@inspectr/mcplab 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,249 +0,0 @@
1
- function AU(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(r,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}}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 a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();var Wp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ay={exports:{}},Hu={},sy={exports:{}},Rt={};var dE;function _U(){if(dE)return Rt;dE=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function x(B){return B===null||typeof B!="object"?null:(B=p&&B[p]||B["@@iterator"],typeof B=="function"?B:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,b={};function y(B,L,te){this.props=B,this.context=L,this.refs=b,this.updater=te||g}y.prototype.isReactComponent={},y.prototype.setState=function(B,L){if(typeof B!="object"&&typeof B!="function"&&B!=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,B,L,"setState")},y.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function S(){}S.prototype=y.prototype;function C(B,L,te){this.props=B,this.context=L,this.refs=b,this.updater=te||g}var N=C.prototype=new S;N.constructor=C,j(N,y.prototype),N.isPureReactComponent=!0;var E=Array.isArray,_=Object.prototype.hasOwnProperty,P={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function T(B,L,te){var ie,G={},de=null,oe=null;if(L!=null)for(ie in L.ref!==void 0&&(oe=L.ref),L.key!==void 0&&(de=""+L.key),L)_.call(L,ie)&&!O.hasOwnProperty(ie)&&(G[ie]=L[ie]);var ce=arguments.length-2;if(ce===1)G.children=te;else if(1<ce){for(var le=Array(ce),fe=0;fe<ce;fe++)le[fe]=arguments[fe+2];G.children=le}if(B&&B.defaultProps)for(ie in ce=B.defaultProps,ce)G[ie]===void 0&&(G[ie]=ce[ie]);return{$$typeof:e,type:B,key:de,ref:oe,props:G,_owner:P.current}}function I(B,L){return{$$typeof:e,type:B.type,key:L,ref:B.ref,props:B.props,_owner:B._owner}}function M(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function D(B){var L={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(te){return L[te]})}var R=/\/+/g;function q(B,L){return typeof B=="object"&&B!==null&&B.key!=null?D(""+B.key):L.toString(36)}function U(B,L,te,ie,G){var de=typeof B;(de==="undefined"||de==="boolean")&&(B=null);var oe=!1;if(B===null)oe=!0;else switch(de){case"string":case"number":oe=!0;break;case"object":switch(B.$$typeof){case e:case t:oe=!0}}if(oe)return oe=B,G=G(oe),B=ie===""?"."+q(oe,0):ie,E(G)?(te="",B!=null&&(te=B.replace(R,"$&/")+"/"),U(G,L,te,"",function(fe){return fe})):G!=null&&(M(G)&&(G=I(G,te+(!G.key||oe&&oe.key===G.key?"":(""+G.key).replace(R,"$&/")+"/")+B)),L.push(G)),1;if(oe=0,ie=ie===""?".":ie+":",E(B))for(var ce=0;ce<B.length;ce++){de=B[ce];var le=ie+q(de,ce);oe+=U(de,L,te,le,G)}else if(le=x(B),typeof le=="function")for(B=le.call(B),ce=0;!(de=B.next()).done;)de=de.value,le=ie+q(de,ce++),oe+=U(de,L,te,le,G);else if(de==="object")throw L=String(B),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.");return oe}function H(B,L,te){if(B==null)return B;var ie=[],G=0;return U(B,ie,"","",function(de){return L.call(te,de,G++)}),ie}function J(B){if(B._status===-1){var L=B._result;L=L(),L.then(function(te){(B._status===0||B._status===-1)&&(B._status=1,B._result=te)},function(te){(B._status===0||B._status===-1)&&(B._status=2,B._result=te)}),B._status===-1&&(B._status=0,B._result=L)}if(B._status===1)return B._result.default;throw B._result}var Z={current:null},F={transition:null},z={ReactCurrentDispatcher:Z,ReactCurrentBatchConfig:F,ReactCurrentOwner:P};function ee(){throw Error("act(...) is not supported in production builds of React.")}return Rt.Children={map:H,forEach:function(B,L,te){H(B,function(){L.apply(this,arguments)},te)},count:function(B){var L=0;return H(B,function(){L++}),L},toArray:function(B){return H(B,function(L){return L})||[]},only:function(B){if(!M(B))throw Error("React.Children.only expected to receive a single React element child.");return B}},Rt.Component=y,Rt.Fragment=n,Rt.Profiler=a,Rt.PureComponent=C,Rt.StrictMode=r,Rt.Suspense=d,Rt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=z,Rt.act=ee,Rt.cloneElement=function(B,L,te){if(B==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+B+".");var ie=j({},B.props),G=B.key,de=B.ref,oe=B._owner;if(L!=null){if(L.ref!==void 0&&(de=L.ref,oe=P.current),L.key!==void 0&&(G=""+L.key),B.type&&B.type.defaultProps)var ce=B.type.defaultProps;for(le in L)_.call(L,le)&&!O.hasOwnProperty(le)&&(ie[le]=L[le]===void 0&&ce!==void 0?ce[le]:L[le])}var le=arguments.length-2;if(le===1)ie.children=te;else if(1<le){ce=Array(le);for(var fe=0;fe<le;fe++)ce[fe]=arguments[fe+2];ie.children=ce}return{$$typeof:e,type:B.type,key:G,ref:de,props:ie,_owner:oe}},Rt.createContext=function(B){return B={$$typeof:o,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},B.Provider={$$typeof:i,_context:B},B.Consumer=B},Rt.createElement=T,Rt.createFactory=function(B){var L=T.bind(null,B);return L.type=B,L},Rt.createRef=function(){return{current:null}},Rt.forwardRef=function(B){return{$$typeof:c,render:B}},Rt.isValidElement=M,Rt.lazy=function(B){return{$$typeof:h,_payload:{_status:-1,_result:B},_init:J}},Rt.memo=function(B,L){return{$$typeof:f,type:B,compare:L===void 0?null:L}},Rt.startTransition=function(B){var L=F.transition;F.transition={};try{B()}finally{F.transition=L}},Rt.unstable_act=ee,Rt.useCallback=function(B,L){return Z.current.useCallback(B,L)},Rt.useContext=function(B){return Z.current.useContext(B)},Rt.useDebugValue=function(){},Rt.useDeferredValue=function(B){return Z.current.useDeferredValue(B)},Rt.useEffect=function(B,L){return Z.current.useEffect(B,L)},Rt.useId=function(){return Z.current.useId()},Rt.useImperativeHandle=function(B,L,te){return Z.current.useImperativeHandle(B,L,te)},Rt.useInsertionEffect=function(B,L){return Z.current.useInsertionEffect(B,L)},Rt.useLayoutEffect=function(B,L){return Z.current.useLayoutEffect(B,L)},Rt.useMemo=function(B,L){return Z.current.useMemo(B,L)},Rt.useReducer=function(B,L,te){return Z.current.useReducer(B,L,te)},Rt.useRef=function(B){return Z.current.useRef(B)},Rt.useState=function(B){return Z.current.useState(B)},Rt.useSyncExternalStore=function(B,L,te){return Z.current.useSyncExternalStore(B,L,te)},Rt.useTransition=function(){return Z.current.useTransition()},Rt.version="18.3.1",Rt}var fE;function qS(){return fE||(fE=1,sy.exports=_U()),sy.exports}var pE;function EU(){if(pE)return Hu;pE=1;var e=qS(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function o(c,d,f){var h,p={},x=null,g=null;f!==void 0&&(x=""+f),d.key!==void 0&&(x=""+d.key),d.ref!==void 0&&(g=d.ref);for(h in d)r.call(d,h)&&!i.hasOwnProperty(h)&&(p[h]=d[h]);if(c&&c.defaultProps)for(h in d=c.defaultProps,d)p[h]===void 0&&(p[h]=d[h]);return{$$typeof:t,type:c,key:x,ref:g,props:p,_owner:a.current}}return Hu.Fragment=n,Hu.jsx=o,Hu.jsxs=o,Hu}var hE;function PU(){return hE||(hE=1,ay.exports=EU()),ay.exports}var s=PU(),Vp={},iy={exports:{}},Rr={},oy={exports:{}},ly={};var mE;function kU(){return mE||(mE=1,(function(e){function t(F,z){var ee=F.length;F.push(z);e:for(;0<ee;){var B=ee-1>>>1,L=F[B];if(0<a(L,z))F[B]=z,F[ee]=L,ee=B;else break e}}function n(F){return F.length===0?null:F[0]}function r(F){if(F.length===0)return null;var z=F[0],ee=F.pop();if(ee!==z){F[0]=ee;e:for(var B=0,L=F.length,te=L>>>1;B<te;){var ie=2*(B+1)-1,G=F[ie],de=ie+1,oe=F[de];if(0>a(G,ee))de<L&&0>a(oe,G)?(F[B]=oe,F[de]=ee,B=de):(F[B]=G,F[ie]=ee,B=ie);else if(de<L&&0>a(oe,ee))F[B]=oe,F[de]=ee,B=de;else break e}}return z}function a(F,z){var ee=F.sortIndex-z.sortIndex;return ee!==0?ee:F.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,c=o.now();e.unstable_now=function(){return o.now()-c}}var d=[],f=[],h=1,p=null,x=3,g=!1,j=!1,b=!1,y=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function N(F){for(var z=n(f);z!==null;){if(z.callback===null)r(f);else if(z.startTime<=F)r(f),z.sortIndex=z.expirationTime,t(d,z);else break;z=n(f)}}function E(F){if(b=!1,N(F),!j)if(n(d)!==null)j=!0,J(_);else{var z=n(f);z!==null&&Z(E,z.startTime-F)}}function _(F,z){j=!1,b&&(b=!1,S(T),T=-1),g=!0;var ee=x;try{for(N(z),p=n(d);p!==null&&(!(p.expirationTime>z)||F&&!D());){var B=p.callback;if(typeof B=="function"){p.callback=null,x=p.priorityLevel;var L=B(p.expirationTime<=z);z=e.unstable_now(),typeof L=="function"?p.callback=L:p===n(d)&&r(d),N(z)}else r(d);p=n(d)}if(p!==null)var te=!0;else{var ie=n(f);ie!==null&&Z(E,ie.startTime-z),te=!1}return te}finally{p=null,x=ee,g=!1}}var P=!1,O=null,T=-1,I=5,M=-1;function D(){return!(e.unstable_now()-M<I)}function R(){if(O!==null){var F=e.unstable_now();M=F;var z=!0;try{z=O(!0,F)}finally{z?q():(P=!1,O=null)}}else P=!1}var q;if(typeof C=="function")q=function(){C(R)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,H=U.port2;U.port1.onmessage=R,q=function(){H.postMessage(null)}}else q=function(){y(R,0)};function J(F){O=F,P||(P=!0,q())}function Z(F,z){T=y(function(){F(e.unstable_now())},z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(F){F.callback=null},e.unstable_continueExecution=function(){j||g||(j=!0,J(_))},e.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<F?Math.floor(1e3/F):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(F){switch(x){case 1:case 2:case 3:var z=3;break;default:z=x}var ee=x;x=z;try{return F()}finally{x=ee}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(F,z){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var ee=x;x=F;try{return z()}finally{x=ee}},e.unstable_scheduleCallback=function(F,z,ee){var B=e.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?B+ee:B):ee=B,F){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=ee+L,F={id:h++,callback:z,priorityLevel:F,startTime:ee,expirationTime:L,sortIndex:-1},ee>B?(F.sortIndex=ee,t(f,F),n(d)===null&&F===n(f)&&(b?(S(T),T=-1):b=!0,Z(E,ee-B))):(F.sortIndex=L,t(d,F),j||g||(j=!0,J(_))),F},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(F){var z=x;return function(){var ee=x;x=z;try{return F.apply(this,arguments)}finally{x=ee}}}})(ly)),ly}var vE;function OU(){return vE||(vE=1,oy.exports=kU()),oy.exports}var gE;function TU(){if(gE)return Rr;gE=1;var e=qS(),t=OU();function n(l){for(var u="https://reactjs.org/docs/error-decoder.html?invariant="+l,m=1;m<arguments.length;m++)u+="&args[]="+encodeURIComponent(arguments[m]);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,a={};function i(l,u){o(l,u),o(l+"Capture",u)}function o(l,u){for(a[l]=u,l=0;l<u.length;l++)r.add(u[l])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,h={},p={};function x(l){return d.call(p,l)?!0:d.call(h,l)?!1:f.test(l)?p[l]=!0:(h[l]=!0,!1)}function g(l,u,m,w){if(m!==null&&m.type===0)return!1;switch(typeof u){case"function":case"symbol":return!0;case"boolean":return w?!1:m!==null?!m.acceptsBooleans:(l=l.toLowerCase().slice(0,5),l!=="data-"&&l!=="aria-");default:return!1}}function j(l,u,m,w){if(u===null||typeof u>"u"||g(l,u,m,w))return!0;if(w)return!1;if(m!==null)switch(m.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,m,w,A,k,$){this.acceptsBooleans=u===2||u===3||u===4,this.attributeName=w,this.attributeNamespace=A,this.mustUseProperty=m,this.propertyName=l,this.type=u,this.sanitizeURL=k,this.removeEmptyString=$}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,m,w){var A=y.hasOwnProperty(u)?y[u]:null;(A!==null?A.type!==0:w||!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(j(u,m,A,w)&&(m=null),w||A===null?x(u)&&(m===null?l.removeAttribute(u):l.setAttribute(u,""+m)):A.mustUseProperty?l[A.propertyName]=m===null?A.type===3?!1:"":m:(u=A.attributeName,w=A.attributeNamespace,m===null?l.removeAttribute(u):(A=A.type,m=A===3||A===4&&m===!0?"":""+m,w?l.setAttributeNS(w,u,m):l.setAttribute(u,m))))}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,_=Symbol.for("react.element"),P=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),I=Symbol.for("react.profiler"),M=Symbol.for("react.provider"),D=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),q=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),J=Symbol.for("react.lazy"),Z=Symbol.for("react.offscreen"),F=Symbol.iterator;function z(l){return l===null||typeof l!="object"?null:(l=F&&l[F]||l["@@iterator"],typeof l=="function"?l:null)}var ee=Object.assign,B;function L(l){if(B===void 0)try{throw Error()}catch(m){var u=m.stack.trim().match(/\n( *(at )?)/);B=u&&u[1]||""}return`
2
- `+B+l}var te=!1;function ie(l,u){if(!l||te)return"";te=!0;var m=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(ve){var w=ve}Reflect.construct(l,[],u)}else{try{u.call()}catch(ve){w=ve}l.call(u.prototype)}else{try{throw Error()}catch(ve){w=ve}l()}}catch(ve){if(ve&&w&&typeof ve.stack=="string"){for(var A=ve.stack.split(`
3
- `),k=w.stack.split(`
4
- `),$=A.length-1,X=k.length-1;1<=$&&0<=X&&A[$]!==k[X];)X--;for(;1<=$&&0<=X;$--,X--)if(A[$]!==k[X]){if($!==1||X!==1)do if($--,X--,0>X||A[$]!==k[X]){var ne=`
5
- `+A[$].replace(" at new "," at ");return l.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",l.displayName)),ne}while(1<=$&&0<=X);break}}}finally{te=!1,Error.prepareStackTrace=m}return(l=l?l.displayName||l.name:"")?L(l):""}function G(l){switch(l.tag){case 5:return L(l.type);case 16:return L("Lazy");case 13:return L("Suspense");case 19:return L("SuspenseList");case 0:case 2:case 15:return l=ie(l.type,!1),l;case 11:return l=ie(l.type.render,!1),l;case 1:return l=ie(l.type,!0),l;default:return""}}function de(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case O:return"Fragment";case P:return"Portal";case I:return"Profiler";case T:return"StrictMode";case q:return"Suspense";case U:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case D:return(l.displayName||"Context")+".Consumer";case M:return(l._context.displayName||"Context")+".Provider";case R:var u=l.render;return l=l.displayName,l||(l=u.displayName||u.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case H:return u=l.displayName||null,u!==null?u:de(l.type)||"Memo";case J:u=l._payload,l=l._init;try{return de(l(u))}catch{}}return null}function oe(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 de(u);case 8:return u===T?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u}return null}function ce(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function le(l){var u=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function fe(l){var u=le(l)?"checked":"value",m=Object.getOwnPropertyDescriptor(l.constructor.prototype,u),w=""+l[u];if(!l.hasOwnProperty(u)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var A=m.get,k=m.set;return Object.defineProperty(l,u,{configurable:!0,get:function(){return A.call(this)},set:function($){w=""+$,k.call(this,$)}}),Object.defineProperty(l,u,{enumerable:m.enumerable}),{getValue:function(){return w},setValue:function($){w=""+$},stopTracking:function(){l._valueTracker=null,delete l[u]}}}}function Ce(l){l._valueTracker||(l._valueTracker=fe(l))}function ae(l){if(!l)return!1;var u=l._valueTracker;if(!u)return!0;var m=u.getValue(),w="";return l&&(w=le(l)?l.checked?"true":"false":l.value),l=w,l!==m?(u.setValue(l),!0):!1}function ke(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 Ae(l,u){var m=u.checked;return ee({},u,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:m??l._wrapperState.initialChecked})}function Ye(l,u){var m=u.defaultValue==null?"":u.defaultValue,w=u.checked!=null?u.checked:u.defaultChecked;m=ce(u.value!=null?u.value:m),l._wrapperState={initialChecked:w,initialValue:m,controlled:u.type==="checkbox"||u.type==="radio"?u.checked!=null:u.value!=null}}function be(l,u){u=u.checked,u!=null&&N(l,"checked",u,!1)}function Re(l,u){be(l,u);var m=ce(u.value),w=u.type;if(m!=null)w==="number"?(m===0&&l.value===""||l.value!=m)&&(l.value=""+m):l.value!==""+m&&(l.value=""+m);else if(w==="submit"||w==="reset"){l.removeAttribute("value");return}u.hasOwnProperty("value")?xe(l,u.type,m):u.hasOwnProperty("defaultValue")&&xe(l,u.type,ce(u.defaultValue)),u.checked==null&&u.defaultChecked!=null&&(l.defaultChecked=!!u.defaultChecked)}function Y(l,u,m){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,m||u===l.value||(l.value=u),l.defaultValue=u}m=l.name,m!==""&&(l.name=""),l.defaultChecked=!!l._wrapperState.initialChecked,m!==""&&(l.name=m)}function xe(l,u,m){(u!=="number"||ke(l.ownerDocument)!==l)&&(m==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+m&&(l.defaultValue=""+m))}var ue=Array.isArray;function Oe(l,u,m,w){if(l=l.options,u){u={};for(var A=0;A<m.length;A++)u["$"+m[A]]=!0;for(m=0;m<l.length;m++)A=u.hasOwnProperty("$"+l[m].value),l[m].selected!==A&&(l[m].selected=A),A&&w&&(l[m].defaultSelected=!0)}else{for(m=""+ce(m),u=null,A=0;A<l.length;A++){if(l[A].value===m){l[A].selected=!0,w&&(l[A].defaultSelected=!0);return}u!==null||l[A].disabled||(u=l[A])}u!==null&&(u.selected=!0)}}function Ke(l,u){if(u.dangerouslySetInnerHTML!=null)throw Error(n(91));return ee({},u,{value:void 0,defaultValue:void 0,children:""+l._wrapperState.initialValue})}function bt(l,u){var m=u.value;if(m==null){if(m=u.children,u=u.defaultValue,m!=null){if(u!=null)throw Error(n(92));if(ue(m)){if(1<m.length)throw Error(n(93));m=m[0]}u=m}u==null&&(u=""),m=u}l._wrapperState={initialValue:ce(m)}}function It(l,u){var m=ce(u.value),w=ce(u.defaultValue);m!=null&&(m=""+m,m!==l.value&&(l.value=m),u.defaultValue==null&&l.defaultValue!==m&&(l.defaultValue=m)),w!=null&&(l.defaultValue=""+w)}function Q(l){var u=l.textContent;u===l._wrapperState.initialValue&&u!==""&&u!==null&&(l.value=u)}function je(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 Ne(l,u){return l==null||l==="http://www.w3.org/1999/xhtml"?je(u):l==="http://www.w3.org/2000/svg"&&u==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var $e,Be=(function(l){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(u,m,w,A){MSApp.execUnsafeLocalFunction(function(){return l(u,m,w,A)})}:l})(function(l,u){if(l.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in l)l.innerHTML=u;else{for($e=$e||document.createElement("div"),$e.innerHTML="<svg>"+u.valueOf().toString()+"</svg>",u=$e.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;u.firstChild;)l.appendChild(u.firstChild)}});function et(l,u){if(u){var m=l.firstChild;if(m&&m===l.lastChild&&m.nodeType===3){m.nodeValue=u;return}}l.textContent=u}var Pt={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},Sn=["Webkit","ms","Moz","O"];Object.keys(Pt).forEach(function(l){Sn.forEach(function(u){u=u+l.charAt(0).toUpperCase()+l.substring(1),Pt[u]=Pt[l]})});function Nn(l,u,m){return u==null||typeof u=="boolean"||u===""?"":m||typeof u!="number"||u===0||Pt.hasOwnProperty(l)&&Pt[l]?(""+u).trim():u+"px"}function cr(l,u){l=l.style;for(var m in u)if(u.hasOwnProperty(m)){var w=m.indexOf("--")===0,A=Nn(m,u[m],w);m==="float"&&(m="cssFloat"),w?l.setProperty(m,A):l[m]=A}}var ur=ee({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 Dn(l,u){if(u){if(ur[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 dr(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 _r=null;function Ur(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var qr=null,Yn=null,Xt=null;function En(l){if(l=Ou(l)){if(typeof qr!="function")throw Error(n(280));var u=l.stateNode;u&&(u=sp(u),qr(l.stateNode,l.type,u))}}function pe(l){Yn?Xt?Xt.push(l):Xt=[l]:Yn=l}function De(){if(Yn){var l=Yn,u=Xt;if(Xt=Yn=null,En(l),u)for(l=0;l<u.length;l++)En(u[l])}}function st(l,u){return l(u)}function yt(){}var Lt=!1;function nn(l,u,m){if(Lt)return l(u,m);Lt=!0;try{return st(l,u,m)}finally{Lt=!1,(Yn!==null||Xt!==null)&&(yt(),De())}}function ln(l,u){var m=l.stateNode;if(m===null)return null;var w=sp(m);if(w===null)return null;m=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(m&&typeof m!="function")throw Error(n(231,u,typeof m));return m}var Xn=!1;if(c)try{var Cn={};Object.defineProperty(Cn,"passive",{get:function(){Xn=!0}}),window.addEventListener("test",Cn,Cn),window.removeEventListener("test",Cn,Cn)}catch{Xn=!1}function rr(l,u,m,w,A,k,$,X,ne){var ve=Array.prototype.slice.call(arguments,3);try{u.apply(m,ve)}catch(Ee){this.onError(Ee)}}var fr=!1,Wr=null,ci=!1,ui=null,cl={onError:function(l){fr=!0,Wr=l}};function K(l,u,m,w,A,k,$,X,ne){fr=!1,Wr=null,rr.apply(cl,arguments)}function ge(l,u,m,w,A,k,$,X,ne){if(K.apply(this,arguments),fr){if(fr){var ve=Wr;fr=!1,Wr=null}else throw Error(n(198));ci||(ci=!0,ui=ve)}}function Ve(l){var u=l,m=l;if(l.alternate)for(;u.return;)u=u.return;else{l=u;do u=l,(u.flags&4098)!==0&&(m=u.return),l=u.return;while(l)}return u.tag===3?m:null}function ct(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 Ot(l){if(Ve(l)!==l)throw Error(n(188))}function Mt(l){var u=l.alternate;if(!u){if(u=Ve(l),u===null)throw Error(n(188));return u!==l?null:l}for(var m=l,w=u;;){var A=m.return;if(A===null)break;var k=A.alternate;if(k===null){if(w=A.return,w!==null){m=w;continue}break}if(A.child===k.child){for(k=A.child;k;){if(k===m)return Ot(A),l;if(k===w)return Ot(A),u;k=k.sibling}throw Error(n(188))}if(m.return!==w.return)m=A,w=k;else{for(var $=!1,X=A.child;X;){if(X===m){$=!0,m=A,w=k;break}if(X===w){$=!0,w=A,m=k;break}X=X.sibling}if(!$){for(X=k.child;X;){if(X===m){$=!0,m=k,w=A;break}if(X===w){$=!0,w=k,m=A;break}X=X.sibling}if(!$)throw Error(n(189))}}if(m.alternate!==w)throw Error(n(190))}if(m.tag!==3)throw Error(n(188));return m.stateNode.current===m?l:u}function Tt(l){return l=Mt(l),l!==null?Pn(l):null}function Pn(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var u=Pn(l);if(u!==null)return u;l=l.sibling}return null}var He=t.unstable_scheduleCallback,Vt=t.unstable_cancelCallback,Ft=t.unstable_shouldYield,kn=t.unstable_requestPaint,cn=t.unstable_now,Ng=t.unstable_getCurrentPriorityLevel,ul=t.unstable_ImmediatePriority,Bf=t.unstable_UserBlockingPriority,di=t.unstable_NormalPriority,zf=t.unstable_LowPriority,hu=t.unstable_IdlePriority,ks=null,la=null;function Cg(l){if(la&&typeof la.onCommitFiberRoot=="function")try{la.onCommitFiberRoot(ks,l,void 0,(l.current.flags&128)===128)}catch{}}var Vr=Math.clz32?Math.clz32:_g,Uf=Math.log,Ag=Math.LN2;function _g(l){return l>>>=0,l===0?32:31-(Uf(l)/Ag|0)|0}var dl=64,fl=4194304;function V(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 ye(l,u){var m=l.pendingLanes;if(m===0)return 0;var w=0,A=l.suspendedLanes,k=l.pingedLanes,$=m&268435455;if($!==0){var X=$&~A;X!==0?w=V(X):(k&=$,k!==0&&(w=V(k)))}else $=m&~A,$!==0?w=V($):k!==0&&(w=V(k));if(w===0)return 0;if(u!==0&&u!==w&&(u&A)===0&&(A=w&-w,k=u&-u,A>=k||A===16&&(k&4194240)!==0))return u;if((w&4)!==0&&(w|=m&16),u=l.entangledLanes,u!==0)for(l=l.entanglements,u&=w;0<u;)m=31-Vr(u),A=1<<m,w|=l[m],u&=~A;return w}function rt(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 Me(l,u){for(var m=l.suspendedLanes,w=l.pingedLanes,A=l.expirationTimes,k=l.pendingLanes;0<k;){var $=31-Vr(k),X=1<<$,ne=A[$];ne===-1?((X&m)===0||(X&w)!==0)&&(A[$]=rt(X,u)):ne<=u&&(l.expiredLanes|=X),k&=~X}}function kt(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function dt(){var l=dl;return dl<<=1,(dl&4194240)===0&&(dl=64),l}function Ht(l){for(var u=[],m=0;31>m;m++)u.push(l);return u}function Ln(l,u,m){l.pendingLanes|=u,u!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,u=31-Vr(u),l[u]=m}function Qt(l,u){var m=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<m;){var A=31-Vr(m),k=1<<A;u[A]=0,w[A]=-1,l[A]=-1,m&=~k}}function ca(l,u){var m=l.entangledLanes|=u;for(l=l.entanglements;m;){var w=31-Vr(m),A=1<<w;A&u|l[w]&u&&(l[w]|=u),m&=~A}}var zt=0;function qf(l){return l&=-l,1<l?4<l?(l&268435455)!==0?16:536870912:4:1}var pl,Eg,VC,HC,KC,Pg=!1,Wf=[],fi=null,pi=null,hi=null,mu=new Map,vu=new Map,mi=[],G8="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 GC(l,u){switch(l){case"focusin":case"focusout":fi=null;break;case"dragenter":case"dragleave":pi=null;break;case"mouseover":case"mouseout":hi=null;break;case"pointerover":case"pointerout":mu.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":vu.delete(u.pointerId)}}function gu(l,u,m,w,A,k){return l===null||l.nativeEvent!==k?(l={blockedOn:u,domEventName:m,eventSystemFlags:w,nativeEvent:k,targetContainers:[A]},u!==null&&(u=Ou(u),u!==null&&Eg(u)),l):(l.eventSystemFlags|=w,u=l.targetContainers,A!==null&&u.indexOf(A)===-1&&u.push(A),l)}function Y8(l,u,m,w,A){switch(u){case"focusin":return fi=gu(fi,l,u,m,w,A),!0;case"dragenter":return pi=gu(pi,l,u,m,w,A),!0;case"mouseover":return hi=gu(hi,l,u,m,w,A),!0;case"pointerover":var k=A.pointerId;return mu.set(k,gu(mu.get(k)||null,l,u,m,w,A)),!0;case"gotpointercapture":return k=A.pointerId,vu.set(k,gu(vu.get(k)||null,l,u,m,w,A)),!0}return!1}function YC(l){var u=ao(l.target);if(u!==null){var m=Ve(u);if(m!==null){if(u=m.tag,u===13){if(u=ct(m),u!==null){l.blockedOn=u,KC(l.priority,function(){VC(m)});return}}else if(u===3&&m.stateNode.current.memoizedState.isDehydrated){l.blockedOn=m.tag===3?m.stateNode.containerInfo:null;return}}}l.blockedOn=null}function Vf(l){if(l.blockedOn!==null)return!1;for(var u=l.targetContainers;0<u.length;){var m=Og(l.domEventName,l.eventSystemFlags,u[0],l.nativeEvent);if(m===null){m=l.nativeEvent;var w=new m.constructor(m.type,m);_r=w,m.target.dispatchEvent(w),_r=null}else return u=Ou(m),u!==null&&Eg(u),l.blockedOn=m,!1;u.shift()}return!0}function XC(l,u,m){Vf(l)&&m.delete(u)}function X8(){Pg=!1,fi!==null&&Vf(fi)&&(fi=null),pi!==null&&Vf(pi)&&(pi=null),hi!==null&&Vf(hi)&&(hi=null),mu.forEach(XC),vu.forEach(XC)}function xu(l,u){l.blockedOn===u&&(l.blockedOn=null,Pg||(Pg=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,X8)))}function yu(l){function u(A){return xu(A,l)}if(0<Wf.length){xu(Wf[0],l);for(var m=1;m<Wf.length;m++){var w=Wf[m];w.blockedOn===l&&(w.blockedOn=null)}}for(fi!==null&&xu(fi,l),pi!==null&&xu(pi,l),hi!==null&&xu(hi,l),mu.forEach(u),vu.forEach(u),m=0;m<mi.length;m++)w=mi[m],w.blockedOn===l&&(w.blockedOn=null);for(;0<mi.length&&(m=mi[0],m.blockedOn===null);)YC(m),m.blockedOn===null&&mi.shift()}var hl=E.ReactCurrentBatchConfig,Hf=!0;function Q8(l,u,m,w){var A=zt,k=hl.transition;hl.transition=null;try{zt=1,kg(l,u,m,w)}finally{zt=A,hl.transition=k}}function J8(l,u,m,w){var A=zt,k=hl.transition;hl.transition=null;try{zt=4,kg(l,u,m,w)}finally{zt=A,hl.transition=k}}function kg(l,u,m,w){if(Hf){var A=Og(l,u,m,w);if(A===null)Gg(l,u,w,Kf,m),GC(l,w);else if(Y8(A,l,u,m,w))w.stopPropagation();else if(GC(l,w),u&4&&-1<G8.indexOf(l)){for(;A!==null;){var k=Ou(A);if(k!==null&&pl(k),k=Og(l,u,m,w),k===null&&Gg(l,u,w,Kf,m),k===A)break;A=k}A!==null&&w.stopPropagation()}else Gg(l,u,w,null,m)}}var Kf=null;function Og(l,u,m,w){if(Kf=null,l=Ur(w),l=ao(l),l!==null)if(u=Ve(l),u===null)l=null;else if(m=u.tag,m===13){if(l=ct(u),l!==null)return l;l=null}else if(m===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;l=null}else u!==l&&(l=null);return Kf=l,null}function QC(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(Ng()){case ul:return 1;case Bf:return 4;case di:case zf:return 16;case hu:return 536870912;default:return 16}default:return 16}}var vi=null,Tg=null,Gf=null;function JC(){if(Gf)return Gf;var l,u=Tg,m=u.length,w,A="value"in vi?vi.value:vi.textContent,k=A.length;for(l=0;l<m&&u[l]===A[l];l++);var $=m-l;for(w=1;w<=$&&u[m-w]===A[k-w];w++);return Gf=A.slice(l,1<w?1-w:void 0)}function Yf(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 Xf(){return!0}function ZC(){return!1}function Hr(l){function u(m,w,A,k,$){this._reactName=m,this._targetInst=A,this.type=w,this.nativeEvent=k,this.target=$,this.currentTarget=null;for(var X in l)l.hasOwnProperty(X)&&(m=l[X],this[X]=m?m(k):k[X]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?Xf:ZC,this.isPropagationStopped=ZC,this}return ee(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var m=this.nativeEvent;m&&(m.preventDefault?m.preventDefault():typeof m.returnValue!="unknown"&&(m.returnValue=!1),this.isDefaultPrevented=Xf)},stopPropagation:function(){var m=this.nativeEvent;m&&(m.stopPropagation?m.stopPropagation():typeof m.cancelBubble!="unknown"&&(m.cancelBubble=!0),this.isPropagationStopped=Xf)},persist:function(){},isPersistent:Xf}),u}var ml={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Rg=Hr(ml),bu=ee({},ml,{view:0,detail:0}),Z8=Hr(bu),Ig,Mg,wu,Qf=ee({},bu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Dg,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!==wu&&(wu&&l.type==="mousemove"?(Ig=l.screenX-wu.screenX,Mg=l.screenY-wu.screenY):Mg=Ig=0,wu=l),Ig)},movementY:function(l){return"movementY"in l?l.movementY:Mg}}),eA=Hr(Qf),e6=ee({},Qf,{dataTransfer:0}),t6=Hr(e6),n6=ee({},bu,{relatedTarget:0}),$g=Hr(n6),r6=ee({},ml,{animationName:0,elapsedTime:0,pseudoElement:0}),a6=Hr(r6),s6=ee({},ml,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),i6=Hr(s6),o6=ee({},ml,{data:0}),tA=Hr(o6),l6={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},c6={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"},u6={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function d6(l){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(l):(l=u6[l])?!!u[l]:!1}function Dg(){return d6}var f6=ee({},bu,{key:function(l){if(l.key){var u=l6[l.key]||l.key;if(u!=="Unidentified")return u}return l.type==="keypress"?(l=Yf(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?c6[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Dg,charCode:function(l){return l.type==="keypress"?Yf(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?Yf(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),p6=Hr(f6),h6=ee({},Qf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),nA=Hr(h6),m6=ee({},bu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dg}),v6=Hr(m6),g6=ee({},ml,{propertyName:0,elapsedTime:0,pseudoElement:0}),x6=Hr(g6),y6=ee({},Qf,{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}),b6=Hr(y6),w6=[9,13,27,32],Lg=c&&"CompositionEvent"in window,ju=null;c&&"documentMode"in document&&(ju=document.documentMode);var j6=c&&"TextEvent"in window&&!ju,rA=c&&(!Lg||ju&&8<ju&&11>=ju),aA=" ",sA=!1;function iA(l,u){switch(l){case"keyup":return w6.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function oA(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var vl=!1;function S6(l,u){switch(l){case"compositionend":return oA(u);case"keypress":return u.which!==32?null:(sA=!0,aA);case"textInput":return l=u.data,l===aA&&sA?null:l;default:return null}}function N6(l,u){if(vl)return l==="compositionend"||!Lg&&iA(l,u)?(l=JC(),Gf=Tg=vi=null,vl=!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 rA&&u.locale!=="ko"?null:u.data;default:return null}}var C6={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 lA(l){var u=l&&l.nodeName&&l.nodeName.toLowerCase();return u==="input"?!!C6[l.type]:u==="textarea"}function cA(l,u,m,w){pe(w),u=np(u,"onChange"),0<u.length&&(m=new Rg("onChange","change",null,m,w),l.push({event:m,listeners:u}))}var Su=null,Nu=null;function A6(l){_A(l,0)}function Jf(l){var u=wl(l);if(ae(u))return l}function _6(l,u){if(l==="change")return u}var uA=!1;if(c){var Fg;if(c){var Bg="oninput"in document;if(!Bg){var dA=document.createElement("div");dA.setAttribute("oninput","return;"),Bg=typeof dA.oninput=="function"}Fg=Bg}else Fg=!1;uA=Fg&&(!document.documentMode||9<document.documentMode)}function fA(){Su&&(Su.detachEvent("onpropertychange",pA),Nu=Su=null)}function pA(l){if(l.propertyName==="value"&&Jf(Nu)){var u=[];cA(u,Nu,l,Ur(l)),nn(A6,u)}}function E6(l,u,m){l==="focusin"?(fA(),Su=u,Nu=m,Su.attachEvent("onpropertychange",pA)):l==="focusout"&&fA()}function P6(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return Jf(Nu)}function k6(l,u){if(l==="click")return Jf(u)}function O6(l,u){if(l==="input"||l==="change")return Jf(u)}function T6(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var Oa=typeof Object.is=="function"?Object.is:T6;function Cu(l,u){if(Oa(l,u))return!0;if(typeof l!="object"||l===null||typeof u!="object"||u===null)return!1;var m=Object.keys(l),w=Object.keys(u);if(m.length!==w.length)return!1;for(w=0;w<m.length;w++){var A=m[w];if(!d.call(u,A)||!Oa(l[A],u[A]))return!1}return!0}function hA(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function mA(l,u){var m=hA(l);l=0;for(var w;m;){if(m.nodeType===3){if(w=l+m.textContent.length,l<=u&&w>=u)return{node:m,offset:u-l};l=w}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=hA(m)}}function vA(l,u){return l&&u?l===u?!0:l&&l.nodeType===3?!1:u&&u.nodeType===3?vA(l,u.parentNode):"contains"in l?l.contains(u):l.compareDocumentPosition?!!(l.compareDocumentPosition(u)&16):!1:!1}function gA(){for(var l=window,u=ke();u instanceof l.HTMLIFrameElement;){try{var m=typeof u.contentWindow.location.href=="string"}catch{m=!1}if(m)l=u.contentWindow;else break;u=ke(l.document)}return u}function zg(l){var u=l&&l.nodeName&&l.nodeName.toLowerCase();return u&&(u==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||u==="textarea"||l.contentEditable==="true")}function R6(l){var u=gA(),m=l.focusedElem,w=l.selectionRange;if(u!==m&&m&&m.ownerDocument&&vA(m.ownerDocument.documentElement,m)){if(w!==null&&zg(m)){if(u=w.start,l=w.end,l===void 0&&(l=u),"selectionStart"in m)m.selectionStart=u,m.selectionEnd=Math.min(l,m.value.length);else if(l=(u=m.ownerDocument||document)&&u.defaultView||window,l.getSelection){l=l.getSelection();var A=m.textContent.length,k=Math.min(w.start,A);w=w.end===void 0?k:Math.min(w.end,A),!l.extend&&k>w&&(A=w,w=k,k=A),A=mA(m,k);var $=mA(m,w);A&&$&&(l.rangeCount!==1||l.anchorNode!==A.node||l.anchorOffset!==A.offset||l.focusNode!==$.node||l.focusOffset!==$.offset)&&(u=u.createRange(),u.setStart(A.node,A.offset),l.removeAllRanges(),k>w?(l.addRange(u),l.extend($.node,$.offset)):(u.setEnd($.node,$.offset),l.addRange(u)))}}for(u=[],l=m;l=l.parentNode;)l.nodeType===1&&u.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m<u.length;m++)l=u[m],l.element.scrollLeft=l.left,l.element.scrollTop=l.top}}var I6=c&&"documentMode"in document&&11>=document.documentMode,gl=null,Ug=null,Au=null,qg=!1;function xA(l,u,m){var w=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;qg||gl==null||gl!==ke(w)||(w=gl,"selectionStart"in w&&zg(w)?w={start:w.selectionStart,end:w.selectionEnd}:(w=(w.ownerDocument&&w.ownerDocument.defaultView||window).getSelection(),w={anchorNode:w.anchorNode,anchorOffset:w.anchorOffset,focusNode:w.focusNode,focusOffset:w.focusOffset}),Au&&Cu(Au,w)||(Au=w,w=np(Ug,"onSelect"),0<w.length&&(u=new Rg("onSelect","select",null,u,m),l.push({event:u,listeners:w}),u.target=gl)))}function Zf(l,u){var m={};return m[l.toLowerCase()]=u.toLowerCase(),m["Webkit"+l]="webkit"+u,m["Moz"+l]="moz"+u,m}var xl={animationend:Zf("Animation","AnimationEnd"),animationiteration:Zf("Animation","AnimationIteration"),animationstart:Zf("Animation","AnimationStart"),transitionend:Zf("Transition","TransitionEnd")},Wg={},yA={};c&&(yA=document.createElement("div").style,"AnimationEvent"in window||(delete xl.animationend.animation,delete xl.animationiteration.animation,delete xl.animationstart.animation),"TransitionEvent"in window||delete xl.transitionend.transition);function ep(l){if(Wg[l])return Wg[l];if(!xl[l])return l;var u=xl[l],m;for(m in u)if(u.hasOwnProperty(m)&&m in yA)return Wg[l]=u[m];return l}var bA=ep("animationend"),wA=ep("animationiteration"),jA=ep("animationstart"),SA=ep("transitionend"),NA=new Map,CA="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 gi(l,u){NA.set(l,u),i(u,[l])}for(var Vg=0;Vg<CA.length;Vg++){var Hg=CA[Vg],M6=Hg.toLowerCase(),$6=Hg[0].toUpperCase()+Hg.slice(1);gi(M6,"on"+$6)}gi(bA,"onAnimationEnd"),gi(wA,"onAnimationIteration"),gi(jA,"onAnimationStart"),gi("dblclick","onDoubleClick"),gi("focusin","onFocus"),gi("focusout","onBlur"),gi(SA,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _u="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(" "),D6=new Set("cancel close invalid load scroll toggle".split(" ").concat(_u));function AA(l,u,m){var w=l.type||"unknown-event";l.currentTarget=m,ge(w,u,void 0,l),l.currentTarget=null}function _A(l,u){u=(u&4)!==0;for(var m=0;m<l.length;m++){var w=l[m],A=w.event;w=w.listeners;e:{var k=void 0;if(u)for(var $=w.length-1;0<=$;$--){var X=w[$],ne=X.instance,ve=X.currentTarget;if(X=X.listener,ne!==k&&A.isPropagationStopped())break e;AA(A,X,ve),k=ne}else for($=0;$<w.length;$++){if(X=w[$],ne=X.instance,ve=X.currentTarget,X=X.listener,ne!==k&&A.isPropagationStopped())break e;AA(A,X,ve),k=ne}}}if(ci)throw l=ui,ci=!1,ui=null,l}function un(l,u){var m=u[ex];m===void 0&&(m=u[ex]=new Set);var w=l+"__bubble";m.has(w)||(EA(u,l,2,!1),m.add(w))}function Kg(l,u,m){var w=0;u&&(w|=4),EA(m,l,w,u)}var tp="_reactListening"+Math.random().toString(36).slice(2);function Eu(l){if(!l[tp]){l[tp]=!0,r.forEach(function(m){m!=="selectionchange"&&(D6.has(m)||Kg(m,!1,l),Kg(m,!0,l))});var u=l.nodeType===9?l:l.ownerDocument;u===null||u[tp]||(u[tp]=!0,Kg("selectionchange",!1,u))}}function EA(l,u,m,w){switch(QC(u)){case 1:var A=Q8;break;case 4:A=J8;break;default:A=kg}m=A.bind(null,u,m,l),A=void 0,!Xn||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(A=!0),w?A!==void 0?l.addEventListener(u,m,{capture:!0,passive:A}):l.addEventListener(u,m,!0):A!==void 0?l.addEventListener(u,m,{passive:A}):l.addEventListener(u,m,!1)}function Gg(l,u,m,w,A){var k=w;if((u&1)===0&&(u&2)===0&&w!==null)e:for(;;){if(w===null)return;var $=w.tag;if($===3||$===4){var X=w.stateNode.containerInfo;if(X===A||X.nodeType===8&&X.parentNode===A)break;if($===4)for($=w.return;$!==null;){var ne=$.tag;if((ne===3||ne===4)&&(ne=$.stateNode.containerInfo,ne===A||ne.nodeType===8&&ne.parentNode===A))return;$=$.return}for(;X!==null;){if($=ao(X),$===null)return;if(ne=$.tag,ne===5||ne===6){w=k=$;continue e}X=X.parentNode}}w=w.return}nn(function(){var ve=k,Ee=Ur(m),Ie=[];e:{var _e=NA.get(l);if(_e!==void 0){var Xe=Rg,nt=l;switch(l){case"keypress":if(Yf(m)===0)break e;case"keydown":case"keyup":Xe=p6;break;case"focusin":nt="focus",Xe=$g;break;case"focusout":nt="blur",Xe=$g;break;case"beforeblur":case"afterblur":Xe=$g;break;case"click":if(m.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Xe=eA;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Xe=t6;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Xe=v6;break;case bA:case wA:case jA:Xe=a6;break;case SA:Xe=x6;break;case"scroll":Xe=Z8;break;case"wheel":Xe=b6;break;case"copy":case"cut":case"paste":Xe=i6;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Xe=nA}var at=(u&4)!==0,On=!at&&l==="scroll",he=at?_e!==null?_e+"Capture":null:_e;at=[];for(var se=ve,me;se!==null;){me=se;var Le=me.stateNode;if(me.tag===5&&Le!==null&&(me=Le,he!==null&&(Le=ln(se,he),Le!=null&&at.push(Pu(se,Le,me)))),On)break;se=se.return}0<at.length&&(_e=new Xe(_e,nt,null,m,Ee),Ie.push({event:_e,listeners:at}))}}if((u&7)===0){e:{if(_e=l==="mouseover"||l==="pointerover",Xe=l==="mouseout"||l==="pointerout",_e&&m!==_r&&(nt=m.relatedTarget||m.fromElement)&&(ao(nt)||nt[Os]))break e;if((Xe||_e)&&(_e=Ee.window===Ee?Ee:(_e=Ee.ownerDocument)?_e.defaultView||_e.parentWindow:window,Xe?(nt=m.relatedTarget||m.toElement,Xe=ve,nt=nt?ao(nt):null,nt!==null&&(On=Ve(nt),nt!==On||nt.tag!==5&&nt.tag!==6)&&(nt=null)):(Xe=null,nt=ve),Xe!==nt)){if(at=eA,Le="onMouseLeave",he="onMouseEnter",se="mouse",(l==="pointerout"||l==="pointerover")&&(at=nA,Le="onPointerLeave",he="onPointerEnter",se="pointer"),On=Xe==null?_e:wl(Xe),me=nt==null?_e:wl(nt),_e=new at(Le,se+"leave",Xe,m,Ee),_e.target=On,_e.relatedTarget=me,Le=null,ao(Ee)===ve&&(at=new at(he,se+"enter",nt,m,Ee),at.target=me,at.relatedTarget=On,Le=at),On=Le,Xe&&nt)t:{for(at=Xe,he=nt,se=0,me=at;me;me=yl(me))se++;for(me=0,Le=he;Le;Le=yl(Le))me++;for(;0<se-me;)at=yl(at),se--;for(;0<me-se;)he=yl(he),me--;for(;se--;){if(at===he||he!==null&&at===he.alternate)break t;at=yl(at),he=yl(he)}at=null}else at=null;Xe!==null&&PA(Ie,_e,Xe,at,!1),nt!==null&&On!==null&&PA(Ie,On,nt,at,!0)}}e:{if(_e=ve?wl(ve):window,Xe=_e.nodeName&&_e.nodeName.toLowerCase(),Xe==="select"||Xe==="input"&&_e.type==="file")var ot=_6;else if(lA(_e))if(uA)ot=O6;else{ot=P6;var pt=E6}else(Xe=_e.nodeName)&&Xe.toLowerCase()==="input"&&(_e.type==="checkbox"||_e.type==="radio")&&(ot=k6);if(ot&&(ot=ot(l,ve))){cA(Ie,ot,m,Ee);break e}pt&&pt(l,_e,ve),l==="focusout"&&(pt=_e._wrapperState)&&pt.controlled&&_e.type==="number"&&xe(_e,"number",_e.value)}switch(pt=ve?wl(ve):window,l){case"focusin":(lA(pt)||pt.contentEditable==="true")&&(gl=pt,Ug=ve,Au=null);break;case"focusout":Au=Ug=gl=null;break;case"mousedown":qg=!0;break;case"contextmenu":case"mouseup":case"dragend":qg=!1,xA(Ie,m,Ee);break;case"selectionchange":if(I6)break;case"keydown":case"keyup":xA(Ie,m,Ee)}var ht;if(Lg)e:{switch(l){case"compositionstart":var wt="onCompositionStart";break e;case"compositionend":wt="onCompositionEnd";break e;case"compositionupdate":wt="onCompositionUpdate";break e}wt=void 0}else vl?iA(l,m)&&(wt="onCompositionEnd"):l==="keydown"&&m.keyCode===229&&(wt="onCompositionStart");wt&&(rA&&m.locale!=="ko"&&(vl||wt!=="onCompositionStart"?wt==="onCompositionEnd"&&vl&&(ht=JC()):(vi=Ee,Tg="value"in vi?vi.value:vi.textContent,vl=!0)),pt=np(ve,wt),0<pt.length&&(wt=new tA(wt,l,null,m,Ee),Ie.push({event:wt,listeners:pt}),ht?wt.data=ht:(ht=oA(m),ht!==null&&(wt.data=ht)))),(ht=j6?S6(l,m):N6(l,m))&&(ve=np(ve,"onBeforeInput"),0<ve.length&&(Ee=new tA("onBeforeInput","beforeinput",null,m,Ee),Ie.push({event:Ee,listeners:ve}),Ee.data=ht))}_A(Ie,u)})}function Pu(l,u,m){return{instance:l,listener:u,currentTarget:m}}function np(l,u){for(var m=u+"Capture",w=[];l!==null;){var A=l,k=A.stateNode;A.tag===5&&k!==null&&(A=k,k=ln(l,m),k!=null&&w.unshift(Pu(l,k,A)),k=ln(l,u),k!=null&&w.push(Pu(l,k,A))),l=l.return}return w}function yl(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5);return l||null}function PA(l,u,m,w,A){for(var k=u._reactName,$=[];m!==null&&m!==w;){var X=m,ne=X.alternate,ve=X.stateNode;if(ne!==null&&ne===w)break;X.tag===5&&ve!==null&&(X=ve,A?(ne=ln(m,k),ne!=null&&$.unshift(Pu(m,ne,X))):A||(ne=ln(m,k),ne!=null&&$.push(Pu(m,ne,X)))),m=m.return}$.length!==0&&l.push({event:u,listeners:$})}var L6=/\r\n?/g,F6=/\u0000|\uFFFD/g;function kA(l){return(typeof l=="string"?l:""+l).replace(L6,`
6
- `).replace(F6,"")}function rp(l,u,m){if(u=kA(u),kA(l)!==u&&m)throw Error(n(425))}function ap(){}var Yg=null,Xg=null;function Qg(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 Jg=typeof setTimeout=="function"?setTimeout:void 0,B6=typeof clearTimeout=="function"?clearTimeout:void 0,OA=typeof Promise=="function"?Promise:void 0,z6=typeof queueMicrotask=="function"?queueMicrotask:typeof OA<"u"?function(l){return OA.resolve(null).then(l).catch(U6)}:Jg;function U6(l){setTimeout(function(){throw l})}function Zg(l,u){var m=u,w=0;do{var A=m.nextSibling;if(l.removeChild(m),A&&A.nodeType===8)if(m=A.data,m==="/$"){if(w===0){l.removeChild(A),yu(u);return}w--}else m!=="$"&&m!=="$?"&&m!=="$!"||w++;m=A}while(m);yu(u)}function xi(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 TA(l){l=l.previousSibling;for(var u=0;l;){if(l.nodeType===8){var m=l.data;if(m==="$"||m==="$!"||m==="$?"){if(u===0)return l;u--}else m==="/$"&&u++}l=l.previousSibling}return null}var bl=Math.random().toString(36).slice(2),rs="__reactFiber$"+bl,ku="__reactProps$"+bl,Os="__reactContainer$"+bl,ex="__reactEvents$"+bl,q6="__reactListeners$"+bl,W6="__reactHandles$"+bl;function ao(l){var u=l[rs];if(u)return u;for(var m=l.parentNode;m;){if(u=m[Os]||m[rs]){if(m=u.alternate,u.child!==null||m!==null&&m.child!==null)for(l=TA(l);l!==null;){if(m=l[rs])return m;l=TA(l)}return u}l=m,m=l.parentNode}return null}function Ou(l){return l=l[rs]||l[Os],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function wl(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(n(33))}function sp(l){return l[ku]||null}var tx=[],jl=-1;function yi(l){return{current:l}}function dn(l){0>jl||(l.current=tx[jl],tx[jl]=null,jl--)}function rn(l,u){jl++,tx[jl]=l.current,l.current=u}var bi={},pr=yi(bi),Er=yi(!1),so=bi;function Sl(l,u){var m=l.type.contextTypes;if(!m)return bi;var w=l.stateNode;if(w&&w.__reactInternalMemoizedUnmaskedChildContext===u)return w.__reactInternalMemoizedMaskedChildContext;var A={},k;for(k in m)A[k]=u[k];return w&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=u,l.__reactInternalMemoizedMaskedChildContext=A),A}function Pr(l){return l=l.childContextTypes,l!=null}function ip(){dn(Er),dn(pr)}function RA(l,u,m){if(pr.current!==bi)throw Error(n(168));rn(pr,u),rn(Er,m)}function IA(l,u,m){var w=l.stateNode;if(u=u.childContextTypes,typeof w.getChildContext!="function")return m;w=w.getChildContext();for(var A in w)if(!(A in u))throw Error(n(108,oe(l)||"Unknown",A));return ee({},m,w)}function op(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||bi,so=pr.current,rn(pr,l),rn(Er,Er.current),!0}function MA(l,u,m){var w=l.stateNode;if(!w)throw Error(n(169));m?(l=IA(l,u,so),w.__reactInternalMemoizedMergedChildContext=l,dn(Er),dn(pr),rn(pr,l)):dn(Er),rn(Er,m)}var Ts=null,lp=!1,nx=!1;function $A(l){Ts===null?Ts=[l]:Ts.push(l)}function V6(l){lp=!0,$A(l)}function wi(){if(!nx&&Ts!==null){nx=!0;var l=0,u=zt;try{var m=Ts;for(zt=1;l<m.length;l++){var w=m[l];do w=w(!0);while(w!==null)}Ts=null,lp=!1}catch(A){throw Ts!==null&&(Ts=Ts.slice(l+1)),He(ul,wi),A}finally{zt=u,nx=!1}}return null}var Nl=[],Cl=0,cp=null,up=0,ua=[],da=0,io=null,Rs=1,Is="";function oo(l,u){Nl[Cl++]=up,Nl[Cl++]=cp,cp=l,up=u}function DA(l,u,m){ua[da++]=Rs,ua[da++]=Is,ua[da++]=io,io=l;var w=Rs;l=Is;var A=32-Vr(w)-1;w&=~(1<<A),m+=1;var k=32-Vr(u)+A;if(30<k){var $=A-A%5;k=(w&(1<<$)-1).toString(32),w>>=$,A-=$,Rs=1<<32-Vr(u)+A|m<<A|w,Is=k+l}else Rs=1<<k|m<<A|w,Is=l}function rx(l){l.return!==null&&(oo(l,1),DA(l,1,0))}function ax(l){for(;l===cp;)cp=Nl[--Cl],Nl[Cl]=null,up=Nl[--Cl],Nl[Cl]=null;for(;l===io;)io=ua[--da],ua[da]=null,Is=ua[--da],ua[da]=null,Rs=ua[--da],ua[da]=null}var Kr=null,Gr=null,hn=!1,Ta=null;function LA(l,u){var m=ma(5,null,null,0);m.elementType="DELETED",m.stateNode=u,m.return=l,u=l.deletions,u===null?(l.deletions=[m],l.flags|=16):u.push(m)}function FA(l,u){switch(l.tag){case 5:var m=l.type;return u=u.nodeType!==1||m.toLowerCase()!==u.nodeName.toLowerCase()?null:u,u!==null?(l.stateNode=u,Kr=l,Gr=xi(u.firstChild),!0):!1;case 6:return u=l.pendingProps===""||u.nodeType!==3?null:u,u!==null?(l.stateNode=u,Kr=l,Gr=null,!0):!1;case 13:return u=u.nodeType!==8?null:u,u!==null?(m=io!==null?{id:Rs,overflow:Is}:null,l.memoizedState={dehydrated:u,treeContext:m,retryLane:1073741824},m=ma(18,null,null,0),m.stateNode=u,m.return=l,l.child=m,Kr=l,Gr=null,!0):!1;default:return!1}}function sx(l){return(l.mode&1)!==0&&(l.flags&128)===0}function ix(l){if(hn){var u=Gr;if(u){var m=u;if(!FA(l,u)){if(sx(l))throw Error(n(418));u=xi(m.nextSibling);var w=Kr;u&&FA(l,u)?LA(w,m):(l.flags=l.flags&-4097|2,hn=!1,Kr=l)}}else{if(sx(l))throw Error(n(418));l.flags=l.flags&-4097|2,hn=!1,Kr=l}}}function BA(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;Kr=l}function dp(l){if(l!==Kr)return!1;if(!hn)return BA(l),hn=!0,!1;var u;if((u=l.tag!==3)&&!(u=l.tag!==5)&&(u=l.type,u=u!=="head"&&u!=="body"&&!Qg(l.type,l.memoizedProps)),u&&(u=Gr)){if(sx(l))throw zA(),Error(n(418));for(;u;)LA(l,u),u=xi(u.nextSibling)}if(BA(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 m=l.data;if(m==="/$"){if(u===0){Gr=xi(l.nextSibling);break e}u--}else m!=="$"&&m!=="$!"&&m!=="$?"||u++}l=l.nextSibling}Gr=null}}else Gr=Kr?xi(l.stateNode.nextSibling):null;return!0}function zA(){for(var l=Gr;l;)l=xi(l.nextSibling)}function Al(){Gr=Kr=null,hn=!1}function ox(l){Ta===null?Ta=[l]:Ta.push(l)}var H6=E.ReactCurrentBatchConfig;function Tu(l,u,m){if(l=m.ref,l!==null&&typeof l!="function"&&typeof l!="object"){if(m._owner){if(m=m._owner,m){if(m.tag!==1)throw Error(n(309));var w=m.stateNode}if(!w)throw Error(n(147,l));var A=w,k=""+l;return u!==null&&u.ref!==null&&typeof u.ref=="function"&&u.ref._stringRef===k?u.ref:(u=function($){var X=A.refs;$===null?delete X[k]:X[k]=$},u._stringRef=k,u)}if(typeof l!="string")throw Error(n(284));if(!m._owner)throw Error(n(290,l))}return l}function fp(l,u){throw l=Object.prototype.toString.call(u),Error(n(31,l==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":l))}function UA(l){var u=l._init;return u(l._payload)}function qA(l){function u(he,se){if(l){var me=he.deletions;me===null?(he.deletions=[se],he.flags|=16):me.push(se)}}function m(he,se){if(!l)return null;for(;se!==null;)u(he,se),se=se.sibling;return null}function w(he,se){for(he=new Map;se!==null;)se.key!==null?he.set(se.key,se):he.set(se.index,se),se=se.sibling;return he}function A(he,se){return he=Pi(he,se),he.index=0,he.sibling=null,he}function k(he,se,me){return he.index=me,l?(me=he.alternate,me!==null?(me=me.index,me<se?(he.flags|=2,se):me):(he.flags|=2,se)):(he.flags|=1048576,se)}function $(he){return l&&he.alternate===null&&(he.flags|=2),he}function X(he,se,me,Le){return se===null||se.tag!==6?(se=Jx(me,he.mode,Le),se.return=he,se):(se=A(se,me),se.return=he,se)}function ne(he,se,me,Le){var ot=me.type;return ot===O?Ee(he,se,me.props.children,Le,me.key):se!==null&&(se.elementType===ot||typeof ot=="object"&&ot!==null&&ot.$$typeof===J&&UA(ot)===se.type)?(Le=A(se,me.props),Le.ref=Tu(he,se,me),Le.return=he,Le):(Le=$p(me.type,me.key,me.props,null,he.mode,Le),Le.ref=Tu(he,se,me),Le.return=he,Le)}function ve(he,se,me,Le){return se===null||se.tag!==4||se.stateNode.containerInfo!==me.containerInfo||se.stateNode.implementation!==me.implementation?(se=Zx(me,he.mode,Le),se.return=he,se):(se=A(se,me.children||[]),se.return=he,se)}function Ee(he,se,me,Le,ot){return se===null||se.tag!==7?(se=vo(me,he.mode,Le,ot),se.return=he,se):(se=A(se,me),se.return=he,se)}function Ie(he,se,me){if(typeof se=="string"&&se!==""||typeof se=="number")return se=Jx(""+se,he.mode,me),se.return=he,se;if(typeof se=="object"&&se!==null){switch(se.$$typeof){case _:return me=$p(se.type,se.key,se.props,null,he.mode,me),me.ref=Tu(he,null,se),me.return=he,me;case P:return se=Zx(se,he.mode,me),se.return=he,se;case J:var Le=se._init;return Ie(he,Le(se._payload),me)}if(ue(se)||z(se))return se=vo(se,he.mode,me,null),se.return=he,se;fp(he,se)}return null}function _e(he,se,me,Le){var ot=se!==null?se.key:null;if(typeof me=="string"&&me!==""||typeof me=="number")return ot!==null?null:X(he,se,""+me,Le);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case _:return me.key===ot?ne(he,se,me,Le):null;case P:return me.key===ot?ve(he,se,me,Le):null;case J:return ot=me._init,_e(he,se,ot(me._payload),Le)}if(ue(me)||z(me))return ot!==null?null:Ee(he,se,me,Le,null);fp(he,me)}return null}function Xe(he,se,me,Le,ot){if(typeof Le=="string"&&Le!==""||typeof Le=="number")return he=he.get(me)||null,X(se,he,""+Le,ot);if(typeof Le=="object"&&Le!==null){switch(Le.$$typeof){case _:return he=he.get(Le.key===null?me:Le.key)||null,ne(se,he,Le,ot);case P:return he=he.get(Le.key===null?me:Le.key)||null,ve(se,he,Le,ot);case J:var pt=Le._init;return Xe(he,se,me,pt(Le._payload),ot)}if(ue(Le)||z(Le))return he=he.get(me)||null,Ee(se,he,Le,ot,null);fp(se,Le)}return null}function nt(he,se,me,Le){for(var ot=null,pt=null,ht=se,wt=se=0,Zn=null;ht!==null&&wt<me.length;wt++){ht.index>wt?(Zn=ht,ht=null):Zn=ht.sibling;var Ut=_e(he,ht,me[wt],Le);if(Ut===null){ht===null&&(ht=Zn);break}l&&ht&&Ut.alternate===null&&u(he,ht),se=k(Ut,se,wt),pt===null?ot=Ut:pt.sibling=Ut,pt=Ut,ht=Zn}if(wt===me.length)return m(he,ht),hn&&oo(he,wt),ot;if(ht===null){for(;wt<me.length;wt++)ht=Ie(he,me[wt],Le),ht!==null&&(se=k(ht,se,wt),pt===null?ot=ht:pt.sibling=ht,pt=ht);return hn&&oo(he,wt),ot}for(ht=w(he,ht);wt<me.length;wt++)Zn=Xe(ht,he,wt,me[wt],Le),Zn!==null&&(l&&Zn.alternate!==null&&ht.delete(Zn.key===null?wt:Zn.key),se=k(Zn,se,wt),pt===null?ot=Zn:pt.sibling=Zn,pt=Zn);return l&&ht.forEach(function(ki){return u(he,ki)}),hn&&oo(he,wt),ot}function at(he,se,me,Le){var ot=z(me);if(typeof ot!="function")throw Error(n(150));if(me=ot.call(me),me==null)throw Error(n(151));for(var pt=ot=null,ht=se,wt=se=0,Zn=null,Ut=me.next();ht!==null&&!Ut.done;wt++,Ut=me.next()){ht.index>wt?(Zn=ht,ht=null):Zn=ht.sibling;var ki=_e(he,ht,Ut.value,Le);if(ki===null){ht===null&&(ht=Zn);break}l&&ht&&ki.alternate===null&&u(he,ht),se=k(ki,se,wt),pt===null?ot=ki:pt.sibling=ki,pt=ki,ht=Zn}if(Ut.done)return m(he,ht),hn&&oo(he,wt),ot;if(ht===null){for(;!Ut.done;wt++,Ut=me.next())Ut=Ie(he,Ut.value,Le),Ut!==null&&(se=k(Ut,se,wt),pt===null?ot=Ut:pt.sibling=Ut,pt=Ut);return hn&&oo(he,wt),ot}for(ht=w(he,ht);!Ut.done;wt++,Ut=me.next())Ut=Xe(ht,he,wt,Ut.value,Le),Ut!==null&&(l&&Ut.alternate!==null&&ht.delete(Ut.key===null?wt:Ut.key),se=k(Ut,se,wt),pt===null?ot=Ut:pt.sibling=Ut,pt=Ut);return l&&ht.forEach(function(CU){return u(he,CU)}),hn&&oo(he,wt),ot}function On(he,se,me,Le){if(typeof me=="object"&&me!==null&&me.type===O&&me.key===null&&(me=me.props.children),typeof me=="object"&&me!==null){switch(me.$$typeof){case _:e:{for(var ot=me.key,pt=se;pt!==null;){if(pt.key===ot){if(ot=me.type,ot===O){if(pt.tag===7){m(he,pt.sibling),se=A(pt,me.props.children),se.return=he,he=se;break e}}else if(pt.elementType===ot||typeof ot=="object"&&ot!==null&&ot.$$typeof===J&&UA(ot)===pt.type){m(he,pt.sibling),se=A(pt,me.props),se.ref=Tu(he,pt,me),se.return=he,he=se;break e}m(he,pt);break}else u(he,pt);pt=pt.sibling}me.type===O?(se=vo(me.props.children,he.mode,Le,me.key),se.return=he,he=se):(Le=$p(me.type,me.key,me.props,null,he.mode,Le),Le.ref=Tu(he,se,me),Le.return=he,he=Le)}return $(he);case P:e:{for(pt=me.key;se!==null;){if(se.key===pt)if(se.tag===4&&se.stateNode.containerInfo===me.containerInfo&&se.stateNode.implementation===me.implementation){m(he,se.sibling),se=A(se,me.children||[]),se.return=he,he=se;break e}else{m(he,se);break}else u(he,se);se=se.sibling}se=Zx(me,he.mode,Le),se.return=he,he=se}return $(he);case J:return pt=me._init,On(he,se,pt(me._payload),Le)}if(ue(me))return nt(he,se,me,Le);if(z(me))return at(he,se,me,Le);fp(he,me)}return typeof me=="string"&&me!==""||typeof me=="number"?(me=""+me,se!==null&&se.tag===6?(m(he,se.sibling),se=A(se,me),se.return=he,he=se):(m(he,se),se=Jx(me,he.mode,Le),se.return=he,he=se),$(he)):m(he,se)}return On}var _l=qA(!0),WA=qA(!1),pp=yi(null),hp=null,El=null,lx=null;function cx(){lx=El=hp=null}function ux(l){var u=pp.current;dn(pp),l._currentValue=u}function dx(l,u,m){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===m)break;l=l.return}}function Pl(l,u){hp=l,lx=El=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&u)!==0&&(kr=!0),l.firstContext=null)}function fa(l){var u=l._currentValue;if(lx!==l)if(l={context:l,memoizedValue:u,next:null},El===null){if(hp===null)throw Error(n(308));El=l,hp.dependencies={lanes:0,firstContext:l}}else El=El.next=l;return u}var lo=null;function fx(l){lo===null?lo=[l]:lo.push(l)}function VA(l,u,m,w){var A=u.interleaved;return A===null?(m.next=m,fx(u)):(m.next=A.next,A.next=m),u.interleaved=m,Ms(l,w)}function Ms(l,u){l.lanes|=u;var m=l.alternate;for(m!==null&&(m.lanes|=u),m=l,l=l.return;l!==null;)l.childLanes|=u,m=l.alternate,m!==null&&(m.childLanes|=u),m=l,l=l.return;return m.tag===3?m.stateNode:null}var ji=!1;function px(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function HA(l,u){l=l.updateQueue,u.updateQueue===l&&(u.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,effects:l.effects})}function $s(l,u){return{eventTime:l,lane:u,tag:0,payload:null,callback:null,next:null}}function Si(l,u,m){var w=l.updateQueue;if(w===null)return null;if(w=w.shared,(Bt&2)!==0){var A=w.pending;return A===null?u.next=u:(u.next=A.next,A.next=u),w.pending=u,Ms(l,m)}return A=w.interleaved,A===null?(u.next=u,fx(w)):(u.next=A.next,A.next=u),w.interleaved=u,Ms(l,m)}function mp(l,u,m){if(u=u.updateQueue,u!==null&&(u=u.shared,(m&4194240)!==0)){var w=u.lanes;w&=l.pendingLanes,m|=w,u.lanes=m,ca(l,m)}}function KA(l,u){var m=l.updateQueue,w=l.alternate;if(w!==null&&(w=w.updateQueue,m===w)){var A=null,k=null;if(m=m.firstBaseUpdate,m!==null){do{var $={eventTime:m.eventTime,lane:m.lane,tag:m.tag,payload:m.payload,callback:m.callback,next:null};k===null?A=k=$:k=k.next=$,m=m.next}while(m!==null);k===null?A=k=u:k=k.next=u}else A=k=u;m={baseState:w.baseState,firstBaseUpdate:A,lastBaseUpdate:k,shared:w.shared,effects:w.effects},l.updateQueue=m;return}l=m.lastBaseUpdate,l===null?m.firstBaseUpdate=u:l.next=u,m.lastBaseUpdate=u}function vp(l,u,m,w){var A=l.updateQueue;ji=!1;var k=A.firstBaseUpdate,$=A.lastBaseUpdate,X=A.shared.pending;if(X!==null){A.shared.pending=null;var ne=X,ve=ne.next;ne.next=null,$===null?k=ve:$.next=ve,$=ne;var Ee=l.alternate;Ee!==null&&(Ee=Ee.updateQueue,X=Ee.lastBaseUpdate,X!==$&&(X===null?Ee.firstBaseUpdate=ve:X.next=ve,Ee.lastBaseUpdate=ne))}if(k!==null){var Ie=A.baseState;$=0,Ee=ve=ne=null,X=k;do{var _e=X.lane,Xe=X.eventTime;if((w&_e)===_e){Ee!==null&&(Ee=Ee.next={eventTime:Xe,lane:0,tag:X.tag,payload:X.payload,callback:X.callback,next:null});e:{var nt=l,at=X;switch(_e=u,Xe=m,at.tag){case 1:if(nt=at.payload,typeof nt=="function"){Ie=nt.call(Xe,Ie,_e);break e}Ie=nt;break e;case 3:nt.flags=nt.flags&-65537|128;case 0:if(nt=at.payload,_e=typeof nt=="function"?nt.call(Xe,Ie,_e):nt,_e==null)break e;Ie=ee({},Ie,_e);break e;case 2:ji=!0}}X.callback!==null&&X.lane!==0&&(l.flags|=64,_e=A.effects,_e===null?A.effects=[X]:_e.push(X))}else Xe={eventTime:Xe,lane:_e,tag:X.tag,payload:X.payload,callback:X.callback,next:null},Ee===null?(ve=Ee=Xe,ne=Ie):Ee=Ee.next=Xe,$|=_e;if(X=X.next,X===null){if(X=A.shared.pending,X===null)break;_e=X,X=_e.next,_e.next=null,A.lastBaseUpdate=_e,A.shared.pending=null}}while(!0);if(Ee===null&&(ne=Ie),A.baseState=ne,A.firstBaseUpdate=ve,A.lastBaseUpdate=Ee,u=A.shared.interleaved,u!==null){A=u;do $|=A.lane,A=A.next;while(A!==u)}else k===null&&(A.shared.lanes=0);fo|=$,l.lanes=$,l.memoizedState=Ie}}function GA(l,u,m){if(l=u.effects,u.effects=null,l!==null)for(u=0;u<l.length;u++){var w=l[u],A=w.callback;if(A!==null){if(w.callback=null,w=m,typeof A!="function")throw Error(n(191,A));A.call(w)}}}var Ru={},as=yi(Ru),Iu=yi(Ru),Mu=yi(Ru);function co(l){if(l===Ru)throw Error(n(174));return l}function hx(l,u){switch(rn(Mu,u),rn(Iu,l),rn(as,Ru),l=u.nodeType,l){case 9:case 11:u=(u=u.documentElement)?u.namespaceURI:Ne(null,"");break;default:l=l===8?u.parentNode:u,u=l.namespaceURI||null,l=l.tagName,u=Ne(u,l)}dn(as),rn(as,u)}function kl(){dn(as),dn(Iu),dn(Mu)}function YA(l){co(Mu.current);var u=co(as.current),m=Ne(u,l.type);u!==m&&(rn(Iu,l),rn(as,m))}function mx(l){Iu.current===l&&(dn(as),dn(Iu))}var xn=yi(0);function gp(l){for(var u=l;u!==null;){if(u.tag===13){var m=u.memoizedState;if(m!==null&&(m=m.dehydrated,m===null||m.data==="$?"||m.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 vx=[];function gx(){for(var l=0;l<vx.length;l++)vx[l]._workInProgressVersionPrimary=null;vx.length=0}var xp=E.ReactCurrentDispatcher,xx=E.ReactCurrentBatchConfig,uo=0,yn=null,Fn=null,Qn=null,yp=!1,$u=!1,Du=0,K6=0;function hr(){throw Error(n(321))}function yx(l,u){if(u===null)return!1;for(var m=0;m<u.length&&m<l.length;m++)if(!Oa(l[m],u[m]))return!1;return!0}function bx(l,u,m,w,A,k){if(uo=k,yn=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,xp.current=l===null||l.memoizedState===null?Q6:J6,l=m(w,A),$u){k=0;do{if($u=!1,Du=0,25<=k)throw Error(n(301));k+=1,Qn=Fn=null,u.updateQueue=null,xp.current=Z6,l=m(w,A)}while($u)}if(xp.current=jp,u=Fn!==null&&Fn.next!==null,uo=0,Qn=Fn=yn=null,yp=!1,u)throw Error(n(300));return l}function wx(){var l=Du!==0;return Du=0,l}function ss(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qn===null?yn.memoizedState=Qn=l:Qn=Qn.next=l,Qn}function pa(){if(Fn===null){var l=yn.alternate;l=l!==null?l.memoizedState:null}else l=Fn.next;var u=Qn===null?yn.memoizedState:Qn.next;if(u!==null)Qn=u,Fn=l;else{if(l===null)throw Error(n(310));Fn=l,l={memoizedState:Fn.memoizedState,baseState:Fn.baseState,baseQueue:Fn.baseQueue,queue:Fn.queue,next:null},Qn===null?yn.memoizedState=Qn=l:Qn=Qn.next=l}return Qn}function Lu(l,u){return typeof u=="function"?u(l):u}function jx(l){var u=pa(),m=u.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=l;var w=Fn,A=w.baseQueue,k=m.pending;if(k!==null){if(A!==null){var $=A.next;A.next=k.next,k.next=$}w.baseQueue=A=k,m.pending=null}if(A!==null){k=A.next,w=w.baseState;var X=$=null,ne=null,ve=k;do{var Ee=ve.lane;if((uo&Ee)===Ee)ne!==null&&(ne=ne.next={lane:0,action:ve.action,hasEagerState:ve.hasEagerState,eagerState:ve.eagerState,next:null}),w=ve.hasEagerState?ve.eagerState:l(w,ve.action);else{var Ie={lane:Ee,action:ve.action,hasEagerState:ve.hasEagerState,eagerState:ve.eagerState,next:null};ne===null?(X=ne=Ie,$=w):ne=ne.next=Ie,yn.lanes|=Ee,fo|=Ee}ve=ve.next}while(ve!==null&&ve!==k);ne===null?$=w:ne.next=X,Oa(w,u.memoizedState)||(kr=!0),u.memoizedState=w,u.baseState=$,u.baseQueue=ne,m.lastRenderedState=w}if(l=m.interleaved,l!==null){A=l;do k=A.lane,yn.lanes|=k,fo|=k,A=A.next;while(A!==l)}else A===null&&(m.lanes=0);return[u.memoizedState,m.dispatch]}function Sx(l){var u=pa(),m=u.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=l;var w=m.dispatch,A=m.pending,k=u.memoizedState;if(A!==null){m.pending=null;var $=A=A.next;do k=l(k,$.action),$=$.next;while($!==A);Oa(k,u.memoizedState)||(kr=!0),u.memoizedState=k,u.baseQueue===null&&(u.baseState=k),m.lastRenderedState=k}return[k,w]}function XA(){}function QA(l,u){var m=yn,w=pa(),A=u(),k=!Oa(w.memoizedState,A);if(k&&(w.memoizedState=A,kr=!0),w=w.queue,Nx(e_.bind(null,m,w,l),[l]),w.getSnapshot!==u||k||Qn!==null&&Qn.memoizedState.tag&1){if(m.flags|=2048,Fu(9,ZA.bind(null,m,w,A,u),void 0,null),Jn===null)throw Error(n(349));(uo&30)!==0||JA(m,u,A)}return A}function JA(l,u,m){l.flags|=16384,l={getSnapshot:u,value:m},u=yn.updateQueue,u===null?(u={lastEffect:null,stores:null},yn.updateQueue=u,u.stores=[l]):(m=u.stores,m===null?u.stores=[l]:m.push(l))}function ZA(l,u,m,w){u.value=m,u.getSnapshot=w,t_(u)&&n_(l)}function e_(l,u,m){return m(function(){t_(u)&&n_(l)})}function t_(l){var u=l.getSnapshot;l=l.value;try{var m=u();return!Oa(l,m)}catch{return!0}}function n_(l){var u=Ms(l,1);u!==null&&$a(u,l,1,-1)}function r_(l){var u=ss();return typeof l=="function"&&(l=l()),u.memoizedState=u.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Lu,lastRenderedState:l},u.queue=l,l=l.dispatch=X6.bind(null,yn,l),[u.memoizedState,l]}function Fu(l,u,m,w){return l={tag:l,create:u,destroy:m,deps:w,next:null},u=yn.updateQueue,u===null?(u={lastEffect:null,stores:null},yn.updateQueue=u,u.lastEffect=l.next=l):(m=u.lastEffect,m===null?u.lastEffect=l.next=l:(w=m.next,m.next=l,l.next=w,u.lastEffect=l)),l}function a_(){return pa().memoizedState}function bp(l,u,m,w){var A=ss();yn.flags|=l,A.memoizedState=Fu(1|u,m,void 0,w===void 0?null:w)}function wp(l,u,m,w){var A=pa();w=w===void 0?null:w;var k=void 0;if(Fn!==null){var $=Fn.memoizedState;if(k=$.destroy,w!==null&&yx(w,$.deps)){A.memoizedState=Fu(u,m,k,w);return}}yn.flags|=l,A.memoizedState=Fu(1|u,m,k,w)}function s_(l,u){return bp(8390656,8,l,u)}function Nx(l,u){return wp(2048,8,l,u)}function i_(l,u){return wp(4,2,l,u)}function o_(l,u){return wp(4,4,l,u)}function l_(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 c_(l,u,m){return m=m!=null?m.concat([l]):null,wp(4,4,l_.bind(null,u,l),m)}function Cx(){}function u_(l,u){var m=pa();u=u===void 0?null:u;var w=m.memoizedState;return w!==null&&u!==null&&yx(u,w[1])?w[0]:(m.memoizedState=[l,u],l)}function d_(l,u){var m=pa();u=u===void 0?null:u;var w=m.memoizedState;return w!==null&&u!==null&&yx(u,w[1])?w[0]:(l=l(),m.memoizedState=[l,u],l)}function f_(l,u,m){return(uo&21)===0?(l.baseState&&(l.baseState=!1,kr=!0),l.memoizedState=m):(Oa(m,u)||(m=dt(),yn.lanes|=m,fo|=m,l.baseState=!0),u)}function G6(l,u){var m=zt;zt=m!==0&&4>m?m:4,l(!0);var w=xx.transition;xx.transition={};try{l(!1),u()}finally{zt=m,xx.transition=w}}function p_(){return pa().memoizedState}function Y6(l,u,m){var w=_i(l);if(m={lane:w,action:m,hasEagerState:!1,eagerState:null,next:null},h_(l))m_(u,m);else if(m=VA(l,u,m,w),m!==null){var A=br();$a(m,l,w,A),v_(m,u,w)}}function X6(l,u,m){var w=_i(l),A={lane:w,action:m,hasEagerState:!1,eagerState:null,next:null};if(h_(l))m_(u,A);else{var k=l.alternate;if(l.lanes===0&&(k===null||k.lanes===0)&&(k=u.lastRenderedReducer,k!==null))try{var $=u.lastRenderedState,X=k($,m);if(A.hasEagerState=!0,A.eagerState=X,Oa(X,$)){var ne=u.interleaved;ne===null?(A.next=A,fx(u)):(A.next=ne.next,ne.next=A),u.interleaved=A;return}}catch{}m=VA(l,u,A,w),m!==null&&(A=br(),$a(m,l,w,A),v_(m,u,w))}}function h_(l){var u=l.alternate;return l===yn||u!==null&&u===yn}function m_(l,u){$u=yp=!0;var m=l.pending;m===null?u.next=u:(u.next=m.next,m.next=u),l.pending=u}function v_(l,u,m){if((m&4194240)!==0){var w=u.lanes;w&=l.pendingLanes,m|=w,u.lanes=m,ca(l,m)}}var jp={readContext:fa,useCallback:hr,useContext:hr,useEffect:hr,useImperativeHandle:hr,useInsertionEffect:hr,useLayoutEffect:hr,useMemo:hr,useReducer:hr,useRef:hr,useState:hr,useDebugValue:hr,useDeferredValue:hr,useTransition:hr,useMutableSource:hr,useSyncExternalStore:hr,useId:hr,unstable_isNewReconciler:!1},Q6={readContext:fa,useCallback:function(l,u){return ss().memoizedState=[l,u===void 0?null:u],l},useContext:fa,useEffect:s_,useImperativeHandle:function(l,u,m){return m=m!=null?m.concat([l]):null,bp(4194308,4,l_.bind(null,u,l),m)},useLayoutEffect:function(l,u){return bp(4194308,4,l,u)},useInsertionEffect:function(l,u){return bp(4,2,l,u)},useMemo:function(l,u){var m=ss();return u=u===void 0?null:u,l=l(),m.memoizedState=[l,u],l},useReducer:function(l,u,m){var w=ss();return u=m!==void 0?m(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=Y6.bind(null,yn,l),[w.memoizedState,l]},useRef:function(l){var u=ss();return l={current:l},u.memoizedState=l},useState:r_,useDebugValue:Cx,useDeferredValue:function(l){return ss().memoizedState=l},useTransition:function(){var l=r_(!1),u=l[0];return l=G6.bind(null,l[1]),ss().memoizedState=l,[u,l]},useMutableSource:function(){},useSyncExternalStore:function(l,u,m){var w=yn,A=ss();if(hn){if(m===void 0)throw Error(n(407));m=m()}else{if(m=u(),Jn===null)throw Error(n(349));(uo&30)!==0||JA(w,u,m)}A.memoizedState=m;var k={value:m,getSnapshot:u};return A.queue=k,s_(e_.bind(null,w,k,l),[l]),w.flags|=2048,Fu(9,ZA.bind(null,w,k,m,u),void 0,null),m},useId:function(){var l=ss(),u=Jn.identifierPrefix;if(hn){var m=Is,w=Rs;m=(w&~(1<<32-Vr(w)-1)).toString(32)+m,u=":"+u+"R"+m,m=Du++,0<m&&(u+="H"+m.toString(32)),u+=":"}else m=K6++,u=":"+u+"r"+m.toString(32)+":";return l.memoizedState=u},unstable_isNewReconciler:!1},J6={readContext:fa,useCallback:u_,useContext:fa,useEffect:Nx,useImperativeHandle:c_,useInsertionEffect:i_,useLayoutEffect:o_,useMemo:d_,useReducer:jx,useRef:a_,useState:function(){return jx(Lu)},useDebugValue:Cx,useDeferredValue:function(l){var u=pa();return f_(u,Fn.memoizedState,l)},useTransition:function(){var l=jx(Lu)[0],u=pa().memoizedState;return[l,u]},useMutableSource:XA,useSyncExternalStore:QA,useId:p_,unstable_isNewReconciler:!1},Z6={readContext:fa,useCallback:u_,useContext:fa,useEffect:Nx,useImperativeHandle:c_,useInsertionEffect:i_,useLayoutEffect:o_,useMemo:d_,useReducer:Sx,useRef:a_,useState:function(){return Sx(Lu)},useDebugValue:Cx,useDeferredValue:function(l){var u=pa();return Fn===null?u.memoizedState=l:f_(u,Fn.memoizedState,l)},useTransition:function(){var l=Sx(Lu)[0],u=pa().memoizedState;return[l,u]},useMutableSource:XA,useSyncExternalStore:QA,useId:p_,unstable_isNewReconciler:!1};function Ra(l,u){if(l&&l.defaultProps){u=ee({},u),l=l.defaultProps;for(var m in l)u[m]===void 0&&(u[m]=l[m]);return u}return u}function Ax(l,u,m,w){u=l.memoizedState,m=m(w,u),m=m==null?u:ee({},u,m),l.memoizedState=m,l.lanes===0&&(l.updateQueue.baseState=m)}var Sp={isMounted:function(l){return(l=l._reactInternals)?Ve(l)===l:!1},enqueueSetState:function(l,u,m){l=l._reactInternals;var w=br(),A=_i(l),k=$s(w,A);k.payload=u,m!=null&&(k.callback=m),u=Si(l,k,A),u!==null&&($a(u,l,A,w),mp(u,l,A))},enqueueReplaceState:function(l,u,m){l=l._reactInternals;var w=br(),A=_i(l),k=$s(w,A);k.tag=1,k.payload=u,m!=null&&(k.callback=m),u=Si(l,k,A),u!==null&&($a(u,l,A,w),mp(u,l,A))},enqueueForceUpdate:function(l,u){l=l._reactInternals;var m=br(),w=_i(l),A=$s(m,w);A.tag=2,u!=null&&(A.callback=u),u=Si(l,A,w),u!==null&&($a(u,l,w,m),mp(u,l,w))}};function g_(l,u,m,w,A,k,$){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(w,k,$):u.prototype&&u.prototype.isPureReactComponent?!Cu(m,w)||!Cu(A,k):!0}function x_(l,u,m){var w=!1,A=bi,k=u.contextType;return typeof k=="object"&&k!==null?k=fa(k):(A=Pr(u)?so:pr.current,w=u.contextTypes,k=(w=w!=null)?Sl(l,A):bi),u=new u(m,k),l.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Sp,l.stateNode=u,u._reactInternals=l,w&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=A,l.__reactInternalMemoizedMaskedChildContext=k),u}function y_(l,u,m,w){l=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(m,w),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(m,w),u.state!==l&&Sp.enqueueReplaceState(u,u.state,null)}function _x(l,u,m,w){var A=l.stateNode;A.props=m,A.state=l.memoizedState,A.refs={},px(l);var k=u.contextType;typeof k=="object"&&k!==null?A.context=fa(k):(k=Pr(u)?so:pr.current,A.context=Sl(l,k)),A.state=l.memoizedState,k=u.getDerivedStateFromProps,typeof k=="function"&&(Ax(l,u,k,m),A.state=l.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof A.getSnapshotBeforeUpdate=="function"||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(u=A.state,typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount(),u!==A.state&&Sp.enqueueReplaceState(A,A.state,null),vp(l,m,A,w),A.state=l.memoizedState),typeof A.componentDidMount=="function"&&(l.flags|=4194308)}function Ol(l,u){try{var m="",w=u;do m+=G(w),w=w.return;while(w);var A=m}catch(k){A=`
7
- Error generating stack: `+k.message+`
8
- `+k.stack}return{value:l,source:u,stack:A,digest:null}}function Ex(l,u,m){return{value:l,source:null,stack:m??null,digest:u??null}}function Px(l,u){try{console.error(u.value)}catch(m){setTimeout(function(){throw m})}}var eU=typeof WeakMap=="function"?WeakMap:Map;function b_(l,u,m){m=$s(-1,m),m.tag=3,m.payload={element:null};var w=u.value;return m.callback=function(){kp||(kp=!0,Wx=w),Px(l,u)},m}function w_(l,u,m){m=$s(-1,m),m.tag=3;var w=l.type.getDerivedStateFromError;if(typeof w=="function"){var A=u.value;m.payload=function(){return w(A)},m.callback=function(){Px(l,u)}}var k=l.stateNode;return k!==null&&typeof k.componentDidCatch=="function"&&(m.callback=function(){Px(l,u),typeof w!="function"&&(Ci===null?Ci=new Set([this]):Ci.add(this));var $=u.stack;this.componentDidCatch(u.value,{componentStack:$!==null?$:""})}),m}function j_(l,u,m){var w=l.pingCache;if(w===null){w=l.pingCache=new eU;var A=new Set;w.set(u,A)}else A=w.get(u),A===void 0&&(A=new Set,w.set(u,A));A.has(m)||(A.add(m),l=hU.bind(null,l,u,m),u.then(l,l))}function S_(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 N_(l,u,m,w,A){return(l.mode&1)===0?(l===u?l.flags|=65536:(l.flags|=128,m.flags|=131072,m.flags&=-52805,m.tag===1&&(m.alternate===null?m.tag=17:(u=$s(-1,1),u.tag=2,Si(m,u,1))),m.lanes|=1),l):(l.flags|=65536,l.lanes=A,l)}var tU=E.ReactCurrentOwner,kr=!1;function yr(l,u,m,w){u.child=l===null?WA(u,null,m,w):_l(u,l.child,m,w)}function C_(l,u,m,w,A){m=m.render;var k=u.ref;return Pl(u,A),w=bx(l,u,m,w,k,A),m=wx(),l!==null&&!kr?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~A,Ds(l,u,A)):(hn&&m&&rx(u),u.flags|=1,yr(l,u,w,A),u.child)}function A_(l,u,m,w,A){if(l===null){var k=m.type;return typeof k=="function"&&!Qx(k)&&k.defaultProps===void 0&&m.compare===null&&m.defaultProps===void 0?(u.tag=15,u.type=k,__(l,u,k,w,A)):(l=$p(m.type,null,w,u,u.mode,A),l.ref=u.ref,l.return=u,u.child=l)}if(k=l.child,(l.lanes&A)===0){var $=k.memoizedProps;if(m=m.compare,m=m!==null?m:Cu,m($,w)&&l.ref===u.ref)return Ds(l,u,A)}return u.flags|=1,l=Pi(k,w),l.ref=u.ref,l.return=u,u.child=l}function __(l,u,m,w,A){if(l!==null){var k=l.memoizedProps;if(Cu(k,w)&&l.ref===u.ref)if(kr=!1,u.pendingProps=w=k,(l.lanes&A)!==0)(l.flags&131072)!==0&&(kr=!0);else return u.lanes=l.lanes,Ds(l,u,A)}return kx(l,u,m,w,A)}function E_(l,u,m){var w=u.pendingProps,A=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},rn(Rl,Yr),Yr|=m;else{if((m&1073741824)===0)return l=k!==null?k.baseLanes|m:m,u.lanes=u.childLanes=1073741824,u.memoizedState={baseLanes:l,cachePool:null,transitions:null},u.updateQueue=null,rn(Rl,Yr),Yr|=l,null;u.memoizedState={baseLanes:0,cachePool:null,transitions:null},w=k!==null?k.baseLanes:m,rn(Rl,Yr),Yr|=w}else k!==null?(w=k.baseLanes|m,u.memoizedState=null):w=m,rn(Rl,Yr),Yr|=w;return yr(l,u,A,m),u.child}function P_(l,u){var m=u.ref;(l===null&&m!==null||l!==null&&l.ref!==m)&&(u.flags|=512,u.flags|=2097152)}function kx(l,u,m,w,A){var k=Pr(m)?so:pr.current;return k=Sl(u,k),Pl(u,A),m=bx(l,u,m,w,k,A),w=wx(),l!==null&&!kr?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~A,Ds(l,u,A)):(hn&&w&&rx(u),u.flags|=1,yr(l,u,m,A),u.child)}function k_(l,u,m,w,A){if(Pr(m)){var k=!0;op(u)}else k=!1;if(Pl(u,A),u.stateNode===null)Cp(l,u),x_(u,m,w),_x(u,m,w,A),w=!0;else if(l===null){var $=u.stateNode,X=u.memoizedProps;$.props=X;var ne=$.context,ve=m.contextType;typeof ve=="object"&&ve!==null?ve=fa(ve):(ve=Pr(m)?so:pr.current,ve=Sl(u,ve));var Ee=m.getDerivedStateFromProps,Ie=typeof Ee=="function"||typeof $.getSnapshotBeforeUpdate=="function";Ie||typeof $.UNSAFE_componentWillReceiveProps!="function"&&typeof $.componentWillReceiveProps!="function"||(X!==w||ne!==ve)&&y_(u,$,w,ve),ji=!1;var _e=u.memoizedState;$.state=_e,vp(u,w,$,A),ne=u.memoizedState,X!==w||_e!==ne||Er.current||ji?(typeof Ee=="function"&&(Ax(u,m,Ee,w),ne=u.memoizedState),(X=ji||g_(u,m,X,w,_e,ne,ve))?(Ie||typeof $.UNSAFE_componentWillMount!="function"&&typeof $.componentWillMount!="function"||(typeof $.componentWillMount=="function"&&$.componentWillMount(),typeof $.UNSAFE_componentWillMount=="function"&&$.UNSAFE_componentWillMount()),typeof $.componentDidMount=="function"&&(u.flags|=4194308)):(typeof $.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=w,u.memoizedState=ne),$.props=w,$.state=ne,$.context=ve,w=X):(typeof $.componentDidMount=="function"&&(u.flags|=4194308),w=!1)}else{$=u.stateNode,HA(l,u),X=u.memoizedProps,ve=u.type===u.elementType?X:Ra(u.type,X),$.props=ve,Ie=u.pendingProps,_e=$.context,ne=m.contextType,typeof ne=="object"&&ne!==null?ne=fa(ne):(ne=Pr(m)?so:pr.current,ne=Sl(u,ne));var Xe=m.getDerivedStateFromProps;(Ee=typeof Xe=="function"||typeof $.getSnapshotBeforeUpdate=="function")||typeof $.UNSAFE_componentWillReceiveProps!="function"&&typeof $.componentWillReceiveProps!="function"||(X!==Ie||_e!==ne)&&y_(u,$,w,ne),ji=!1,_e=u.memoizedState,$.state=_e,vp(u,w,$,A);var nt=u.memoizedState;X!==Ie||_e!==nt||Er.current||ji?(typeof Xe=="function"&&(Ax(u,m,Xe,w),nt=u.memoizedState),(ve=ji||g_(u,m,ve,w,_e,nt,ne)||!1)?(Ee||typeof $.UNSAFE_componentWillUpdate!="function"&&typeof $.componentWillUpdate!="function"||(typeof $.componentWillUpdate=="function"&&$.componentWillUpdate(w,nt,ne),typeof $.UNSAFE_componentWillUpdate=="function"&&$.UNSAFE_componentWillUpdate(w,nt,ne)),typeof $.componentDidUpdate=="function"&&(u.flags|=4),typeof $.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof $.componentDidUpdate!="function"||X===l.memoizedProps&&_e===l.memoizedState||(u.flags|=4),typeof $.getSnapshotBeforeUpdate!="function"||X===l.memoizedProps&&_e===l.memoizedState||(u.flags|=1024),u.memoizedProps=w,u.memoizedState=nt),$.props=w,$.state=nt,$.context=ne,w=ve):(typeof $.componentDidUpdate!="function"||X===l.memoizedProps&&_e===l.memoizedState||(u.flags|=4),typeof $.getSnapshotBeforeUpdate!="function"||X===l.memoizedProps&&_e===l.memoizedState||(u.flags|=1024),w=!1)}return Ox(l,u,m,w,k,A)}function Ox(l,u,m,w,A,k){P_(l,u);var $=(u.flags&128)!==0;if(!w&&!$)return A&&MA(u,m,!1),Ds(l,u,k);w=u.stateNode,tU.current=u;var X=$&&typeof m.getDerivedStateFromError!="function"?null:w.render();return u.flags|=1,l!==null&&$?(u.child=_l(u,l.child,null,k),u.child=_l(u,null,X,k)):yr(l,u,X,k),u.memoizedState=w.state,A&&MA(u,m,!0),u.child}function O_(l){var u=l.stateNode;u.pendingContext?RA(l,u.pendingContext,u.pendingContext!==u.context):u.context&&RA(l,u.context,!1),hx(l,u.containerInfo)}function T_(l,u,m,w,A){return Al(),ox(A),u.flags|=256,yr(l,u,m,w),u.child}var Tx={dehydrated:null,treeContext:null,retryLane:0};function Rx(l){return{baseLanes:l,cachePool:null,transitions:null}}function R_(l,u,m){var w=u.pendingProps,A=xn.current,k=!1,$=(u.flags&128)!==0,X;if((X=$)||(X=l!==null&&l.memoizedState===null?!1:(A&2)!==0),X?(k=!0,u.flags&=-129):(l===null||l.memoizedState!==null)&&(A|=1),rn(xn,A&1),l===null)return ix(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):($=w.children,l=w.fallback,k?(w=u.mode,k=u.child,$={mode:"hidden",children:$},(w&1)===0&&k!==null?(k.childLanes=0,k.pendingProps=$):k=Dp($,w,0,null),l=vo(l,w,m,null),k.return=u,l.return=u,k.sibling=l,u.child=k,u.child.memoizedState=Rx(m),u.memoizedState=Tx,l):Ix(u,$));if(A=l.memoizedState,A!==null&&(X=A.dehydrated,X!==null))return nU(l,u,$,w,X,A,m);if(k){k=w.fallback,$=u.mode,A=l.child,X=A.sibling;var ne={mode:"hidden",children:w.children};return($&1)===0&&u.child!==A?(w=u.child,w.childLanes=0,w.pendingProps=ne,u.deletions=null):(w=Pi(A,ne),w.subtreeFlags=A.subtreeFlags&14680064),X!==null?k=Pi(X,k):(k=vo(k,$,m,null),k.flags|=2),k.return=u,w.return=u,w.sibling=k,u.child=w,w=k,k=u.child,$=l.child.memoizedState,$=$===null?Rx(m):{baseLanes:$.baseLanes|m,cachePool:null,transitions:$.transitions},k.memoizedState=$,k.childLanes=l.childLanes&~m,u.memoizedState=Tx,w}return k=l.child,l=k.sibling,w=Pi(k,{mode:"visible",children:w.children}),(u.mode&1)===0&&(w.lanes=m),w.return=u,w.sibling=null,l!==null&&(m=u.deletions,m===null?(u.deletions=[l],u.flags|=16):m.push(l)),u.child=w,u.memoizedState=null,w}function Ix(l,u){return u=Dp({mode:"visible",children:u},l.mode,0,null),u.return=l,l.child=u}function Np(l,u,m,w){return w!==null&&ox(w),_l(u,l.child,null,m),l=Ix(u,u.pendingProps.children),l.flags|=2,u.memoizedState=null,l}function nU(l,u,m,w,A,k,$){if(m)return u.flags&256?(u.flags&=-257,w=Ex(Error(n(422))),Np(l,u,$,w)):u.memoizedState!==null?(u.child=l.child,u.flags|=128,null):(k=w.fallback,A=u.mode,w=Dp({mode:"visible",children:w.children},A,0,null),k=vo(k,A,$,null),k.flags|=2,w.return=u,k.return=u,w.sibling=k,u.child=w,(u.mode&1)!==0&&_l(u,l.child,null,$),u.child.memoizedState=Rx($),u.memoizedState=Tx,k);if((u.mode&1)===0)return Np(l,u,$,null);if(A.data==="$!"){if(w=A.nextSibling&&A.nextSibling.dataset,w)var X=w.dgst;return w=X,k=Error(n(419)),w=Ex(k,w,void 0),Np(l,u,$,w)}if(X=($&l.childLanes)!==0,kr||X){if(w=Jn,w!==null){switch($&-$){case 4:A=2;break;case 16:A=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:A=32;break;case 536870912:A=268435456;break;default:A=0}A=(A&(w.suspendedLanes|$))!==0?0:A,A!==0&&A!==k.retryLane&&(k.retryLane=A,Ms(l,A),$a(w,l,A,-1))}return Xx(),w=Ex(Error(n(421))),Np(l,u,$,w)}return A.data==="$?"?(u.flags|=128,u.child=l.child,u=mU.bind(null,l),A._reactRetry=u,null):(l=k.treeContext,Gr=xi(A.nextSibling),Kr=u,hn=!0,Ta=null,l!==null&&(ua[da++]=Rs,ua[da++]=Is,ua[da++]=io,Rs=l.id,Is=l.overflow,io=u),u=Ix(u,w.children),u.flags|=4096,u)}function I_(l,u,m){l.lanes|=u;var w=l.alternate;w!==null&&(w.lanes|=u),dx(l.return,u,m)}function Mx(l,u,m,w,A){var k=l.memoizedState;k===null?l.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:w,tail:m,tailMode:A}:(k.isBackwards=u,k.rendering=null,k.renderingStartTime=0,k.last=w,k.tail=m,k.tailMode=A)}function M_(l,u,m){var w=u.pendingProps,A=w.revealOrder,k=w.tail;if(yr(l,u,w.children,m),w=xn.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&&I_(l,m,u);else if(l.tag===19)I_(l,m,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(rn(xn,w),(u.mode&1)===0)u.memoizedState=null;else switch(A){case"forwards":for(m=u.child,A=null;m!==null;)l=m.alternate,l!==null&&gp(l)===null&&(A=m),m=m.sibling;m=A,m===null?(A=u.child,u.child=null):(A=m.sibling,m.sibling=null),Mx(u,!1,A,m,k);break;case"backwards":for(m=null,A=u.child,u.child=null;A!==null;){if(l=A.alternate,l!==null&&gp(l)===null){u.child=A;break}l=A.sibling,A.sibling=m,m=A,A=l}Mx(u,!0,m,null,k);break;case"together":Mx(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function Cp(l,u){(u.mode&1)===0&&l!==null&&(l.alternate=null,u.alternate=null,u.flags|=2)}function Ds(l,u,m){if(l!==null&&(u.dependencies=l.dependencies),fo|=u.lanes,(m&u.childLanes)===0)return null;if(l!==null&&u.child!==l.child)throw Error(n(153));if(u.child!==null){for(l=u.child,m=Pi(l,l.pendingProps),u.child=m,m.return=u;l.sibling!==null;)l=l.sibling,m=m.sibling=Pi(l,l.pendingProps),m.return=u;m.sibling=null}return u.child}function rU(l,u,m){switch(u.tag){case 3:O_(u),Al();break;case 5:YA(u);break;case 1:Pr(u.type)&&op(u);break;case 4:hx(u,u.stateNode.containerInfo);break;case 10:var w=u.type._context,A=u.memoizedProps.value;rn(pp,w._currentValue),w._currentValue=A;break;case 13:if(w=u.memoizedState,w!==null)return w.dehydrated!==null?(rn(xn,xn.current&1),u.flags|=128,null):(m&u.child.childLanes)!==0?R_(l,u,m):(rn(xn,xn.current&1),l=Ds(l,u,m),l!==null?l.sibling:null);rn(xn,xn.current&1);break;case 19:if(w=(m&u.childLanes)!==0,(l.flags&128)!==0){if(w)return M_(l,u,m);u.flags|=128}if(A=u.memoizedState,A!==null&&(A.rendering=null,A.tail=null,A.lastEffect=null),rn(xn,xn.current),w)break;return null;case 22:case 23:return u.lanes=0,E_(l,u,m)}return Ds(l,u,m)}var $_,$x,D_,L_;$_=function(l,u){for(var m=u.child;m!==null;){if(m.tag===5||m.tag===6)l.appendChild(m.stateNode);else if(m.tag!==4&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===u)break;for(;m.sibling===null;){if(m.return===null||m.return===u)return;m=m.return}m.sibling.return=m.return,m=m.sibling}},$x=function(){},D_=function(l,u,m,w){var A=l.memoizedProps;if(A!==w){l=u.stateNode,co(as.current);var k=null;switch(m){case"input":A=Ae(l,A),w=Ae(l,w),k=[];break;case"select":A=ee({},A,{value:void 0}),w=ee({},w,{value:void 0}),k=[];break;case"textarea":A=Ke(l,A),w=Ke(l,w),k=[];break;default:typeof A.onClick!="function"&&typeof w.onClick=="function"&&(l.onclick=ap)}Dn(m,w);var $;m=null;for(ve in A)if(!w.hasOwnProperty(ve)&&A.hasOwnProperty(ve)&&A[ve]!=null)if(ve==="style"){var X=A[ve];for($ in X)X.hasOwnProperty($)&&(m||(m={}),m[$]="")}else ve!=="dangerouslySetInnerHTML"&&ve!=="children"&&ve!=="suppressContentEditableWarning"&&ve!=="suppressHydrationWarning"&&ve!=="autoFocus"&&(a.hasOwnProperty(ve)?k||(k=[]):(k=k||[]).push(ve,null));for(ve in w){var ne=w[ve];if(X=A?.[ve],w.hasOwnProperty(ve)&&ne!==X&&(ne!=null||X!=null))if(ve==="style")if(X){for($ in X)!X.hasOwnProperty($)||ne&&ne.hasOwnProperty($)||(m||(m={}),m[$]="");for($ in ne)ne.hasOwnProperty($)&&X[$]!==ne[$]&&(m||(m={}),m[$]=ne[$])}else m||(k||(k=[]),k.push(ve,m)),m=ne;else ve==="dangerouslySetInnerHTML"?(ne=ne?ne.__html:void 0,X=X?X.__html:void 0,ne!=null&&X!==ne&&(k=k||[]).push(ve,ne)):ve==="children"?typeof ne!="string"&&typeof ne!="number"||(k=k||[]).push(ve,""+ne):ve!=="suppressContentEditableWarning"&&ve!=="suppressHydrationWarning"&&(a.hasOwnProperty(ve)?(ne!=null&&ve==="onScroll"&&un("scroll",l),k||X===ne||(k=[])):(k=k||[]).push(ve,ne))}m&&(k=k||[]).push("style",m);var ve=k;(u.updateQueue=ve)&&(u.flags|=4)}},L_=function(l,u,m,w){m!==w&&(u.flags|=4)};function Bu(l,u){if(!hn)switch(l.tailMode){case"hidden":u=l.tail;for(var m=null;u!==null;)u.alternate!==null&&(m=u),u=u.sibling;m===null?l.tail=null:m.sibling=null;break;case"collapsed":m=l.tail;for(var w=null;m!==null;)m.alternate!==null&&(w=m),m=m.sibling;w===null?u||l.tail===null?l.tail=null:l.tail.sibling=null:w.sibling=null}}function mr(l){var u=l.alternate!==null&&l.alternate.child===l.child,m=0,w=0;if(u)for(var A=l.child;A!==null;)m|=A.lanes|A.childLanes,w|=A.subtreeFlags&14680064,w|=A.flags&14680064,A.return=l,A=A.sibling;else for(A=l.child;A!==null;)m|=A.lanes|A.childLanes,w|=A.subtreeFlags,w|=A.flags,A.return=l,A=A.sibling;return l.subtreeFlags|=w,l.childLanes=m,u}function aU(l,u,m){var w=u.pendingProps;switch(ax(u),u.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mr(u),null;case 1:return Pr(u.type)&&ip(),mr(u),null;case 3:return w=u.stateNode,kl(),dn(Er),dn(pr),gx(),w.pendingContext&&(w.context=w.pendingContext,w.pendingContext=null),(l===null||l.child===null)&&(dp(u)?u.flags|=4:l===null||l.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,Ta!==null&&(Kx(Ta),Ta=null))),$x(l,u),mr(u),null;case 5:mx(u);var A=co(Mu.current);if(m=u.type,l!==null&&u.stateNode!=null)D_(l,u,m,w,A),l.ref!==u.ref&&(u.flags|=512,u.flags|=2097152);else{if(!w){if(u.stateNode===null)throw Error(n(166));return mr(u),null}if(l=co(as.current),dp(u)){w=u.stateNode,m=u.type;var k=u.memoizedProps;switch(w[rs]=u,w[ku]=k,l=(u.mode&1)!==0,m){case"dialog":un("cancel",w),un("close",w);break;case"iframe":case"object":case"embed":un("load",w);break;case"video":case"audio":for(A=0;A<_u.length;A++)un(_u[A],w);break;case"source":un("error",w);break;case"img":case"image":case"link":un("error",w),un("load",w);break;case"details":un("toggle",w);break;case"input":Ye(w,k),un("invalid",w);break;case"select":w._wrapperState={wasMultiple:!!k.multiple},un("invalid",w);break;case"textarea":bt(w,k),un("invalid",w)}Dn(m,k),A=null;for(var $ in k)if(k.hasOwnProperty($)){var X=k[$];$==="children"?typeof X=="string"?w.textContent!==X&&(k.suppressHydrationWarning!==!0&&rp(w.textContent,X,l),A=["children",X]):typeof X=="number"&&w.textContent!==""+X&&(k.suppressHydrationWarning!==!0&&rp(w.textContent,X,l),A=["children",""+X]):a.hasOwnProperty($)&&X!=null&&$==="onScroll"&&un("scroll",w)}switch(m){case"input":Ce(w),Y(w,k,!0);break;case"textarea":Ce(w),Q(w);break;case"select":case"option":break;default:typeof k.onClick=="function"&&(w.onclick=ap)}w=A,u.updateQueue=w,w!==null&&(u.flags|=4)}else{$=A.nodeType===9?A:A.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=je(m)),l==="http://www.w3.org/1999/xhtml"?m==="script"?(l=$.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild)):typeof w.is=="string"?l=$.createElement(m,{is:w.is}):(l=$.createElement(m),m==="select"&&($=l,w.multiple?$.multiple=!0:w.size&&($.size=w.size))):l=$.createElementNS(l,m),l[rs]=u,l[ku]=w,$_(l,u,!1,!1),u.stateNode=l;e:{switch($=dr(m,w),m){case"dialog":un("cancel",l),un("close",l),A=w;break;case"iframe":case"object":case"embed":un("load",l),A=w;break;case"video":case"audio":for(A=0;A<_u.length;A++)un(_u[A],l);A=w;break;case"source":un("error",l),A=w;break;case"img":case"image":case"link":un("error",l),un("load",l),A=w;break;case"details":un("toggle",l),A=w;break;case"input":Ye(l,w),A=Ae(l,w),un("invalid",l);break;case"option":A=w;break;case"select":l._wrapperState={wasMultiple:!!w.multiple},A=ee({},w,{value:void 0}),un("invalid",l);break;case"textarea":bt(l,w),A=Ke(l,w),un("invalid",l);break;default:A=w}Dn(m,A),X=A;for(k in X)if(X.hasOwnProperty(k)){var ne=X[k];k==="style"?cr(l,ne):k==="dangerouslySetInnerHTML"?(ne=ne?ne.__html:void 0,ne!=null&&Be(l,ne)):k==="children"?typeof ne=="string"?(m!=="textarea"||ne!=="")&&et(l,ne):typeof ne=="number"&&et(l,""+ne):k!=="suppressContentEditableWarning"&&k!=="suppressHydrationWarning"&&k!=="autoFocus"&&(a.hasOwnProperty(k)?ne!=null&&k==="onScroll"&&un("scroll",l):ne!=null&&N(l,k,ne,$))}switch(m){case"input":Ce(l),Y(l,w,!1);break;case"textarea":Ce(l),Q(l);break;case"option":w.value!=null&&l.setAttribute("value",""+ce(w.value));break;case"select":l.multiple=!!w.multiple,k=w.value,k!=null?Oe(l,!!w.multiple,k,!1):w.defaultValue!=null&&Oe(l,!!w.multiple,w.defaultValue,!0);break;default:typeof A.onClick=="function"&&(l.onclick=ap)}switch(m){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 mr(u),null;case 6:if(l&&u.stateNode!=null)L_(l,u,l.memoizedProps,w);else{if(typeof w!="string"&&u.stateNode===null)throw Error(n(166));if(m=co(Mu.current),co(as.current),dp(u)){if(w=u.stateNode,m=u.memoizedProps,w[rs]=u,(k=w.nodeValue!==m)&&(l=Kr,l!==null))switch(l.tag){case 3:rp(w.nodeValue,m,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&rp(w.nodeValue,m,(l.mode&1)!==0)}k&&(u.flags|=4)}else w=(m.nodeType===9?m:m.ownerDocument).createTextNode(w),w[rs]=u,u.stateNode=w}return mr(u),null;case 13:if(dn(xn),w=u.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(hn&&Gr!==null&&(u.mode&1)!==0&&(u.flags&128)===0)zA(),Al(),u.flags|=98560,k=!1;else if(k=dp(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[rs]=u}else Al(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;mr(u),k=!1}else Ta!==null&&(Kx(Ta),Ta=null),k=!0;if(!k)return u.flags&65536?u:null}return(u.flags&128)!==0?(u.lanes=m,u):(w=w!==null,w!==(l!==null&&l.memoizedState!==null)&&w&&(u.child.flags|=8192,(u.mode&1)!==0&&(l===null||(xn.current&1)!==0?Bn===0&&(Bn=3):Xx())),u.updateQueue!==null&&(u.flags|=4),mr(u),null);case 4:return kl(),$x(l,u),l===null&&Eu(u.stateNode.containerInfo),mr(u),null;case 10:return ux(u.type._context),mr(u),null;case 17:return Pr(u.type)&&ip(),mr(u),null;case 19:if(dn(xn),k=u.memoizedState,k===null)return mr(u),null;if(w=(u.flags&128)!==0,$=k.rendering,$===null)if(w)Bu(k,!1);else{if(Bn!==0||l!==null&&(l.flags&128)!==0)for(l=u.child;l!==null;){if($=gp(l),$!==null){for(u.flags|=128,Bu(k,!1),w=$.updateQueue,w!==null&&(u.updateQueue=w,u.flags|=4),u.subtreeFlags=0,w=m,m=u.child;m!==null;)k=m,l=w,k.flags&=14680066,$=k.alternate,$===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=$.childLanes,k.lanes=$.lanes,k.child=$.child,k.subtreeFlags=0,k.deletions=null,k.memoizedProps=$.memoizedProps,k.memoizedState=$.memoizedState,k.updateQueue=$.updateQueue,k.type=$.type,l=$.dependencies,k.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),m=m.sibling;return rn(xn,xn.current&1|2),u.child}l=l.sibling}k.tail!==null&&cn()>Il&&(u.flags|=128,w=!0,Bu(k,!1),u.lanes=4194304)}else{if(!w)if(l=gp($),l!==null){if(u.flags|=128,w=!0,m=l.updateQueue,m!==null&&(u.updateQueue=m,u.flags|=4),Bu(k,!0),k.tail===null&&k.tailMode==="hidden"&&!$.alternate&&!hn)return mr(u),null}else 2*cn()-k.renderingStartTime>Il&&m!==1073741824&&(u.flags|=128,w=!0,Bu(k,!1),u.lanes=4194304);k.isBackwards?($.sibling=u.child,u.child=$):(m=k.last,m!==null?m.sibling=$:u.child=$,k.last=$)}return k.tail!==null?(u=k.tail,k.rendering=u,k.tail=u.sibling,k.renderingStartTime=cn(),u.sibling=null,m=xn.current,rn(xn,w?m&1|2:m&1),u):(mr(u),null);case 22:case 23:return Yx(),w=u.memoizedState!==null,l!==null&&l.memoizedState!==null!==w&&(u.flags|=8192),w&&(u.mode&1)!==0?(Yr&1073741824)!==0&&(mr(u),u.subtreeFlags&6&&(u.flags|=8192)):mr(u),null;case 24:return null;case 25:return null}throw Error(n(156,u.tag))}function sU(l,u){switch(ax(u),u.tag){case 1:return Pr(u.type)&&ip(),l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 3:return kl(),dn(Er),dn(pr),gx(),l=u.flags,(l&65536)!==0&&(l&128)===0?(u.flags=l&-65537|128,u):null;case 5:return mx(u),null;case 13:if(dn(xn),l=u.memoizedState,l!==null&&l.dehydrated!==null){if(u.alternate===null)throw Error(n(340));Al()}return l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 19:return dn(xn),null;case 4:return kl(),null;case 10:return ux(u.type._context),null;case 22:case 23:return Yx(),null;case 24:return null;default:return null}}var Ap=!1,vr=!1,iU=typeof WeakSet=="function"?WeakSet:Set,Je=null;function Tl(l,u){var m=l.ref;if(m!==null)if(typeof m=="function")try{m(null)}catch(w){An(l,u,w)}else m.current=null}function Dx(l,u,m){try{m()}catch(w){An(l,u,w)}}var F_=!1;function oU(l,u){if(Yg=Hf,l=gA(),zg(l)){if("selectionStart"in l)var m={start:l.selectionStart,end:l.selectionEnd};else e:{m=(m=l.ownerDocument)&&m.defaultView||window;var w=m.getSelection&&m.getSelection();if(w&&w.rangeCount!==0){m=w.anchorNode;var A=w.anchorOffset,k=w.focusNode;w=w.focusOffset;try{m.nodeType,k.nodeType}catch{m=null;break e}var $=0,X=-1,ne=-1,ve=0,Ee=0,Ie=l,_e=null;t:for(;;){for(var Xe;Ie!==m||A!==0&&Ie.nodeType!==3||(X=$+A),Ie!==k||w!==0&&Ie.nodeType!==3||(ne=$+w),Ie.nodeType===3&&($+=Ie.nodeValue.length),(Xe=Ie.firstChild)!==null;)_e=Ie,Ie=Xe;for(;;){if(Ie===l)break t;if(_e===m&&++ve===A&&(X=$),_e===k&&++Ee===w&&(ne=$),(Xe=Ie.nextSibling)!==null)break;Ie=_e,_e=Ie.parentNode}Ie=Xe}m=X===-1||ne===-1?null:{start:X,end:ne}}else m=null}m=m||{start:0,end:0}}else m=null;for(Xg={focusedElem:l,selectionRange:m},Hf=!1,Je=u;Je!==null;)if(u=Je,l=u.child,(u.subtreeFlags&1028)!==0&&l!==null)l.return=u,Je=l;else for(;Je!==null;){u=Je;try{var nt=u.alternate;if((u.flags&1024)!==0)switch(u.tag){case 0:case 11:case 15:break;case 1:if(nt!==null){var at=nt.memoizedProps,On=nt.memoizedState,he=u.stateNode,se=he.getSnapshotBeforeUpdate(u.elementType===u.type?at:Ra(u.type,at),On);he.__reactInternalSnapshotBeforeUpdate=se}break;case 3:var me=u.stateNode.containerInfo;me.nodeType===1?me.textContent="":me.nodeType===9&&me.documentElement&&me.removeChild(me.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Le){An(u,u.return,Le)}if(l=u.sibling,l!==null){l.return=u.return,Je=l;break}Je=u.return}return nt=F_,F_=!1,nt}function zu(l,u,m){var w=u.updateQueue;if(w=w!==null?w.lastEffect:null,w!==null){var A=w=w.next;do{if((A.tag&l)===l){var k=A.destroy;A.destroy=void 0,k!==void 0&&Dx(u,m,k)}A=A.next}while(A!==w)}}function _p(l,u){if(u=u.updateQueue,u=u!==null?u.lastEffect:null,u!==null){var m=u=u.next;do{if((m.tag&l)===l){var w=m.create;m.destroy=w()}m=m.next}while(m!==u)}}function Lx(l){var u=l.ref;if(u!==null){var m=l.stateNode;l.tag,l=m,typeof u=="function"?u(l):u.current=l}}function B_(l){var u=l.alternate;u!==null&&(l.alternate=null,B_(u)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(u=l.stateNode,u!==null&&(delete u[rs],delete u[ku],delete u[ex],delete u[q6],delete u[W6])),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 z_(l){return l.tag===5||l.tag===3||l.tag===4}function U_(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||z_(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 Fx(l,u,m){var w=l.tag;if(w===5||w===6)l=l.stateNode,u?m.nodeType===8?m.parentNode.insertBefore(l,u):m.insertBefore(l,u):(m.nodeType===8?(u=m.parentNode,u.insertBefore(l,m)):(u=m,u.appendChild(l)),m=m._reactRootContainer,m!=null||u.onclick!==null||(u.onclick=ap));else if(w!==4&&(l=l.child,l!==null))for(Fx(l,u,m),l=l.sibling;l!==null;)Fx(l,u,m),l=l.sibling}function Bx(l,u,m){var w=l.tag;if(w===5||w===6)l=l.stateNode,u?m.insertBefore(l,u):m.appendChild(l);else if(w!==4&&(l=l.child,l!==null))for(Bx(l,u,m),l=l.sibling;l!==null;)Bx(l,u,m),l=l.sibling}var ar=null,Ia=!1;function Ni(l,u,m){for(m=m.child;m!==null;)q_(l,u,m),m=m.sibling}function q_(l,u,m){if(la&&typeof la.onCommitFiberUnmount=="function")try{la.onCommitFiberUnmount(ks,m)}catch{}switch(m.tag){case 5:vr||Tl(m,u);case 6:var w=ar,A=Ia;ar=null,Ni(l,u,m),ar=w,Ia=A,ar!==null&&(Ia?(l=ar,m=m.stateNode,l.nodeType===8?l.parentNode.removeChild(m):l.removeChild(m)):ar.removeChild(m.stateNode));break;case 18:ar!==null&&(Ia?(l=ar,m=m.stateNode,l.nodeType===8?Zg(l.parentNode,m):l.nodeType===1&&Zg(l,m),yu(l)):Zg(ar,m.stateNode));break;case 4:w=ar,A=Ia,ar=m.stateNode.containerInfo,Ia=!0,Ni(l,u,m),ar=w,Ia=A;break;case 0:case 11:case 14:case 15:if(!vr&&(w=m.updateQueue,w!==null&&(w=w.lastEffect,w!==null))){A=w=w.next;do{var k=A,$=k.destroy;k=k.tag,$!==void 0&&((k&2)!==0||(k&4)!==0)&&Dx(m,u,$),A=A.next}while(A!==w)}Ni(l,u,m);break;case 1:if(!vr&&(Tl(m,u),w=m.stateNode,typeof w.componentWillUnmount=="function"))try{w.props=m.memoizedProps,w.state=m.memoizedState,w.componentWillUnmount()}catch(X){An(m,u,X)}Ni(l,u,m);break;case 21:Ni(l,u,m);break;case 22:m.mode&1?(vr=(w=vr)||m.memoizedState!==null,Ni(l,u,m),vr=w):Ni(l,u,m);break;default:Ni(l,u,m)}}function W_(l){var u=l.updateQueue;if(u!==null){l.updateQueue=null;var m=l.stateNode;m===null&&(m=l.stateNode=new iU),u.forEach(function(w){var A=vU.bind(null,l,w);m.has(w)||(m.add(w),w.then(A,A))})}}function Ma(l,u){var m=u.deletions;if(m!==null)for(var w=0;w<m.length;w++){var A=m[w];try{var k=l,$=u,X=$;e:for(;X!==null;){switch(X.tag){case 5:ar=X.stateNode,Ia=!1;break e;case 3:ar=X.stateNode.containerInfo,Ia=!0;break e;case 4:ar=X.stateNode.containerInfo,Ia=!0;break e}X=X.return}if(ar===null)throw Error(n(160));q_(k,$,A),ar=null,Ia=!1;var ne=A.alternate;ne!==null&&(ne.return=null),A.return=null}catch(ve){An(A,u,ve)}}if(u.subtreeFlags&12854)for(u=u.child;u!==null;)V_(u,l),u=u.sibling}function V_(l,u){var m=l.alternate,w=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(Ma(u,l),is(l),w&4){try{zu(3,l,l.return),_p(3,l)}catch(at){An(l,l.return,at)}try{zu(5,l,l.return)}catch(at){An(l,l.return,at)}}break;case 1:Ma(u,l),is(l),w&512&&m!==null&&Tl(m,m.return);break;case 5:if(Ma(u,l),is(l),w&512&&m!==null&&Tl(m,m.return),l.flags&32){var A=l.stateNode;try{et(A,"")}catch(at){An(l,l.return,at)}}if(w&4&&(A=l.stateNode,A!=null)){var k=l.memoizedProps,$=m!==null?m.memoizedProps:k,X=l.type,ne=l.updateQueue;if(l.updateQueue=null,ne!==null)try{X==="input"&&k.type==="radio"&&k.name!=null&&be(A,k),dr(X,$);var ve=dr(X,k);for($=0;$<ne.length;$+=2){var Ee=ne[$],Ie=ne[$+1];Ee==="style"?cr(A,Ie):Ee==="dangerouslySetInnerHTML"?Be(A,Ie):Ee==="children"?et(A,Ie):N(A,Ee,Ie,ve)}switch(X){case"input":Re(A,k);break;case"textarea":It(A,k);break;case"select":var _e=A._wrapperState.wasMultiple;A._wrapperState.wasMultiple=!!k.multiple;var Xe=k.value;Xe!=null?Oe(A,!!k.multiple,Xe,!1):_e!==!!k.multiple&&(k.defaultValue!=null?Oe(A,!!k.multiple,k.defaultValue,!0):Oe(A,!!k.multiple,k.multiple?[]:"",!1))}A[ku]=k}catch(at){An(l,l.return,at)}}break;case 6:if(Ma(u,l),is(l),w&4){if(l.stateNode===null)throw Error(n(162));A=l.stateNode,k=l.memoizedProps;try{A.nodeValue=k}catch(at){An(l,l.return,at)}}break;case 3:if(Ma(u,l),is(l),w&4&&m!==null&&m.memoizedState.isDehydrated)try{yu(u.containerInfo)}catch(at){An(l,l.return,at)}break;case 4:Ma(u,l),is(l);break;case 13:Ma(u,l),is(l),A=l.child,A.flags&8192&&(k=A.memoizedState!==null,A.stateNode.isHidden=k,!k||A.alternate!==null&&A.alternate.memoizedState!==null||(qx=cn())),w&4&&W_(l);break;case 22:if(Ee=m!==null&&m.memoizedState!==null,l.mode&1?(vr=(ve=vr)||Ee,Ma(u,l),vr=ve):Ma(u,l),is(l),w&8192){if(ve=l.memoizedState!==null,(l.stateNode.isHidden=ve)&&!Ee&&(l.mode&1)!==0)for(Je=l,Ee=l.child;Ee!==null;){for(Ie=Je=Ee;Je!==null;){switch(_e=Je,Xe=_e.child,_e.tag){case 0:case 11:case 14:case 15:zu(4,_e,_e.return);break;case 1:Tl(_e,_e.return);var nt=_e.stateNode;if(typeof nt.componentWillUnmount=="function"){w=_e,m=_e.return;try{u=w,nt.props=u.memoizedProps,nt.state=u.memoizedState,nt.componentWillUnmount()}catch(at){An(w,m,at)}}break;case 5:Tl(_e,_e.return);break;case 22:if(_e.memoizedState!==null){G_(Ie);continue}}Xe!==null?(Xe.return=_e,Je=Xe):G_(Ie)}Ee=Ee.sibling}e:for(Ee=null,Ie=l;;){if(Ie.tag===5){if(Ee===null){Ee=Ie;try{A=Ie.stateNode,ve?(k=A.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none"):(X=Ie.stateNode,ne=Ie.memoizedProps.style,$=ne!=null&&ne.hasOwnProperty("display")?ne.display:null,X.style.display=Nn("display",$))}catch(at){An(l,l.return,at)}}}else if(Ie.tag===6){if(Ee===null)try{Ie.stateNode.nodeValue=ve?"":Ie.memoizedProps}catch(at){An(l,l.return,at)}}else if((Ie.tag!==22&&Ie.tag!==23||Ie.memoizedState===null||Ie===l)&&Ie.child!==null){Ie.child.return=Ie,Ie=Ie.child;continue}if(Ie===l)break e;for(;Ie.sibling===null;){if(Ie.return===null||Ie.return===l)break e;Ee===Ie&&(Ee=null),Ie=Ie.return}Ee===Ie&&(Ee=null),Ie.sibling.return=Ie.return,Ie=Ie.sibling}}break;case 19:Ma(u,l),is(l),w&4&&W_(l);break;case 21:break;default:Ma(u,l),is(l)}}function is(l){var u=l.flags;if(u&2){try{e:{for(var m=l.return;m!==null;){if(z_(m)){var w=m;break e}m=m.return}throw Error(n(160))}switch(w.tag){case 5:var A=w.stateNode;w.flags&32&&(et(A,""),w.flags&=-33);var k=U_(l);Bx(l,k,A);break;case 3:case 4:var $=w.stateNode.containerInfo,X=U_(l);Fx(l,X,$);break;default:throw Error(n(161))}}catch(ne){An(l,l.return,ne)}l.flags&=-3}u&4096&&(l.flags&=-4097)}function lU(l,u,m){Je=l,H_(l)}function H_(l,u,m){for(var w=(l.mode&1)!==0;Je!==null;){var A=Je,k=A.child;if(A.tag===22&&w){var $=A.memoizedState!==null||Ap;if(!$){var X=A.alternate,ne=X!==null&&X.memoizedState!==null||vr;X=Ap;var ve=vr;if(Ap=$,(vr=ne)&&!ve)for(Je=A;Je!==null;)$=Je,ne=$.child,$.tag===22&&$.memoizedState!==null?Y_(A):ne!==null?(ne.return=$,Je=ne):Y_(A);for(;k!==null;)Je=k,H_(k),k=k.sibling;Je=A,Ap=X,vr=ve}K_(l)}else(A.subtreeFlags&8772)!==0&&k!==null?(k.return=A,Je=k):K_(l)}}function K_(l){for(;Je!==null;){var u=Je;if((u.flags&8772)!==0){var m=u.alternate;try{if((u.flags&8772)!==0)switch(u.tag){case 0:case 11:case 15:vr||_p(5,u);break;case 1:var w=u.stateNode;if(u.flags&4&&!vr)if(m===null)w.componentDidMount();else{var A=u.elementType===u.type?m.memoizedProps:Ra(u.type,m.memoizedProps);w.componentDidUpdate(A,m.memoizedState,w.__reactInternalSnapshotBeforeUpdate)}var k=u.updateQueue;k!==null&&GA(u,k,w);break;case 3:var $=u.updateQueue;if($!==null){if(m=null,u.child!==null)switch(u.child.tag){case 5:m=u.child.stateNode;break;case 1:m=u.child.stateNode}GA(u,$,m)}break;case 5:var X=u.stateNode;if(m===null&&u.flags&4){m=X;var ne=u.memoizedProps;switch(u.type){case"button":case"input":case"select":case"textarea":ne.autoFocus&&m.focus();break;case"img":ne.src&&(m.src=ne.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(u.memoizedState===null){var ve=u.alternate;if(ve!==null){var Ee=ve.memoizedState;if(Ee!==null){var Ie=Ee.dehydrated;Ie!==null&&yu(Ie)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}vr||u.flags&512&&Lx(u)}catch(_e){An(u,u.return,_e)}}if(u===l){Je=null;break}if(m=u.sibling,m!==null){m.return=u.return,Je=m;break}Je=u.return}}function G_(l){for(;Je!==null;){var u=Je;if(u===l){Je=null;break}var m=u.sibling;if(m!==null){m.return=u.return,Je=m;break}Je=u.return}}function Y_(l){for(;Je!==null;){var u=Je;try{switch(u.tag){case 0:case 11:case 15:var m=u.return;try{_p(4,u)}catch(ne){An(u,m,ne)}break;case 1:var w=u.stateNode;if(typeof w.componentDidMount=="function"){var A=u.return;try{w.componentDidMount()}catch(ne){An(u,A,ne)}}var k=u.return;try{Lx(u)}catch(ne){An(u,k,ne)}break;case 5:var $=u.return;try{Lx(u)}catch(ne){An(u,$,ne)}}}catch(ne){An(u,u.return,ne)}if(u===l){Je=null;break}var X=u.sibling;if(X!==null){X.return=u.return,Je=X;break}Je=u.return}}var cU=Math.ceil,Ep=E.ReactCurrentDispatcher,zx=E.ReactCurrentOwner,ha=E.ReactCurrentBatchConfig,Bt=0,Jn=null,In=null,sr=0,Yr=0,Rl=yi(0),Bn=0,Uu=null,fo=0,Pp=0,Ux=0,qu=null,Or=null,qx=0,Il=1/0,Ls=null,kp=!1,Wx=null,Ci=null,Op=!1,Ai=null,Tp=0,Wu=0,Vx=null,Rp=-1,Ip=0;function br(){return(Bt&6)!==0?cn():Rp!==-1?Rp:Rp=cn()}function _i(l){return(l.mode&1)===0?1:(Bt&2)!==0&&sr!==0?sr&-sr:H6.transition!==null?(Ip===0&&(Ip=dt()),Ip):(l=zt,l!==0||(l=window.event,l=l===void 0?16:QC(l.type)),l)}function $a(l,u,m,w){if(50<Wu)throw Wu=0,Vx=null,Error(n(185));Ln(l,m,w),((Bt&2)===0||l!==Jn)&&(l===Jn&&((Bt&2)===0&&(Pp|=m),Bn===4&&Ei(l,sr)),Tr(l,w),m===1&&Bt===0&&(u.mode&1)===0&&(Il=cn()+500,lp&&wi()))}function Tr(l,u){var m=l.callbackNode;Me(l,u);var w=ye(l,l===Jn?sr:0);if(w===0)m!==null&&Vt(m),l.callbackNode=null,l.callbackPriority=0;else if(u=w&-w,l.callbackPriority!==u){if(m!=null&&Vt(m),u===1)l.tag===0?V6(Q_.bind(null,l)):$A(Q_.bind(null,l)),z6(function(){(Bt&6)===0&&wi()}),m=null;else{switch(qf(w)){case 1:m=ul;break;case 4:m=Bf;break;case 16:m=di;break;case 536870912:m=hu;break;default:m=di}m=sE(m,X_.bind(null,l))}l.callbackPriority=u,l.callbackNode=m}}function X_(l,u){if(Rp=-1,Ip=0,(Bt&6)!==0)throw Error(n(327));var m=l.callbackNode;if(Ml()&&l.callbackNode!==m)return null;var w=ye(l,l===Jn?sr:0);if(w===0)return null;if((w&30)!==0||(w&l.expiredLanes)!==0||u)u=Mp(l,w);else{u=w;var A=Bt;Bt|=2;var k=Z_();(Jn!==l||sr!==u)&&(Ls=null,Il=cn()+500,ho(l,u));do try{fU();break}catch(X){J_(l,X)}while(!0);cx(),Ep.current=k,Bt=A,In!==null?u=0:(Jn=null,sr=0,u=Bn)}if(u!==0){if(u===2&&(A=kt(l),A!==0&&(w=A,u=Hx(l,A))),u===1)throw m=Uu,ho(l,0),Ei(l,w),Tr(l,cn()),m;if(u===6)Ei(l,w);else{if(A=l.current.alternate,(w&30)===0&&!uU(A)&&(u=Mp(l,w),u===2&&(k=kt(l),k!==0&&(w=k,u=Hx(l,k))),u===1))throw m=Uu,ho(l,0),Ei(l,w),Tr(l,cn()),m;switch(l.finishedWork=A,l.finishedLanes=w,u){case 0:case 1:throw Error(n(345));case 2:mo(l,Or,Ls);break;case 3:if(Ei(l,w),(w&130023424)===w&&(u=qx+500-cn(),10<u)){if(ye(l,0)!==0)break;if(A=l.suspendedLanes,(A&w)!==w){br(),l.pingedLanes|=l.suspendedLanes&A;break}l.timeoutHandle=Jg(mo.bind(null,l,Or,Ls),u);break}mo(l,Or,Ls);break;case 4:if(Ei(l,w),(w&4194240)===w)break;for(u=l.eventTimes,A=-1;0<w;){var $=31-Vr(w);k=1<<$,$=u[$],$>A&&(A=$),w&=~k}if(w=A,w=cn()-w,w=(120>w?120:480>w?480:1080>w?1080:1920>w?1920:3e3>w?3e3:4320>w?4320:1960*cU(w/1960))-w,10<w){l.timeoutHandle=Jg(mo.bind(null,l,Or,Ls),w);break}mo(l,Or,Ls);break;case 5:mo(l,Or,Ls);break;default:throw Error(n(329))}}}return Tr(l,cn()),l.callbackNode===m?X_.bind(null,l):null}function Hx(l,u){var m=qu;return l.current.memoizedState.isDehydrated&&(ho(l,u).flags|=256),l=Mp(l,u),l!==2&&(u=Or,Or=m,u!==null&&Kx(u)),l}function Kx(l){Or===null?Or=l:Or.push.apply(Or,l)}function uU(l){for(var u=l;;){if(u.flags&16384){var m=u.updateQueue;if(m!==null&&(m=m.stores,m!==null))for(var w=0;w<m.length;w++){var A=m[w],k=A.getSnapshot;A=A.value;try{if(!Oa(k(),A))return!1}catch{return!1}}}if(m=u.child,u.subtreeFlags&16384&&m!==null)m.return=u,u=m;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 Ei(l,u){for(u&=~Ux,u&=~Pp,l.suspendedLanes|=u,l.pingedLanes&=~u,l=l.expirationTimes;0<u;){var m=31-Vr(u),w=1<<m;l[m]=-1,u&=~w}}function Q_(l){if((Bt&6)!==0)throw Error(n(327));Ml();var u=ye(l,0);if((u&1)===0)return Tr(l,cn()),null;var m=Mp(l,u);if(l.tag!==0&&m===2){var w=kt(l);w!==0&&(u=w,m=Hx(l,w))}if(m===1)throw m=Uu,ho(l,0),Ei(l,u),Tr(l,cn()),m;if(m===6)throw Error(n(345));return l.finishedWork=l.current.alternate,l.finishedLanes=u,mo(l,Or,Ls),Tr(l,cn()),null}function Gx(l,u){var m=Bt;Bt|=1;try{return l(u)}finally{Bt=m,Bt===0&&(Il=cn()+500,lp&&wi())}}function po(l){Ai!==null&&Ai.tag===0&&(Bt&6)===0&&Ml();var u=Bt;Bt|=1;var m=ha.transition,w=zt;try{if(ha.transition=null,zt=1,l)return l()}finally{zt=w,ha.transition=m,Bt=u,(Bt&6)===0&&wi()}}function Yx(){Yr=Rl.current,dn(Rl)}function ho(l,u){l.finishedWork=null,l.finishedLanes=0;var m=l.timeoutHandle;if(m!==-1&&(l.timeoutHandle=-1,B6(m)),In!==null)for(m=In.return;m!==null;){var w=m;switch(ax(w),w.tag){case 1:w=w.type.childContextTypes,w!=null&&ip();break;case 3:kl(),dn(Er),dn(pr),gx();break;case 5:mx(w);break;case 4:kl();break;case 13:dn(xn);break;case 19:dn(xn);break;case 10:ux(w.type._context);break;case 22:case 23:Yx()}m=m.return}if(Jn=l,In=l=Pi(l.current,null),sr=Yr=u,Bn=0,Uu=null,Ux=Pp=fo=0,Or=qu=null,lo!==null){for(u=0;u<lo.length;u++)if(m=lo[u],w=m.interleaved,w!==null){m.interleaved=null;var A=w.next,k=m.pending;if(k!==null){var $=k.next;k.next=A,w.next=$}m.pending=w}lo=null}return l}function J_(l,u){do{var m=In;try{if(cx(),xp.current=jp,yp){for(var w=yn.memoizedState;w!==null;){var A=w.queue;A!==null&&(A.pending=null),w=w.next}yp=!1}if(uo=0,Qn=Fn=yn=null,$u=!1,Du=0,zx.current=null,m===null||m.return===null){Bn=1,Uu=u,In=null;break}e:{var k=l,$=m.return,X=m,ne=u;if(u=sr,X.flags|=32768,ne!==null&&typeof ne=="object"&&typeof ne.then=="function"){var ve=ne,Ee=X,Ie=Ee.tag;if((Ee.mode&1)===0&&(Ie===0||Ie===11||Ie===15)){var _e=Ee.alternate;_e?(Ee.updateQueue=_e.updateQueue,Ee.memoizedState=_e.memoizedState,Ee.lanes=_e.lanes):(Ee.updateQueue=null,Ee.memoizedState=null)}var Xe=S_($);if(Xe!==null){Xe.flags&=-257,N_(Xe,$,X,k,u),Xe.mode&1&&j_(k,ve,u),u=Xe,ne=ve;var nt=u.updateQueue;if(nt===null){var at=new Set;at.add(ne),u.updateQueue=at}else nt.add(ne);break e}else{if((u&1)===0){j_(k,ve,u),Xx();break e}ne=Error(n(426))}}else if(hn&&X.mode&1){var On=S_($);if(On!==null){(On.flags&65536)===0&&(On.flags|=256),N_(On,$,X,k,u),ox(Ol(ne,X));break e}}k=ne=Ol(ne,X),Bn!==4&&(Bn=2),qu===null?qu=[k]:qu.push(k),k=$;do{switch(k.tag){case 3:k.flags|=65536,u&=-u,k.lanes|=u;var he=b_(k,ne,u);KA(k,he);break e;case 1:X=ne;var se=k.type,me=k.stateNode;if((k.flags&128)===0&&(typeof se.getDerivedStateFromError=="function"||me!==null&&typeof me.componentDidCatch=="function"&&(Ci===null||!Ci.has(me)))){k.flags|=65536,u&=-u,k.lanes|=u;var Le=w_(k,X,u);KA(k,Le);break e}}k=k.return}while(k!==null)}tE(m)}catch(ot){u=ot,In===m&&m!==null&&(In=m=m.return);continue}break}while(!0)}function Z_(){var l=Ep.current;return Ep.current=jp,l===null?jp:l}function Xx(){(Bn===0||Bn===3||Bn===2)&&(Bn=4),Jn===null||(fo&268435455)===0&&(Pp&268435455)===0||Ei(Jn,sr)}function Mp(l,u){var m=Bt;Bt|=2;var w=Z_();(Jn!==l||sr!==u)&&(Ls=null,ho(l,u));do try{dU();break}catch(A){J_(l,A)}while(!0);if(cx(),Bt=m,Ep.current=w,In!==null)throw Error(n(261));return Jn=null,sr=0,Bn}function dU(){for(;In!==null;)eE(In)}function fU(){for(;In!==null&&!Ft();)eE(In)}function eE(l){var u=aE(l.alternate,l,Yr);l.memoizedProps=l.pendingProps,u===null?tE(l):In=u,zx.current=null}function tE(l){var u=l;do{var m=u.alternate;if(l=u.return,(u.flags&32768)===0){if(m=aU(m,u,Yr),m!==null){In=m;return}}else{if(m=sU(m,u),m!==null){m.flags&=32767,In=m;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{Bn=6,In=null;return}}if(u=u.sibling,u!==null){In=u;return}In=u=l}while(u!==null);Bn===0&&(Bn=5)}function mo(l,u,m){var w=zt,A=ha.transition;try{ha.transition=null,zt=1,pU(l,u,m,w)}finally{ha.transition=A,zt=w}return null}function pU(l,u,m,w){do Ml();while(Ai!==null);if((Bt&6)!==0)throw Error(n(327));m=l.finishedWork;var A=l.finishedLanes;if(m===null)return null;if(l.finishedWork=null,l.finishedLanes=0,m===l.current)throw Error(n(177));l.callbackNode=null,l.callbackPriority=0;var k=m.lanes|m.childLanes;if(Qt(l,k),l===Jn&&(In=Jn=null,sr=0),(m.subtreeFlags&2064)===0&&(m.flags&2064)===0||Op||(Op=!0,sE(di,function(){return Ml(),null})),k=(m.flags&15990)!==0,(m.subtreeFlags&15990)!==0||k){k=ha.transition,ha.transition=null;var $=zt;zt=1;var X=Bt;Bt|=4,zx.current=null,oU(l,m),V_(m,l),R6(Xg),Hf=!!Yg,Xg=Yg=null,l.current=m,lU(m),kn(),Bt=X,zt=$,ha.transition=k}else l.current=m;if(Op&&(Op=!1,Ai=l,Tp=A),k=l.pendingLanes,k===0&&(Ci=null),Cg(m.stateNode),Tr(l,cn()),u!==null)for(w=l.onRecoverableError,m=0;m<u.length;m++)A=u[m],w(A.value,{componentStack:A.stack,digest:A.digest});if(kp)throw kp=!1,l=Wx,Wx=null,l;return(Tp&1)!==0&&l.tag!==0&&Ml(),k=l.pendingLanes,(k&1)!==0?l===Vx?Wu++:(Wu=0,Vx=l):Wu=0,wi(),null}function Ml(){if(Ai!==null){var l=qf(Tp),u=ha.transition,m=zt;try{if(ha.transition=null,zt=16>l?16:l,Ai===null)var w=!1;else{if(l=Ai,Ai=null,Tp=0,(Bt&6)!==0)throw Error(n(331));var A=Bt;for(Bt|=4,Je=l.current;Je!==null;){var k=Je,$=k.child;if((Je.flags&16)!==0){var X=k.deletions;if(X!==null){for(var ne=0;ne<X.length;ne++){var ve=X[ne];for(Je=ve;Je!==null;){var Ee=Je;switch(Ee.tag){case 0:case 11:case 15:zu(8,Ee,k)}var Ie=Ee.child;if(Ie!==null)Ie.return=Ee,Je=Ie;else for(;Je!==null;){Ee=Je;var _e=Ee.sibling,Xe=Ee.return;if(B_(Ee),Ee===ve){Je=null;break}if(_e!==null){_e.return=Xe,Je=_e;break}Je=Xe}}}var nt=k.alternate;if(nt!==null){var at=nt.child;if(at!==null){nt.child=null;do{var On=at.sibling;at.sibling=null,at=On}while(at!==null)}}Je=k}}if((k.subtreeFlags&2064)!==0&&$!==null)$.return=k,Je=$;else e:for(;Je!==null;){if(k=Je,(k.flags&2048)!==0)switch(k.tag){case 0:case 11:case 15:zu(9,k,k.return)}var he=k.sibling;if(he!==null){he.return=k.return,Je=he;break e}Je=k.return}}var se=l.current;for(Je=se;Je!==null;){$=Je;var me=$.child;if(($.subtreeFlags&2064)!==0&&me!==null)me.return=$,Je=me;else e:for($=se;Je!==null;){if(X=Je,(X.flags&2048)!==0)try{switch(X.tag){case 0:case 11:case 15:_p(9,X)}}catch(ot){An(X,X.return,ot)}if(X===$){Je=null;break e}var Le=X.sibling;if(Le!==null){Le.return=X.return,Je=Le;break e}Je=X.return}}if(Bt=A,wi(),la&&typeof la.onPostCommitFiberRoot=="function")try{la.onPostCommitFiberRoot(ks,l)}catch{}w=!0}return w}finally{zt=m,ha.transition=u}}return!1}function nE(l,u,m){u=Ol(m,u),u=b_(l,u,1),l=Si(l,u,1),u=br(),l!==null&&(Ln(l,1,u),Tr(l,u))}function An(l,u,m){if(l.tag===3)nE(l,l,m);else for(;u!==null;){if(u.tag===3){nE(u,l,m);break}else if(u.tag===1){var w=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof w.componentDidCatch=="function"&&(Ci===null||!Ci.has(w))){l=Ol(m,l),l=w_(u,l,1),u=Si(u,l,1),l=br(),u!==null&&(Ln(u,1,l),Tr(u,l));break}}u=u.return}}function hU(l,u,m){var w=l.pingCache;w!==null&&w.delete(u),u=br(),l.pingedLanes|=l.suspendedLanes&m,Jn===l&&(sr&m)===m&&(Bn===4||Bn===3&&(sr&130023424)===sr&&500>cn()-qx?ho(l,0):Ux|=m),Tr(l,u)}function rE(l,u){u===0&&((l.mode&1)===0?u=1:(u=fl,fl<<=1,(fl&130023424)===0&&(fl=4194304)));var m=br();l=Ms(l,u),l!==null&&(Ln(l,u,m),Tr(l,m))}function mU(l){var u=l.memoizedState,m=0;u!==null&&(m=u.retryLane),rE(l,m)}function vU(l,u){var m=0;switch(l.tag){case 13:var w=l.stateNode,A=l.memoizedState;A!==null&&(m=A.retryLane);break;case 19:w=l.stateNode;break;default:throw Error(n(314))}w!==null&&w.delete(u),rE(l,m)}var aE;aE=function(l,u,m){if(l!==null)if(l.memoizedProps!==u.pendingProps||Er.current)kr=!0;else{if((l.lanes&m)===0&&(u.flags&128)===0)return kr=!1,rU(l,u,m);kr=(l.flags&131072)!==0}else kr=!1,hn&&(u.flags&1048576)!==0&&DA(u,up,u.index);switch(u.lanes=0,u.tag){case 2:var w=u.type;Cp(l,u),l=u.pendingProps;var A=Sl(u,pr.current);Pl(u,m),A=bx(null,u,w,l,A,m);var k=wx();return u.flags|=1,typeof A=="object"&&A!==null&&typeof A.render=="function"&&A.$$typeof===void 0?(u.tag=1,u.memoizedState=null,u.updateQueue=null,Pr(w)?(k=!0,op(u)):k=!1,u.memoizedState=A.state!==null&&A.state!==void 0?A.state:null,px(u),A.updater=Sp,u.stateNode=A,A._reactInternals=u,_x(u,w,l,m),u=Ox(null,u,w,!0,k,m)):(u.tag=0,hn&&k&&rx(u),yr(null,u,A,m),u=u.child),u;case 16:w=u.elementType;e:{switch(Cp(l,u),l=u.pendingProps,A=w._init,w=A(w._payload),u.type=w,A=u.tag=xU(w),l=Ra(w,l),A){case 0:u=kx(null,u,w,l,m);break e;case 1:u=k_(null,u,w,l,m);break e;case 11:u=C_(null,u,w,l,m);break e;case 14:u=A_(null,u,w,Ra(w.type,l),m);break e}throw Error(n(306,w,""))}return u;case 0:return w=u.type,A=u.pendingProps,A=u.elementType===w?A:Ra(w,A),kx(l,u,w,A,m);case 1:return w=u.type,A=u.pendingProps,A=u.elementType===w?A:Ra(w,A),k_(l,u,w,A,m);case 3:e:{if(O_(u),l===null)throw Error(n(387));w=u.pendingProps,k=u.memoizedState,A=k.element,HA(l,u),vp(u,w,null,m);var $=u.memoizedState;if(w=$.element,k.isDehydrated)if(k={element:w,isDehydrated:!1,cache:$.cache,pendingSuspenseBoundaries:$.pendingSuspenseBoundaries,transitions:$.transitions},u.updateQueue.baseState=k,u.memoizedState=k,u.flags&256){A=Ol(Error(n(423)),u),u=T_(l,u,w,m,A);break e}else if(w!==A){A=Ol(Error(n(424)),u),u=T_(l,u,w,m,A);break e}else for(Gr=xi(u.stateNode.containerInfo.firstChild),Kr=u,hn=!0,Ta=null,m=WA(u,null,w,m),u.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if(Al(),w===A){u=Ds(l,u,m);break e}yr(l,u,w,m)}u=u.child}return u;case 5:return YA(u),l===null&&ix(u),w=u.type,A=u.pendingProps,k=l!==null?l.memoizedProps:null,$=A.children,Qg(w,A)?$=null:k!==null&&Qg(w,k)&&(u.flags|=32),P_(l,u),yr(l,u,$,m),u.child;case 6:return l===null&&ix(u),null;case 13:return R_(l,u,m);case 4:return hx(u,u.stateNode.containerInfo),w=u.pendingProps,l===null?u.child=_l(u,null,w,m):yr(l,u,w,m),u.child;case 11:return w=u.type,A=u.pendingProps,A=u.elementType===w?A:Ra(w,A),C_(l,u,w,A,m);case 7:return yr(l,u,u.pendingProps,m),u.child;case 8:return yr(l,u,u.pendingProps.children,m),u.child;case 12:return yr(l,u,u.pendingProps.children,m),u.child;case 10:e:{if(w=u.type._context,A=u.pendingProps,k=u.memoizedProps,$=A.value,rn(pp,w._currentValue),w._currentValue=$,k!==null)if(Oa(k.value,$)){if(k.children===A.children&&!Er.current){u=Ds(l,u,m);break e}}else for(k=u.child,k!==null&&(k.return=u);k!==null;){var X=k.dependencies;if(X!==null){$=k.child;for(var ne=X.firstContext;ne!==null;){if(ne.context===w){if(k.tag===1){ne=$s(-1,m&-m),ne.tag=2;var ve=k.updateQueue;if(ve!==null){ve=ve.shared;var Ee=ve.pending;Ee===null?ne.next=ne:(ne.next=Ee.next,Ee.next=ne),ve.pending=ne}}k.lanes|=m,ne=k.alternate,ne!==null&&(ne.lanes|=m),dx(k.return,m,u),X.lanes|=m;break}ne=ne.next}}else if(k.tag===10)$=k.type===u.type?null:k.child;else if(k.tag===18){if($=k.return,$===null)throw Error(n(341));$.lanes|=m,X=$.alternate,X!==null&&(X.lanes|=m),dx($,m,u),$=k.sibling}else $=k.child;if($!==null)$.return=k;else for($=k;$!==null;){if($===u){$=null;break}if(k=$.sibling,k!==null){k.return=$.return,$=k;break}$=$.return}k=$}yr(l,u,A.children,m),u=u.child}return u;case 9:return A=u.type,w=u.pendingProps.children,Pl(u,m),A=fa(A),w=w(A),u.flags|=1,yr(l,u,w,m),u.child;case 14:return w=u.type,A=Ra(w,u.pendingProps),A=Ra(w.type,A),A_(l,u,w,A,m);case 15:return __(l,u,u.type,u.pendingProps,m);case 17:return w=u.type,A=u.pendingProps,A=u.elementType===w?A:Ra(w,A),Cp(l,u),u.tag=1,Pr(w)?(l=!0,op(u)):l=!1,Pl(u,m),x_(u,w,A),_x(u,w,A,m),Ox(null,u,w,!0,l,m);case 19:return M_(l,u,m);case 22:return E_(l,u,m)}throw Error(n(156,u.tag))};function sE(l,u){return He(l,u)}function gU(l,u,m,w){this.tag=l,this.key=m,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 ma(l,u,m,w){return new gU(l,u,m,w)}function Qx(l){return l=l.prototype,!(!l||!l.isReactComponent)}function xU(l){if(typeof l=="function")return Qx(l)?1:0;if(l!=null){if(l=l.$$typeof,l===R)return 11;if(l===H)return 14}return 2}function Pi(l,u){var m=l.alternate;return m===null?(m=ma(l.tag,u,l.key,l.mode),m.elementType=l.elementType,m.type=l.type,m.stateNode=l.stateNode,m.alternate=l,l.alternate=m):(m.pendingProps=u,m.type=l.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=l.flags&14680064,m.childLanes=l.childLanes,m.lanes=l.lanes,m.child=l.child,m.memoizedProps=l.memoizedProps,m.memoizedState=l.memoizedState,m.updateQueue=l.updateQueue,u=l.dependencies,m.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},m.sibling=l.sibling,m.index=l.index,m.ref=l.ref,m}function $p(l,u,m,w,A,k){var $=2;if(w=l,typeof l=="function")Qx(l)&&($=1);else if(typeof l=="string")$=5;else e:switch(l){case O:return vo(m.children,A,k,u);case T:$=8,A|=8;break;case I:return l=ma(12,m,u,A|2),l.elementType=I,l.lanes=k,l;case q:return l=ma(13,m,u,A),l.elementType=q,l.lanes=k,l;case U:return l=ma(19,m,u,A),l.elementType=U,l.lanes=k,l;case Z:return Dp(m,A,k,u);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case M:$=10;break e;case D:$=9;break e;case R:$=11;break e;case H:$=14;break e;case J:$=16,w=null;break e}throw Error(n(130,l==null?l:typeof l,""))}return u=ma($,m,u,A),u.elementType=l,u.type=w,u.lanes=k,u}function vo(l,u,m,w){return l=ma(7,l,w,u),l.lanes=m,l}function Dp(l,u,m,w){return l=ma(22,l,w,u),l.elementType=Z,l.lanes=m,l.stateNode={isHidden:!1},l}function Jx(l,u,m){return l=ma(6,l,null,u),l.lanes=m,l}function Zx(l,u,m){return u=ma(4,l.children!==null?l.children:[],l.key,u),u.lanes=m,u.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},u}function yU(l,u,m,w,A){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=Ht(0),this.expirationTimes=Ht(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ht(0),this.identifierPrefix=w,this.onRecoverableError=A,this.mutableSourceEagerHydrationData=null}function ey(l,u,m,w,A,k,$,X,ne){return l=new yU(l,u,m,X,ne),u===1?(u=1,k===!0&&(u|=8)):u=0,k=ma(3,null,null,u),l.current=k,k.stateNode=l,k.memoizedState={element:w,isDehydrated:m,cache:null,transitions:null,pendingSuspenseBoundaries:null},px(k),l}function bU(l,u,m){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:m}}function iE(l){if(!l)return bi;l=l._reactInternals;e:{if(Ve(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(Pr(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break e}}u=u.return}while(u!==null);throw Error(n(171))}if(l.tag===1){var m=l.type;if(Pr(m))return IA(l,m,u)}return u}function oE(l,u,m,w,A,k,$,X,ne){return l=ey(m,w,!0,l,A,k,$,X,ne),l.context=iE(null),m=l.current,w=br(),A=_i(m),k=$s(w,A),k.callback=u??null,Si(m,k,A),l.current.lanes=A,Ln(l,A,w),Tr(l,w),l}function Lp(l,u,m,w){var A=u.current,k=br(),$=_i(A);return m=iE(m),u.context===null?u.context=m:u.pendingContext=m,u=$s(k,$),u.payload={element:l},w=w===void 0?null:w,w!==null&&(u.callback=w),l=Si(A,u,$),l!==null&&($a(l,A,$,k),mp(l,A,$)),$}function Fp(l){return l=l.current,l.child?(l.child.tag===5,l.child.stateNode):null}function lE(l,u){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var m=l.retryLane;l.retryLane=m!==0&&m<u?m:u}}function ty(l,u){lE(l,u),(l=l.alternate)&&lE(l,u)}function wU(){return null}var cE=typeof reportError=="function"?reportError:function(l){console.error(l)};function ny(l){this._internalRoot=l}Bp.prototype.render=ny.prototype.render=function(l){var u=this._internalRoot;if(u===null)throw Error(n(409));Lp(l,u,null,null)},Bp.prototype.unmount=ny.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var u=l.containerInfo;po(function(){Lp(null,l,null,null)}),u[Os]=null}};function Bp(l){this._internalRoot=l}Bp.prototype.unstable_scheduleHydration=function(l){if(l){var u=HC();l={blockedOn:null,target:l,priority:u};for(var m=0;m<mi.length&&u!==0&&u<mi[m].priority;m++);mi.splice(m,0,l),m===0&&YC(l)}};function ry(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function zp(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function uE(){}function jU(l,u,m,w,A){if(A){if(typeof w=="function"){var k=w;w=function(){var ve=Fp($);k.call(ve)}}var $=oE(u,w,l,0,null,!1,!1,"",uE);return l._reactRootContainer=$,l[Os]=$.current,Eu(l.nodeType===8?l.parentNode:l),po(),$}for(;A=l.lastChild;)l.removeChild(A);if(typeof w=="function"){var X=w;w=function(){var ve=Fp(ne);X.call(ve)}}var ne=ey(l,0,!1,null,null,!1,!1,"",uE);return l._reactRootContainer=ne,l[Os]=ne.current,Eu(l.nodeType===8?l.parentNode:l),po(function(){Lp(u,ne,m,w)}),ne}function Up(l,u,m,w,A){var k=m._reactRootContainer;if(k){var $=k;if(typeof A=="function"){var X=A;A=function(){var ne=Fp($);X.call(ne)}}Lp(u,$,l,A)}else $=jU(m,u,l,A,w);return Fp($)}pl=function(l){switch(l.tag){case 3:var u=l.stateNode;if(u.current.memoizedState.isDehydrated){var m=V(u.pendingLanes);m!==0&&(ca(u,m|1),Tr(u,cn()),(Bt&6)===0&&(Il=cn()+500,wi()))}break;case 13:po(function(){var w=Ms(l,1);if(w!==null){var A=br();$a(w,l,1,A)}}),ty(l,1)}},Eg=function(l){if(l.tag===13){var u=Ms(l,134217728);if(u!==null){var m=br();$a(u,l,134217728,m)}ty(l,134217728)}},VC=function(l){if(l.tag===13){var u=_i(l),m=Ms(l,u);if(m!==null){var w=br();$a(m,l,u,w)}ty(l,u)}},HC=function(){return zt},KC=function(l,u){var m=zt;try{return zt=l,u()}finally{zt=m}},qr=function(l,u,m){switch(u){case"input":if(Re(l,m),u=m.name,m.type==="radio"&&u!=null){for(m=l;m.parentNode;)m=m.parentNode;for(m=m.querySelectorAll("input[name="+JSON.stringify(""+u)+'][type="radio"]'),u=0;u<m.length;u++){var w=m[u];if(w!==l&&w.form===l.form){var A=sp(w);if(!A)throw Error(n(90));ae(w),Re(w,A)}}}break;case"textarea":It(l,m);break;case"select":u=m.value,u!=null&&Oe(l,!!m.multiple,u,!1)}},st=Gx,yt=po;var SU={usingClientEntryPoint:!1,Events:[Ou,wl,sp,pe,De,Gx]},Vu={findFiberByHostInstance:ao,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},NU={bundleType:Vu.bundleType,version:Vu.version,rendererPackageName:Vu.rendererPackageName,rendererConfig:Vu.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=Tt(l),l===null?null:l.stateNode},findFiberByHostInstance:Vu.findFiberByHostInstance||wU,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{ks=qp.inject(NU),la=qp}catch{}}return Rr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=SU,Rr.createPortal=function(l,u){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ry(u))throw Error(n(200));return bU(l,u,null,m)},Rr.createRoot=function(l,u){if(!ry(l))throw Error(n(299));var m=!1,w="",A=cE;return u!=null&&(u.unstable_strictMode===!0&&(m=!0),u.identifierPrefix!==void 0&&(w=u.identifierPrefix),u.onRecoverableError!==void 0&&(A=u.onRecoverableError)),u=ey(l,1,!1,null,null,m,!1,w,A),l[Os]=u.current,Eu(l.nodeType===8?l.parentNode:l),new ny(u)},Rr.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=Tt(u),l=l===null?null:l.stateNode,l},Rr.flushSync=function(l){return po(l)},Rr.hydrate=function(l,u,m){if(!zp(u))throw Error(n(200));return Up(null,l,u,!0,m)},Rr.hydrateRoot=function(l,u,m){if(!ry(l))throw Error(n(405));var w=m!=null&&m.hydratedSources||null,A=!1,k="",$=cE;if(m!=null&&(m.unstable_strictMode===!0&&(A=!0),m.identifierPrefix!==void 0&&(k=m.identifierPrefix),m.onRecoverableError!==void 0&&($=m.onRecoverableError)),u=oE(u,null,l,1,m??null,A,!1,k,$),l[Os]=u.current,Eu(l),w)for(l=0;l<w.length;l++)m=w[l],A=m._getVersion,A=A(m._source),u.mutableSourceEagerHydrationData==null?u.mutableSourceEagerHydrationData=[m,A]:u.mutableSourceEagerHydrationData.push(m,A);return new Bp(u)},Rr.render=function(l,u,m){if(!zp(u))throw Error(n(200));return Up(null,l,u,!1,m)},Rr.unmountComponentAtNode=function(l){if(!zp(l))throw Error(n(40));return l._reactRootContainer?(po(function(){Up(null,null,l,!1,function(){l._reactRootContainer=null,l[Os]=null})}),!0):!1},Rr.unstable_batchedUpdates=Gx,Rr.unstable_renderSubtreeIntoContainer=function(l,u,m,w){if(!zp(m))throw Error(n(200));if(l==null||l._reactInternals===void 0)throw Error(n(38));return Up(l,u,m,!1,w)},Rr.version="18.3.1-next-f1338f8080-20240426",Rr}var xE;function KM(){if(xE)return iy.exports;xE=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(),iy.exports=TU(),iy.exports}var yE;function RU(){if(yE)return Vp;yE=1;var e=KM();return Vp.createRoot=e.createRoot,Vp.hydrateRoot=e.hydrateRoot,Vp}var IU=RU(),v=qS();const W=Yt(v),Vm=AU({__proto__:null,default:W},[v]),MU=1,$U=1e6;let cy=0;function DU(){return cy=(cy+1)%Number.MAX_SAFE_INTEGER,cy.toString()}const uy=new Map,bE=e=>{if(uy.has(e))return;const t=setTimeout(()=>{uy.delete(e),dd({type:"REMOVE_TOAST",toastId:e})},$U);uy.set(e,t)},LU=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,MU)};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?bE(n):e.toasts.forEach(r=>{bE(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)}}},gh=[];let xh={toasts:[]};function dd(e){xh=LU(xh,e),gh.forEach(t=>{t(xh)})}function Pe({...e}){const t=DU(),n=a=>dd({type:"UPDATE_TOAST",toast:{...a,id:t}}),r=()=>dd({type:"DISMISS_TOAST",toastId:t});return dd({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||r()}}}),{id:t,dismiss:r,update:n}}function FU(){const[e,t]=v.useState(xh);return v.useEffect(()=>(gh.push(t),()=>{const n=gh.indexOf(t);n>-1&&gh.splice(n,1)}),[e]),{...e,toast:Pe,dismiss:n=>dd({type:"DISMISS_TOAST",toastId:n})}}var Kc=KM();const GM=Yt(Kc);function Te(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e?.(a),n===!1||!a.defaultPrevented)return t?.(a)}}function wE(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Cr(...e){return t=>{let n=!1;const r=e.map(a=>{const i=wE(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<r.length;a++){const i=r[a];typeof i=="function"?i():wE(e[a],null)}}}}function vt(...e){return v.useCallback(Cr(...e),e)}function BU(e,t){const n=v.createContext(t),r=i=>{const{children:o,...c}=i,d=v.useMemo(()=>c,Object.values(c));return s.jsx(n.Provider,{value:d,children:o})};r.displayName=e+"Provider";function a(i){const o=v.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,a]}function lr(e,t=[]){let n=[];function r(i,o){const c=v.createContext(o),d=n.length;n=[...n,o];const f=p=>{const{scope:x,children:g,...j}=p,b=x?.[e]?.[d]||c,y=v.useMemo(()=>j,Object.values(j));return s.jsx(b.Provider,{value:y,children:g})};f.displayName=i+"Provider";function h(p,x){const g=x?.[e]?.[d]||c,j=v.useContext(g);if(j)return j;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[f,h]}const a=()=>{const i=n.map(o=>v.createContext(o));return function(c){const d=c?.[e]||i;return v.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return a.scopeName=e,[r,zU(a,...t)]}function zU(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=r.reduce((c,{useScope:d,scopeName:f})=>{const p=d(i)[`__scope${f}`];return{...c,...p}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function jE(e){const t=UU(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(WU);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function UU(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=HU(a),c=VU(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Cr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var qU=Symbol("radix.slottable");function WU(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===qU}function VU(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function HU(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 hf(e){const t=e+"CollectionProvider",[n,r]=lr(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=b=>{const{scope:y,children:S}=b,C=W.useRef(null),N=W.useRef(new Map).current;return s.jsx(a,{scope:y,itemMap:N,collectionRef:C,children:S})};o.displayName=t;const c=e+"CollectionSlot",d=jE(c),f=W.forwardRef((b,y)=>{const{scope:S,children:C}=b,N=i(c,S),E=vt(y,N.collectionRef);return s.jsx(d,{ref:E,children:C})});f.displayName=c;const h=e+"CollectionItemSlot",p="data-radix-collection-item",x=jE(h),g=W.forwardRef((b,y)=>{const{scope:S,children:C,...N}=b,E=W.useRef(null),_=vt(y,E),P=i(h,S);return W.useEffect(()=>(P.itemMap.set(E,{ref:E,...N}),()=>{P.itemMap.delete(E)})),s.jsx(x,{[p]:"",ref:_,children:C})});g.displayName=h;function j(b){const y=i(e+"CollectionConsumer",b);return W.useCallback(()=>{const C=y.collectionRef.current;if(!C)return[];const N=Array.from(C.querySelectorAll(`[${p}]`));return Array.from(y.itemMap.values()).sort((P,O)=>N.indexOf(P.ref.current)-N.indexOf(O.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:o,Slot:f,ItemSlot:g},j,r]}function KU(e){const t=GU(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(XU);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function GU(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=JU(a),c=QU(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Cr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var YU=Symbol("radix.slottable");function XU(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===YU}function QU(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function JU(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 ZU=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ge=ZU.reduce((e,t)=>{const n=KU(`Primitive.${t}`),r=v.forwardRef((a,i)=>{const{asChild:o,...c}=a,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function WS(e,t){e&&Kc.flushSync(()=>e.dispatchEvent(t))}function Tn(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>t.current?.(...n),[])}function e7(e,t=globalThis?.document){const n=Tn(e);v.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var t7="DismissableLayer",Lj="dismissableLayer.update",n7="dismissableLayer.pointerDownOutside",r7="dismissableLayer.focusOutside",SE,YM=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Qo=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:c,...d}=e,f=v.useContext(YM),[h,p]=v.useState(null),x=h?.ownerDocument??globalThis?.document,[,g]=v.useState({}),j=vt(t,O=>p(O)),b=Array.from(f.layers),[y]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),S=b.indexOf(y),C=h?b.indexOf(h):-1,N=f.layersWithOutsidePointerEventsDisabled.size>0,E=C>=S,_=s7(O=>{const T=O.target,I=[...f.branches].some(M=>M.contains(T));!E||I||(a?.(O),o?.(O),O.defaultPrevented||c?.())},x),P=i7(O=>{const T=O.target;[...f.branches].some(M=>M.contains(T))||(i?.(O),o?.(O),O.defaultPrevented||c?.())},x);return e7(O=>{C===f.layers.size-1&&(r?.(O),!O.defaultPrevented&&c&&(O.preventDefault(),c()))},x),v.useEffect(()=>{if(h)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(SE=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),NE(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=SE)}},[h,x,n,f]),v.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),NE())},[h,f]),v.useEffect(()=>{const O=()=>g({});return document.addEventListener(Lj,O),()=>document.removeEventListener(Lj,O)},[]),s.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,_.onPointerDownCapture)})});Qo.displayName=t7;var a7="DismissableLayerBranch",XM=v.forwardRef((e,t)=>{const n=v.useContext(YM),r=v.useRef(null),a=vt(t,r);return v.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),s.jsx(Ge.div,{...e,ref:a})});XM.displayName=a7;function s7(e,t=globalThis?.document){const n=Tn(e),r=v.useRef(!1),a=v.useRef(()=>{});return v.useEffect(()=>{const i=c=>{if(c.target&&!r.current){let d=function(){QM(n7,n,f,{discrete:!0})};const f={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=d,t.addEventListener("click",a.current,{once:!0})):d()}else t.removeEventListener("click",a.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function i7(e,t=globalThis?.document){const n=Tn(e),r=v.useRef(!1);return v.useEffect(()=>{const a=i=>{i.target&&!r.current&&QM(r7,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function NE(){const e=new CustomEvent(Lj);document.dispatchEvent(e)}function QM(e,t,n,{discrete:r}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?WS(a,i):a.dispatchEvent(i)}var o7=Qo,l7=XM,Hn=globalThis?.document?v.useLayoutEffect:()=>{},c7="Portal",Gc=v.forwardRef((e,t)=>{const{container:n,...r}=e,[a,i]=v.useState(!1);Hn(()=>i(!0),[]);const o=n||a&&globalThis?.document?.body;return o?GM.createPortal(s.jsx(Ge.div,{...r,ref:t}),o):null});Gc.displayName=c7;function u7(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var Kn=e=>{const{present:t,children:n}=e,r=d7(t),a=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),i=vt(r.ref,f7(a));return typeof n=="function"||r.isPresent?v.cloneElement(a,{ref:i}):null};Kn.displayName="Presence";function d7(e){const[t,n]=v.useState(),r=v.useRef(null),a=v.useRef(e),i=v.useRef("none"),o=e?"mounted":"unmounted",[c,d]=u7(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const f=Hp(r.current);i.current=c==="mounted"?f:"none"},[c]),Hn(()=>{const f=r.current,h=a.current;if(h!==e){const x=i.current,g=Hp(f);e?d("MOUNT"):g==="none"||f?.display==="none"?d("UNMOUNT"):d(h&&x!==g?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,d]),Hn(()=>{if(t){let f;const h=t.ownerDocument.defaultView??window,p=g=>{const b=Hp(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&b&&(d("ANIMATION_END"),!a.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",f=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},x=g=>{g.target===t&&(i.current=Hp(r.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{h.clearTimeout(f),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:v.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function Hp(e){return e?.animationName||"none"}function f7(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 p7=Vm[" useInsertionEffect ".trim().toString()]||Hn;function oa({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,o]=h7({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:a;{const h=v.useRef(e!==void 0);v.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=v.useCallback(h=>{if(c){const p=m7(h)?h(e):h;p!==e&&o.current?.(p)}else i(h)},[c,e,i,o]);return[d,f]}function h7({defaultProp:e,onChange:t}){const[n,r]=v.useState(e),a=v.useRef(n),i=v.useRef(t);return p7(()=>{i.current=t},[t]),v.useEffect(()=>{a.current!==n&&(i.current?.(n),a.current=n)},[n,a]),[n,r,i]}function m7(e){return typeof e=="function"}var JM=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"}),v7="VisuallyHidden",Hm=v.forwardRef((e,t)=>s.jsx(Ge.span,{...e,ref:t,style:{...JM,...e.style}}));Hm.displayName=v7;var g7=Hm,VS="ToastProvider",[HS,x7,y7]=hf("Toast"),[ZM]=lr("Toast",[y7]),[b7,Km]=ZM(VS),e$=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:a="right",swipeThreshold:i=50,children:o}=e,[c,d]=v.useState(null),[f,h]=v.useState(0),p=v.useRef(!1),x=v.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${VS}\`. Expected non-empty \`string\`.`),s.jsx(HS.Provider,{scope:t,children:s.jsx(b7,{scope:t,label:n,duration:r,swipeDirection:a,swipeThreshold:i,toastCount:f,viewport:c,onViewportChange:d,onToastAdd:v.useCallback(()=>h(g=>g+1),[]),onToastRemove:v.useCallback(()=>h(g=>g-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:x,children:o})})};e$.displayName=VS;var t$="ToastViewport",w7=["F8"],Fj="toast.viewportPause",Bj="toast.viewportResume",n$=v.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=w7,label:a="Notifications ({hotkey})",...i}=e,o=Km(t$,n),c=x7(n),d=v.useRef(null),f=v.useRef(null),h=v.useRef(null),p=v.useRef(null),x=vt(t,p,o.onViewportChange),g=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=o.toastCount>0;v.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]),v.useEffect(()=>{const y=d.current,S=p.current;if(j&&y&&S){const C=()=>{if(!o.isClosePausedRef.current){const P=new CustomEvent(Fj);S.dispatchEvent(P),o.isClosePausedRef.current=!0}},N=()=>{if(o.isClosePausedRef.current){const P=new CustomEvent(Bj);S.dispatchEvent(P),o.isClosePausedRef.current=!1}},E=P=>{!y.contains(P.relatedTarget)&&N()},_=()=>{y.contains(document.activeElement)||N()};return y.addEventListener("focusin",C),y.addEventListener("focusout",E),y.addEventListener("pointermove",C),y.addEventListener("pointerleave",_),window.addEventListener("blur",C),window.addEventListener("focus",N),()=>{y.removeEventListener("focusin",C),y.removeEventListener("focusout",E),y.removeEventListener("pointermove",C),y.removeEventListener("pointerleave",_),window.removeEventListener("blur",C),window.removeEventListener("focus",N)}}},[j,o.isClosePausedRef]);const b=v.useCallback(({tabbingDirection:y})=>{const C=c().map(N=>{const E=N.ref.current,_=[E,...I7(E)];return y==="forwards"?_:_.reverse()});return(y==="forwards"?C.reverse():C).flat()},[c]);return v.useEffect(()=>{const y=p.current;if(y){const S=C=>{const N=C.altKey||C.ctrlKey||C.metaKey;if(C.key==="Tab"&&!N){const _=document.activeElement,P=C.shiftKey;if(C.target===y&&P){f.current?.focus();return}const I=b({tabbingDirection:P?"backwards":"forwards"}),M=I.findIndex(D=>D===_);dy(I.slice(M+1))?C.preventDefault():P?f.current?.focus():h.current?.focus()}};return y.addEventListener("keydown",S),()=>y.removeEventListener("keydown",S)}},[c,b]),s.jsxs(l7,{ref:d,role:"region","aria-label":a.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:j?void 0:"none"},children:[j&&s.jsx(zj,{ref:f,onFocusFromOutsideViewport:()=>{const y=b({tabbingDirection:"forwards"});dy(y)}}),s.jsx(HS.Slot,{scope:n,children:s.jsx(Ge.ol,{tabIndex:-1,...i,ref:x})}),j&&s.jsx(zj,{ref:h,onFocusFromOutsideViewport:()=>{const y=b({tabbingDirection:"backwards"});dy(y)}})]})});n$.displayName=t$;var r$="ToastFocusProxy",zj=v.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...a}=e,i=Km(r$,n);return s.jsx(Hm,{tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:o=>{const c=o.relatedTarget;!i.viewport?.contains(c)&&r()}})});zj.displayName=r$;var mf="Toast",j7="toast.swipeStart",S7="toast.swipeMove",N7="toast.swipeCancel",C7="toast.swipeEnd",a$=v.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:a,onOpenChange:i,...o}=e,[c,d]=oa({prop:r,defaultProp:a??!0,onChange:i,caller:mf});return s.jsx(Kn,{present:n||c,children:s.jsx(E7,{open:c,...o,ref:t,onClose:()=>d(!1),onPause:Tn(e.onPause),onResume:Tn(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)})})})});a$.displayName=mf;var[A7,_7]=ZM(mf,{onClose(){}}),E7=v.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:a,open:i,onClose:o,onEscapeKeyDown:c,onPause:d,onResume:f,onSwipeStart:h,onSwipeMove:p,onSwipeCancel:x,onSwipeEnd:g,...j}=e,b=Km(mf,n),[y,S]=v.useState(null),C=vt(t,U=>S(U)),N=v.useRef(null),E=v.useRef(null),_=a||b.duration,P=v.useRef(0),O=v.useRef(_),T=v.useRef(0),{onToastAdd:I,onToastRemove:M}=b,D=Tn(()=>{y?.contains(document.activeElement)&&b.viewport?.focus(),o()}),R=v.useCallback(U=>{!U||U===1/0||(window.clearTimeout(T.current),P.current=new Date().getTime(),T.current=window.setTimeout(D,U))},[D]);v.useEffect(()=>{const U=b.viewport;if(U){const H=()=>{R(O.current),f?.()},J=()=>{const Z=new Date().getTime()-P.current;O.current=O.current-Z,window.clearTimeout(T.current),d?.()};return U.addEventListener(Fj,J),U.addEventListener(Bj,H),()=>{U.removeEventListener(Fj,J),U.removeEventListener(Bj,H)}}},[b.viewport,_,d,f,R]),v.useEffect(()=>{i&&!b.isClosePausedRef.current&&R(_)},[i,_,b.isClosePausedRef,R]),v.useEffect(()=>(I(),()=>M()),[I,M]);const q=v.useMemo(()=>y?d$(y):null,[y]);return b.viewport?s.jsxs(s.Fragment,{children:[q&&s.jsx(P7,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:q}),s.jsx(A7,{scope:n,onClose:D,children:Kc.createPortal(s.jsx(HS.ItemSlot,{scope:n,children:s.jsx(o7,{asChild:!0,onEscapeKeyDown:Te(c,()=>{b.isFocusedToastEscapeKeyDownRef.current||D(),b.isFocusedToastEscapeKeyDownRef.current=!1}),children:s.jsx(Ge.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":b.swipeDirection,...j,ref:C,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Te(e.onKeyDown,U=>{U.key==="Escape"&&(c?.(U.nativeEvent),U.nativeEvent.defaultPrevented||(b.isFocusedToastEscapeKeyDownRef.current=!0,D()))}),onPointerDown:Te(e.onPointerDown,U=>{U.button===0&&(N.current={x:U.clientX,y:U.clientY})}),onPointerMove:Te(e.onPointerMove,U=>{if(!N.current)return;const H=U.clientX-N.current.x,J=U.clientY-N.current.y,Z=!!E.current,F=["left","right"].includes(b.swipeDirection),z=["left","up"].includes(b.swipeDirection)?Math.min:Math.max,ee=F?z(0,H):0,B=F?0:z(0,J),L=U.pointerType==="touch"?10:2,te={x:ee,y:B},ie={originalEvent:U,delta:te};Z?(E.current=te,Kp(S7,p,ie,{discrete:!1})):CE(te,b.swipeDirection,L)?(E.current=te,Kp(j7,h,ie,{discrete:!1}),U.target.setPointerCapture(U.pointerId)):(Math.abs(H)>L||Math.abs(J)>L)&&(N.current=null)}),onPointerUp:Te(e.onPointerUp,U=>{const H=E.current,J=U.target;if(J.hasPointerCapture(U.pointerId)&&J.releasePointerCapture(U.pointerId),E.current=null,N.current=null,H){const Z=U.currentTarget,F={originalEvent:U,delta:H};CE(H,b.swipeDirection,b.swipeThreshold)?Kp(C7,g,F,{discrete:!0}):Kp(N7,x,F,{discrete:!0}),Z.addEventListener("click",z=>z.preventDefault(),{once:!0})}})})})}),b.viewport)})]}):null}),P7=e=>{const{__scopeToast:t,children:n,...r}=e,a=Km(mf,t),[i,o]=v.useState(!1),[c,d]=v.useState(!1);return T7(()=>o(!0)),v.useEffect(()=>{const f=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(f)},[]),c?null:s.jsx(Gc,{asChild:!0,children:s.jsx(Hm,{...r,children:i&&s.jsxs(s.Fragment,{children:[a.label," ",n]})})})},k7="ToastTitle",s$=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(Ge.div,{...r,ref:t})});s$.displayName=k7;var O7="ToastDescription",i$=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(Ge.div,{...r,ref:t})});i$.displayName=O7;var o$="ToastAction",l$=v.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?s.jsx(u$,{altText:n,asChild:!0,children:s.jsx(KS,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${o$}\`. Expected non-empty \`string\`.`),null)});l$.displayName=o$;var c$="ToastClose",KS=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,a=_7(c$,n);return s.jsx(u$,{asChild:!0,children:s.jsx(Ge.button,{type:"button",...r,ref:t,onClick:Te(e.onClick,a.onClose)})})});KS.displayName=c$;var u$=v.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...a}=e;return s.jsx(Ge.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...a,ref:t})});function d$(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),R7(r)){const a=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!a)if(i){const o=r.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...d$(r))}}),t}function Kp(e,t,n,{discrete:r}){const a=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?WS(a,i):a.dispatchEvent(i)}var CE=(e,t,n=0)=>{const r=Math.abs(e.x),a=Math.abs(e.y),i=r>a;return t==="left"||t==="right"?i&&r>n:!i&&a>n};function T7(e=()=>{}){const t=Tn(e);Hn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function R7(e){return e.nodeType===e.ELEMENT_NODE}function I7(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function dy(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var M7=e$,f$=n$,p$=a$,h$=s$,m$=i$,v$=l$,g$=KS;function x$(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=x$(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function _t(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=x$(e))&&(r&&(r+=" "),r+=t);return r}const AE=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,_E=_t,Jo=(e,t)=>n=>{var r;if(t?.variants==null)return _E(e,n?.class,n?.className);const{variants:a,defaultVariants:i}=t,o=Object.keys(a).map(f=>{const h=n?.[f],p=i?.[f];if(h===null)return null;const x=AE(h)||AE(p);return a[f][x]}),c=n&&Object.entries(n).reduce((f,h)=>{let[p,x]=h;return x===void 0||(f[p]=x),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,h)=>{let{class:p,className:x,...g}=h;return Object.entries(g).every(j=>{let[b,y]=j;return Array.isArray(y)?y.includes({...i,...c}[b]):{...i,...c}[b]===y})?[...f,p,x]:f},[]);return _E(e,o,d,n?.class,n?.className)};const $7=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),y$=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();var D7={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 L7=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:i,iconNode:o,...c},d)=>v.createElement("svg",{ref:d,...D7,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:y$("lucide",a),...c},[...o.map(([f,h])=>v.createElement(f,h)),...Array.isArray(i)?i:[i]]));const lt=(e,t)=>{const n=v.forwardRef(({className:r,...a},i)=>v.createElement(L7,{ref:i,iconNode:t,className:y$(`lucide-${$7(e)}`,r),...a}));return n.displayName=`${e}`,n};const b$=lt("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 F7=lt("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 Ro=lt("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const wa=lt("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 wd=lt("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 hc=lt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Dt=lt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const w$=lt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const fs=lt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const tc=lt("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);const fy=lt("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 nc=lt("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const B7=lt("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 yh=lt("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 z7=lt("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const vf=lt("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Ui=lt("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 j$=lt("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 Sa=lt("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 Gm=lt("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 Ah=lt("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 U7=lt("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 S$=lt("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 EE=lt("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 N$=lt("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 GS=lt("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 q7=lt("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 Uj=lt("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 C$=lt("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 W7=lt("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 or=lt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const A$=lt("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]);const V7=lt("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 _$=lt("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 Yl=lt("NotepadText",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"16",height:"18",x:"4",y:"4",rx:"2",key:"1u9h20"}],["path",{d:"M8 10h6",key:"3oa6kw"}],["path",{d:"M8 14h8",key:"1fgep2"}],["path",{d:"M8 18h5",key:"17enja"}]]);const H7=lt("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);const py=lt("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 hy=lt("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 Ym=lt("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 rc=lt("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const xs=lt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const E$=lt("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 Ca=lt("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);const K7=lt("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 YS=lt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);const P$=lt("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 XS=lt("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 ya=lt("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 bh=lt("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);const k$=lt("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 Aa=lt("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 wh=lt("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 G7=lt("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 QS=lt("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 O$=lt("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 ls=lt("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 ys=lt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),JS="-",Y7=e=>{const t=Q7(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const c=o.split(JS);return c[0]===""&&c.length!==1&&c.shift(),T$(c,t)||X7(o)},getConflictingClassGroupIds:(o,c)=>{const d=n[o]||[];return c&&r[o]?[...d,...r[o]]:d}}},T$=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?T$(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(JS);return t.validators.find(({validator:o})=>o(i))?.classGroupId},PE=/^\[(.+)\]$/,X7=e=>{if(PE.test(e)){const t=PE.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Q7=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Z7(Object.entries(e.classGroups),n).forEach(([i,o])=>{qj(o,r,i,t)}),r},qj=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:kE(t,a);i.classGroupId=n;return}if(typeof a=="function"){if(J7(a)){qj(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([i,o])=>{qj(o,kE(t,i),n,r)})})},kE=(e,t)=>{let n=e;return t.split(JS).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},J7=e=>e.isThemeGetter,Z7=(e,t)=>t?e.map(([n,r])=>{const a=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,c])=>[t+o,c])):i);return[n,a]}):e,eq=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const a=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return a(i,o),o},set(i,o){n.has(i)?n.set(i,o):a(i,o)}}},R$="!",tq=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,a=t[0],i=t.length,o=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===a&&(r||c.slice(y,y+i)===t)){d.push(c.slice(h,y)),h=y+i;continue}if(S==="/"){p=y;continue}}S==="["?f++:S==="]"&&f--}const x=d.length===0?c:c.substring(h),g=x.startsWith(R$),j=g?x.substring(1):x,b=p&&p>h?p-h:void 0;return{modifiers:d,hasImportantModifier:g,baseClassName:j,maybePostfixModifierPosition:b}};return n?c=>n({className:c,parseClassName:o}):o},nq=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},rq=e=>({cache:eq(e.cacheSize),parseClassName:tq(e),...Y7(e)}),aq=/\s+/,sq=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,i=[],o=e.trim().split(aq);let c="";for(let d=o.length-1;d>=0;d-=1){const f=o[d],{modifiers:h,hasImportantModifier:p,baseClassName:x,maybePostfixModifierPosition:g}=n(f);let j=!!g,b=r(j?x.substring(0,g):x);if(!b){if(!j){c=f+(c.length>0?" "+c:c);continue}if(b=r(x),!b){c=f+(c.length>0?" "+c:c);continue}j=!1}const y=nq(h).join(":"),S=p?y+R$:y,C=S+b;if(i.includes(C))continue;i.push(C);const N=a(b,j);for(let E=0;E<N.length;++E){const _=N[E];i.push(S+_)}c=f+(c.length>0?" "+c:c)}return c};function iq(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=I$(t))&&(r&&(r+=" "),r+=n);return r}const I$=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=I$(e[r]))&&(n&&(n+=" "),n+=t);return n};function oq(e,...t){let n,r,a,i=o;function o(d){const f=t.reduce((h,p)=>p(h),e());return n=rq(f),r=n.cache.get,a=n.cache.set,i=c,c(d)}function c(d){const f=r(d);if(f)return f;const h=sq(d,n);return a(d,h),h}return function(){return i(iq.apply(null,arguments))}}const fn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},M$=/^\[(?:([a-z-]+):)?(.+)\]$/i,lq=/^\d+\/\d+$/,cq=new Set(["px","full","screen"]),uq=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,dq=/\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$/,fq=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,pq=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hq=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Fs=e=>ac(e)||cq.has(e)||lq.test(e),Oi=e=>Yc(e,"length",jq),ac=e=>!!e&&!Number.isNaN(Number(e)),my=e=>Yc(e,"number",ac),Ku=e=>!!e&&Number.isInteger(Number(e)),mq=e=>e.endsWith("%")&&ac(e.slice(0,-1)),Et=e=>M$.test(e),Ti=e=>uq.test(e),vq=new Set(["length","size","percentage"]),gq=e=>Yc(e,vq,$$),xq=e=>Yc(e,"position",$$),yq=new Set(["image","url"]),bq=e=>Yc(e,yq,Nq),wq=e=>Yc(e,"",Sq),Gu=()=>!0,Yc=(e,t,n)=>{const r=M$.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},jq=e=>dq.test(e)&&!fq.test(e),$$=()=>!1,Sq=e=>pq.test(e),Nq=e=>hq.test(e),Cq=()=>{const e=fn("colors"),t=fn("spacing"),n=fn("blur"),r=fn("brightness"),a=fn("borderColor"),i=fn("borderRadius"),o=fn("borderSpacing"),c=fn("borderWidth"),d=fn("contrast"),f=fn("grayscale"),h=fn("hueRotate"),p=fn("invert"),x=fn("gap"),g=fn("gradientColorStops"),j=fn("gradientColorStopPositions"),b=fn("inset"),y=fn("margin"),S=fn("opacity"),C=fn("padding"),N=fn("saturate"),E=fn("scale"),_=fn("sepia"),P=fn("skew"),O=fn("space"),T=fn("translate"),I=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto",Et,t],R=()=>[Et,t],q=()=>["",Fs,Oi],U=()=>["auto",ac,Et],H=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],J=()=>["solid","dashed","dotted","double","none"],Z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],F=()=>["start","end","center","between","around","evenly","stretch"],z=()=>["","0",Et],ee=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[ac,Et];return{cacheSize:500,separator:":",theme:{colors:[Gu],spacing:[Fs,Oi],blur:["none","",Ti,Et],brightness:B(),borderColor:[e],borderRadius:["none","","full",Ti,Et],borderSpacing:R(),borderWidth:q(),contrast:B(),grayscale:z(),hueRotate:B(),invert:z(),gap:R(),gradientColorStops:[e],gradientColorStopPositions:[mq,Oi],inset:D(),margin:D(),opacity:B(),padding:R(),saturate:B(),scale:B(),sepia:z(),skew:B(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",Et]}],container:["container"],columns:[{columns:[Ti]}],"break-after":[{"break-after":ee()}],"break-before":[{"break-before":ee()}],"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:[...H(),Et]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],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",Ku,Et]}],basis:[{basis:D()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Et]}],grow:[{grow:z()}],shrink:[{shrink:z()}],order:[{order:["first","last","none",Ku,Et]}],"grid-cols":[{"grid-cols":[Gu]}],"col-start-end":[{col:["auto",{span:["full",Ku,Et]},Et]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[Gu]}],"row-start-end":[{row:["auto",{span:[Ku,Et]},Et]}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Et]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Et]}],gap:[{gap:[x]}],"gap-x":[{"gap-x":[x]}],"gap-y":[{"gap-y":[x]}],"justify-content":[{justify:["normal",...F()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...F(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...F(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[C]}],px:[{px:[C]}],py:[{py:[C]}],ps:[{ps:[C]}],pe:[{pe:[C]}],pt:[{pt:[C]}],pr:[{pr:[C]}],pb:[{pb:[C]}],pl:[{pl:[C]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[O]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[O]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Et,t]}],"min-w":[{"min-w":[Et,t,"min","max","fit"]}],"max-w":[{"max-w":[Et,t,"none","full","min","max","fit","prose",{screen:[Ti]},Ti]}],h:[{h:[Et,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Et,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Et,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Et,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ti,Oi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",my]}],"font-family":[{font:[Gu]}],"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",Et]}],"line-clamp":[{"line-clamp":["none",ac,my]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Fs,Et]}],"list-image":[{"list-image":["none",Et]}],"list-style-type":[{list:["none","disc","decimal",Et]}],"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:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Fs,Oi]}],"underline-offset":[{"underline-offset":["auto",Fs,Et]}],"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:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Et]}],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",Et]}],"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:[...H(),xq]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",gq]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},bq]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[j]}],"gradient-via-pos":[{via:[j]}],"gradient-to-pos":[{to:[j]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[S]}],"border-style":[{border:[...J(),"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:J()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...J()]}],"outline-offset":[{"outline-offset":[Fs,Et]}],"outline-w":[{outline:[Fs,Oi]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[Fs,Oi]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ti,wq]}],"shadow-color":[{shadow:[Gu]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...Z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Z()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",Ti,Et]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[p]}],saturate:[{saturate:[N]}],sepia:[{sepia:[_]}],"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":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Et]}],duration:[{duration:B()}],ease:[{ease:["linear","in","out","in-out",Et]}],delay:[{delay:B()}],animate:[{animate:["none","spin","ping","pulse","bounce",Et]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[Ku,Et]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"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",Et]}],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",Et]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"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",Et]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Fs,Oi,my]}],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"]}}},Aq=oq(Cq);function Se(...e){return Aq(_t(e))}const _q=M7,D$=v.forwardRef(({className:e,...t},n)=>s.jsx(f$,{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}));D$.displayName=f$.displayName;const Eq=Jo("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"}}),L$=v.forwardRef(({className:e,variant:t,...n},r)=>s.jsx(p$,{ref:r,className:Se(Eq({variant:t}),e),...n}));L$.displayName=p$.displayName;const Pq=v.forwardRef(({className:e,...t},n)=>s.jsx(v$,{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}));Pq.displayName=v$.displayName;const F$=v.forwardRef(({className:e,...t},n)=>s.jsx(g$,{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:s.jsx(ys,{className:"h-4 w-4"})}));F$.displayName=g$.displayName;const B$=v.forwardRef(({className:e,...t},n)=>s.jsx(h$,{ref:n,className:Se("text-sm font-semibold",e),...t}));B$.displayName=h$.displayName;const z$=v.forwardRef(({className:e,...t},n)=>s.jsx(m$,{ref:n,className:Se("text-sm opacity-90",e),...t}));z$.displayName=m$.displayName;function kq(){const{toasts:e}=FU();return s.jsxs(_q,{children:[e.map(function({id:t,title:n,description:r,action:a,...i}){return s.jsxs(L$,{...i,children:[s.jsxs("div",{className:"grid gap-1",children:[n&&s.jsx(B$,{children:n}),r&&s.jsx(z$,{children:r})]}),a,s.jsx(F$,{})]},t)}),s.jsx(D$,{})]})}var OE=["light","dark"],Oq="(prefers-color-scheme: dark)",Tq=v.createContext(void 0),Rq={setTheme:e=>{},themes:[]},Iq=()=>{var e;return(e=v.useContext(Tq))!=null?e:Rq};v.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:a,defaultTheme:i,value:o,attrs:c,nonce:d})=>{let f=i==="system",h=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${c.map(j=>`'${j}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,p=a?OE.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",x=(j,b=!1,y=!0)=>{let S=o?o[j]:j,C=b?j+"|| ''":`'${S}'`,N="";return a&&y&&!b&&OE.includes(j)&&(N+=`d.style.colorScheme = '${j}';`),n==="class"?b||S?N+=`c.add(${C})`:N+="null":S&&(N+=`d[s](n,${C})`),N},g=e?`!function(){${h}${x(e)}}()`:r?`!function(){try{${h}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${f})){var t='${Oq}',m=window.matchMedia(t);if(m.media!==t||m.matches){${x("dark")}}else{${x("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${x(o?"x[e]":"e",!0)}}${f?"":"else{"+x(i,!1,!1)+"}"}${p}}catch(e){}}()`:`!function(){try{${h}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${x(o?"x[e]":"e",!0)}}else{${x(i,!1,!1)};}${p}}catch(t){}}();`;return v.createElement("script",{nonce:d,dangerouslySetInnerHTML:{__html:g}})});var Mq=e=>{switch(e){case"success":return Lq;case"info":return Bq;case"warning":return Fq;case"error":return zq;default:return null}},$q=Array(12).fill(0),Dq=({visible:e,className:t})=>W.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},W.createElement("div",{className:"sonner-spinner"},$q.map((n,r)=>W.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Lq=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.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"})),Fq=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},W.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"})),Bq=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.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"})),zq=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.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"})),Uq=W.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"},W.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),W.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),qq=()=>{let[e,t]=W.useState(document.hidden);return W.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Wj=1,Wq=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,a=typeof e?.id=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Wj++,i=this.toasts.find(c=>c.id===a),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(c=>c.id===a?(this.publish({...c,...e,id:a,title:n}),{...c,...e,id:a,dismissible:o,title:n}):c):this.addToast({title:n,...r,dismissible:o,id:a}),a},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(),a=n!==void 0,i,o=r.then(async d=>{if(i=["resolve",d],W.isValidElement(d))a=!1,this.create({id:n,type:"default",message:d});else if(Hq(d)&&!d.ok){a=!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){a=!1;let f=typeof t.success=="function"?await t.success(d):t.success,h=typeof t.description=="function"?await t.description(d):t.description;this.create({id:n,type:"success",message:f,description:h})}}).catch(async d=>{if(i=["reject",d],t.error!==void 0){a=!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;a&&(this.dismiss(n),n=void 0),(d=t.finally)==null||d.call(t)}),c=()=>new Promise((d,f)=>o.then(()=>i[0]==="reject"?f(i[1]):d(i[1])).catch(f));return typeof n!="string"&&typeof n!="number"?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(e,t)=>{let n=t?.id||Wj++;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}},Ir=new Wq,Vq=(e,t)=>{let n=t?.id||Wj++;return Ir.addToast({title:e,...t,id:n}),n},Hq=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Kq=Vq,Gq=()=>Ir.toasts,Yq=()=>Ir.getActiveToasts();Object.assign(Kq,{success:Ir.success,info:Ir.info,warning:Ir.warning,error:Ir.error,custom:Ir.custom,message:Ir.message,promise:Ir.promise,dismiss:Ir.dismiss,loading:Ir.loading},{getHistory:Gq,getToasts:Yq});function Xq(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))}Xq(`: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 Gp(e){return e.label!==void 0}var Qq=3,Jq="32px",Zq="16px",TE=4e3,e9=356,t9=14,n9=20,r9=200;function Da(...e){return e.filter(Boolean).join(" ")}function a9(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var s9=e=>{var t,n,r,a,i,o,c,d,f,h,p;let{invert:x,toast:g,unstyled:j,interacting:b,setHeights:y,visibleToasts:S,heights:C,index:N,toasts:E,expanded:_,removeToast:P,defaultRichColors:O,closeButton:T,style:I,cancelButtonStyle:M,actionButtonStyle:D,className:R="",descriptionClassName:q="",duration:U,position:H,gap:J,loadingIcon:Z,expandByDefault:F,classNames:z,icons:ee,closeButtonAriaLabel:B="Close toast",pauseWhenPageIsHidden:L}=e,[te,ie]=W.useState(null),[G,de]=W.useState(null),[oe,ce]=W.useState(!1),[le,fe]=W.useState(!1),[Ce,ae]=W.useState(!1),[ke,Ae]=W.useState(!1),[Ye,be]=W.useState(!1),[Re,Y]=W.useState(0),[xe,ue]=W.useState(0),Oe=W.useRef(g.duration||U||TE),Ke=W.useRef(null),bt=W.useRef(null),It=N===0,Q=N+1<=S,je=g.type,Ne=g.dismissible!==!1,$e=g.className||"",Be=g.descriptionClassName||"",et=W.useMemo(()=>C.findIndex(De=>De.toastId===g.id)||0,[C,g.id]),Pt=W.useMemo(()=>{var De;return(De=g.closeButton)!=null?De:T},[g.closeButton,T]),Sn=W.useMemo(()=>g.duration||U||TE,[g.duration,U]),Nn=W.useRef(0),cr=W.useRef(0),ur=W.useRef(0),Dn=W.useRef(null),[dr,_r]=H.split("-"),Ur=W.useMemo(()=>C.reduce((De,st,yt)=>yt>=et?De:De+st.height,0),[C,et]),qr=qq(),Yn=g.invert||x,Xt=je==="loading";cr.current=W.useMemo(()=>et*J+Ur,[et,Ur]),W.useEffect(()=>{Oe.current=Sn},[Sn]),W.useEffect(()=>{ce(!0)},[]),W.useEffect(()=>{let De=bt.current;if(De){let st=De.getBoundingClientRect().height;return ue(st),y(yt=>[{toastId:g.id,height:st,position:g.position},...yt]),()=>y(yt=>yt.filter(Lt=>Lt.toastId!==g.id))}},[y,g.id]),W.useLayoutEffect(()=>{if(!oe)return;let De=bt.current,st=De.style.height;De.style.height="auto";let yt=De.getBoundingClientRect().height;De.style.height=st,ue(yt),y(Lt=>Lt.find(nn=>nn.toastId===g.id)?Lt.map(nn=>nn.toastId===g.id?{...nn,height:yt}:nn):[{toastId:g.id,height:yt,position:g.position},...Lt])},[oe,g.title,g.description,y,g.id]);let En=W.useCallback(()=>{fe(!0),Y(cr.current),y(De=>De.filter(st=>st.toastId!==g.id)),setTimeout(()=>{P(g)},r9)},[g,P,y,cr]);W.useEffect(()=>{if(g.promise&&je==="loading"||g.duration===1/0||g.type==="loading")return;let De;return _||b||L&&qr?(()=>{if(ur.current<Nn.current){let st=new Date().getTime()-Nn.current;Oe.current=Oe.current-st}ur.current=new Date().getTime()})():Oe.current!==1/0&&(Nn.current=new Date().getTime(),De=setTimeout(()=>{var st;(st=g.onAutoClose)==null||st.call(g,g),En()},Oe.current)),()=>clearTimeout(De)},[_,b,g,je,L,qr,En]),W.useEffect(()=>{g.delete&&En()},[En,g.delete]);function pe(){var De,st,yt;return ee!=null&&ee.loading?W.createElement("div",{className:Da(z?.loader,(De=g?.classNames)==null?void 0:De.loader,"sonner-loader"),"data-visible":je==="loading"},ee.loading):Z?W.createElement("div",{className:Da(z?.loader,(st=g?.classNames)==null?void 0:st.loader,"sonner-loader"),"data-visible":je==="loading"},Z):W.createElement(Dq,{className:Da(z?.loader,(yt=g?.classNames)==null?void 0:yt.loader),visible:je==="loading"})}return W.createElement("li",{tabIndex:0,ref:bt,className:Da(R,$e,z?.toast,(t=g?.classNames)==null?void 0:t.toast,z?.default,z?.[je],(n=g?.classNames)==null?void 0:n[je]),"data-sonner-toast":"","data-rich-colors":(r=g.richColors)!=null?r:O,"data-styled":!(g.jsx||g.unstyled||j),"data-mounted":oe,"data-promise":!!g.promise,"data-swiped":Ye,"data-removed":le,"data-visible":Q,"data-y-position":dr,"data-x-position":_r,"data-index":N,"data-front":It,"data-swiping":Ce,"data-dismissible":Ne,"data-type":je,"data-invert":Yn,"data-swipe-out":ke,"data-swipe-direction":G,"data-expanded":!!(_||F&&oe),style:{"--index":N,"--toasts-before":N,"--z-index":E.length-N,"--offset":`${le?Re:cr.current}px`,"--initial-height":F?"auto":`${xe}px`,...I,...g.style},onDragEnd:()=>{ae(!1),ie(null),Dn.current=null},onPointerDown:De=>{Xt||!Ne||(Ke.current=new Date,Y(cr.current),De.target.setPointerCapture(De.pointerId),De.target.tagName!=="BUTTON"&&(ae(!0),Dn.current={x:De.clientX,y:De.clientY}))},onPointerUp:()=>{var De,st,yt,Lt;if(ke||!Ne)return;Dn.current=null;let nn=Number(((De=bt.current)==null?void 0:De.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ln=Number(((st=bt.current)==null?void 0:st.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Xn=new Date().getTime()-((yt=Ke.current)==null?void 0:yt.getTime()),Cn=te==="x"?nn:ln,rr=Math.abs(Cn)/Xn;if(Math.abs(Cn)>=n9||rr>.11){Y(cr.current),(Lt=g.onDismiss)==null||Lt.call(g,g),de(te==="x"?nn>0?"right":"left":ln>0?"down":"up"),En(),Ae(!0),be(!1);return}ae(!1),ie(null)},onPointerMove:De=>{var st,yt,Lt,nn;if(!Dn.current||!Ne||((st=window.getSelection())==null?void 0:st.toString().length)>0)return;let ln=De.clientY-Dn.current.y,Xn=De.clientX-Dn.current.x,Cn=(yt=e.swipeDirections)!=null?yt:a9(H);!te&&(Math.abs(Xn)>1||Math.abs(ln)>1)&&ie(Math.abs(Xn)>Math.abs(ln)?"x":"y");let rr={x:0,y:0};te==="y"?(Cn.includes("top")||Cn.includes("bottom"))&&(Cn.includes("top")&&ln<0||Cn.includes("bottom")&&ln>0)&&(rr.y=ln):te==="x"&&(Cn.includes("left")||Cn.includes("right"))&&(Cn.includes("left")&&Xn<0||Cn.includes("right")&&Xn>0)&&(rr.x=Xn),(Math.abs(rr.x)>0||Math.abs(rr.y)>0)&&be(!0),(Lt=bt.current)==null||Lt.style.setProperty("--swipe-amount-x",`${rr.x}px`),(nn=bt.current)==null||nn.style.setProperty("--swipe-amount-y",`${rr.y}px`)}},Pt&&!g.jsx?W.createElement("button",{"aria-label":B,"data-disabled":Xt,"data-close-button":!0,onClick:Xt||!Ne?()=>{}:()=>{var De;En(),(De=g.onDismiss)==null||De.call(g,g)},className:Da(z?.closeButton,(a=g?.classNames)==null?void 0:a.closeButton)},(i=ee?.close)!=null?i:Uq):null,g.jsx||v.isValidElement(g.title)?g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title:W.createElement(W.Fragment,null,je||g.icon||g.promise?W.createElement("div",{"data-icon":"",className:Da(z?.icon,(o=g?.classNames)==null?void 0:o.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||pe():null,g.type!=="loading"?g.icon||ee?.[je]||Mq(je):null):null,W.createElement("div",{"data-content":"",className:Da(z?.content,(c=g?.classNames)==null?void 0:c.content)},W.createElement("div",{"data-title":"",className:Da(z?.title,(d=g?.classNames)==null?void 0:d.title)},typeof g.title=="function"?g.title():g.title),g.description?W.createElement("div",{"data-description":"",className:Da(q,Be,z?.description,(f=g?.classNames)==null?void 0:f.description)},typeof g.description=="function"?g.description():g.description):null),v.isValidElement(g.cancel)?g.cancel:g.cancel&&Gp(g.cancel)?W.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||M,onClick:De=>{var st,yt;Gp(g.cancel)&&Ne&&((yt=(st=g.cancel).onClick)==null||yt.call(st,De),En())},className:Da(z?.cancelButton,(h=g?.classNames)==null?void 0:h.cancelButton)},g.cancel.label):null,v.isValidElement(g.action)?g.action:g.action&&Gp(g.action)?W.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||D,onClick:De=>{var st,yt;Gp(g.action)&&((yt=(st=g.action).onClick)==null||yt.call(st,De),!De.defaultPrevented&&En())},className:Da(z?.actionButton,(p=g?.classNames)==null?void 0:p.actionButton)},g.action.label):null))};function RE(){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 i9(e,t){let n={};return[e,t].forEach((r,a)=>{let i=a===1,o=i?"--mobile-offset":"--offset",c=i?Zq:Jq;function d(f){["top","right","bottom","left"].forEach(h=>{n[`${o}-${h}`]=typeof f=="number"?`${f}px`:f})}typeof r=="number"||typeof r=="string"?d(r):typeof r=="object"?["top","right","bottom","left"].forEach(f=>{r[f]===void 0?n[`${o}-${f}`]=c:n[`${o}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):d(c)}),n}var o9=v.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:a=["altKey","KeyT"],expand:i,closeButton:o,className:c,offset:d,mobileOffset:f,theme:h="light",richColors:p,duration:x,style:g,visibleToasts:j=Qq,toastOptions:b,dir:y=RE(),gap:S=t9,loadingIcon:C,icons:N,containerAriaLabel:E="Notifications",pauseWhenPageIsHidden:_}=e,[P,O]=W.useState([]),T=W.useMemo(()=>Array.from(new Set([r].concat(P.filter(L=>L.position).map(L=>L.position)))),[P,r]),[I,M]=W.useState([]),[D,R]=W.useState(!1),[q,U]=W.useState(!1),[H,J]=W.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Z=W.useRef(null),F=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),z=W.useRef(null),ee=W.useRef(!1),B=W.useCallback(L=>{O(te=>{var ie;return(ie=te.find(G=>G.id===L.id))!=null&&ie.delete||Ir.dismiss(L.id),te.filter(({id:G})=>G!==L.id)})},[]);return W.useEffect(()=>Ir.subscribe(L=>{if(L.dismiss){O(te=>te.map(ie=>ie.id===L.id?{...ie,delete:!0}:ie));return}setTimeout(()=>{GM.flushSync(()=>{O(te=>{let ie=te.findIndex(G=>G.id===L.id);return ie!==-1?[...te.slice(0,ie),{...te[ie],...L},...te.slice(ie+1)]:[L,...te]})})})}),[]),W.useEffect(()=>{if(h!=="system"){J(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?J("dark"):J("light")),typeof window>"u")return;let L=window.matchMedia("(prefers-color-scheme: dark)");try{L.addEventListener("change",({matches:te})=>{J(te?"dark":"light")})}catch{L.addListener(({matches:ie})=>{try{J(ie?"dark":"light")}catch(G){console.error(G)}})}},[h]),W.useEffect(()=>{P.length<=1&&R(!1)},[P]),W.useEffect(()=>{let L=te=>{var ie,G;a.every(de=>te[de]||te.code===de)&&(R(!0),(ie=Z.current)==null||ie.focus()),te.code==="Escape"&&(document.activeElement===Z.current||(G=Z.current)!=null&&G.contains(document.activeElement))&&R(!1)};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[a]),W.useEffect(()=>{if(Z.current)return()=>{z.current&&(z.current.focus({preventScroll:!0}),z.current=null,ee.current=!1)}},[Z.current]),W.createElement("section",{ref:t,"aria-label":`${E} ${F}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},T.map((L,te)=>{var ie;let[G,de]=L.split("-");return P.length?W.createElement("ol",{key:L,dir:y==="auto"?RE():y,tabIndex:-1,ref:Z,className:c,"data-sonner-toaster":!0,"data-theme":H,"data-y-position":G,"data-lifted":D&&P.length>1&&!i,"data-x-position":de,style:{"--front-toast-height":`${((ie=I[0])==null?void 0:ie.height)||0}px`,"--width":`${e9}px`,"--gap":`${S}px`,...g,...i9(d,f)},onBlur:oe=>{ee.current&&!oe.currentTarget.contains(oe.relatedTarget)&&(ee.current=!1,z.current&&(z.current.focus({preventScroll:!0}),z.current=null))},onFocus:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||ee.current||(ee.current=!0,z.current=oe.relatedTarget)},onMouseEnter:()=>R(!0),onMouseMove:()=>R(!0),onMouseLeave:()=>{q||R(!1)},onDragEnd:()=>R(!1),onPointerDown:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||U(!0)},onPointerUp:()=>U(!1)},P.filter(oe=>!oe.position&&te===0||oe.position===L).map((oe,ce)=>{var le,fe;return W.createElement(s9,{key:oe.id,icons:N,index:ce,toast:oe,defaultRichColors:p,duration:(le=b?.duration)!=null?le:x,className:b?.className,descriptionClassName:b?.descriptionClassName,invert:n,visibleToasts:j,closeButton:(fe=b?.closeButton)!=null?fe:o,interacting:q,position:L,style:b?.style,unstyled:b?.unstyled,classNames:b?.classNames,cancelButtonStyle:b?.cancelButtonStyle,actionButtonStyle:b?.actionButtonStyle,removeToast:B,toasts:P.filter(Ce=>Ce.position==oe.position),heights:I.filter(Ce=>Ce.position==oe.position),setHeights:M,expandByDefault:i,gap:S,loadingIcon:C,expanded:D,pauseWhenPageIsHidden:_,swipeDirections:e.swipeDirections})})):null}))});const l9=({...e})=>{const{theme:t="system"}=Iq();return s.jsx(o9,{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 c9=Vm[" useId ".trim().toString()]||(()=>{}),u9=0;function Vn(e){const[t,n]=v.useState(c9());return Hn(()=>{n(r=>r??String(u9++))},[e]),e||(t?`radix-${t}`:"")}const d9=["top","right","bottom","left"],qi=Math.min,Zr=Math.max,_h=Math.round,Yp=Math.floor,ps=e=>({x:e,y:e}),f9={left:"right",right:"left",bottom:"top",top:"bottom"},p9={start:"end",end:"start"};function Vj(e,t,n){return Zr(e,qi(t,n))}function Js(e,t){return typeof e=="function"?e(t):e}function Zs(e){return e.split("-")[0]}function Xc(e){return e.split("-")[1]}function ZS(e){return e==="x"?"y":"x"}function eN(e){return e==="y"?"height":"width"}const h9=new Set(["top","bottom"]);function us(e){return h9.has(Zs(e))?"y":"x"}function tN(e){return ZS(us(e))}function m9(e,t,n){n===void 0&&(n=!1);const r=Xc(e),a=tN(e),i=eN(a);let o=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=Eh(o)),[o,Eh(o)]}function v9(e){const t=Eh(e);return[Hj(e),t,Hj(t)]}function Hj(e){return e.replace(/start|end/g,t=>p9[t])}const IE=["left","right"],ME=["right","left"],g9=["top","bottom"],x9=["bottom","top"];function y9(e,t,n){switch(e){case"top":case"bottom":return n?t?ME:IE:t?IE:ME;case"left":case"right":return t?g9:x9;default:return[]}}function b9(e,t,n,r){const a=Xc(e);let i=y9(Zs(e),n==="start",r);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map(Hj)))),i}function Eh(e){return e.replace(/left|right|bottom|top/g,t=>f9[t])}function w9(e){return{top:0,right:0,bottom:0,left:0,...e}}function U$(e){return typeof e!="number"?w9(e):{top:e,right:e,bottom:e,left:e}}function Ph(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function $E(e,t,n){let{reference:r,floating:a}=e;const i=us(t),o=tN(t),c=eN(o),d=Zs(t),f=i==="y",h=r.x+r.width/2-a.width/2,p=r.y+r.height/2-a.height/2,x=r[c]/2-a[c]/2;let g;switch(d){case"top":g={x:h,y:r.y-a.height};break;case"bottom":g={x:h,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:p};break;case"left":g={x:r.x-a.width,y:p};break;default:g={x:r.x,y:r.y}}switch(Xc(t)){case"start":g[o]-=x*(n&&f?-1:1);break;case"end":g[o]+=x*(n&&f?-1:1);break}return g}async function j9(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:i,rects:o,elements:c,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:x=!1,padding:g=0}=Js(t,e),j=U$(g),y=c[x?p==="floating"?"reference":"floating":p],S=Ph(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:f,rootBoundary:h,strategy:d})),C=p==="floating"?{x:r,y:a,width:o.floating.width,height:o.floating.height}:o.reference,N=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),E=await(i.isElement==null?void 0:i.isElement(N))?await(i.getScale==null?void 0:i.getScale(N))||{x:1,y:1}:{x:1,y:1},_=Ph(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:C,offsetParent:N,strategy:d}):C);return{top:(S.top-_.top+j.top)/E.y,bottom:(_.bottom-S.bottom+j.bottom)/E.y,left:(S.left-_.left+j.left)/E.x,right:(_.right-S.right+j.right)/E.x}}const S9=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:o}=n,c=i.filter(Boolean),d=await(o.isRTL==null?void 0:o.isRTL(t));let f=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:h,y:p}=$E(f,r,d),x=r,g={},j=0;for(let y=0;y<c.length;y++){var b;const{name:S,fn:C}=c[y],{x:N,y:E,data:_,reset:P}=await C({x:h,y:p,initialPlacement:r,placement:x,strategy:a,middlewareData:g,rects:f,platform:{...o,detectOverflow:(b=o.detectOverflow)!=null?b:j9},elements:{reference:e,floating:t}});h=N??h,p=E??p,g={...g,[S]:{...g[S],..._}},P&&j<=50&&(j++,typeof P=="object"&&(P.placement&&(x=P.placement),P.rects&&(f=P.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:a}):P.rects),{x:h,y:p}=$E(f,x,d)),y=-1)}return{x:h,y:p,placement:x,strategy:a,middlewareData:g}},N9=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:i,platform:o,elements:c,middlewareData:d}=t,{element:f,padding:h=0}=Js(e,t)||{};if(f==null)return{};const p=U$(h),x={x:n,y:r},g=tN(a),j=eN(g),b=await o.getDimensions(f),y=g==="y",S=y?"top":"left",C=y?"bottom":"right",N=y?"clientHeight":"clientWidth",E=i.reference[j]+i.reference[g]-x[g]-i.floating[j],_=x[g]-i.reference[g],P=await(o.getOffsetParent==null?void 0:o.getOffsetParent(f));let O=P?P[N]:0;(!O||!await(o.isElement==null?void 0:o.isElement(P)))&&(O=c.floating[N]||i.floating[j]);const T=E/2-_/2,I=O/2-b[j]/2-1,M=qi(p[S],I),D=qi(p[C],I),R=M,q=O-b[j]-D,U=O/2-b[j]/2+T,H=Vj(R,U,q),J=!d.arrow&&Xc(a)!=null&&U!==H&&i.reference[j]/2-(U<R?M:D)-b[j]/2<0,Z=J?U<R?U-R:U-q:0;return{[g]:x[g]+Z,data:{[g]:H,centerOffset:U-H-Z,...J&&{alignmentOffset:Z}},reset:J}}}),C9=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:i,rects:o,initialPlacement:c,platform:d,elements:f}=t,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:x,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:j="none",flipAlignment:b=!0,...y}=Js(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const S=Zs(a),C=us(c),N=Zs(c)===c,E=await(d.isRTL==null?void 0:d.isRTL(f.floating)),_=x||(N||!b?[Eh(c)]:v9(c)),P=j!=="none";!x&&P&&_.push(...b9(c,b,j,E));const O=[c,..._],T=await d.detectOverflow(t,y),I=[];let M=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&I.push(T[S]),p){const U=m9(a,o,E);I.push(T[U[0]],T[U[1]])}if(M=[...M,{placement:a,overflows:I}],!I.every(U=>U<=0)){var D,R;const U=(((D=i.flip)==null?void 0:D.index)||0)+1,H=O[U];if(H&&(!(p==="alignment"?C!==us(H):!1)||M.every(F=>us(F.placement)===C?F.overflows[0]>0:!0)))return{data:{index:U,overflows:M},reset:{placement:H}};let J=(R=M.filter(Z=>Z.overflows[0]<=0).sort((Z,F)=>Z.overflows[1]-F.overflows[1])[0])==null?void 0:R.placement;if(!J)switch(g){case"bestFit":{var q;const Z=(q=M.filter(F=>{if(P){const z=us(F.placement);return z===C||z==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(z=>z>0).reduce((z,ee)=>z+ee,0)]).sort((F,z)=>F[1]-z[1])[0])==null?void 0:q[0];Z&&(J=Z);break}case"initialPlacement":J=c;break}if(a!==J)return{reset:{placement:J}}}return{}}}};function DE(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function LE(e){return d9.some(t=>e[t]>=0)}const A9=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...i}=Js(e,t);switch(a){case"referenceHidden":{const o=await r.detectOverflow(t,{...i,elementContext:"reference"}),c=DE(o,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:LE(c)}}}case"escaped":{const o=await r.detectOverflow(t,{...i,altBoundary:!0}),c=DE(o,n.floating);return{data:{escapedOffsets:c,escaped:LE(c)}}}default:return{}}}}},q$=new Set(["left","top"]);async function _9(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),o=Zs(n),c=Xc(n),d=us(n)==="y",f=q$.has(o)?-1:1,h=i&&d?-1:1,p=Js(t,e);let{mainAxis:x,crossAxis:g,alignmentAxis:j}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof j=="number"&&(g=c==="end"?j*-1:j),d?{x:g*h,y:x*f}:{x:x*f,y:g*h}}const E9=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:o,middlewareData:c}=t,d=await _9(t,e);return o===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:a+d.x,y:i+d.y,data:{...d,placement:o}}}}},P9=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a,platform:i}=t,{mainAxis:o=!0,crossAxis:c=!1,limiter:d={fn:S=>{let{x:C,y:N}=S;return{x:C,y:N}}},...f}=Js(e,t),h={x:n,y:r},p=await i.detectOverflow(t,f),x=us(Zs(a)),g=ZS(x);let j=h[g],b=h[x];if(o){const S=g==="y"?"top":"left",C=g==="y"?"bottom":"right",N=j+p[S],E=j-p[C];j=Vj(N,j,E)}if(c){const S=x==="y"?"top":"left",C=x==="y"?"bottom":"right",N=b+p[S],E=b-p[C];b=Vj(N,b,E)}const y=d.fn({...t,[g]:j,[x]:b});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[g]:o,[x]:c}}}}}},k9=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:i,middlewareData:o}=t,{offset:c=0,mainAxis:d=!0,crossAxis:f=!0}=Js(e,t),h={x:n,y:r},p=us(a),x=ZS(p);let g=h[x],j=h[p];const b=Js(c,t),y=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(d){const N=x==="y"?"height":"width",E=i.reference[x]-i.floating[N]+y.mainAxis,_=i.reference[x]+i.reference[N]-y.mainAxis;g<E?g=E:g>_&&(g=_)}if(f){var S,C;const N=x==="y"?"width":"height",E=q$.has(Zs(a)),_=i.reference[p]-i.floating[N]+(E&&((S=o.offset)==null?void 0:S[p])||0)+(E?0:y.crossAxis),P=i.reference[p]+i.reference[N]+(E?0:((C=o.offset)==null?void 0:C[p])||0)-(E?y.crossAxis:0);j<_?j=_:j>P&&(j=P)}return{[x]:g,[p]:j}}}},O9=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:i,platform:o,elements:c}=t,{apply:d=()=>{},...f}=Js(e,t),h=await o.detectOverflow(t,f),p=Zs(a),x=Xc(a),g=us(a)==="y",{width:j,height:b}=i.floating;let y,S;p==="top"||p==="bottom"?(y=p,S=x===(await(o.isRTL==null?void 0:o.isRTL(c.floating))?"start":"end")?"left":"right"):(S=p,y=x==="end"?"top":"bottom");const C=b-h.top-h.bottom,N=j-h.left-h.right,E=qi(b-h[y],C),_=qi(j-h[S],N),P=!t.middlewareData.shift;let O=E,T=_;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=N),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=C),P&&!x){const M=Zr(h.left,0),D=Zr(h.right,0),R=Zr(h.top,0),q=Zr(h.bottom,0);g?T=j-2*(M!==0||D!==0?M+D:Zr(h.left,h.right)):O=b-2*(R!==0||q!==0?R+q:Zr(h.top,h.bottom))}await d({...t,availableWidth:T,availableHeight:O});const I=await o.getDimensions(c.floating);return j!==I.width||b!==I.height?{reset:{rects:!0}}:{}}}};function Xm(){return typeof window<"u"}function Qc(e){return W$(e)?(e.nodeName||"").toLowerCase():"#document"}function aa(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ss(e){var t;return(t=(W$(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function W$(e){return Xm()?e instanceof Node||e instanceof aa(e).Node:!1}function Va(e){return Xm()?e instanceof Element||e instanceof aa(e).Element:!1}function bs(e){return Xm()?e instanceof HTMLElement||e instanceof aa(e).HTMLElement:!1}function FE(e){return!Xm()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof aa(e).ShadowRoot}const T9=new Set(["inline","contents"]);function gf(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Ha(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!T9.has(a)}const R9=new Set(["table","td","th"]);function I9(e){return R9.has(Qc(e))}const M9=[":popover-open",":modal"];function Qm(e){return M9.some(t=>{try{return e.matches(t)}catch{return!1}})}const $9=["transform","translate","scale","rotate","perspective"],D9=["transform","translate","scale","rotate","perspective","filter"],L9=["paint","layout","strict","content"];function nN(e){const t=rN(),n=Va(e)?Ha(e):e;return $9.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)||D9.some(r=>(n.willChange||"").includes(r))||L9.some(r=>(n.contain||"").includes(r))}function F9(e){let t=Wi(e);for(;bs(t)&&!mc(t);){if(nN(t))return t;if(Qm(t))return null;t=Wi(t)}return null}function rN(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const B9=new Set(["html","body","#document"]);function mc(e){return B9.has(Qc(e))}function Ha(e){return aa(e).getComputedStyle(e)}function Jm(e){return Va(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Wi(e){if(Qc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||FE(e)&&e.host||Ss(e);return FE(t)?t.host:t}function V$(e){const t=Wi(e);return mc(t)?e.ownerDocument?e.ownerDocument.body:e.body:bs(t)&&gf(t)?t:V$(t)}function jd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=V$(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),o=aa(a);if(i){const c=Kj(o);return t.concat(o,o.visualViewport||[],gf(a)?a:[],c&&n?jd(c):[])}return t.concat(a,jd(a,[],n))}function Kj(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function H$(e){const t=Ha(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=bs(e),i=a?e.offsetWidth:n,o=a?e.offsetHeight:r,c=_h(n)!==i||_h(r)!==o;return c&&(n=i,r=o),{width:n,height:r,$:c}}function aN(e){return Va(e)?e:e.contextElement}function sc(e){const t=aN(e);if(!bs(t))return ps(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=H$(t);let o=(i?_h(n.width):n.width)/r,c=(i?_h(n.height):n.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!c||!Number.isFinite(c))&&(c=1),{x:o,y:c}}const z9=ps(0);function K$(e){const t=aa(e);return!rN()||!t.visualViewport?z9:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function U9(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==aa(e)?!1:t}function Io(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=aN(e);let o=ps(1);t&&(r?Va(r)&&(o=sc(r)):o=sc(e));const c=U9(i,n,r)?K$(i):ps(0);let d=(a.left+c.x)/o.x,f=(a.top+c.y)/o.y,h=a.width/o.x,p=a.height/o.y;if(i){const x=aa(i),g=r&&Va(r)?aa(r):r;let j=x,b=Kj(j);for(;b&&r&&g!==j;){const y=sc(b),S=b.getBoundingClientRect(),C=Ha(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=aa(b),b=Kj(j)}}return Ph({width:h,height:p,x:d,y:f})}function Zm(e,t){const n=Jm(e).scrollLeft;return t?t.left+n:Io(Ss(e)).left+n}function G$(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Zm(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function q9(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",o=Ss(r),c=t?Qm(t.floating):!1;if(r===o||c&&i)return n;let d={scrollLeft:0,scrollTop:0},f=ps(1);const h=ps(0),p=bs(r);if((p||!p&&!i)&&((Qc(r)!=="body"||gf(o))&&(d=Jm(r)),bs(r))){const g=Io(r);f=sc(r),h.x=g.x+r.clientLeft,h.y=g.y+r.clientTop}const x=o&&!p&&!i?G$(o,d):ps(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+h.x+x.x,y:n.y*f.y-d.scrollTop*f.y+h.y+x.y}}function W9(e){return Array.from(e.getClientRects())}function V9(e){const t=Ss(e),n=Jm(e),r=e.ownerDocument.body,a=Zr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Zr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Zm(e);const c=-n.scrollTop;return Ha(r).direction==="rtl"&&(o+=Zr(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:o,y:c}}const BE=25;function H9(e,t){const n=aa(e),r=Ss(e),a=n.visualViewport;let i=r.clientWidth,o=r.clientHeight,c=0,d=0;if(a){i=a.width,o=a.height;const h=rN();(!h||h&&t==="fixed")&&(c=a.offsetLeft,d=a.offsetTop)}const f=Zm(r);if(f<=0){const h=r.ownerDocument,p=h.body,x=getComputedStyle(p),g=h.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,j=Math.abs(r.clientWidth-p.clientWidth-g);j<=BE&&(i-=j)}else f<=BE&&(i+=f);return{width:i,height:o,x:c,y:d}}const K9=new Set(["absolute","fixed"]);function G9(e,t){const n=Io(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=bs(e)?sc(e):ps(1),o=e.clientWidth*i.x,c=e.clientHeight*i.y,d=a*i.x,f=r*i.y;return{width:o,height:c,x:d,y:f}}function zE(e,t,n){let r;if(t==="viewport")r=H9(e,n);else if(t==="document")r=V9(Ss(e));else if(Va(t))r=G9(t,n);else{const a=K$(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Ph(r)}function Y$(e,t){const n=Wi(e);return n===t||!Va(n)||mc(n)?!1:Ha(n).position==="fixed"||Y$(n,t)}function Y9(e,t){const n=t.get(e);if(n)return n;let r=jd(e,[],!1).filter(c=>Va(c)&&Qc(c)!=="body"),a=null;const i=Ha(e).position==="fixed";let o=i?Wi(e):e;for(;Va(o)&&!mc(o);){const c=Ha(o),d=nN(o);!d&&c.position==="fixed"&&(a=null),(i?!d&&!a:!d&&c.position==="static"&&!!a&&K9.has(a.position)||gf(o)&&!d&&Y$(e,o))?r=r.filter(h=>h!==o):a=c,o=Wi(o)}return t.set(e,r),r}function X9(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const o=[...n==="clippingAncestors"?Qm(t)?[]:Y9(t,this._c):[].concat(n),r],c=o[0],d=o.reduce((f,h)=>{const p=zE(t,h,a);return f.top=Zr(p.top,f.top),f.right=qi(p.right,f.right),f.bottom=qi(p.bottom,f.bottom),f.left=Zr(p.left,f.left),f},zE(t,c,a));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function Q9(e){const{width:t,height:n}=H$(e);return{width:t,height:n}}function J9(e,t,n){const r=bs(t),a=Ss(t),i=n==="fixed",o=Io(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const d=ps(0);function f(){d.x=Zm(a)}if(r||!r&&!i)if((Qc(t)!=="body"||gf(a))&&(c=Jm(t)),r){const g=Io(t,!0,i,t);d.x=g.x+t.clientLeft,d.y=g.y+t.clientTop}else a&&f();i&&!r&&a&&f();const h=a&&!r&&!i?G$(a,c):ps(0),p=o.left+c.scrollLeft-d.x-h.x,x=o.top+c.scrollTop-d.y-h.y;return{x:p,y:x,width:o.width,height:o.height}}function vy(e){return Ha(e).position==="static"}function UE(e,t){if(!bs(e)||Ha(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ss(e)===n&&(n=n.ownerDocument.body),n}function X$(e,t){const n=aa(e);if(Qm(e))return n;if(!bs(e)){let a=Wi(e);for(;a&&!mc(a);){if(Va(a)&&!vy(a))return a;a=Wi(a)}return n}let r=UE(e,t);for(;r&&I9(r)&&vy(r);)r=UE(r,t);return r&&mc(r)&&vy(r)&&!nN(r)?n:r||F9(e)||n}const Z9=async function(e){const t=this.getOffsetParent||X$,n=this.getDimensions,r=await n(e.floating);return{reference:J9(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function eW(e){return Ha(e).direction==="rtl"}const tW={convertOffsetParentRelativeRectToViewportRelativeRect:q9,getDocumentElement:Ss,getClippingRect:X9,getOffsetParent:X$,getElementRects:Z9,getClientRects:W9,getDimensions:Q9,getScale:sc,isElement:Va,isRTL:eW};function Q$(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function nW(e,t){let n=null,r;const a=Ss(e);function i(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function o(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),i();const f=e.getBoundingClientRect(),{left:h,top:p,width:x,height:g}=f;if(c||t(),!x||!g)return;const j=Yp(p),b=Yp(a.clientWidth-(h+x)),y=Yp(a.clientHeight-(p+g)),S=Yp(h),N={rootMargin:-j+"px "+-b+"px "+-y+"px "+-S+"px",threshold:Zr(0,qi(1,d))||1};let E=!0;function _(P){const O=P[0].intersectionRatio;if(O!==d){if(!E)return o();O?o(!1,O):r=setTimeout(()=>{o(!1,1e-7)},1e3)}O===1&&!Q$(f,e.getBoundingClientRect())&&o(),E=!1}try{n=new IntersectionObserver(_,{...N,root:a.ownerDocument})}catch{n=new IntersectionObserver(_,N)}n.observe(e)}return o(!0),i}function rW(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=aN(e),h=a||i?[...f?jd(f):[],...jd(t)]:[];h.forEach(S=>{a&&S.addEventListener("scroll",n,{passive:!0}),i&&S.addEventListener("resize",n)});const p=f&&c?nW(f,n):null;let x=-1,g=null;o&&(g=new ResizeObserver(S=>{let[C]=S;C&&C.target===f&&g&&(g.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var N;(N=g)==null||N.observe(t)})),n()}),f&&!d&&g.observe(f),g.observe(t));let j,b=d?Io(e):null;d&&y();function y(){const S=Io(e);b&&!Q$(b,S)&&n(),b=S,j=requestAnimationFrame(y)}return n(),()=>{var S;h.forEach(C=>{a&&C.removeEventListener("scroll",n),i&&C.removeEventListener("resize",n)}),p?.(),(S=g)==null||S.disconnect(),g=null,d&&cancelAnimationFrame(j)}}const aW=E9,sW=P9,iW=C9,oW=O9,lW=A9,qE=N9,cW=k9,uW=(e,t,n)=>{const r=new Map,a={platform:tW,...n},i={...a.platform,_c:r};return S9(e,t,{...a,platform:i})};var dW=typeof document<"u",fW=function(){},jh=dW?v.useLayoutEffect:fW;function kh(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,a;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(!kh(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!kh(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function J$(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function WE(e,t){const n=J$(e);return Math.round(t*n)/n}function gy(e){const t=v.useRef(e);return jh(()=>{t.current=e}),t}function pW(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:o}={},transform:c=!0,whileElementsMounted:d,open:f}=e,[h,p]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[x,g]=v.useState(r);kh(x,r)||g(r);const[j,b]=v.useState(null),[y,S]=v.useState(null),C=v.useCallback(F=>{F!==P.current&&(P.current=F,b(F))},[]),N=v.useCallback(F=>{F!==O.current&&(O.current=F,S(F))},[]),E=i||j,_=o||y,P=v.useRef(null),O=v.useRef(null),T=v.useRef(h),I=d!=null,M=gy(d),D=gy(a),R=gy(f),q=v.useCallback(()=>{if(!P.current||!O.current)return;const F={placement:t,strategy:n,middleware:x};D.current&&(F.platform=D.current),uW(P.current,O.current,F).then(z=>{const ee={...z,isPositioned:R.current!==!1};U.current&&!kh(T.current,ee)&&(T.current=ee,Kc.flushSync(()=>{p(ee)}))})},[x,t,n,D,R]);jh(()=>{f===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,p(F=>({...F,isPositioned:!1})))},[f]);const U=v.useRef(!1);jh(()=>(U.current=!0,()=>{U.current=!1}),[]),jh(()=>{if(E&&(P.current=E),_&&(O.current=_),E&&_){if(M.current)return M.current(E,_,q);q()}},[E,_,q,M,I]);const H=v.useMemo(()=>({reference:P,floating:O,setReference:C,setFloating:N}),[C,N]),J=v.useMemo(()=>({reference:E,floating:_}),[E,_]),Z=v.useMemo(()=>{const F={position:n,left:0,top:0};if(!J.floating)return F;const z=WE(J.floating,h.x),ee=WE(J.floating,h.y);return c?{...F,transform:"translate("+z+"px, "+ee+"px)",...J$(J.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:z,top:ee}},[n,c,J.floating,h.x,h.y]);return v.useMemo(()=>({...h,update:q,refs:H,elements:J,floatingStyles:Z}),[h,q,H,J,Z])}const hW=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?qE({element:r.current,padding:a}).fn(n):{}:r?qE({element:r,padding:a}).fn(n):{}}}},mW=(e,t)=>({...aW(e),options:[e,t]}),vW=(e,t)=>({...sW(e),options:[e,t]}),gW=(e,t)=>({...cW(e),options:[e,t]}),xW=(e,t)=>({...iW(e),options:[e,t]}),yW=(e,t)=>({...oW(e),options:[e,t]}),bW=(e,t)=>({...lW(e),options:[e,t]}),wW=(e,t)=>({...hW(e),options:[e,t]});var jW="Arrow",Z$=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return s.jsx(Ge.svg,{...i,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});Z$.displayName=jW;var SW=Z$;function ev(e){const[t,n]=v.useState(void 0);return Hn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let o,c;if("borderBoxSize"in i){const d=i.borderBoxSize,f=Array.isArray(d)?d[0]:d;o=f.inlineSize,c=f.blockSize}else o=e.offsetWidth,c=e.offsetHeight;n({width:o,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var sN="Popper",[eD,Gi]=lr(sN),[NW,tD]=eD(sN),nD=e=>{const{__scopePopper:t,children:n}=e,[r,a]=v.useState(null);return s.jsx(NW,{scope:t,anchor:r,onAnchorChange:a,children:n})};nD.displayName=sN;var rD="PopperAnchor",aD=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=tD(rD,n),o=v.useRef(null),c=vt(t,o),d=v.useRef(null);return v.useEffect(()=>{const f=d.current;d.current=r?.current||o.current,f!==d.current&&i.onAnchorChange(d.current)}),r?null:s.jsx(Ge.div,{...a,ref:c})});aD.displayName=rD;var iN="PopperContent",[CW,AW]=eD(iN),sD=v.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:o=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:h=0,sticky:p="partial",hideWhenDetached:x=!1,updatePositionStrategy:g="optimized",onPlaced:j,...b}=e,y=tD(iN,n),[S,C]=v.useState(null),N=vt(t,oe=>C(oe)),[E,_]=v.useState(null),P=ev(E),O=P?.width??0,T=P?.height??0,I=r+(i!=="center"?"-"+i:""),M=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},D=Array.isArray(f)?f:[f],R=D.length>0,q={padding:M,boundary:D.filter(EW),altBoundary:R},{refs:U,floatingStyles:H,placement:J,isPositioned:Z,middlewareData:F}=pW({strategy:"fixed",placement:I,whileElementsMounted:(...oe)=>rW(...oe,{animationFrame:g==="always"}),elements:{reference:y.anchor},middleware:[mW({mainAxis:a+T,alignmentAxis:o}),d&&vW({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?gW():void 0,...q}),d&&xW({...q}),yW({...q,apply:({elements:oe,rects:ce,availableWidth:le,availableHeight:fe})=>{const{width:Ce,height:ae}=ce.reference,ke=oe.floating.style;ke.setProperty("--radix-popper-available-width",`${le}px`),ke.setProperty("--radix-popper-available-height",`${fe}px`),ke.setProperty("--radix-popper-anchor-width",`${Ce}px`),ke.setProperty("--radix-popper-anchor-height",`${ae}px`)}}),E&&wW({element:E,padding:c}),PW({arrowWidth:O,arrowHeight:T}),x&&bW({strategy:"referenceHidden",...q})]}),[z,ee]=lD(J),B=Tn(j);Hn(()=>{Z&&B?.()},[Z,B]);const L=F.arrow?.x,te=F.arrow?.y,ie=F.arrow?.centerOffset!==0,[G,de]=v.useState();return Hn(()=>{S&&de(window.getComputedStyle(S).zIndex)},[S]),s.jsx("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:Z?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(" "),...F.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(CW,{scope:n,placedSide:z,onArrowChange:_,arrowX:L,arrowY:te,shouldHideArrow:ie,children:s.jsx(Ge.div,{"data-side":z,"data-align":ee,...b,ref:N,style:{...b.style,animation:Z?void 0:"none"}})})})});sD.displayName=iN;var iD="PopperArrow",_W={top:"bottom",right:"left",bottom:"top",left:"right"},oD=v.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=AW(iD,r),o=_W[i.placedSide];return s.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:s.jsx(SW,{...a,ref:n,style:{...a.style,display:"block"}})})});oD.displayName=iD;function EW(e){return e!==null}var PW=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:a}=t,o=a.arrow?.centerOffset!==0,c=o?0:e.arrowWidth,d=o?0:e.arrowHeight,[f,h]=lD(n),p={start:"0%",center:"50%",end:"100%"}[h],x=(a.arrow?.x??0)+c/2,g=(a.arrow?.y??0)+d/2;let j="",b="";return f==="bottom"?(j=o?p:`${x}px`,b=`${-d}px`):f==="top"?(j=o?p:`${x}px`,b=`${r.floating.height+d}px`):f==="right"?(j=`${-d}px`,b=o?p:`${g}px`):f==="left"&&(j=`${r.floating.width+d}px`,b=o?p:`${g}px`),{data:{x:j,y:b}}}});function lD(e){const[t,n="center"]=e.split("-");return[t,n]}var tv=nD,xf=aD,nv=sD,rv=oD,kW=Symbol("radix.slottable");function OW(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=kW,t}var[av]=lr("Tooltip",[Gi]),sv=Gi(),cD="TooltipProvider",TW=700,Gj="tooltip.open",[RW,oN]=av(cD),uD=e=>{const{__scopeTooltip:t,delayDuration:n=TW,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:i}=e,o=v.useRef(!0),c=v.useRef(!1),d=v.useRef(0);return v.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),s.jsx(RW,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:v.useCallback(()=>{window.clearTimeout(d.current),o.current=!1},[]),onClose:v.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:v.useCallback(f=>{c.current=f},[]),disableHoverableContent:a,children:i})};uD.displayName=cD;var Sd="Tooltip",[IW,iv]=av(Sd),dD=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:i,disableHoverableContent:o,delayDuration:c}=e,d=oN(Sd,e.__scopeTooltip),f=sv(t),[h,p]=v.useState(null),x=Vn(),g=v.useRef(0),j=o??d.disableHoverableContent,b=c??d.delayDuration,y=v.useRef(!1),[S,C]=oa({prop:r,defaultProp:a??!1,onChange:O=>{O?(d.onOpen(),document.dispatchEvent(new CustomEvent(Gj))):d.onClose(),i?.(O)},caller:Sd}),N=v.useMemo(()=>S?y.current?"delayed-open":"instant-open":"closed",[S]),E=v.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y.current=!1,C(!0)},[C]),_=v.useCallback(()=>{window.clearTimeout(g.current),g.current=0,C(!1)},[C]),P=v.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{y.current=!0,C(!0),g.current=0},b)},[b,C]);return v.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),s.jsx(tv,{...f,children:s.jsx(IW,{scope:t,contentId:x,open:S,stateAttribute:N,trigger:h,onTriggerChange:p,onTriggerEnter:v.useCallback(()=>{d.isOpenDelayedRef.current?P():E()},[d.isOpenDelayedRef,P,E]),onTriggerLeave:v.useCallback(()=>{j?_():(window.clearTimeout(g.current),g.current=0)},[_,j]),onOpen:E,onClose:_,disableHoverableContent:j,children:n})})};dD.displayName=Sd;var Yj="TooltipTrigger",fD=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=iv(Yj,n),i=oN(Yj,n),o=sv(n),c=v.useRef(null),d=vt(t,c,a.onTriggerChange),f=v.useRef(!1),h=v.useRef(!1),p=v.useCallback(()=>f.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),s.jsx(xf,{asChild:!0,...o,children:s.jsx(Ge.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:d,onPointerMove:Te(e.onPointerMove,x=>{x.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),h.current=!0)}),onPointerLeave:Te(e.onPointerLeave,()=>{a.onTriggerLeave(),h.current=!1}),onPointerDown:Te(e.onPointerDown,()=>{a.open&&a.onClose(),f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Te(e.onFocus,()=>{f.current||a.onOpen()}),onBlur:Te(e.onBlur,a.onClose),onClick:Te(e.onClick,a.onClose)})})});fD.displayName=Yj;var MW="TooltipPortal",[zge,$W]=av(MW,{forceMount:void 0}),vc="TooltipContent",pD=v.forwardRef((e,t)=>{const n=$W(vc,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...i}=e,o=iv(vc,e.__scopeTooltip);return s.jsx(Kn,{present:r||o.open,children:o.disableHoverableContent?s.jsx(hD,{side:a,...i,ref:t}):s.jsx(DW,{side:a,...i,ref:t})})}),DW=v.forwardRef((e,t)=>{const n=iv(vc,e.__scopeTooltip),r=oN(vc,e.__scopeTooltip),a=v.useRef(null),i=vt(t,a),[o,c]=v.useState(null),{trigger:d,onClose:f}=n,h=a.current,{onPointerInTransitChange:p}=r,x=v.useCallback(()=>{c(null),p(!1)},[p]),g=v.useCallback((j,b)=>{const y=j.currentTarget,S={x:j.clientX,y:j.clientY},C=UW(S,y.getBoundingClientRect()),N=qW(S,C),E=WW(b.getBoundingClientRect()),_=HW([...N,...E]);c(_),p(!0)},[p]);return v.useEffect(()=>()=>x(),[x]),v.useEffect(()=>{if(d&&h){const j=y=>g(y,h),b=y=>g(y,d);return d.addEventListener("pointerleave",j),h.addEventListener("pointerleave",b),()=>{d.removeEventListener("pointerleave",j),h.removeEventListener("pointerleave",b)}}},[d,h,g,x]),v.useEffect(()=>{if(o){const j=b=>{const y=b.target,S={x:b.clientX,y:b.clientY},C=d?.contains(y)||h?.contains(y),N=!VW(S,o);C?x():N&&(x(),f())};return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[d,h,o,f,x]),s.jsx(hD,{...e,ref:i})}),[LW,FW]=av(Sd,{isInside:!1}),BW=OW("TooltipContent"),hD=v.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:o,...c}=e,d=iv(vc,n),f=sv(n),{onClose:h}=d;return v.useEffect(()=>(document.addEventListener(Gj,h),()=>document.removeEventListener(Gj,h)),[h]),v.useEffect(()=>{if(d.trigger){const p=x=>{x.target?.contains(d.trigger)&&h()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[d.trigger,h]),s.jsx(Qo,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:p=>p.preventDefault(),onDismiss:h,children:s.jsxs(nv,{"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:[s.jsx(BW,{children:r}),s.jsx(LW,{scope:n,isInside:!0,children:s.jsx(g7,{id:d.contentId,role:"tooltip",children:a||r})})]})})});pD.displayName=vc;var mD="TooltipArrow",zW=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=sv(n);return FW(mD,n).isInside?null:s.jsx(rv,{...a,...r,ref:t})});zW.displayName=mD;function UW(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,a,i)){case i:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function qW(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 WW(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}function VW(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const c=t[i],d=t[o],f=c.x,h=c.y,p=d.x,x=d.y;h>r!=x>r&&n<(p-f)*(r-h)/(x-h)+f&&(a=!a)}return a}function HW(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),KW(t)}function KW(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const a=e[r];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))n.pop();else break}n.push(a)}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 GW=uD,YW=dD,XW=fD,vD=pD;const gD=GW,xD=YW,yD=XW,lN=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(vD,{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}));lN.displayName=vD.displayName;var ov=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(){}},QW={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},JW=class{#e=QW;#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)}},Xj=new JW;function ZW(e){setTimeout(e,0)}var lv=typeof window>"u"||"Deno"in globalThis;function Ba(){}function eV(e,t){return typeof e=="function"?e(t):e}function tV(e){return typeof e=="number"&&e>=0&&e!==1/0}function nV(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Qj(e,t){return typeof e=="function"?e(t):e}function rV(e,t){return typeof e=="function"?e(t):e}function VE(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:i,queryKey:o,stale:c}=e;if(o){if(r){if(t.queryHash!==cN(o,t.options))return!1}else if(!Cd(t.queryKey,o))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||a&&a!==t.state.fetchStatus||i&&!i(t))}function HE(e,t){const{exact:n,status:r,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Nd(t.options.mutationKey)!==Nd(i))return!1}else if(!Cd(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function cN(e,t){return(t?.queryKeyHashFn||Nd)(e)}function Nd(e){return JSON.stringify(e,(t,n)=>Jj(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function Cd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Cd(e[n],t[n])):!1}var aV=Object.prototype.hasOwnProperty;function bD(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=KE(e)&&KE(t);if(!r&&!(Jj(e)&&Jj(t)))return t;const i=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),c=o.length,d=r?new Array(c):{};let f=0;for(let h=0;h<c;h++){const p=r?h:o[h],x=e[p],g=t[p];if(x===g){d[p]=x,(r?h<i:aV.call(e,p))&&f++;continue}if(x===null||g===null||typeof x!="object"||typeof g!="object"){d[p]=g;continue}const j=bD(x,g,n+1);d[p]=j,j===x&&f++}return i===c&&f===i?e:d}function KE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Jj(e){if(!GE(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!GE(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function GE(e){return Object.prototype.toString.call(e)==="[object Object]"}function sV(e){return new Promise(t=>{Xj.setTimeout(t,e)})}function iV(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?bD(e,t):t}function oV(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function lV(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var uN=Symbol();function wD(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===uN?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function cV(e,t,n){let r=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??=t(),r||(r=!0,a.aborted?n():a.addEventListener("abort",n,{once:!0})),a)}),e}var uV=class extends ov{#e;#n;#t;constructor(){super(),this.#t=e=>{if(!lv&&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"}},jD=new uV;function dV(){let e,t;const n=new Promise((a,i)=>{e=a,t=i});n.status="pending",n.catch(()=>{});function r(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{r({status:"fulfilled",value:a}),e(a)},n.reject=a=>{r({status:"rejected",reason:a}),t(a)},n}var fV=ZW;function pV(){let e=[],t=0,n=c=>{c()},r=c=>{c()},a=fV;const i=c=>{t?e.push(c):a(()=>{n(c)})},o=()=>{const c=e;e=[],c.length&&a(()=>{r(()=>{c.forEach(d=>{n(d)})})})};return{batch:c=>{let d;t++;try{d=c()}finally{t--,t||o()}return d},batchCalls:c=>(...d)=>{i(()=>{c(...d)})},schedule:i,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{a=c}}}var wr=pV(),hV=class extends ov{#e=!0;#n;#t;constructor(){super(),this.#t=e=>{if(!lv&&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}},Oh=new hV;function mV(e){return Math.min(1e3*2**e,3e4)}function SD(e){return(e??"online")==="online"?Oh.isOnline():!0}var Zj=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function ND(e){let t=!1,n=0,r;const a=dV(),i=()=>a.status!=="pending",o=b=>{if(!i()){const y=new Zj(b);x(y),e.onCancel?.(y)}},c=()=>{t=!0},d=()=>{t=!1},f=()=>jD.isFocused()&&(e.networkMode==="always"||Oh.isOnline())&&e.canRun(),h=()=>SD(e.networkMode)&&e.canRun(),p=b=>{i()||(r?.(),a.resolve(b))},x=b=>{i()||(r?.(),a.reject(b))},g=()=>new Promise(b=>{r=y=>{(i()||f())&&b(y)},e.onPause?.()}).then(()=>{r=void 0,i()||e.onContinue?.()}),j=()=>{if(i())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(i())return;const C=e.retry??(lv?0:3),N=e.retryDelay??mV,E=typeof N=="function"?N(n,S):N,_=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,S);if(t||!_){x(S);return}n++,e.onFail?.(n,S),sV(E).then(()=>f()?void 0:g()).then(()=>{t?x(S):j()})})};return{promise:a,status:()=>a.status,cancel:o,continue:()=>(r?.(),a),cancelRetry:c,continueRetry:d,canStart:h,start:()=>(h()?j():g().then(j),a)}}var CD=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),tV(this.gcTime)&&(this.#e=Xj.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(lv?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Xj.clearTimeout(this.#e),this.#e=void 0)}},vV=class extends CD{#e;#n;#t;#a;#r;#i;#o;constructor(e){super(),this.#o=!1,this.#i=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=XE(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.#i,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=XE(this.options);t.data!==void 0&&(this.setState(YE(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#t.remove(this)}setData(e,t){const n=iV(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(Ba).catch(Ba):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>rV(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===uN||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Qj(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:!nV(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.#o?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.#o=!0,n.signal)})},a=()=>{const c=wD(this.options,t),f=(()=>{const h={client:this.#a,queryKey:this.queryKey,meta:this.meta};return r(h),h})();return this.#o=!1,this.options.persister?this.options.persister(c,f,this):c(f)},o=(()=>{const c={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#a,state:this.state,fetchFn:a};return r(c),c})();this.options.behavior?.onFetch(o,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#s({type:"fetch",meta:o.fetchOptions?.meta}),this.#r=ND({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:c=>{c instanceof Zj&&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:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.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 Zj){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,...gV(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...YE(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 a=e.error;return{...n,error:a,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),wr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#t.notify({query:this,type:"updated",action:e})})}};function gV(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:SD(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function YE(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function XE(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 QE(e){return{onFetch:(t,n)=>{const r=t.options,a=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let c={pages:[],pageParams:[]},d=0;const f=async()=>{let h=!1;const p=j=>{cV(j,()=>t.signal,()=>h=!0)},x=wD(t.options,t.fetchOptions),g=async(j,b,y)=>{if(h)return Promise.reject();if(b==null&&j.pages.length)return Promise.resolve(j);const C=(()=>{const P={client:t.client,queryKey:t.queryKey,pageParam:b,direction:y?"backward":"forward",meta:t.options.meta};return p(P),P})(),N=await x(C),{maxPages:E}=t.options,_=y?lV:oV;return{pages:_(j.pages,N,E),pageParams:_(j.pageParams,b,E)}};if(a&&i.length){const j=a==="backward",b=j?xV:JE,y={pages:i,pageParams:o},S=b(r,y);c=await g(y,S,j)}else{const j=e??i.length;do{const b=d===0?o[0]??r.initialPageParam:JE(r,c);if(d>0&&b==null)break;c=await g(c,b),d++}while(d<j)}return c};t.options.persister?t.fetchFn=()=>t.options.persister?.(f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=f}}}function JE(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 xV(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var yV=class extends CD{#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||bV(),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=ND({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(i,o)=>{this.#r({type:"failed",failureCount:i,error:o})},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",a=!this.#a.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:a}),this.#t.config.onMutate&&await this.#t.config.onMutate(e,this,n);const o=await this.options.onMutate?.(e,n);o!==this.state.context&&this.#r({type:"pending",context:o,variables:e,isPaused:a})}const i=await this.#a.start();return await this.#t.config.onSuccess?.(i,e,this.state.context,this,n),await this.options.onSuccess?.(i,e,this.state.context,n),await this.#t.config.onSettled?.(i,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(i,null,e,this.state.context,n),this.#r({type:"success",data:i}),i}catch(i){try{await this.#t.config.onError?.(i,e,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onError?.(i,e,this.state.context,n)}catch(o){Promise.reject(o)}try{await this.#t.config.onSettled?.(void 0,i,this.state.variables,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onSettled?.(void 0,i,e,this.state.context,n)}catch(o){Promise.reject(o)}throw this.#r({type:"error",error:i}),i}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),wr.batch(()=>{this.#n.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function bV(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var wV=class extends ov{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 yV({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=Xp(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=Xp(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=Xp(e);if(typeof t=="string"){const r=this.#n.get(t)?.find(a=>a.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=Xp(e);return typeof t=="string"?this.#n.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){wr.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=>HE(t,n))}findAll(e={}){return this.getAll().filter(t=>HE(e,t))}notify(e){wr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return wr.batch(()=>Promise.all(e.map(t=>t.continue().catch(Ba))))}};function Xp(e){return e.options.scope?.id}var jV=class extends ov{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,a=t.queryHash??cN(r,t);let i=this.get(a);return i||(i=new vV({client:e,queryKey:r,queryHash:a,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(i)),i}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){wr.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=>VE(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>VE(e,n)):t}notify(e){wr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){wr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){wr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},SV=class{#e;#n;#t;#a;#r;#i;#o;#s;constructor(e={}){this.#e=e.queryCache||new jV,this.#n=e.mutationCache||new wV,this.#t=e.defaultOptions||{},this.#a=new Map,this.#r=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=jD.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Oh.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#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(Qj(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,o=eV(t,i);if(o!==void 0)return this.#e.build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return wr.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;wr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return wr.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=wr.batch(()=>this.#e.findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(Ba).catch(Ba)}invalidateQueries(e,t={}){return wr.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=wr.batch(()=>this.#e.findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let i=a.fetch(void 0,n);return n.throwOnError||(i=i.catch(Ba)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Ba)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(Qj(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ba).catch(Ba)}fetchInfiniteQuery(e){return e.behavior=QE(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ba).catch(Ba)}ensureInfiniteQueryData(e){return e.behavior=QE(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Oh.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(Nd(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#a.values()],n={};return t.forEach(r=>{Cd(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Nd(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Cd(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=cN(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===uN&&(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()}},NV=v.createContext(void 0),CV=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(NV.Provider,{value:e,children:t}));function Ad(){return Ad=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},Ad.apply(this,arguments)}var Di;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Di||(Di={}));const ZE="popstate";function AV(e){e===void 0&&(e={});function t(r,a){let{pathname:i,search:o,hash:c}=r.location;return e1("",{pathname:i,search:o,hash:c},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:Th(a)}return EV(t,n,null,e)}function jn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function dN(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function _V(){return Math.random().toString(36).substr(2,8)}function eP(e,t){return{usr:e.state,key:e.key,idx:t}}function e1(e,t,n,r){return n===void 0&&(n=null),Ad({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Jc(t):t,{state:n,key:t&&t.key||r||_V()})}function Th(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 Jc(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 EV(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:i=!1}=r,o=a.history,c=Di.Pop,d=null,f=h();f==null&&(f=0,o.replaceState(Ad({},o.state,{idx:f}),""));function h(){return(o.state||{idx:null}).idx}function p(){c=Di.Pop;let y=h(),S=y==null?null:y-f;f=y,d&&d({action:c,location:b.location,delta:S})}function x(y,S){c=Di.Push;let C=e1(b.location,y,S);f=h()+1;let N=eP(C,f),E=b.createHref(C);try{o.pushState(N,"",E)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;a.location.assign(E)}i&&d&&d({action:c,location:b.location,delta:1})}function g(y,S){c=Di.Replace;let C=e1(b.location,y,S);f=h();let N=eP(C,f),E=b.createHref(C);o.replaceState(N,"",E),i&&d&&d({action:c,location:b.location,delta:0})}function j(y){let S=a.location.origin!=="null"?a.location.origin:a.location.href,C=typeof y=="string"?y:Th(y);return C=C.replace(/ $/,"%20"),jn(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(a,o)},listen(y){if(d)throw new Error("A history only accepts one active listener");return a.addEventListener(ZE,p),d=y,()=>{a.removeEventListener(ZE,p),d=null}},createHref(y){return t(a,y)},createURL:j,encodeLocation(y){let S=j(y);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:x,replace:g,go(y){return o.go(y)}};return b}var tP;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(tP||(tP={}));function PV(e,t,n){return n===void 0&&(n="/"),kV(e,t,n)}function kV(e,t,n,r){let a=typeof t=="string"?Jc(t):t,i=gc(a.pathname||"/",n);if(i==null)return null;let o=AD(e);OV(o);let c=null;for(let d=0;c==null&&d<o.length;++d){let f=UV(i);c=BV(o[d],f)}return c}function AD(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let a=(i,o,c)=>{let d={relativePath:c===void 0?i.path||"":c,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};d.relativePath.startsWith("/")&&(jn(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=Fi([r,d.relativePath]),h=n.concat(d);i.children&&i.children.length>0&&(jn(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),AD(i.children,t,h,f)),!(i.path==null&&!i.index)&&t.push({path:f,score:LV(f,i.index),routesMeta:h})};return e.forEach((i,o)=>{var c;if(i.path===""||!((c=i.path)!=null&&c.includes("?")))a(i,o);else for(let d of _D(i.path))a(i,o,d)}),t}function _D(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return a?[i,""]:[i];let o=_D(r.join("/")),c=[];return c.push(...o.map(d=>d===""?i:[i,d].join("/"))),a&&c.push(...o),c.map(d=>e.startsWith("/")&&d===""?"/":d)}function OV(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:FV(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const TV=/^:[\w-]+$/,RV=3,IV=2,MV=1,$V=10,DV=-2,nP=e=>e==="*";function LV(e,t){let n=e.split("/"),r=n.length;return n.some(nP)&&(r+=DV),t&&(r+=IV),n.filter(a=>!nP(a)).reduce((a,i)=>a+(TV.test(i)?RV:i===""?MV:$V),r)}function FV(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function BV(e,t,n){let{routesMeta:r}=e,a={},i="/",o=[];for(let c=0;c<r.length;++c){let d=r[c],f=c===r.length-1,h=i==="/"?t:t.slice(i.length)||"/",p=en({path:d.relativePath,caseSensitive:d.caseSensitive,end:f},h),x=d.route;if(!p)return null;Object.assign(a,p.params),o.push({params:a,pathname:Fi([i,p.pathname]),pathnameBase:KV(Fi([i,p.pathnameBase])),route:x}),p.pathnameBase!=="/"&&(i=Fi([i,p.pathnameBase]))}return o}function en(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=zV(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let i=a[0],o=i.replace(/(.)\/+$/,"$1"),c=a.slice(1);return{params:r.reduce((f,h,p)=>{let{paramName:x,isOptional:g}=h;if(x==="*"){let b=c[p]||"";o=i.slice(0,i.length-b.length).replace(/(.)\/+$/,"$1")}const j=c[p];return g&&!j?f[x]=void 0:f[x]=(j||"").replace(/%2F/g,"/"),f},{}),pathname:i,pathnameBase:o,pattern:e}}function zV(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),dN(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=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,c,d)=>(r.push({paramName:c,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function UV(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return dN(!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 gc(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 qV=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,WV=e=>qV.test(e);function VV(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Jc(e):e,i;if(n)if(WV(n))i=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),dN(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?i=rP(n.substring(1),"/"):i=rP(n,t)}else i=t;return{pathname:i,search:GV(r),hash:YV(a)}}function rP(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function xy(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 HV(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function fN(e,t){let n=HV(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function pN(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=Jc(e):(a=Ad({},e),jn(!a.pathname||!a.pathname.includes("?"),xy("?","pathname","search",a)),jn(!a.pathname||!a.pathname.includes("#"),xy("#","pathname","hash",a)),jn(!a.search||!a.search.includes("#"),xy("#","search","hash",a)));let i=e===""||a.pathname==="",o=i?"/":a.pathname,c;if(o==null)c=n;else{let p=t.length-1;if(!r&&o.startsWith("..")){let x=o.split("/");for(;x[0]==="..";)x.shift(),p-=1;a.pathname=x.join("/")}c=p>=0?t[p]:"/"}let d=VV(a,c),f=o&&o!=="/"&&o.endsWith("/"),h=(i||o===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(f||h)&&(d.pathname+="/"),d}const Fi=e=>e.join("/").replace(/\/\/+/g,"/"),KV=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),GV=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,YV=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function XV(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const ED=["post","put","patch","delete"];new Set(ED);const QV=["get",...ED];new Set(QV);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 cv=v.createContext(null),PD=v.createContext(null),ri=v.createContext(null),uv=v.createContext(null),Ns=v.createContext({outlet:null,matches:[],isDataRoute:!1}),kD=v.createContext(null);function JV(e,t){let{relative:n}=t===void 0?{}:t;Zc()||jn(!1);let{basename:r,navigator:a}=v.useContext(ri),{hash:i,pathname:o,search:c}=dv(e,{relative:n}),d=o;return r!=="/"&&(d=o==="/"?r:Fi([r,o])),a.createHref({pathname:d,search:c,hash:i})}function Zc(){return v.useContext(uv)!=null}function Cs(){return Zc()||jn(!1),v.useContext(uv).location}function OD(e){v.useContext(ri).static||v.useLayoutEffect(e)}function Ea(){let{isDataRoute:e}=v.useContext(Ns);return e?pH():ZV()}function ZV(){Zc()||jn(!1);let e=v.useContext(cv),{basename:t,future:n,navigator:r}=v.useContext(ri),{matches:a}=v.useContext(Ns),{pathname:i}=Cs(),o=JSON.stringify(fN(a,n.v7_relativeSplatPath)),c=v.useRef(!1);return OD(()=>{c.current=!0}),v.useCallback(function(f,h){if(h===void 0&&(h={}),!c.current)return;if(typeof f=="number"){r.go(f);return}let p=pN(f,JSON.parse(o),i,h.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Fi([t,p.pathname])),(h.replace?r.replace:r.push)(p,h.state,h)},[t,r,o,i,e])}const eH=v.createContext(null);function tH(e){let t=v.useContext(Ns).outlet;return t&&v.createElement(eH.Provider,{value:e},t)}function Zo(){let{matches:e}=v.useContext(Ns),t=e[e.length-1];return t?t.params:{}}function dv(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=v.useContext(ri),{matches:a}=v.useContext(Ns),{pathname:i}=Cs(),o=JSON.stringify(fN(a,r.v7_relativeSplatPath));return v.useMemo(()=>pN(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function nH(e,t){return rH(e,t)}function rH(e,t,n,r){Zc()||jn(!1);let{navigator:a}=v.useContext(ri),{matches:i}=v.useContext(Ns),o=i[i.length-1],c=o?o.params:{};o&&o.pathname;let d=o?o.pathnameBase:"/";o&&o.route;let f=Cs(),h;if(t){var p;let y=typeof t=="string"?Jc(t):t;d==="/"||(p=y.pathname)!=null&&p.startsWith(d)||jn(!1),h=y}else h=f;let x=h.pathname||"/",g=x;if(d!=="/"){let y=d.replace(/^\//,"").split("/");g="/"+x.replace(/^\//,"").split("/").slice(y.length).join("/")}let j=PV(e,{pathname:g}),b=lH(j&&j.map(y=>Object.assign({},y,{params:Object.assign({},c,y.params),pathname:Fi([d,a.encodeLocation?a.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?d:Fi([d,a.encodeLocation?a.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),i,n,r);return t&&b?v.createElement(uv.Provider,{value:{location:_d({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:Di.Pop}},b):b}function aH(){let e=fH(),t=XV(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:a},n):null,null)}const sH=v.createElement(aH,null);class iH extends v.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?v.createElement(Ns.Provider,{value:this.props.routeContext},v.createElement(kD.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function oH(e){let{routeContext:t,match:n,children:r}=e,a=v.useContext(cv);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(Ns.Provider,{value:t},r)}function lH(e,t,n,r){var a;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,c=(a=n)==null?void 0:a.errors;if(c!=null){let h=o.findIndex(p=>p.route.id&&c?.[p.route.id]!==void 0);h>=0||jn(!1),o=o.slice(0,Math.min(o.length,h+1))}let d=!1,f=-1;if(n&&r&&r.v7_partialHydration)for(let h=0;h<o.length;h++){let p=o[h];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(f=h),p.route.id){let{loaderData:x,errors:g}=n,j=p.route.loader&&x[p.route.id]===void 0&&(!g||g[p.route.id]===void 0);if(p.route.lazy||j){d=!0,f>=0?o=o.slice(0,f+1):o=[o[0]];break}}}return o.reduceRight((h,p,x)=>{let g,j=!1,b=null,y=null;n&&(g=c&&p.route.id?c[p.route.id]:void 0,b=p.route.errorElement||sH,d&&(f<0&&x===0?(hH("route-fallback"),j=!0,y=null):f===x&&(j=!0,y=p.route.hydrateFallbackElement||null)));let S=t.concat(o.slice(0,x+1)),C=()=>{let N;return g?N=b:j?N=y:p.route.Component?N=v.createElement(p.route.Component,null):p.route.element?N=p.route.element:N=h,v.createElement(oH,{match:p,routeContext:{outlet:h,matches:S,isDataRoute:n!=null},children:N})};return n&&(p.route.ErrorBoundary||p.route.errorElement||x===0)?v.createElement(iH,{location:n.location,revalidation:n.revalidation,component:b,error:g,children:C(),routeContext:{outlet:null,matches:S,isDataRoute:!0}}):C()},null)}var TD=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(TD||{}),RD=(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})(RD||{});function cH(e){let t=v.useContext(cv);return t||jn(!1),t}function uH(e){let t=v.useContext(PD);return t||jn(!1),t}function dH(e){let t=v.useContext(Ns);return t||jn(!1),t}function ID(e){let t=dH(),n=t.matches[t.matches.length-1];return n.route.id||jn(!1),n.route.id}function fH(){var e;let t=v.useContext(kD),n=uH(),r=ID();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function pH(){let{router:e}=cH(TD.UseNavigateStable),t=ID(RD.UseNavigateStable),n=v.useRef(!1);return OD(()=>{n.current=!0}),v.useCallback(function(a,i){i===void 0&&(i={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,_d({fromRouteId:t},i)))},[e,t])}const aP={};function hH(e,t,n){aP[e]||(aP[e]=!0)}function mH(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function MD(e){let{to:t,replace:n,state:r,relative:a}=e;Zc()||jn(!1);let{future:i,static:o}=v.useContext(ri),{matches:c}=v.useContext(Ns),{pathname:d}=Cs(),f=Ea(),h=pN(t,fN(c,i.v7_relativeSplatPath),d,a==="path"),p=JSON.stringify(h);return v.useEffect(()=>f(JSON.parse(p),{replace:n,state:r,relative:a}),[f,p,a,n,r]),null}function sP(e){return tH(e.context)}function Zt(e){jn(!1)}function vH(e){let{basename:t="/",children:n=null,location:r,navigationType:a=Di.Pop,navigator:i,static:o=!1,future:c}=e;Zc()&&jn(!1);let d=t.replace(/^\/*/,"/"),f=v.useMemo(()=>({basename:d,navigator:i,static:o,future:_d({v7_relativeSplatPath:!1},c)}),[d,c,i,o]);typeof r=="string"&&(r=Jc(r));let{pathname:h="/",search:p="",hash:x="",state:g=null,key:j="default"}=r,b=v.useMemo(()=>{let y=gc(h,d);return y==null?null:{location:{pathname:y,search:p,hash:x,state:g,key:j},navigationType:a}},[d,h,p,x,g,j,a]);return b==null?null:v.createElement(ri.Provider,{value:f},v.createElement(uv.Provider,{children:n,value:b}))}function gH(e){let{children:t,location:n}=e;return nH(t1(t),n)}new Promise(()=>{});function t1(e,t){t===void 0&&(t=[]);let n=[];return v.Children.forEach(e,(r,a)=>{if(!v.isValidElement(r))return;let i=[...t,a];if(r.type===v.Fragment){n.push.apply(n,t1(r.props.children,i));return}r.type!==Zt&&jn(!1),!r.props.index||!r.props.children||jn(!1);let o={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=t1(r.props.children,i)),n.push(o)}),n}function Rh(){return Rh=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},Rh.apply(this,arguments)}function $D(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function xH(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function yH(e,t){return e.button===0&&(!t||t==="_self")&&!xH(e)}function n1(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(a=>[n,a]):[[n,r]])},[]))}function bH(e,t){let n=n1(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(i=>{n.append(a,i)})}),n}const wH=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],jH=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],SH="6";try{window.__reactRouterVersion=SH}catch{}const NH=v.createContext({isTransitioning:!1}),CH="startTransition",iP=Vm[CH];function AH(e){let{basename:t,children:n,future:r,window:a}=e,i=v.useRef();i.current==null&&(i.current=AV({window:a,v5Compat:!0}));let o=i.current,[c,d]=v.useState({action:o.action,location:o.location}),{v7_startTransition:f}=r||{},h=v.useCallback(p=>{f&&iP?iP(()=>d(p)):d(p)},[d,f]);return v.useLayoutEffect(()=>o.listen(h),[o,h]),v.useEffect(()=>mH(r),[r]),v.createElement(vH,{basename:t,children:n,location:c.location,navigationType:c.action,navigator:o,future:r})}const _H=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",EH=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,jt=v.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:i,replace:o,state:c,target:d,to:f,preventScrollReset:h,viewTransition:p}=t,x=$D(t,wH),{basename:g}=v.useContext(ri),j,b=!1;if(typeof f=="string"&&EH.test(f)&&(j=f,_H))try{let N=new URL(window.location.href),E=f.startsWith("//")?new URL(N.protocol+f):new URL(f),_=gc(E.pathname,g);E.origin===N.origin&&_!=null?f=_+E.search+E.hash:b=!0}catch{}let y=JV(f,{relative:a}),S=OH(f,{replace:o,state:c,target:d,preventScrollReset:h,relative:a,viewTransition:p});function C(N){r&&r(N),N.defaultPrevented||S(N)}return v.createElement("a",Rh({},x,{href:j||y,onClick:b||i?r:C,ref:n,target:d}))}),PH=v.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:a=!1,className:i="",end:o=!1,style:c,to:d,viewTransition:f,children:h}=t,p=$D(t,jH),x=dv(d,{relative:p.relative}),g=Cs(),j=v.useContext(PD),{navigator:b,basename:y}=v.useContext(ri),S=j!=null&&TH(x)&&f===!0,C=b.encodeLocation?b.encodeLocation(x).pathname:x.pathname,N=g.pathname,E=j&&j.navigation&&j.navigation.location?j.navigation.location.pathname:null;a||(N=N.toLowerCase(),E=E?E.toLowerCase():null,C=C.toLowerCase()),E&&y&&(E=gc(E,y)||E);const _=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let P=N===C||!o&&N.startsWith(C)&&N.charAt(_)==="/",O=E!=null&&(E===C||!o&&E.startsWith(C)&&E.charAt(C.length)==="/"),T={isActive:P,isPending:O,isTransitioning:S},I=P?r:void 0,M;typeof i=="function"?M=i(T):M=[i,P?"active":null,O?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let D=typeof c=="function"?c(T):c;return v.createElement(jt,Rh({},p,{"aria-current":I,className:M,ref:n,style:D,to:d,viewTransition:f}),typeof h=="function"?h(T):h)});var r1;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(r1||(r1={}));var oP;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(oP||(oP={}));function kH(e){let t=v.useContext(cv);return t||jn(!1),t}function OH(e,t){let{target:n,replace:r,state:a,preventScrollReset:i,relative:o,viewTransition:c}=t===void 0?{}:t,d=Ea(),f=Cs(),h=dv(e,{relative:o});return v.useCallback(p=>{if(yH(p,n)){p.preventDefault();let x=r!==void 0?r:Th(f)===Th(h);d(e,{replace:x,state:a,preventScrollReset:i,relative:o,viewTransition:c})}},[f,d,h,r,a,n,e,i,o,c])}function Yi(e){let t=v.useRef(n1(e)),n=v.useRef(!1),r=Cs(),a=v.useMemo(()=>bH(r.search,n.current?null:t.current),[r.search]),i=Ea(),o=v.useCallback((c,d)=>{const f=n1(typeof c=="function"?c(a):c);n.current=!0,i("?"+f,d)},[i,a]);return[a,o]}function TH(e,t){t===void 0&&(t={});let n=v.useContext(NH);n==null&&jn(!1);let{basename:r}=kH(r1.useViewTransitionState),a=dv(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=gc(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=gc(n.nextLocation.pathname,r)||n.nextLocation.pathname;return en(a.pathname,o)!=null||en(a.pathname,i)!=null}var RH=Symbol.for("react.lazy"),Ih=Vm[" use ".trim().toString()];function IH(e){return typeof e=="object"&&e!==null&&"then"in e}function DD(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===RH&&"_payload"in e&&IH(e._payload)}function fv(e){const t=MH(e),n=v.forwardRef((r,a)=>{let{children:i,...o}=r;DD(i)&&typeof Ih=="function"&&(i=Ih(i._payload));const c=v.Children.toArray(i),d=c.find(DH);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}var Xi=fv("Slot");function MH(e){const t=v.forwardRef((n,r)=>{let{children:a,...i}=n;if(DD(a)&&typeof Ih=="function"&&(a=Ih(a._payload)),v.isValidElement(a)){const o=FH(a),c=LH(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Cr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var $H=Symbol("radix.slottable");function DH(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$H}function LH(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function FH(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 yy=768;function BH(){const[e,t]=v.useState(void 0);return v.useEffect(()=>{const n=window.matchMedia(`(max-width: ${yy-1}px)`),r=()=>{t(window.innerWidth<yy)};return n.addEventListener("change",r),t(window.innerWidth<yy),()=>n.removeEventListener("change",r)},[]),!!e}const hN=Jo("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"}}),re=v.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},i)=>{const o=r?Xi:"button";return s.jsx(o,{className:Se(hN({variant:t,size:n,className:e})),ref:i,...a})});re.displayName="Button";const ft=v.forwardRef(({className:e,type:t,...n},r)=>s.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}));ft.displayName="Input";var zH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],UH=zH.reduce((e,t)=>{const n=fv(`Primitive.${t}`),r=v.forwardRef((a,i)=>{const{asChild:o,...c}=a,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),qH="Separator",lP="horizontal",WH=["horizontal","vertical"],LD=v.forwardRef((e,t)=>{const{decorative:n,orientation:r=lP,...a}=e,i=VH(r)?r:lP,c=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return s.jsx(UH.div,{"data-orientation":i,...c,...a,ref:t})});LD.displayName=qH;function VH(e){return WH.includes(e)}var FD=LD;const BD=v.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},a)=>s.jsx(FD,{ref:a,decorative:n,orientation:t,className:Se("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));BD.displayName=FD.displayName;var by="focusScope.autoFocusOnMount",wy="focusScope.autoFocusOnUnmount",cP={bubbles:!1,cancelable:!0},HH="FocusScope",yf=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[c,d]=v.useState(null),f=Tn(a),h=Tn(i),p=v.useRef(null),x=vt(t,b=>d(b)),g=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let b=function(N){if(g.paused||!c)return;const E=N.target;c.contains(E)?p.current=E:Ri(p.current,{select:!0})},y=function(N){if(g.paused||!c)return;const E=N.relatedTarget;E!==null&&(c.contains(E)||Ri(p.current,{select:!0}))},S=function(N){if(document.activeElement===document.body)for(const _ of N)_.removedNodes.length>0&&Ri(c)};document.addEventListener("focusin",b),document.addEventListener("focusout",y);const C=new MutationObserver(S);return c&&C.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",y),C.disconnect()}}},[r,c,g.paused]),v.useEffect(()=>{if(c){dP.add(g);const b=document.activeElement;if(!c.contains(b)){const S=new CustomEvent(by,cP);c.addEventListener(by,f),c.dispatchEvent(S),S.defaultPrevented||(KH(JH(zD(c)),{select:!0}),document.activeElement===b&&Ri(c))}return()=>{c.removeEventListener(by,f),setTimeout(()=>{const S=new CustomEvent(wy,cP);c.addEventListener(wy,h),c.dispatchEvent(S),S.defaultPrevented||Ri(b??document.body,{select:!0}),c.removeEventListener(wy,h),dP.remove(g)},0)}}},[c,f,h,g]);const j=v.useCallback(b=>{if(!n&&!r||g.paused)return;const y=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,S=document.activeElement;if(y&&S){const C=b.currentTarget,[N,E]=GH(C);N&&E?!b.shiftKey&&S===E?(b.preventDefault(),n&&Ri(N,{select:!0})):b.shiftKey&&S===N&&(b.preventDefault(),n&&Ri(E,{select:!0})):S===C&&b.preventDefault()}},[n,r,g.paused]);return s.jsx(Ge.div,{tabIndex:-1,...o,ref:x,onKeyDown:j})});yf.displayName=HH;function KH(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ri(r,{select:t}),document.activeElement!==n)return}function GH(e){const t=zD(e),n=uP(t,e),r=uP(t.reverse(),e);return[n,r]}function zD(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function uP(e,t){for(const n of e)if(!YH(n,{upTo:t}))return n}function YH(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 XH(e){return e instanceof HTMLInputElement&&"select"in e}function Ri(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&XH(e)&&t&&e.select()}}var dP=QH();function QH(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=fP(e,t),e.unshift(t)},remove(t){e=fP(e,t),e[0]?.resume()}}}function fP(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function JH(e){return e.filter(t=>t.tagName!=="A")}var jy=0;function pv(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??pP()),document.body.insertAdjacentElement("beforeend",e[1]??pP()),jy++,()=>{jy===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),jy--}},[])}function pP(){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 cs=function(){return cs=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},cs.apply(this,arguments)};function UD(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 a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function ZH(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,i;r<a;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Sh="right-scroll-bar-position",Nh="width-before-scroll-bar",eK="with-scroll-bars-hidden",tK="--removed-body-scroll-bar-size";function Sy(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function nK(e,t){var n=v.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var rK=typeof window<"u"?v.useLayoutEffect:v.useEffect,hP=new WeakMap;function aK(e,t){var n=nK(null,function(r){return e.forEach(function(a){return Sy(a,r)})});return rK(function(){var r=hP.get(n);if(r){var a=new Set(r),i=new Set(e),o=n.current;a.forEach(function(c){i.has(c)||Sy(c,null)}),i.forEach(function(c){a.has(c)||Sy(c,o)})}hP.set(n,e)},[e]),n}function sK(e){return e}function iK(e,t){t===void 0&&(t=sK);var n=[],r=!1,a={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var o=t(i,r);return n.push(o),function(){n=n.filter(function(c){return c!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(c){return i(c)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var c=n;n=[],c.forEach(i),o=n}var d=function(){var h=o;o=[],h.forEach(i)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(h){o.push(h),f()},filter:function(h){return o=o.filter(h),n}}}};return a}function oK(e){e===void 0&&(e={});var t=iK(null);return t.options=cs({async:!0,ssr:!1},e),t}var qD=function(e){var t=e.sideCar,n=UD(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 v.createElement(r,cs({},n))};qD.isSideCarExport=!0;function lK(e,t){return e.useMedium(t),qD}var WD=oK(),Ny=function(){},hv=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:Ny,onWheelCapture:Ny,onTouchMoveCapture:Ny}),a=r[0],i=r[1],o=e.forwardProps,c=e.children,d=e.className,f=e.removeScrollBar,h=e.enabled,p=e.shards,x=e.sideCar,g=e.noRelative,j=e.noIsolation,b=e.inert,y=e.allowPinchZoom,S=e.as,C=S===void 0?"div":S,N=e.gapMode,E=UD(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=x,P=aK([n,t]),O=cs(cs({},E),a);return v.createElement(v.Fragment,null,h&&v.createElement(_,{sideCar:WD,removeScrollBar:f,shards:p,noRelative:g,noIsolation:j,inert:b,setCallbacks:i,allowPinchZoom:!!y,lockRef:n,gapMode:N}),o?v.cloneElement(v.Children.only(c),cs(cs({},O),{ref:P})):v.createElement(C,cs({},O,{className:d,ref:P}),c))});hv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};hv.classNames={fullWidth:Nh,zeroRight:Sh};var cK=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function uK(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=cK();return t&&e.setAttribute("nonce",t),e}function dK(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function fK(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var pK=function(){var e=0,t=null;return{add:function(n){e==0&&(t=uK())&&(dK(t,n),fK(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},hK=function(){var e=pK();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},VD=function(){var e=hK(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},mK={left:0,top:0,right:0,gap:0},Cy=function(e){return parseInt(e||"",10)||0},vK=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[Cy(n),Cy(r),Cy(a)]},gK=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return mK;var t=vK(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])}},xK=VD(),ic="data-scroll-locked",yK=function(e,t,n,r){var a=e.left,i=e.top,o=e.right,c=e.gap;return n===void 0&&(n="margin"),`
10
- .`.concat(eK,` {
11
- overflow: hidden `).concat(r,`;
12
- padding-right: `).concat(c,"px ").concat(r,`;
13
- }
14
- body[`).concat(ic,`] {
15
- overflow: hidden `).concat(r,`;
16
- overscroll-behavior: contain;
17
- `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
18
- padding-left: `.concat(a,`px;
19
- padding-top: `).concat(i,`px;
20
- padding-right: `).concat(o,`px;
21
- margin-left:0;
22
- margin-top:0;
23
- margin-right: `).concat(c,"px ").concat(r,`;
24
- `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
25
- }
26
-
27
- .`).concat(Sh,` {
28
- right: `).concat(c,"px ").concat(r,`;
29
- }
30
-
31
- .`).concat(Nh,` {
32
- margin-right: `).concat(c,"px ").concat(r,`;
33
- }
34
-
35
- .`).concat(Sh," .").concat(Sh,` {
36
- right: 0 `).concat(r,`;
37
- }
38
-
39
- .`).concat(Nh," .").concat(Nh,` {
40
- margin-right: 0 `).concat(r,`;
41
- }
42
-
43
- body[`).concat(ic,`] {
44
- `).concat(tK,": ").concat(c,`px;
45
- }
46
- `)},mP=function(){var e=parseInt(document.body.getAttribute(ic)||"0",10);return isFinite(e)?e:0},bK=function(){v.useEffect(function(){return document.body.setAttribute(ic,(mP()+1).toString()),function(){var e=mP()-1;e<=0?document.body.removeAttribute(ic):document.body.setAttribute(ic,e.toString())}},[])},wK=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;bK();var i=v.useMemo(function(){return gK(a)},[a]);return v.createElement(xK,{styles:yK(i,!t,a,n?"":"!important")})},a1=!1;if(typeof window<"u")try{var Qp=Object.defineProperty({},"passive",{get:function(){return a1=!0,!0}});window.addEventListener("test",Qp,Qp),window.removeEventListener("test",Qp,Qp)}catch{a1=!1}var $l=a1?{passive:!1}:!1,jK=function(e){return e.tagName==="TEXTAREA"},HD=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!jK(e)&&n[t]==="visible")},SK=function(e){return HD(e,"overflowY")},NK=function(e){return HD(e,"overflowX")},vP=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=KD(e,r);if(a){var i=GD(e,r),o=i[1],c=i[2];if(o>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},CK=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},AK=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},KD=function(e,t){return e==="v"?SK(t):NK(t)},GD=function(e,t){return e==="v"?CK(t):AK(t)},_K=function(e,t){return e==="h"&&t==="rtl"?-1:1},EK=function(e,t,n,r,a){var i=_K(e,window.getComputedStyle(t).direction),o=i*r,c=n.target,d=t.contains(c),f=!1,h=o>0,p=0,x=0;do{if(!c)break;var g=GD(e,c),j=g[0],b=g[1],y=g[2],S=b-y-i*j;(j||S)&&KD(e,c)&&(p+=S,x+=j);var C=c.parentNode;c=C&&C.nodeType===Node.DOCUMENT_FRAGMENT_NODE?C.host:C}while(!d&&c!==document.body||d&&(t.contains(c)||t===c));return(h&&Math.abs(p)<1||!h&&Math.abs(x)<1)&&(f=!0),f},Jp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},gP=function(e){return[e.deltaX,e.deltaY]},xP=function(e){return e&&"current"in e?e.current:e},PK=function(e,t){return e[0]===t[0]&&e[1]===t[1]},kK=function(e){return`
47
- .block-interactivity-`.concat(e,` {pointer-events: none;}
48
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
49
- `)},OK=0,Dl=[];function TK(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),a=v.useState(OK++)[0],i=v.useState(VD)[0],o=v.useRef(e);v.useEffect(function(){o.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var b=ZH([e.lockRef.current],(e.shards||[]).map(xP),!0).filter(Boolean);return b.forEach(function(y){return y.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),b.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var c=v.useCallback(function(b,y){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!o.current.allowPinchZoom;var S=Jp(b),C=n.current,N="deltaX"in b?b.deltaX:C[0]-S[0],E="deltaY"in b?b.deltaY:C[1]-S[1],_,P=b.target,O=Math.abs(N)>Math.abs(E)?"h":"v";if("touches"in b&&O==="h"&&P.type==="range")return!1;var T=window.getSelection(),I=T&&T.anchorNode,M=I?I===P||I.contains(P):!1;if(M)return!1;var D=vP(O,P);if(!D)return!0;if(D?_=O:(_=O==="v"?"h":"v",D=vP(O,P)),!D)return!1;if(!r.current&&"changedTouches"in b&&(N||E)&&(r.current=_),!_)return!0;var R=r.current||_;return EK(R,y,b,R==="h"?N:E)},[]),d=v.useCallback(function(b){var y=b;if(!(!Dl.length||Dl[Dl.length-1]!==i)){var S="deltaY"in y?gP(y):Jp(y),C=t.current.filter(function(_){return _.name===y.type&&(_.target===y.target||y.target===_.shadowParent)&&PK(_.delta,S)})[0];if(C&&C.should){y.cancelable&&y.preventDefault();return}if(!C){var N=(o.current.shards||[]).map(xP).filter(Boolean).filter(function(_){return _.contains(y.target)}),E=N.length>0?c(y,N[0]):!o.current.noIsolation;E&&y.cancelable&&y.preventDefault()}}},[]),f=v.useCallback(function(b,y,S,C){var N={name:b,delta:y,target:S,should:C,shadowParent:RK(S)};t.current.push(N),setTimeout(function(){t.current=t.current.filter(function(E){return E!==N})},1)},[]),h=v.useCallback(function(b){n.current=Jp(b),r.current=void 0},[]),p=v.useCallback(function(b){f(b.type,gP(b),b.target,c(b,e.lockRef.current))},[]),x=v.useCallback(function(b){f(b.type,Jp(b),b.target,c(b,e.lockRef.current))},[]);v.useEffect(function(){return Dl.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:x}),document.addEventListener("wheel",d,$l),document.addEventListener("touchmove",d,$l),document.addEventListener("touchstart",h,$l),function(){Dl=Dl.filter(function(b){return b!==i}),document.removeEventListener("wheel",d,$l),document.removeEventListener("touchmove",d,$l),document.removeEventListener("touchstart",h,$l)}},[]);var g=e.removeScrollBar,j=e.inert;return v.createElement(v.Fragment,null,j?v.createElement(i,{styles:kK(a)}):null,g?v.createElement(wK,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function RK(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const IK=lK(WD,TK);var bf=v.forwardRef(function(e,t){return v.createElement(hv,cs({},e,{ref:t,sideCar:IK}))});bf.classNames=hv.classNames;var MK=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ll=new WeakMap,Zp=new WeakMap,eh={},Ay=0,YD=function(e){return e&&(e.host||YD(e.parentNode))},$K=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=YD(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})},DK=function(e,t,n,r){var a=$K(t,Array.isArray(e)?e:[e]);eh[n]||(eh[n]=new WeakMap);var i=eh[n],o=[],c=new Set,d=new Set(a),f=function(p){!p||c.has(p)||(c.add(p),f(p.parentNode))};a.forEach(f);var h=function(p){!p||d.has(p)||Array.prototype.forEach.call(p.children,function(x){if(c.has(x))h(x);else try{var g=x.getAttribute(r),j=g!==null&&g!=="false",b=(Ll.get(x)||0)+1,y=(i.get(x)||0)+1;Ll.set(x,b),i.set(x,y),o.push(x),b===1&&j&&Zp.set(x,!0),y===1&&x.setAttribute(n,"true"),j||x.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",x,S)}})};return h(t),c.clear(),Ay++,function(){o.forEach(function(p){var x=Ll.get(p)-1,g=i.get(p)-1;Ll.set(p,x),i.set(p,g),x||(Zp.has(p)||p.removeAttribute(r),Zp.delete(p)),g||p.removeAttribute(n)}),Ay--,Ay||(Ll=new WeakMap,Ll=new WeakMap,Zp=new WeakMap,eh={})}},mv=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=MK(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),DK(r,a,n,"aria-hidden")):function(){return null}};function LK(e){const t=FK(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(zK);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function FK(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=qK(a),c=UK(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Cr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var BK=Symbol("radix.slottable");function zK(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===BK}function UK(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function qK(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var vv="Dialog",[XD,QD]=lr(vv),[WK,Ka]=XD(vv),JD=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:o=!0}=e,c=v.useRef(null),d=v.useRef(null),[f,h]=oa({prop:r,defaultProp:a??!1,onChange:i,caller:vv});return s.jsx(WK,{scope:t,triggerRef:c,contentRef:d,contentId:Vn(),titleId:Vn(),descriptionId:Vn(),open:f,onOpenChange:h,onOpenToggle:v.useCallback(()=>h(p=>!p),[h]),modal:o,children:n})};JD.displayName=vv;var ZD="DialogTrigger",e3=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ka(ZD,n),i=vt(t,a.triggerRef);return s.jsx(Ge.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":gN(a.open),...r,ref:i,onClick:Te(e.onClick,a.onOpenToggle)})});e3.displayName=ZD;var mN="DialogPortal",[VK,t3]=XD(mN,{forceMount:void 0}),n3=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=Ka(mN,t);return s.jsx(VK,{scope:t,forceMount:n,children:v.Children.map(r,o=>s.jsx(Kn,{present:n||i.open,children:s.jsx(Gc,{asChild:!0,container:a,children:o})}))})};n3.displayName=mN;var Mh="DialogOverlay",r3=v.forwardRef((e,t)=>{const n=t3(Mh,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Ka(Mh,e.__scopeDialog);return i.modal?s.jsx(Kn,{present:r||i.open,children:s.jsx(KK,{...a,ref:t})}):null});r3.displayName=Mh;var HK=LK("DialogOverlay.RemoveScroll"),KK=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ka(Mh,n);return s.jsx(bf,{as:HK,allowPinchZoom:!0,shards:[a.contentRef],children:s.jsx(Ge.div,{"data-state":gN(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Mo="DialogContent",a3=v.forwardRef((e,t)=>{const n=t3(Mo,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Ka(Mo,e.__scopeDialog);return s.jsx(Kn,{present:r||i.open,children:i.modal?s.jsx(GK,{...a,ref:t}):s.jsx(YK,{...a,ref:t})})});a3.displayName=Mo;var GK=v.forwardRef((e,t)=>{const n=Ka(Mo,e.__scopeDialog),r=v.useRef(null),a=vt(t,n.contentRef,r);return v.useEffect(()=>{const i=r.current;if(i)return mv(i)},[]),s.jsx(s3,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Te(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Te(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0;(o.button===2||c)&&i.preventDefault()}),onFocusOutside:Te(e.onFocusOutside,i=>i.preventDefault())})}),YK=v.forwardRef((e,t)=>{const n=Ka(Mo,e.__scopeDialog),r=v.useRef(!1),a=v.useRef(!1);return s.jsx(s3,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;n.triggerRef.current?.contains(o)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),s3=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,c=Ka(Mo,n),d=v.useRef(null),f=vt(t,d);return pv(),s.jsxs(s.Fragment,{children:[s.jsx(yf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(Qo,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":gN(c.open),...o,ref:f,onDismiss:()=>c.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(QK,{titleId:c.titleId}),s.jsx(ZK,{contentRef:d,descriptionId:c.descriptionId})]})]})}),vN="DialogTitle",i3=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ka(vN,n);return s.jsx(Ge.h2,{id:a.titleId,...r,ref:t})});i3.displayName=vN;var o3="DialogDescription",l3=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ka(o3,n);return s.jsx(Ge.p,{id:a.descriptionId,...r,ref:t})});l3.displayName=o3;var c3="DialogClose",u3=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ka(c3,n);return s.jsx(Ge.button,{type:"button",...r,ref:t,onClick:Te(e.onClick,()=>a.onOpenChange(!1))})});u3.displayName=c3;function gN(e){return e?"open":"closed"}var d3="DialogTitleWarning",[XK,f3]=BU(d3,{contentName:Mo,titleName:vN,docsSlug:"dialog"}),QK=({titleId:e})=>{const t=f3(d3),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 v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},JK="DialogDescriptionWarning",ZK=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${f3(JK).contentName}}.`;return v.useEffect(()=>{const a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},gv=JD,eG=e3,xv=n3,eu=r3,tu=a3,wf=i3,jf=l3,yv=u3;const p3=gv,tG=xv,h3=v.forwardRef(({className:e,...t},n)=>s.jsx(eu,{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}));h3.displayName=eu.displayName;const nG=Jo("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"}}),xN=v.forwardRef(({side:e="right",className:t,children:n,...r},a)=>s.jsxs(tG,{children:[s.jsx(h3,{}),s.jsxs(tu,{ref:a,className:Se(nG({side:e}),t),...r,children:[n,s.jsxs(yv,{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:[s.jsx(ys,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));xN.displayName=tu.displayName;const m3=({className:e,...t})=>s.jsx("div",{className:Se("flex flex-col space-y-2 text-center sm:text-left",e),...t});m3.displayName="SheetHeader";const v3=v.forwardRef(({className:e,...t},n)=>s.jsx(wf,{ref:n,className:Se("text-lg font-semibold text-foreground",e),...t}));v3.displayName=wf.displayName;const rG=v.forwardRef(({className:e,...t},n)=>s.jsx(jf,{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));rG.displayName=jf.displayName;function yP({className:e,...t}){return s.jsx("div",{className:Se("animate-pulse rounded-md bg-muted",e),...t})}const aG="sidebar:state",sG=3600*24*7,iG="16rem",oG="18rem",lG="3rem",cG="b",g3=v.createContext(null);function Sf(){const e=v.useContext(g3);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const x3=v.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:a,children:i,...o},c)=>{const d=BH(),[f,h]=v.useState(!1),[p,x]=v.useState(e),g=t??p,j=v.useCallback(C=>{const N=typeof C=="function"?C(g):C;n?n(N):x(N),document.cookie=`${aG}=${N}; path=/; max-age=${sG}`},[n,g]),b=v.useCallback(()=>d?h(C=>!C):j(C=>!C),[d,j,h]);v.useEffect(()=>{const C=N=>{N.key===cG&&(N.metaKey||N.ctrlKey)&&(N.preventDefault(),b())};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[b]);const y=g?"expanded":"collapsed",S=v.useMemo(()=>({state:y,open:g,setOpen:j,isMobile:d,openMobile:f,setOpenMobile:h,toggleSidebar:b}),[y,g,j,d,f,h,b]);return s.jsx(g3.Provider,{value:S,children:s.jsx(gD,{delayDuration:0,children:s.jsx("div",{style:{"--sidebar-width":iG,"--sidebar-width-icon":lG,...a},className:Se("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",r),ref:c,...o,children:i})})})});x3.displayName="SidebarProvider";const y3=v.forwardRef(({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:a,...i},o)=>{const{isMobile:c,state:d,openMobile:f,setOpenMobile:h}=Sf();return n==="none"?s.jsx("div",{className:Se("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",r),ref:o,...i,children:a}):c?s.jsx(p3,{open:f,onOpenChange:h,...i,children:s.jsx(xN,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":oG},side:e,children:s.jsx("div",{className:"flex h-full w-full flex-col",children:a})})}):s.jsxs("div",{ref:o,className:"group peer hidden text-sidebar-foreground md:block","data-state":d,"data-collapsible":d==="collapsed"?n:"","data-variant":t,"data-side":e,children:[s.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]")}),s.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),...i,children:s.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:a})})]})});y3.displayName="Sidebar";const b3=v.forwardRef(({className:e,onClick:t,...n},r)=>{const{toggleSidebar:a}=Sf();return s.jsxs(re,{ref:r,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:Se("h-7 w-7",e),onClick:i=>{t?.(i),a()},...n,children:[s.jsx(H7,{}),s.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});b3.displayName="SidebarTrigger";const uG=v.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:r}=Sf();return s.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})});uG.displayName="SidebarRail";const dG=v.forwardRef(({className:e,...t},n)=>s.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}));dG.displayName="SidebarInset";const fG=v.forwardRef(({className:e,...t},n)=>s.jsx(ft,{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}));fG.displayName="SidebarInput";const w3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"header",className:Se("flex flex-col gap-2 p-2",e),...t}));w3.displayName="SidebarHeader";const j3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"footer",className:Se("flex flex-col gap-2 p-2",e),...t}));j3.displayName="SidebarFooter";const s1=v.forwardRef(({className:e,...t},n)=>s.jsx(BD,{ref:n,"data-sidebar":"separator",className:Se("mx-2 w-auto bg-sidebar-border",e),...t}));s1.displayName="SidebarSeparator";const S3=v.forwardRef(({className:e,...t},n)=>s.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}));S3.displayName="SidebarContent";const N3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"group",className:Se("relative flex w-full min-w-0 flex-col p-2",e),...t}));N3.displayName="SidebarGroup";const C3=v.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const a=t?Xi:"div";return s.jsx(a,{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})});C3.displayName="SidebarGroupLabel";const pG=v.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const a=t?Xi:"button";return s.jsx(a,{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})});pG.displayName="SidebarGroupAction";const A3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"group-content",className:Se("w-full text-sm",e),...t}));A3.displayName="SidebarGroupContent";const _3=v.forwardRef(({className:e,...t},n)=>s.jsx("ul",{ref:n,"data-sidebar":"menu",className:Se("flex w-full min-w-0 flex-col gap-1",e),...t}));_3.displayName="SidebarMenu";const E3=v.forwardRef(({className:e,...t},n)=>s.jsx("li",{ref:n,"data-sidebar":"menu-item",className:Se("group/menu-item relative",e),...t}));E3.displayName="SidebarMenuItem";const hG=Jo("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"}}),P3=v.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:a,className:i,...o},c)=>{const d=e?Xi:"button",{isMobile:f,state:h}=Sf(),p=s.jsx(d,{ref:c,"data-sidebar":"menu-button","data-size":r,"data-active":t,className:Se(hG({variant:n,size:r}),i),...o});return a?(typeof a=="string"&&(a={children:a}),s.jsxs(xD,{children:[s.jsx(yD,{asChild:!0,children:p}),s.jsx(lN,{side:"right",align:"center",hidden:h!=="collapsed"||f,...a})]})):p});P3.displayName="SidebarMenuButton";const mG=v.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},a)=>{const i=t?Xi:"button";return s.jsx(i,{ref:a,"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})});mG.displayName="SidebarMenuAction";const vG=v.forwardRef(({className:e,...t},n)=>s.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}));vG.displayName="SidebarMenuBadge";const gG=v.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{const a=v.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return s.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&&s.jsx(yP,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),s.jsx(yP,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":a}})]})});gG.displayName="SidebarMenuSkeleton";const xG=v.forwardRef(({className:e,...t},n)=>s.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}));xG.displayName="SidebarMenuSub";const yG=v.forwardRef(({...e},t)=>s.jsx("li",{ref:t,...e}));yG.displayName="SidebarMenuSubItem";const bG=v.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:r,...a},i)=>{const o=e?Xi:"a";return s.jsx(o,{ref:i,"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),...a})});bG.displayName="SidebarMenuSubButton";const k3=v.forwardRef(({className:e,activeClassName:t,pendingClassName:n,to:r,...a},i)=>s.jsx(PH,{ref:i,to:r,className:({isActive:o,isPending:c})=>Se(e,o&&t,c&&n),...a}));k3.displayName="NavLink";function wG({width:e=24,height:t=24,from:n="#53afba",to:r="#76fffb",...a}){const i=`grad-${v.useId().slice(1)}`;return s.jsxs("svg",{className:"inline-block",width:e,height:t,viewBox:"0 0 1648 1648",xmlns:"http://www.w3.org/2000/svg",...a,children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:i,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[s.jsx("stop",{offset:"0%",style:{stopColor:n}}),s.jsx("stop",{offset:"100%",style:{stopColor:r}})]})}),s.jsx("path",{d:"m610 216.654c-66.158 4.092-126.119 35.849-164.917 87.346-8.408 11.16-13.344 19.191-19.983 32.513-12.431 24.946-19.521 50.434-22.11 79.487-1.665 18.687-.854 826.238.841 837.939 7.867 54.284 32.465 101.134 70.706 134.667 16.297 14.291 32.283 24.657 53.963 34.991 16.889 8.05 34.568 13.468 60.5 18.541 9.019 1.764 52.201 1.795 61.5.044 26.487-4.989 43.97-10.341 61-18.675 15.131-7.406 21.53-11.135 60.5-35.267 20.813-12.887 23.095-14.298 29.5-18.24l13-8 13-8c6.901-4.247 12.593-7.767 29.54-18.271 5.796-3.593 12.771-7.863 15.5-9.49 2.728-1.626 8.56-5.19 12.96-7.921 4.4-2.73 72.575-44.711 151.5-93.29s150.925-92.918 160-98.531c9.075-5.612 24.15-14.936 33.5-20.719s23.075-14.234 30.5-18.78c85.169-52.142 120.029-73.942 130.014-81.304 40.974-30.211 68.344-69.764 81.788-118.194 13.864-49.94 8.549-104.847-14.809-153-16.836-34.708-41.252-62.432-74.993-85.154-4.125-2.778-17.625-11.26-30-18.849s-27-16.594-32.5-20.009c-5.5-3.416-109.45-67.427-231-142.246-306.386-188.593-335.221-206.352-350-215.553-30.562-19.028-59.301-29.911-90-34.083-11.697-1.59-30.408-2.514-39.5-1.952m-10.5 77.269c-39.541 6.402-76.013 29.73-97.661 62.467-13.001 19.66-19.718 38.39-22.802 63.584-1.472 12.028-1.434 802.191.04 818.026 1.861 19.998 6.142 35.48 14.415 52.133 17.942 36.114 53.025 64.18 91.508 73.203 3.575.839 8.975 2.118 12 2.844 8.221 1.973 40.343 1.613 49.971-.56 32.301-7.289 65.233-26.686 94.817-55.849 15.26-15.042 22.884-24.803 33.571-42.979 13.939-23.706 20.949-43.36 27.745-77.792 1.004-5.086 1.428-50 1.949-206.5.465-139.686 1.001-201.809 1.777-206 .611-3.3 1.608-9.15 2.217-13 1.672-10.583 4.039-21.117 7.191-32 8.179-28.247 20.714-55.13 37.188-79.751 24.262-36.262 53.189-63.572 93.074-87.872 4.95-3.016 12.825-7.435 17.5-9.82s8.95-4.668 9.5-5.074c3.565-2.63 34.688-13.266 52.465-17.93 6.2-1.627 11.49-3.174 11.754-3.439 1.003-1.002-1.016-2.602-10.967-8.689-5.639-3.449-16.552-10.172-24.252-14.94-13.435-8.319-31.76-19.604-58.5-36.029-6.875-4.222-16.1-9.911-20.5-12.641-7.667-4.758-73.088-45.103-122.5-75.546-75.227-46.348-108.509-66.591-116.5-70.86-9.422-5.033-25.23-10.76-37.043-13.419-7.967-1.794-40.076-2.843-47.957-1.567m473.5 305.564c-5.775.685-11.625 1.491-13 1.792-1.375.3-5.2 1.088-8.5 1.749-7.914 1.587-27.103 7.461-36.5 11.174-38.797 15.33-75.171 44.925-98.829 80.41-11.24 16.86-21.329 38.407-26.167 55.888-2.443 8.825-3.85 14.608-4.866 20-.621 3.3-1.653 8.475-2.292 11.5-.846 4.008-1.345 59.624-1.837 205-.618 182.331-.824 200.361-2.399 209.5-1.629 9.459-4.196 22.506-6.744 34.279-.628 2.903-.881 5.54-.561 5.859.596.596 455.986-279.084 472.195-290.001 17.547-11.819 36.335-33.412 46.291-53.203 3.956-7.863 9.527-23.924 11.597-33.434 4.848-22.272 3.572-48.26-3.506-71.387-6.907-22.572-18.055-40.93-35.316-58.158-12.705-12.681-16.829-15.485-79.066-53.756-7.15-4.397-15.7-9.654-19-11.684-3.3-2.029-8.925-5.504-12.5-7.722-53.826-33.397-67.199-40.611-88.616-47.8-29.343-9.85-61.599-13.421-90.384-10.006m-1066.25 1048.256c3.988.189 10.513.189 14.5 0 3.988-.19.725-.346-7.25-.346s-11.238.156-7.25.346",fill:`url(#${i})`,fillRule:"evenodd"})]})}const jG=[{title:"Home",items:[{title:"Dashboard",url:"/",icon:C$}]},{title:"Lab",items:[{title:"MCP Evaluations",url:"/mcp-evaluations",icon:N$},{title:"Analyze MCP",url:"/tool-analysis",icon:A$}]},{title:"Libraries",items:[{title:"Test Cases",url:"/libraries/test-cases",icon:S$},{title:"Servers",url:"/libraries/servers",icon:j$},{title:"Agents",url:"/libraries/agents",icon:wa}]},{title:"Execution",items:[{title:"Run Evaluation",url:"/run",icon:rc},{title:"Evaluation Results",url:"/results",icon:wd},{title:"Compare Evaluations",url:"/compare",icon:GS},{title:"MCP Analysis Results",url:"/tool-analysis-results",icon:_$},{title:"Custom Reports",url:"/markdown-reports",icon:Yl}]},{title:"Workspace",items:[{title:"Settings",url:"/settings",icon:XS}]}];function SG(e={version:null}){const t=e.version??null,{state:n}=Sf(),r=n==="collapsed",a=Cs(),i=v.useMemo(()=>jG,[]);return s.jsxs(y3,{collapsible:"icon",children:[s.jsx(w3,{className:`border-b border-sidebar-border py-3 ${r?"px-2":"px-4"}`,children:s.jsxs("div",{className:`flex items-center ${r?"justify-center":"gap-2.5"} overflow-hidden`,children:[s.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:s.jsx(wG,{width:22,height:22,from:"#f97316",to:"#fb923c"})}),!r&&s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{className:"text-sm font-semibold text-sidebar-foreground",children:"MCPLab"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"MCP Evaluation Lab"})]})]})}),s.jsx(S3,{children:i.map((o,c)=>s.jsxs("div",{children:[c>0&&!r&&s.jsx(s1,{className:"my-1.5"}),s.jsxs(N3,{className:r?"px-2":"px-3 py-2",children:[!r&&s.jsx(C3,{className:"px-1 pb-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-muted-foreground/90",children:o.title}),s.jsx(A3,{children:s.jsx(_3,{children:o.items.map(d=>s.jsx(E3,{children:s.jsx(P3,{asChild:!0,isActive:d.url==="/"?a.pathname==="/":a.pathname.startsWith(d.url),tooltip:d.title,children:s.jsxs(k3,{to:d.url,end:d.url==="/",activeClassName:"bg-sidebar-accent text-sidebar-accent-foreground",children:[s.jsx(d.icon,{className:"h-4 w-4"}),s.jsx("span",{children:d.title})]})})},d.title))})})]})]},o.title))}),s.jsxs(j3,{className:r?"px-2 py-2":"px-3 py-3",children:[s.jsx(s1,{className:"my-1.5"}),s.jsxs("div",{className:`flex ${r?"justify-center":"items-center justify-center gap-2"} w-full`,children:[s.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:[s.jsx(q7,{className:"h-4 w-4 shrink-0"}),!r&&s.jsx("span",{className:"text-xs text-sidebar-foreground/85",children:`v${t??"unknown"}`})]}),!r&&s.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 ",s.jsx("span",{className:"text-[#00e5ff] hover:text-[#00b8d4]",children:"Inspectr"})]})]})]})]})}const O3=v.forwardRef(({...e},t)=>s.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));O3.displayName="Breadcrumb";const T3=v.forwardRef(({className:e,...t},n)=>s.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}));T3.displayName="BreadcrumbList";const R3=v.forwardRef(({className:e,...t},n)=>s.jsx("li",{ref:n,className:Se("inline-flex items-center gap-1.5",e),...t}));R3.displayName="BreadcrumbItem";const I3=v.forwardRef(({asChild:e,className:t,...n},r)=>{const a=e?Xi:"a";return s.jsx(a,{ref:r,className:Se("transition-colors hover:text-foreground",t),...n})});I3.displayName="BreadcrumbLink";const M3=v.forwardRef(({className:e,...t},n)=>s.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:Se("font-normal text-foreground",e),...t}));M3.displayName="BreadcrumbPage";const $3=({children:e,className:t,...n})=>s.jsx("li",{role:"presentation","aria-hidden":"true",className:Se("[&>svg]:size-3.5",t),...n,children:e??s.jsx(w$,{})});$3.displayName="BreadcrumbSeparator";function qs(){return{input:0,output:0,total:0,hasInput:!1,hasOutput:!1,hasTotal:!1}}function Wl(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 Ws(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 NG(e){const t=qs();for(const n of e)Wl(t,n);return Ws(t)}function CG(e,t){return`${e}-${t+1}`}function Vl(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:[],a=new Map,i=[],o=[];for(const p of n){if("ref"in p){const y=String(p.ref||"").trim();if(!y)continue;a.set(y,y),o.push({kind:"referenced",ref:y});continue}const x=String(p.id||p.name||"").trim();if(!x)continue;const g=x;a.set(x,g);const j=p.auth?.type==="bearer"?"bearer":p.auth?.type==="api_key"||p.auth?.type==="oauth_client_credentials"?"api-key":p.auth?.type==="oauth_authorization_code"?"oauth2":"none",b={id:g,name:String(p.name||x),transport:"streamable-http",url:p.url,authType:j,authValue:p.auth?.type==="bearer"?p.auth.token??(p.auth.env?`\${${p.auth.env}}`:void 0):p.auth?.type==="api_key"?p.auth.value:void 0,apiKeyHeaderName:p.auth?.type==="api_key"?p.auth.header_name:void 0,oauthClientId:p.auth?.type==="oauth_authorization_code"?p.auth.client_id:void 0,oauthClientSecret:p.auth?.type==="oauth_authorization_code"?p.auth.client_secret:void 0,oauthRedirectUrl:p.auth?.type==="oauth_authorization_code"?p.auth.redirect_url:void 0,oauthScope:p.auth?.type==="oauth_authorization_code"||p.auth?.type==="oauth_client_credentials"?p.auth.scope:void 0,oauthTokenUrl:p.auth?.type==="oauth_client_credentials"?p.auth.token_url:void 0,oauthClientIdEnv:p.auth?.type==="oauth_client_credentials"?p.auth.client_id_env:void 0,oauthClientSecretEnv:p.auth?.type==="oauth_client_credentials"?p.auth.client_secret_env:void 0,oauthAudience:p.auth?.type==="oauth_client_credentials"?p.auth.audience:void 0};i.push(b),o.push({kind:"inline",server:b})}const c=[],d=[];for(const p of r){if("ref"in p){const y=String(p.ref||"").trim();if(!y)continue;d.push({kind:"referenced",ref:y});continue}const x=String(p.id||p.name||"").trim();if(!x)continue;const g=x,j=p.provider==="azure_openai"?"azure":p.provider,b={id:g,name:String(p.name||x),provider:j,model:p.model,temperature:p.temperature??0,maxTokens:p.max_tokens??2048,maxTurns:p.max_turns,systemPrompt:p.system};c.push(b),d.push({kind:"inline",agent:b})}const f=[],h=[];return e.config.scenarios.forEach((p,x)=>{if("ref"in p){const b=String(p.ref||"").trim();if(!b)return;h.push({kind:"referenced",ref:b});return}const g=[];for(const b of p.eval?.tool_constraints?.required_tools??[])g.push({type:"required_tool",value:b});for(const b of p.eval?.tool_constraints?.forbidden_tools??[])g.push({type:"forbidden_tool",value:b});for(const b of p.eval?.response_assertions??[])b.type==="regex"?g.push({type:"response_contains",value:b.pattern}):g.push({type:"response_contains",value:`${b.path}${b.equals!==void 0?` == ${b.equals}`:""}`});const j={id:p.id||CG("scn",x),name:p.name||p.id||`Scenario ${x+1}`,serverIds:(()=>{if((p.servers??[]).length>0)return p.servers.map(y=>a.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(!a.has(S)){a.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";i.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,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}),o.push({kind:"inline",server:i[i.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:g,extractRules:(p.extract??[]).map(b=>({name:b.name,pattern:b.regex}))};f.push(j),h.push({kind:"inline",scenario:j})}),{id:e.id,name:t||e.name,configName:t,description:e.path,loadError:e.error,loadWarnings:e.warnings,servers:i,serverEntries:o,agents:c,agentEntries:d,scenarios:f,scenarioEntries:h,runDefaults:e.config.run_defaults?.selected_agents&&e.config.run_defaults.selected_agents.length>0?{selectedAgentNames:[...e.config.run_defaults.selected_agents]}:void 0,snapshotEval:e.config.snapshot_eval?{enabled:e.config.snapshot_eval.enabled,mode:e.config.snapshot_eval.mode,baselineSnapshotId:e.config.snapshot_eval.baseline_snapshot_id,baselineSourceRunId:e.config.snapshot_eval.baseline_source_run_id,lastUpdatedAt:e.config.snapshot_eval.last_updated_at}:void 0,createdAt:e.mtime,updatedAt:e.mtime,sourcePath:e.path}}function AG(e){const t={id:"library",name:"library",path:"library",mtime:new Date(0).toISOString(),config:{servers:Object.entries(e.servers).map(([r,a])=>({id:r,name:a.name||r,transport:a.transport,url:a.url,auth:a.auth})),agents:Object.entries(e.agents).map(([r,a])=>({id:r,name:a.name||r,provider:a.provider,model:a.model,temperature:a.temperature,max_tokens:a.max_tokens,max_turns:a.max_turns,system:a.system})),scenarios:e.scenarios}},n=Vl(t);return{servers:n.servers,agents:n.agents,scenarios:n.scenarios}}function bP(e){const t=new Map,n=g=>{const j=g.id,b=g.authValue?.trim()??"",y=g.apiKeyHeaderName?.trim()??"",S=g.authType==="bearer"?(()=>{if(!b)throw new Error(`Server '${j}' is missing bearer token value`);return{type:"bearer",token:b}})():g.authType==="api-key"&&!g.oauthTokenUrl?{type:"api_key",...y?{header_name:y}:{},value:(()=>{if(!b)throw new Error(`Server '${j}' is missing API key value`);return b})()}:g.authType==="api-key"?{type:"oauth_client_credentials",token_url:g.oauthTokenUrl||"",client_id_env:g.oauthClientIdEnv||"",client_secret_env:g.oauthClientSecretEnv||"",...g.oauthScope?{scope:g.oauthScope}:{},...g.oauthAudience?{audience:g.oauthAudience}:{}}:g.authType==="oauth2"?{type:"oauth_authorization_code",client_id:g.oauthClientId||"",client_secret:g.oauthClientSecret||void 0,redirect_url:g.oauthRedirectUrl||"http://localhost:6274/oauth/",scope:g.oauthScope||void 0}:void 0;return{id:j,...g.name&&g.name!==j?{name:g.name}:{},transport:"http",url:g.url||"http://localhost:3000/mcp",...S!==void 0?{auth:S}:{}}},r=e.serverEntries&&e.serverEntries.length>0?e.serverEntries:[...e.servers.map(g=>({kind:"inline",server:g}))],a=new Set,i=new Map,o=r.flatMap(g=>{if(g.kind==="referenced"){const b=String(g.ref||"").trim();return!b||a.has(b)?[]:(a.add(b),t.set(b,b),[{ref:b}])}const j=n(g.server);return t.set(g.server.id,j.id),i.set(j.id,j),[j]}),c=g=>{const j=g.id;return{id:j,...g.name&&g.name!==j?{name:g.name}:{},provider:g.provider==="azure"?"azure_openai":g.provider==="anthropic"?"anthropic":"openai",model:g.model,temperature:g.temperature,max_tokens:g.maxTokens,max_turns:g.maxTurns,system:g.systemPrompt}},d=e.agentEntries&&e.agentEntries.length>0?e.agentEntries:[...e.agents.map(g=>({kind:"inline",agent:g}))],f=new Set,h=d.flatMap(g=>{if(g.kind==="referenced"){const j=String(g.ref||"").trim();return!j||f.has(j)?[]:(f.add(j),[{ref:j}])}return[c(g.agent)]}),p=g=>{const j=g.evalRules.filter(S=>S.type==="required_tool").map(S=>S.value),b=g.evalRules.filter(S=>S.type==="forbidden_tool").map(S=>S.value),y=g.evalRules.filter(S=>S.type==="response_contains"||S.type==="response_not_contains").map(S=>({type:"regex",pattern:S.value}));return{id:g.id,name:g.name||void 0,mcp_servers:g.serverIds.length>0?g.serverIds.map(S=>{const C=t.get(S)??S;return i.get(C)??{ref:C}}):void 0,prompt:g.prompt,...g.snapshotEval?{snapshot_eval:{enabled:g.snapshotEval.enabled,baseline_snapshot_id:g.snapshotEval.baselineSnapshotId,baseline_source_run_id:g.snapshotEval.baselineSourceRunId,last_updated_at:g.snapshotEval.lastUpdatedAt}}:{},eval:{tool_constraints:{required_tools:j,forbidden_tools:b},response_assertions:y},extract:g.extractRules.map(S=>({name:S.name,from:"final_text",regex:S.pattern}))}},x=e.scenarioEntries&&e.scenarioEntries.length>0?e.scenarioEntries.map(g=>g.kind==="referenced"?{ref:g.ref}:p(g.scenario)):[...e.scenarios.map(g=>p(g))];return{name:e.configName?.trim()||void 0,servers:o,agents:h,scenarios:x,run_defaults:e.runDefaults?.selectedAgentNames&&e.runDefaults.selectedAgentNames.length>0?{selected_agents:[...e.runDefaults.selectedAgentNames]}:void 0,snapshot_eval:e.snapshotEval?{enabled:e.snapshotEval.enabled,mode:e.snapshotEval.mode,baseline_snapshot_id:e.snapshotEval.baselineSnapshotId,baseline_source_run_id:e.snapshotEval.baselineSourceRunId,last_updated_at:e.snapshotEval.lastUpdatedAt}:void 0}}function _G(e){const t=Object.fromEntries((e.servers??[]).map(r=>[r.id,(()=>{const a=r.authValue?.trim()??"",i=r.apiKeyHeaderName?.trim()??"";return{...r.name&&r.name!==r.id?{name:r.name}:{},transport:"http",url:r.url||"http://localhost:3000/mcp",auth:r.authType==="bearer"?(()=>{if(!a)throw new Error(`Server '${r.id}' is missing bearer token value`);return{type:"bearer",token:a}})():r.authType==="api-key"&&!r.oauthTokenUrl?{type:"api_key",...i?{header_name:i}:{},value:(()=>{if(!a)throw new Error(`Server '${r.id}' is missing API key value`);return a})()}: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",client_id:r.oauthClientId||"",client_secret:r.oauthClientSecret||void 0,redirect_url:r.oauthRedirectUrl||"http://localhost:6274/oauth/",scope:r.oauthScope||void 0}: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(a=>({ref:a})):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(a=>a.type==="required_tool").map(a=>a.value),forbidden_tools:r.evalRules.filter(a=>a.type==="forbidden_tool").map(a=>a.value)},response_assertions:r.evalRules.filter(a=>a.type==="response_contains"||a.type==="response_not_contains").map(a=>({type:"regex",pattern:a.value}))},extract:r.extractRules.map(a=>({name:a.name,from:"final_text",regex:a.pattern}))}))}}function EG(e,t){if(e)return`${e}::${t??""}`}function th(e){return e.type==="text"}function PG(e,t){if(!t)return e.tool_calls.map((a,i)=>({name:a,arguments:{},duration:e.tool_durations_ms[i]??0,timestamp:new Date().toISOString()}));const n=[],r=new Map;for(const a of t.messages)for(const i of a.content)i.type==="tool_use"?n.push({id:i.id,name:i.name,input:i.input??{},ts:a.ts}):i.type==="tool_result"&&r.set(i.tool_use_id,{durationMs:i.duration_ms,tsEnd:i.ts_end});return n.map((a,i)=>{const o=r.get(a.id);return{name:a.name,arguments:a.input,duration:o?.durationMs??e.tool_durations_ms[i]??0,timestamp:o?.tsEnd??a.ts??new Date().toISOString()}})}function kG(e,t){const n=[];if(!e)return n;let r;const a=e.messages??[];for(let i=0;i<a.length;i+=1){const o=a[i];if(o.role==="user"){const c=o.content.filter(th);for(const d of c)n.push({id:`user_prompt-${n.length}`,kind:"user_prompt",text:d.text,timestamp:o.ts});continue}if(o.role==="assistant"){const c=o.content.filter(h=>h.type==="tool_use");for(const h of o.content)h.type==="text"&&(n.push({id:`assistant_thought-${n.length}`,kind:"assistant_thought",text:h.text,timestamp:o.ts}),r=n.length-1);const d=a[i+1],f=d?.role==="tool";if(c.length>0&&f){const h=new Map,p=[];for(const x of d.content)x.type==="tool_result"&&(x.tool_use_id?h.set(x.tool_use_id,x):p.push(x));for(const x of c){n.push({id:`tool_call-${n.length}`,kind:"tool_call",text:wP(x.input??{}),toolName:x.name,timestamp:o.ts});const g=h.get(x.id);if(!g)continue;const j=g.content.filter(th).map(b=>b.text).join(`
54
- `);n.push({id:`tool_result-${n.length}`,kind:"tool_result",text:j,toolName:g.name,ok:!g.is_error,durationMs:g.duration_ms,timestamp:g.ts_end??d.ts}),h.delete(x.id)}for(const x of[...h.values(),...p]){const g=x.content.filter(th).map(j=>j.text).join(`
55
- `);n.push({id:`tool_result-${n.length}`,kind:"tool_result",text:g,toolName:x.name,ok:!x.is_error,durationMs:x.duration_ms,timestamp:x.ts_end??d.ts})}i+=1}else for(const h of c)n.push({id:`tool_call-${n.length}`,kind:"tool_call",text:wP(h.input??{}),toolName:h.name,timestamp:o.ts});continue}if(o.role==="tool")for(const c of o.content){if(c.type!=="tool_result")continue;const d=c.content.filter(th).map(f=>f.text).join(`
56
- `);n.push({id:`tool_result-${n.length}`,kind:"tool_result",text:d,toolName:c.name,ok:!c.is_error,durationMs:c.duration_ms,timestamp:c.ts_end??o.ts})}}return typeof r=="number"&&n[r]&&(n[r]={...n[r],kind:"assistant_final"}),n}function wP(e){try{return JSON.stringify(e)}catch{return String(e)}}function jP(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 _y(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},(a,i)=>n+(i<r?1:0))}function OG(e){const t=qs(),n=qs(),r=new Map;if(!e)return{assistant:null,tool:null,perTool:{}};for(const i of e.messages??[]){if(i.role!=="assistant")continue;jP(t,i.usage);const o=i.content.filter(h=>h.type==="tool_use");if(o.length===0)continue;jP(n,i.usage);const c=_y(i.usage?.input_tokens,o.length),d=_y(i.usage?.output_tokens,o.length),f=_y(i.usage?.total_tokens,o.length);for(let h=0;h<o.length;h+=1){const p=o[h].name,x=r.get(p)??qs(),g=c[h],j=d[h],b=f[h];typeof g=="number"&&(x.input+=g,x.hasInput=!0),typeof j=="number"&&(x.output+=j,x.hasOutput=!0),typeof b=="number"&&(x.total+=b,x.hasTotal=!0),r.set(p,x)}}const a={};for(const[i,o]of Array.from(r.entries()).sort((c,d)=>c[0].localeCompare(d[0]))){const c=Ws(o);c&&(a[i]=c)}return{assistant:Ws(t),tool:Ws(n),perTool:a}}function SP(e,t=[]){const n=new Map;for(const o of t){const c=EG(o.scenario_id,o.agent);if(!c)continue;const d=n.get(c)??[];d.push(o),n.set(c,d)}const r=e.scenarios.map(o=>{const c=n.get(`${o.scenario_id}::${o.agent}`)??[],d=new Map;for(const y of c)d.set(y.run_index,y);const f=o.runs.map((y,S)=>{const C=d.get(y.run_index)??c[S],N=OG(C);return{runIndex:y.run_index,passed:y.pass,toolCalls:PG(y,C),assistantTokenUsage:N.assistant,toolTokenUsage:N.tool,toolTokenUsageByTool:N.perTool,finalAnswer:y.final_text,conversation:kG(C),duration:y.tool_durations_ms.reduce((E,_)=>E+_,0),extractedValues:Object.fromEntries(Object.entries(y.extracted).map(([E,_])=>[E,String(_??"")])),failureReasons:y.failures}}),h=qs(),p=qs(),x=new Map;for(const y of f){Wl(h,y.assistantTokenUsage),Wl(p,y.toolTokenUsage);for(const[S,C]of Object.entries(y.toolTokenUsageByTool??{})){const N=x.get(S)??qs();Wl(N,C),x.set(S,N)}}const g={};for(const[y,S]of Array.from(x.entries()).sort((C,N)=>C[0].localeCompare(N[0]))){const C=Ws(S);C&&(g[y]=C)}const j=f.length===0?0:Math.round(f.reduce((y,S)=>y+S.duration,0)/f.length),b=f.length===0?0:f.reduce((y,S)=>y+S.toolCalls.length,0)/f.length;return{scenarioId:o.scenario_id,scenarioName:o.scenario_name||o.scenario_id,agentId:o.agent,agentName:o.agent,runs:f,passRate:o.pass_rate,avgToolCalls:b,avgDuration:j,assistantTokenUsage:Ws(h),toolTokenUsage:Ws(p),toolTokenUsageByTool:g}}),a=qs(),i=qs();for(const o of r)Wl(a,o.assistantTokenUsage),Wl(i,o.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:Ws(a),toolTokenUsage:Ws(i),overallPassRate:e.summary.pass_rate,totalScenarios:e.summary.total_scenarios,totalRuns:e.summary.total_runs,avgToolCalls:e.summary.avg_tool_calls_per_run,avgLatency:Math.round(e.summary.avg_tool_latency_ms??0),snapshotEval:e.metadata.snapshot_eval?{applied:e.metadata.snapshot_eval.applied,mode:e.metadata.snapshot_eval.mode,baselineSnapshotId:e.metadata.snapshot_eval.baseline_snapshot_id,baselineSourceRunId:e.metadata.snapshot_eval.baseline_source_run_id,overallScore:e.metadata.snapshot_eval.overall_score,status:e.metadata.snapshot_eval.status,impactedScenarios:e.metadata.snapshot_eval.impacted_scenarios}:void 0}}function TG(){return typeof window>"u"?"":window.location.port==="8685"?"http://127.0.0.1:8787":""}const fd=TG();async function ut(e,t){const n=await fetch(`${fd}${e}`,{...t,headers:{"content-type":"application/json",...t?.headers||{}}});if(!n.ok){const r=await n.text();throw new Error(`Request failed (${n.status}): ${r}`)}return await n.json()}async function RG(e,t){const n=await fetch(`${fd}${e}`,{...t,headers:{}});if(!n.ok){const r=await n.text();throw new Error(`Request failed (${n.status}): ${r}`)}return n.text()}const it={health:()=>ut("/api/health"),getSettings:()=>ut("/api/settings"),updateSettings:e=>ut("/api/settings",{method:"PUT",body:JSON.stringify(e)}),listConfigs:()=>ut("/api/evals"),createConfig:(e,t)=>ut("/api/evals",{method:"POST",body:JSON.stringify({fileName:e,config:t})}),updateConfig:(e,t,n)=>ut(`/api/evals/${e}`,{method:"PUT",body:JSON.stringify({config:t,fileName:n})}),deleteConfig:e=>ut(`/api/evals/${e}`,{method:"DELETE"}),listRuns:()=>ut("/api/runs"),listMarkdownReports:()=>ut("/api/markdown-reports").then(e=>e.items),getMarkdownReport:e=>ut(`/api/markdown-reports/content?path=${encodeURIComponent(e)}`),deleteMarkdownReport:e=>ut(`/api/markdown-reports?path=${encodeURIComponent(e)}`,{method:"DELETE"}).then(()=>{}),getRun:e=>ut(`/api/runs/${e}`),deleteRun:e=>ut(`/api/runs/${e}`,{method:"DELETE"}),updateRunNote:(e,t)=>ut(`/api/runs/${encodeURIComponent(e)}/note`,{method:"PATCH",body:JSON.stringify({runNote:t??""})}).then(()=>{}),getRunTrace:e=>ut(`/api/runs/${e}/trace`),listSnapshots:()=>ut("/api/snapshots"),createSnapshotFromRun:(e,t)=>ut("/api/snapshots",{method:"POST",body:JSON.stringify({runId:e,name:t})}),getSnapshot:e=>ut(`/api/snapshots/${e}`),compareSnapshot:(e,t)=>ut(`/api/snapshots/${e}/compare`,{method:"POST",body:JSON.stringify({runId:t})}),askResultAssistant:(e,t)=>ut(`/api/runs/${encodeURIComponent(e)}/assistant`,{method:"POST",body:JSON.stringify({messages:t})}),applyResultAssistantReport:e=>ut(`/api/runs/${encodeURIComponent(e.runId)}/assistant/apply-report`,{method:"POST",body:JSON.stringify({markdown:e.markdown,outputPath:e.outputPath,overwrite:e.overwrite})}),createResultAssistantSession:e=>ut("/api/result-assistant/sessions",{method:"POST",body:JSON.stringify({runId:e})}),getResultAssistantSession:e=>ut(`/api/result-assistant/sessions/${e}`),sendResultAssistantMessage:(e,t)=>ut(`/api/result-assistant/sessions/${e}/messages`,{method:"POST",body:JSON.stringify({message:t})}),approveResultAssistantToolCall:(e,t,n)=>ut(`/api/result-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:"POST",body:JSON.stringify(n===void 0?{}:{argumentsOverride:n})}),denyResultAssistantToolCall:(e,t)=>ut(`/api/result-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:"POST",body:JSON.stringify({})}),closeResultAssistantSession:e=>ut(`/api/result-assistant/sessions/${e}`,{method:"DELETE"}).then(()=>{}),generateSnapshotEvalBaseline:(e,t,n)=>ut("/api/snapshots/generate-eval",{method:"POST",body:JSON.stringify({runId:e,configId:t,name:n})}),updateSnapshotPolicy:(e,t)=>ut(`/api/evals/${e}/snapshot-policy`,{method:"POST",body:JSON.stringify(t)}),getLibraries:()=>ut("/api/libraries"),saveLibraries:e=>ut("/api/libraries",{method:"PUT",body:JSON.stringify(e)}),startRun:e=>ut("/api/runs",{method:"POST",body:JSON.stringify(e)}),listProviderModels:e=>ut(`/api/providers/models?provider=${encodeURIComponent(e)}`),createScenarioAssistantSession:e=>ut("/api/scenario-assistant/sessions",{method:"POST",body:JSON.stringify(e)}),getScenarioAssistantSession:e=>ut(`/api/scenario-assistant/sessions/${e}`),sendScenarioAssistantMessage:(e,t)=>ut(`/api/scenario-assistant/sessions/${e}/messages`,{method:"POST",body:JSON.stringify({message:t})}),approveScenarioAssistantToolCall:(e,t)=>ut(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:"POST",body:JSON.stringify({})}),denyScenarioAssistantToolCall:(e,t)=>ut(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:"POST",body:JSON.stringify({})}),approveAllScenarioAssistantToolCalls:e=>ut(`/api/scenario-assistant/sessions/${e}/tool-calls/approve-all`,{method:"POST",body:JSON.stringify({})}),closeScenarioAssistantSession:e=>ut(`/api/scenario-assistant/sessions/${e}`,{method:"DELETE"}),discoverToolsForAnalysis:e=>ut("/api/tool-analysis/discover-tools",{method:"POST",body:JSON.stringify(e)}),startToolAnalysis:e=>ut("/api/tool-analysis/jobs",{method:"POST",body:JSON.stringify(e)}),getToolAnalysisResult:e=>ut(`/api/tool-analysis/jobs/${e}/result`),stopToolAnalysis:e=>ut(`/api/tool-analysis/jobs/${e}/stop`,{method:"POST"}),subscribeToolAnalysisJob:(e,t)=>{const n=new EventSource(`${fd}/api/tool-analysis/jobs/${e}/events`);let r=!1;const a=()=>{r||(r=!0,n.close())},i=o=>{if(!r&&!(typeof o.data!="string"||!o.data))try{const c=JSON.parse(o.data);t(c),(c.type==="completed"||c.type==="error")&&a()}catch{}};return n.addEventListener("started",i),n.addEventListener("log",i),n.addEventListener("completed",i),n.addEventListener("error",i),n.onerror=()=>{r||(t({type:"error",ts:new Date().toISOString(),payload:{message:"SSE connection error"}}),a())},()=>a()},listToolAnalysisResults:()=>ut("/api/tool-analysis-results").then(e=>e.items),getToolAnalysisSavedResult:e=>ut(`/api/tool-analysis-results/${e}`),deleteToolAnalysisSavedResult:e=>ut(`/api/tool-analysis-results/${e}`,{method:"DELETE"}).then(()=>{}),createOAuthDebuggerSession:e=>ut("/api/oauth-debugger/sessions",{method:"POST",body:JSON.stringify(e)}),getOAuthDebuggerSession:e=>ut(`/api/oauth-debugger/sessions/${e}`),startOAuthDebuggerSession:e=>ut(`/api/oauth-debugger/sessions/${e}/start`,{method:"POST",body:JSON.stringify({})}),subscribeOAuthDebuggerSession:(e,t)=>{const n=new EventSource(`${fd}/api/oauth-debugger/sessions/${e}/events`);let r=!1;const a=()=>{r||(r=!0,n.close())},i=o=>{if(!r&&!(typeof o.data!="string"||!o.data))try{const c=JSON.parse(o.data);t(c),(c.type==="completed"||c.type==="error"||c.type==="stopped")&&a()}catch{}};return["started","step_started","step_completed","step_failed","http_request","http_response","validation","log","waiting_for_user","waiting_for_browser_callback","completed","error","stopped"].forEach(o=>n.addEventListener(o,i)),n.onerror=()=>{r||(t({type:"error",ts:new Date().toISOString(),payload:{message:"SSE connection error"}}),a())},()=>a()},submitOAuthDebuggerManualCallback:(e,t)=>ut(`/api/oauth-debugger/sessions/${e}/manual-callback`,{method:"POST",body:JSON.stringify(t)}),stopOAuthDebuggerSession:e=>ut(`/api/oauth-debugger/sessions/${e}/stop`,{method:"POST",body:JSON.stringify({})}),exportOAuthDebuggerSession:(e,t)=>t==="json"?ut(`/api/oauth-debugger/sessions/${e}/export?format=json`):RG(`/api/oauth-debugger/sessions/${e}/export?format=${t}`),stopRun:e=>ut(`/api/runs/jobs/${e}/stop`,{method:"POST"}),getRunQueue:()=>ut("/api/runs/queue"),removeQueuedRun:e=>ut(`/api/runs/queue/${e}`,{method:"DELETE"}).then(()=>{}),subscribeRunJob:(e,t)=>{const n=new EventSource(`${fd}/api/runs/jobs/${e}/events`);let r=!1;const a=()=>{r||(r=!0,n.close())},i=o=>{if(!r&&!(typeof o.data!="string"||!o.data))try{const c=JSON.parse(o.data);t(c),(c.type==="completed"||c.type==="error")&&a()}catch{}};return n.addEventListener("queued",i),n.addEventListener("started",i),n.addEventListener("log",i),n.addEventListener("completed",i),n.addEventListener("error",i),n.onerror=()=>{r||(t({type:"error",ts:new Date().toISOString(),payload:{message:"SSE connection error"}}),a())},()=>{a()}}};function IG(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 MG(e){return e||`config-${Date.now()}`}const $G={async listConfigs(){return(await it.listConfigs()).map(Vl)},async createConfig(e){const t=await it.createConfig(IG(e),bP(e));return Vl(t)},async updateConfig(e){const t=await it.updateConfig(e.id,bP(e),MG(e.name));return Vl(t)},async deleteConfig(e){await it.deleteConfig(e)},async listResults(){const t=(await it.listRuns()).map(async n=>{const[{results:r},a]=await Promise.all([it.getRun(n.runId),it.getRunTrace(n.runId)]);return SP(r,a.records)});return Promise.all(t)},async getResult(e){try{const[{results:t},n]=await Promise.all([it.getRun(e),it.getRunTrace(e)]);return SP(t,n.records)}catch{return}},async deleteResult(e){await it.deleteRun(e)},async updateRunNote(e,t){await it.updateRunNote(e,t)},async listMarkdownReports(){return it.listMarkdownReports()},async getMarkdownReport(e){return it.getMarkdownReport(e)},async deleteMarkdownReport(e){await it.deleteMarkdownReport(e)},async startRun(e){return it.startRun(e)},async stopRun(e){await it.stopRun(e)},async getRunQueue(){return it.getRunQueue()},async removeQueuedRun(e){await it.removeQueuedRun(e)},subscribeRunJob(e,t){return it.subscribeRunJob(e,t)},async listSnapshots(){return it.listSnapshots()},async createSnapshotFromRun(e,t){return it.createSnapshotFromRun(e,t)},async getSnapshot(e){try{return await it.getSnapshot(e)}catch{return}},async compareSnapshot(e,t){return it.compareSnapshot(e,t)},async askResultAssistant(e,t){return it.askResultAssistant(e,t)},async applyResultAssistantReport(e){return it.applyResultAssistantReport(e)},async createResultAssistantSession(e){return it.createResultAssistantSession(e)},async getResultAssistantSession(e){return it.getResultAssistantSession(e)},async sendResultAssistantMessage(e,t){return it.sendResultAssistantMessage(e,t)},async approveResultAssistantToolCall(e,t,n){return it.approveResultAssistantToolCall(e,t,n)},async denyResultAssistantToolCall(e,t){return it.denyResultAssistantToolCall(e,t)},async closeResultAssistantSession(e){await it.closeResultAssistantSession(e)},async generateSnapshotEvalBaseline(e,t,n){const r=await it.generateSnapshotEvalBaseline(e,t,n);return{snapshot:r.snapshot,config:Vl(r.config)}},async updateSnapshotPolicy(e,t){const n=await it.updateSnapshotPolicy(e,t);return Vl(n)},async getLibraries(){const e=await it.getLibraries();return AG(e)},async saveLibraries(e){await it.saveLibraries(_G(e))},async listProviderModels(e){return it.listProviderModels(e)},async getWorkspaceSettings(){return it.getSettings()},async updateWorkspaceSettings(e){return it.updateSettings(e)},async createScenarioAssistantSession(e){return it.createScenarioAssistantSession(e)},async getScenarioAssistantSession(e){return it.getScenarioAssistantSession(e)},async sendScenarioAssistantMessage(e,t){return it.sendScenarioAssistantMessage(e,t)},async approveScenarioAssistantToolCall(e,t){return it.approveScenarioAssistantToolCall(e,t)},async denyScenarioAssistantToolCall(e,t){return it.denyScenarioAssistantToolCall(e,t)},async approveAllScenarioAssistantToolCalls(e){return it.approveAllScenarioAssistantToolCalls(e)},async closeScenarioAssistantSession(e){await it.closeScenarioAssistantSession(e)},async discoverToolsForAnalysis(e){return it.discoverToolsForAnalysis(e)},async startToolAnalysis(e){return it.startToolAnalysis(e)},subscribeToolAnalysisJob(e,t){return it.subscribeToolAnalysisJob(e,t)},async getToolAnalysisResult(e){return it.getToolAnalysisResult(e)},async stopToolAnalysis(e){return it.stopToolAnalysis(e)},async listToolAnalysisResults(){return it.listToolAnalysisResults()},async getToolAnalysisSavedResult(e){return it.getToolAnalysisSavedResult(e)},async deleteToolAnalysisSavedResult(e){await it.deleteToolAnalysisSavedResult(e)},async createOAuthDebuggerSession(e){return it.createOAuthDebuggerSession(e)},async getOAuthDebuggerSession(e){return it.getOAuthDebuggerSession(e)},async startOAuthDebuggerSession(e){return it.startOAuthDebuggerSession(e)},subscribeOAuthDebuggerSession(e,t){return it.subscribeOAuthDebuggerSession(e,t)},async submitOAuthDebuggerManualCallback(e,t){return it.submitOAuthDebuggerManualCallback(e,t)},async stopOAuthDebuggerSession(e){return it.stopOAuthDebuggerSession(e)},async exportOAuthDebuggerSession(e,t){return it.exportOAuthDebuggerSession(e,t)}},D3=v.createContext(null);function DG({children:e}){const t="workspace",[n,r]=v.useState("checking"),[a,i]=v.useState(null);v.useEffect(()=>{r("checking"),it.health().then(c=>{r("connected"),i(typeof c?.version=="string"?c.version:null)}).catch(()=>{r("disconnected"),i(null)})},[t]);const o=v.useMemo(()=>$G,[]);return s.jsx(D3.Provider,{value:{mode:t,connection:n,version:a,source:o},children:e})}function Rn(){const e=v.useContext(D3);if(!e)throw new Error("useDataSource must be used within DataSourceProvider");return e}const LG=e=>{if(e==="/")return[{label:"Dashboard"}];const t=[{label:"Dashboard",to:"/"}];if(en("/mcp-evaluations/:id",e))return t.push({label:"MCP Evaluations",to:"/mcp-evaluations"},{label:"MCP Evaluation"}),t;if(en("/mcp-evaluations",e))return t.push({label:"MCP Evaluations"}),t;if(en("/settings",e))return t.push({label:"Settings"}),t;if(en("/tool-analysis",e))return t.push({label:"Analyze MCP Tools"}),t;if(en("/tool-analysis-results/:id",e)){const n=en("/tool-analysis-results/:id",e);return t.push({label:"Tool Analysis Results",to:"/tool-analysis-results"},{label:n?.params.id??"Report"}),t}if(en("/tool-analysis-results",e))return t.push({label:"Tool Analysis Results"}),t;if(en("/markdown-reports/view",e))return t.push({label:"Markdown Reports",to:"/markdown-reports"},{label:"View Report"}),t;if(en("/markdown-reports",e))return t.push({label:"Markdown Reports"}),t;if(en("/oauth-debugger",e))return t.push({label:"OAuth Debugger"}),t;if(en("/results/:id",e))return t.push({label:"Evaluation Results",to:"/results"},{label:"Result"}),t;if(en("/results",e))return t.push({label:"Evaluation Results"}),t;if(en("/run",e))return t.push({label:"Run Evaluation"}),t;if(en("/libraries/servers/:serverId",e)){const n=en("/libraries/servers/:serverId",e),r=n?.params.serverId?decodeURIComponent(n.params.serverId):"Server";return t.push({label:"Libraries",to:"/libraries/servers"},{label:"Servers",to:"/libraries/servers"},{label:r==="new"?"New Server":r}),t}if(en("/libraries/servers",e))return t.push({label:"Libraries",to:"/libraries/servers"},{label:"Servers"}),t;if(en("/libraries/agents/:agentName",e)){const n=en("/libraries/agents/:agentName",e),r=n?.params.agentName?decodeURIComponent(n.params.agentName):"Agent";return t.push({label:"Libraries",to:"/libraries/agents"},{label:"Agents",to:"/libraries/agents"},{label:r==="new"?"New Agent":r}),t}if(en("/libraries/agents",e))return t.push({label:"Libraries",to:"/libraries/agents"},{label:"Agents"}),t;if(en("/libraries/test-cases/:testCaseId",e)){const n=en("/libraries/test-cases/:testCaseId",e),r=n?.params.testCaseId?decodeURIComponent(n.params.testCaseId):"Test Case";return t.push({label:"Libraries",to:"/libraries/test-cases"},{label:"Test Cases",to:"/libraries/test-cases"},{label:r}),t}return en("/libraries/test-cases",e)?(t.push({label:"Libraries",to:"/libraries/test-cases"},{label:"Test Cases"}),t):en("/compare",e)?(t.push({label:"Compare Evaluations"}),t):(en("/compare/results",e)&&t.push({label:"Compare Evaluations",to:"/compare"},{label:"Full Result Compare"}),t)};function FG(){const e=Cs(),t=new URLSearchParams(e.search).get("embed")==="1",n=LG(e.pathname),{connection:r,version:a}=Rn();return t?s.jsx("main",{className:"min-h-screen overflow-auto bg-background p-4",children:s.jsx(sP,{})}):s.jsx(x3,{children:s.jsxs("div",{className:"flex min-h-screen w-full",children:[s.jsx(SG,{version:a}),s.jsxs("div",{className:"flex flex-1 flex-col",children:[s.jsxs("header",{className:"flex h-12 items-center gap-2 border-b bg-card px-4",children:[s.jsx(b3,{}),s.jsx(O3,{children:s.jsx(T3,{children:n.map((i,o)=>{const c=o===n.length-1;return s.jsxs(v.Fragment,{children:[s.jsx(R3,{children:i.to&&!c?s.jsx(I3,{asChild:!0,children:s.jsx(jt,{to:i.to,children:i.label})}):s.jsx(M3,{children:i.label})}),!c&&s.jsx($3,{})]},`${i.label}-${o}`)})})}),s.jsx("div",{className:"ml-auto flex items-center gap-2",children:s.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full border px-2.5 py-1",children:[s.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"}),s.jsx("span",{className:`text-xs ${r==="connected"?"text-emerald-700":r==="checking"?"text-muted-foreground":"text-destructive"}`,children:r})]})})]}),s.jsx("main",{className:"flex-1 overflow-auto p-6",children:s.jsx(sP,{})})]})]})})}const L3=v.createContext(null);function BG({children:e}){const{source:t}=Rn(),[n,r]=v.useState([]),[a,i]=v.useState(!0),o=v.useCallback(async()=>{i(!0);try{const x=await t.listConfigs();r(x)}finally{i(!1)}},[t]);v.useEffect(()=>{o()},[o]);const c=v.useCallback(x=>n.find(g=>g.id===x),[n]),d=v.useCallback(async x=>{const g=await t.createConfig(x);return r(j=>[...j,g]),g},[t]),f=v.useCallback(async(x,g)=>{const j=await t.updateConfig({...g,id:x});return r(b=>b.map(y=>y.id===x?j:y)),j},[t]),h=v.useCallback(async x=>{await t.deleteConfig(x),r(g=>g.filter(j=>j.id!==x))},[t]),p=v.useCallback(async x=>{const g=n.find(y=>y.id===x);if(!g)throw new Error("Config not found");const j={...structuredClone(g),id:`cfg-${Date.now()}`,name:`${g.name} (Copy)`,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()},b=await t.createConfig(j);return r(y=>[...y,b]),b},[n,t]);return s.jsx(L3.Provider,{value:{configs:n,loading:a,getConfig:c,addConfig:d,updateConfig:f,deleteConfig:h,cloneConfig:p,reload:o},children:e})}function Nf(){const e=v.useContext(L3);if(!e)throw new Error("useConfigs must be used within ConfigProvider");return e}const F3=v.createContext(null);function zG({children:e}){const{source:t}=Rn(),[n,r]=v.useState({servers:[],agents:[],scenarios:[]}),[a,i]=v.useState(!0),o=v.useCallback(async()=>{i(!0);try{const f=await t.getLibraries();r(f)}finally{i(!1)}},[t]);v.useEffect(()=>{o()},[t]),v.useEffect(()=>{const f=()=>{o()};return window.addEventListener("focus",f),()=>{window.removeEventListener("focus",f)}},[t]);const c=v.useCallback(async f=>{r(f),await t.saveLibraries(f)},[t]),d=v.useMemo(()=>({...n,loading:a,setServers:async f=>c({...n,servers:f}),setAgents:async f=>c({...n,agents:f}),setScenarios:async f=>c({...n,scenarios:f}),reload:o}),[n,a,o,c]);return s.jsx(F3.Provider,{value:d,children:e})}function Ga(){const e=v.useContext(F3);if(!e)throw new Error("useLibraries must be used within LibraryProvider");return e}const Ue=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Se("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Ue.displayName="Card";const St=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Se("flex flex-col space-y-1.5 p-6",e),...t}));St.displayName="CardHeader";const Nt=v.forwardRef(({className:e,...t},n)=>s.jsx("h3",{ref:n,className:Se("text-2xl font-semibold leading-none tracking-tight",e),...t}));Nt.displayName="CardTitle";const hs=v.forwardRef(({className:e,...t},n)=>s.jsx("p",{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));hs.displayName="CardDescription";const qe=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Se("p-6 pt-0",e),...t}));qe.displayName="CardContent";const UG=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Se("flex items-center p-6 pt-0",e),...t}));UG.displayName="CardFooter";const $r=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{className:"relative w-full overflow-auto",children:s.jsx("table",{ref:n,className:Se("w-full caption-bottom text-sm",e),...t})}));$r.displayName="Table";const Dr=v.forwardRef(({className:e,...t},n)=>s.jsx("thead",{ref:n,className:Se("[&_tr]:border-b",e),...t}));Dr.displayName="TableHeader";const Lr=v.forwardRef(({className:e,...t},n)=>s.jsx("tbody",{ref:n,className:Se("[&_tr:last-child]:border-0",e),...t}));Lr.displayName="TableBody";const qG=v.forwardRef(({className:e,...t},n)=>s.jsx("tfoot",{ref:n,className:Se("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));qG.displayName="TableFooter";const $t=v.forwardRef(({className:e,...t},n)=>s.jsx("tr",{ref:n,className:Se("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",e),...t}));$t.displayName="TableRow";const tt=v.forwardRef(({className:e,...t},n)=>s.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}));tt.displayName="TableHead";const ze=v.forwardRef(({className:e,...t},n)=>s.jsx("td",{ref:n,className:Se("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));ze.displayName="TableCell";const WG=v.forwardRef(({className:e,...t},n)=>s.jsx("caption",{ref:n,className:Se("mt-4 text-sm text-muted-foreground",e),...t}));WG.displayName="TableCaption";function os({title:e,value:t,subtitle:n,icon:r,trend:a}){return s.jsx(Ue,{children:s.jsx(qe,{className:"p-4",children:s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:e}),s.jsx("p",{className:"text-2xl font-bold",children:t}),n&&s.jsxs("p",{className:`text-xs ${a==="up"?"text-success":a==="down"?"text-destructive":"text-muted-foreground"}`,children:[a==="up"&&"↑ ",a==="down"&&"↓ ",n]})]}),s.jsx("div",{className:"rounded-lg bg-primary/10 p-2",children:s.jsx(r,{className:"h-4 w-4 text-primary"})})]})})})}const VG=Jo("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"}});function Qe({className:e,variant:t,asChild:n,...r}){const a=n?Xi:"div";return s.jsx(a,{className:Se(VG({variant:t}),e),...r})}function Vs({rate:e,className:t}){const n=Math.round(e*100),r=n>=80?"default":n>=50?"secondary":"destructive";return s.jsxs(Qe,{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 Ey,NP;function Br(){if(NP)return Ey;NP=1;var e=Array.isArray;return Ey=e,Ey}var Py,CP;function B3(){if(CP)return Py;CP=1;var e=typeof Wp=="object"&&Wp&&Wp.Object===Object&&Wp;return Py=e,Py}var ky,AP;function As(){if(AP)return ky;AP=1;var e=B3(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return ky=n,ky}var Oy,_P;function Cf(){if(_P)return Oy;_P=1;var e=As(),t=e.Symbol;return Oy=t,Oy}var Ty,EP;function HG(){if(EP)return Ty;EP=1;var e=Cf(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,a=e?e.toStringTag:void 0;function i(o){var c=n.call(o,a),d=o[a];try{o[a]=void 0;var f=!0}catch{}var h=r.call(o);return f&&(c?o[a]=d:delete o[a]),h}return Ty=i,Ty}var Ry,PP;function KG(){if(PP)return Ry;PP=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return Ry=n,Ry}var Iy,kP;function ai(){if(kP)return Iy;kP=1;var e=Cf(),t=HG(),n=KG(),r="[object Null]",a="[object Undefined]",i=e?e.toStringTag:void 0;function o(c){return c==null?c===void 0?a:r:i&&i in Object(c)?t(c):n(c)}return Iy=o,Iy}var My,OP;function si(){if(OP)return My;OP=1;function e(t){return t!=null&&typeof t=="object"}return My=e,My}var $y,TP;function nu(){if(TP)return $y;TP=1;var e=ai(),t=si(),n="[object Symbol]";function r(a){return typeof a=="symbol"||t(a)&&e(a)==n}return $y=r,$y}var Dy,RP;function yN(){if(RP)return Dy;RP=1;var e=Br(),t=nu(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function a(i,o){if(e(i))return!1;var c=typeof i;return c=="number"||c=="symbol"||c=="boolean"||i==null||t(i)?!0:r.test(i)||!n.test(i)||o!=null&&i in Object(o)}return Dy=a,Dy}var Ly,IP;function Qi(){if(IP)return Ly;IP=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return Ly=e,Ly}var Fy,MP;function bN(){if(MP)return Fy;MP=1;var e=ai(),t=Qi(),n="[object AsyncFunction]",r="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function o(c){if(!t(c))return!1;var d=e(c);return d==r||d==a||d==n||d==i}return Fy=o,Fy}var By,$P;function GG(){if($P)return By;$P=1;var e=As(),t=e["__core-js_shared__"];return By=t,By}var zy,DP;function YG(){if(DP)return zy;DP=1;var e=GG(),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 zy=n,zy}var Uy,LP;function z3(){if(LP)return Uy;LP=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 Uy=n,Uy}var qy,FP;function XG(){if(FP)return qy;FP=1;var e=bN(),t=YG(),n=Qi(),r=z3(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=Function.prototype,c=Object.prototype,d=o.toString,f=c.hasOwnProperty,h=RegExp("^"+d.call(f).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(x){if(!n(x)||t(x))return!1;var g=e(x)?h:i;return g.test(r(x))}return qy=p,qy}var Wy,BP;function QG(){if(BP)return Wy;BP=1;function e(t,n){return t?.[n]}return Wy=e,Wy}var Vy,zP;function el(){if(zP)return Vy;zP=1;var e=XG(),t=QG();function n(r,a){var i=t(r,a);return e(i)?i:void 0}return Vy=n,Vy}var Hy,UP;function bv(){if(UP)return Hy;UP=1;var e=el(),t=e(Object,"create");return Hy=t,Hy}var Ky,qP;function JG(){if(qP)return Ky;qP=1;var e=bv();function t(){this.__data__=e?e(null):{},this.size=0}return Ky=t,Ky}var Gy,WP;function ZG(){if(WP)return Gy;WP=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return Gy=e,Gy}var Yy,VP;function eY(){if(VP)return Yy;VP=1;var e=bv(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function a(i){var o=this.__data__;if(e){var c=o[i];return c===t?void 0:c}return r.call(o,i)?o[i]:void 0}return Yy=a,Yy}var Xy,HP;function tY(){if(HP)return Xy;HP=1;var e=bv(),t=Object.prototype,n=t.hasOwnProperty;function r(a){var i=this.__data__;return e?i[a]!==void 0:n.call(i,a)}return Xy=r,Xy}var Qy,KP;function nY(){if(KP)return Qy;KP=1;var e=bv(),t="__lodash_hash_undefined__";function n(r,a){var i=this.__data__;return this.size+=this.has(r)?0:1,i[r]=e&&a===void 0?t:a,this}return Qy=n,Qy}var Jy,GP;function rY(){if(GP)return Jy;GP=1;var e=JG(),t=ZG(),n=eY(),r=tY(),a=nY();function i(o){var c=-1,d=o==null?0:o.length;for(this.clear();++c<d;){var f=o[c];this.set(f[0],f[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=a,Jy=i,Jy}var Zy,YP;function aY(){if(YP)return Zy;YP=1;function e(){this.__data__=[],this.size=0}return Zy=e,Zy}var eb,XP;function wN(){if(XP)return eb;XP=1;function e(t,n){return t===n||t!==t&&n!==n}return eb=e,eb}var tb,QP;function wv(){if(QP)return tb;QP=1;var e=wN();function t(n,r){for(var a=n.length;a--;)if(e(n[a][0],r))return a;return-1}return tb=t,tb}var nb,JP;function sY(){if(JP)return nb;JP=1;var e=wv(),t=Array.prototype,n=t.splice;function r(a){var i=this.__data__,o=e(i,a);if(o<0)return!1;var c=i.length-1;return o==c?i.pop():n.call(i,o,1),--this.size,!0}return nb=r,nb}var rb,ZP;function iY(){if(ZP)return rb;ZP=1;var e=wv();function t(n){var r=this.__data__,a=e(r,n);return a<0?void 0:r[a][1]}return rb=t,rb}var ab,ek;function oY(){if(ek)return ab;ek=1;var e=wv();function t(n){return e(this.__data__,n)>-1}return ab=t,ab}var sb,tk;function lY(){if(tk)return sb;tk=1;var e=wv();function t(n,r){var a=this.__data__,i=e(a,n);return i<0?(++this.size,a.push([n,r])):a[i][1]=r,this}return sb=t,sb}var ib,nk;function jv(){if(nk)return ib;nk=1;var e=aY(),t=sY(),n=iY(),r=oY(),a=lY();function i(o){var c=-1,d=o==null?0:o.length;for(this.clear();++c<d;){var f=o[c];this.set(f[0],f[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=a,ib=i,ib}var ob,rk;function jN(){if(rk)return ob;rk=1;var e=el(),t=As(),n=e(t,"Map");return ob=n,ob}var lb,ak;function cY(){if(ak)return lb;ak=1;var e=rY(),t=jv(),n=jN();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return lb=r,lb}var cb,sk;function uY(){if(sk)return cb;sk=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return cb=e,cb}var ub,ik;function Sv(){if(ik)return ub;ik=1;var e=uY();function t(n,r){var a=n.__data__;return e(r)?a[typeof r=="string"?"string":"hash"]:a.map}return ub=t,ub}var db,ok;function dY(){if(ok)return db;ok=1;var e=Sv();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return db=t,db}var fb,lk;function fY(){if(lk)return fb;lk=1;var e=Sv();function t(n){return e(this,n).get(n)}return fb=t,fb}var pb,ck;function pY(){if(ck)return pb;ck=1;var e=Sv();function t(n){return e(this,n).has(n)}return pb=t,pb}var hb,uk;function hY(){if(uk)return hb;uk=1;var e=Sv();function t(n,r){var a=e(this,n),i=a.size;return a.set(n,r),this.size+=a.size==i?0:1,this}return hb=t,hb}var mb,dk;function SN(){if(dk)return mb;dk=1;var e=cY(),t=dY(),n=fY(),r=pY(),a=hY();function i(o){var c=-1,d=o==null?0:o.length;for(this.clear();++c<d;){var f=o[c];this.set(f[0],f[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=a,mb=i,mb}var vb,fk;function U3(){if(fk)return vb;fk=1;var e=SN(),t="Expected a function";function n(r,a){if(typeof r!="function"||a!=null&&typeof a!="function")throw new TypeError(t);var i=function(){var o=arguments,c=a?a.apply(this,o):o[0],d=i.cache;if(d.has(c))return d.get(c);var f=r.apply(this,o);return i.cache=d.set(c,f)||d,f};return i.cache=new(n.Cache||e),i}return n.Cache=e,vb=n,vb}var gb,pk;function mY(){if(pk)return gb;pk=1;var e=U3(),t=500;function n(r){var a=e(r,function(o){return i.size===t&&i.clear(),o}),i=a.cache;return a}return gb=n,gb}var xb,hk;function vY(){if(hk)return xb;hk=1;var e=mY(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(a){var i=[];return a.charCodeAt(0)===46&&i.push(""),a.replace(t,function(o,c,d,f){i.push(d?f.replace(n,"$1"):c||o)}),i});return xb=r,xb}var yb,mk;function NN(){if(mk)return yb;mk=1;function e(t,n){for(var r=-1,a=t==null?0:t.length,i=Array(a);++r<a;)i[r]=n(t[r],r,t);return i}return yb=e,yb}var bb,vk;function gY(){if(vk)return bb;vk=1;var e=Cf(),t=NN(),n=Br(),r=nu(),a=e?e.prototype:void 0,i=a?a.toString:void 0;function o(c){if(typeof c=="string")return c;if(n(c))return t(c,o)+"";if(r(c))return i?i.call(c):"";var d=c+"";return d=="0"&&1/c==-1/0?"-0":d}return bb=o,bb}var wb,gk;function q3(){if(gk)return wb;gk=1;var e=gY();function t(n){return n==null?"":e(n)}return wb=t,wb}var jb,xk;function W3(){if(xk)return jb;xk=1;var e=Br(),t=yN(),n=vY(),r=q3();function a(i,o){return e(i)?i:t(i,o)?[i]:n(r(i))}return jb=a,jb}var Sb,yk;function Nv(){if(yk)return Sb;yk=1;var e=nu();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return Sb=t,Sb}var Nb,bk;function CN(){if(bk)return Nb;bk=1;var e=W3(),t=Nv();function n(r,a){a=e(a,r);for(var i=0,o=a.length;r!=null&&i<o;)r=r[t(a[i++])];return i&&i==o?r:void 0}return Nb=n,Nb}var Cb,wk;function V3(){if(wk)return Cb;wk=1;var e=CN();function t(n,r,a){var i=n==null?void 0:e(n,r);return i===void 0?a:i}return Cb=t,Cb}var xY=V3();const sa=Yt(xY);var Ab,jk;function yY(){if(jk)return Ab;jk=1;function e(t){return t==null}return Ab=e,Ab}var bY=yY();const At=Yt(bY);var _b,Sk;function wY(){if(Sk)return _b;Sk=1;var e=ai(),t=Br(),n=si(),r="[object String]";function a(i){return typeof i=="string"||!t(i)&&n(i)&&e(i)==r}return _b=a,_b}var jY=wY();const $o=Yt(jY);var SY=bN();const Ct=Yt(SY);var NY=Qi();const ru=Yt(NY);var Eb={exports:{}},Kt={};var Nk;function CY(){if(Nk)return Kt;Nk=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),c=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),j;j=Symbol.for("react.module.reference");function b(y){if(typeof y=="object"&&y!==null){var S=y.$$typeof;switch(S){case e:switch(y=y.type,y){case n:case a:case r:case f:case h:return y;default:switch(y=y&&y.$$typeof,y){case c:case o:case d:case x:case p:case i:return y;default:return S}}case t:return S}}}return Kt.ContextConsumer=o,Kt.ContextProvider=i,Kt.Element=e,Kt.ForwardRef=d,Kt.Fragment=n,Kt.Lazy=x,Kt.Memo=p,Kt.Portal=t,Kt.Profiler=a,Kt.StrictMode=r,Kt.Suspense=f,Kt.SuspenseList=h,Kt.isAsyncMode=function(){return!1},Kt.isConcurrentMode=function(){return!1},Kt.isContextConsumer=function(y){return b(y)===o},Kt.isContextProvider=function(y){return b(y)===i},Kt.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===e},Kt.isForwardRef=function(y){return b(y)===d},Kt.isFragment=function(y){return b(y)===n},Kt.isLazy=function(y){return b(y)===x},Kt.isMemo=function(y){return b(y)===p},Kt.isPortal=function(y){return b(y)===t},Kt.isProfiler=function(y){return b(y)===a},Kt.isStrictMode=function(y){return b(y)===r},Kt.isSuspense=function(y){return b(y)===f},Kt.isSuspenseList=function(y){return b(y)===h},Kt.isValidElementType=function(y){return typeof y=="string"||typeof y=="function"||y===n||y===a||y===r||y===f||y===h||y===g||typeof y=="object"&&y!==null&&(y.$$typeof===x||y.$$typeof===p||y.$$typeof===i||y.$$typeof===o||y.$$typeof===d||y.$$typeof===j||y.getModuleId!==void 0)},Kt.typeOf=b,Kt}var Ck;function AY(){return Ck||(Ck=1,Eb.exports=CY()),Eb.exports}var _Y=AY(),Pb,Ak;function H3(){if(Ak)return Pb;Ak=1;var e=ai(),t=si(),n="[object Number]";function r(a){return typeof a=="number"||t(a)&&e(a)==n}return Pb=r,Pb}var kb,_k;function EY(){if(_k)return kb;_k=1;var e=H3();function t(n){return e(n)&&n!=+n}return kb=t,kb}var PY=EY();const Af=Yt(PY);var kY=H3();const OY=Yt(kY);var jr=function(t){return t===0?0:t>0?1:-1},Ao=function(t){return $o(t)&&t.indexOf("%")===t.length-1},We=function(t){return OY(t)&&!Af(t)},TY=function(t){return At(t)},Wn=function(t){return We(t)||$o(t)},RY=0,au=function(t){var n=++RY;return"".concat(t||"").concat(n)},Sr=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!We(t)&&!$o(t))return r;var i;if(Ao(t)){var o=t.indexOf("%");i=n*parseFloat(t.slice(0,o))/100}else i=+t;return Af(i)&&(i=r),a&&i>n&&(i=n),i},Hl=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},IY=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},a=0;a<n;a++)if(!r[t[a]])r[t[a]]=!0;else return!0;return!1},ea=function(t,n){return We(t)&&We(n)?function(r){return t+r*(n-t)}:function(){return n}};function $h(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):sa(r,t))===n})}var MY=function(t,n){return We(t)&&We(n)?t-n:$o(t)&&$o(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function oc(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 i1(e){"@babel/helpers - typeof";return i1=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},i1(e)}var $Y=["viewBox","children"],DY=["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"],Ek=["points","pathLength"],Ob={svg:$Y,polygon:Ek,polyline:Ek},AN=["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"],Dh=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(v.isValidElement(t)&&(r=t.props),!ru(r))return null;var a={};return Object.keys(r).forEach(function(i){AN.includes(i)&&(a[i]=n||function(o){return r[i](r,o)})}),a},LY=function(t,n,r){return function(a){return t(n,r,a),null}},Do=function(t,n,r){if(!ru(t)||i1(t)!=="object")return null;var a=null;return Object.keys(t).forEach(function(i){var o=t[i];AN.includes(i)&&typeof o=="function"&&(a||(a={}),a[i]=LY(o,n,r))}),a},FY=["children"],BY=["children"];function Pk(e,t){if(e==null)return{};var n=zY(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function zY(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 o1(e){"@babel/helpers - typeof";return o1=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},o1(e)}var kk={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"},Gs=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},Ok=null,Tb=null,_N=function e(t){if(t===Ok&&Array.isArray(Tb))return Tb;var n=[];return v.Children.forEach(t,function(r){At(r)||(_Y.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),Tb=n,Ok=t,n};function ia(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(a){return Gs(a)}):r=[Gs(t)],_N(e).forEach(function(a){var i=sa(a,"type.displayName")||sa(a,"type.name");r.indexOf(i)!==-1&&n.push(a)}),n}function Jr(e,t){var n=ia(e,t);return n&&n[0]}var Tk=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,a=n.height;return!(!We(r)||r<=0||!We(a)||a<=0)},UY=["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"],qY=function(t){return t&&t.type&&$o(t.type)&&UY.indexOf(t.type)>=0},WY=function(t){return t&&o1(t)==="object"&&"clipDot"in t},VY=function(t,n,r,a){var i,o=(i=Ob?.[a])!==null&&i!==void 0?i:[];return n.startsWith("data-")||!Ct(t)&&(a&&o.includes(n)||DY.includes(n))||r&&AN.includes(n)},gt=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(v.isValidElement(t)&&(a=t.props),!ru(a))return null;var i={};return Object.keys(a).forEach(function(o){var c;VY((c=a)===null||c===void 0?void 0:c[o],o,n,r)&&(i[o]=a[o])}),i},l1=function e(t,n){if(t===n)return!0;var r=v.Children.count(t);if(r!==v.Children.count(n))return!1;if(r===0)return!0;if(r===1)return Rk(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var a=0;a<r;a++){var i=t[a],o=n[a];if(Array.isArray(i)||Array.isArray(o)){if(!e(i,o))return!1}else if(!Rk(i,o))return!1}return!0},Rk=function(t,n){if(At(t)&&At(n))return!0;if(!At(t)&&!At(n)){var r=t.props||{},a=r.children,i=Pk(r,FY),o=n.props||{},c=o.children,d=Pk(o,BY);return a&&c?oc(i,d)&&l1(a,c):!a&&!c?oc(i,d):!1}return!1},Ik=function(t,n){var r=[],a={};return _N(t).forEach(function(i,o){if(qY(i))r.push(i);else if(i){var c=Gs(i.type),d=n[c]||{},f=d.handler,h=d.once;if(f&&(!h||!a[c])){var p=f(i,c,o);r.push(p),a[c]=!0}}}),r},HY=function(t){var n=t&&t.type;return n&&kk[n]?kk[n]:null},KY=function(t,n){return _N(n).indexOf(t)},GY=["children","width","height","viewBox","className","style","title","desc"];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 YY(e,t){if(e==null)return{};var n=XY(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function XY(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 u1(e){var t=e.children,n=e.width,r=e.height,a=e.viewBox,i=e.className,o=e.style,c=e.title,d=e.desc,f=YY(e,GY),h=a||{width:n,height:r,x:0,y:0},p=_t("recharts-surface",i);return W.createElement("svg",c1({},gt(f,!0,"svg"),{className:p,width:n,height:r,style:o,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height)}),W.createElement("title",null,c),W.createElement("desc",null,d),t)}var QY=["children","className"];function d1(){return d1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},d1.apply(this,arguments)}function JY(e,t){if(e==null)return{};var n=ZY(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ZY(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 qt=W.forwardRef(function(e,t){var n=e.children,r=e.className,a=JY(e,QY),i=_t("recharts-layer",r);return W.createElement("g",d1({className:i},gt(a,!0),{ref:t}),n)}),Ys=function(t,n){for(var r=arguments.length,a=new Array(r>2?r-2:0),i=2;i<r;i++)a[i-2]=arguments[i]},Rb,Mk;function eX(){if(Mk)return Rb;Mk=1;function e(t,n,r){var a=-1,i=t.length;n<0&&(n=-n>i?0:i+n),r=r>i?i:r,r<0&&(r+=i),i=n>r?0:r-n>>>0,n>>>=0;for(var o=Array(i);++a<i;)o[a]=t[a+n];return o}return Rb=e,Rb}var Ib,$k;function tX(){if($k)return Ib;$k=1;var e=eX();function t(n,r,a){var i=n.length;return a=a===void 0?i:a,!r&&a>=i?n:e(n,r,a)}return Ib=t,Ib}var Mb,Dk;function K3(){if(Dk)return Mb;Dk=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",a=t+n+r,i="\\ufe0e\\ufe0f",o="\\u200d",c=RegExp("["+o+e+a+i+"]");function d(f){return c.test(f)}return Mb=d,Mb}var $b,Lk;function nX(){if(Lk)return $b;Lk=1;function e(t){return t.split("")}return $b=e,$b}var Db,Fk;function rX(){if(Fk)return Db;Fk=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",a=t+n+r,i="\\ufe0e\\ufe0f",o="["+e+"]",c="["+a+"]",d="\\ud83c[\\udffb-\\udfff]",f="(?:"+c+"|"+d+")",h="[^"+e+"]",p="(?:\\ud83c[\\udde6-\\uddff]){2}",x="[\\ud800-\\udbff][\\udc00-\\udfff]",g="\\u200d",j=f+"?",b="["+i+"]?",y="(?:"+g+"(?:"+[h,p,x].join("|")+")"+b+j+")*",S=b+j+y,C="(?:"+[h+c+"?",c,p,x,o].join("|")+")",N=RegExp(d+"(?="+d+")|"+C+S,"g");function E(_){return _.match(N)||[]}return Db=E,Db}var Lb,Bk;function aX(){if(Bk)return Lb;Bk=1;var e=nX(),t=K3(),n=rX();function r(a){return t(a)?n(a):e(a)}return Lb=r,Lb}var Fb,zk;function sX(){if(zk)return Fb;zk=1;var e=tX(),t=K3(),n=aX(),r=q3();function a(i){return function(o){o=r(o);var c=t(o)?n(o):void 0,d=c?c[0]:o.charAt(0),f=c?e(c,1).join(""):o.slice(1);return d[i]()+f}}return Fb=a,Fb}var Bb,Uk;function iX(){if(Uk)return Bb;Uk=1;var e=sX(),t=e("toUpperCase");return Bb=t,Bb}var oX=iX();const Cv=Yt(oX);function sn(e){return function(){return e}}const G3=Math.cos,Lh=Math.sin,Ya=Math.sqrt,Fh=Math.PI,Av=2*Fh,f1=Math.PI,p1=2*f1,So=1e-6,lX=p1-So;function Y3(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function cX(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Y3;const n=10**t;return function(r){this._+=r[0];for(let a=1,i=r.length;a<i;++a)this._+=Math.round(arguments[a]*n)/n+r[a]}}class uX{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Y3:cX(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,a){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+a}`}bezierCurveTo(t,n,r,a,i,o){this._append`C${+t},${+n},${+r},${+a},${this._x1=+i},${this._y1=+o}`}arcTo(t,n,r,a,i){if(t=+t,n=+n,r=+r,a=+a,i=+i,i<0)throw new Error(`negative radius: ${i}`);let o=this._x1,c=this._y1,d=r-t,f=a-n,h=o-t,p=c-n,x=h*h+p*p;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(x>So)if(!(Math.abs(p*d-f*h)>So)||!i)this._append`L${this._x1=t},${this._y1=n}`;else{let g=r-o,j=a-c,b=d*d+f*f,y=g*g+j*j,S=Math.sqrt(b),C=Math.sqrt(x),N=i*Math.tan((f1-Math.acos((b+x-y)/(2*S*C)))/2),E=N/C,_=N/S;Math.abs(E-1)>So&&this._append`L${t+E*h},${n+E*p}`,this._append`A${i},${i},0,0,${+(p*g>h*j)},${this._x1=t+_*d},${this._y1=n+_*f}`}}arc(t,n,r,a,i,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let c=r*Math.cos(a),d=r*Math.sin(a),f=t+c,h=n+d,p=1^o,x=o?a-i:i-a;this._x1===null?this._append`M${f},${h}`:(Math.abs(this._x1-f)>So||Math.abs(this._y1-h)>So)&&this._append`L${f},${h}`,r&&(x<0&&(x=x%p1+p1),x>lX?this._append`A${r},${r},0,1,${p},${t-c},${n-d}A${r},${r},0,1,${p},${this._x1=f},${this._y1=h}`:x>So&&this._append`A${r},${r},0,${+(x>=f1)},${p},${this._x1=t+r*Math.cos(i)},${this._y1=n+r*Math.sin(i)}`)}rect(t,n,r,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+a}h${-r}Z`}toString(){return this._}}function EN(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 uX(t)}function PN(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function X3(e){this._context=e}X3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function _v(e){return new X3(e)}function Q3(e){return e[0]}function J3(e){return e[1]}function Z3(e,t){var n=sn(!0),r=null,a=_v,i=null,o=EN(c);e=typeof e=="function"?e:e===void 0?Q3:sn(e),t=typeof t=="function"?t:t===void 0?J3:sn(t);function c(d){var f,h=(d=PN(d)).length,p,x=!1,g;for(r==null&&(i=a(g=o())),f=0;f<=h;++f)!(f<h&&n(p=d[f],f,d))===x&&((x=!x)?i.lineStart():i.lineEnd()),x&&i.point(+e(p,f,d),+t(p,f,d));if(g)return i=null,g+""||null}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:sn(+d),c):e},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:sn(+d),c):t},c.defined=function(d){return arguments.length?(n=typeof d=="function"?d:sn(!!d),c):n},c.curve=function(d){return arguments.length?(a=d,r!=null&&(i=a(r)),c):a},c.context=function(d){return arguments.length?(d==null?r=i=null:i=a(r=d),c):r},c}function nh(e,t,n){var r=null,a=sn(!0),i=null,o=_v,c=null,d=EN(f);e=typeof e=="function"?e:e===void 0?Q3:sn(+e),t=typeof t=="function"?t:sn(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?J3:sn(+n);function f(p){var x,g,j,b=(p=PN(p)).length,y,S=!1,C,N=new Array(b),E=new Array(b);for(i==null&&(c=o(C=d())),x=0;x<=b;++x){if(!(x<b&&a(y=p[x],x,p))===S)if(S=!S)g=x,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),j=x-1;j>=g;--j)c.point(N[j],E[j]);c.lineEnd(),c.areaEnd()}S&&(N[x]=+e(y,x,p),E[x]=+t(y,x,p),c.point(r?+r(y,x,p):N[x],n?+n(y,x,p):E[x]))}if(C)return c=null,C+""||null}function h(){return Z3().defined(a).curve(o).context(i)}return f.x=function(p){return arguments.length?(e=typeof p=="function"?p:sn(+p),r=null,f):e},f.x0=function(p){return arguments.length?(e=typeof p=="function"?p:sn(+p),f):e},f.x1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:sn(+p),f):r},f.y=function(p){return arguments.length?(t=typeof p=="function"?p:sn(+p),n=null,f):t},f.y0=function(p){return arguments.length?(t=typeof p=="function"?p:sn(+p),f):t},f.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:sn(+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?(a=typeof p=="function"?p:sn(!!p),f):a},f.curve=function(p){return arguments.length?(o=p,i!=null&&(c=o(i)),f):o},f.context=function(p){return arguments.length?(p==null?i=c=null:c=o(i=p),f):i},f}class e5{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 dX(e){return new e5(e,!0)}function fX(e){return new e5(e,!1)}const kN={draw(e,t){const n=Ya(t/Fh);e.moveTo(n,0),e.arc(0,0,n,0,Av)}},pX={draw(e,t){const n=Ya(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()}},t5=Ya(1/3),hX=t5*2,mX={draw(e,t){const n=Ya(t/hX),r=n*t5;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},vX={draw(e,t){const n=Ya(t),r=-n/2;e.rect(r,r,n,n)}},gX=.8908130915292852,n5=Lh(Fh/10)/Lh(7*Fh/10),xX=Lh(Av/10)*n5,yX=-G3(Av/10)*n5,bX={draw(e,t){const n=Ya(t*gX),r=xX*n,a=yX*n;e.moveTo(0,-n),e.lineTo(r,a);for(let i=1;i<5;++i){const o=Av*i/5,c=G3(o),d=Lh(o);e.lineTo(d*n,-c*n),e.lineTo(c*r-d*a,d*r+c*a)}e.closePath()}},zb=Ya(3),wX={draw(e,t){const n=-Ya(t/(zb*3));e.moveTo(0,n*2),e.lineTo(-zb*n,-n),e.lineTo(zb*n,-n),e.closePath()}},va=-.5,ga=Ya(3)/2,h1=1/Ya(12),jX=(h1/2+1)*3,SX={draw(e,t){const n=Ya(t/jX),r=n/2,a=n*h1,i=r,o=n*h1+n,c=-i,d=o;e.moveTo(r,a),e.lineTo(i,o),e.lineTo(c,d),e.lineTo(va*r-ga*a,ga*r+va*a),e.lineTo(va*i-ga*o,ga*i+va*o),e.lineTo(va*c-ga*d,ga*c+va*d),e.lineTo(va*r+ga*a,va*a-ga*r),e.lineTo(va*i+ga*o,va*o-ga*i),e.lineTo(va*c+ga*d,va*d-ga*c),e.closePath()}};function NX(e,t){let n=null,r=EN(a);e=typeof e=="function"?e:sn(e||kN),t=typeof t=="function"?t:sn(t===void 0?64:+t);function a(){let i;if(n||(n=i=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+""||null}return a.type=function(i){return arguments.length?(e=typeof i=="function"?i:sn(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:sn(+i),a):t},a.context=function(i){return arguments.length?(n=i??null,a):n},a}function Bh(){}function zh(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 r5(e){this._context=e}r5.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:zh(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:zh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function CX(e){return new r5(e)}function a5(e){this._context=e}a5.prototype={areaStart:Bh,areaEnd:Bh,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:zh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function AX(e){return new a5(e)}function s5(e){this._context=e}s5.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:zh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function _X(e){return new s5(e)}function i5(e){this._context=e}i5.prototype={areaStart:Bh,areaEnd:Bh,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 EX(e){return new i5(e)}function qk(e){return e<0?-1:1}function Wk(e,t,n){var r=e._x1-e._x0,a=t-e._x1,i=(e._y1-e._y0)/(r||a<0&&-0),o=(n-e._y1)/(a||r<0&&-0),c=(i*a+o*r)/(r+a);return(qk(i)+qk(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(c))||0}function Vk(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Ub(e,t,n){var r=e._x0,a=e._y0,i=e._x1,o=e._y1,c=(i-r)/3;e._context.bezierCurveTo(r+c,a+c*t,i-c,o-c*n,i,o)}function Uh(e){this._context=e}Uh.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:Ub(this,this._t0,Vk(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,Ub(this,Vk(this,n=Wk(this,e,t)),n);break;default:Ub(this,this._t0,n=Wk(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function o5(e){this._context=new l5(e)}(o5.prototype=Object.create(Uh.prototype)).point=function(e,t){Uh.prototype.point.call(this,t,e)};function l5(e){this._context=e}l5.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,a,i){this._context.bezierCurveTo(t,e,r,n,i,a)}};function PX(e){return new Uh(e)}function kX(e){return new o5(e)}function c5(e){this._context=e}c5.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=Hk(e),a=Hk(t),i=0,o=1;o<n;++i,++o)this._context.bezierCurveTo(r[0][i],a[0][i],r[1][i],a[1][i],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function Hk(e){var t,n=e.length-1,r,a=new Array(n),i=new Array(n),o=new Array(n);for(a[0]=0,i[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)a[t]=1,i[t]=4,o[t]=4*e[t]+2*e[t+1];for(a[n-1]=2,i[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=a[t]/i[t-1],i[t]-=r,o[t]-=r*o[t-1];for(a[n-1]=o[n-1]/i[n-1],t=n-2;t>=0;--t)a[t]=(o[t]-a[t+1])/i[t];for(i[n-1]=(e[n]+a[n-1])/2,t=0;t<n-1;++t)i[t]=2*e[t+1]-a[t+1];return[a,i]}function OX(e){return new c5(e)}function Ev(e,t){this._context=e,this._t=t}Ev.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 TX(e){return new Ev(e,.5)}function RX(e){return new Ev(e,0)}function IX(e){return new Ev(e,1)}function xc(e,t){if((o=e.length)>1)for(var n=1,r,a,i=e[t[0]],o,c=i.length;n<o;++n)for(a=i,i=e[t[n]],r=0;r<c;++r)i[r][1]+=i[r][0]=isNaN(a[r][1])?a[r][0]:a[r][1]}function m1(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function MX(e,t){return e[t]}function $X(e){const t=[];return t.key=e,t}function DX(){var e=sn([]),t=m1,n=xc,r=MX;function a(i){var o=Array.from(e.apply(this,arguments),$X),c,d=o.length,f=-1,h;for(const p of i)for(c=0,++f;c<d;++c)(o[c][f]=[0,+r(p,o[c].key,f,i)]).data=p;for(c=0,h=PN(t(o));c<d;++c)o[h[c]].index=c;return n(o,h),o}return a.keys=function(i){return arguments.length?(e=typeof i=="function"?i:sn(Array.from(i)),a):e},a.value=function(i){return arguments.length?(r=typeof i=="function"?i:sn(+i),a):r},a.order=function(i){return arguments.length?(t=i==null?m1:typeof i=="function"?i:sn(Array.from(i)),a):t},a.offset=function(i){return arguments.length?(n=i??xc,a):n},a}function LX(e,t){if((r=e.length)>0){for(var n,r,a=0,i=e[0].length,o;a<i;++a){for(o=n=0;n<r;++n)o+=e[n][a][1]||0;if(o)for(n=0;n<r;++n)e[n][a][1]/=o}xc(e,t)}}function FX(e,t){if((a=e.length)>0){for(var n=0,r=e[t[0]],a,i=r.length;n<i;++n){for(var o=0,c=0;o<a;++o)c+=e[o][n][1]||0;r[n][1]+=r[n][0]=-c/2}xc(e,t)}}function BX(e,t){if(!(!((o=e.length)>0)||!((i=(a=e[t[0]]).length)>0))){for(var n=0,r=1,a,i,o;r<i;++r){for(var c=0,d=0,f=0;c<o;++c){for(var h=e[t[c]],p=h[r][1]||0,x=h[r-1][1]||0,g=(p-x)/2,j=0;j<c;++j){var b=e[t[j]],y=b[r][1]||0,S=b[r-1][1]||0;g+=y-S}d+=p,f+=g*p}a[r-1][1]+=a[r-1][0]=n,d&&(n-=f/d)}a[r-1][1]+=a[r-1][0]=n,xc(e,t)}}function Ed(e){"@babel/helpers - typeof";return Ed=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},Ed(e)}var zX=["type","size","sizeType"];function v1(){return v1=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},v1.apply(this,arguments)}function Kk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Gk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Kk(Object(n),!0).forEach(function(r){UX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function UX(e,t,n){return t=qX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qX(e){var t=WX(e,"string");return Ed(t)=="symbol"?t:t+""}function WX(e,t){if(Ed(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ed(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function VX(e,t){if(e==null)return{};var n=HX(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function HX(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 u5={symbolCircle:kN,symbolCross:pX,symbolDiamond:mX,symbolSquare:vX,symbolStar:bX,symbolTriangle:wX,symbolWye:SX},KX=Math.PI/180,GX=function(t){var n="symbol".concat(Cv(t));return u5[n]||kN},YX=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 a=18*KX;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),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}},XX=function(t,n){u5["symbol".concat(Cv(t))]=n},ON=function(t){var n=t.type,r=n===void 0?"circle":n,a=t.size,i=a===void 0?64:a,o=t.sizeType,c=o===void 0?"area":o,d=VX(t,zX),f=Gk(Gk({},d),{},{type:r,size:i,sizeType:c}),h=function(){var y=GX(r),S=NX().type(y).size(YX(i,c,r));return S()},p=f.className,x=f.cx,g=f.cy,j=gt(f,!0);return x===+x&&g===+g&&i===+i?W.createElement("path",v1({},j,{className:_t("recharts-symbols",p),transform:"translate(".concat(x,", ").concat(g,")"),d:h()})):null};ON.registerSymbol=XX;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 g1(){return g1=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},g1.apply(this,arguments)}function Yk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function QX(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Yk(Object(n),!0).forEach(function(r){Pd(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function JX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZX(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,f5(r.key),r)}}function eQ(e,t,n){return t&&ZX(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function tQ(e,t,n){return t=qh(t),nQ(e,d5()?Reflect.construct(t,n||[],qh(e).constructor):t.apply(e,n))}function nQ(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 rQ(e)}function rQ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(d5=function(){return!!e})()}function qh(e){return qh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},qh(e)}function aQ(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,a){return r.__proto__=a,r},x1(e,t)}function Pd(e,t,n){return t=f5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f5(e){var t=sQ(e,"string");return yc(t)=="symbol"?t:t+""}function sQ(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 xa=32,TN=(function(e){function t(){return JX(this,t),tQ(this,t,arguments)}return aQ(t,e),eQ(t,[{key:"renderIcon",value:function(r){var a=this.props.inactiveColor,i=xa/2,o=xa/6,c=xa/3,d=r.inactive?a:r.color;if(r.type==="plainline")return W.createElement("line",{strokeWidth:4,fill:"none",stroke:d,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:i,x2:xa,y2:i,className:"recharts-legend-icon"});if(r.type==="line")return W.createElement("path",{strokeWidth:4,fill:"none",stroke:d,d:"M0,".concat(i,"h").concat(c,`
57
- A`).concat(o,",").concat(o,",0,1,1,").concat(2*c,",").concat(i,`
58
- H`).concat(xa,"M").concat(2*c,",").concat(i,`
59
- A`).concat(o,",").concat(o,",0,1,1,").concat(c,",").concat(i),className:"recharts-legend-icon"});if(r.type==="rect")return W.createElement("path",{stroke:"none",fill:d,d:"M0,".concat(xa/8,"h").concat(xa,"v").concat(xa*3/4,"h").concat(-xa,"z"),className:"recharts-legend-icon"});if(W.isValidElement(r.legendIcon)){var f=QX({},r);return delete f.legendIcon,W.cloneElement(r.legendIcon,f)}return W.createElement(ON,{fill:d,cx:i,cy:i,size:xa,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,a=this.props,i=a.payload,o=a.iconSize,c=a.layout,d=a.formatter,f=a.inactiveColor,h={x:0,y:0,width:xa,height:xa},p={display:c==="horizontal"?"inline-block":"block",marginRight:10},x={display:"inline-block",verticalAlign:"middle",marginRight:4};return i.map(function(g,j){var b=g.formatter||d,y=_t(Pd(Pd({"recharts-legend-item":!0},"legend-item-".concat(j),!0),"inactive",g.inactive));if(g.type==="none")return null;var S=Ct(g.value)?null:g.value;Ys(!Ct(g.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var C=g.inactive?f:g.color;return W.createElement("li",g1({className:y,style:p,key:"legend-item-".concat(j)},Do(r.props,g,j)),W.createElement(u1,{width:o,height:o,viewBox:h,style:x},r.renderIcon(g)),W.createElement("span",{className:"recharts-legend-item-text",style:{color:C}},b?b(S,g,j):S))})}},{key:"render",value:function(){var r=this.props,a=r.payload,i=r.layout,o=r.align;if(!a||!a.length)return null;var c={padding:0,margin:0,textAlign:i==="horizontal"?o:"left"};return W.createElement("ul",{className:"recharts-default-legend",style:c},this.renderItems())}}])})(v.PureComponent);Pd(TN,"displayName","Legend");Pd(TN,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var qb,Xk;function iQ(){if(Xk)return qb;Xk=1;var e=jv();function t(){this.__data__=new e,this.size=0}return qb=t,qb}var Wb,Qk;function oQ(){if(Qk)return Wb;Qk=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return Wb=e,Wb}var Vb,Jk;function lQ(){if(Jk)return Vb;Jk=1;function e(t){return this.__data__.get(t)}return Vb=e,Vb}var Hb,Zk;function cQ(){if(Zk)return Hb;Zk=1;function e(t){return this.__data__.has(t)}return Hb=e,Hb}var Kb,eO;function uQ(){if(eO)return Kb;eO=1;var e=jv(),t=jN(),n=SN(),r=200;function a(i,o){var c=this.__data__;if(c instanceof e){var d=c.__data__;if(!t||d.length<r-1)return d.push([i,o]),this.size=++c.size,this;c=this.__data__=new n(d)}return c.set(i,o),this.size=c.size,this}return Kb=a,Kb}var Gb,tO;function p5(){if(tO)return Gb;tO=1;var e=jv(),t=iQ(),n=oQ(),r=lQ(),a=cQ(),i=uQ();function o(c){var d=this.__data__=new e(c);this.size=d.size}return o.prototype.clear=t,o.prototype.delete=n,o.prototype.get=r,o.prototype.has=a,o.prototype.set=i,Gb=o,Gb}var Yb,nO;function dQ(){if(nO)return Yb;nO=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return Yb=t,Yb}var Xb,rO;function fQ(){if(rO)return Xb;rO=1;function e(t){return this.__data__.has(t)}return Xb=e,Xb}var Qb,aO;function h5(){if(aO)return Qb;aO=1;var e=SN(),t=dQ(),n=fQ();function r(a){var i=-1,o=a==null?0:a.length;for(this.__data__=new e;++i<o;)this.add(a[i])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,Qb=r,Qb}var Jb,sO;function m5(){if(sO)return Jb;sO=1;function e(t,n){for(var r=-1,a=t==null?0:t.length;++r<a;)if(n(t[r],r,t))return!0;return!1}return Jb=e,Jb}var Zb,iO;function v5(){if(iO)return Zb;iO=1;function e(t,n){return t.has(n)}return Zb=e,Zb}var e0,oO;function g5(){if(oO)return e0;oO=1;var e=h5(),t=m5(),n=v5(),r=1,a=2;function i(o,c,d,f,h,p){var x=d&r,g=o.length,j=c.length;if(g!=j&&!(x&&j>g))return!1;var b=p.get(o),y=p.get(c);if(b&&y)return b==c&&y==o;var S=-1,C=!0,N=d&a?new e:void 0;for(p.set(o,c),p.set(c,o);++S<g;){var E=o[S],_=c[S];if(f)var P=x?f(_,E,S,c,o,p):f(E,_,S,o,c,p);if(P!==void 0){if(P)continue;C=!1;break}if(N){if(!t(c,function(O,T){if(!n(N,T)&&(E===O||h(E,O,d,f,p)))return N.push(T)})){C=!1;break}}else if(!(E===_||h(E,_,d,f,p))){C=!1;break}}return p.delete(o),p.delete(c),C}return e0=i,e0}var t0,lO;function pQ(){if(lO)return t0;lO=1;var e=As(),t=e.Uint8Array;return t0=t,t0}var n0,cO;function hQ(){if(cO)return n0;cO=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(a,i){r[++n]=[i,a]}),r}return n0=e,n0}var r0,uO;function RN(){if(uO)return r0;uO=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(a){r[++n]=a}),r}return r0=e,r0}var a0,dO;function mQ(){if(dO)return a0;dO=1;var e=Cf(),t=pQ(),n=wN(),r=g5(),a=hQ(),i=RN(),o=1,c=2,d="[object Boolean]",f="[object Date]",h="[object Error]",p="[object Map]",x="[object Number]",g="[object RegExp]",j="[object Set]",b="[object String]",y="[object Symbol]",S="[object ArrayBuffer]",C="[object DataView]",N=e?e.prototype:void 0,E=N?N.valueOf:void 0;function _(P,O,T,I,M,D,R){switch(T){case C:if(P.byteLength!=O.byteLength||P.byteOffset!=O.byteOffset)return!1;P=P.buffer,O=O.buffer;case S:return!(P.byteLength!=O.byteLength||!D(new t(P),new t(O)));case d:case f:case x:return n(+P,+O);case h:return P.name==O.name&&P.message==O.message;case g:case b:return P==O+"";case p:var q=a;case j:var U=I&o;if(q||(q=i),P.size!=O.size&&!U)return!1;var H=R.get(P);if(H)return H==O;I|=c,R.set(P,O);var J=r(q(P),q(O),I,M,D,R);return R.delete(P),J;case y:if(E)return E.call(P)==E.call(O)}return!1}return a0=_,a0}var s0,fO;function x5(){if(fO)return s0;fO=1;function e(t,n){for(var r=-1,a=n.length,i=t.length;++r<a;)t[i+r]=n[r];return t}return s0=e,s0}var i0,pO;function vQ(){if(pO)return i0;pO=1;var e=x5(),t=Br();function n(r,a,i){var o=a(r);return t(r)?o:e(o,i(r))}return i0=n,i0}var o0,hO;function gQ(){if(hO)return o0;hO=1;function e(t,n){for(var r=-1,a=t==null?0:t.length,i=0,o=[];++r<a;){var c=t[r];n(c,r,t)&&(o[i++]=c)}return o}return o0=e,o0}var l0,mO;function xQ(){if(mO)return l0;mO=1;function e(){return[]}return l0=e,l0}var c0,vO;function yQ(){if(vO)return c0;vO=1;var e=gQ(),t=xQ(),n=Object.prototype,r=n.propertyIsEnumerable,a=Object.getOwnPropertySymbols,i=a?function(o){return o==null?[]:(o=Object(o),e(a(o),function(c){return r.call(o,c)}))}:t;return c0=i,c0}var u0,gO;function bQ(){if(gO)return u0;gO=1;function e(t,n){for(var r=-1,a=Array(t);++r<t;)a[r]=n(r);return a}return u0=e,u0}var d0,xO;function wQ(){if(xO)return d0;xO=1;var e=ai(),t=si(),n="[object Arguments]";function r(a){return t(a)&&e(a)==n}return d0=r,d0}var f0,yO;function IN(){if(yO)return f0;yO=1;var e=wQ(),t=si(),n=Object.prototype,r=n.hasOwnProperty,a=n.propertyIsEnumerable,i=e((function(){return arguments})())?e:function(o){return t(o)&&r.call(o,"callee")&&!a.call(o,"callee")};return f0=i,f0}var id={exports:{}},p0,bO;function jQ(){if(bO)return p0;bO=1;function e(){return!1}return p0=e,p0}id.exports;var wO;function y5(){return wO||(wO=1,(function(e,t){var n=As(),r=jQ(),a=t&&!t.nodeType&&t,i=a&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===a,c=o?n.Buffer:void 0,d=c?c.isBuffer:void 0,f=d||r;e.exports=f})(id,id.exports)),id.exports}var h0,jO;function MN(){if(jO)return h0;jO=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,a){var i=typeof r;return a=a??e,!!a&&(i=="number"||i!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<a}return h0=n,h0}var m0,SO;function $N(){if(SO)return m0;SO=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return m0=t,m0}var v0,NO;function SQ(){if(NO)return v0;NO=1;var e=ai(),t=$N(),n=si(),r="[object Arguments]",a="[object Array]",i="[object Boolean]",o="[object Date]",c="[object Error]",d="[object Function]",f="[object Map]",h="[object Number]",p="[object Object]",x="[object RegExp]",g="[object Set]",j="[object String]",b="[object WeakMap]",y="[object ArrayBuffer]",S="[object DataView]",C="[object Float32Array]",N="[object Float64Array]",E="[object Int8Array]",_="[object Int16Array]",P="[object Int32Array]",O="[object Uint8Array]",T="[object Uint8ClampedArray]",I="[object Uint16Array]",M="[object Uint32Array]",D={};D[C]=D[N]=D[E]=D[_]=D[P]=D[O]=D[T]=D[I]=D[M]=!0,D[r]=D[a]=D[y]=D[i]=D[S]=D[o]=D[c]=D[d]=D[f]=D[h]=D[p]=D[x]=D[g]=D[j]=D[b]=!1;function R(q){return n(q)&&t(q.length)&&!!D[e(q)]}return v0=R,v0}var g0,CO;function b5(){if(CO)return g0;CO=1;function e(t){return function(n){return t(n)}}return g0=e,g0}var od={exports:{}};od.exports;var AO;function NQ(){return AO||(AO=1,(function(e,t){var n=B3(),r=t&&!t.nodeType&&t,a=r&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===r,o=i&&n.process,c=(function(){try{var d=a&&a.require&&a.require("util").types;return d||o&&o.binding&&o.binding("util")}catch{}})();e.exports=c})(od,od.exports)),od.exports}var x0,_O;function w5(){if(_O)return x0;_O=1;var e=SQ(),t=b5(),n=NQ(),r=n&&n.isTypedArray,a=r?t(r):e;return x0=a,x0}var y0,EO;function CQ(){if(EO)return y0;EO=1;var e=bQ(),t=IN(),n=Br(),r=y5(),a=MN(),i=w5(),o=Object.prototype,c=o.hasOwnProperty;function d(f,h){var p=n(f),x=!p&&t(f),g=!p&&!x&&r(f),j=!p&&!x&&!g&&i(f),b=p||x||g||j,y=b?e(f.length,String):[],S=y.length;for(var C in f)(h||c.call(f,C))&&!(b&&(C=="length"||g&&(C=="offset"||C=="parent")||j&&(C=="buffer"||C=="byteLength"||C=="byteOffset")||a(C,S)))&&y.push(C);return y}return y0=d,y0}var b0,PO;function AQ(){if(PO)return b0;PO=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,a=typeof r=="function"&&r.prototype||e;return n===a}return b0=t,b0}var w0,kO;function j5(){if(kO)return w0;kO=1;function e(t,n){return function(r){return t(n(r))}}return w0=e,w0}var j0,OO;function _Q(){if(OO)return j0;OO=1;var e=j5(),t=e(Object.keys,Object);return j0=t,j0}var S0,TO;function EQ(){if(TO)return S0;TO=1;var e=AQ(),t=_Q(),n=Object.prototype,r=n.hasOwnProperty;function a(i){if(!e(i))return t(i);var o=[];for(var c in Object(i))r.call(i,c)&&c!="constructor"&&o.push(c);return o}return S0=a,S0}var N0,RO;function _f(){if(RO)return N0;RO=1;var e=bN(),t=$N();function n(r){return r!=null&&t(r.length)&&!e(r)}return N0=n,N0}var C0,IO;function Pv(){if(IO)return C0;IO=1;var e=CQ(),t=EQ(),n=_f();function r(a){return n(a)?e(a):t(a)}return C0=r,C0}var A0,MO;function PQ(){if(MO)return A0;MO=1;var e=vQ(),t=yQ(),n=Pv();function r(a){return e(a,n,t)}return A0=r,A0}var _0,$O;function kQ(){if($O)return _0;$O=1;var e=PQ(),t=1,n=Object.prototype,r=n.hasOwnProperty;function a(i,o,c,d,f,h){var p=c&t,x=e(i),g=x.length,j=e(o),b=j.length;if(g!=b&&!p)return!1;for(var y=g;y--;){var S=x[y];if(!(p?S in o:r.call(o,S)))return!1}var C=h.get(i),N=h.get(o);if(C&&N)return C==o&&N==i;var E=!0;h.set(i,o),h.set(o,i);for(var _=p;++y<g;){S=x[y];var P=i[S],O=o[S];if(d)var T=p?d(O,P,S,o,i,h):d(P,O,S,i,o,h);if(!(T===void 0?P===O||f(P,O,c,d,h):T)){E=!1;break}_||(_=S=="constructor")}if(E&&!_){var I=i.constructor,M=o.constructor;I!=M&&"constructor"in i&&"constructor"in o&&!(typeof I=="function"&&I instanceof I&&typeof M=="function"&&M instanceof M)&&(E=!1)}return h.delete(i),h.delete(o),E}return _0=a,_0}var E0,DO;function OQ(){if(DO)return E0;DO=1;var e=el(),t=As(),n=e(t,"DataView");return E0=n,E0}var P0,LO;function TQ(){if(LO)return P0;LO=1;var e=el(),t=As(),n=e(t,"Promise");return P0=n,P0}var k0,FO;function S5(){if(FO)return k0;FO=1;var e=el(),t=As(),n=e(t,"Set");return k0=n,k0}var O0,BO;function RQ(){if(BO)return O0;BO=1;var e=el(),t=As(),n=e(t,"WeakMap");return O0=n,O0}var T0,zO;function IQ(){if(zO)return T0;zO=1;var e=OQ(),t=jN(),n=TQ(),r=S5(),a=RQ(),i=ai(),o=z3(),c="[object Map]",d="[object Object]",f="[object Promise]",h="[object Set]",p="[object WeakMap]",x="[object DataView]",g=o(e),j=o(t),b=o(n),y=o(r),S=o(a),C=i;return(e&&C(new e(new ArrayBuffer(1)))!=x||t&&C(new t)!=c||n&&C(n.resolve())!=f||r&&C(new r)!=h||a&&C(new a)!=p)&&(C=function(N){var E=i(N),_=E==d?N.constructor:void 0,P=_?o(_):"";if(P)switch(P){case g:return x;case j:return c;case b:return f;case y:return h;case S:return p}return E}),T0=C,T0}var R0,UO;function MQ(){if(UO)return R0;UO=1;var e=p5(),t=g5(),n=mQ(),r=kQ(),a=IQ(),i=Br(),o=y5(),c=w5(),d=1,f="[object Arguments]",h="[object Array]",p="[object Object]",x=Object.prototype,g=x.hasOwnProperty;function j(b,y,S,C,N,E){var _=i(b),P=i(y),O=_?h:a(b),T=P?h:a(y);O=O==f?p:O,T=T==f?p:T;var I=O==p,M=T==p,D=O==T;if(D&&o(b)){if(!o(y))return!1;_=!0,I=!1}if(D&&!I)return E||(E=new e),_||c(b)?t(b,y,S,C,N,E):n(b,y,O,S,C,N,E);if(!(S&d)){var R=I&&g.call(b,"__wrapped__"),q=M&&g.call(y,"__wrapped__");if(R||q){var U=R?b.value():b,H=q?y.value():y;return E||(E=new e),N(U,H,S,C,E)}}return D?(E||(E=new e),r(b,y,S,C,N,E)):!1}return R0=j,R0}var I0,qO;function DN(){if(qO)return I0;qO=1;var e=MQ(),t=si();function n(r,a,i,o,c){return r===a?!0:r==null||a==null||!t(r)&&!t(a)?r!==r&&a!==a:e(r,a,i,o,n,c)}return I0=n,I0}var M0,WO;function $Q(){if(WO)return M0;WO=1;var e=p5(),t=DN(),n=1,r=2;function a(i,o,c,d){var f=c.length,h=f,p=!d;if(i==null)return!h;for(i=Object(i);f--;){var x=c[f];if(p&&x[2]?x[1]!==i[x[0]]:!(x[0]in i))return!1}for(;++f<h;){x=c[f];var g=x[0],j=i[g],b=x[1];if(p&&x[2]){if(j===void 0&&!(g in i))return!1}else{var y=new e;if(d)var S=d(j,b,g,i,o,y);if(!(S===void 0?t(b,j,n|r,d,y):S))return!1}}return!0}return M0=a,M0}var $0,VO;function N5(){if(VO)return $0;VO=1;var e=Qi();function t(n){return n===n&&!e(n)}return $0=t,$0}var D0,HO;function DQ(){if(HO)return D0;HO=1;var e=N5(),t=Pv();function n(r){for(var a=t(r),i=a.length;i--;){var o=a[i],c=r[o];a[i]=[o,c,e(c)]}return a}return D0=n,D0}var L0,KO;function C5(){if(KO)return L0;KO=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return L0=e,L0}var F0,GO;function LQ(){if(GO)return F0;GO=1;var e=$Q(),t=DQ(),n=C5();function r(a){var i=t(a);return i.length==1&&i[0][2]?n(i[0][0],i[0][1]):function(o){return o===a||e(o,a,i)}}return F0=r,F0}var B0,YO;function FQ(){if(YO)return B0;YO=1;function e(t,n){return t!=null&&n in Object(t)}return B0=e,B0}var z0,XO;function BQ(){if(XO)return z0;XO=1;var e=W3(),t=IN(),n=Br(),r=MN(),a=$N(),i=Nv();function o(c,d,f){d=e(d,c);for(var h=-1,p=d.length,x=!1;++h<p;){var g=i(d[h]);if(!(x=c!=null&&f(c,g)))break;c=c[g]}return x||++h!=p?x:(p=c==null?0:c.length,!!p&&a(p)&&r(g,p)&&(n(c)||t(c)))}return z0=o,z0}var U0,QO;function zQ(){if(QO)return U0;QO=1;var e=FQ(),t=BQ();function n(r,a){return r!=null&&t(r,a,e)}return U0=n,U0}var q0,JO;function UQ(){if(JO)return q0;JO=1;var e=DN(),t=V3(),n=zQ(),r=yN(),a=N5(),i=C5(),o=Nv(),c=1,d=2;function f(h,p){return r(h)&&a(p)?i(o(h),p):function(x){var g=t(x,h);return g===void 0&&g===p?n(x,h):e(p,g,c|d)}}return q0=f,q0}var W0,ZO;function su(){if(ZO)return W0;ZO=1;function e(t){return t}return W0=e,W0}var V0,eT;function qQ(){if(eT)return V0;eT=1;function e(t){return function(n){return n?.[t]}}return V0=e,V0}var H0,tT;function WQ(){if(tT)return H0;tT=1;var e=CN();function t(n){return function(r){return e(r,n)}}return H0=t,H0}var K0,nT;function VQ(){if(nT)return K0;nT=1;var e=qQ(),t=WQ(),n=yN(),r=Nv();function a(i){return n(i)?e(r(i)):t(i)}return K0=a,K0}var G0,rT;function _s(){if(rT)return G0;rT=1;var e=LQ(),t=UQ(),n=su(),r=Br(),a=VQ();function i(o){return typeof o=="function"?o:o==null?n:typeof o=="object"?r(o)?t(o[0],o[1]):e(o):a(o)}return G0=i,G0}var Y0,aT;function A5(){if(aT)return Y0;aT=1;function e(t,n,r,a){for(var i=t.length,o=r+(a?1:-1);a?o--:++o<i;)if(n(t[o],o,t))return o;return-1}return Y0=e,Y0}var X0,sT;function HQ(){if(sT)return X0;sT=1;function e(t){return t!==t}return X0=e,X0}var Q0,iT;function KQ(){if(iT)return Q0;iT=1;function e(t,n,r){for(var a=r-1,i=t.length;++a<i;)if(t[a]===n)return a;return-1}return Q0=e,Q0}var J0,oT;function GQ(){if(oT)return J0;oT=1;var e=A5(),t=HQ(),n=KQ();function r(a,i,o){return i===i?n(a,i,o):e(a,t,o)}return J0=r,J0}var Z0,lT;function YQ(){if(lT)return Z0;lT=1;var e=GQ();function t(n,r){var a=n==null?0:n.length;return!!a&&e(n,r,0)>-1}return Z0=t,Z0}var ew,cT;function XQ(){if(cT)return ew;cT=1;function e(t,n,r){for(var a=-1,i=t==null?0:t.length;++a<i;)if(r(n,t[a]))return!0;return!1}return ew=e,ew}var tw,uT;function QQ(){if(uT)return tw;uT=1;function e(){}return tw=e,tw}var nw,dT;function JQ(){if(dT)return nw;dT=1;var e=S5(),t=QQ(),n=RN(),r=1/0,a=e&&1/n(new e([,-0]))[1]==r?function(i){return new e(i)}:t;return nw=a,nw}var rw,fT;function ZQ(){if(fT)return rw;fT=1;var e=h5(),t=YQ(),n=XQ(),r=v5(),a=JQ(),i=RN(),o=200;function c(d,f,h){var p=-1,x=t,g=d.length,j=!0,b=[],y=b;if(h)j=!1,x=n;else if(g>=o){var S=f?null:a(d);if(S)return i(S);j=!1,x=r,y=new e}else y=f?[]:b;e:for(;++p<g;){var C=d[p],N=f?f(C):C;if(C=h||C!==0?C:0,j&&N===N){for(var E=y.length;E--;)if(y[E]===N)continue e;f&&y.push(N),b.push(C)}else x(y,N,h)||(y!==b&&y.push(N),b.push(C))}return b}return rw=c,rw}var aw,pT;function eJ(){if(pT)return aw;pT=1;var e=_s(),t=ZQ();function n(r,a){return r&&r.length?t(r,e(a,2)):[]}return aw=n,aw}var tJ=eJ();const hT=Yt(tJ);function _5(e,t,n){return t===!0?hT(e,n):Ct(t)?hT(e,t):e}function bc(e){"@babel/helpers - typeof";return bc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bc(e)}var nJ=["ref"];function mT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Bs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mT(Object(n),!0).forEach(function(r){kv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vT(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,P5(r.key),r)}}function aJ(e,t,n){return t&&vT(e.prototype,t),n&&vT(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function sJ(e,t,n){return t=Wh(t),iJ(e,E5()?Reflect.construct(t,n||[],Wh(e).constructor):t.apply(e,n))}function iJ(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 oJ(e)}function oJ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(E5=function(){return!!e})()}function Wh(e){return Wh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Wh(e)}function lJ(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&&y1(e,t)}function y1(e,t){return y1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},y1(e,t)}function kv(e,t,n){return t=P5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P5(e){var t=cJ(e,"string");return bc(t)=="symbol"?t:t+""}function cJ(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 String(e)}function uJ(e,t){if(e==null)return{};var n=dJ(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function dJ(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 fJ(e){return e.value}function pJ(e,t){if(W.isValidElement(e))return W.cloneElement(e,t);if(typeof e=="function")return W.createElement(e,t);t.ref;var n=uJ(t,nJ);return W.createElement(TN,n)}var gT=1,ko=(function(e){function t(){var n;rJ(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=sJ(this,t,[].concat(a)),kv(n,"lastBoundingBox",{width:-1,height:-1}),n}return lJ(t,e),aJ(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,a=this.getBBox();a?(Math.abs(a.width-this.lastBoundingBox.width)>gT||Math.abs(a.height-this.lastBoundingBox.height)>gT)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,r&&r(a)):(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?Bs({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var a=this.props,i=a.layout,o=a.align,c=a.verticalAlign,d=a.margin,f=a.chartWidth,h=a.chartHeight,p,x;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(o==="center"&&i==="vertical"){var g=this.getBBoxSnapshot();p={left:((f||0)-g.width)/2}}else p=o==="right"?{right:d&&d.right||0}:{left:d&&d.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(c==="middle"){var j=this.getBBoxSnapshot();x={top:((h||0)-j.height)/2}}else x=c==="bottom"?{bottom:d&&d.bottom||0}:{top:d&&d.top||0};return Bs(Bs({},p),x)}},{key:"render",value:function(){var r=this,a=this.props,i=a.content,o=a.width,c=a.height,d=a.wrapperStyle,f=a.payloadUniqBy,h=a.payload,p=Bs(Bs({position:"absolute",width:o||"auto",height:c||"auto"},this.getDefaultPosition(d)),d);return W.createElement("div",{className:"recharts-legend-wrapper",style:p,ref:function(g){r.wrapperNode=g}},pJ(i,Bs(Bs({},this.props),{},{payload:_5(h,f,fJ)})))}}],[{key:"getWithHeight",value:function(r,a){var i=Bs(Bs({},this.defaultProps),r.props),o=i.layout;return o==="vertical"&&We(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||a}:null}}])})(v.PureComponent);kv(ko,"displayName","Legend");kv(ko,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var sw,xT;function hJ(){if(xT)return sw;xT=1;var e=Cf(),t=IN(),n=Br(),r=e?e.isConcatSpreadable:void 0;function a(i){return n(i)||t(i)||!!(r&&i&&i[r])}return sw=a,sw}var iw,yT;function k5(){if(yT)return iw;yT=1;var e=x5(),t=hJ();function n(r,a,i,o,c){var d=-1,f=r.length;for(i||(i=t),c||(c=[]);++d<f;){var h=r[d];a>0&&i(h)?a>1?n(h,a-1,i,o,c):e(c,h):o||(c[c.length]=h)}return c}return iw=n,iw}var ow,bT;function mJ(){if(bT)return ow;bT=1;function e(t){return function(n,r,a){for(var i=-1,o=Object(n),c=a(n),d=c.length;d--;){var f=c[t?d:++i];if(r(o[f],f,o)===!1)break}return n}}return ow=e,ow}var lw,wT;function vJ(){if(wT)return lw;wT=1;var e=mJ(),t=e();return lw=t,lw}var cw,jT;function O5(){if(jT)return cw;jT=1;var e=vJ(),t=Pv();function n(r,a){return r&&e(r,a,t)}return cw=n,cw}var uw,ST;function gJ(){if(ST)return uw;ST=1;var e=_f();function t(n,r){return function(a,i){if(a==null)return a;if(!e(a))return n(a,i);for(var o=a.length,c=r?o:-1,d=Object(a);(r?c--:++c<o)&&i(d[c],c,d)!==!1;);return a}}return uw=t,uw}var dw,NT;function LN(){if(NT)return dw;NT=1;var e=O5(),t=gJ(),n=t(e);return dw=n,dw}var fw,CT;function T5(){if(CT)return fw;CT=1;var e=LN(),t=_f();function n(r,a){var i=-1,o=t(r)?Array(r.length):[];return e(r,function(c,d,f){o[++i]=a(c,d,f)}),o}return fw=n,fw}var pw,AT;function xJ(){if(AT)return pw;AT=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return pw=e,pw}var hw,_T;function yJ(){if(_T)return hw;_T=1;var e=nu();function t(n,r){if(n!==r){var a=n!==void 0,i=n===null,o=n===n,c=e(n),d=r!==void 0,f=r===null,h=r===r,p=e(r);if(!f&&!p&&!c&&n>r||c&&d&&h&&!f&&!p||i&&d&&h||!a&&h||!o)return 1;if(!i&&!c&&!p&&n<r||p&&a&&o&&!i&&!c||f&&a&&o||!d&&o||!h)return-1}return 0}return hw=t,hw}var mw,ET;function bJ(){if(ET)return mw;ET=1;var e=yJ();function t(n,r,a){for(var i=-1,o=n.criteria,c=r.criteria,d=o.length,f=a.length;++i<d;){var h=e(o[i],c[i]);if(h){if(i>=f)return h;var p=a[i];return h*(p=="desc"?-1:1)}}return n.index-r.index}return mw=t,mw}var vw,PT;function wJ(){if(PT)return vw;PT=1;var e=NN(),t=CN(),n=_s(),r=T5(),a=xJ(),i=b5(),o=bJ(),c=su(),d=Br();function f(h,p,x){p.length?p=e(p,function(b){return d(b)?function(y){return t(y,b.length===1?b[0]:b)}:b}):p=[c];var g=-1;p=e(p,i(n));var j=r(h,function(b,y,S){var C=e(p,function(N){return N(b)});return{criteria:C,index:++g,value:b}});return a(j,function(b,y){return o(b,y,x)})}return vw=f,vw}var gw,kT;function jJ(){if(kT)return gw;kT=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 gw=e,gw}var xw,OT;function SJ(){if(OT)return xw;OT=1;var e=jJ(),t=Math.max;function n(r,a,i){return a=t(a===void 0?r.length-1:a,0),function(){for(var o=arguments,c=-1,d=t(o.length-a,0),f=Array(d);++c<d;)f[c]=o[a+c];c=-1;for(var h=Array(a+1);++c<a;)h[c]=o[c];return h[a]=i(f),e(r,this,h)}}return xw=n,xw}var yw,TT;function NJ(){if(TT)return yw;TT=1;function e(t){return function(){return t}}return yw=e,yw}var bw,RT;function R5(){if(RT)return bw;RT=1;var e=el(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return bw=t,bw}var ww,IT;function CJ(){if(IT)return ww;IT=1;var e=NJ(),t=R5(),n=su(),r=t?function(a,i){return t(a,"toString",{configurable:!0,enumerable:!1,value:e(i),writable:!0})}:n;return ww=r,ww}var jw,MT;function AJ(){if(MT)return jw;MT=1;var e=800,t=16,n=Date.now;function r(a){var i=0,o=0;return function(){var c=n(),d=t-(c-o);if(o=c,d>0){if(++i>=e)return arguments[0]}else i=0;return a.apply(void 0,arguments)}}return jw=r,jw}var Sw,$T;function _J(){if($T)return Sw;$T=1;var e=CJ(),t=AJ(),n=t(e);return Sw=n,Sw}var Nw,DT;function EJ(){if(DT)return Nw;DT=1;var e=su(),t=SJ(),n=_J();function r(a,i){return n(t(a,i,e),a+"")}return Nw=r,Nw}var Cw,LT;function Ov(){if(LT)return Cw;LT=1;var e=wN(),t=_f(),n=MN(),r=Qi();function a(i,o,c){if(!r(c))return!1;var d=typeof o;return(d=="number"?t(c)&&n(o,c.length):d=="string"&&o in c)?e(c[o],i):!1}return Cw=a,Cw}var Aw,FT;function PJ(){if(FT)return Aw;FT=1;var e=k5(),t=wJ(),n=EJ(),r=Ov(),a=n(function(i,o){if(i==null)return[];var c=o.length;return c>1&&r(i,o[0],o[1])?o=[]:c>2&&r(o[0],o[1],o[2])&&(o=[o[0]]),t(i,e(o,1),[])});return Aw=a,Aw}var kJ=PJ();const FN=Yt(kJ);function kd(e){"@babel/helpers - typeof";return kd=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},kd(e)}function b1(){return b1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},b1.apply(this,arguments)}function OJ(e,t){return MJ(e)||IJ(e,t)||RJ(e,t)||TJ()}function TJ(){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 RJ(e,t){if(e){if(typeof e=="string")return BT(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 BT(e,t)}}function BT(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 IJ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function MJ(e){if(Array.isArray(e))return e}function zT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function _w(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zT(Object(n),!0).forEach(function(r){$J(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $J(e,t,n){return t=DJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DJ(e){var t=LJ(e,"string");return kd(t)=="symbol"?t:t+""}function LJ(e,t){if(kd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(kd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function FJ(e){return Array.isArray(e)&&Wn(e[0])&&Wn(e[1])?e.join(" ~ "):e}var BJ=function(t){var n=t.separator,r=n===void 0?" : ":n,a=t.contentStyle,i=a===void 0?{}:a,o=t.itemStyle,c=o===void 0?{}:o,d=t.labelStyle,f=d===void 0?{}:d,h=t.payload,p=t.formatter,x=t.itemSorter,g=t.wrapperClassName,j=t.labelClassName,b=t.label,y=t.labelFormatter,S=t.accessibilityLayer,C=S===void 0?!1:S,N=function(){if(h&&h.length){var R={padding:0,margin:0},q=(x?FN(h,x):h).map(function(U,H){if(U.type==="none")return null;var J=_w({display:"block",paddingTop:4,paddingBottom:4,color:U.color||"#000"},c),Z=U.formatter||p||FJ,F=U.value,z=U.name,ee=F,B=z;if(Z&&ee!=null&&B!=null){var L=Z(F,z,U,H,h);if(Array.isArray(L)){var te=OJ(L,2);ee=te[0],B=te[1]}else ee=L}return W.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(H),style:J},Wn(B)?W.createElement("span",{className:"recharts-tooltip-item-name"},B):null,Wn(B)?W.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,W.createElement("span",{className:"recharts-tooltip-item-value"},ee),W.createElement("span",{className:"recharts-tooltip-item-unit"},U.unit||""))});return W.createElement("ul",{className:"recharts-tooltip-item-list",style:R},q)}return null},E=_w({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),_=_w({margin:0},f),P=!At(b),O=P?b:"",T=_t("recharts-default-tooltip",g),I=_t("recharts-tooltip-label",j);P&&y&&h!==void 0&&h!==null&&(O=y(b,h));var M=C?{role:"status","aria-live":"assertive"}:{};return W.createElement("div",b1({className:T,style:E},M),W.createElement("p",{className:I,style:_},W.isValidElement(O)?O:"".concat(O)),N())};function Od(e){"@babel/helpers - typeof";return Od=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},Od(e)}function rh(e,t,n){return t=zJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zJ(e){var t=UJ(e,"string");return Od(t)=="symbol"?t:t+""}function UJ(e,t){if(Od(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Od(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Yu="recharts-tooltip-wrapper",qJ={visibility:"hidden"};function WJ(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return _t(Yu,rh(rh(rh(rh({},"".concat(Yu,"-right"),We(n)&&t&&We(t.x)&&n>=t.x),"".concat(Yu,"-left"),We(n)&&t&&We(t.x)&&n<t.x),"".concat(Yu,"-bottom"),We(r)&&t&&We(t.y)&&r>=t.y),"".concat(Yu,"-top"),We(r)&&t&&We(t.y)&&r<t.y))}function UT(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,a=e.offsetTopLeft,i=e.position,o=e.reverseDirection,c=e.tooltipDimension,d=e.viewBox,f=e.viewBoxDimension;if(i&&We(i[r]))return i[r];var h=n[r]-c-a,p=n[r]+a;if(t[r])return o[r]?h:p;if(o[r]){var x=h,g=d[r];return x<g?Math.max(p,d[r]):Math.max(h,d[r])}var j=p+c,b=d[r]+f;return j>b?Math.max(h,d[r]):Math.max(p,d[r])}function VJ(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 HJ(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,a=e.position,i=e.reverseDirection,o=e.tooltipBox,c=e.useTranslate3d,d=e.viewBox,f,h,p;return o.height>0&&o.width>0&&n?(h=UT({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:a,reverseDirection:i,tooltipDimension:o.width,viewBox:d,viewBoxDimension:d.width}),p=UT({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:a,reverseDirection:i,tooltipDimension:o.height,viewBox:d,viewBoxDimension:d.height}),f=VJ({translateX:h,translateY:p,useTranslate3d:c})):f=qJ,{cssProperties:f,cssClasses:WJ({translateX:h,translateY:p,coordinate:n})}}function wc(e){"@babel/helpers - typeof";return wc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wc(e)}function qT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function WT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qT(Object(n),!0).forEach(function(r){j1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qT(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 GJ(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,M5(r.key),r)}}function YJ(e,t,n){return t&&GJ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function XJ(e,t,n){return t=Vh(t),QJ(e,I5()?Reflect.construct(t,n||[],Vh(e).constructor):t.apply(e,n))}function QJ(e,t){if(t&&(wc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return JJ(e)}function JJ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function I5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(I5=function(){return!!e})()}function Vh(e){return Vh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Vh(e)}function ZJ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&w1(e,t)}function w1(e,t){return w1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},w1(e,t)}function j1(e,t,n){return t=M5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M5(e){var t=eZ(e,"string");return wc(t)=="symbol"?t:t+""}function eZ(e,t){if(wc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(wc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var VT=1,tZ=(function(e){function t(){var n;KJ(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=XJ(this,t,[].concat(a)),j1(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),j1(n,"handleKeyDown",function(o){if(o.key==="Escape"){var c,d,f,h;n.setState({dismissed:!0,dismissedAtCoordinate:{x:(c=(d=n.props.coordinate)===null||d===void 0?void 0:d.x)!==null&&c!==void 0?c:0,y:(f=(h=n.props.coordinate)===null||h===void 0?void 0:h.y)!==null&&f!==void 0?f:0}})}}),n}return ZJ(t,e),YJ(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>VT||Math.abs(r.height-this.state.lastBoundingBox.height)>VT)&&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,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,a=this.props,i=a.active,o=a.allowEscapeViewBox,c=a.animationDuration,d=a.animationEasing,f=a.children,h=a.coordinate,p=a.hasPayload,x=a.isAnimationActive,g=a.offset,j=a.position,b=a.reverseDirection,y=a.useTranslate3d,S=a.viewBox,C=a.wrapperStyle,N=HJ({allowEscapeViewBox:o,coordinate:h,offsetTopLeft:g,position:j,reverseDirection:b,tooltipBox:this.state.lastBoundingBox,useTranslate3d:y,viewBox:S}),E=N.cssClasses,_=N.cssProperties,P=WT(WT({transition:x&&i?"transform ".concat(c,"ms ").concat(d):void 0},_),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&p?"visible":"hidden",position:"absolute",top:0,left:0},C);return W.createElement("div",{tabIndex:-1,className:E,style:P,ref:function(T){r.wrapperNode=T}},f)}}])})(v.PureComponent),nZ=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},tl={isSsr:nZ()};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 HT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function KT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HT(Object(n),!0).forEach(function(r){BN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aZ(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,D5(r.key),r)}}function sZ(e,t,n){return t&&aZ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function iZ(e,t,n){return t=Hh(t),oZ(e,$5()?Reflect.construct(t,n||[],Hh(e).constructor):t.apply(e,n))}function oZ(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 lZ(e)}function lZ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($5=function(){return!!e})()}function Hh(e){return Hh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Hh(e)}function cZ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&S1(e,t)}function S1(e,t){return S1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},S1(e,t)}function BN(e,t,n){return t=D5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function D5(e){var t=uZ(e,"string");return jc(t)=="symbol"?t:t+""}function uZ(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 dZ(e){return e.dataKey}function fZ(e,t){return W.isValidElement(e)?W.cloneElement(e,t):typeof e=="function"?W.createElement(e,t):W.createElement(BJ,t)}var Mr=(function(e){function t(){return rZ(this,t),iZ(this,t,arguments)}return cZ(t,e),sZ(t,[{key:"render",value:function(){var r=this,a=this.props,i=a.active,o=a.allowEscapeViewBox,c=a.animationDuration,d=a.animationEasing,f=a.content,h=a.coordinate,p=a.filterNull,x=a.isAnimationActive,g=a.offset,j=a.payload,b=a.payloadUniqBy,y=a.position,S=a.reverseDirection,C=a.useTranslate3d,N=a.viewBox,E=a.wrapperStyle,_=j??[];p&&_.length&&(_=_5(j.filter(function(O){return O.value!=null&&(O.hide!==!0||r.props.includeHidden)}),b,dZ));var P=_.length>0;return W.createElement(tZ,{allowEscapeViewBox:o,animationDuration:c,animationEasing:d,isAnimationActive:x,active:i,coordinate:h,hasPayload:P,offset:g,position:y,reverseDirection:S,useTranslate3d:C,viewBox:N,wrapperStyle:E},fZ(f,KT(KT({},this.props),{},{payload:_})))}}])})(v.PureComponent);BN(Mr,"displayName","Tooltip");BN(Mr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!tl.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 Ew,GT;function pZ(){if(GT)return Ew;GT=1;var e=As(),t=function(){return e.Date.now()};return Ew=t,Ew}var Pw,YT;function hZ(){if(YT)return Pw;YT=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return Pw=t,Pw}var kw,XT;function mZ(){if(XT)return kw;XT=1;var e=hZ(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return kw=n,kw}var Ow,QT;function L5(){if(QT)return Ow;QT=1;var e=mZ(),t=Qi(),n=nu(),r=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,c=parseInt;function d(f){if(typeof f=="number")return f;if(n(f))return r;if(t(f)){var h=typeof f.valueOf=="function"?f.valueOf():f;f=t(h)?h+"":h}if(typeof f!="string")return f===0?f:+f;f=e(f);var p=i.test(f);return p||o.test(f)?c(f.slice(2),p?2:8):a.test(f)?r:+f}return Ow=d,Ow}var Tw,JT;function vZ(){if(JT)return Tw;JT=1;var e=Qi(),t=pZ(),n=L5(),r="Expected a function",a=Math.max,i=Math.min;function o(c,d,f){var h,p,x,g,j,b,y=0,S=!1,C=!1,N=!0;if(typeof c!="function")throw new TypeError(r);d=n(d)||0,e(f)&&(S=!!f.leading,C="maxWait"in f,x=C?a(n(f.maxWait)||0,d):x,N="trailing"in f?!!f.trailing:N);function E(q){var U=h,H=p;return h=p=void 0,y=q,g=c.apply(H,U),g}function _(q){return y=q,j=setTimeout(T,d),S?E(q):g}function P(q){var U=q-b,H=q-y,J=d-U;return C?i(J,x-H):J}function O(q){var U=q-b,H=q-y;return b===void 0||U>=d||U<0||C&&H>=x}function T(){var q=t();if(O(q))return I(q);j=setTimeout(T,P(q))}function I(q){return j=void 0,N&&h?E(q):(h=p=void 0,g)}function M(){j!==void 0&&clearTimeout(j),y=0,h=b=p=j=void 0}function D(){return j===void 0?g:I(t())}function R(){var q=t(),U=O(q);if(h=arguments,p=this,b=q,U){if(j===void 0)return _(b);if(C)return clearTimeout(j),j=setTimeout(T,d),E(b)}return j===void 0&&(j=setTimeout(T,d)),g}return R.cancel=M,R.flush=D,R}return Tw=o,Tw}var Rw,ZT;function gZ(){if(ZT)return Rw;ZT=1;var e=vZ(),t=Qi(),n="Expected a function";function r(a,i,o){var c=!0,d=!0;if(typeof a!="function")throw new TypeError(n);return t(o)&&(c="leading"in o?!!o.leading:c,d="trailing"in o?!!o.trailing:d),e(a,i,{leading:c,maxWait:i,trailing:d})}return Rw=r,Rw}var xZ=gZ();const F5=Yt(xZ);function Td(e){"@babel/helpers - typeof";return Td=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},Td(e)}function eR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ah(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eR(Object(n),!0).forEach(function(r){yZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yZ(e,t,n){return t=bZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bZ(e){var t=wZ(e,"string");return Td(t)=="symbol"?t:t+""}function wZ(e,t){if(Td(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Td(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function jZ(e,t){return AZ(e)||CZ(e,t)||NZ(e,t)||SZ()}function SZ(){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 NZ(e,t){if(e){if(typeof e=="string")return tR(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tR(e,t)}}function tR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function CZ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function AZ(e){if(Array.isArray(e))return e}var Kh=v.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,a=r===void 0?{width:-1,height:-1}:r,i=e.width,o=i===void 0?"100%":i,c=e.height,d=c===void 0?"100%":c,f=e.minWidth,h=f===void 0?0:f,p=e.minHeight,x=e.maxHeight,g=e.children,j=e.debounce,b=j===void 0?0:j,y=e.id,S=e.className,C=e.onResize,N=e.style,E=N===void 0?{}:N,_=v.useRef(null),P=v.useRef();P.current=C,v.useImperativeHandle(t,function(){return Object.defineProperty(_.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),_.current},configurable:!0})});var O=v.useState({containerWidth:a.width,containerHeight:a.height}),T=jZ(O,2),I=T[0],M=T[1],D=v.useCallback(function(q,U){M(function(H){var J=Math.round(q),Z=Math.round(U);return H.containerWidth===J&&H.containerHeight===Z?H:{containerWidth:J,containerHeight:Z}})},[]);v.useEffect(function(){var q=function(z){var ee,B=z[0].contentRect,L=B.width,te=B.height;D(L,te),(ee=P.current)===null||ee===void 0||ee.call(P,L,te)};b>0&&(q=F5(q,b,{trailing:!0,leading:!1}));var U=new ResizeObserver(q),H=_.current.getBoundingClientRect(),J=H.width,Z=H.height;return D(J,Z),U.observe(_.current),function(){U.disconnect()}},[D,b]);var R=v.useMemo(function(){var q=I.containerWidth,U=I.containerHeight;if(q<0||U<0)return null;Ys(Ao(o)||Ao(d),`The width(%s) and height(%s) are both fixed numbers,
62
- maybe you don't need to use a ResponsiveContainer.`,o,d),Ys(!n||n>0,"The aspect(%s) must be greater than zero.",n);var H=Ao(o)?q:o,J=Ao(d)?U:d;n&&n>0&&(H?J=H/n:J&&(H=J*n),x&&J>x&&(J=x)),Ys(H>0||J>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.`,H,J,o,d,h,p,n);var Z=!Array.isArray(g)&&Gs(g.type).endsWith("Chart");return W.Children.map(g,function(F){return W.isValidElement(F)?v.cloneElement(F,ah({width:H,height:J},Z?{style:ah({height:"100%",width:"100%",maxHeight:J,maxWidth:H},F.props.style)}:{})):F})},[n,g,d,x,p,h,I,o]);return W.createElement("div",{id:y?"".concat(y):void 0,className:_t("recharts-responsive-container",S),style:ah(ah({},E),{},{width:o,height:d,minWidth:h,minHeight:p,maxHeight:x}),ref:_},R)}),Tv=function(t){return null};Tv.displayName="Cell";function Rd(e){"@babel/helpers - typeof";return Rd=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},Rd(e)}function nR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function N1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nR(Object(n),!0).forEach(function(r){_Z(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _Z(e,t,n){return t=EZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EZ(e){var t=PZ(e,"string");return Rd(t)=="symbol"?t:t+""}function PZ(e,t){if(Rd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Rd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Fl={widthCache:{},cacheCount:0},kZ=2e3,OZ={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},rR="recharts_measurement_span";function TZ(e){var t=N1({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var pd=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||tl.isSsr)return{width:0,height:0};var r=TZ(n),a=JSON.stringify({text:t,copyStyle:r});if(Fl.widthCache[a])return Fl.widthCache[a];try{var i=document.getElementById(rR);i||(i=document.createElement("span"),i.setAttribute("id",rR),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var o=N1(N1({},OZ),r);Object.assign(i.style,o),i.textContent="".concat(t);var c=i.getBoundingClientRect(),d={width:c.width,height:c.height};return Fl.widthCache[a]=d,++Fl.cacheCount>kZ&&(Fl.cacheCount=0,Fl.widthCache={}),d}catch{return{width:0,height:0}}},RZ=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Id(e){"@babel/helpers - typeof";return Id=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},Id(e)}function Gh(e,t){return DZ(e)||$Z(e,t)||MZ(e,t)||IZ()}function IZ(){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 MZ(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 $Z(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;d=!1}else for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function DZ(e){if(Array.isArray(e))return e}function LZ(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,BZ(r.key),r)}}function FZ(e,t,n){return t&&sR(e.prototype,t),n&&sR(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function BZ(e){var t=zZ(e,"string");return Id(t)=="symbol"?t:t+""}function zZ(e,t){if(Id(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Id(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var iR=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,oR=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,UZ=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,qZ=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,B5={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},WZ=Object.keys(B5),Xl="NaN";function VZ(e,t){return e*B5[t]}var sh=(function(){function e(t,n){LZ(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!UZ.test(n)&&(this.num=NaN,this.unit=""),WZ.includes(n)&&(this.num=VZ(t,n),this.unit="px")}return FZ(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,a=(r=qZ.exec(n))!==null&&r!==void 0?r:[],i=Gh(a,3),o=i[1],c=i[2];return new e(parseFloat(o),c??"")}}])})();function z5(e){if(e.includes(Xl))return Xl;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=iR.exec(t))!==null&&n!==void 0?n:[],a=Gh(r,4),i=a[1],o=a[2],c=a[3],d=sh.parse(i??""),f=sh.parse(c??""),h=o==="*"?d.multiply(f):d.divide(f);if(h.isNaN())return Xl;t=t.replace(iR,h.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var p,x=(p=oR.exec(t))!==null&&p!==void 0?p:[],g=Gh(x,4),j=g[1],b=g[2],y=g[3],S=sh.parse(j??""),C=sh.parse(y??""),N=b==="+"?S.add(C):S.subtract(C);if(N.isNaN())return Xl;t=t.replace(oR,N.toString())}return t}var lR=/\(([^()]*)\)/;function HZ(e){for(var t=e;t.includes("(");){var n=lR.exec(t),r=Gh(n,2),a=r[1];t=t.replace(lR,z5(a))}return t}function KZ(e){var t=e.replace(/\s+/g,"");return t=HZ(t),t=z5(t),t}function GZ(e){try{return KZ(e)}catch{return Xl}}function Iw(e){var t=GZ(e.slice(5,-1));return t===Xl?"":t}var YZ=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],XZ=["dx","dy","angle","className","breakAll"];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 cR(e,t){if(e==null)return{};var n=QZ(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function QZ(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 uR(e,t){return tee(e)||eee(e,t)||ZZ(e,t)||JZ()}function JZ(){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 ZZ(e,t){if(e){if(typeof e=="string")return dR(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 dR(e,t)}}function dR(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 eee(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;d=!1}else for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function tee(e){if(Array.isArray(e))return e}var U5=/[ \f\n\r\t\v\u2028\u2029]+/,q5=function(t){var n=t.children,r=t.breakAll,a=t.style;try{var i=[];At(n)||(r?i=n.toString().split(""):i=n.toString().split(U5));var o=i.map(function(d){return{word:d,width:pd(d,a).width}}),c=r?0:pd(" ",a).width;return{wordsWithComputedWidth:o,spaceWidth:c}}catch{return null}},nee=function(t,n,r,a,i){var o=t.maxLines,c=t.children,d=t.style,f=t.breakAll,h=We(o),p=c,x=function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return H.reduce(function(J,Z){var F=Z.word,z=Z.width,ee=J[J.length-1];if(ee&&(a==null||i||ee.width+z+r<Number(a)))ee.words.push(F),ee.width+=z+r;else{var B={words:[F],width:z};J.push(B)}return J},[])},g=x(n),j=function(H){return H.reduce(function(J,Z){return J.width>Z.width?J:Z})};if(!h)return g;for(var b="…",y=function(H){var J=p.slice(0,H),Z=q5({breakAll:f,style:d,children:J+b}).wordsWithComputedWidth,F=x(Z),z=F.length>o||j(F).width>Number(a);return[z,F]},S=0,C=p.length-1,N=0,E;S<=C&&N<=p.length-1;){var _=Math.floor((S+C)/2),P=_-1,O=y(P),T=uR(O,2),I=T[0],M=T[1],D=y(_),R=uR(D,1),q=R[0];if(!I&&!q&&(S=_+1),I&&q&&(C=_-1),!I&&q){E=M;break}N++}return E||g},fR=function(t){var n=At(t)?[]:t.toString().split(U5);return[{words:n}]},ree=function(t){var n=t.width,r=t.scaleToFit,a=t.children,i=t.style,o=t.breakAll,c=t.maxLines;if((n||r)&&!tl.isSsr){var d,f,h=q5({breakAll:o,children:a,style:i});if(h){var p=h.wordsWithComputedWidth,x=h.spaceWidth;d=p,f=x}else return fR(a);return nee({breakAll:o,children:a,maxLines:c,style:i},d,f,n,r)}return fR(a)},pR="#808080",Lo=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,i=a===void 0?0:a,o=t.lineHeight,c=o===void 0?"1em":o,d=t.capHeight,f=d===void 0?"0.71em":d,h=t.scaleToFit,p=h===void 0?!1:h,x=t.textAnchor,g=x===void 0?"start":x,j=t.verticalAnchor,b=j===void 0?"end":j,y=t.fill,S=y===void 0?pR:y,C=cR(t,YZ),N=v.useMemo(function(){return ree({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,_=C.dy,P=C.angle,O=C.className,T=C.breakAll,I=cR(C,XZ);if(!Wn(r)||!Wn(i))return null;var M=r+(We(E)?E:0),D=i+(We(_)?_:0),R;switch(b){case"start":R=Iw("calc(".concat(f,")"));break;case"middle":R=Iw("calc(".concat((N.length-1)/2," * -").concat(c," + (").concat(f," / 2))"));break;default:R=Iw("calc(".concat(N.length-1," * -").concat(c,")"));break}var q=[];if(p){var U=N[0].width,H=C.width;q.push("scale(".concat((We(H)?H/U:1)/U,")"))}return P&&q.push("rotate(".concat(P,", ").concat(M,", ").concat(D,")")),q.length&&(I.transform=q.join(" ")),W.createElement("text",C1({},gt(I,!0),{x:M,y:D,className:_t("recharts-text",O),textAnchor:g,fill:S.includes("url")?pR:S}),N.map(function(J,Z){var F=J.words.join(T?"":" ");return W.createElement("tspan",{x:M,dy:Z===0?R:c,key:"".concat(F,"-").concat(Z)},F)}))};function Bi(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function aee(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function zN(e){let t,n,r;e.length!==2?(t=Bi,n=(c,d)=>Bi(e(c),d),r=(c,d)=>e(c)-d):(t=e===Bi||e===aee?e:see,n=e,r=e);function a(c,d,f=0,h=c.length){if(f<h){if(t(d,d)!==0)return h;do{const p=f+h>>>1;n(c[p],d)<0?f=p+1:h=p}while(f<h)}return f}function i(c,d,f=0,h=c.length){if(f<h){if(t(d,d)!==0)return h;do{const p=f+h>>>1;n(c[p],d)<=0?f=p+1:h=p}while(f<h)}return f}function o(c,d,f=0,h=c.length){const p=a(c,d,f,h-1);return p>f&&r(c[p-1],d)>-r(c[p],d)?p-1:p}return{left:a,center:o,right:i}}function see(){return 0}function W5(e){return e===null?NaN:+e}function*iee(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const oee=zN(Bi),Ef=oee.right;zN(W5).center;class hR extends Map{constructor(t,n=uee){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,a]of t)this.set(r,a)}get(t){return super.get(mR(this,t))}has(t){return super.has(mR(this,t))}set(t,n){return super.set(lee(this,t),n)}delete(t){return super.delete(cee(this,t))}}function mR({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function lee({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function cee({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function uee(e){return e!==null&&typeof e=="object"?e.valueOf():e}function dee(e=Bi){if(e===Bi)return V5;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 V5(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const fee=Math.sqrt(50),pee=Math.sqrt(10),hee=Math.sqrt(2);function Yh(e,t,n){const r=(t-e)/Math.max(0,n),a=Math.floor(Math.log10(r)),i=r/Math.pow(10,a),o=i>=fee?10:i>=pee?5:i>=hee?2:1;let c,d,f;return a<0?(f=Math.pow(10,-a)/o,c=Math.round(e*f),d=Math.round(t*f),c/f<e&&++c,d/f>t&&--d,f=-f):(f=Math.pow(10,a)*o,c=Math.round(e/f),d=Math.round(t/f),c*f<e&&++c,d*f>t&&--d),d<c&&.5<=n&&n<2?Yh(e,t,n*2):[c,d,f]}function A1(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[a,i,o]=r?Yh(t,e,n):Yh(e,t,n);if(!(i>=a))return[];const c=i-a+1,d=new Array(c);if(r)if(o<0)for(let f=0;f<c;++f)d[f]=(i-f)/-o;else for(let f=0;f<c;++f)d[f]=(i-f)*o;else if(o<0)for(let f=0;f<c;++f)d[f]=(a+f)/-o;else for(let f=0;f<c;++f)d[f]=(a+f)*o;return d}function _1(e,t,n){return t=+t,e=+e,n=+n,Yh(e,t,n)[2]}function E1(e,t,n){t=+t,e=+e,n=+n;const r=t<e,a=r?_1(t,e,n):_1(e,t,n);return(r?-1:1)*(a<0?1/-a:a)}function vR(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function gR(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function H5(e,t,n=0,r=1/0,a){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(a=a===void 0?V5:dee(a);r>n;){if(r-n>600){const d=r-n+1,f=t-n+1,h=Math.log(d),p=.5*Math.exp(2*h/3),x=.5*Math.sqrt(h*p*(d-p)/d)*(f-d/2<0?-1:1),g=Math.max(n,Math.floor(t-f*p/d+x)),j=Math.min(r,Math.floor(t+(d-f)*p/d+x));H5(e,t,g,j,a)}const i=e[t];let o=n,c=r;for(Xu(e,n,t),a(e[r],i)>0&&Xu(e,n,r);o<c;){for(Xu(e,o,c),++o,--c;a(e[o],i)<0;)++o;for(;a(e[c],i)>0;)--c}a(e[n],i)===0?Xu(e,n,c):(++c,Xu(e,c,r)),c<=t&&(n=c+1),t<=c&&(r=c-1)}return e}function Xu(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function mee(e,t,n){if(e=Float64Array.from(iee(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return gR(e);if(t>=1)return vR(e);var r,a=(r-1)*t,i=Math.floor(a),o=vR(H5(e,i).subarray(0,i+1)),c=gR(e.subarray(i+1));return o+(c-o)*(a-i)}}function vee(e,t,n=W5){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,a=(r-1)*t,i=Math.floor(a),o=+n(e[i],i,e),c=+n(e[i+1],i+1,e);return o+(c-o)*(a-i)}}function gee(e,t,n){e=+e,t=+t,n=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+n;for(var r=-1,a=Math.max(0,Math.ceil((t-e)/n))|0,i=new Array(a);++r<a;)i[r]=e+r*n;return i}function Pa(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function ii(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 P1=Symbol("implicit");function UN(){var e=new hR,t=[],n=[],r=P1;function a(i){let o=e.get(i);if(o===void 0){if(r!==P1)return r;e.set(i,o=t.push(i)-1)}return n[o%n.length]}return a.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new hR;for(const o of i)e.has(o)||e.set(o,t.push(o)-1);return a},a.range=function(i){return arguments.length?(n=Array.from(i),a):n.slice()},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return UN(t,n).unknown(r)},Pa.apply(a,arguments),a}function Md(){var e=UN().unknown(void 0),t=e.domain,n=e.range,r=0,a=1,i,o,c=!1,d=0,f=0,h=.5;delete e.unknown;function p(){var x=t().length,g=a<r,j=g?a:r,b=g?r:a;i=(b-j)/Math.max(1,x-d+f*2),c&&(i=Math.floor(i)),j+=(b-j-i*(x-d))*h,o=i*(1-d),c&&(j=Math.round(j),o=Math.round(o));var y=gee(x).map(function(S){return j+i*S});return n(g?y.reverse():y)}return e.domain=function(x){return arguments.length?(t(x),p()):t()},e.range=function(x){return arguments.length?([r,a]=x,r=+r,a=+a,p()):[r,a]},e.rangeRound=function(x){return[r,a]=x,r=+r,a=+a,c=!0,p()},e.bandwidth=function(){return o},e.step=function(){return i},e.round=function(x){return arguments.length?(c=!!x,p()):c},e.padding=function(x){return arguments.length?(d=Math.min(1,f=+x),p()):d},e.paddingInner=function(x){return arguments.length?(d=Math.min(1,x),p()):d},e.paddingOuter=function(x){return arguments.length?(f=+x,p()):f},e.align=function(x){return arguments.length?(h=Math.max(0,Math.min(1,x)),p()):h},e.copy=function(){return Md(t(),[r,a]).round(c).paddingInner(d).paddingOuter(f).align(h)},Pa.apply(p(),arguments)}function K5(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return K5(t())},e}function hd(){return K5(Md.apply(null,arguments).paddingInner(1))}function qN(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function G5(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Pf(){}var $d=.7,Xh=1/$d,lc="\\s*([+-]?\\d+)\\s*",Dd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ms="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",xee=/^#([0-9a-f]{3,8})$/,yee=new RegExp(`^rgb\\(${lc},${lc},${lc}\\)$`),bee=new RegExp(`^rgb\\(${ms},${ms},${ms}\\)$`),wee=new RegExp(`^rgba\\(${lc},${lc},${lc},${Dd}\\)$`),jee=new RegExp(`^rgba\\(${ms},${ms},${ms},${Dd}\\)$`),See=new RegExp(`^hsl\\(${Dd},${ms},${ms}\\)$`),Nee=new RegExp(`^hsla\\(${Dd},${ms},${ms},${Dd}\\)$`),xR={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};qN(Pf,Ld,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:yR,formatHex:yR,formatHex8:Cee,formatHsl:Aee,formatRgb:bR,toString:bR});function yR(){return this.rgb().formatHex()}function Cee(){return this.rgb().formatHex8()}function Aee(){return Y5(this).formatHsl()}function bR(){return this.rgb().formatRgb()}function Ld(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=xee.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?wR(t):n===3?new Fr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ih(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ih(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=yee.exec(e))?new Fr(t[1],t[2],t[3],1):(t=bee.exec(e))?new Fr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=wee.exec(e))?ih(t[1],t[2],t[3],t[4]):(t=jee.exec(e))?ih(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=See.exec(e))?NR(t[1],t[2]/100,t[3]/100,1):(t=Nee.exec(e))?NR(t[1],t[2]/100,t[3]/100,t[4]):xR.hasOwnProperty(e)?wR(xR[e]):e==="transparent"?new Fr(NaN,NaN,NaN,0):null}function wR(e){return new Fr(e>>16&255,e>>8&255,e&255,1)}function ih(e,t,n,r){return r<=0&&(e=t=n=NaN),new Fr(e,t,n,r)}function _ee(e){return e instanceof Pf||(e=Ld(e)),e?(e=e.rgb(),new Fr(e.r,e.g,e.b,e.opacity)):new Fr}function k1(e,t,n,r){return arguments.length===1?_ee(e):new Fr(e,t,n,r??1)}function Fr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}qN(Fr,k1,G5(Pf,{brighter(e){return e=e==null?Xh:Math.pow(Xh,e),new Fr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?$d:Math.pow($d,e),new Fr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Fr(Oo(this.r),Oo(this.g),Oo(this.b),Qh(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:jR,formatHex:jR,formatHex8:Eee,formatRgb:SR,toString:SR}));function jR(){return`#${_o(this.r)}${_o(this.g)}${_o(this.b)}`}function Eee(){return`#${_o(this.r)}${_o(this.g)}${_o(this.b)}${_o((isNaN(this.opacity)?1:this.opacity)*255)}`}function SR(){const e=Qh(this.opacity);return`${e===1?"rgb(":"rgba("}${Oo(this.r)}, ${Oo(this.g)}, ${Oo(this.b)}${e===1?")":`, ${e})`}`}function Qh(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Oo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function _o(e){return e=Oo(e),(e<16?"0":"")+e.toString(16)}function NR(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new qa(e,t,n,r)}function Y5(e){if(e instanceof qa)return new qa(e.h,e.s,e.l,e.opacity);if(e instanceof Pf||(e=Ld(e)),!e)return new qa;if(e instanceof qa)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),i=Math.max(t,n,r),o=NaN,c=i-a,d=(i+a)/2;return c?(t===i?o=(n-r)/c+(n<r)*6:n===i?o=(r-t)/c+2:o=(t-n)/c+4,c/=d<.5?i+a:2-i-a,o*=60):c=d>0&&d<1?0:o,new qa(o,c,d,e.opacity)}function Pee(e,t,n,r){return arguments.length===1?Y5(e):new qa(e,t,n,r??1)}function qa(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}qN(qa,Pee,G5(Pf,{brighter(e){return e=e==null?Xh:Math.pow(Xh,e),new qa(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?$d:Math.pow($d,e),new qa(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,a=2*n-r;return new Fr(Mw(e>=240?e-240:e+120,a,r),Mw(e,a,r),Mw(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new qa(CR(this.h),oh(this.s),oh(this.l),Qh(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=Qh(this.opacity);return`${e===1?"hsl(":"hsla("}${CR(this.h)}, ${oh(this.s)*100}%, ${oh(this.l)*100}%${e===1?")":`, ${e})`}`}}));function CR(e){return e=(e||0)%360,e<0?e+360:e}function oh(e){return Math.max(0,Math.min(1,e||0))}function Mw(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 WN=e=>()=>e;function kee(e,t){return function(n){return e+n*t}}function Oee(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 Tee(e){return(e=+e)==1?X5:function(t,n){return n-t?Oee(t,n,e):WN(isNaN(t)?n:t)}}function X5(e,t){var n=t-e;return n?kee(e,n):WN(isNaN(e)?t:e)}const AR=(function e(t){var n=Tee(t);function r(a,i){var o=n((a=k1(a)).r,(i=k1(i)).r),c=n(a.g,i.g),d=n(a.b,i.b),f=X5(a.opacity,i.opacity);return function(h){return a.r=o(h),a.g=c(h),a.b=d(h),a.opacity=f(h),a+""}}return r.gamma=e,r})(1);function Ree(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(i){for(a=0;a<n;++a)r[a]=e[a]*(1-i)+t[a]*i;return r}}function Iee(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Mee(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,a=new Array(r),i=new Array(n),o;for(o=0;o<r;++o)a[o]=iu(e[o],t[o]);for(;o<n;++o)i[o]=t[o];return function(c){for(o=0;o<r;++o)i[o]=a[o](c);return i}}function $ee(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Jh(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Dee(e,t){var n={},r={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?n[a]=iu(e[a],t[a]):r[a]=t[a];return function(i){for(a in n)r[a]=n[a](i);return r}}var O1=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,$w=new RegExp(O1.source,"g");function Lee(e){return function(){return e}}function Fee(e){return function(t){return e(t)+""}}function Bee(e,t){var n=O1.lastIndex=$w.lastIndex=0,r,a,i,o=-1,c=[],d=[];for(e=e+"",t=t+"";(r=O1.exec(e))&&(a=$w.exec(t));)(i=a.index)>n&&(i=t.slice(n,i),c[o]?c[o]+=i:c[++o]=i),(r=r[0])===(a=a[0])?c[o]?c[o]+=a:c[++o]=a:(c[++o]=null,d.push({i:o,x:Jh(r,a)})),n=$w.lastIndex;return n<t.length&&(i=t.slice(n),c[o]?c[o]+=i:c[++o]=i),c.length<2?d[0]?Fee(d[0].x):Lee(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 iu(e,t){var n=typeof t,r;return t==null||n==="boolean"?WN(t):(n==="number"?Jh:n==="string"?(r=Ld(t))?(t=r,AR):Bee:t instanceof Ld?AR:t instanceof Date?$ee:Iee(t)?Ree:Array.isArray(t)?Mee:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Dee:Jh)(e,t)}function VN(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function zee(e,t){t===void 0&&(t=e,e=iu);for(var n=0,r=t.length-1,a=t[0],i=new Array(r<0?0:r);n<r;)i[n]=e(a,a=t[++n]);return function(o){var c=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return i[c](o-c)}}function Uee(e){return function(){return e}}function Zh(e){return+e}var _R=[0,1];function Nr(e){return e}function T1(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Uee(isNaN(t)?NaN:.5)}function qee(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Wee(e,t,n){var r=e[0],a=e[1],i=t[0],o=t[1];return a<r?(r=T1(a,r),i=n(o,i)):(r=T1(r,a),i=n(i,o)),function(c){return i(r(c))}}function Vee(e,t,n){var r=Math.min(e.length,t.length)-1,a=new Array(r),i=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)a[o]=T1(e[o],e[o+1]),i[o]=n(t[o],t[o+1]);return function(c){var d=Ef(e,c,1,r)-1;return i[d](a[d](c))}}function kf(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Rv(){var e=_R,t=_R,n=iu,r,a,i,o=Nr,c,d,f;function h(){var x=Math.min(e.length,t.length);return o!==Nr&&(o=qee(e[0],e[x-1])),c=x>2?Vee:Wee,d=f=null,p}function p(x){return x==null||isNaN(x=+x)?i:(d||(d=c(e.map(r),t,n)))(r(o(x)))}return p.invert=function(x){return o(a((f||(f=c(t,e.map(r),Jh)))(x)))},p.domain=function(x){return arguments.length?(e=Array.from(x,Zh),h()):e.slice()},p.range=function(x){return arguments.length?(t=Array.from(x),h()):t.slice()},p.rangeRound=function(x){return t=Array.from(x),n=VN,h()},p.clamp=function(x){return arguments.length?(o=x?!0:Nr,h()):o!==Nr},p.interpolate=function(x){return arguments.length?(n=x,h()):n},p.unknown=function(x){return arguments.length?(i=x,p):i},function(x,g){return r=x,a=g,h()}}function HN(){return Rv()(Nr,Nr)}function Hee(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function em(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 Sc(e){return e=em(Math.abs(e)),e?e[1]:NaN}function Kee(e,t){return function(n,r){for(var a=n.length,i=[],o=0,c=e[0],d=0;a>0&&c>0&&(d+c+1>r&&(c=Math.max(1,r-d)),i.push(n.substring(a-=c,a+c)),!((d+=c+1)>r));)c=e[o=(o+1)%e.length];return i.reverse().join(t)}}function Gee(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Yee=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Fd(e){if(!(t=Yee.exec(e)))throw new Error("invalid format: "+e);var t;return new KN({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]})}Fd.prototype=KN.prototype;function KN(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+""}KN.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 Xee(e){e:for(var t=e.length,n=1,r=-1,a;n<t;++n)switch(e[n]){case".":r=a=n;break;case"0":r===0&&(r=n),a=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(a+1):e}var tm;function Qee(e,t){var n=em(e,t);if(!n)return tm=void 0,e.toPrecision(t);var r=n[0],a=n[1],i=a-(tm=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,o=r.length;return i===o?r:i>o?r+new Array(i-o+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+em(e,Math.max(0,t+i-1))[0]}function ER(e,t){var n=em(e,t);if(!n)return e+"";var r=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+r:r.length>a+1?r.slice(0,a+1)+"."+r.slice(a+1):r+new Array(a-r.length+2).join("0")}const PR={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Hee,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)=>ER(e*100,t),r:ER,s:Qee,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function kR(e){return e}var OR=Array.prototype.map,TR=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Jee(e){var t=e.grouping===void 0||e.thousands===void 0?kR:Kee(OR.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?kR:Gee(OR.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",c=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function f(p,x){p=Fd(p);var g=p.fill,j=p.align,b=p.sign,y=p.symbol,S=p.zero,C=p.width,N=p.comma,E=p.precision,_=p.trim,P=p.type;P==="n"?(N=!0,P="g"):PR[P]||(E===void 0&&(E=12),_=!0,P="g"),(S||g==="0"&&j==="=")&&(S=!0,g="0",j="=");var O=(x&&x.prefix!==void 0?x.prefix:"")+(y==="$"?n:y==="#"&&/[boxX]/.test(P)?"0"+P.toLowerCase():""),T=(y==="$"?r:/[%p]/.test(P)?o:"")+(x&&x.suffix!==void 0?x.suffix:""),I=PR[P],M=/[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 D(R){var q=O,U=T,H,J,Z;if(P==="c")U=I(R)+U,R="";else{R=+R;var F=R<0||1/R<0;if(R=isNaN(R)?d:I(Math.abs(R),E),_&&(R=Xee(R)),F&&+R==0&&b!=="+"&&(F=!1),q=(F?b==="("?b:c:b==="-"||b==="("?"":b)+q,U=(P==="s"&&!isNaN(R)&&tm!==void 0?TR[8+tm/3]:"")+U+(F&&b==="("?")":""),M){for(H=-1,J=R.length;++H<J;)if(Z=R.charCodeAt(H),48>Z||Z>57){U=(Z===46?a+R.slice(H+1):R.slice(H))+U,R=R.slice(0,H);break}}}N&&!S&&(R=t(R,1/0));var z=q.length+R.length+U.length,ee=z<C?new Array(C-z+1).join(g):"";switch(N&&S&&(R=t(ee+R,ee.length?C-U.length:1/0),ee=""),j){case"<":R=q+R+U+ee;break;case"=":R=q+ee+R+U;break;case"^":R=ee.slice(0,z=ee.length>>1)+q+R+U+ee.slice(z);break;default:R=ee+q+R+U;break}return i(R)}return D.toString=function(){return p+""},D}function h(p,x){var g=Math.max(-8,Math.min(8,Math.floor(Sc(x)/3)))*3,j=Math.pow(10,-g),b=f((p=Fd(p),p.type="f",p),{suffix:TR[8+g/3]});return function(y){return b(j*y)}}return{format:f,formatPrefix:h}}var lh,GN,Q5;Zee({thousands:",",grouping:[3],currency:["$",""]});function Zee(e){return lh=Jee(e),GN=lh.format,Q5=lh.formatPrefix,lh}function ete(e){return Math.max(0,-Sc(Math.abs(e)))}function tte(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Sc(t)/3)))*3-Sc(Math.abs(e)))}function nte(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Sc(t)-Sc(e))+1}function J5(e,t,n,r){var a=E1(e,t,n),i;switch(r=Fd(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(i=tte(a,o))&&(r.precision=i),Q5(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=nte(a,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=ete(a))&&(r.precision=i-(r.type==="%")*2);break}}return GN(r)}function Ji(e){var t=e.domain;return e.ticks=function(n){var r=t();return A1(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var a=t();return J5(a[0],a[a.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),a=0,i=r.length-1,o=r[a],c=r[i],d,f,h=10;for(c<o&&(f=o,o=c,c=f,f=a,a=i,i=f);h-- >0;){if(f=_1(o,c,n),f===d)return r[a]=o,r[i]=c,t(r);if(f>0)o=Math.floor(o/f)*f,c=Math.ceil(c/f)*f;else if(f<0)o=Math.ceil(o*f)/f,c=Math.floor(c*f)/f;else break;d=f}return e},e}function nm(){var e=HN();return e.copy=function(){return kf(e,nm())},Pa.apply(e,arguments),Ji(e)}function Z5(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,Zh),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return Z5(e).unknown(t)},e=arguments.length?Array.from(e,Zh):[0,1],Ji(n)}function eL(e,t){e=e.slice();var n=0,r=e.length-1,a=e[n],i=e[r],o;return i<a&&(o=n,n=r,r=o,o=a,a=i,i=o),e[n]=t.floor(a),e[r]=t.ceil(i),e}function RR(e){return Math.log(e)}function IR(e){return Math.exp(e)}function rte(e){return-Math.log(-e)}function ate(e){return-Math.exp(-e)}function ste(e){return isFinite(e)?+("1e"+e):e<0?0:e}function ite(e){return e===10?ste:e===Math.E?Math.exp:t=>Math.pow(e,t)}function ote(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 MR(e){return(t,n)=>-e(-t,n)}function YN(e){const t=e(RR,IR),n=t.domain;let r=10,a,i;function o(){return a=ote(r),i=ite(r),n()[0]<0?(a=MR(a),i=MR(i),e(rte,ate)):e(RR,IR),t}return t.base=function(c){return arguments.length?(r=+c,o()):r},t.domain=function(c){return arguments.length?(n(c),o()):n()},t.ticks=c=>{const d=n();let f=d[0],h=d[d.length-1];const p=h<f;p&&([f,h]=[h,f]);let x=a(f),g=a(h),j,b;const y=c==null?10:+c;let S=[];if(!(r%1)&&g-x<y){if(x=Math.floor(x),g=Math.ceil(g),f>0){for(;x<=g;++x)for(j=1;j<r;++j)if(b=x<0?j/i(-x):j*i(x),!(b<f)){if(b>h)break;S.push(b)}}else for(;x<=g;++x)for(j=r-1;j>=1;--j)if(b=x>0?j/i(-x):j*i(x),!(b<f)){if(b>h)break;S.push(b)}S.length*2<y&&(S=A1(f,h,y))}else S=A1(x,g,Math.min(g-x,y)).map(i);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=Fd(d)).precision==null&&(d.trim=!0),d=GN(d)),c===1/0)return d;const f=Math.max(1,r*c/t.ticks().length);return h=>{let p=h/i(Math.round(a(h)));return p*r<r-.5&&(p*=r),p<=f?d(h):""}},t.nice=()=>n(eL(n(),{floor:c=>i(Math.floor(a(c))),ceil:c=>i(Math.ceil(a(c)))})),t}function tL(){const e=YN(Rv()).domain([1,10]);return e.copy=()=>kf(e,tL()).base(e.base()),Pa.apply(e,arguments),e}function $R(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function DR(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function XN(e){var t=1,n=e($R(t),DR(t));return n.constant=function(r){return arguments.length?e($R(t=+r),DR(t)):t},Ji(n)}function nL(){var e=XN(Rv());return e.copy=function(){return kf(e,nL()).constant(e.constant())},Pa.apply(e,arguments)}function LR(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function lte(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function cte(e){return e<0?-e*e:e*e}function QN(e){var t=e(Nr,Nr),n=1;function r(){return n===1?e(Nr,Nr):n===.5?e(lte,cte):e(LR(n),LR(1/n))}return t.exponent=function(a){return arguments.length?(n=+a,r()):n},Ji(t)}function JN(){var e=QN(Rv());return e.copy=function(){return kf(e,JN()).exponent(e.exponent())},Pa.apply(e,arguments),e}function ute(){return JN.apply(null,arguments).exponent(.5)}function FR(e){return Math.sign(e)*e*e}function dte(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function rL(){var e=HN(),t=[0,1],n=!1,r;function a(i){var o=dte(e(i));return isNaN(o)?r:n?Math.round(o):o}return a.invert=function(i){return e.invert(FR(i))},a.domain=function(i){return arguments.length?(e.domain(i),a):e.domain()},a.range=function(i){return arguments.length?(e.range((t=Array.from(i,Zh)).map(FR)),a):t.slice()},a.rangeRound=function(i){return a.range(i).round(!0)},a.round=function(i){return arguments.length?(n=!!i,a):n},a.clamp=function(i){return arguments.length?(e.clamp(i),a):e.clamp()},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return rL(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Pa.apply(a,arguments),Ji(a)}function aL(){var e=[],t=[],n=[],r;function a(){var o=0,c=Math.max(1,t.length);for(n=new Array(c-1);++o<c;)n[o-1]=vee(e,o/c);return i}function i(o){return o==null||isNaN(o=+o)?r:t[Ef(n,o)]}return i.invertExtent=function(o){var c=t.indexOf(o);return c<0?[NaN,NaN]:[c>0?n[c-1]:e[0],c<n.length?n[c]:e[e.length-1]]},i.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let c of o)c!=null&&!isNaN(c=+c)&&e.push(c);return e.sort(Bi),a()},i.range=function(o){return arguments.length?(t=Array.from(o),a()):t.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.quantiles=function(){return n.slice()},i.copy=function(){return aL().domain(e).range(t).unknown(r)},Pa.apply(i,arguments)}function sL(){var e=0,t=1,n=1,r=[.5],a=[0,1],i;function o(d){return d!=null&&d<=d?a[Ef(r,d,0,n)]:i}function c(){var d=-1;for(r=new Array(n);++d<n;)r[d]=((d+1)*t-(d-n)*e)/(n+1);return o}return o.domain=function(d){return arguments.length?([e,t]=d,e=+e,t=+t,c()):[e,t]},o.range=function(d){return arguments.length?(n=(a=Array.from(d)).length-1,c()):a.slice()},o.invertExtent=function(d){var f=a.indexOf(d);return f<0?[NaN,NaN]:f<1?[e,r[0]]:f>=n?[r[n-1],t]:[r[f-1],r[f]]},o.unknown=function(d){return arguments.length&&(i=d),o},o.thresholds=function(){return r.slice()},o.copy=function(){return sL().domain([e,t]).range(a).unknown(i)},Pa.apply(Ji(o),arguments)}function iL(){var e=[.5],t=[0,1],n,r=1;function a(i){return i!=null&&i<=i?t[Ef(e,i,0,r)]:n}return a.domain=function(i){return arguments.length?(e=Array.from(i),r=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(i){return arguments.length?(t=Array.from(i),r=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(i){var o=t.indexOf(i);return[e[o-1],e[o]]},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return iL().domain(e).range(t).unknown(n)},Pa.apply(a,arguments)}const Dw=new Date,Lw=new Date;function Gn(e,t,n,r){function a(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return a.floor=i=>(e(i=new Date(+i)),i),a.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),a.round=i=>{const o=a(i),c=a.ceil(i);return i-o<c-i?o:c},a.offset=(i,o)=>(t(i=new Date(+i),o==null?1:Math.floor(o)),i),a.range=(i,o,c)=>{const d=[];if(i=a.ceil(i),c=c==null?1:Math.floor(c),!(i<o)||!(c>0))return d;let f;do d.push(f=new Date(+i)),t(i,c),e(i);while(f<i&&i<o);return d},a.filter=i=>Gn(o=>{if(o>=o)for(;e(o),!i(o);)o.setTime(o-1)},(o,c)=>{if(o>=o)if(c<0)for(;++c<=0;)for(;t(o,-1),!i(o););else for(;--c>=0;)for(;t(o,1),!i(o););}),n&&(a.count=(i,o)=>(Dw.setTime(+i),Lw.setTime(+o),e(Dw),e(Lw),Math.floor(n(Dw,Lw))),a.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?a.filter(r?o=>r(o)%i===0:o=>a.count(0,o)%i===0):a)),a}const rm=Gn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);rm.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Gn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):rm);rm.range;const Hs=1e3,ja=Hs*60,Ks=ja*60,ei=Ks*24,ZN=ei*7,BR=ei*30,Fw=ei*365,Eo=Gn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Hs)},(e,t)=>(t-e)/Hs,e=>e.getUTCSeconds());Eo.range;const eC=Gn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Hs)},(e,t)=>{e.setTime(+e+t*ja)},(e,t)=>(t-e)/ja,e=>e.getMinutes());eC.range;const tC=Gn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ja)},(e,t)=>(t-e)/ja,e=>e.getUTCMinutes());tC.range;const nC=Gn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Hs-e.getMinutes()*ja)},(e,t)=>{e.setTime(+e+t*Ks)},(e,t)=>(t-e)/Ks,e=>e.getHours());nC.range;const rC=Gn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ks)},(e,t)=>(t-e)/Ks,e=>e.getUTCHours());rC.range;const Of=Gn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ja)/ei,e=>e.getDate()-1);Of.range;const Iv=Gn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ei,e=>e.getUTCDate()-1);Iv.range;const oL=Gn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ei,e=>Math.floor(e/ei));oL.range;function nl(e){return Gn(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())*ja)/ZN)}const Mv=nl(0),am=nl(1),fte=nl(2),pte=nl(3),Nc=nl(4),hte=nl(5),mte=nl(6);Mv.range;am.range;fte.range;pte.range;Nc.range;hte.range;mte.range;function rl(e){return Gn(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)/ZN)}const $v=rl(0),sm=rl(1),vte=rl(2),gte=rl(3),Cc=rl(4),xte=rl(5),yte=rl(6);$v.range;sm.range;vte.range;gte.range;Cc.range;xte.range;yte.range;const aC=Gn(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());aC.range;const sC=Gn(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());sC.range;const ti=Gn(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());ti.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Gn(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)});ti.range;const ni=Gn(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());ni.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Gn(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)});ni.range;function lL(e,t,n,r,a,i){const o=[[Eo,1,Hs],[Eo,5,5*Hs],[Eo,15,15*Hs],[Eo,30,30*Hs],[i,1,ja],[i,5,5*ja],[i,15,15*ja],[i,30,30*ja],[a,1,Ks],[a,3,3*Ks],[a,6,6*Ks],[a,12,12*Ks],[r,1,ei],[r,2,2*ei],[n,1,ZN],[t,1,BR],[t,3,3*BR],[e,1,Fw]];function c(f,h,p){const x=h<f;x&&([f,h]=[h,f]);const g=p&&typeof p.range=="function"?p:d(f,h,p),j=g?g.range(f,+h+1):[];return x?j.reverse():j}function d(f,h,p){const x=Math.abs(h-f)/p,g=zN(([,,y])=>y).right(o,x);if(g===o.length)return e.every(E1(f/Fw,h/Fw,p));if(g===0)return rm.every(Math.max(E1(f,h,p),1));const[j,b]=o[x/o[g-1][2]<o[g][2]/x?g-1:g];return j.every(b)}return[c,d]}const[bte,wte]=lL(ni,sC,$v,oL,rC,tC),[jte,Ste]=lL(ti,aC,Mv,Of,nC,eC);function Bw(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 zw(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 Qu(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Nte(e){var t=e.dateTime,n=e.date,r=e.time,a=e.periods,i=e.days,o=e.shortDays,c=e.months,d=e.shortMonths,f=Ju(a),h=Zu(a),p=Ju(i),x=Zu(i),g=Ju(o),j=Zu(o),b=Ju(c),y=Zu(c),S=Ju(d),C=Zu(d),N={a:Z,A:F,b:z,B:ee,c:null,d:HR,e:HR,f:Kte,g:rne,G:sne,H:Wte,I:Vte,j:Hte,L:cL,m:Gte,M:Yte,p:B,q:L,Q:YR,s:XR,S:Xte,u:Qte,U:Jte,V:Zte,w:ene,W:tne,x:null,X:null,y:nne,Y:ane,Z:ine,"%":GR},E={a:te,A:ie,b:G,B:de,c:null,d:KR,e:KR,f:une,g:bne,G:jne,H:one,I:lne,j:cne,L:dL,m:dne,M:fne,p:oe,q:ce,Q:YR,s:XR,S:pne,u:hne,U:mne,V:vne,w:gne,W:xne,x:null,X:null,y:yne,Y:wne,Z:Sne,"%":GR},_={a:M,A:D,b:R,B:q,c:U,d:WR,e:WR,f:Bte,g:qR,G:UR,H:VR,I:VR,j:$te,L:Fte,m:Mte,M:Dte,p:I,q:Ite,Q:Ute,s:qte,S:Lte,u:Pte,U:kte,V:Ote,w:Ete,W:Tte,x:H,X:J,y:qR,Y:UR,Z:Rte,"%":zte};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(le,fe){return function(Ce){var ae=[],ke=-1,Ae=0,Ye=le.length,be,Re,Y;for(Ce instanceof Date||(Ce=new Date(+Ce));++ke<Ye;)le.charCodeAt(ke)===37&&(ae.push(le.slice(Ae,ke)),(Re=zR[be=le.charAt(++ke)])!=null?be=le.charAt(++ke):Re=be==="e"?" ":"0",(Y=fe[be])&&(be=Y(Ce,Re)),ae.push(be),Ae=ke+1);return ae.push(le.slice(Ae,ke)),ae.join("")}}function O(le,fe){return function(Ce){var ae=Qu(1900,void 0,1),ke=T(ae,le,Ce+="",0),Ae,Ye;if(ke!=Ce.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(fe&&!("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?(Ae=zw(Qu(ae.y,0,1)),Ye=Ae.getUTCDay(),Ae=Ye>4||Ye===0?sm.ceil(Ae):sm(Ae),Ae=Iv.offset(Ae,(ae.V-1)*7),ae.y=Ae.getUTCFullYear(),ae.m=Ae.getUTCMonth(),ae.d=Ae.getUTCDate()+(ae.w+6)%7):(Ae=Bw(Qu(ae.y,0,1)),Ye=Ae.getDay(),Ae=Ye>4||Ye===0?am.ceil(Ae):am(Ae),Ae=Of.offset(Ae,(ae.V-1)*7),ae.y=Ae.getFullYear(),ae.m=Ae.getMonth(),ae.d=Ae.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?zw(Qu(ae.y,0,1)).getUTCDay():Bw(Qu(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,zw(ae)):Bw(ae)}}function T(le,fe,Ce,ae){for(var ke=0,Ae=fe.length,Ye=Ce.length,be,Re;ke<Ae;){if(ae>=Ye)return-1;if(be=fe.charCodeAt(ke++),be===37){if(be=fe.charAt(ke++),Re=_[be in zR?fe.charAt(ke++):be],!Re||(ae=Re(le,Ce,ae))<0)return-1}else if(be!=Ce.charCodeAt(ae++))return-1}return ae}function I(le,fe,Ce){var ae=f.exec(fe.slice(Ce));return ae?(le.p=h.get(ae[0].toLowerCase()),Ce+ae[0].length):-1}function M(le,fe,Ce){var ae=g.exec(fe.slice(Ce));return ae?(le.w=j.get(ae[0].toLowerCase()),Ce+ae[0].length):-1}function D(le,fe,Ce){var ae=p.exec(fe.slice(Ce));return ae?(le.w=x.get(ae[0].toLowerCase()),Ce+ae[0].length):-1}function R(le,fe,Ce){var ae=S.exec(fe.slice(Ce));return ae?(le.m=C.get(ae[0].toLowerCase()),Ce+ae[0].length):-1}function q(le,fe,Ce){var ae=b.exec(fe.slice(Ce));return ae?(le.m=y.get(ae[0].toLowerCase()),Ce+ae[0].length):-1}function U(le,fe,Ce){return T(le,t,fe,Ce)}function H(le,fe,Ce){return T(le,n,fe,Ce)}function J(le,fe,Ce){return T(le,r,fe,Ce)}function Z(le){return o[le.getDay()]}function F(le){return i[le.getDay()]}function z(le){return d[le.getMonth()]}function ee(le){return c[le.getMonth()]}function B(le){return a[+(le.getHours()>=12)]}function L(le){return 1+~~(le.getMonth()/3)}function te(le){return o[le.getUTCDay()]}function ie(le){return i[le.getUTCDay()]}function G(le){return d[le.getUTCMonth()]}function de(le){return c[le.getUTCMonth()]}function oe(le){return a[+(le.getUTCHours()>=12)]}function ce(le){return 1+~~(le.getUTCMonth()/3)}return{format:function(le){var fe=P(le+="",N);return fe.toString=function(){return le},fe},parse:function(le){var fe=O(le+="",!1);return fe.toString=function(){return le},fe},utcFormat:function(le){var fe=P(le+="",E);return fe.toString=function(){return le},fe},utcParse:function(le){var fe=O(le+="",!0);return fe.toString=function(){return le},fe}}}var zR={"-":"",_:" ",0:"0"},nr=/^\s*\d+/,Cte=/^%/,Ate=/[\\^$*+?|[\]().{}]/g;function Wt(e,t,n){var r=e<0?"-":"",a=(r?-e:e)+"",i=a.length;return r+(i<n?new Array(n-i+1).join(t)+a:a)}function _te(e){return e.replace(Ate,"\\$&")}function Ju(e){return new RegExp("^(?:"+e.map(_te).join("|")+")","i")}function Zu(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Ete(e,t,n){var r=nr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Pte(e,t,n){var r=nr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function kte(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Ote(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Tte(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function UR(e,t,n){var r=nr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function qR(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Rte(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 Ite(e,t,n){var r=nr.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Mte(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function WR(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function $te(e,t,n){var r=nr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function VR(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Dte(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Lte(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Fte(e,t,n){var r=nr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Bte(e,t,n){var r=nr.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function zte(e,t,n){var r=Cte.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Ute(e,t,n){var r=nr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function qte(e,t,n){var r=nr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function HR(e,t){return Wt(e.getDate(),t,2)}function Wte(e,t){return Wt(e.getHours(),t,2)}function Vte(e,t){return Wt(e.getHours()%12||12,t,2)}function Hte(e,t){return Wt(1+Of.count(ti(e),e),t,3)}function cL(e,t){return Wt(e.getMilliseconds(),t,3)}function Kte(e,t){return cL(e,t)+"000"}function Gte(e,t){return Wt(e.getMonth()+1,t,2)}function Yte(e,t){return Wt(e.getMinutes(),t,2)}function Xte(e,t){return Wt(e.getSeconds(),t,2)}function Qte(e){var t=e.getDay();return t===0?7:t}function Jte(e,t){return Wt(Mv.count(ti(e)-1,e),t,2)}function uL(e){var t=e.getDay();return t>=4||t===0?Nc(e):Nc.ceil(e)}function Zte(e,t){return e=uL(e),Wt(Nc.count(ti(e),e)+(ti(e).getDay()===4),t,2)}function ene(e){return e.getDay()}function tne(e,t){return Wt(am.count(ti(e)-1,e),t,2)}function nne(e,t){return Wt(e.getFullYear()%100,t,2)}function rne(e,t){return e=uL(e),Wt(e.getFullYear()%100,t,2)}function ane(e,t){return Wt(e.getFullYear()%1e4,t,4)}function sne(e,t){var n=e.getDay();return e=n>=4||n===0?Nc(e):Nc.ceil(e),Wt(e.getFullYear()%1e4,t,4)}function ine(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Wt(t/60|0,"0",2)+Wt(t%60,"0",2)}function KR(e,t){return Wt(e.getUTCDate(),t,2)}function one(e,t){return Wt(e.getUTCHours(),t,2)}function lne(e,t){return Wt(e.getUTCHours()%12||12,t,2)}function cne(e,t){return Wt(1+Iv.count(ni(e),e),t,3)}function dL(e,t){return Wt(e.getUTCMilliseconds(),t,3)}function une(e,t){return dL(e,t)+"000"}function dne(e,t){return Wt(e.getUTCMonth()+1,t,2)}function fne(e,t){return Wt(e.getUTCMinutes(),t,2)}function pne(e,t){return Wt(e.getUTCSeconds(),t,2)}function hne(e){var t=e.getUTCDay();return t===0?7:t}function mne(e,t){return Wt($v.count(ni(e)-1,e),t,2)}function fL(e){var t=e.getUTCDay();return t>=4||t===0?Cc(e):Cc.ceil(e)}function vne(e,t){return e=fL(e),Wt(Cc.count(ni(e),e)+(ni(e).getUTCDay()===4),t,2)}function gne(e){return e.getUTCDay()}function xne(e,t){return Wt(sm.count(ni(e)-1,e),t,2)}function yne(e,t){return Wt(e.getUTCFullYear()%100,t,2)}function bne(e,t){return e=fL(e),Wt(e.getUTCFullYear()%100,t,2)}function wne(e,t){return Wt(e.getUTCFullYear()%1e4,t,4)}function jne(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Cc(e):Cc.ceil(e),Wt(e.getUTCFullYear()%1e4,t,4)}function Sne(){return"+0000"}function GR(){return"%"}function YR(e){return+e}function XR(e){return Math.floor(+e/1e3)}var Bl,pL,hL;Nne({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 Nne(e){return Bl=Nte(e),pL=Bl.format,Bl.parse,hL=Bl.utcFormat,Bl.utcParse,Bl}function Cne(e){return new Date(e)}function Ane(e){return e instanceof Date?+e:+new Date(+e)}function iC(e,t,n,r,a,i,o,c,d,f){var h=HN(),p=h.invert,x=h.domain,g=f(".%L"),j=f(":%S"),b=f("%I:%M"),y=f("%I %p"),S=f("%a %d"),C=f("%b %d"),N=f("%B"),E=f("%Y");function _(P){return(d(P)<P?g:c(P)<P?j:o(P)<P?b:i(P)<P?y:r(P)<P?a(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?x(Array.from(P,Ane)):x().map(Cne)},h.ticks=function(P){var O=x();return e(O[0],O[O.length-1],P??10)},h.tickFormat=function(P,O){return O==null?_:f(O)},h.nice=function(P){var O=x();return(!P||typeof P.range!="function")&&(P=t(O[0],O[O.length-1],P??10)),P?x(eL(O,P)):h},h.copy=function(){return kf(h,iC(e,t,n,r,a,i,o,c,d,f))},h}function _ne(){return Pa.apply(iC(jte,Ste,ti,aC,Mv,Of,nC,eC,Eo,pL).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Ene(){return Pa.apply(iC(bte,wte,ni,sC,$v,Iv,rC,tC,Eo,hL).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Dv(){var e=0,t=1,n,r,a,i,o=Nr,c=!1,d;function f(p){return p==null||isNaN(p=+p)?d:o(a===0?.5:(p=(i(p)-n)*a,c?Math.max(0,Math.min(1,p)):p))}f.domain=function(p){return arguments.length?([e,t]=p,n=i(e=+e),r=i(t=+t),a=n===r?0:1/(r-n),f):[e,t]},f.clamp=function(p){return arguments.length?(c=!!p,f):c},f.interpolator=function(p){return arguments.length?(o=p,f):o};function h(p){return function(x){var g,j;return arguments.length?([g,j]=x,o=p(g,j),f):[o(0),o(1)]}}return f.range=h(iu),f.rangeRound=h(VN),f.unknown=function(p){return arguments.length?(d=p,f):d},function(p){return i=p,n=p(e),r=p(t),a=n===r?0:1/(r-n),f}}function Zi(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function mL(){var e=Ji(Dv()(Nr));return e.copy=function(){return Zi(e,mL())},ii.apply(e,arguments)}function vL(){var e=YN(Dv()).domain([1,10]);return e.copy=function(){return Zi(e,vL()).base(e.base())},ii.apply(e,arguments)}function gL(){var e=XN(Dv());return e.copy=function(){return Zi(e,gL()).constant(e.constant())},ii.apply(e,arguments)}function oC(){var e=QN(Dv());return e.copy=function(){return Zi(e,oC()).exponent(e.exponent())},ii.apply(e,arguments)}function Pne(){return oC.apply(null,arguments).exponent(.5)}function xL(){var e=[],t=Nr;function n(r){if(r!=null&&!isNaN(r=+r))return t((Ef(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let a of r)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(Bi),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,a)=>t(a/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(a,i)=>mee(e,i/r))},n.copy=function(){return xL(t).domain(e)},ii.apply(n,arguments)}function Lv(){var e=0,t=.5,n=1,r=1,a,i,o,c,d,f=Nr,h,p=!1,x;function g(b){return isNaN(b=+b)?x:(b=.5+((b=+h(b))-i)*(r*b<r*i?c:d),f(p?Math.max(0,Math.min(1,b)):b))}g.domain=function(b){return arguments.length?([e,t,n]=b,a=h(e=+e),i=h(t=+t),o=h(n=+n),c=a===i?0:.5/(i-a),d=i===o?0:.5/(o-i),r=i<a?-1:1,g):[e,t,n]},g.clamp=function(b){return arguments.length?(p=!!b,g):p},g.interpolator=function(b){return arguments.length?(f=b,g):f};function j(b){return function(y){var S,C,N;return arguments.length?([S,C,N]=y,f=zee(b,[S,C,N]),g):[f(0),f(.5),f(1)]}}return g.range=j(iu),g.rangeRound=j(VN),g.unknown=function(b){return arguments.length?(x=b,g):x},function(b){return h=b,a=b(e),i=b(t),o=b(n),c=a===i?0:.5/(i-a),d=i===o?0:.5/(o-i),r=i<a?-1:1,g}}function yL(){var e=Ji(Lv()(Nr));return e.copy=function(){return Zi(e,yL())},ii.apply(e,arguments)}function bL(){var e=YN(Lv()).domain([.1,1,10]);return e.copy=function(){return Zi(e,bL()).base(e.base())},ii.apply(e,arguments)}function wL(){var e=XN(Lv());return e.copy=function(){return Zi(e,wL()).constant(e.constant())},ii.apply(e,arguments)}function lC(){var e=QN(Lv());return e.copy=function(){return Zi(e,lC()).exponent(e.exponent())},ii.apply(e,arguments)}function kne(){return lC.apply(null,arguments).exponent(.5)}const QR=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Md,scaleDiverging:yL,scaleDivergingLog:bL,scaleDivergingPow:lC,scaleDivergingSqrt:kne,scaleDivergingSymlog:wL,scaleIdentity:Z5,scaleImplicit:P1,scaleLinear:nm,scaleLog:tL,scaleOrdinal:UN,scalePoint:hd,scalePow:JN,scaleQuantile:aL,scaleQuantize:sL,scaleRadial:rL,scaleSequential:mL,scaleSequentialLog:vL,scaleSequentialPow:oC,scaleSequentialQuantile:xL,scaleSequentialSqrt:Pne,scaleSequentialSymlog:gL,scaleSqrt:ute,scaleSymlog:nL,scaleThreshold:iL,scaleTime:_ne,scaleUtc:Ene,tickFormat:J5},Symbol.toStringTag,{value:"Module"}));var Uw,JR;function Fv(){if(JR)return Uw;JR=1;var e=nu();function t(n,r,a){for(var i=-1,o=n.length;++i<o;){var c=n[i],d=r(c);if(d!=null&&(f===void 0?d===d&&!e(d):a(d,f)))var f=d,h=c}return h}return Uw=t,Uw}var qw,ZR;function jL(){if(ZR)return qw;ZR=1;function e(t,n){return t>n}return qw=e,qw}var Ww,e2;function One(){if(e2)return Ww;e2=1;var e=Fv(),t=jL(),n=su();function r(a){return a&&a.length?e(a,n,t):void 0}return Ww=r,Ww}var Tne=One();const Bv=Yt(Tne);var Vw,t2;function SL(){if(t2)return Vw;t2=1;function e(t,n){return t<n}return Vw=e,Vw}var Hw,n2;function Rne(){if(n2)return Hw;n2=1;var e=Fv(),t=SL(),n=su();function r(a){return a&&a.length?e(a,n,t):void 0}return Hw=r,Hw}var Ine=Rne();const zv=Yt(Ine);var Kw,r2;function Mne(){if(r2)return Kw;r2=1;var e=NN(),t=_s(),n=T5(),r=Br();function a(i,o){var c=r(i)?e:n;return c(i,t(o,3))}return Kw=a,Kw}var Gw,a2;function $ne(){if(a2)return Gw;a2=1;var e=k5(),t=Mne();function n(r,a){return e(t(r,a),1)}return Gw=n,Gw}var Dne=$ne();const Lne=Yt(Dne);var Yw,s2;function Fne(){if(s2)return Yw;s2=1;var e=DN();function t(n,r){return e(n,r)}return Yw=t,Yw}var Bne=Fne();const Tf=Yt(Bne);var ou=1e9,zne={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},uC,gn=!0,_a="[DecimalError] ",To=_a+"Invalid argument: ",cC=_a+"Exponent out of range: ",lu=Math.floor,No=Math.pow,Une=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ta,er=1e7,pn=7,NL=9007199254740991,im=lu(NL/pn),Ze={};Ze.absoluteValue=Ze.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Ze.comparedTo=Ze.cmp=function(e){var t,n,r,a,i=this;if(e=new i.constructor(e),i.s!==e.s)return i.s||-e.s;if(i.e!==e.e)return i.e>e.e^i.s<0?1:-1;for(r=i.d.length,a=e.d.length,t=0,n=r<a?r:a;t<n;++t)if(i.d[t]!==e.d[t])return i.d[t]>e.d[t]^i.s<0?1:-1;return r===a?0:r>a^i.s<0?1:-1};Ze.decimalPlaces=Ze.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*pn;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Ze.dividedBy=Ze.div=function(e){return Xs(this,new this.constructor(e))};Ze.dividedToIntegerBy=Ze.idiv=function(e){var t=this,n=t.constructor;return tn(Xs(t,new n(e),0,1),n.precision)};Ze.equals=Ze.eq=function(e){return!this.cmp(e)};Ze.exponent=function(){return $n(this)};Ze.greaterThan=Ze.gt=function(e){return this.cmp(e)>0};Ze.greaterThanOrEqualTo=Ze.gte=function(e){return this.cmp(e)>=0};Ze.isInteger=Ze.isint=function(){return this.e>this.d.length-2};Ze.isNegative=Ze.isneg=function(){return this.s<0};Ze.isPositive=Ze.ispos=function(){return this.s>0};Ze.isZero=function(){return this.s===0};Ze.lessThan=Ze.lt=function(e){return this.cmp(e)<0};Ze.lessThanOrEqualTo=Ze.lte=function(e){return this.cmp(e)<1};Ze.logarithm=Ze.log=function(e){var t,n=this,r=n.constructor,a=r.precision,i=a+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(ta))throw Error(_a+"NaN");if(n.s<1)throw Error(_a+(n.s?"NaN":"-Infinity"));return n.eq(ta)?new r(0):(gn=!1,t=Xs(Bd(n,i),Bd(e,i),i),gn=!0,tn(t,a))};Ze.minus=Ze.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?_L(t,e):CL(t,(e.s=-e.s,e))};Ze.modulo=Ze.mod=function(e){var t,n=this,r=n.constructor,a=r.precision;if(e=new r(e),!e.s)throw Error(_a+"NaN");return n.s?(gn=!1,t=Xs(n,e,0,1).times(e),gn=!0,n.minus(t)):tn(new r(n),a)};Ze.naturalExponential=Ze.exp=function(){return AL(this)};Ze.naturalLogarithm=Ze.ln=function(){return Bd(this)};Ze.negated=Ze.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Ze.plus=Ze.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?CL(t,e):_L(t,(e.s=-e.s,e))};Ze.precision=Ze.sd=function(e){var t,n,r,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(To+e);if(t=$n(a)+1,r=a.d.length-1,n=r*pn+1,r=a.d[r],r){for(;r%10==0;r/=10)n--;for(r=a.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Ze.squareRoot=Ze.sqrt=function(){var e,t,n,r,a,i,o,c=this,d=c.constructor;if(c.s<1){if(!c.s)return new d(0);throw Error(_a+"NaN")}for(e=$n(c),gn=!1,a=Math.sqrt(+c),a==0||a==1/0?(t=ds(c.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=lu((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new d(t)):r=new d(a.toString()),n=d.precision,a=o=n+3;;)if(i=r,r=i.plus(Xs(c,i,o+2)).times(.5),ds(i.d).slice(0,o)===(t=ds(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),a==o&&t=="4999"){if(tn(i,n+1,0),i.times(i).eq(c)){r=i;break}}else if(t!="9999")break;o+=4}return gn=!0,tn(r,n)};Ze.times=Ze.mul=function(e){var t,n,r,a,i,o,c,d,f,h=this,p=h.constructor,x=h.d,g=(e=new p(e)).d;if(!h.s||!e.s)return new p(0);for(e.s*=h.s,n=h.e+e.e,d=x.length,f=g.length,d<f&&(i=x,x=g,g=i,o=d,d=f,f=o),i=[],o=d+f,r=o;r--;)i.push(0);for(r=f;--r>=0;){for(t=0,a=d+r;a>r;)c=i[a]+g[r]*x[a-r-1]+t,i[a--]=c%er|0,t=c/er|0;i[a]=(i[a]+t)%er|0}for(;!i[--o];)i.pop();return t?++n:i.shift(),e.d=i,e.e=n,gn?tn(e,p.precision):e};Ze.toDecimalPlaces=Ze.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(ws(e,0,ou),t===void 0?t=r.rounding:ws(t,0,8),tn(n,e+$n(n)+1,t))};Ze.toExponential=function(e,t){var n,r=this,a=r.constructor;return e===void 0?n=Fo(r,!0):(ws(e,0,ou),t===void 0?t=a.rounding:ws(t,0,8),r=tn(new a(r),e+1,t),n=Fo(r,!0,e+1)),n};Ze.toFixed=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?Fo(a):(ws(e,0,ou),t===void 0?t=i.rounding:ws(t,0,8),r=tn(new i(a),e+$n(a)+1,t),n=Fo(r.abs(),!1,e+$n(r)+1),a.isneg()&&!a.isZero()?"-"+n:n)};Ze.toInteger=Ze.toint=function(){var e=this,t=e.constructor;return tn(new t(e),$n(e)+1,t.rounding)};Ze.toNumber=function(){return+this};Ze.toPower=Ze.pow=function(e){var t,n,r,a,i,o,c=this,d=c.constructor,f=12,h=+(e=new d(e));if(!e.s)return new d(ta);if(c=new d(c),!c.s){if(e.s<1)throw Error(_a+"Infinity");return c}if(c.eq(ta))return c;if(r=d.precision,e.eq(ta))return tn(c,r);if(t=e.e,n=e.d.length-1,o=t>=n,i=c.s,o){if((n=h<0?-h:h)<=NL){for(a=new d(ta),t=Math.ceil(r/pn+4),gn=!1;n%2&&(a=a.times(c),o2(a.d,t)),n=lu(n/2),n!==0;)c=c.times(c),o2(c.d,t);return gn=!0,e.s<0?new d(ta).div(a):tn(a,r)}}else if(i<0)throw Error(_a+"NaN");return i=i<0&&e.d[Math.max(t,n)]&1?-1:1,c.s=1,gn=!1,a=e.times(Bd(c,r+f)),gn=!0,a=AL(a),a.s=i,a};Ze.toPrecision=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?(n=$n(a),r=Fo(a,n<=i.toExpNeg||n>=i.toExpPos)):(ws(e,1,ou),t===void 0?t=i.rounding:ws(t,0,8),a=tn(new i(a),e,t),n=$n(a),r=Fo(a,e<=n||n<=i.toExpNeg,e)),r};Ze.toSignificantDigits=Ze.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(ws(e,1,ou),t===void 0?t=r.rounding:ws(t,0,8)),tn(new r(n),e,t)};Ze.toString=Ze.valueOf=Ze.val=Ze.toJSON=Ze[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=$n(e),n=e.constructor;return Fo(e,t<=n.toExpNeg||t>=n.toExpPos)};function CL(e,t){var n,r,a,i,o,c,d,f,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s||(t=new h(e)),gn?tn(t,p):t;if(d=e.d,f=t.d,o=e.e,a=t.e,d=d.slice(),i=o-a,i){for(i<0?(r=d,i=-i,c=f.length):(r=f,a=o,c=d.length),o=Math.ceil(p/pn),c=o>c?o+1:c+1,i>c&&(i=c,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(c=d.length,i=f.length,c-i<0&&(i=c,r=f,f=d,d=r),n=0;i;)n=(d[--i]=d[i]+f[i]+n)/er|0,d[i]%=er;for(n&&(d.unshift(n),++a),c=d.length;d[--c]==0;)d.pop();return t.d=d,t.e=a,gn?tn(t,p):t}function ws(e,t,n){if(e!==~~e||e<t||e>n)throw Error(To+e)}function ds(e){var t,n,r,a=e.length-1,i="",o=e[0];if(a>0){for(i+=o,t=1;t<a;t++)r=e[t]+"",n=pn-r.length,n&&(i+=Ii(n)),i+=r;o=e[t],r=o+"",n=pn-r.length,n&&(i+=Ii(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return i+o}var Xs=(function(){function e(r,a){var i,o=0,c=r.length;for(r=r.slice();c--;)i=r[c]*a+o,r[c]=i%er|0,o=i/er|0;return o&&r.unshift(o),r}function t(r,a,i,o){var c,d;if(i!=o)d=i>o?1:-1;else for(c=d=0;c<i;c++)if(r[c]!=a[c]){d=r[c]>a[c]?1:-1;break}return d}function n(r,a,i){for(var o=0;i--;)r[i]-=o,o=r[i]<a[i]?1:0,r[i]=o*er+r[i]-a[i];for(;!r[0]&&r.length>1;)r.shift()}return function(r,a,i,o){var c,d,f,h,p,x,g,j,b,y,S,C,N,E,_,P,O,T,I=r.constructor,M=r.s==a.s?1:-1,D=r.d,R=a.d;if(!r.s)return new I(r);if(!a.s)throw Error(_a+"Division by zero");for(d=r.e-a.e,O=R.length,_=D.length,g=new I(M),j=g.d=[],f=0;R[f]==(D[f]||0);)++f;if(R[f]>(D[f]||0)&&--d,i==null?C=i=I.precision:o?C=i+($n(r)-$n(a))+1:C=i,C<0)return new I(0);if(C=C/pn+2|0,f=0,O==1)for(h=0,R=R[0],C++;(f<_||h)&&C--;f++)N=h*er+(D[f]||0),j[f]=N/R|0,h=N%R|0;else{for(h=er/(R[0]+1)|0,h>1&&(R=e(R,h),D=e(D,h),O=R.length,_=D.length),E=O,b=D.slice(0,O),y=b.length;y<O;)b[y++]=0;T=R.slice(),T.unshift(0),P=R[0],R[1]>=er/2&&++P;do h=0,c=t(R,b,O,y),c<0?(S=b[0],O!=y&&(S=S*er+(b[1]||0)),h=S/P|0,h>1?(h>=er&&(h=er-1),p=e(R,h),x=p.length,y=b.length,c=t(p,b,x,y),c==1&&(h--,n(p,O<x?T:R,x))):(h==0&&(c=h=1),p=R.slice()),x=p.length,x<y&&p.unshift(0),n(b,p,y),c==-1&&(y=b.length,c=t(R,b,O,y),c<1&&(h++,n(b,O<y?T:R,y))),y=b.length):c===0&&(h++,b=[0]),j[f++]=h,c&&b[0]?b[y++]=D[E]||0:(b=[D[E]],y=1);while((E++<_||b[0]!==void 0)&&C--)}return j[0]||j.shift(),g.e=d,tn(g,o?i+$n(g)+1:i)}})();function AL(e,t){var n,r,a,i,o,c,d=0,f=0,h=e.constructor,p=h.precision;if($n(e)>16)throw Error(cC+$n(e));if(!e.s)return new h(ta);for(gn=!1,c=p,o=new h(.03125);e.abs().gte(.1);)e=e.times(o),f+=5;for(r=Math.log(No(2,f))/Math.LN10*2+5|0,c+=r,n=a=i=new h(ta),h.precision=c;;){if(a=tn(a.times(e),c),n=n.times(++d),o=i.plus(Xs(a,n,c)),ds(o.d).slice(0,c)===ds(i.d).slice(0,c)){for(;f--;)i=tn(i.times(i),c);return h.precision=p,t==null?(gn=!0,tn(i,p)):i}i=o}}function $n(e){for(var t=e.e*pn,n=e.d[0];n>=10;n/=10)t++;return t}function Xw(e,t,n){if(t>e.LN10.sd())throw gn=!0,n&&(e.precision=n),Error(_a+"LN10 precision limit exceeded");return tn(new e(e.LN10),t)}function Ii(e){for(var t="";e--;)t+="0";return t}function Bd(e,t){var n,r,a,i,o,c,d,f,h,p=1,x=10,g=e,j=g.d,b=g.constructor,y=b.precision;if(g.s<1)throw Error(_a+(g.s?"NaN":"-Infinity"));if(g.eq(ta))return new b(0);if(t==null?(gn=!1,f=y):f=t,g.eq(10))return t==null&&(gn=!0),Xw(b,f);if(f+=x,b.precision=f,n=ds(j),r=n.charAt(0),i=$n(g),Math.abs(i)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=ds(g.d),r=n.charAt(0),p++;i=$n(g),r>1?(g=new b("0."+n),i++):g=new b(r+"."+n.slice(1))}else return d=Xw(b,f+2,y).times(i+""),g=Bd(new b(r+"."+n.slice(1)),f-x).plus(d),b.precision=y,t==null?(gn=!0,tn(g,y)):g;for(c=o=g=Xs(g.minus(ta),g.plus(ta),f),h=tn(g.times(g),f),a=3;;){if(o=tn(o.times(h),f),d=c.plus(Xs(o,new b(a),f)),ds(d.d).slice(0,f)===ds(c.d).slice(0,f))return c=c.times(2),i!==0&&(c=c.plus(Xw(b,f+2,y).times(i+""))),c=Xs(c,new b(p),f),b.precision=y,t==null?(gn=!0,tn(c,y)):c;c=d,a+=2}}function i2(e,t){var n,r,a;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(r,a),t){if(a-=r,n=n-r-1,e.e=lu(n/pn),e.d=[],r=(n+1)%pn,n<0&&(r+=pn),r<a){for(r&&e.d.push(+t.slice(0,r)),a-=pn;r<a;)e.d.push(+t.slice(r,r+=pn));t=t.slice(r),r=pn-t.length}else r-=a;for(;r--;)t+="0";if(e.d.push(+t),gn&&(e.e>im||e.e<-im))throw Error(cC+n)}else e.s=0,e.e=0,e.d=[0];return e}function tn(e,t,n){var r,a,i,o,c,d,f,h,p=e.d;for(o=1,i=p[0];i>=10;i/=10)o++;if(r=t-o,r<0)r+=pn,a=t,f=p[h=0];else{if(h=Math.ceil((r+1)/pn),i=p.length,h>=i)return e;for(f=i=p[h],o=1;i>=10;i/=10)o++;r%=pn,a=r-pn+o}if(n!==void 0&&(i=No(10,o-a-1),c=f/i%10|0,d=t<0||p[h+1]!==void 0||f%i,d=n<4?(c||d)&&(n==0||n==(e.s<0?3:2)):c>5||c==5&&(n==4||d||n==6&&(r>0?a>0?f/No(10,o-a):0:p[h-1])%10&1||n==(e.s<0?8:7))),t<1||!p[0])return d?(i=$n(e),p.length=1,t=t-i-1,p[0]=No(10,(pn-t%pn)%pn),e.e=lu(-t/pn)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(r==0?(p.length=h,i=1,h--):(p.length=h+1,i=No(10,pn-r),p[h]=a>0?(f/No(10,o-a)%No(10,a)|0)*i:0),d)for(;;)if(h==0){(p[0]+=i)==er&&(p[0]=1,++e.e);break}else{if(p[h]+=i,p[h]!=er)break;p[h--]=0,i=1}for(r=p.length;p[--r]===0;)p.pop();if(gn&&(e.e>im||e.e<-im))throw Error(cC+$n(e));return e}function _L(e,t){var n,r,a,i,o,c,d,f,h,p,x=e.constructor,g=x.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new x(e),gn?tn(t,g):t;if(d=e.d,p=t.d,r=t.e,f=e.e,d=d.slice(),o=f-r,o){for(h=o<0,h?(n=d,o=-o,c=p.length):(n=p,r=f,c=d.length),a=Math.max(Math.ceil(g/pn),c)+2,o>a&&(o=a,n.length=1),n.reverse(),a=o;a--;)n.push(0);n.reverse()}else{for(a=d.length,c=p.length,h=a<c,h&&(c=a),a=0;a<c;a++)if(d[a]!=p[a]){h=d[a]<p[a];break}o=0}for(h&&(n=d,d=p,p=n,t.s=-t.s),c=d.length,a=p.length-c;a>0;--a)d[c++]=0;for(a=p.length;a>o;){if(d[--a]<p[a]){for(i=a;i&&d[--i]===0;)d[i]=er-1;--d[i],d[a]+=er}d[a]-=p[a]}for(;d[--c]===0;)d.pop();for(;d[0]===0;d.shift())--r;return d[0]?(t.d=d,t.e=r,gn?tn(t,g):t):new x(0)}function Fo(e,t,n){var r,a=$n(e),i=ds(e.d),o=i.length;return t?(n&&(r=n-o)>0?i=i.charAt(0)+"."+i.slice(1)+Ii(r):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+Ii(-a-1)+i,n&&(r=n-o)>0&&(i+=Ii(r))):a>=o?(i+=Ii(a+1-o),n&&(r=n-a-1)>0&&(i=i+"."+Ii(r))):((r=a+1)<o&&(i=i.slice(0,r)+"."+i.slice(r)),n&&(r=n-o)>0&&(a+1===o&&(i+="."),i+=Ii(r))),e.s<0?"-"+i:i}function o2(e,t){if(e.length>t)return e.length=t,!0}function EL(e){var t,n,r;function a(i){var o=this;if(!(o instanceof a))return new a(i);if(o.constructor=a,i instanceof a){o.s=i.s,o.e=i.e,o.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(To+i);if(i>0)o.s=1;else if(i<0)i=-i,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(i===~~i&&i<1e7){o.e=0,o.d=[i];return}return i2(o,i.toString())}else if(typeof i!="string")throw Error(To+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,Une.test(i))i2(o,i);else throw Error(To+i)}if(a.prototype=Ze,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=EL,a.config=a.set=qne,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 a.config(e),a}function qne(e){if(!e||typeof e!="object")throw Error(_a+"Object expected");var t,n,r,a=["precision",1,ou,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<a.length;t+=3)if((r=e[n=a[t]])!==void 0)if(lu(r)===r&&r>=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(To+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(To+n+": "+r);return this}var uC=EL(zne);ta=new uC(1);const Jt=uC;function Wne(e){return Gne(e)||Kne(e)||Hne(e)||Vne()}function Vne(){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 Hne(e,t){if(e){if(typeof e=="string")return R1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return R1(e,t)}}function Kne(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Gne(e){if(Array.isArray(e))return R1(e)}function R1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Yne=function(t){return t},PL={},kL=function(t){return t===PL},l2=function(t){return function n(){return arguments.length===0||arguments.length===1&&kL(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},Xne=function e(t,n){return t===1?n:l2(function(){for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];var o=a.filter(function(c){return c!==PL}).length;return o>=t?n.apply(void 0,a):e(t-o,l2(function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];var h=a.map(function(p){return kL(p)?d.shift():p});return n.apply(void 0,Wne(h).concat(d))}))})},Uv=function(t){return Xne(t.length,t)},I1=function(t,n){for(var r=[],a=t;a<n;++a)r[a-t]=a;return r},Qne=Uv(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),Jne=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return Yne;var a=n.reverse(),i=a[0],o=a.slice(1);return function(){return o.reduce(function(c,d){return d(c)},i.apply(void 0,arguments))}},M1=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},OL=function(t){var n=null,r=null;return function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return n&&i.every(function(c,d){return c===n[d]})||(n=i,r=t.apply(void 0,i)),r}};function Zne(e){var t;return e===0?t=1:t=Math.floor(new Jt(e).abs().log(10).toNumber())+1,t}function ere(e,t,n){for(var r=new Jt(e),a=0,i=[];r.lt(t)&&a<1e5;)i.push(r.toNumber()),r=r.add(n),a++;return i}var tre=Uv(function(e,t,n){var r=+e,a=+t;return r+n*(a-r)}),nre=Uv(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),rre=Uv(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const qv={rangeStep:ere,getDigitCount:Zne,interpolateNumber:tre,uninterpolateNumber:nre,uninterpolateTruncation:rre};function $1(e){return ire(e)||sre(e)||TL(e)||are()}function are(){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 sre(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function ire(e){if(Array.isArray(e))return D1(e)}function zd(e,t){return cre(e)||lre(e,t)||TL(e,t)||ore()}function ore(){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 TL(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 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 lre(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,a=!1,i=void 0;try{for(var o=e[Symbol.iterator](),c;!(r=(c=o.next()).done)&&(n.push(c.value),!(t&&n.length===t));r=!0);}catch(d){a=!0,i=d}finally{try{!r&&o.return!=null&&o.return()}finally{if(a)throw i}}return n}}function cre(e){if(Array.isArray(e))return e}function RL(e){var t=zd(e,2),n=t[0],r=t[1],a=n,i=r;return n>r&&(a=r,i=n),[a,i]}function IL(e,t,n){if(e.lte(0))return new Jt(0);var r=qv.getDigitCount(e.toNumber()),a=new Jt(10).pow(r),i=e.div(a),o=r!==1?.05:.1,c=new Jt(Math.ceil(i.div(o).toNumber())).add(n).mul(o),d=c.mul(a);return t?d:new Jt(Math.ceil(d))}function ure(e,t,n){var r=1,a=new Jt(e);if(!a.isint()&&n){var i=Math.abs(e);i<1?(r=new Jt(10).pow(qv.getDigitCount(e)-1),a=new Jt(Math.floor(a.div(r).toNumber())).mul(r)):i>1&&(a=new Jt(Math.floor(e)))}else e===0?a=new Jt(Math.floor((t-1)/2)):n||(a=new Jt(Math.floor(e)));var o=Math.floor((t-1)/2),c=Jne(Qne(function(d){return a.add(new Jt(d-o).mul(r)).toNumber()}),I1);return c(0,t)}function ML(e,t,n,r){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new Jt(0),tickMin:new Jt(0),tickMax:new Jt(0)};var i=IL(new Jt(t).sub(e).div(n-1),r,a),o;e<=0&&t>=0?o=new Jt(0):(o=new Jt(e).add(t).div(2),o=o.sub(new Jt(o).mod(i)));var c=Math.ceil(o.sub(e).div(i).toNumber()),d=Math.ceil(new Jt(t).sub(o).div(i).toNumber()),f=c+d+1;return f>n?ML(e,t,n,r,a+1):(f<n&&(d=t>0?d+(n-f):d,c=t>0?c:c+(n-f)),{step:i,tickMin:o.sub(new Jt(c).mul(i)),tickMax:o.add(new Jt(d).mul(i))})}function dre(e){var t=zd(e,2),n=t[0],r=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(a,2),c=RL([n,r]),d=zd(c,2),f=d[0],h=d[1];if(f===-1/0||h===1/0){var p=h===1/0?[f].concat($1(I1(0,a-1).map(function(){return 1/0}))):[].concat($1(I1(0,a-1).map(function(){return-1/0})),[h]);return n>r?M1(p):p}if(f===h)return ure(f,a,i);var x=ML(f,h,o,i),g=x.step,j=x.tickMin,b=x.tickMax,y=qv.rangeStep(j,b.add(new Jt(.1).mul(g)),g);return n>r?M1(y):y}function fre(e,t){var n=zd(e,2),r=n[0],a=n[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=RL([r,a]),c=zd(o,2),d=c[0],f=c[1];if(d===-1/0||f===1/0)return[r,a];if(d===f)return[d];var h=Math.max(t,2),p=IL(new Jt(f).sub(d).div(h-1),i,0),x=[].concat($1(qv.rangeStep(new Jt(d),new Jt(f).sub(new Jt(.99).mul(p)),p)),[f]);return r>a?M1(x):x}var pre=OL(dre),hre=OL(fre),mre="Invariant failed";function Bo(e,t){throw new Error(mre)}var vre=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Ac(e){"@babel/helpers - typeof";return Ac=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},Ac(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 gre(e,t){return wre(e)||bre(e,t)||yre(e,t)||xre()}function xre(){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 yre(e,t){if(e){if(typeof e=="string")return c2(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 c2(e,t)}}function c2(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 bre(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function wre(e){if(Array.isArray(e))return e}function jre(e,t){if(e==null)return{};var n=Sre(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Sre(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 Nre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cre(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,LL(r.key),r)}}function Are(e,t,n){return t&&Cre(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _re(e,t,n){return t=lm(t),Ere(e,$L()?Reflect.construct(t,n||[],lm(e).constructor):t.apply(e,n))}function Ere(e,t){if(t&&(Ac(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Pre(e)}function Pre(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $L(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($L=function(){return!!e})()}function lm(e){return lm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},lm(e)}function kre(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&L1(e,t)}function L1(e,t){return L1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},L1(e,t)}function DL(e,t,n){return t=LL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LL(e){var t=Ore(e,"string");return Ac(t)=="symbol"?t:t+""}function Ore(e,t){if(Ac(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ac(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Rf=(function(e){function t(){return Nre(this,t),_re(this,t,arguments)}return kre(t,e),Are(t,[{key:"render",value:function(){var r=this.props,a=r.offset,i=r.layout,o=r.width,c=r.dataKey,d=r.data,f=r.dataPointFormatter,h=r.xAxis,p=r.yAxis,x=jre(r,vre),g=gt(x,!1);this.props.direction==="x"&&h.type!=="number"&&Bo();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 _=[],P,O;if(Array.isArray(E)){var T=gre(E,2);P=T[0],O=T[1]}else P=O=E;if(i==="vertical"){var I=h.scale,M=C+a,D=M+o,R=M-o,q=I(N-P),U=I(N+O);_.push({x1:U,y1:D,x2:U,y2:R}),_.push({x1:q,y1:M,x2:U,y2:M}),_.push({x1:q,y1:D,x2:q,y2:R})}else if(i==="horizontal"){var H=p.scale,J=S+a,Z=J-o,F=J+o,z=H(N-P),ee=H(N+O);_.push({x1:Z,y1:ee,x2:F,y2:ee}),_.push({x1:J,y1:z,x2:J,y2:ee}),_.push({x1:Z,y1:z,x2:F,y2:z})}return W.createElement(qt,om({className:"recharts-errorBar",key:"bar-".concat(_.map(function(B){return"".concat(B.x1,"-").concat(B.x2,"-").concat(B.y1,"-").concat(B.y2)}))},g),_.map(function(B){return W.createElement("line",om({},B,{key:"line-".concat(B.x1,"-").concat(B.x2,"-").concat(B.y1,"-").concat(B.y2)}))}))});return W.createElement(qt,{className:"recharts-errorBars"},j)}}])})(W.Component);DL(Rf,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});DL(Rf,"displayName","ErrorBar");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 u2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function go(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?u2(Object(n),!0).forEach(function(r){Tre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tre(e,t,n){return t=Rre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rre(e){var t=Ire(e,"string");return Ud(t)=="symbol"?t:t+""}function Ire(e,t){if(Ud(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ud(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var FL=function(t){var n=t.children,r=t.formattedGraphicalItems,a=t.legendWidth,i=t.legendContent,o=Jr(n,ko);if(!o)return null;var c=ko.defaultProps,d=c!==void 0?go(go({},c),o.props):{},f;return o.props&&o.props.payload?f=o.props&&o.props.payload:i==="children"?f=(r||[]).reduce(function(h,p){var x=p.item,g=p.props,j=g.sectors||g.data||[];return h.concat(j.map(function(b){return{type:o.props.iconType||x.props.legendType,value:b.name,color:b.fill,payload:b}}))},[]):f=(r||[]).map(function(h){var p=h.item,x=p.type.defaultProps,g=x!==void 0?go(go({},x),p.props):{},j=g.dataKey,b=g.name,y=g.legendType,S=g.hide;return{inactive:S,dataKey:j,type:d.iconType||y||"square",color:dC(p),value:b||j,payload:g}}),go(go(go({},d),ko.getWithHeight(o,a)),{},{payload:f,item:o})};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 d2(e){return Lre(e)||Dre(e)||$re(e)||Mre()}function Mre(){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 $re(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 Dre(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Lre(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}function f2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function _n(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?f2(Object(n),!0).forEach(function(r){cc(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cc(e,t,n){return t=Fre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fre(e){var t=Bre(e,"string");return qd(t)=="symbol"?t:t+""}function Bre(e,t){if(qd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(qd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qn(e,t,n){return At(e)||At(t)?n:Wn(t)?sa(e,t,n):Ct(t)?t(e):n}function md(e,t,n,r){var a=Lne(e,function(c){return qn(c,t)});if(n==="number"){var i=a.filter(function(c){return We(c)||parseFloat(c)});return i.length?[zv(i),Bv(i)]:[1/0,-1/0]}var o=r?a.filter(function(c){return!At(c)}):a;return o.map(function(c){return Wn(c)||c instanceof Date?c:""})}var zre=function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=-1,c=(n=r?.length)!==null&&n!==void 0?n:0;if(c<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var d=i.range,f=0;f<c;f++){var h=f>0?a[f-1].coordinate:a[c-1].coordinate,p=a[f].coordinate,x=f>=c-1?a[0].coordinate:a[f+1].coordinate,g=void 0;if(jr(p-h)!==jr(x-p)){var j=[];if(jr(x-p)===jr(d[1]-d[0])){g=x;var b=p+d[1]-d[0];j[0]=Math.min(b,(b+h)/2),j[1]=Math.max(b,(b+h)/2)}else{g=h;var y=x+d[1]-d[0];j[0]=Math.min(p,(y+p)/2),j[1]=Math.max(p,(y+p)/2)}var S=[Math.min(p,(g+p)/2),Math.max(p,(g+p)/2)];if(t>S[0]&&t<=S[1]||t>=j[0]&&t<=j[1]){o=a[f].index;break}}else{var C=Math.min(h,x),N=Math.max(h,x);if(t>(C+p)/2&&t<=(N+p)/2){o=a[f].index;break}}}else for(var E=0;E<c;E++)if(E===0&&t<=(r[E].coordinate+r[E+1].coordinate)/2||E>0&&E<c-1&&t>(r[E].coordinate+r[E-1].coordinate)/2&&t<=(r[E].coordinate+r[E+1].coordinate)/2||E===c-1&&t>(r[E].coordinate+r[E-1].coordinate)/2){o=r[E].index;break}return o},dC=function(t){var n,r=t,a=r.type.displayName,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?_n(_n({},t.type.defaultProps),t.props):t.props,o=i.stroke,c=i.fill,d;switch(a){case"Line":d=o;break;case"Area":case"Radar":d=o&&o!=="none"?o:c;break;default:d=c;break}return d},Ure=function(t){var n=t.barSize,r=t.totalSize,a=t.stackGroups,i=a===void 0?{}:a;if(!i)return{};for(var o={},c=Object.keys(i),d=0,f=c.length;d<f;d++)for(var h=i[c[d]].stackGroups,p=Object.keys(h),x=0,g=p.length;x<g;x++){var j=h[p[x]],b=j.items,y=j.cateAxisId,S=b.filter(function(O){return Gs(O.type).indexOf("Bar")>=0});if(S&&S.length){var C=S[0].type.defaultProps,N=C!==void 0?_n(_n({},C),S[0].props):S[0].props,E=N.barSize,_=N[y];o[_]||(o[_]=[]);var P=At(E)?n:E;o[_].push({item:S[0],stackList:S.slice(1),barSize:At(P)?void 0:Sr(P,r,0)})}}return o},qre=function(t){var n=t.barGap,r=t.barCategoryGap,a=t.bandSize,i=t.sizeList,o=i===void 0?[]:i,c=t.maxBarSize,d=o.length;if(d<1)return null;var f=Sr(n,a,0,!0),h,p=[];if(o[0].barSize===+o[0].barSize){var x=!1,g=a/d,j=o.reduce(function(E,_){return E+_.barSize||0},0);j+=(d-1)*f,j>=a&&(j-=(d-1)*f,f=0),j>=a&&g>0&&(x=!0,g*=.9,j=d*g);var b=(a-j)/2>>0,y={offset:b-f,size:0};h=o.reduce(function(E,_){var P={item:_.item,position:{offset:y.offset+y.size+f,size:x?g:_.barSize}},O=[].concat(d2(E),[P]);return y=O[O.length-1].position,_.stackList&&_.stackList.length&&_.stackList.forEach(function(T){O.push({item:T,position:y})}),O},p)}else{var S=Sr(r,a,0,!0);a-2*S-(d-1)*f<=0&&(f=0);var C=(a-2*S-(d-1)*f)/d;C>1&&(C>>=0);var N=c===+c?Math.min(C,c):C;h=o.reduce(function(E,_,P){var O=[].concat(d2(E),[{item:_.item,position:{offset:S+(C+f)*P+(C-N)/2,size:N}}]);return _.stackList&&_.stackList.length&&_.stackList.forEach(function(T){O.push({item:T,position:O[O.length-1].position})}),O},p)}return h},Wre=function(t,n,r,a){var i=r.children,o=r.width,c=r.margin,d=o-(c.left||0)-(c.right||0),f=FL({children:i,legendWidth:d});if(f){var h=a||{},p=h.width,x=h.height,g=f.align,j=f.verticalAlign,b=f.layout;if((b==="vertical"||b==="horizontal"&&j==="middle")&&g!=="center"&&We(t[g]))return _n(_n({},t),{},cc({},g,t[g]+(p||0)));if((b==="horizontal"||b==="vertical"&&g==="center")&&j!=="middle"&&We(t[j]))return _n(_n({},t),{},cc({},j,t[j]+(x||0)))}return t},Vre=function(t,n,r){return At(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},BL=function(t,n,r,a,i){var o=n.props.children,c=ia(o,Rf).filter(function(f){return Vre(a,i,f.props.direction)});if(c&&c.length){var d=c.map(function(f){return f.props.dataKey});return t.reduce(function(f,h){var p=qn(h,r);if(At(p))return f;var x=Array.isArray(p)?[zv(p),Bv(p)]:[p,p],g=d.reduce(function(j,b){var y=qn(h,b,0),S=x[0]-Math.abs(Array.isArray(y)?y[0]:y),C=x[1]+Math.abs(Array.isArray(y)?y[1]:y);return[Math.min(S,j[0]),Math.max(C,j[1])]},[1/0,-1/0]);return[Math.min(g[0],f[0]),Math.max(g[1],f[1])]},[1/0,-1/0])}return null},Hre=function(t,n,r,a,i){var o=n.map(function(c){return BL(t,c,r,i,a)}).filter(function(c){return!At(c)});return o&&o.length?o.reduce(function(c,d){return[Math.min(c[0],d[0]),Math.max(c[1],d[1])]},[1/0,-1/0]):null},zL=function(t,n,r,a,i){var o=n.map(function(d){var f=d.props.dataKey;return r==="number"&&f&&BL(t,d,f,a)||md(t,f,r,i)});if(r==="number")return o.reduce(function(d,f){return[Math.min(d[0],f[0]),Math.max(d[1],f[1])]},[1/0,-1/0]);var c={};return o.reduce(function(d,f){for(var h=0,p=f.length;h<p;h++)c[f[h]]||(c[f[h]]=!0,d.push(f[h]));return d},[])},UL=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},Po=function(t,n,r){if(!t)return null;var a=t.scale,i=t.duplicateDomain,o=t.type,c=t.range,d=t.realScaleType==="scaleBand"?a.bandwidth()/2:2,f=(n||r)&&o==="category"&&a.bandwidth?a.bandwidth()/d:0;if(f=t.axisType==="angleAxis"&&c?.length>=2?jr(c[0]-c[1])*2*f:f,n&&(t.ticks||t.niceTicks)){var h=(t.ticks||t.niceTicks).map(function(p){var x=i?i.indexOf(p):p;return{coordinate:a(x)+f,value:p,offset:f}});return h.filter(function(p){return!Af(p.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(p,x){return{coordinate:a(p)+f,value:p,index:x,offset:f}}):a.ticks&&!r?a.ticks(t.tickCount).map(function(p){return{coordinate:a(p)+f,value:p,offset:f}}):a.domain().map(function(p,x){return{coordinate:a(p)+f,value:i?i[p]:p,index:x,offset:f}})},Qw=new WeakMap,ch=function(t,n){if(typeof n!="function")return t;Qw.has(t)||Qw.set(t,new WeakMap);var r=Qw.get(t);if(r.has(n))return r.get(n);var a=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,a),a},qL=function(t,n,r){var a=t.scale,i=t.type,o=t.layout,c=t.axisType;if(a==="auto")return o==="radial"&&c==="radiusAxis"?{scale:Md(),realScaleType:"band"}:o==="radial"&&c==="angleAxis"?{scale:nm(),realScaleType:"linear"}:i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:hd(),realScaleType:"point"}:i==="category"?{scale:Md(),realScaleType:"band"}:{scale:nm(),realScaleType:"linear"};if($o(a)){var d="scale".concat(Cv(a));return{scale:(QR[d]||hd)(),realScaleType:QR[d]?d:"point"}}return Ct(a)?{scale:a}:{scale:hd(),realScaleType:"point"}},p2=1e-4,WL=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,a=t.range(),i=Math.min(a[0],a[1])-p2,o=Math.max(a[0],a[1])+p2,c=t(n[0]),d=t(n[r-1]);(c<i||c>o||d<i||d>o)&&t.domain([n[0],n[r-1]])}},Kre=function(t,n){if(!t)return null;for(var r=0,a=t.length;r<a;r++)if(t[r].item===n)return t[r].position;return null},Gre=function(t,n){if(!n||n.length!==2||!We(n[0])||!We(n[1]))return t;var r=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]),i=[t[0],t[1]];return(!We(t[0])||t[0]<r)&&(i[0]=r),(!We(t[1])||t[1]>a)&&(i[1]=a),i[0]>a&&(i[0]=a),i[1]<r&&(i[1]=r),i},Yre=function(t){var n=t.length;if(!(n<=0))for(var r=0,a=t[0].length;r<a;++r)for(var i=0,o=0,c=0;c<n;++c){var d=Af(t[c][r][1])?t[c][r][0]:t[c][r][1];d>=0?(t[c][r][0]=i,t[c][r][1]=i+d,i=t[c][r][1]):(t[c][r][0]=o,t[c][r][1]=o+d,o=t[c][r][1])}},Xre=function(t){var n=t.length;if(!(n<=0))for(var r=0,a=t[0].length;r<a;++r)for(var i=0,o=0;o<n;++o){var c=Af(t[o][r][1])?t[o][r][0]:t[o][r][1];c>=0?(t[o][r][0]=i,t[o][r][1]=i+c,i=t[o][r][1]):(t[o][r][0]=0,t[o][r][1]=0)}},Qre={sign:Yre,expand:LX,none:xc,silhouette:FX,wiggle:BX,positive:Xre},Jre=function(t,n,r){var a=n.map(function(c){return c.props.dataKey}),i=Qre[r],o=DX().keys(a).value(function(c,d){return+qn(c,d,0)}).order(m1).offset(i);return o(t)},Zre=function(t,n,r,a,i,o){if(!t)return null;var c=o?n.reverse():n,d={},f=c.reduce(function(p,x){var g,j=(g=x.type)!==null&&g!==void 0&&g.defaultProps?_n(_n({},x.type.defaultProps),x.props):x.props,b=j.stackId,y=j.hide;if(y)return p;var S=j[r],C=p[S]||{hasStack:!1,stackGroups:{}};if(Wn(b)){var N=C.stackGroups[b]||{numericAxisId:r,cateAxisId:a,items:[]};N.items.push(x),C.hasStack=!0,C.stackGroups[b]=N}else C.stackGroups[au("_stackId_")]={numericAxisId:r,cateAxisId:a,items:[x]};return _n(_n({},p),{},cc({},S,C))},d),h={};return Object.keys(f).reduce(function(p,x){var g=f[x];if(g.hasStack){var j={};g.stackGroups=Object.keys(g.stackGroups).reduce(function(b,y){var S=g.stackGroups[y];return _n(_n({},b),{},cc({},y,{numericAxisId:r,cateAxisId:a,items:S.items,stackedData:Jre(t,S.items,i)}))},j)}return _n(_n({},p),{},cc({},x,g))},h)},VL=function(t,n){var r=n.realScaleType,a=n.type,i=n.tickCount,o=n.originalDomain,c=n.allowDecimals,d=r||n.scale;if(d!=="auto"&&d!=="linear")return null;if(i&&a==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var f=t.domain();if(!f.length)return null;var h=pre(f,i,c);return t.domain([zv(h),Bv(h)]),{niceTicks:h}}if(i&&a==="number"){var p=t.domain(),x=hre(p,i,c);return{niceTicks:x}}return null};function h2(e){var t=e.axis,n=e.ticks,r=e.bandSize,a=e.entry,i=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!At(a[t.dataKey])){var c=$h(n,"value",a[t.dataKey]);if(c)return c.coordinate+r/2}return n[i]?n[i].coordinate+r/2:null}var d=qn(a,At(o)?t.dataKey:o);return At(d)?null:t.scale(d)}var m2=function(t){var n=t.axis,r=t.ticks,a=t.offset,i=t.bandSize,o=t.entry,c=t.index;if(n.type==="category")return r[c]?r[c].coordinate+a:null;var d=qn(o,n.dataKey,n.domain[c]);return At(d)?null:n.scale(d)-i/2+a},eae=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var a=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]);return a<=0&&i>=0?0:i<0?i:a}return r[0]},tae=function(t,n){var r,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?_n(_n({},t.type.defaultProps),t.props):t.props,i=a.stackId;if(Wn(i)){var o=n[i];if(o){var c=o.items.indexOf(t);return c>=0?o.stackedData[c]:null}}return null},nae=function(t){return t.reduce(function(n,r){return[zv(r.concat([n[0]]).filter(We)),Bv(r.concat([n[1]]).filter(We))]},[1/0,-1/0])},HL=function(t,n,r){return Object.keys(t).reduce(function(a,i){var o=t[i],c=o.stackedData,d=c.reduce(function(f,h){var p=nae(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],a[0]),Math.max(d[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},v2=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,g2=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,B1=function(t,n,r){if(Ct(t))return t(n,r);if(!Array.isArray(t))return n;var a=[];if(We(t[0]))a[0]=r?t[0]:Math.min(t[0],n[0]);else if(v2.test(t[0])){var i=+v2.exec(t[0])[1];a[0]=n[0]-i}else Ct(t[0])?a[0]=t[0](n[0]):a[0]=n[0];if(We(t[1]))a[1]=r?t[1]:Math.max(t[1],n[1]);else if(g2.test(t[1])){var o=+g2.exec(t[1])[1];a[1]=n[1]+o}else Ct(t[1])?a[1]=t[1](n[1]):a[1]=n[1];return a},cm=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!r||a>0)return a}if(t&&n&&n.length>=2){for(var i=FN(n,function(p){return p.coordinate}),o=1/0,c=1,d=i.length;c<d;c++){var f=i[c],h=i[c-1];o=Math.min((f.coordinate||0)-(h.coordinate||0),o)}return o===1/0?0:o}return r?void 0:0},x2=function(t,n,r){return!t||!t.length||Tf(t,sa(r,"type.defaultProps.domain"))?n:t},KL=function(t,n){var r=t.type.defaultProps?_n(_n({},t.type.defaultProps),t.props):t.props,a=r.dataKey,i=r.name,o=r.unit,c=r.formatter,d=r.tooltipType,f=r.chartType,h=r.hide;return _n(_n({},gt(t,!1)),{},{dataKey:a,unit:o,formatter:c,name:i||a,color:dC(t),value:qn(n,a),type:d,payload:n,chartType:f,hide:h})};function Wd(e){"@babel/helpers - typeof";return Wd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wd(e)}function y2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function zs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?y2(Object(n),!0).forEach(function(r){GL(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function GL(e,t,n){return t=rae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rae(e){var t=aae(e,"string");return Wd(t)=="symbol"?t:t+""}function aae(e,t){if(Wd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Wd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sae(e,t){return cae(e)||lae(e,t)||oae(e,t)||iae()}function iae(){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 oae(e,t){if(e){if(typeof e=="string")return b2(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 b2(e,t)}}function b2(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 lae(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function cae(e){if(Array.isArray(e))return e}var um=Math.PI/180,uae=function(t){return t*180/Math.PI},on=function(t,n,r,a){return{x:t+Math.cos(-um*a)*r,y:n+Math.sin(-um*a)*r}},YL=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},dae=function(t,n,r,a,i){var o=t.width,c=t.height,d=t.startAngle,f=t.endAngle,h=Sr(t.cx,o,o/2),p=Sr(t.cy,c,c/2),x=YL(o,c,r),g=Sr(t.innerRadius,x,0),j=Sr(t.outerRadius,x,x*.8),b=Object.keys(n);return b.reduce(function(y,S){var C=n[S],N=C.domain,E=C.reversed,_;if(At(C.range))a==="angleAxis"?_=[d,f]:a==="radiusAxis"&&(_=[g,j]),E&&(_=[_[1],_[0]]);else{_=C.range;var P=_,O=sae(P,2);d=O[0],f=O[1]}var T=qL(C,i),I=T.realScaleType,M=T.scale;M.domain(N).range(_),WL(M);var D=VL(M,zs(zs({},C),{},{realScaleType:I})),R=zs(zs(zs({},C),D),{},{range:_,radius:j,realScaleType:I,scale:M,cx:h,cy:p,innerRadius:g,outerRadius:j,startAngle:d,endAngle:f});return zs(zs({},y),{},GL({},S,R))},{})},fae=function(t,n){var r=t.x,a=t.y,i=n.x,o=n.y;return Math.sqrt(Math.pow(r-i,2)+Math.pow(a-o,2))},pae=function(t,n){var r=t.x,a=t.y,i=n.cx,o=n.cy,c=fae({x:r,y:a},{x:i,y:o});if(c<=0)return{radius:c};var d=(r-i)/c,f=Math.acos(d);return a>o&&(f=2*Math.PI-f),{radius:c,angle:uae(f),angleInRadian:f}},hae=function(t){var n=t.startAngle,r=t.endAngle,a=Math.floor(n/360),i=Math.floor(r/360),o=Math.min(a,i);return{startAngle:n-o*360,endAngle:r-o*360}},mae=function(t,n){var r=n.startAngle,a=n.endAngle,i=Math.floor(r/360),o=Math.floor(a/360),c=Math.min(i,o);return t+c*360},w2=function(t,n){var r=t.x,a=t.y,i=pae({x:r,y:a},n),o=i.radius,c=i.angle,d=n.innerRadius,f=n.outerRadius;if(o<d||o>f)return!1;if(o===0)return!0;var h=hae(n),p=h.startAngle,x=h.endAngle,g=c,j;if(p<=x){for(;g>x;)g-=360;for(;g<p;)g+=360;j=g>=p&&g<=x}else{for(;g>p;)g-=360;for(;g<x;)g+=360;j=g>=x&&g<=p}return j?zs(zs({},n),{},{radius:o,angle:mae(g,n)}):null},XL=function(t){return!v.isValidElement(t)&&!Ct(t)&&typeof t!="boolean"?t.className:""};function Vd(e){"@babel/helpers - typeof";return Vd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vd(e)}var vae=["offset"];function gae(e){return wae(e)||bae(e)||yae(e)||xae()}function xae(){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 yae(e,t){if(e){if(typeof e=="string")return z1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return z1(e,t)}}function bae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function wae(e){if(Array.isArray(e))return z1(e)}function z1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function jae(e,t){if(e==null)return{};var n=Sae(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Sae(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 j2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Un(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?j2(Object(n),!0).forEach(function(r){Nae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nae(e,t,n){return t=Cae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cae(e){var t=Aae(e,"string");return Vd(t)=="symbol"?t:t+""}function Aae(e,t){if(Vd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Vd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Hd(){return Hd=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},Hd.apply(this,arguments)}var _ae=function(t){var n=t.value,r=t.formatter,a=At(t.children)?n:t.children;return Ct(r)?r(a):a},Eae=function(t,n){var r=jr(n-t),a=Math.min(Math.abs(n-t),360);return r*a},Pae=function(t,n,r){var a=t.position,i=t.viewBox,o=t.offset,c=t.className,d=i,f=d.cx,h=d.cy,p=d.innerRadius,x=d.outerRadius,g=d.startAngle,j=d.endAngle,b=d.clockWise,y=(p+x)/2,S=Eae(g,j),C=S>=0?1:-1,N,E;a==="insideStart"?(N=g+C*o,E=b):a==="insideEnd"?(N=j-C*o,E=!b):a==="end"&&(N=j+C*o,E=b),E=S<=0?E:!E;var _=on(f,h,y,N),P=on(f,h,y,N+(E?1:-1)*359),O="M".concat(_.x,",").concat(_.y,`
75
- A`).concat(y,",").concat(y,",0,1,").concat(E?0:1,`,
76
- `).concat(P.x,",").concat(P.y),T=At(t.id)?au("recharts-radial-line-"):t.id;return W.createElement("text",Hd({},r,{dominantBaseline:"central",className:_t("recharts-radial-bar-label",c)}),W.createElement("defs",null,W.createElement("path",{id:T,d:O})),W.createElement("textPath",{xlinkHref:"#".concat(T)},n))},kae=function(t){var n=t.viewBox,r=t.offset,a=t.position,i=n,o=i.cx,c=i.cy,d=i.innerRadius,f=i.outerRadius,h=i.startAngle,p=i.endAngle,x=(h+p)/2;if(a==="outside"){var g=on(o,c,f+r,x),j=g.x,b=g.y;return{x:j,y:b,textAnchor:j>=o?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"end"};var y=(d+f)/2,S=on(o,c,y,x),C=S.x,N=S.y;return{x:C,y:N,textAnchor:"middle",verticalAnchor:"middle"}},Oae=function(t){var n=t.viewBox,r=t.parentViewBox,a=t.offset,i=t.position,o=n,c=o.x,d=o.y,f=o.width,h=o.height,p=h>=0?1:-1,x=p*a,g=p>0?"end":"start",j=p>0?"start":"end",b=f>=0?1:-1,y=b*a,S=b>0?"end":"start",C=b>0?"start":"end";if(i==="top"){var N={x:c+f/2,y:d-p*a,textAnchor:"middle",verticalAnchor:g};return Un(Un({},N),r?{height:Math.max(d-r.y,0),width:f}:{})}if(i==="bottom"){var E={x:c+f/2,y:d+h+x,textAnchor:"middle",verticalAnchor:j};return Un(Un({},E),r?{height:Math.max(r.y+r.height-(d+h),0),width:f}:{})}if(i==="left"){var _={x:c-y,y:d+h/2,textAnchor:S,verticalAnchor:"middle"};return Un(Un({},_),r?{width:Math.max(_.x-r.x,0),height:h}:{})}if(i==="right"){var P={x:c+f+y,y:d+h/2,textAnchor:C,verticalAnchor:"middle"};return Un(Un({},P),r?{width:Math.max(r.x+r.width-P.x,0),height:h}:{})}var O=r?{width:f,height:h}:{};return i==="insideLeft"?Un({x:c+y,y:d+h/2,textAnchor:C,verticalAnchor:"middle"},O):i==="insideRight"?Un({x:c+f-y,y:d+h/2,textAnchor:S,verticalAnchor:"middle"},O):i==="insideTop"?Un({x:c+f/2,y:d+x,textAnchor:"middle",verticalAnchor:j},O):i==="insideBottom"?Un({x:c+f/2,y:d+h-x,textAnchor:"middle",verticalAnchor:g},O):i==="insideTopLeft"?Un({x:c+y,y:d+x,textAnchor:C,verticalAnchor:j},O):i==="insideTopRight"?Un({x:c+f-y,y:d+x,textAnchor:S,verticalAnchor:j},O):i==="insideBottomLeft"?Un({x:c+y,y:d+h-x,textAnchor:C,verticalAnchor:g},O):i==="insideBottomRight"?Un({x:c+f-y,y:d+h-x,textAnchor:S,verticalAnchor:g},O):ru(i)&&(We(i.x)||Ao(i.x))&&(We(i.y)||Ao(i.y))?Un({x:c+Sr(i.x,f),y:d+Sr(i.y,h),textAnchor:"end",verticalAnchor:"end"},O):Un({x:c+f/2,y:d+h/2,textAnchor:"middle",verticalAnchor:"middle"},O)},Tae=function(t){return"cx"in t&&We(t.cx)};function tr(e){var t=e.offset,n=t===void 0?5:t,r=jae(e,vae),a=Un({offset:n},r),i=a.viewBox,o=a.position,c=a.value,d=a.children,f=a.content,h=a.className,p=h===void 0?"":h,x=a.textBreakAll;if(!i||At(c)&&At(d)&&!v.isValidElement(f)&&!Ct(f))return null;if(v.isValidElement(f))return v.cloneElement(f,a);var g;if(Ct(f)){if(g=v.createElement(f,a),v.isValidElement(g))return g}else g=_ae(a);var j=Tae(i),b=gt(a,!0);if(j&&(o==="insideStart"||o==="insideEnd"||o==="end"))return Pae(a,g,b);var y=j?kae(a):Oae(a);return W.createElement(Lo,Hd({className:_t("recharts-label",p)},b,y,{breakAll:x}),g)}tr.displayName="Label";var QL=function(t){var n=t.cx,r=t.cy,a=t.angle,i=t.startAngle,o=t.endAngle,c=t.r,d=t.radius,f=t.innerRadius,h=t.outerRadius,p=t.x,x=t.y,g=t.top,j=t.left,b=t.width,y=t.height,S=t.clockWise,C=t.labelViewBox;if(C)return C;if(We(b)&&We(y)){if(We(p)&&We(x))return{x:p,y:x,width:b,height:y};if(We(g)&&We(j))return{x:g,y:j,width:b,height:y}}return We(p)&&We(x)?{x:p,y:x,width:0,height:0}:We(n)&&We(r)?{cx:n,cy:r,startAngle:i||a||0,endAngle:o||a||0,innerRadius:f||0,outerRadius:h||d||c||0,clockWise:S}:t.viewBox?t.viewBox:{}},Rae=function(t,n){return t?t===!0?W.createElement(tr,{key:"label-implicit",viewBox:n}):Wn(t)?W.createElement(tr,{key:"label-implicit",viewBox:n,value:t}):v.isValidElement(t)?t.type===tr?v.cloneElement(t,{key:"label-implicit",viewBox:n}):W.createElement(tr,{key:"label-implicit",content:t,viewBox:n}):Ct(t)?W.createElement(tr,{key:"label-implicit",content:t,viewBox:n}):ru(t)?W.createElement(tr,Hd({viewBox:n},t,{key:"label-implicit"})):null:null},Iae=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 a=t.children,i=QL(t),o=ia(a,tr).map(function(d,f){return v.cloneElement(d,{viewBox:n||i,key:"label-".concat(f)})});if(!r)return o;var c=Rae(t.label,n||i);return[c].concat(gae(o))};tr.parseViewBox=QL;tr.renderCallByParent=Iae;var Jw,S2;function Mae(){if(S2)return Jw;S2=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return Jw=e,Jw}var $ae=Mae();const Dae=Yt($ae);function Kd(e){"@babel/helpers - typeof";return Kd=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},Kd(e)}var Lae=["valueAccessor"],Fae=["data","dataKey","clockWise","id","textBreakAll"];function Bae(e){return Wae(e)||qae(e)||Uae(e)||zae()}function zae(){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 Uae(e,t){if(e){if(typeof e=="string")return U1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return U1(e,t)}}function qae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Wae(e){if(Array.isArray(e))return U1(e)}function U1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function dm(){return dm=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},dm.apply(this,arguments)}function N2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function C2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?N2(Object(n),!0).forEach(function(r){Vae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Vae(e,t,n){return t=Hae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hae(e){var t=Kae(e,"string");return Kd(t)=="symbol"?t:t+""}function Kae(e,t){if(Kd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Kd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function A2(e,t){if(e==null)return{};var n=Gae(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Gae(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 Yae=function(t){return Array.isArray(t.value)?Dae(t.value):t.value};function Qs(e){var t=e.valueAccessor,n=t===void 0?Yae:t,r=A2(e,Lae),a=r.data,i=r.dataKey,o=r.clockWise,c=r.id,d=r.textBreakAll,f=A2(r,Fae);return!a||!a.length?null:W.createElement(qt,{className:"recharts-label-list"},a.map(function(h,p){var x=At(i)?n(h,p):qn(h&&h.payload,i),g=At(c)?{}:{id:"".concat(c,"-").concat(p)};return W.createElement(tr,dm({},gt(h,!0),f,g,{parentViewBox:h.parentViewBox,value:x,textBreakAll:d,viewBox:tr.parseViewBox(At(o)?h:C2(C2({},h),{},{clockWise:o})),key:"label-".concat(p),index:p}))}))}Qs.displayName="LabelList";function Xae(e,t){return e?e===!0?W.createElement(Qs,{key:"labelList-implicit",data:t}):W.isValidElement(e)||Ct(e)?W.createElement(Qs,{key:"labelList-implicit",data:t,content:e}):ru(e)?W.createElement(Qs,dm({data:t},e,{key:"labelList-implicit"})):null:null}function Qae(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,a=ia(r,Qs).map(function(o,c){return v.cloneElement(o,{data:t,key:"labelList-".concat(c)})});if(!n)return a;var i=Xae(e.label,t);return[i].concat(Bae(a))}Qs.renderCallByParent=Qae;function Gd(e){"@babel/helpers - typeof";return Gd=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},Gd(e)}function q1(){return q1=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},q1.apply(this,arguments)}function _2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function E2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_2(Object(n),!0).forEach(function(r){Jae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jae(e,t,n){return t=Zae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zae(e){var t=ese(e,"string");return Gd(t)=="symbol"?t:t+""}function ese(e,t){if(Gd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Gd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var tse=function(t,n){var r=jr(n-t),a=Math.min(Math.abs(n-t),359.999);return r*a},uh=function(t){var n=t.cx,r=t.cy,a=t.radius,i=t.angle,o=t.sign,c=t.isExternal,d=t.cornerRadius,f=t.cornerIsExternal,h=d*(c?1:-1)+a,p=Math.asin(d/h)/um,x=f?i:i+o*p,g=on(n,r,h,x),j=on(n,r,a,x),b=f?i-o*p:i,y=on(n,r,h*Math.cos(p*um),b);return{center:g,circleTangency:j,lineTangency:y,theta:p}},JL=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.startAngle,c=t.endAngle,d=tse(o,c),f=o+d,h=on(n,r,i,o),p=on(n,r,i,f),x="M ".concat(h.x,",").concat(h.y,`
78
- A `).concat(i,",").concat(i,`,0,
79
- `).concat(+(Math.abs(d)>180),",").concat(+(o>f),`,
80
- `).concat(p.x,",").concat(p.y,`
81
- `);if(a>0){var g=on(n,r,a,o),j=on(n,r,a,f);x+="L ".concat(j.x,",").concat(j.y,`
82
- A `).concat(a,",").concat(a,`,0,
83
- `).concat(+(Math.abs(d)>180),",").concat(+(o<=f),`,
84
- `).concat(g.x,",").concat(g.y," Z")}else x+="L ".concat(n,",").concat(r," Z");return x},nse=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.cornerRadius,c=t.forceCornerRadius,d=t.cornerIsExternal,f=t.startAngle,h=t.endAngle,p=jr(h-f),x=uh({cx:n,cy:r,radius:i,angle:f,sign:p,cornerRadius:o,cornerIsExternal:d}),g=x.circleTangency,j=x.lineTangency,b=x.theta,y=uh({cx:n,cy:r,radius:i,angle:h,sign:-p,cornerRadius:o,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(o,",").concat(o,",0,0,1,").concat(o*2,`,0
86
- a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0
87
- `):JL({cx:n,cy:r,innerRadius:a,outerRadius:i,startAngle:f,endAngle:h});var _="M ".concat(j.x,",").concat(j.y,`
88
- A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(g.x,",").concat(g.y,`
89
- A`).concat(i,",").concat(i,",0,").concat(+(E>180),",").concat(+(p<0),",").concat(S.x,",").concat(S.y,`
90
- A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(C.x,",").concat(C.y,`
91
- `);if(a>0){var P=uh({cx:n,cy:r,radius:a,angle:f,sign:p,isExternal:!0,cornerRadius:o,cornerIsExternal:d}),O=P.circleTangency,T=P.lineTangency,I=P.theta,M=uh({cx:n,cy:r,radius:a,angle:h,sign:-p,isExternal:!0,cornerRadius:o,cornerIsExternal:d}),D=M.circleTangency,R=M.lineTangency,q=M.theta,U=d?Math.abs(f-h):Math.abs(f-h)-I-q;if(U<0&&o===0)return"".concat(_,"L").concat(n,",").concat(r,"Z");_+="L".concat(R.x,",").concat(R.y,`
92
- A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(D.x,",").concat(D.y,`
93
- A`).concat(a,",").concat(a,",0,").concat(+(U>180),",").concat(+(p>0),",").concat(O.x,",").concat(O.y,`
94
- A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(T.x,",").concat(T.y,"Z")}else _+="L".concat(n,",").concat(r,"Z");return _},rse={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},ZL=function(t){var n=E2(E2({},rse),t),r=n.cx,a=n.cy,i=n.innerRadius,o=n.outerRadius,c=n.cornerRadius,d=n.forceCornerRadius,f=n.cornerIsExternal,h=n.startAngle,p=n.endAngle,x=n.className;if(o<i||h===p)return null;var g=_t("recharts-sector",x),j=o-i,b=Sr(c,j,0,!0),y;return b>0&&Math.abs(h-p)<360?y=nse({cx:r,cy:a,innerRadius:i,outerRadius:o,cornerRadius:Math.min(b,j/2),forceCornerRadius:d,cornerIsExternal:f,startAngle:h,endAngle:p}):y=JL({cx:r,cy:a,innerRadius:i,outerRadius:o,startAngle:h,endAngle:p}),W.createElement("path",q1({},gt(n,!0),{className:g,d:y,role:"img"}))};function Yd(e){"@babel/helpers - typeof";return Yd=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},Yd(e)}function W1(){return W1=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},W1.apply(this,arguments)}function P2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function k2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?P2(Object(n),!0).forEach(function(r){ase(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ase(e,t,n){return t=sse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sse(e){var t=ise(e,"string");return Yd(t)=="symbol"?t:t+""}function ise(e,t){if(Yd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Yd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var O2={curveBasisClosed:AX,curveBasisOpen:_X,curveBasis:CX,curveBumpX:dX,curveBumpY:fX,curveLinearClosed:EX,curveLinear:_v,curveMonotoneX:PX,curveMonotoneY:kX,curveNatural:OX,curveStep:TX,curveStepAfter:IX,curveStepBefore:RX},dh=function(t){return t.x===+t.x&&t.y===+t.y},ed=function(t){return t.x},td=function(t){return t.y},ose=function(t,n){if(Ct(t))return t;var r="curve".concat(Cv(t));return(r==="curveMonotone"||r==="curveBump")&&n?O2["".concat(r).concat(n==="vertical"?"Y":"X")]:O2[r]||_v},lse=function(t){var n=t.type,r=n===void 0?"linear":n,a=t.points,i=a===void 0?[]:a,o=t.baseLine,c=t.layout,d=t.connectNulls,f=d===void 0?!1:d,h=ose(r,c),p=f?i.filter(function(b){return dh(b)}):i,x;if(Array.isArray(o)){var g=f?o.filter(function(b){return dh(b)}):o,j=p.map(function(b,y){return k2(k2({},b),{},{base:g[y]})});return c==="vertical"?x=nh().y(td).x1(ed).x0(function(b){return b.base.x}):x=nh().x(ed).y1(td).y0(function(b){return b.base.y}),x.defined(dh).curve(h),x(j)}return c==="vertical"&&We(o)?x=nh().y(td).x1(ed).x0(o):We(o)?x=nh().x(ed).y1(td).y0(o):x=Z3().x(ed).y(td),x.defined(dh).curve(h),x(p)},fm=function(t){var n=t.className,r=t.points,a=t.path,i=t.pathRef;if((!r||!r.length)&&!a)return null;var o=r&&r.length?lse(t):a;return v.createElement("path",W1({},gt(t,!1),Dh(t),{className:_t("recharts-curve",n),d:o,ref:i}))},Zw={exports:{}},ej,T2;function cse(){if(T2)return ej;T2=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ej=e,ej}var tj,R2;function use(){if(R2)return tj;R2=1;var e=cse();function t(){}function n(){}return n.resetWarningCache=t,tj=function(){function r(o,c,d,f,h,p){if(p!==e){var x=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw x.name="Invariant Violation",x}}r.isRequired=r;function a(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},tj}var I2;function dse(){return I2||(I2=1,Zw.exports=use()()),Zw.exports}var fse=dse();const Gt=Yt(fse),{getOwnPropertyNames:pse,getOwnPropertySymbols:hse}=Object,{hasOwnProperty:mse}=Object.prototype;function nj(e,t){return function(r,a,i){return e(r,a,i)&&t(r,a,i)}}function fh(e){return function(n,r,a){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,a);const{cache:i}=a,o=i.get(n),c=i.get(r);if(o&&c)return o===r&&c===n;i.set(n,r),i.set(r,n);const d=e(n,r,a);return i.delete(n),i.delete(r),d}}function vse(e){return e?.[Symbol.toStringTag]}function M2(e){return pse(e).concat(hse(e))}const gse=Object.hasOwn||((e,t)=>mse.call(e,t));function al(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const xse="__v",yse="__o",bse="_owner",{getOwnPropertyDescriptor:$2,keys:D2}=Object;function wse(e,t){return e.byteLength===t.byteLength&&pm(new Uint8Array(e),new Uint8Array(t))}function jse(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 Sse(e,t){return e.byteLength===t.byteLength&&pm(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function Nse(e,t){return al(e.getTime(),t.getTime())}function Cse(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Ase(e,t){return e===t}function L2(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const a=new Array(r),i=e.entries();let o,c,d=0;for(;(o=i.next())&&!o.done;){const f=t.entries();let h=!1,p=0;for(;(c=f.next())&&!c.done;){if(a[p]){p++;continue}const x=o.value,g=c.value;if(n.equals(x[0],g[0],d,p,e,t,n)&&n.equals(x[1],g[1],x[0],g[0],e,t,n)){h=a[p]=!0;break}p++}if(!h)return!1;d++}return!0}const _se=al;function Ese(e,t,n){const r=D2(e);let a=r.length;if(D2(t).length!==a)return!1;for(;a-- >0;)if(!e4(e,t,n,r[a]))return!1;return!0}function nd(e,t,n){const r=M2(e);let a=r.length;if(M2(t).length!==a)return!1;let i,o,c;for(;a-- >0;)if(i=r[a],!e4(e,t,n,i)||(o=$2(e,i),c=$2(t,i),(o||c)&&(!o||!c||o.configurable!==c.configurable||o.enumerable!==c.enumerable||o.writable!==c.writable)))return!1;return!0}function Pse(e,t){return al(e.valueOf(),t.valueOf())}function kse(e,t){return e.source===t.source&&e.flags===t.flags}function F2(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const a=new Array(r),i=e.values();let o,c;for(;(o=i.next())&&!o.done;){const d=t.values();let f=!1,h=0;for(;(c=d.next())&&!c.done;){if(!a[h]&&n.equals(o.value,c.value,o.value,c.value,e,t,n)){f=a[h]=!0;break}h++}if(!f)return!1}return!0}function pm(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 Ose(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===bse||r===yse||r===xse)&&(e.$$typeof||t.$$typeof)?!0:gse(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const Tse="[object ArrayBuffer]",Rse="[object Arguments]",Ise="[object Boolean]",Mse="[object DataView]",$se="[object Date]",Dse="[object Error]",Lse="[object Map]",Fse="[object Number]",Bse="[object Object]",zse="[object RegExp]",Use="[object Set]",qse="[object String]",Wse={"[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},Vse="[object URL]",Hse=Object.prototype.toString;function Kse({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:a,areFunctionsEqual:i,areMapsEqual:o,areNumbersEqual:c,areObjectsEqual:d,arePrimitiveWrappersEqual:f,areRegExpsEqual:h,areSetsEqual:p,areTypedArraysEqual:x,areUrlsEqual:g,unknownTagComparators:j}){return function(y,S,C){if(y===S)return!0;if(y==null||S==null)return!1;const N=typeof y;if(N!==typeof S)return!1;if(N!=="object")return N==="number"?c(y,S,C):N==="function"?i(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 o(y,S,C);if(E===Set)return p(y,S,C);const _=Hse.call(y);if(_===$se)return r(y,S,C);if(_===zse)return h(y,S,C);if(_===Lse)return o(y,S,C);if(_===Use)return p(y,S,C);if(_===Bse)return typeof y.then!="function"&&typeof S.then!="function"&&d(y,S,C);if(_===Vse)return g(y,S,C);if(_===Dse)return a(y,S,C);if(_===Rse)return d(y,S,C);if(Wse[_])return x(y,S,C);if(_===Tse)return e(y,S,C);if(_===Mse)return n(y,S,C);if(_===Ise||_===Fse||_===qse)return f(y,S,C);if(j){let P=j[_];if(!P){const O=vse(y);O&&(P=j[O])}if(P)return P(y,S,C)}return!1}}function Gse({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:wse,areArraysEqual:n?nd:jse,areDataViewsEqual:Sse,areDatesEqual:Nse,areErrorsEqual:Cse,areFunctionsEqual:Ase,areMapsEqual:n?nj(L2,nd):L2,areNumbersEqual:_se,areObjectsEqual:n?nd:Ese,arePrimitiveWrappersEqual:Pse,areRegExpsEqual:kse,areSetsEqual:n?nj(F2,nd):F2,areTypedArraysEqual:n?nj(pm,nd):pm,areUrlsEqual:Ose,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const a=fh(r.areArraysEqual),i=fh(r.areMapsEqual),o=fh(r.areObjectsEqual),c=fh(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:a,areMapsEqual:i,areObjectsEqual:o,areSetsEqual:c})}return r}function Yse(e){return function(t,n,r,a,i,o,c){return e(t,n,c)}}function Xse({circular:e,comparator:t,createState:n,equals:r,strict:a}){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:a})};if(e)return function(c,d){return t(c,d,{cache:new WeakMap,equals:r,meta:void 0,strict:a})};const i={cache:void 0,equals:r,meta:void 0,strict:a};return function(c,d){return t(c,d,i)}}const Qse=eo();eo({strict:!0});eo({circular:!0});eo({circular:!0,strict:!0});eo({createInternalComparator:()=>al});eo({strict:!0,createInternalComparator:()=>al});eo({circular:!0,createInternalComparator:()=>al});eo({circular:!0,createInternalComparator:()=>al,strict:!0});function eo(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:a=!1}=e,i=Gse(e),o=Kse(i),c=n?n(o):Yse(o);return Xse({circular:t,comparator:o,createState:r,equals:c,strict:a})}function Jse(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function B2(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function a(i){n<0&&(n=i),i-n>t?(e(i),n=-1):Jse(a)};requestAnimationFrame(r)}function V1(e){"@babel/helpers - typeof";return V1=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},V1(e)}function Zse(e){return rie(e)||nie(e)||tie(e)||eie()}function eie(){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 tie(e,t){if(e){if(typeof e=="string")return z2(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 z2(e,t)}}function z2(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 nie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function rie(e){if(Array.isArray(e))return e}function aie(){var e={},t=function(){return null},n=!1,r=function a(i){if(!n){if(Array.isArray(i)){if(!i.length)return;var o=i,c=Zse(o),d=c[0],f=c.slice(1);if(typeof d=="number"){B2(a.bind(null,f),d);return}a(d),B2(a.bind(null,f));return}V1(i)==="object"&&(e=i,t(e)),typeof i=="function"&&i()}};return{stop:function(){n=!0},start:function(i){n=!1,r(i)},subscribe:function(i){return t=i,function(){t=function(){return null}}}}}function Xd(e){"@babel/helpers - typeof";return Xd=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},Xd(e)}function U2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function q2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?U2(Object(n),!0).forEach(function(r){t4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function t4(e,t,n){return t=sie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sie(e){var t=iie(e,"string");return Xd(t)==="symbol"?t:String(t)}function iie(e,t){if(Xd(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Xd(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var oie=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,a){return r.filter(function(i){return a.includes(i)})})},lie=function(t){return t},cie=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},vd=function(t,n){return Object.keys(n).reduce(function(r,a){return q2(q2({},r),{},t4({},a,t(a,n[a])))},{})},W2=function(t,n,r){return t.map(function(a){return"".concat(cie(a)," ").concat(n,"ms ").concat(r)}).join(",")};function uie(e,t){return pie(e)||fie(e,t)||n4(e,t)||die()}function die(){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 fie(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function pie(e){if(Array.isArray(e))return e}function hie(e){return gie(e)||vie(e)||n4(e)||mie()}function mie(){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 n4(e,t){if(e){if(typeof e=="string")return H1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return H1(e,t)}}function vie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function gie(e){if(Array.isArray(e))return H1(e)}function H1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var hm=1e-4,r4=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},a4=function(t,n){return t.map(function(r,a){return r*Math.pow(n,a)}).reduce(function(r,a){return r+a})},V2=function(t,n){return function(r){var a=r4(t,n);return a4(a,r)}},xie=function(t,n){return function(r){var a=r4(t,n),i=[].concat(hie(a.map(function(o,c){return o*c}).slice(1)),[0]);return a4(i,r)}},H2=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0],i=n[1],o=n[2],c=n[3];if(n.length===1)switch(n[0]){case"linear":a=0,i=0,o=1,c=1;break;case"ease":a=.25,i=.1,o=.25,c=1;break;case"ease-in":a=.42,i=0,o=1,c=1;break;case"ease-out":a=.42,i=0,o=.58,c=1;break;case"ease-in-out":a=0,i=0,o=.58,c=1;break;default:{var d=n[0].split("(");if(d[0]==="cubic-bezier"&&d[1].split(")")[0].split(",").length===4){var f=d[1].split(")")[0].split(",").map(function(y){return parseFloat(y)}),h=uie(f,4);a=h[0],i=h[1],o=h[2],c=h[3]}}}var p=V2(a,o),x=V2(i,c),g=xie(a,o),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 _=p(N)-C,P=g(N);if(Math.abs(_-C)<hm||P<hm)return x(N);N=j(N-_/P)}return x(N)};return b.isStepper=!1,b},yie=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,a=t.damping,i=a===void 0?8:a,o=t.dt,c=o===void 0?17:o,d=function(h,p,x){var g=-(h-p)*r,j=x*i,b=x+(g-j)*c/1e3,y=x*c/1e3+h;return Math.abs(y-p)<hm&&Math.abs(b)<hm?[p,0]:[y,b]};return d.isStepper=!0,d.dt=c,d},bie=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0];if(typeof a=="string")switch(a){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return H2(a);case"spring":return yie();default:if(a.split("(")[0]==="cubic-bezier")return H2(a)}return typeof a=="function"?a:null};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 K2(e){return Sie(e)||jie(e)||s4(e)||wie()}function wie(){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 jie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Sie(e){if(Array.isArray(e))return G1(e)}function G2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ir(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?G2(Object(n),!0).forEach(function(r){K1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):G2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function K1(e,t,n){return t=Nie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nie(e){var t=Cie(e,"string");return Qd(t)==="symbol"?t:String(t)}function Cie(e,t){if(Qd(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Qd(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Aie(e,t){return Pie(e)||Eie(e,t)||s4(e,t)||_ie()}function _ie(){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 s4(e,t){if(e){if(typeof e=="string")return G1(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 G1(e,t)}}function G1(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 Eie(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function Pie(e){if(Array.isArray(e))return e}var mm=function(t,n,r){return t+(n-t)*r},Y1=function(t){var n=t.from,r=t.to;return n!==r},kie=function e(t,n,r){var a=vd(function(i,o){if(Y1(o)){var c=t(o.from,o.to,o.velocity),d=Aie(c,2),f=d[0],h=d[1];return ir(ir({},o),{},{from:f,velocity:h})}return o},n);return r<1?vd(function(i,o){return Y1(o)?ir(ir({},o),{},{velocity:mm(o.velocity,a[i].velocity,r),from:mm(o.from,a[i].from,r)}):o},n):e(t,a,r-1)};const Oie=(function(e,t,n,r,a){var i=oie(e,t),o=i.reduce(function(y,S){return ir(ir({},y),{},K1({},S,[e[S],t[S]]))},{}),c=i.reduce(function(y,S){return ir(ir({},y),{},K1({},S,{from:e[S],velocity:0,to:t[S]}))},{}),d=-1,f,h,p=function(){return null},x=function(){return vd(function(S,C){return C.from},c)},g=function(){return!Object.values(c).filter(Y1).length},j=function(S){f||(f=S);var C=S-f,N=C/n.dt;c=kie(n,c,N),a(ir(ir(ir({},e),t),x())),f=S,g()||(d=requestAnimationFrame(p))},b=function(S){h||(h=S);var C=(S-h)/r,N=vd(function(_,P){return mm.apply(void 0,K2(P).concat([n(C)]))},o);if(a(ir(ir(ir({},e),t),N)),C<1)d=requestAnimationFrame(p);else{var E=vd(function(_,P){return mm.apply(void 0,K2(P).concat([n(1)]))},o);a(ir(ir(ir({},e),t),E))}};return p=n.isStepper?j:b,function(){return requestAnimationFrame(p),function(){cancelAnimationFrame(d)}}});function _c(e){"@babel/helpers - typeof";return _c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_c(e)}var Tie=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function Rie(e,t){if(e==null)return{};var n=Iie(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Iie(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function rj(e){return Lie(e)||Die(e)||$ie(e)||Mie()}function Mie(){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 X1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return X1(e,t)}}function Die(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Lie(e){if(Array.isArray(e))return X1(e)}function X1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Y2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function La(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Y2(Object(n),!0).forEach(function(r){ld(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ld(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 Fie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bie(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 zie(e,t,n){return t&&Bie(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function i4(e){var t=Uie(e,"string");return _c(t)==="symbol"?t:String(t)}function Uie(e,t){if(_c(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(_c(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qie(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Q1(e,t)}function Q1(e,t){return Q1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Q1(e,t)}function Wie(e){var t=Vie();return function(){var r=vm(e),a;if(t){var i=vm(this).constructor;a=Reflect.construct(r,arguments,i)}else a=r.apply(this,arguments);return J1(this,a)}}function J1(e,t){if(t&&(_c(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Z1(e)}function Z1(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Vie(){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 vm(e){return vm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},vm(e)}var js=(function(e){qie(n,e);var t=Wie(n);function n(r,a){var i;Fie(this,n),i=t.call(this,r,a);var o=i.props,c=o.isActive,d=o.attributeName,f=o.from,h=o.to,p=o.steps,x=o.children,g=o.duration;if(i.handleStyleChange=i.handleStyleChange.bind(Z1(i)),i.changeStyle=i.changeStyle.bind(Z1(i)),!c||g<=0)return i.state={style:{}},typeof x=="function"&&(i.state={style:h}),J1(i);if(p&&p.length)i.state={style:p[0].style};else if(f){if(typeof x=="function")return i.state={style:f},J1(i);i.state={style:d?ld({},d,f):f}}else i.state={style:{}};return i}return zie(n,[{key:"componentDidMount",value:function(){var a=this.props,i=a.isActive,o=a.canBegin;this.mounted=!0,!(!i||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var i=this.props,o=i.isActive,c=i.canBegin,d=i.attributeName,f=i.shouldReAnimate,h=i.to,p=i.from,x=this.state.style;if(c){if(!o){var g={style:d?ld({},d,h):h};this.state&&x&&(d&&x[d]!==h||!d&&x!==h)&&this.setState(g);return}if(!(Qse(a.to,h)&&a.canBegin&&a.isActive)){var j=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var b=j||f?p:a.to;if(this.state&&x){var y={style:d?ld({},d,b):b};(d&&x[d]!==b||!d&&x!==b)&&this.setState(y)}this.runAnimation(La(La({},this.props),{},{from:b,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var a=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),a&&a()}},{key:"handleStyleChange",value:function(a){this.changeStyle(a)}},{key:"changeStyle",value:function(a){this.mounted&&this.setState({style:a})}},{key:"runJSAnimation",value:function(a){var i=this,o=a.from,c=a.to,d=a.duration,f=a.easing,h=a.begin,p=a.onAnimationEnd,x=a.onAnimationStart,g=Oie(o,c,bie(f),d,this.changeStyle),j=function(){i.stopJSAnimation=g()};this.manager.start([x,h,j,d,p])}},{key:"runStepAnimation",value:function(a){var i=this,o=a.steps,c=a.begin,d=a.onAnimationStart,f=o[0],h=f.style,p=f.duration,x=p===void 0?0:p,g=function(b,y,S){if(S===0)return b;var C=y.duration,N=y.easing,E=N===void 0?"ease":N,_=y.style,P=y.properties,O=y.onAnimationEnd,T=S>0?o[S-1]:y,I=P||Object.keys(_);if(typeof E=="function"||E==="spring")return[].concat(rj(b),[i.runJSAnimation.bind(i,{from:T.style,to:_,duration:C,easing:E}),C]);var M=W2(I,C,E),D=La(La(La({},T.style),_),{},{transition:M});return[].concat(rj(b),[D,C,O]).filter(lie)};return this.manager.start([d].concat(rj(o.reduce(g,[h,Math.max(x,c)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=aie());var i=a.begin,o=a.duration,c=a.attributeName,d=a.to,f=a.easing,h=a.onAnimationStart,p=a.onAnimationEnd,x=a.steps,g=a.children,j=this.manager;if(this.unSubscribe=j.subscribe(this.handleStyleChange),typeof f=="function"||typeof g=="function"||f==="spring"){this.runJSAnimation(a);return}if(x.length>1){this.runStepAnimation(a);return}var b=c?ld({},c,d):d,y=W2(Object.keys(b),o,f);j.start([h,i,La(La({},b),{},{transition:y}),o,p])}},{key:"render",value:function(){var a=this.props,i=a.children;a.begin;var o=a.duration;a.attributeName,a.easing;var c=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var d=Rie(a,Tie),f=v.Children.count(i),h=this.state.style;if(typeof i=="function")return i(h);if(!c||f===0||o<=0)return i;var p=function(g){var j=g.props,b=j.style,y=b===void 0?{}:b,S=j.className,C=v.cloneElement(g,La(La({},d),{},{style:La(La({},y),h),className:S}));return C};return f===1?p(v.Children.only(i)):W.createElement("div",null,v.Children.map(i,function(x){return p(x)}))}}]),n})(v.PureComponent);js.displayName="Animate";js.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};js.propTypes={from:Gt.oneOfType([Gt.object,Gt.string]),to:Gt.oneOfType([Gt.object,Gt.string]),attributeName:Gt.string,duration:Gt.number,begin:Gt.number,easing:Gt.oneOfType([Gt.string,Gt.func]),steps:Gt.arrayOf(Gt.shape({duration:Gt.number.isRequired,style:Gt.object.isRequired,easing:Gt.oneOfType([Gt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Gt.func]),properties:Gt.arrayOf("string"),onAnimationEnd:Gt.func})),children:Gt.oneOfType([Gt.node,Gt.func]),isActive:Gt.bool,canBegin:Gt.bool,onAnimationEnd:Gt.func,shouldReAnimate:Gt.bool,onAnimationStart:Gt.func,onAnimationReStart:Gt.func};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 gm(){return gm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gm.apply(this,arguments)}function Hie(e,t){return Xie(e)||Yie(e,t)||Gie(e,t)||Kie()}function Kie(){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 Gie(e,t){if(e){if(typeof e=="string")return X2(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 X2(e,t)}}function X2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Yie(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function Xie(e){if(Array.isArray(e))return e}function Q2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function J2(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){Qie(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 Qie(e,t,n){return t=Jie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jie(e){var t=Zie(e,"string");return Jd(t)=="symbol"?t:t+""}function Zie(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)}var Z2=function(t,n,r,a,i){var o=Math.min(Math.abs(r)/2,Math.abs(a)/2),c=a>=0?1:-1,d=r>=0?1:-1,f=a>=0&&r>=0||a<0&&r<0?1:0,h;if(o>0&&i instanceof Array){for(var p=[0,0,0,0],x=0,g=4;x<g;x++)p[x]=i[x]>o?o:i[x];h="M".concat(t,",").concat(n+c*p[0]),p[0]>0&&(h+="A ".concat(p[0],",").concat(p[0],",0,0,").concat(f,",").concat(t+d*p[0],",").concat(n)),h+="L ".concat(t+r-d*p[1],",").concat(n),p[1]>0&&(h+="A ".concat(p[1],",").concat(p[1],",0,0,").concat(f,`,
102
- `).concat(t+r,",").concat(n+c*p[1])),h+="L ".concat(t+r,",").concat(n+a-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+a)),h+="L ".concat(t+d*p[3],",").concat(n+a),p[3]>0&&(h+="A ".concat(p[3],",").concat(p[3],",0,0,").concat(f,`,
104
- `).concat(t,",").concat(n+a-c*p[3])),h+="Z"}else if(o>0&&i===+i&&i>0){var j=Math.min(o,i);h="M ".concat(t,",").concat(n+c*j,`
105
- A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+d*j,",").concat(n,`
106
- L `).concat(t+r-d*j,",").concat(n,`
107
- A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+r,",").concat(n+c*j,`
108
- L `).concat(t+r,",").concat(n+a-c*j,`
109
- A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+r-d*j,",").concat(n+a,`
110
- L `).concat(t+d*j,",").concat(n+a,`
111
- A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t,",").concat(n+a-c*j," Z")}else h="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(a," h ").concat(-r," Z");return h},eoe=function(t,n){if(!t||!n)return!1;var r=t.x,a=t.y,i=n.x,o=n.y,c=n.width,d=n.height;if(Math.abs(c)>0&&Math.abs(d)>0){var f=Math.min(i,i+c),h=Math.max(i,i+c),p=Math.min(o,o+d),x=Math.max(o,o+d);return r>=f&&r<=h&&a>=p&&a<=x}return!1},toe={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},fC=function(t){var n=J2(J2({},toe),t),r=v.useRef(),a=v.useState(-1),i=Hie(a,2),o=i[0],c=i[1];v.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var E=r.current.getTotalLength();E&&c(E)}catch{}},[]);var d=n.x,f=n.y,h=n.width,p=n.height,x=n.radius,g=n.className,j=n.animationEasing,b=n.animationDuration,y=n.animationBegin,S=n.isAnimationActive,C=n.isUpdateAnimationActive;if(d!==+d||f!==+f||h!==+h||p!==+p||h===0||p===0)return null;var N=_t("recharts-rectangle",g);return C?W.createElement(js,{canBegin:o>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 _=E.width,P=E.height,O=E.x,T=E.y;return W.createElement(js,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:b,isActive:S,easing:j},W.createElement("path",gm({},gt(n,!0),{className:N,d:Z2(O,T,_,P,x),ref:r})))}):W.createElement("path",gm({},gt(n,!0),{className:N,d:Z2(d,f,h,p,x)}))},noe=["points","className","baseLinePoints","connectNulls"];function Ql(){return Ql=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},Ql.apply(this,arguments)}function roe(e,t){if(e==null)return{};var n=aoe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function aoe(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 eI(e){return loe(e)||ooe(e)||ioe(e)||soe()}function soe(){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 ioe(e,t){if(e){if(typeof e=="string")return eS(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 eS(e,t)}}function ooe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function loe(e){if(Array.isArray(e))return eS(e)}function eS(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 tI=function(t){return t&&t.x===+t.x&&t.y===+t.y},coe=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){tI(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),tI(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},gd=function(t,n){var r=coe(t);n&&(r=[r.reduce(function(i,o){return[].concat(eI(i),eI(o))},[])]);var a=r.map(function(i){return i.reduce(function(o,c,d){return"".concat(o).concat(d===0?"M":"L").concat(c.x,",").concat(c.y)},"")}).join("");return r.length===1?"".concat(a,"Z"):a},uoe=function(t,n,r){var a=gd(t,r);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(gd(n.reverse(),r).slice(1))},doe=function(t){var n=t.points,r=t.className,a=t.baseLinePoints,i=t.connectNulls,o=roe(t,noe);if(!n||!n.length)return null;var c=_t("recharts-polygon",r);if(a&&a.length){var d=o.stroke&&o.stroke!=="none",f=uoe(n,a,i);return W.createElement("g",{className:c},W.createElement("path",Ql({},gt(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:f})),d?W.createElement("path",Ql({},gt(o,!0),{fill:"none",d:gd(n,i)})):null,d?W.createElement("path",Ql({},gt(o,!0),{fill:"none",d:gd(a,i)})):null)}var h=gd(n,i);return W.createElement("path",Ql({},gt(o,!0),{fill:h.slice(-1)==="Z"?o.fill:"none",className:c,d:h}))};function tS(){return tS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tS.apply(this,arguments)}var Wv=function(t){var n=t.cx,r=t.cy,a=t.r,i=t.className,o=_t("recharts-dot",i);return n===+n&&r===+r&&a===+a?v.createElement("circle",tS({},gt(t,!1),Dh(t),{className:o,cx:n,cy:r,r:a})):null};function Zd(e){"@babel/helpers - typeof";return Zd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zd(e)}var foe=["x","y","top","left","width","height","className"];function nS(){return nS=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},nS.apply(this,arguments)}function nI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function poe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nI(Object(n),!0).forEach(function(r){hoe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hoe(e,t,n){return t=moe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function moe(e){var t=voe(e,"string");return Zd(t)=="symbol"?t:t+""}function voe(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 goe(e,t){if(e==null)return{};var n=xoe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function xoe(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 yoe=function(t,n,r,a,i,o){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(o,",").concat(n,"h").concat(r)},boe=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,i=a===void 0?0:a,o=t.top,c=o===void 0?0:o,d=t.left,f=d===void 0?0:d,h=t.width,p=h===void 0?0:h,x=t.height,g=x===void 0?0:x,j=t.className,b=goe(t,foe),y=poe({x:r,y:i,top:c,left:f,width:p,height:g},b);return!We(r)||!We(i)||!We(p)||!We(g)||!We(c)||!We(f)?null:W.createElement("path",nS({},gt(y,!0),{className:_t("recharts-cross",j),d:yoe(r,i,p,g,c,f)}))},aj,rI;function woe(){if(rI)return aj;rI=1;var e=Fv(),t=jL(),n=_s();function r(a,i){return a&&a.length?e(a,n(i,2),t):void 0}return aj=r,aj}var joe=woe();const Soe=Yt(joe);var sj,aI;function Noe(){if(aI)return sj;aI=1;var e=Fv(),t=_s(),n=SL();function r(a,i){return a&&a.length?e(a,t(i,2),n):void 0}return sj=r,sj}var Coe=Noe();const Aoe=Yt(Coe);var _oe=["cx","cy","angle","ticks","axisLine"],Eoe=["ticks","tick","angle","tickFormatter","stroke"];function Ec(e){"@babel/helpers - typeof";return Ec=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},Ec(e)}function xd(){return xd=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},xd.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(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function xo(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){Vv(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 iI(e,t){if(e==null)return{};var n=Poe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Poe(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 koe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,l4(r.key),r)}}function Ooe(e,t,n){return t&&oI(e.prototype,t),n&&oI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Toe(e,t,n){return t=xm(t),Roe(e,o4()?Reflect.construct(t,n||[],xm(e).constructor):t.apply(e,n))}function Roe(e,t){if(t&&(Ec(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ioe(e)}function Ioe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function o4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(o4=function(){return!!e})()}function xm(e){return xm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},xm(e)}function Moe(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,a){return r.__proto__=a,r},rS(e,t)}function Vv(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=$oe(e,"string");return Ec(t)=="symbol"?t:t+""}function $oe(e,t){if(Ec(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ec(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Hv=(function(e){function t(){return koe(this,t),Toe(this,t,arguments)}return Moe(t,e),Ooe(t,[{key:"getTickValueCoord",value:function(r){var a=r.coordinate,i=this.props,o=i.angle,c=i.cx,d=i.cy;return on(c,d,a,o)}},{key:"getTickTextAnchor",value:function(){var r=this.props.orientation,a;switch(r){case"left":a="end";break;case"right":a="start";break;default:a="middle";break}return a}},{key:"getViewBox",value:function(){var r=this.props,a=r.cx,i=r.cy,o=r.angle,c=r.ticks,d=Soe(c,function(h){return h.coordinate||0}),f=Aoe(c,function(h){return h.coordinate||0});return{cx:a,cy:i,startAngle:o,endAngle:o,innerRadius:f.coordinate||0,outerRadius:d.coordinate||0}}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.cx,i=r.cy,o=r.angle,c=r.ticks,d=r.axisLine,f=iI(r,_oe),h=c.reduce(function(j,b){return[Math.min(j[0],b.coordinate),Math.max(j[1],b.coordinate)]},[1/0,-1/0]),p=on(a,i,h[0],o),x=on(a,i,h[1],o),g=xo(xo(xo({},gt(f,!1)),{},{fill:"none"},gt(d,!1)),{},{x1:p.x,y1:p.y,x2:x.x,y2:x.y});return W.createElement("line",xd({className:"recharts-polar-radius-axis-line"},g))}},{key:"renderTicks",value:function(){var r=this,a=this.props,i=a.ticks,o=a.tick,c=a.angle,d=a.tickFormatter,f=a.stroke,h=iI(a,Eoe),p=this.getTickTextAnchor(),x=gt(h,!1),g=gt(o,!1),j=i.map(function(b,y){var S=r.getTickValueCoord(b),C=xo(xo(xo(xo({textAnchor:p,transform:"rotate(".concat(90-c,", ").concat(S.x,", ").concat(S.y,")")},x),{},{stroke:"none",fill:f},g),{},{index:y},S),{},{payload:b});return W.createElement(qt,xd({className:_t("recharts-polar-radius-axis-tick",XL(o)),key:"tick-".concat(b.coordinate)},Do(r.props,b,y)),t.renderTickItem(o,C,d?d(b.value,y):b.value))});return W.createElement(qt,{className:"recharts-polar-radius-axis-ticks"},j)}},{key:"render",value:function(){var r=this.props,a=r.ticks,i=r.axisLine,o=r.tick;return!a||!a.length?null:W.createElement(qt,{className:_t("recharts-polar-radius-axis",this.props.className)},i&&this.renderAxisLine(),o&&this.renderTicks(),tr.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(r,a,i){var o;return W.isValidElement(r)?o=W.cloneElement(r,a):Ct(r)?o=r(a):o=W.createElement(Lo,xd({},a,{className:"recharts-polar-radius-axis-tick-value"}),i),o}}])})(v.PureComponent);Vv(Hv,"displayName","PolarRadiusAxis");Vv(Hv,"axisType","radiusAxis");Vv(Hv,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function Pc(e){"@babel/helpers - typeof";return Pc=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},Pc(e)}function Co(){return Co=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},Co.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(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function yo(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){Kv(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 Doe(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,u4(r.key),r)}}function Loe(e,t,n){return t&&cI(e.prototype,t),n&&cI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Foe(e,t,n){return t=ym(t),Boe(e,c4()?Reflect.construct(t,n||[],ym(e).constructor):t.apply(e,n))}function Boe(e,t){if(t&&(Pc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zoe(e)}function zoe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(c4=function(){return!!e})()}function ym(e){return ym=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ym(e)}function Uoe(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&&aS(e,t)}function aS(e,t){return aS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},aS(e,t)}function Kv(e,t,n){return t=u4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u4(e){var t=qoe(e,"string");return Pc(t)=="symbol"?t:t+""}function qoe(e,t){if(Pc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Pc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Woe=Math.PI/180,uI=1e-5,Gv=(function(e){function t(){return Doe(this,t),Foe(this,t,arguments)}return Uoe(t,e),Loe(t,[{key:"getTickLineCoord",value:function(r){var a=this.props,i=a.cx,o=a.cy,c=a.radius,d=a.orientation,f=a.tickSize,h=f||8,p=on(i,o,c,r.coordinate),x=on(i,o,c+(d==="inner"?-1:1)*h,r.coordinate);return{x1:p.x,y1:p.y,x2:x.x,y2:x.y}}},{key:"getTickTextAnchor",value:function(r){var a=this.props.orientation,i=Math.cos(-r.coordinate*Woe),o;return i>uI?o=a==="outer"?"start":"end":i<-uI?o=a==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.cx,i=r.cy,o=r.radius,c=r.axisLine,d=r.axisLineType,f=yo(yo({},gt(this.props,!1)),{},{fill:"none"},gt(c,!1));if(d==="circle")return W.createElement(Wv,Co({className:"recharts-polar-angle-axis-line"},f,{cx:a,cy:i,r:o}));var h=this.props.ticks,p=h.map(function(x){return on(a,i,o,x.coordinate)});return W.createElement(doe,Co({className:"recharts-polar-angle-axis-line"},f,{points:p}))}},{key:"renderTicks",value:function(){var r=this,a=this.props,i=a.ticks,o=a.tick,c=a.tickLine,d=a.tickFormatter,f=a.stroke,h=gt(this.props,!1),p=gt(o,!1),x=yo(yo({},h),{},{fill:"none"},gt(c,!1)),g=i.map(function(j,b){var y=r.getTickLineCoord(j),S=r.getTickTextAnchor(j),C=yo(yo(yo({textAnchor:S},h),{},{stroke:"none",fill:f},p),{},{index:b,payload:j,x:y.x2,y:y.y2});return W.createElement(qt,Co({className:_t("recharts-polar-angle-axis-tick",XL(o)),key:"tick-".concat(j.coordinate)},Do(r.props,j,b)),c&&W.createElement("line",Co({className:"recharts-polar-angle-axis-tick-line"},x,y)),o&&t.renderTickItem(o,C,d?d(j.value,b):j.value))});return W.createElement(qt,{className:"recharts-polar-angle-axis-ticks"},g)}},{key:"render",value:function(){var r=this.props,a=r.ticks,i=r.radius,o=r.axisLine;return i<=0||!a||!a.length?null:W.createElement(qt,{className:_t("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,a,i){var o;return W.isValidElement(r)?o=W.cloneElement(r,a):Ct(r)?o=r(a):o=W.createElement(Lo,Co({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),o}}])})(v.PureComponent);Kv(Gv,"displayName","PolarAngleAxis");Kv(Gv,"axisType","angleAxis");Kv(Gv,"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 ij,dI;function Voe(){if(dI)return ij;dI=1;var e=j5(),t=e(Object.getPrototypeOf,Object);return ij=t,ij}var oj,fI;function Hoe(){if(fI)return oj;fI=1;var e=ai(),t=Voe(),n=si(),r="[object Object]",a=Function.prototype,i=Object.prototype,o=a.toString,c=i.hasOwnProperty,d=o.call(Object);function f(h){if(!n(h)||e(h)!=r)return!1;var p=t(h);if(p===null)return!0;var x=c.call(p,"constructor")&&p.constructor;return typeof x=="function"&&x instanceof x&&o.call(x)==d}return oj=f,oj}var Koe=Hoe();const Goe=Yt(Koe);var lj,pI;function Yoe(){if(pI)return lj;pI=1;var e=ai(),t=si(),n="[object Boolean]";function r(a){return a===!0||a===!1||t(a)&&e(a)==n}return lj=r,lj}var Xoe=Yoe();const Qoe=Yt(Xoe);function ef(e){"@babel/helpers - typeof";return ef=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ef(e)}function bm(){return bm=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},bm.apply(this,arguments)}function Joe(e,t){return nle(e)||tle(e,t)||ele(e,t)||Zoe()}function Zoe(){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 ele(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 tle(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function nle(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(a){return Object.getOwnPropertyDescriptor(e,a).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){rle(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 rle(e,t,n){return t=ale(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ale(e){var t=sle(e,"string");return ef(t)=="symbol"?t:t+""}function sle(e,t){if(ef(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ef(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gI=function(t,n,r,a,i){var o=r-a,c;return c="M ".concat(t,",").concat(n),c+="L ".concat(t+r,",").concat(n),c+="L ".concat(t+r-o/2,",").concat(n+i),c+="L ".concat(t+r-o/2-a,",").concat(n+i),c+="L ".concat(t,",").concat(n," Z"),c},ile={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},ole=function(t){var n=vI(vI({},ile),t),r=v.useRef(),a=v.useState(-1),i=Joe(a,2),o=i[0],c=i[1];v.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var N=r.current.getTotalLength();N&&c(N)}catch{}},[]);var d=n.x,f=n.y,h=n.upperWidth,p=n.lowerWidth,x=n.height,g=n.className,j=n.animationEasing,b=n.animationDuration,y=n.animationBegin,S=n.isUpdateAnimationActive;if(d!==+d||f!==+f||h!==+h||p!==+p||x!==+x||h===0&&p===0||x===0)return null;var C=_t("recharts-trapezoid",g);return S?W.createElement(js,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:x,x:d,y:f},to:{upperWidth:h,lowerWidth:p,height:x,x:d,y:f},duration:b,animationEasing:j,isActive:S},function(N){var E=N.upperWidth,_=N.lowerWidth,P=N.height,O=N.x,T=N.y;return W.createElement(js,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:b,easing:j},W.createElement("path",bm({},gt(n,!0),{className:C,d:gI(O,T,E,_,P),ref:r})))}):W.createElement("g",null,W.createElement("path",bm({},gt(n,!0),{className:C,d:gI(d,f,h,p,x)})))},lle=["option","shapeType","propTransformer","activeClassName","isActive"];function tf(e){"@babel/helpers - typeof";return tf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tf(e)}function cle(e,t){if(e==null)return{};var n=ule(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ule(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,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function wm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xI(Object(n),!0).forEach(function(r){dle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dle(e,t,n){return t=fle(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fle(e){var t=ple(e,"string");return tf(t)=="symbol"?t:t+""}function ple(e,t){if(tf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(tf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hle(e,t){return wm(wm({},t),e)}function mle(e,t){return e==="symbols"}function yI(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return W.createElement(fC,n);case"trapezoid":return W.createElement(ole,n);case"sector":return W.createElement(ZL,n);case"symbols":if(mle(t))return W.createElement(ON,n);break;default:return null}}function vle(e){return v.isValidElement(e)?e.props:e}function d4(e){var t=e.option,n=e.shapeType,r=e.propTransformer,a=r===void 0?hle:r,i=e.activeClassName,o=i===void 0?"recharts-active-shape":i,c=e.isActive,d=cle(e,lle),f;if(v.isValidElement(t))f=v.cloneElement(t,wm(wm({},d),vle(t)));else if(Ct(t))f=t(d);else if(Goe(t)&&!Qoe(t)){var h=a(t,d);f=W.createElement(yI,{shapeType:n,elementProps:h})}else{var p=d;f=W.createElement(yI,{shapeType:n,elementProps:p})}return c?W.createElement(qt,{className:o},f):f}function Yv(e,t){return t!=null&&"trapezoids"in e.props}function Xv(e,t){return t!=null&&"sectors"in e.props}function nf(e,t){return t!=null&&"points"in e.props}function gle(e,t){var n,r,a=e.x===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.x)||e.x===t.x,i=e.y===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.y)||e.y===t.y;return a&&i}function xle(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function yle(e,t){var n=e.x===t.x,r=e.y===t.y,a=e.z===t.z;return n&&r&&a}function ble(e,t){var n;return Yv(e,t)?n=gle:Xv(e,t)?n=xle:nf(e,t)&&(n=yle),n}function wle(e,t){var n;return Yv(e,t)?n="trapezoids":Xv(e,t)?n="sectors":nf(e,t)&&(n="points"),n}function jle(e,t){if(Yv(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(Xv(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 nf(e,t)?t.payload:{}}function Sle(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,a=wle(n,t),i=jle(n,t),o=r.filter(function(d,f){var h=Tf(i,d),p=n.props[a].filter(function(j){var b=ble(n,t);return b(j,t)}),x=n.props[a].indexOf(p[p.length-1]),g=f===x;return h&&g}),c=r.indexOf(o[o.length-1]);return c}var Ch;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 Jl(){return Jl=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},Jl.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(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function an(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){ba(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 Nle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,p4(r.key),r)}}function Cle(e,t,n){return t&&wI(e.prototype,t),n&&wI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ale(e,t,n){return t=jm(t),_le(e,f4()?Reflect.construct(t,n||[],jm(e).constructor):t.apply(e,n))}function _le(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 Ele(e)}function Ele(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(f4=function(){return!!e})()}function jm(e){return jm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},jm(e)}function Ple(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&&sS(e,t)}function sS(e,t){return sS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},sS(e,t)}function ba(e,t,n){return t=p4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p4(e){var t=kle(e,"string");return kc(t)=="symbol"?t:t+""}function kle(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 oi=(function(e){function t(n){var r;return Nle(this,t),r=Ale(this,t,[n]),ba(r,"pieRef",null),ba(r,"sectorRefs",[]),ba(r,"id",au("recharts-pie-")),ba(r,"handleAnimationEnd",function(){var a=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),Ct(a)&&a()}),ba(r,"handleAnimationStart",function(){var a=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),Ct(a)&&a()}),r.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},r}return Ple(t,e),Cle(t,[{key:"isActiveIndex",value:function(r){var a=this.props.activeIndex;return Array.isArray(a)?a.indexOf(r)!==-1:r===a}},{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 a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.label,c=i.labelLine,d=i.dataKey,f=i.valueKey,h=gt(this.props,!1),p=gt(o,!1),x=gt(c,!1),g=o&&o.offsetRadius||20,j=r.map(function(b,y){var S=(b.startAngle+b.endAngle)/2,C=on(b.cx,b.cy,b.outerRadius+g,S),N=an(an(an(an({},h),b),{},{stroke:"none"},p),{},{index:y,textAnchor:t.getTextAnchor(C.x,b.cx)},C),E=an(an(an(an({},h),b),{},{fill:"none",stroke:b.fill},x),{},{index:y,points:[on(b.cx,b.cy,b.outerRadius,S),C]}),_=d;return At(d)&&At(f)?_="value":At(d)&&(_=f),W.createElement(qt,{key:"label-".concat(b.startAngle,"-").concat(b.endAngle,"-").concat(b.midAngle,"-").concat(y)},c&&t.renderLabelLineItem(c,E,"line"),t.renderLabelItem(o,N,qn(b,_)))});return W.createElement(qt,{className:"recharts-pie-labels"},j)}},{key:"renderSectorsStatically",value:function(r){var a=this,i=this.props,o=i.activeShape,c=i.blendStroke,d=i.inactiveShape;return r.map(function(f,h){if(f?.startAngle===0&&f?.endAngle===0&&r.length!==1)return null;var p=a.isActiveIndex(h),x=d&&a.hasActiveIndex()?d:null,g=p?o:x,j=an(an({},f),{},{stroke:c?f.fill:f.stroke,tabIndex:-1});return W.createElement(qt,Jl({ref:function(y){y&&!a.sectorRefs.includes(y)&&a.sectorRefs.push(y)},tabIndex:-1,className:"recharts-pie-sector"},Do(a.props,f,h),{key:"sector-".concat(f?.startAngle,"-").concat(f?.endAngle,"-").concat(f.midAngle,"-").concat(h)}),W.createElement(d4,Jl({option:g,isActive:p,shapeType:"sector"},j)))})}},{key:"renderSectorsWithAnimation",value:function(){var r=this,a=this.props,i=a.sectors,o=a.isAnimationActive,c=a.animationBegin,d=a.animationDuration,f=a.animationEasing,h=a.animationId,p=this.state,x=p.prevSectors,g=p.prevIsAnimationActive;return W.createElement(js,{begin:c,duration:d,isActive:o,easing:f,from:{t:0},to:{t:1},key:"pie-".concat(h,"-").concat(g),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(j){var b=j.t,y=[],S=i&&i[0],C=S.startAngle;return i.forEach(function(N,E){var _=x&&x[E],P=E>0?sa(N,"paddingAngle",0):0;if(_){var O=ea(_.endAngle-_.startAngle,N.endAngle-N.startAngle),T=an(an({},N),{},{startAngle:C+P,endAngle:C+O(b)+P});y.push(T),C=T.endAngle}else{var I=N.endAngle,M=N.startAngle,D=ea(0,I-M),R=D(b),q=an(an({},N),{},{startAngle:C+P,endAngle:C+R+P});y.push(q),C=q.endAngle}}),W.createElement(qt,null,r.renderSectorsStatically(y))})}},{key:"attachKeyboardHandlers",value:function(r){var a=this;r.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var o=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[o].focus(),a.setState({sectorToFocus:o});break}case"ArrowRight":{var c=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[c].focus(),a.setState({sectorToFocus:c});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,a=r.sectors,i=r.isAnimationActive,o=this.state.prevSectors;return i&&a&&a.length&&(!o||!Tf(o,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,a=this.props,i=a.hide,o=a.sectors,c=a.className,d=a.label,f=a.cx,h=a.cy,p=a.innerRadius,x=a.outerRadius,g=a.isAnimationActive,j=this.state.isAnimationFinished;if(i||!o||!o.length||!We(f)||!We(h)||!We(p)||!We(x))return null;var b=_t("recharts-pie",c);return W.createElement(qt,{tabIndex:this.props.rootTabIndex,className:b,ref:function(S){r.pieRef=S}},this.renderSectors(),d&&this.renderLabels(o),tr.renderCallByParent(this.props,null,!1),(!g||j)&&Qs.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return a.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:a.curSectors,isAnimationFinished:!0}:r.sectors!==a.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,a){return r>a?"start":r<a?"end":"middle"}},{key:"renderLabelLineItem",value:function(r,a,i){if(W.isValidElement(r))return W.cloneElement(r,a);if(Ct(r))return r(a);var o=_t("recharts-pie-label-line",typeof r!="boolean"?r.className:"");return W.createElement(fm,Jl({},a,{key:i,type:"linear",className:o}))}},{key:"renderLabelItem",value:function(r,a,i){if(W.isValidElement(r))return W.cloneElement(r,a);var o=i;if(Ct(r)&&(o=r(a),W.isValidElement(o)))return o;var c=_t("recharts-pie-label-text",typeof r!="boolean"&&!Ct(r)?r.className:"");return W.createElement(Lo,Jl({},a,{alignmentBaseline:"middle",className:c}),o)}}])})(v.PureComponent);Ch=oi;ba(oi,"displayName","Pie");ba(oi,"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:!tl.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});ba(oi,"parseDeltaAngle",function(e,t){var n=jr(t-e),r=Math.min(Math.abs(t-e),360);return n*r});ba(oi,"getRealPieData",function(e){var t=e.data,n=e.children,r=gt(e,!1),a=ia(n,Tv);return t&&t.length?t.map(function(i,o){return an(an(an({payload:i},r),i),a&&a[o]&&a[o].props)}):a&&a.length?a.map(function(i){return an(an({},r),i.props)}):[]});ba(oi,"parseCoordinateOfPie",function(e,t){var n=t.top,r=t.left,a=t.width,i=t.height,o=YL(a,i),c=r+Sr(e.cx,a,a/2),d=n+Sr(e.cy,i,i/2),f=Sr(e.innerRadius,o,0),h=Sr(e.outerRadius,o,o*.8),p=e.maxRadius||Math.sqrt(a*a+i*i)/2;return{cx:c,cy:d,innerRadius:f,outerRadius:h,maxRadius:p}});ba(oi,"getComposedData",function(e){var t=e.item,n=e.offset,r=t.type.defaultProps!==void 0?an(an({},t.type.defaultProps),t.props):t.props,a=Ch.getRealPieData(r);if(!a||!a.length)return null;var i=r.cornerRadius,o=r.startAngle,c=r.endAngle,d=r.paddingAngle,f=r.dataKey,h=r.nameKey,p=r.valueKey,x=r.tooltipType,g=Math.abs(r.minAngle),j=Ch.parseCoordinateOfPie(r,n),b=Ch.parseDeltaAngle(o,c),y=Math.abs(b),S=f;At(f)&&At(p)?(Ys(!1,`Use "dataKey" to specify the value of pie,
114
- the props "valueKey" will be deprecated in 1.1.0`),S="value"):At(f)&&(Ys(!1,`Use "dataKey" to specify the value of pie,
115
- the props "valueKey" will be deprecated in 1.1.0`),S=p);var C=a.filter(function(T){return qn(T,S,0)!==0}).length,N=(y>=360?C:C-1)*d,E=y-C*g-N,_=a.reduce(function(T,I){var M=qn(I,S,0);return T+(We(M)?M:0)},0),P;if(_>0){var O;P=a.map(function(T,I){var M=qn(T,S,0),D=qn(T,h,I),R=(We(M)?M:0)/_,q;I?q=O.endAngle+jr(b)*d*(M!==0?1:0):q=o;var U=q+jr(b)*((M!==0?g:0)+R*E),H=(q+U)/2,J=(j.innerRadius+j.outerRadius)/2,Z=[{name:D,value:M,payload:T,dataKey:S,type:x}],F=on(j.cx,j.cy,J,H);return O=an(an(an({percent:R,cornerRadius:i,name:D,tooltipPayload:Z,midAngle:H,middleRadius:J,tooltipPosition:F},T),j),{},{value:qn(T,S),startAngle:q,endAngle:U,payload:T,paddingAngle:jr(b)*d}),O})}return an(an({},j),{},{sectors:P,data:a})});var cj,jI;function Ole(){if(jI)return cj;jI=1;var e=Math.ceil,t=Math.max;function n(r,a,i,o){for(var c=-1,d=t(e((a-r)/(i||1)),0),f=Array(d);d--;)f[o?d:++c]=r,r+=i;return f}return cj=n,cj}var uj,SI;function h4(){if(SI)return uj;SI=1;var e=L5(),t=1/0,n=17976931348623157e292;function r(a){if(!a)return a===0?a:0;if(a=e(a),a===t||a===-t){var i=a<0?-1:1;return i*n}return a===a?a:0}return uj=r,uj}var dj,NI;function Tle(){if(NI)return dj;NI=1;var e=Ole(),t=Ov(),n=h4();function r(a){return function(i,o,c){return c&&typeof c!="number"&&t(i,o,c)&&(o=c=void 0),i=n(i),o===void 0?(o=i,i=0):o=n(o),c=c===void 0?i<o?1:-1:n(c),e(i,o,c,a)}}return dj=r,dj}var fj,CI;function Rle(){if(CI)return fj;CI=1;var e=Tle(),t=e();return fj=t,fj}var Ile=Rle();const Sm=Yt(Ile);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 AI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function _I(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AI(Object(n),!0).forEach(function(r){m4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function m4(e,t,n){return t=Mle(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mle(e){var t=$le(e,"string");return rf(t)=="symbol"?t:t+""}function $le(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 Dle=["Webkit","Moz","O","ms"],Lle=function(t,n){var r=t.replace(/(\w)/,function(i){return i.toUpperCase()}),a=Dle.reduce(function(i,o){return _I(_I({},i),{},m4({},o+r,n))},{});return a[t]=n,a};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)}function Nm(){return Nm=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},Nm.apply(this,arguments)}function EI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function pj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?EI(Object(n),!0).forEach(function(r){Qr(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function PI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,g4(r.key),r)}}function Ble(e,t,n){return t&&PI(e.prototype,t),n&&PI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function zle(e,t,n){return t=Cm(t),Ule(e,v4()?Reflect.construct(t,n||[],Cm(e).constructor):t.apply(e,n))}function Ule(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 qle(e)}function qle(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(v4=function(){return!!e})()}function Cm(e){return Cm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Cm(e)}function Wle(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&&iS(e,t)}function iS(e,t){return iS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},iS(e,t)}function Qr(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=Vle(e,"string");return Oc(t)=="symbol"?t:t+""}function Vle(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)}var Hle=function(t){var n=t.data,r=t.startIndex,a=t.endIndex,i=t.x,o=t.width,c=t.travellerWidth;if(!n||!n.length)return{};var d=n.length,f=hd().domain(Sm(0,d)).range([i,i+o-c]),h=f.domain().map(function(p){return f(p)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:f(r),endX:f(a),scale:f,scaleValues:h}},kI=function(t){return t.changedTouches&&!!t.changedTouches.length},Tc=(function(e){function t(n){var r;return Fle(this,t),r=zle(this,t,[n]),Qr(r,"handleDrag",function(a){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(a):r.state.isSlideMoving&&r.handleSlideDrag(a)}),Qr(r,"handleTouchMove",function(a){a.changedTouches!=null&&a.changedTouches.length>0&&r.handleDrag(a.changedTouches[0])}),Qr(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=r.props,i=a.endIndex,o=a.onDragEnd,c=a.startIndex;o?.({endIndex:i,startIndex:c})}),r.detachDragEndListener()}),Qr(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Qr(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Qr(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Qr(r,"handleSlideDragStart",function(a){var i=kI(a)?a.changedTouches[0]:a;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return Wle(t,e),Ble(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var a=r.startX,i=r.endX,o=this.state.scaleValues,c=this.props,d=c.gap,f=c.data,h=f.length-1,p=Math.min(a,i),x=Math.max(a,i),g=t.getIndexInRange(o,p),j=t.getIndexInRange(o,x);return{startIndex:g-g%d,endIndex:j===h?h:j-j%d}}},{key:"getTextOfTick",value:function(r){var a=this.props,i=a.data,o=a.tickFormatter,c=a.dataKey,d=qn(i[r],c,r);return Ct(o)?o(d,r):d}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var a=this.state,i=a.slideMoveStartX,o=a.startX,c=a.endX,d=this.props,f=d.x,h=d.width,p=d.travellerWidth,x=d.startIndex,g=d.endIndex,j=d.onChange,b=r.pageX-i;b>0?b=Math.min(b,f+h-p-c,f+h-p-o):b<0&&(b=Math.max(b,f-o,f-c));var y=this.getIndex({startX:o+b,endX:c+b});(y.startIndex!==x||y.endIndex!==g)&&j&&j(y),this.setState({startX:o+b,endX:c+b,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,a){var i=kI(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var a=this.state,i=a.brushMoveStartX,o=a.movingTravellerId,c=a.endX,d=a.startX,f=this.state[o],h=this.props,p=h.x,x=h.width,g=h.travellerWidth,j=h.onChange,b=h.gap,y=h.data,S={startX:this.state.startX,endX:this.state.endX},C=r.pageX-i;C>0?C=Math.min(C,p+x-g-f):C<0&&(C=Math.max(C,p-f)),S[o]=f+C;var N=this.getIndex(S),E=N.startIndex,_=N.endIndex,P=function(){var T=y.length-1;return o==="startX"&&(c>d?E%b===0:_%b===0)||c<d&&_===T||o==="endX"&&(c>d?_%b===0:E%b===0)||c>d&&_===T};this.setState(Qr(Qr({},o,f+C),"brushMoveStartX",r.pageX),function(){j&&P()&&j(N)})}},{key:"handleTravellerMoveKeyboard",value:function(r,a){var i=this,o=this.state,c=o.scaleValues,d=o.startX,f=o.endX,h=this.state[a],p=c.indexOf(h);if(p!==-1){var x=p+r;if(!(x===-1||x>=c.length)){var g=c[x];a==="startX"&&g>=f||a==="endX"&&g<=d||this.setState(Qr({},a,g),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,a=r.x,i=r.y,o=r.width,c=r.height,d=r.fill,f=r.stroke;return W.createElement("rect",{stroke:f,fill:d,x:a,y:i,width:o,height:c})}},{key:"renderPanorama",value:function(){var r=this.props,a=r.x,i=r.y,o=r.width,c=r.height,d=r.data,f=r.children,h=r.padding,p=v.Children.only(f);return p?W.cloneElement(p,{x:a,y:i,width:o,height:c,margin:h,compact:!0,data:d}):null}},{key:"renderTravellerLayer",value:function(r,a){var i,o,c=this,d=this.props,f=d.y,h=d.travellerWidth,p=d.height,x=d.traveller,g=d.ariaLabel,j=d.data,b=d.startIndex,y=d.endIndex,S=Math.max(r,this.props.x),C=pj(pj({},gt(this.props,!1)),{},{x:S,y:f,width:h,height:p}),N=g||"Min value: ".concat((i=j[b])===null||i===void 0?void 0:i.name,", Max value: ").concat((o=j[y])===null||o===void 0?void 0:o.name);return W.createElement(qt,{tabIndex:0,role:"slider","aria-label":N,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(_){["ArrowLeft","ArrowRight"].includes(_.key)&&(_.preventDefault(),_.stopPropagation(),c.handleTravellerMoveKeyboard(_.key==="ArrowRight"?1:-1,a))},onFocus:function(){c.setState({isTravellerFocused:!0})},onBlur:function(){c.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(x,C))}},{key:"renderSlide",value:function(r,a){var i=this.props,o=i.y,c=i.height,d=i.stroke,f=i.travellerWidth,h=Math.min(r,a)+f,p=Math.max(Math.abs(a-r)-f,0);return W.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:d,fillOpacity:.2,x:h,y:o,width:p,height:c})}},{key:"renderText",value:function(){var r=this.props,a=r.startIndex,i=r.endIndex,o=r.y,c=r.height,d=r.travellerWidth,f=r.stroke,h=this.state,p=h.startX,x=h.endX,g=5,j={pointerEvents:"none",fill:f};return W.createElement(qt,{className:"recharts-brush-texts"},W.createElement(Lo,Nm({textAnchor:"end",verticalAnchor:"middle",x:Math.min(p,x)-g,y:o+c/2},j),this.getTextOfTick(a)),W.createElement(Lo,Nm({textAnchor:"start",verticalAnchor:"middle",x:Math.max(p,x)+d+g,y:o+c/2},j),this.getTextOfTick(i)))}},{key:"render",value:function(){var r=this.props,a=r.data,i=r.className,o=r.children,c=r.x,d=r.y,f=r.width,h=r.height,p=r.alwaysShowText,x=this.state,g=x.startX,j=x.endX,b=x.isTextActive,y=x.isSlideMoving,S=x.isTravellerMoving,C=x.isTravellerFocused;if(!a||!a.length||!We(c)||!We(d)||!We(f)||!We(h)||f<=0||h<=0)return null;var N=_t("recharts-brush",i),E=W.Children.count(o)===1,_=Lle("userSelect","none");return W.createElement(qt,{className:N,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:_},this.renderBackground(),E&&this.renderPanorama(),this.renderSlide(g,j),this.renderTravellerLayer(g,"startX"),this.renderTravellerLayer(j,"endX"),(b||y||S||C||p)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var a=r.x,i=r.y,o=r.width,c=r.height,d=r.stroke,f=Math.floor(i+c/2)-1;return W.createElement(W.Fragment,null,W.createElement("rect",{x:a,y:i,width:o,height:c,fill:d,stroke:"none"}),W.createElement("line",{x1:a+1,y1:f,x2:a+o-1,y2:f,fill:"none",stroke:"#fff"}),W.createElement("line",{x1:a+1,y1:f+2,x2:a+o-1,y2:f+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,a){var i;return W.isValidElement(r)?i=W.cloneElement(r,a):Ct(r)?i=r(a):i=t.renderDefaultTraveller(a),i}},{key:"getDerivedStateFromProps",value:function(r,a){var i=r.data,o=r.width,c=r.x,d=r.travellerWidth,f=r.updateId,h=r.startIndex,p=r.endIndex;if(i!==a.prevData||f!==a.prevUpdateId)return pj({prevData:i,prevTravellerWidth:d,prevUpdateId:f,prevX:c,prevWidth:o},i&&i.length?Hle({data:i,width:o,x:c,travellerWidth:d,startIndex:h,endIndex:p}):{scale:null,scaleValues:null});if(a.scale&&(o!==a.prevWidth||c!==a.prevX||d!==a.prevTravellerWidth)){a.scale.range([c,c+o-d]);var x=a.scale.domain().map(function(g){return a.scale(g)});return{prevData:i,prevTravellerWidth:d,prevUpdateId:f,prevX:c,prevWidth:o,startX:a.scale(r.startIndex),endX:a.scale(r.endIndex),scaleValues:x}}return null}},{key:"getIndexInRange",value:function(r,a){for(var i=r.length,o=0,c=i-1;c-o>1;){var d=Math.floor((o+c)/2);r[d]>a?c=d:o=d}return a>=r[c]?c:o}}])})(v.PureComponent);Qr(Tc,"displayName","Brush");Qr(Tc,"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 hj,OI;function Kle(){if(OI)return hj;OI=1;var e=LN();function t(n,r){var a;return e(n,function(i,o,c){return a=r(i,o,c),!a}),!!a}return hj=t,hj}var mj,TI;function Gle(){if(TI)return mj;TI=1;var e=m5(),t=_s(),n=Kle(),r=Br(),a=Ov();function i(o,c,d){var f=r(o)?e:n;return d&&a(o,c,d)&&(c=void 0),f(o,t(c,3))}return mj=i,mj}var Yle=Gle();const Xle=Yt(Yle);var vs=function(t,n){var r=t.alwaysShow,a=t.ifOverflow;return r&&(a="extendDomain"),a===n},vj,RI;function Qle(){if(RI)return vj;RI=1;var e=R5();function t(n,r,a){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):n[r]=a}return vj=t,vj}var gj,II;function Jle(){if(II)return gj;II=1;var e=Qle(),t=O5(),n=_s();function r(a,i){var o={};return i=n(i,3),t(a,function(c,d,f){e(o,d,i(c,d,f))}),o}return gj=r,gj}var Zle=Jle();const ece=Yt(Zle);var xj,MI;function tce(){if(MI)return xj;MI=1;function e(t,n){for(var r=-1,a=t==null?0:t.length;++r<a;)if(!n(t[r],r,t))return!1;return!0}return xj=e,xj}var yj,$I;function nce(){if($I)return yj;$I=1;var e=LN();function t(n,r){var a=!0;return e(n,function(i,o,c){return a=!!r(i,o,c),a}),a}return yj=t,yj}var bj,DI;function rce(){if(DI)return bj;DI=1;var e=tce(),t=nce(),n=_s(),r=Br(),a=Ov();function i(o,c,d){var f=r(o)?e:t;return d&&a(o,c,d)&&(c=void 0),f(o,n(c,3))}return bj=i,bj}var ace=rce();const sce=Yt(ace);var ice=["x","y"];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 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 LI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function rd(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){oce(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 oce(e,t,n){return t=lce(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lce(e){var t=cce(e,"string");return af(t)=="symbol"?t:t+""}function cce(e,t){if(af(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(af(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function uce(e,t){if(e==null)return{};var n=dce(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function dce(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 fce(e,t){var n=e.x,r=e.y,a=uce(e,ice),i="".concat(n),o=parseInt(i,10),c="".concat(r),d=parseInt(c,10),f="".concat(t.height||a.height),h=parseInt(f,10),p="".concat(t.width||a.width),x=parseInt(p,10);return rd(rd(rd(rd(rd({},t),a),o?{x:o}:{}),d?{y:d}:{}),{},{height:h,width:x,name:t.name,radius:t.radius})}function FI(e){return W.createElement(d4,oS({shapeType:"rectangle",propTransformer:fce,activeClassName:"recharts-active-bar"},e))}var pce=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,a){if(typeof t=="number")return t;var i=We(r)||TY(r);return i?t(r,a):(i||Bo(),n)}},hce=["value","background"],x4;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 mce(e,t){if(e==null)return{};var n=vce(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function vce(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 Am(){return Am=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Am.apply(this,arguments)}function BI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Mn(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){Li(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 gce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,b4(r.key),r)}}function xce(e,t,n){return t&&zI(e.prototype,t),n&&zI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function yce(e,t,n){return t=_m(t),bce(e,y4()?Reflect.construct(t,n||[],_m(e).constructor):t.apply(e,n))}function bce(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 wce(e)}function wce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(y4=function(){return!!e})()}function _m(e){return _m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_m(e)}function jce(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&&lS(e,t)}function lS(e,t){return lS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},lS(e,t)}function Li(e,t,n){return t=b4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b4(e){var t=Sce(e,"string");return Rc(t)=="symbol"?t:t+""}function Sce(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 sl=(function(e){function t(){var n;gce(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=yce(this,t,[].concat(a)),Li(n,"state",{isAnimationFinished:!1}),Li(n,"id",au("recharts-bar-")),Li(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),o&&o()}),Li(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),o&&o()}),n}return jce(t,e),xce(t,[{key:"renderRectanglesStatically",value:function(r){var a=this,i=this.props,o=i.shape,c=i.dataKey,d=i.activeIndex,f=i.activeBar,h=gt(this.props,!1);return r&&r.map(function(p,x){var g=x===d,j=g?f:o,b=Mn(Mn(Mn({},h),p),{},{isActive:g,option:j,index:x,dataKey:c,onAnimationStart:a.handleAnimationStart,onAnimationEnd:a.handleAnimationEnd});return W.createElement(qt,Am({className:"recharts-bar-rectangle"},Do(a.props,p,x),{key:"rectangle-".concat(p?.x,"-").concat(p?.y,"-").concat(p?.value,"-").concat(x)}),W.createElement(FI,b))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,a=this.props,i=a.data,o=a.layout,c=a.isAnimationActive,d=a.animationBegin,f=a.animationDuration,h=a.animationEasing,p=a.animationId,x=this.state.prevData;return W.createElement(js,{begin:d,duration:f,isActive:c,easing:h,from:{t:0},to:{t:1},key:"bar-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(g){var j=g.t,b=i.map(function(y,S){var C=x&&x[S];if(C){var N=ea(C.x,y.x),E=ea(C.y,y.y),_=ea(C.width,y.width),P=ea(C.height,y.height);return Mn(Mn({},y),{},{x:N(j),y:E(j),width:_(j),height:P(j)})}if(o==="horizontal"){var O=ea(0,y.height),T=O(j);return Mn(Mn({},y),{},{y:y.y+y.height-T,height:T})}var I=ea(0,y.width),M=I(j);return Mn(Mn({},y),{},{width:M})});return W.createElement(qt,null,r.renderRectanglesStatically(b))})}},{key:"renderRectangles",value:function(){var r=this.props,a=r.data,i=r.isAnimationActive,o=this.state.prevData;return i&&a&&a.length&&(!o||!Tf(o,a))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(a)}},{key:"renderBackground",value:function(){var r=this,a=this.props,i=a.data,o=a.dataKey,c=a.activeIndex,d=gt(this.props.background,!1);return i.map(function(f,h){f.value;var p=f.background,x=mce(f,hce);if(!p)return null;var g=Mn(Mn(Mn(Mn(Mn({},x),{},{fill:"#eee"},p),d),Do(r.props,f,h)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:o,index:h,className:"recharts-bar-background-rectangle"});return W.createElement(FI,Am({key:"background-bar-".concat(h),option:r.props.background,isActive:h===c},g))})}},{key:"renderErrorBar",value:function(r,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.data,c=i.xAxis,d=i.yAxis,f=i.layout,h=i.children,p=ia(h,Rf);if(!p)return null;var x=f==="vertical"?o[0].height/2:o[0].width/2,g=function(y,S){var C=Array.isArray(y.value)?y.value[1]:y.value;return{x:y.x,y:y.y,value:C,errorVal:qn(y,S)}},j={clipPath:r?"url(#clipPath-".concat(a,")"):null};return W.createElement(qt,j,p.map(function(b){return W.cloneElement(b,{key:"error-bar-".concat(a,"-").concat(b.props.dataKey),data:o,xAxis:c,yAxis:d,layout:f,offset:x,dataPointFormatter:g})}))}},{key:"render",value:function(){var r=this.props,a=r.hide,i=r.data,o=r.className,c=r.xAxis,d=r.yAxis,f=r.left,h=r.top,p=r.width,x=r.height,g=r.isAnimationActive,j=r.background,b=r.id;if(a||!i||!i.length)return null;var y=this.state.isAnimationFinished,S=_t("recharts-bar",o),C=c&&c.allowDataOverflow,N=d&&d.allowDataOverflow,E=C||N,_=At(b)?this.id:b;return W.createElement(qt,{className:S},C||N?W.createElement("defs",null,W.createElement("clipPath",{id:"clipPath-".concat(_)},W.createElement("rect",{x:C?f:f-p/2,y:N?h:h-x/2,width:C?p:p*2,height:N?x:x*2}))):null,W.createElement(qt,{className:"recharts-bar-rectangles",clipPath:E?"url(#clipPath-".concat(_,")"):null},j?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(E,_),(!g||y)&&Qs.renderCallByParent(this.props,i))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:a.curData}:r.data!==a.curData?{curData:r.data}:null}}])})(v.PureComponent);x4=sl;Li(sl,"displayName","Bar");Li(sl,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!tl.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Li(sl,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,a=e.bandSize,i=e.xAxis,o=e.yAxis,c=e.xAxisTicks,d=e.yAxisTicks,f=e.stackedData,h=e.dataStartIndex,p=e.displayedData,x=e.offset,g=Kre(r,n);if(!g)return null;var j=t.layout,b=n.type.defaultProps,y=b!==void 0?Mn(Mn({},b),n.props):n.props,S=y.dataKey,C=y.children,N=y.minPointSize,E=j==="horizontal"?o:i,_=f?E.scale.domain():null,P=eae({numericAxis:E}),O=ia(C,Tv),T=p.map(function(I,M){var D,R,q,U,H,J;f?D=Gre(f[h+M],_):(D=qn(I,S),Array.isArray(D)||(D=[P,D]));var Z=pce(N,x4.defaultProps.minPointSize)(D[1],M);if(j==="horizontal"){var F,z=[o.scale(D[0]),o.scale(D[1])],ee=z[0],B=z[1];R=m2({axis:i,ticks:c,bandSize:a,offset:g.offset,entry:I,index:M}),q=(F=B??ee)!==null&&F!==void 0?F:void 0,U=g.size;var L=ee-B;if(H=Number.isNaN(L)?0:L,J={x:R,y:o.y,width:U,height:o.height},Math.abs(Z)>0&&Math.abs(H)<Math.abs(Z)){var te=jr(H||Z)*(Math.abs(Z)-Math.abs(H));q-=te,H+=te}}else{var ie=[i.scale(D[0]),i.scale(D[1])],G=ie[0],de=ie[1];if(R=G,q=m2({axis:o,ticks:d,bandSize:a,offset:g.offset,entry:I,index:M}),U=de-G,H=g.size,J={x:i.x,y:q,width:i.width,height:H},Math.abs(Z)>0&&Math.abs(U)<Math.abs(Z)){var oe=jr(U||Z)*(Math.abs(Z)-Math.abs(U));U+=oe}}return Mn(Mn(Mn({},I),{},{x:R,y:q,width:U,height:H,value:f?D:D[1],payload:I,background:J},O&&O[M]&&O[M].props),{},{tooltipPayload:[KL(n,I)],tooltipPosition:{x:R+U/2,y:q+H/2}})});return Mn({data:T,layout:j},x)});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 Nce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function UI(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,w4(r.key),r)}}function Cce(e,t,n){return t&&UI(e.prototype,t),n&&UI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function qI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function za(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qI(Object(n),!0).forEach(function(r){Qv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qv(e,t,n){return t=w4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w4(e){var t=Ace(e,"string");return sf(t)=="symbol"?t:t+""}function Ace(e,t){if(sf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(sf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var j4=function(t,n,r,a,i){var o=t.width,c=t.height,d=t.layout,f=t.children,h=Object.keys(n),p={left:r.left,leftMirror:r.left,right:o-r.right,rightMirror:o-r.right,top:r.top,topMirror:r.top,bottom:c-r.bottom,bottomMirror:c-r.bottom},x=!!Jr(f,sl);return h.reduce(function(g,j){var b=n[j],y=b.orientation,S=b.domain,C=b.padding,N=C===void 0?{}:C,E=b.mirror,_=b.reversed,P="".concat(y).concat(E?"Mirror":""),O,T,I,M,D;if(b.type==="number"&&(b.padding==="gap"||b.padding==="no-gap")){var R=S[1]-S[0],q=1/0,U=b.categoricalDomain.sort(MY);if(U.forEach(function(ie,G){G>0&&(q=Math.min((ie||0)-(U[G-1]||0),q))}),Number.isFinite(q)){var H=q/R,J=b.layout==="vertical"?r.height:r.width;if(b.padding==="gap"&&(O=H*J/2),b.padding==="no-gap"){var Z=Sr(t.barCategoryGap,H*J),F=H*J/2;O=F-Z-(F-Z)/J*Z}}}a==="xAxis"?T=[r.left+(N.left||0)+(O||0),r.left+r.width-(N.right||0)-(O||0)]:a==="yAxis"?T=d==="horizontal"?[r.top+r.height-(N.bottom||0),r.top+(N.top||0)]:[r.top+(N.top||0)+(O||0),r.top+r.height-(N.bottom||0)-(O||0)]:T=b.range,_&&(T=[T[1],T[0]]);var z=qL(b,i,x),ee=z.scale,B=z.realScaleType;ee.domain(S).range(T),WL(ee);var L=VL(ee,za(za({},b),{},{realScaleType:B}));a==="xAxis"?(D=y==="top"&&!E||y==="bottom"&&E,I=r.left,M=p[P]-D*b.height):a==="yAxis"&&(D=y==="left"&&!E||y==="right"&&E,I=p[P]-D*b.width,M=r.top);var te=za(za(za({},b),L),{},{realScaleType:B,x:I,y:M,scale:ee,width:a==="xAxis"?r.width:b.width,height:a==="yAxis"?r.height:b.height});return te.bandSize=cm(te,L),!b.hide&&a==="xAxis"?p[P]+=(D?-1:1)*te.height:b.hide||(p[P]+=(D?-1:1)*te.width),za(za({},g),{},Qv({},j,te))},{})},S4=function(t,n){var r=t.x,a=t.y,i=n.x,o=n.y;return{x:Math.min(r,i),y:Math.min(a,o),width:Math.abs(i-r),height:Math.abs(o-a)}},_ce=function(t){var n=t.x1,r=t.y1,a=t.x2,i=t.y2;return S4({x:n,y:r},{x:a,y:i})},N4=(function(){function e(t){Nce(this,e),this.scale=t}return Cce(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]:{},a=r.bandAware,i=r.position;if(n!==void 0){if(i)switch(i){case"start":return this.scale(n);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+o}case"end":{var c=this.bandwidth?this.bandwidth():0;return this.scale(n)+c}default:return this.scale(n)}if(a){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(),a=r[0],i=r[r.length-1];return a<=i?n>=a&&n<=i:n>=i&&n<=a}}],[{key:"create",value:function(n){return new e(n)}}])})();Qv(N4,"EPS",1e-4);var pC=function(t){var n=Object.keys(t).reduce(function(r,a){return za(za({},r),{},Qv({},a,N4.create(t[a])))},{});return za(za({},n),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.bandAware,c=i.position;return ece(a,function(d,f){return n[f].apply(d,{bandAware:o,position:c})})},isInRange:function(a){return sce(a,function(i,o){return n[o].isInRange(i)})}})};function Ece(e){return(e%180+180)%180}var Pce=function(t){var n=t.width,r=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=Ece(a),o=i*Math.PI/180,c=Math.atan(r/n),d=o>c&&o<Math.PI-c?r/Math.sin(o):n/Math.cos(o);return Math.abs(d)},wj,WI;function kce(){if(WI)return wj;WI=1;var e=_s(),t=_f(),n=Pv();function r(a){return function(i,o,c){var d=Object(i);if(!t(i)){var f=e(o,3);i=n(i),o=function(p){return f(d[p],p,d)}}var h=a(i,o,c);return h>-1?d[f?i[h]:h]:void 0}}return wj=r,wj}var jj,VI;function Oce(){if(VI)return jj;VI=1;var e=h4();function t(n){var r=e(n),a=r%1;return r===r?a?r-a:r:0}return jj=t,jj}var Sj,HI;function Tce(){if(HI)return Sj;HI=1;var e=A5(),t=_s(),n=Oce(),r=Math.max;function a(i,o,c){var d=i==null?0:i.length;if(!d)return-1;var f=c==null?0:n(c);return f<0&&(f=r(d+f,0)),e(i,t(o,3),f)}return Sj=a,Sj}var Nj,KI;function Rce(){if(KI)return Nj;KI=1;var e=kce(),t=Tce(),n=e(t);return Nj=n,Nj}Rce();var Ice=U3();const Mce=Yt(Ice);var $ce=Mce(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("")}),C4=v.createContext(void 0),A4=v.createContext(void 0),_4=v.createContext(void 0),Dce=v.createContext({}),E4=v.createContext(void 0),P4=v.createContext(0),k4=v.createContext(0),GI=function(t){var n=t.state,r=n.xAxisMap,a=n.yAxisMap,i=n.offset,o=t.clipPathId,c=t.children,d=t.width,f=t.height,h=$ce(i);return W.createElement(C4.Provider,{value:r},W.createElement(A4.Provider,{value:a},W.createElement(Dce.Provider,{value:i},W.createElement(_4.Provider,{value:h},W.createElement(E4.Provider,{value:o},W.createElement(P4.Provider,{value:f},W.createElement(k4.Provider,{value:d},c)))))))},Lce=function(){return v.useContext(E4)},O4=function(t){var n=v.useContext(C4);n==null&&Bo();var r=n[t];return r==null&&Bo(),r},T4=function(t){var n=v.useContext(A4);n==null&&Bo();var r=n[t];return r==null&&Bo(),r},Fce=function(){var t=v.useContext(_4);return t},R4=function(){return v.useContext(k4)},I4=function(){return v.useContext(P4)};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 Bce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zce(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 Uce(e,t,n){return t&&zce(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function qce(e,t,n){return t=Em(t),Wce(e,M4()?Reflect.construct(t,n||[],Em(e).constructor):t.apply(e,n))}function Wce(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 Vce(e)}function Vce(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 Em(e){return Em=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Em(e)}function Hce(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&&cS(e,t)}function cS(e,t){return cS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},cS(e,t)}function YI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function XI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YI(Object(n),!0).forEach(function(r){hC(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hC(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=Kce(e,"string");return Ic(t)=="symbol"?t:t+""}function Kce(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 Gce(e,t){return Jce(e)||Qce(e,t)||Xce(e,t)||Yce()}function Yce(){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 Xce(e,t){if(e){if(typeof e=="string")return QI(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 QI(e,t)}}function QI(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 Qce(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function Jce(e){if(Array.isArray(e))return e}function uS(){return uS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uS.apply(this,arguments)}var Zce=function(t,n){var r;return W.isValidElement(t)?r=W.cloneElement(t,n):Ct(t)?r=t(n):r=W.createElement("line",uS({},n,{className:"recharts-reference-line-line"})),r},eue=function(t,n,r,a,i,o,c,d,f){var h=i.x,p=i.y,x=i.width,g=i.height;if(r){var j=f.y,b=t.y.apply(j,{position:o});if(vs(f,"discard")&&!t.y.isInRange(b))return null;var y=[{x:h+x,y:b},{x:h,y:b}];return d==="left"?y.reverse():y}if(n){var S=f.x,C=t.x.apply(S,{position:o});if(vs(f,"discard")&&!t.x.isInRange(C))return null;var N=[{x:C,y:p+g},{x:C,y:p}];return c==="top"?N.reverse():N}if(a){var E=f.segment,_=E.map(function(P){return t.apply(P,{position:o})});return vs(f,"discard")&&Xle(_,function(P){return!t.isInRange(P)})?null:_}return null};function tue(e){var t=e.x,n=e.y,r=e.segment,a=e.xAxisId,i=e.yAxisId,o=e.shape,c=e.className,d=e.alwaysShow,f=Lce(),h=O4(a),p=T4(i),x=Fce();if(!f||!x)return null;Ys(d===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var g=pC({x:h.scale,y:p.scale}),j=Wn(t),b=Wn(n),y=r&&r.length===2,S=eue(g,j,b,y,x,e.position,h.orientation,p.orientation,e);if(!S)return null;var C=Gce(S,2),N=C[0],E=N.x,_=N.y,P=C[1],O=P.x,T=P.y,I=vs(e,"hidden")?"url(#".concat(f,")"):void 0,M=XI(XI({clipPath:I},gt(e,!0)),{},{x1:E,y1:_,x2:O,y2:T});return W.createElement(qt,{className:_t("recharts-reference-line",c)},Zce(o,M),tr.renderCallByParent(e,_ce({x1:E,y1:_,x2:O,y2:T})))}var mC=(function(e){function t(){return Bce(this,t),qce(this,t,arguments)}return Hce(t,e),Uce(t,[{key:"render",value:function(){return W.createElement(tue,this.props)}}])})(W.Component);hC(mC,"displayName","ReferenceLine");hC(mC,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});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 Mc(e){"@babel/helpers - typeof";return Mc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mc(e)}function JI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ZI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JI(Object(n),!0).forEach(function(r){Jv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rue(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 aue(e,t,n){return t&&rue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function sue(e,t,n){return t=Pm(t),iue(e,D4()?Reflect.construct(t,n||[],Pm(e).constructor):t.apply(e,n))}function iue(e,t){if(t&&(Mc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oue(e)}function oue(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 Pm(e){return Pm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Pm(e)}function lue(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fS(e,t)}function fS(e,t){return fS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},fS(e,t)}function Jv(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=cue(e,"string");return Mc(t)=="symbol"?t:t+""}function cue(e,t){if(Mc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Mc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var uue=function(t){var n=t.x,r=t.y,a=t.xAxis,i=t.yAxis,o=pC({x:a.scale,y:i.scale}),c=o.apply({x:n,y:r},{bandAware:!0});return vs(t,"discard")&&!o.isInRange(c)?null:c},Zv=(function(e){function t(){return nue(this,t),sue(this,t,arguments)}return lue(t,e),aue(t,[{key:"render",value:function(){var r=this.props,a=r.x,i=r.y,o=r.r,c=r.alwaysShow,d=r.clipPathId,f=Wn(a),h=Wn(i);if(Ys(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!f||!h)return null;var p=uue(this.props);if(!p)return null;var x=p.x,g=p.y,j=this.props,b=j.shape,y=j.className,S=vs(this.props,"hidden")?"url(#".concat(d,")"):void 0,C=ZI(ZI({clipPath:S},gt(this.props,!0)),{},{cx:x,cy:g});return W.createElement(qt,{className:_t("recharts-reference-dot",y)},t.renderDot(b,C),tr.renderCallByParent(this.props,{x:x-o,y:g-o,width:2*o,height:2*o}))}}])})(W.Component);Jv(Zv,"displayName","ReferenceDot");Jv(Zv,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});Jv(Zv,"renderDot",function(e,t){var n;return W.isValidElement(e)?n=W.cloneElement(e,t):Ct(e)?n=e(t):n=W.createElement(Wv,dS({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});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 $c(e){"@babel/helpers - typeof";return $c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$c(e)}function eM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function tM(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){eg(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 due(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fue(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,B4(r.key),r)}}function pue(e,t,n){return t&&fue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function hue(e,t,n){return t=km(t),mue(e,F4()?Reflect.construct(t,n||[],km(e).constructor):t.apply(e,n))}function mue(e,t){if(t&&($c(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vue(e)}function vue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function F4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(F4=function(){return!!e})()}function km(e){return km=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},km(e)}function gue(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&&hS(e,t)}function hS(e,t){return hS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},hS(e,t)}function eg(e,t,n){return t=B4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B4(e){var t=xue(e,"string");return $c(t)=="symbol"?t:t+""}function xue(e,t){if($c(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if($c(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var yue=function(t,n,r,a,i){var o=i.x1,c=i.x2,d=i.y1,f=i.y2,h=i.xAxis,p=i.yAxis;if(!h||!p)return null;var x=pC({x:h.scale,y:p.scale}),g={x:t?x.x.apply(o,{position:"start"}):x.x.rangeMin,y:r?x.y.apply(d,{position:"start"}):x.y.rangeMin},j={x:n?x.x.apply(c,{position:"end"}):x.x.rangeMax,y:a?x.y.apply(f,{position:"end"}):x.y.rangeMax};return vs(i,"discard")&&(!x.isInRange(g)||!x.isInRange(j))?null:S4(g,j)},tg=(function(e){function t(){return due(this,t),hue(this,t,arguments)}return gue(t,e),pue(t,[{key:"render",value:function(){var r=this.props,a=r.x1,i=r.x2,o=r.y1,c=r.y2,d=r.className,f=r.alwaysShow,h=r.clipPathId;Ys(f===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=Wn(a),x=Wn(i),g=Wn(o),j=Wn(c),b=this.props.shape;if(!p&&!x&&!g&&!j&&!b)return null;var y=yue(p,x,g,j,this.props);if(!y&&!b)return null;var S=vs(this.props,"hidden")?"url(#".concat(h,")"):void 0;return W.createElement(qt,{className:_t("recharts-reference-area",d)},t.renderRect(b,tM(tM({clipPath:S},gt(this.props,!0)),y)),tr.renderCallByParent(this.props,y))}}])})(W.Component);eg(tg,"displayName","ReferenceArea");eg(tg,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});eg(tg,"renderRect",function(e,t){var n;return W.isValidElement(e)?n=W.cloneElement(e,t):Ct(e)?n=e(t):n=W.createElement(fC,pS({},t,{className:"recharts-reference-area-rect"})),n});function z4(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],a=0;a<e.length;a+=t)r.push(e[a]);return r}function bue(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return Pce(r,n)}function wue(e,t,n){var r=n==="width",a=e.x,i=e.y,o=e.width,c=e.height;return t===1?{start:r?a:i,end:r?a+o:i+c}:{start:r?a+o:i+c,end:r?a:i}}function Om(e,t,n,r,a){if(e*t<e*r||e*t>e*a)return!1;var i=n();return e*(t-e*i/2-r)>=0&&e*(t+e*i/2-a)<=0}function jue(e,t){return z4(e,t+1)}function Sue(e,t,n,r,a){for(var i=(r||[]).slice(),o=t.start,c=t.end,d=0,f=1,h=o,p=function(){var j=r?.[d];if(j===void 0)return{v:z4(r,f)};var b=d,y,S=function(){return y===void 0&&(y=n(j,b)),y},C=j.coordinate,N=d===0||Om(e,C,S,h,c);N||(d=0,h=o,f+=1),N&&(h=C+e*(S()/2+a),d+=f)},x;f<=i.length;)if(x=p(),x)return x.v;return[]}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 nM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function gr(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){Nue(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 Nue(e,t,n){return t=Cue(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cue(e){var t=Aue(e,"string");return of(t)=="symbol"?t:t+""}function Aue(e,t){if(of(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(of(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _ue(e,t,n,r,a){for(var i=(r||[]).slice(),o=i.length,c=t.start,d=t.end,f=function(x){var g=i[x],j,b=function(){return j===void 0&&(j=n(g,x)),j};if(x===o-1){var y=e*(g.coordinate+e*b()/2-d);i[x]=g=gr(gr({},g),{},{tickCoord:y>0?g.coordinate-y*e:g.coordinate})}else i[x]=g=gr(gr({},g),{},{tickCoord:g.coordinate});var S=Om(e,g.tickCoord,b,c,d);S&&(d=g.tickCoord-e*(b()/2+a),i[x]=gr(gr({},g),{},{isShow:!0}))},h=o-1;h>=0;h--)f(h);return i}function Eue(e,t,n,r,a,i){var o=(r||[]).slice(),c=o.length,d=t.start,f=t.end;if(i){var h=r[c-1],p=n(h,c-1),x=e*(h.coordinate+e*p/2-f);o[c-1]=h=gr(gr({},h),{},{tickCoord:x>0?h.coordinate-x*e:h.coordinate});var g=Om(e,h.tickCoord,function(){return p},d,f);g&&(f=h.tickCoord-e*(p/2+a),o[c-1]=gr(gr({},h),{},{isShow:!0}))}for(var j=i?c-1:c,b=function(C){var N=o[C],E,_=function(){return E===void 0&&(E=n(N,C)),E};if(C===0){var P=e*(N.coordinate-e*_()/2-d);o[C]=N=gr(gr({},N),{},{tickCoord:P<0?N.coordinate-P*e:N.coordinate})}else o[C]=N=gr(gr({},N),{},{tickCoord:N.coordinate});var O=Om(e,N.tickCoord,_,d,f);O&&(d=N.tickCoord+e*(_()/2+a),o[C]=gr(gr({},N),{},{isShow:!0}))},y=0;y<j;y++)b(y);return o}function Pue(e,t,n){var r=e.tick,a=e.ticks,i=e.viewBox,o=e.minTickGap,c=e.orientation,d=e.interval,f=e.tickFormatter,h=e.unit,p=e.angle;if(!a||!a.length||!r)return[];if(We(d)||tl.isSsr)return jue(a,typeof d=="number"&&We(d)?d:0);var x=[],g=c==="top"||c==="bottom"?"width":"height",j=h&&g==="width"?pd(h,{fontSize:t,letterSpacing:n}):{width:0,height:0},b=function(N,E){var _=Ct(f)?f(N.value,E):N.value;return g==="width"?bue(pd(_,{fontSize:t,letterSpacing:n}),j,p):pd(_,{fontSize:t,letterSpacing:n})[g]},y=a.length>=2?jr(a[1].coordinate-a[0].coordinate):1,S=wue(i,y,g);return d==="equidistantPreserveStart"?Sue(y,S,b,a,o):(d==="preserveStart"||d==="preserveStartEnd"?x=Eue(y,S,b,a,o,d==="preserveStartEnd"):x=_ue(y,S,b,a,o),x.filter(function(C){return C.isShow}))}var kue=["viewBox"],Oue=["viewBox"],Tue=["ticks"];function Dc(e){"@babel/helpers - typeof";return Dc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dc(e)}function Zl(){return Zl=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},Zl.apply(this,arguments)}function rM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function zn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rM(Object(n),!0).forEach(function(r){vC(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cj(e,t){if(e==null)return{};var n=Rue(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Rue(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 Iue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aM(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,q4(r.key),r)}}function Mue(e,t,n){return t&&aM(e.prototype,t),n&&aM(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function $ue(e,t,n){return t=Tm(t),Due(e,U4()?Reflect.construct(t,n||[],Tm(e).constructor):t.apply(e,n))}function Due(e,t){if(t&&(Dc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Lue(e)}function Lue(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 Tm(e){return Tm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Tm(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&&mS(e,t)}function mS(e,t){return mS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},mS(e,t)}function vC(e,t,n){return t=q4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function q4(e){var t=Bue(e,"string");return Dc(t)=="symbol"?t:t+""}function Bue(e,t){if(Dc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Dc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var ng=(function(e){function t(n){var r;return Iue(this,t),r=$ue(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return Fue(t,e),Mue(t,[{key:"shouldComponentUpdate",value:function(r,a){var i=r.viewBox,o=Cj(r,kue),c=this.props,d=c.viewBox,f=Cj(c,Oue);return!oc(i,d)||!oc(o,f)||!oc(a,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var a=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];a&&this.setState({fontSize:window.getComputedStyle(a).fontSize,letterSpacing:window.getComputedStyle(a).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var a=this.props,i=a.x,o=a.y,c=a.width,d=a.height,f=a.orientation,h=a.tickSize,p=a.mirror,x=a.tickMargin,g,j,b,y,S,C,N=p?-1:1,E=r.tickSize||h,_=We(r.tickCoord)?r.tickCoord:r.coordinate;switch(f){case"top":g=j=r.coordinate,y=o+ +!p*d,b=y-N*E,C=b-N*x,S=_;break;case"left":b=y=r.coordinate,j=i+ +!p*c,g=j-N*E,S=g-N*x,C=_;break;case"right":b=y=r.coordinate,j=i+ +p*c,g=j+N*E,S=g+N*x,C=_;break;default:g=j=r.coordinate,y=o+ +p*d,b=y+N*E,C=b+N*x,S=_;break}return{line:{x1:g,y1:b,x2:j,y2:y},tick:{x:S,y:C}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,a=r.orientation,i=r.mirror,o;switch(a){case"left":o=i?"start":"end";break;case"right":o=i?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,a=r.orientation,i=r.mirror,o="end";switch(a){case"left":case"right":o="middle";break;case"top":o=i?"start":"end";break;default:o=i?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.x,i=r.y,o=r.width,c=r.height,d=r.orientation,f=r.mirror,h=r.axisLine,p=zn(zn(zn({},gt(this.props,!1)),gt(h,!1)),{},{fill:"none"});if(d==="top"||d==="bottom"){var x=+(d==="top"&&!f||d==="bottom"&&f);p=zn(zn({},p),{},{x1:a,y1:i+x*c,x2:a+o,y2:i+x*c})}else{var g=+(d==="left"&&!f||d==="right"&&f);p=zn(zn({},p),{},{x1:a+g*o,y1:i,x2:a+g*o,y2:i+c})}return W.createElement("line",Zl({},p,{className:_t("recharts-cartesian-axis-line",sa(h,"className"))}))}},{key:"renderTicks",value:function(r,a,i){var o=this,c=this.props,d=c.tickLine,f=c.stroke,h=c.tick,p=c.tickFormatter,x=c.unit,g=Pue(zn(zn({},this.props),{},{ticks:r}),a,i),j=this.getTickTextAnchor(),b=this.getTickVerticalAnchor(),y=gt(this.props,!1),S=gt(h,!1),C=zn(zn({},y),{},{fill:"none"},gt(d,!1)),N=g.map(function(E,_){var P=o.getTickLineCoord(E),O=P.line,T=P.tick,I=zn(zn(zn(zn({textAnchor:j,verticalAnchor:b},y),{},{stroke:"none",fill:f},S),T),{},{index:_,payload:E,visibleTicksCount:g.length,tickFormatter:p});return W.createElement(qt,Zl({className:"recharts-cartesian-axis-tick",key:"tick-".concat(E.value,"-").concat(E.coordinate,"-").concat(E.tickCoord)},Do(o.props,E,_)),d&&W.createElement("line",Zl({},C,O,{className:_t("recharts-cartesian-axis-tick-line",sa(d,"className"))})),h&&t.renderTickItem(h,I,"".concat(Ct(p)?p(E.value,_):E.value).concat(x||"")))});return W.createElement("g",{className:"recharts-cartesian-axis-ticks"},N)}},{key:"render",value:function(){var r=this,a=this.props,i=a.axisLine,o=a.width,c=a.height,d=a.ticksGenerator,f=a.className,h=a.hide;if(h)return null;var p=this.props,x=p.ticks,g=Cj(p,Tue),j=x;return Ct(d)&&(j=x&&x.length>0?d(this.props):d(g)),o<=0||c<=0||!j||!j.length?null:W.createElement(qt,{className:_t("recharts-cartesian-axis",f),ref:function(y){r.layerReference=y}},i&&this.renderAxisLine(),this.renderTicks(j,this.state.fontSize,this.state.letterSpacing),tr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,a,i){var o,c=_t(a.className,"recharts-cartesian-axis-tick-value");return W.isValidElement(r)?o=W.cloneElement(r,zn(zn({},a),{},{className:c})):Ct(r)?o=r(zn(zn({},a),{},{className:c})):o=W.createElement(Lo,Zl({},a,{className:"recharts-cartesian-axis-tick-value"}),i),o}}])})(v.Component);vC(ng,"displayName","CartesianAxis");vC(ng,"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 zue=["type","layout","connectNulls","ref"],Uue=["key"];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 sM(e,t){if(e==null)return{};var n=que(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function que(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 yd(){return yd=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},yd.apply(this,arguments)}function iM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Xr(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){Ua(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 zl(e){return Kue(e)||Hue(e)||Vue(e)||Wue()}function Wue(){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 Vue(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 Hue(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Kue(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}function Gue(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,V4(r.key),r)}}function Yue(e,t,n){return t&&oM(e.prototype,t),n&&oM(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Xue(e,t,n){return t=Rm(t),Que(e,W4()?Reflect.construct(t,n||[],Rm(e).constructor):t.apply(e,n))}function Que(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 Jue(e)}function Jue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function 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 Zue(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gS(e,t)}function gS(e,t){return gS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},gS(e,t)}function Ua(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=ede(e,"string");return Lc(t)=="symbol"?t:t+""}function ede(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 zo=(function(e){function t(){var n;Gue(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=Xue(this,t,[].concat(a)),Ua(n,"state",{isAnimationFinished:!0,totalLength:0}),Ua(n,"generateSimpleStrokeDasharray",function(o,c){return"".concat(c,"px ").concat(o-c,"px")}),Ua(n,"getStrokeDasharray",function(o,c,d){var f=d.reduce(function(S,C){return S+C});if(!f)return n.generateSimpleStrokeDasharray(c,o);for(var h=Math.floor(o/f),p=o%f,x=c-o,g=[],j=0,b=0;j<d.length;b+=d[j],++j)if(b+d[j]>p){g=[].concat(zl(d.slice(0,j)),[p-b]);break}var y=g.length%2===0?[0,x]:[x];return[].concat(zl(t.repeat(d,h)),zl(g),y).map(function(S){return"".concat(S,"px")}).join(", ")}),Ua(n,"id",au("recharts-line-")),Ua(n,"pathRef",function(o){n.mainCurve=o}),Ua(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Ua(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return Zue(t,e),Yue(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,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.points,c=i.xAxis,d=i.yAxis,f=i.layout,h=i.children,p=ia(h,Rf);if(!p)return null;var x=function(b,y){return{x:b.x,y:b.y,value:b.value,errorVal:qn(b.payload,y)}},g={clipPath:r?"url(#clipPath-".concat(a,")"):null};return W.createElement(qt,g,p.map(function(j){return W.cloneElement(j,{key:"bar-".concat(j.props.dataKey),data:o,xAxis:c,yAxis:d,layout:f,dataPointFormatter:x})}))}},{key:"renderDots",value:function(r,a,i){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var c=this.props,d=c.dot,f=c.points,h=c.dataKey,p=gt(this.props,!1),x=gt(d,!0),g=f.map(function(b,y){var S=Xr(Xr(Xr({key:"dot-".concat(y),r:3},p),x),{},{index:y,cx:b.x,cy:b.y,value:b.value,dataKey:h,payload:b.payload,points:f});return t.renderDotItem(d,S)}),j={clipPath:r?"url(#clipPath-".concat(a?"":"dots-").concat(i,")"):null};return W.createElement(qt,yd({className:"recharts-line-dots",key:"dots"},j),g)}},{key:"renderCurveStatically",value:function(r,a,i,o){var c=this.props,d=c.type,f=c.layout,h=c.connectNulls;c.ref;var p=sM(c,zue),x=Xr(Xr(Xr({},gt(p,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:a?"url(#clipPath-".concat(i,")"):null,points:r},o),{},{type:d,layout:f,connectNulls:h});return W.createElement(fm,yd({},x,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,a){var i=this,o=this.props,c=o.points,d=o.strokeDasharray,f=o.isAnimationActive,h=o.animationBegin,p=o.animationDuration,x=o.animationEasing,g=o.animationId,j=o.animateNewValues,b=o.width,y=o.height,S=this.state,C=S.prevPoints,N=S.totalLength;return W.createElement(js,{begin:h,duration:p,isActive:f,easing:x,from:{t:0},to:{t:1},key:"line-".concat(g),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(E){var _=E.t;if(C){var P=C.length/c.length,O=c.map(function(R,q){var U=Math.floor(q*P);if(C[U]){var H=C[U],J=ea(H.x,R.x),Z=ea(H.y,R.y);return Xr(Xr({},R),{},{x:J(_),y:Z(_)})}if(j){var F=ea(b*2,R.x),z=ea(y/2,R.y);return Xr(Xr({},R),{},{x:F(_),y:z(_)})}return Xr(Xr({},R),{},{x:R.x,y:R.y})});return i.renderCurveStatically(O,r,a)}var T=ea(0,N),I=T(_),M;if(d){var D="".concat(d).split(/[,\s]+/gim).map(function(R){return parseFloat(R)});M=i.getStrokeDasharray(I,N,D)}else M=i.generateSimpleStrokeDasharray(N,I);return i.renderCurveStatically(c,r,a,{strokeDasharray:M})})}},{key:"renderCurve",value:function(r,a){var i=this.props,o=i.points,c=i.isAnimationActive,d=this.state,f=d.prevPoints,h=d.totalLength;return c&&o&&o.length&&(!f&&h>0||!Tf(f,o))?this.renderCurveWithAnimation(r,a):this.renderCurveStatically(o,r,a)}},{key:"render",value:function(){var r,a=this.props,i=a.hide,o=a.dot,c=a.points,d=a.className,f=a.xAxis,h=a.yAxis,p=a.top,x=a.left,g=a.width,j=a.height,b=a.isAnimationActive,y=a.id;if(i||!c||!c.length)return null;var S=this.state.isAnimationFinished,C=c.length===1,N=_t("recharts-line",d),E=f&&f.allowDataOverflow,_=h&&h.allowDataOverflow,P=E||_,O=At(y)?this.id:y,T=(r=gt(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},I=T.r,M=I===void 0?3:I,D=T.strokeWidth,R=D===void 0?2:D,q=WY(o)?o:{},U=q.clipDot,H=U===void 0?!0:U,J=M*2+R;return W.createElement(qt,{className:N},E||_?W.createElement("defs",null,W.createElement("clipPath",{id:"clipPath-".concat(O)},W.createElement("rect",{x:E?x:x-g/2,y:_?p:p-j/2,width:E?g:g*2,height:_?j:j*2})),!H&&W.createElement("clipPath",{id:"clipPath-dots-".concat(O)},W.createElement("rect",{x:x-J/2,y:p-J/2,width:g+J,height:j+J}))):null,!C&&this.renderCurve(P,O),this.renderErrorBar(P,O),(C||o)&&this.renderDots(P,H,O),(!b||S)&&Qs.renderCallByParent(this.props,c))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:a.curPoints}:r.points!==a.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,a){for(var i=r.length%2!==0?[].concat(zl(r),[0]):r,o=[],c=0;c<a;++c)o=[].concat(zl(o),zl(i));return o}},{key:"renderDotItem",value:function(r,a){var i;if(W.isValidElement(r))i=W.cloneElement(r,a);else if(Ct(r))i=r(a);else{var o=a.key,c=sM(a,Uue),d=_t("recharts-line-dot",typeof r!="boolean"?r.className:"");i=W.createElement(Wv,yd({key:o},c,{className:d}))}return i}}])})(v.PureComponent);Ua(zo,"displayName","Line");Ua(zo,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!tl.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Ua(zo,"getComposedData",function(e){var t=e.props,n=e.xAxis,r=e.yAxis,a=e.xAxisTicks,i=e.yAxisTicks,o=e.dataKey,c=e.bandSize,d=e.displayedData,f=e.offset,h=t.layout,p=d.map(function(x,g){var j=qn(x,o);return h==="horizontal"?{x:h2({axis:n,ticks:a,bandSize:c,entry:x,index:g}),y:At(j)?null:r.scale(j),value:j,payload:x}:{x:At(j)?null:n.scale(j),y:h2({axis:r,ticks:i,bandSize:c,entry:x,index:g}),value:j,payload:x}});return Xr({points:p,layout:h},f)});function Fc(e){"@babel/helpers - typeof";return Fc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fc(e)}function 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,G4(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=Im(t),sde(e,H4()?Reflect.construct(t,n||[],Im(e).constructor):t.apply(e,n))}function sde(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 ide(e)}function ide(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function H4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(H4=function(){return!!e})()}function Im(e){return Im=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Im(e)}function ode(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,a){return r.__proto__=a,r},xS(e,t)}function K4(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=lde(e,"string");return Fc(t)=="symbol"?t:t+""}function lde(e,t){if(Fc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Fc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function yS(){return yS=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},yS.apply(this,arguments)}function cde(e){var t=e.xAxisId,n=R4(),r=I4(),a=O4(t);return a==null?null:v.createElement(ng,yS({},a,{className:_t("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(o){return Po(o,!0)}}))}var Vi=(function(e){function t(){return tde(this,t),ade(this,t,arguments)}return ode(t,e),rde(t,[{key:"render",value:function(){return v.createElement(cde,this.props)}}])})(v.Component);K4(Vi,"displayName","XAxis");K4(Vi,"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 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 ude(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dde(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Q4(r.key),r)}}function fde(e,t,n){return t&&dde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function pde(e,t,n){return t=Mm(t),hde(e,Y4()?Reflect.construct(t,n||[],Mm(e).constructor):t.apply(e,n))}function hde(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 mde(e)}function mde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Y4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Y4=function(){return!!e})()}function Mm(e){return Mm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Mm(e)}function vde(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bS(e,t)}function bS(e,t){return bS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},bS(e,t)}function X4(e,t,n){return t=Q4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Q4(e){var t=gde(e,"string");return Bc(t)=="symbol"?t:t+""}function gde(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 String(e)}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)}var xde=function(t){var n=t.yAxisId,r=R4(),a=I4(),i=T4(n);return i==null?null:v.createElement(ng,wS({},i,{className:_t("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:r,height:a},ticksGenerator:function(c){return Po(c,!0)}}))},Hi=(function(e){function t(){return ude(this,t),pde(this,t,arguments)}return vde(t,e),fde(t,[{key:"render",value:function(){return v.createElement(xde,this.props)}}])})(v.Component);X4(Hi,"displayName","YAxis");X4(Hi,"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 lM(e){return jde(e)||wde(e)||bde(e)||yde()}function yde(){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 bde(e,t){if(e){if(typeof e=="string")return jS(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 jS(e,t)}}function wde(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function jde(e){if(Array.isArray(e))return jS(e)}function jS(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 SS=function(t,n,r,a,i){var o=ia(t,mC),c=ia(t,Zv),d=[].concat(lM(o),lM(c)),f=ia(t,tg),h="".concat(a,"Id"),p=a[0],x=n;if(d.length&&(x=d.reduce(function(b,y){if(y.props[h]===r&&vs(y.props,"extendDomain")&&We(y.props[p])){var S=y.props[p];return[Math.min(b[0],S),Math.max(b[1],S)]}return b},x)),f.length){var g="".concat(p,"1"),j="".concat(p,"2");x=f.reduce(function(b,y){if(y.props[h]===r&&vs(y.props,"extendDomain")&&We(y.props[g])&&We(y.props[j])){var S=y.props[g],C=y.props[j];return[Math.min(b[0],S,C),Math.max(b[1],S,C)]}return b},x)}return i&&i.length&&(x=i.reduce(function(b,y){return We(y)?[Math.min(b[0],y),Math.max(b[1],y)]:b},x)),x},Aj={exports:{}},cM;function Sde(){return cM||(cM=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function a(d,f,h){this.fn=d,this.context=f,this.once=h||!1}function i(d,f,h,p,x){if(typeof h!="function")throw new TypeError("The listener must be a function");var g=new a(h,p||d,x),j=n?n+f:f;return d._events[j]?d._events[j].fn?d._events[j]=[d._events[j],g]:d._events[j].push(g):(d._events[j]=g,d._eventsCount++),d}function o(d,f){--d._eventsCount===0?d._events=new r:delete d._events[f]}function c(){this._events=new r,this._eventsCount=0}c.prototype.eventNames=function(){var f=[],h,p;if(this._eventsCount===0)return f;for(p in h=this._events)t.call(h,p)&&f.push(n?p.slice(1):p);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(h)):f},c.prototype.listeners=function(f){var h=n?n+f:f,p=this._events[h];if(!p)return[];if(p.fn)return[p.fn];for(var x=0,g=p.length,j=new Array(g);x<g;x++)j[x]=p[x].fn;return j},c.prototype.listenerCount=function(f){var h=n?n+f:f,p=this._events[h];return p?p.fn?1:p.length:0},c.prototype.emit=function(f,h,p,x,g,j){var b=n?n+f:f;if(!this._events[b])return!1;var y=this._events[b],S=arguments.length,C,N;if(y.fn){switch(y.once&&this.removeListener(f,y.fn,void 0,!0),S){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,h),!0;case 3:return y.fn.call(y.context,h,p),!0;case 4:return y.fn.call(y.context,h,p,x),!0;case 5:return y.fn.call(y.context,h,p,x,g),!0;case 6:return y.fn.call(y.context,h,p,x,g,j),!0}for(N=1,C=new Array(S-1);N<S;N++)C[N-1]=arguments[N];y.fn.apply(y.context,C)}else{var E=y.length,_;for(N=0;N<E;N++)switch(y[N].once&&this.removeListener(f,y[N].fn,void 0,!0),S){case 1:y[N].fn.call(y[N].context);break;case 2:y[N].fn.call(y[N].context,h);break;case 3:y[N].fn.call(y[N].context,h,p);break;case 4:y[N].fn.call(y[N].context,h,p,x);break;default:if(!C)for(_=1,C=new Array(S-1);_<S;_++)C[_-1]=arguments[_];y[N].fn.apply(y[N].context,C)}}return!0},c.prototype.on=function(f,h,p){return i(this,f,h,p,!1)},c.prototype.once=function(f,h,p){return i(this,f,h,p,!0)},c.prototype.removeListener=function(f,h,p,x){var g=n?n+f:f;if(!this._events[g])return this;if(!h)return o(this,g),this;var j=this._events[g];if(j.fn)j.fn===h&&(!x||j.once)&&(!p||j.context===p)&&o(this,g);else{for(var b=0,y=[],S=j.length;b<S;b++)(j[b].fn!==h||x&&!j[b].once||p&&j[b].context!==p)&&y.push(j[b]);y.length?this._events[g]=y.length===1?y[0]:y:o(this,g)}return this},c.prototype.removeAllListeners=function(f){var h;return f?(h=n?n+f:f,this._events[h]&&o(this,h)):(this._events=new r,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c})(Aj)),Aj.exports}var Nde=Sde();const Cde=Yt(Nde);var _j=new Cde,Ej="recharts.syncMouseEvents";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 Ade(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _de(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,J4(r.key),r)}}function Ede(e,t,n){return t&&_de(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pj(e,t,n){return t=J4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function J4(e){var t=Pde(e,"string");return lf(t)=="symbol"?t:t+""}function Pde(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 String(e)}var kde=(function(){function e(){Ade(this,e),Pj(this,"activeIndex",0),Pj(this,"coordinateList",[]),Pj(this,"layout","horizontal")}return Ede(e,[{key:"setDetails",value:function(n){var r,a=n.coordinateList,i=a===void 0?null:a,o=n.container,c=o===void 0?null:o,d=n.layout,f=d===void 0?null:d,h=n.offset,p=h===void 0?null:h,x=n.mouseHandlerCallback,g=x===void 0?null:x;this.coordinateList=(r=i??this.coordinateList)!==null&&r!==void 0?r:[],this.container=c??this.container,this.layout=f??this.layout,this.offset=p??this.offset,this.mouseHandlerCallback=g??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var a=this.container.getBoundingClientRect(),i=a.x,o=a.y,c=a.height,d=this.coordinateList[this.activeIndex].coordinate,f=((n=window)===null||n===void 0?void 0:n.scrollX)||0,h=((r=window)===null||r===void 0?void 0:r.scrollY)||0,p=i+d+f,x=o+this.offset.top+c/2+h;this.mouseHandlerCallback({pageX:p,pageY:x})}}}])})();function Ode(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e?.[0],a=e?.[1];if(r&&a&&We(r)&&We(a))return!0}return!1}function Tde(e,t,n,r){var a=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-a:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-a,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function Z4(e){var t=e.cx,n=e.cy,r=e.radius,a=e.startAngle,i=e.endAngle,o=on(t,n,r,a),c=on(t,n,r,i);return{points:[o,c],cx:t,cy:n,radius:r,startAngle:a,endAngle:i}}function Rde(e,t,n){var r,a,i,o;if(e==="horizontal")r=t.x,i=r,a=n.top,o=n.top+n.height;else if(e==="vertical")a=t.y,o=a,r=n.left,i=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var c=t.cx,d=t.cy,f=t.innerRadius,h=t.outerRadius,p=t.angle,x=on(c,d,f,p),g=on(c,d,h,p);r=x.x,a=x.y,i=g.x,o=g.y}else return Z4(t);return[{x:r,y:a},{x:i,y:o}]}function cf(e){"@babel/helpers - typeof";return cf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cf(e)}function uM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ph(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uM(Object(n),!0).forEach(function(r){Ide(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ide(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=$de(e,"string");return cf(t)=="symbol"?t:t+""}function $de(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 Dde(e){var t,n,r=e.element,a=e.tooltipEventType,i=e.isActive,o=e.activeCoordinate,c=e.activePayload,d=e.offset,f=e.activeTooltipIndex,h=e.tooltipAxisBandSize,p=e.layout,x=e.chartName,g=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!g||!i||!o||x!=="ScatterChart"&&a!=="axis")return null;var j,b=fm;if(x==="ScatterChart")j=o,b=boe;else if(x==="BarChart")j=Tde(p,o,d,h),b=fC;else if(p==="radial"){var y=Z4(o),S=y.cx,C=y.cy,N=y.radius,E=y.startAngle,_=y.endAngle;j={cx:S,cy:C,startAngle:E,endAngle:_,innerRadius:N,outerRadius:N},b=ZL}else j={points:Rde(p,o,d)},b=fm;var P=ph(ph(ph(ph({stroke:"#ccc",pointerEvents:"none"},d),j),gt(g,!1)),{},{payload:c,payloadIndex:f,className:_t("recharts-tooltip-cursor",g.className)});return v.isValidElement(g)?v.cloneElement(g,P):v.createElement(b,P)}var Lde=["item"],Fde=["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 ec(){return ec=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},ec.apply(this,arguments)}function dM(e,t){return Ude(e)||zde(e,t)||tF(e,t)||Bde()}function Bde(){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 zde(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function Ude(e){if(Array.isArray(e))return e}function fM(e,t){if(e==null)return{};var n=qde(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function qde(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 Wde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vde(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,nF(r.key),r)}}function Hde(e,t,n){return t&&Vde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Kde(e,t,n){return t=$m(t),Gde(e,eF()?Reflect.construct(t,n||[],$m(e).constructor):t.apply(e,n))}function Gde(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 Yde(e)}function Yde(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 $m(e){return $m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},$m(e)}function Xde(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&&NS(e,t)}function NS(e,t){return NS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},NS(e,t)}function Uc(e){return Zde(e)||Jde(e)||tF(e)||Qde()}function Qde(){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 tF(e,t){if(e){if(typeof e=="string")return CS(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 CS(e,t)}}function Jde(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Zde(e){if(Array.isArray(e))return CS(e)}function CS(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 pM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function we(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pM(Object(n),!0).forEach(function(r){xt(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 xt(e,t,n){return t=nF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nF(e){var t=efe(e,"string");return zc(t)=="symbol"?t:t+""}function efe(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 tfe={xAxis:["bottom","top"],yAxis:["left","right"]},nfe={width:"100%",height:"100%"},rF={x:0,y:0};function hh(e){return e}var rfe=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},afe=function(t,n,r,a){var i=n.find(function(h){return h&&h.index===r});if(i){if(t==="horizontal")return{x:i.coordinate,y:a.y};if(t==="vertical")return{x:a.x,y:i.coordinate};if(t==="centric"){var o=i.coordinate,c=a.radius;return we(we(we({},a),on(a.cx,a.cy,c,o)),{},{angle:o,radius:c})}var d=i.coordinate,f=a.angle;return we(we(we({},a),on(a.cx,a.cy,d,f)),{},{angle:f,radius:d})}return rF},rg=function(t,n){var r=n.graphicalItems,a=n.dataStartIndex,i=n.dataEndIndex,o=(r??[]).reduce(function(c,d){var f=d.props.data;return f&&f.length?[].concat(Uc(c),Uc(f)):c},[]);return o.length>0?o:t&&t.length&&We(a)&&We(i)?t.slice(a,i+1):[]};function aF(e){return e==="number"?[0,"auto"]:void 0}var AS=function(t,n,r,a){var i=t.graphicalItems,o=t.tooltipAxis,c=rg(n,t);return r<0||!i||!i.length||r>=c.length?null:i.reduce(function(d,f){var h,p=(h=f.props.data)!==null&&h!==void 0?h:n;p&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(p=p.slice(t.dataStartIndex,t.dataEndIndex+1));var x;if(o.dataKey&&!o.allowDuplicatedCategory){var g=p===void 0?c:p;x=$h(g,o.dataKey,a)}else x=p&&p[r]||c[r];return x?[].concat(Uc(d),[KL(f,x)]):d},[])},hM=function(t,n,r,a){var i=a||{x:t.chartX,y:t.chartY},o=rfe(i,r),c=t.orderedTooltipTicks,d=t.tooltipAxis,f=t.tooltipTicks,h=zre(o,c,f,d);if(h>=0&&f){var p=f[h]&&f[h].value,x=AS(t,n,h,p),g=afe(r,c,h,i);return{activeTooltipIndex:h,activeLabel:p,activePayload:x,activeCoordinate:g}}return null},sfe=function(t,n){var r=n.axes,a=n.graphicalItems,i=n.axisType,o=n.axisIdKey,c=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,h=t.layout,p=t.children,x=t.stackOffset,g=UL(h,i);return r.reduce(function(j,b){var y,S=b.type.defaultProps!==void 0?we(we({},b.type.defaultProps),b.props):b.props,C=S.type,N=S.dataKey,E=S.allowDataOverflow,_=S.allowDuplicatedCategory,P=S.scale,O=S.ticks,T=S.includeHidden,I=S[o];if(j[I])return j;var M=rg(t.data,{graphicalItems:a.filter(function(L){var te,ie=o in L.props?L.props[o]:(te=L.type.defaultProps)===null||te===void 0?void 0:te[o];return ie===I}),dataStartIndex:d,dataEndIndex:f}),D=M.length,R,q,U;Ode(S.domain,E,C)&&(R=B1(S.domain,null,E),g&&(C==="number"||P!=="auto")&&(U=md(M,N,"category")));var H=aF(C);if(!R||R.length===0){var J,Z=(J=S.domain)!==null&&J!==void 0?J:H;if(N){if(R=md(M,N,C),C==="category"&&g){var F=IY(R);_&&F?(q=R,R=Sm(0,D)):_||(R=x2(Z,R,b).reduce(function(L,te){return L.indexOf(te)>=0?L:[].concat(Uc(L),[te])},[]))}else if(C==="category")_?R=R.filter(function(L){return L!==""&&!At(L)}):R=x2(Z,R,b).reduce(function(L,te){return L.indexOf(te)>=0||te===""||At(te)?L:[].concat(Uc(L),[te])},[]);else if(C==="number"){var z=Hre(M,a.filter(function(L){var te,ie,G=o in L.props?L.props[o]:(te=L.type.defaultProps)===null||te===void 0?void 0:te[o],de="hide"in L.props?L.props.hide:(ie=L.type.defaultProps)===null||ie===void 0?void 0:ie.hide;return G===I&&(T||!de)}),N,i,h);z&&(R=z)}g&&(C==="number"||P!=="auto")&&(U=md(M,N,"category"))}else g?R=Sm(0,D):c&&c[I]&&c[I].hasStack&&C==="number"?R=x==="expand"?[0,1]:HL(c[I].stackGroups,d,f):R=zL(M,a.filter(function(L){var te=o in L.props?L.props[o]:L.type.defaultProps[o],ie="hide"in L.props?L.props.hide:L.type.defaultProps.hide;return te===I&&(T||!ie)}),C,h,!0);if(C==="number")R=SS(p,R,I,i,O),Z&&(R=B1(Z,R,E));else if(C==="category"&&Z){var ee=Z,B=R.every(function(L){return ee.indexOf(L)>=0});B&&(R=ee)}}return we(we({},j),{},xt({},I,we(we({},S),{},{axisType:i,domain:R,categoricalDomain:U,duplicateDomain:q,originalDomain:(y=S.domain)!==null&&y!==void 0?y:H,isCategorical:g,layout:h})))},{})},ife=function(t,n){var r=n.graphicalItems,a=n.Axis,i=n.axisType,o=n.axisIdKey,c=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,h=t.layout,p=t.children,x=rg(t.data,{graphicalItems:r,dataStartIndex:d,dataEndIndex:f}),g=x.length,j=UL(h,i),b=-1;return r.reduce(function(y,S){var C=S.type.defaultProps!==void 0?we(we({},S.type.defaultProps),S.props):S.props,N=C[o],E=aF("number");if(!y[N]){b++;var _;return j?_=Sm(0,g):c&&c[N]&&c[N].hasStack?(_=HL(c[N].stackGroups,d,f),_=SS(p,_,N,i)):(_=B1(E,zL(x,r.filter(function(P){var O,T,I=o in P.props?P.props[o]:(O=P.type.defaultProps)===null||O===void 0?void 0:O[o],M="hide"in P.props?P.props.hide:(T=P.type.defaultProps)===null||T===void 0?void 0:T.hide;return I===N&&!M}),"number",h),a.defaultProps.allowDataOverflow),_=SS(p,_,N,i)),we(we({},y),{},xt({},N,we(we({axisType:i},a.defaultProps),{},{hide:!0,orientation:sa(tfe,"".concat(i,".").concat(b%2),null),domain:_,originalDomain:E,isCategorical:j,layout:h})))}return y},{})},ofe=function(t,n){var r=n.axisType,a=r===void 0?"xAxis":r,i=n.AxisComp,o=n.graphicalItems,c=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,h=t.children,p="".concat(a,"Id"),x=ia(h,i),g={};return x&&x.length?g=sfe(t,{axes:x,graphicalItems:o,axisType:a,axisIdKey:p,stackGroups:c,dataStartIndex:d,dataEndIndex:f}):o&&o.length&&(g=ife(t,{Axis:i,graphicalItems:o,axisType:a,axisIdKey:p,stackGroups:c,dataStartIndex:d,dataEndIndex:f})),g},lfe=function(t){var n=Hl(t),r=Po(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:FN(r,function(a){return a.coordinate}),tooltipAxis:n,tooltipAxisBandSize:cm(n,r)}},mM=function(t){var n=t.children,r=t.defaultShowTooltip,a=Jr(n,Tc),i=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(i=a.props.startIndex),a.props.endIndex>=0&&(o=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!r}},cfe=function(t){return!t||!t.length?!1:t.some(function(n){var r=Gs(n&&n.type);return r&&r.indexOf("Bar")>=0})},vM=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"}},ufe=function(t,n){var r=t.props,a=t.graphicalItems,i=t.xAxisMap,o=i===void 0?{}:i,c=t.yAxisMap,d=c===void 0?{}:c,f=r.width,h=r.height,p=r.children,x=r.margin||{},g=Jr(p,Tc),j=Jr(p,ko),b=Object.keys(d).reduce(function(_,P){var O=d[P],T=O.orientation;return!O.mirror&&!O.hide?we(we({},_),{},xt({},T,_[T]+O.width)):_},{left:x.left||0,right:x.right||0}),y=Object.keys(o).reduce(function(_,P){var O=o[P],T=O.orientation;return!O.mirror&&!O.hide?we(we({},_),{},xt({},T,sa(_,"".concat(T))+O.height)):_},{top:x.top||0,bottom:x.bottom||0}),S=we(we({},y),b),C=S.bottom;g&&(S.bottom+=g.props.height||Tc.defaultProps.height),j&&n&&(S=Wre(S,a,r,n));var N=f-S.left-S.right,E=h-S.top-S.bottom;return we(we({brushBottom:C},S),{},{width:Math.max(N,0),height:Math.max(E,0)})},dfe=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},gC=function(t){var n=t.chartName,r=t.GraphicalChild,a=t.defaultTooltipEventType,i=a===void 0?"axis":a,o=t.validateTooltipEventTypes,c=o===void 0?["axis"]:o,d=t.axisComponents,f=t.legendContent,h=t.formatAxisMap,p=t.defaultProps,x=function(S,C){var N=C.graphicalItems,E=C.stackGroups,_=C.offset,P=C.updateId,O=C.dataStartIndex,T=C.dataEndIndex,I=S.barSize,M=S.layout,D=S.barGap,R=S.barCategoryGap,q=S.maxBarSize,U=vM(M),H=U.numericAxisName,J=U.cateAxisName,Z=cfe(N),F=[];return N.forEach(function(z,ee){var B=rg(S.data,{graphicalItems:[z],dataStartIndex:O,dataEndIndex:T}),L=z.type.defaultProps!==void 0?we(we({},z.type.defaultProps),z.props):z.props,te=L.dataKey,ie=L.maxBarSize,G=L["".concat(H,"Id")],de=L["".concat(J,"Id")],oe={},ce=d.reduce(function(Oe,Ke){var bt=C["".concat(Ke.axisType,"Map")],It=L["".concat(Ke.axisType,"Id")];bt&&bt[It]||Ke.axisType==="zAxis"||Bo();var Q=bt[It];return we(we({},Oe),{},xt(xt({},Ke.axisType,Q),"".concat(Ke.axisType,"Ticks"),Po(Q)))},oe),le=ce[J],fe=ce["".concat(J,"Ticks")],Ce=E&&E[G]&&E[G].hasStack&&tae(z,E[G].stackGroups),ae=Gs(z.type).indexOf("Bar")>=0,ke=cm(le,fe),Ae=[],Ye=Z&&Ure({barSize:I,stackGroups:E,totalSize:dfe(ce,J)});if(ae){var be,Re,Y=At(ie)?q:ie,xe=(be=(Re=cm(le,fe,!0))!==null&&Re!==void 0?Re:Y)!==null&&be!==void 0?be:0;Ae=qre({barGap:D,barCategoryGap:R,bandSize:xe!==ke?xe:ke,sizeList:Ye[de],maxBarSize:Y}),xe!==ke&&(Ae=Ae.map(function(Oe){return we(we({},Oe),{},{position:we(we({},Oe.position),{},{offset:Oe.position.offset-xe/2})})}))}var ue=z&&z.type&&z.type.getComposedData;ue&&F.push({props:we(we({},ue(we(we({},ce),{},{displayedData:B,props:S,dataKey:te,item:z,bandSize:ke,barPosition:Ae,offset:_,stackedData:Ce,layout:M,dataStartIndex:O,dataEndIndex:T}))),{},xt(xt(xt({key:z.key||"item-".concat(ee)},H,ce[H]),J,ce[J]),"animationId",P)),childIndex:KY(z,S.children),item:z})}),F},g=function(S,C){var N=S.props,E=S.dataStartIndex,_=S.dataEndIndex,P=S.updateId;if(!Tk({props:N}))return null;var O=N.children,T=N.layout,I=N.stackOffset,M=N.data,D=N.reverseStackOrder,R=vM(T),q=R.numericAxisName,U=R.cateAxisName,H=ia(O,r),J=Zre(M,H,"".concat(q,"Id"),"".concat(U,"Id"),I,D),Z=d.reduce(function(L,te){var ie="".concat(te.axisType,"Map");return we(we({},L),{},xt({},ie,ofe(N,we(we({},te),{},{graphicalItems:H,stackGroups:te.axisType===q&&J,dataStartIndex:E,dataEndIndex:_}))))},{}),F=ufe(we(we({},Z),{},{props:N,graphicalItems:H}),C?.legendBBox);Object.keys(Z).forEach(function(L){Z[L]=h(N,Z[L],F,L.replace("Map",""),n)});var z=Z["".concat(U,"Map")],ee=lfe(z),B=x(N,we(we({},Z),{},{dataStartIndex:E,dataEndIndex:_,updateId:P,graphicalItems:H,stackGroups:J,offset:F}));return we(we({formattedGraphicalItems:B,graphicalItems:H,offset:F,stackGroups:J},ee),Z)},j=(function(y){function S(C){var N,E,_;return Wde(this,S),_=Kde(this,S,[C]),xt(_,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),xt(_,"accessibilityManager",new kde),xt(_,"handleLegendBBoxUpdate",function(P){if(P){var O=_.state,T=O.dataStartIndex,I=O.dataEndIndex,M=O.updateId;_.setState(we({legendBBox:P},g({props:_.props,dataStartIndex:T,dataEndIndex:I,updateId:M},we(we({},_.state),{},{legendBBox:P}))))}}),xt(_,"handleReceiveSyncEvent",function(P,O,T){if(_.props.syncId===P){if(T===_.eventEmitterSymbol&&typeof _.props.syncMethod!="function")return;_.applySyncEvent(O)}}),xt(_,"handleBrushChange",function(P){var O=P.startIndex,T=P.endIndex;if(O!==_.state.dataStartIndex||T!==_.state.dataEndIndex){var I=_.state.updateId;_.setState(function(){return we({dataStartIndex:O,dataEndIndex:T},g({props:_.props,dataStartIndex:O,dataEndIndex:T,updateId:I},_.state))}),_.triggerSyncEvent({dataStartIndex:O,dataEndIndex:T})}}),xt(_,"handleMouseEnter",function(P){var O=_.getMouseInfo(P);if(O){var T=we(we({},O),{},{isTooltipActive:!0});_.setState(T),_.triggerSyncEvent(T);var I=_.props.onMouseEnter;Ct(I)&&I(T,P)}}),xt(_,"triggeredAfterMouseMove",function(P){var O=_.getMouseInfo(P),T=O?we(we({},O),{},{isTooltipActive:!0}):{isTooltipActive:!1};_.setState(T),_.triggerSyncEvent(T);var I=_.props.onMouseMove;Ct(I)&&I(T,P)}),xt(_,"handleItemMouseEnter",function(P){_.setState(function(){return{isTooltipActive:!0,activeItem:P,activePayload:P.tooltipPayload,activeCoordinate:P.tooltipPosition||{x:P.cx,y:P.cy}}})}),xt(_,"handleItemMouseLeave",function(){_.setState(function(){return{isTooltipActive:!1}})}),xt(_,"handleMouseMove",function(P){P.persist(),_.throttleTriggeredAfterMouseMove(P)}),xt(_,"handleMouseLeave",function(P){_.throttleTriggeredAfterMouseMove.cancel();var O={isTooltipActive:!1};_.setState(O),_.triggerSyncEvent(O);var T=_.props.onMouseLeave;Ct(T)&&T(O,P)}),xt(_,"handleOuterEvent",function(P){var O=HY(P),T=sa(_.props,"".concat(O));if(O&&Ct(T)){var I,M;/.*touch.*/i.test(O)?M=_.getMouseInfo(P.changedTouches[0]):M=_.getMouseInfo(P),T((I=M)!==null&&I!==void 0?I:{},P)}}),xt(_,"handleClick",function(P){var O=_.getMouseInfo(P);if(O){var T=we(we({},O),{},{isTooltipActive:!0});_.setState(T),_.triggerSyncEvent(T);var I=_.props.onClick;Ct(I)&&I(T,P)}}),xt(_,"handleMouseDown",function(P){var O=_.props.onMouseDown;if(Ct(O)){var T=_.getMouseInfo(P);O(T,P)}}),xt(_,"handleMouseUp",function(P){var O=_.props.onMouseUp;if(Ct(O)){var T=_.getMouseInfo(P);O(T,P)}}),xt(_,"handleTouchMove",function(P){P.changedTouches!=null&&P.changedTouches.length>0&&_.throttleTriggeredAfterMouseMove(P.changedTouches[0])}),xt(_,"handleTouchStart",function(P){P.changedTouches!=null&&P.changedTouches.length>0&&_.handleMouseDown(P.changedTouches[0])}),xt(_,"handleTouchEnd",function(P){P.changedTouches!=null&&P.changedTouches.length>0&&_.handleMouseUp(P.changedTouches[0])}),xt(_,"handleDoubleClick",function(P){var O=_.props.onDoubleClick;if(Ct(O)){var T=_.getMouseInfo(P);O(T,P)}}),xt(_,"handleContextMenu",function(P){var O=_.props.onContextMenu;if(Ct(O)){var T=_.getMouseInfo(P);O(T,P)}}),xt(_,"triggerSyncEvent",function(P){_.props.syncId!==void 0&&_j.emit(Ej,_.props.syncId,P,_.eventEmitterSymbol)}),xt(_,"applySyncEvent",function(P){var O=_.props,T=O.layout,I=O.syncMethod,M=_.state.updateId,D=P.dataStartIndex,R=P.dataEndIndex;if(P.dataStartIndex!==void 0||P.dataEndIndex!==void 0)_.setState(we({dataStartIndex:D,dataEndIndex:R},g({props:_.props,dataStartIndex:D,dataEndIndex:R,updateId:M},_.state)));else if(P.activeTooltipIndex!==void 0){var q=P.chartX,U=P.chartY,H=P.activeTooltipIndex,J=_.state,Z=J.offset,F=J.tooltipTicks;if(!Z)return;if(typeof I=="function")H=I(F,P);else if(I==="value"){H=-1;for(var z=0;z<F.length;z++)if(F[z].value===P.activeLabel){H=z;break}}var ee=we(we({},Z),{},{x:Z.left,y:Z.top}),B=Math.min(q,ee.x+ee.width),L=Math.min(U,ee.y+ee.height),te=F[H]&&F[H].value,ie=AS(_.state,_.props.data,H),G=F[H]?{x:T==="horizontal"?F[H].coordinate:B,y:T==="horizontal"?L:F[H].coordinate}:rF;_.setState(we(we({},P),{},{activeLabel:te,activeCoordinate:G,activePayload:ie,activeTooltipIndex:H}))}else _.setState(P)}),xt(_,"renderCursor",function(P){var O,T=_.state,I=T.isTooltipActive,M=T.activeCoordinate,D=T.activePayload,R=T.offset,q=T.activeTooltipIndex,U=T.tooltipAxisBandSize,H=_.getTooltipEventType(),J=(O=P.props.active)!==null&&O!==void 0?O:I,Z=_.props.layout,F=P.key||"_recharts-cursor";return W.createElement(Dde,{key:F,activeCoordinate:M,activePayload:D,activeTooltipIndex:q,chartName:n,element:P,isActive:J,layout:Z,offset:R,tooltipAxisBandSize:U,tooltipEventType:H})}),xt(_,"renderPolarAxis",function(P,O,T){var I=sa(P,"type.axisType"),M=sa(_.state,"".concat(I,"Map")),D=P.type.defaultProps,R=D!==void 0?we(we({},D),P.props):P.props,q=M&&M[R["".concat(I,"Id")]];return v.cloneElement(P,we(we({},q),{},{className:_t(I,q.className),key:P.key||"".concat(O,"-").concat(T),ticks:Po(q,!0)}))}),xt(_,"renderPolarGrid",function(P){var O=P.props,T=O.radialLines,I=O.polarAngles,M=O.polarRadius,D=_.state,R=D.radiusAxisMap,q=D.angleAxisMap,U=Hl(R),H=Hl(q),J=H.cx,Z=H.cy,F=H.innerRadius,z=H.outerRadius;return v.cloneElement(P,{polarAngles:Array.isArray(I)?I:Po(H,!0).map(function(ee){return ee.coordinate}),polarRadius:Array.isArray(M)?M:Po(U,!0).map(function(ee){return ee.coordinate}),cx:J,cy:Z,innerRadius:F,outerRadius:z,key:P.key||"polar-grid",radialLines:T})}),xt(_,"renderLegend",function(){var P=_.state.formattedGraphicalItems,O=_.props,T=O.children,I=O.width,M=O.height,D=_.props.margin||{},R=I-(D.left||0)-(D.right||0),q=FL({children:T,formattedGraphicalItems:P,legendWidth:R,legendContent:f});if(!q)return null;var U=q.item,H=fM(q,Lde);return v.cloneElement(U,we(we({},H),{},{chartWidth:I,chartHeight:M,margin:D,onBBoxUpdate:_.handleLegendBBoxUpdate}))}),xt(_,"renderTooltip",function(){var P,O=_.props,T=O.children,I=O.accessibilityLayer,M=Jr(T,Mr);if(!M)return null;var D=_.state,R=D.isTooltipActive,q=D.activeCoordinate,U=D.activePayload,H=D.activeLabel,J=D.offset,Z=(P=M.props.active)!==null&&P!==void 0?P:R;return v.cloneElement(M,{viewBox:we(we({},J),{},{x:J.left,y:J.top}),active:Z,label:H,payload:Z?U:[],coordinate:q,accessibilityLayer:I})}),xt(_,"renderBrush",function(P){var O=_.props,T=O.margin,I=O.data,M=_.state,D=M.offset,R=M.dataStartIndex,q=M.dataEndIndex,U=M.updateId;return v.cloneElement(P,{key:P.key||"_recharts-brush",onChange:ch(_.handleBrushChange,P.props.onChange),data:I,x:We(P.props.x)?P.props.x:D.left,y:We(P.props.y)?P.props.y:D.top+D.height+D.brushBottom-(T.bottom||0),width:We(P.props.width)?P.props.width:D.width,startIndex:R,endIndex:q,updateId:"brush-".concat(U)})}),xt(_,"renderReferenceElement",function(P,O,T){if(!P)return null;var I=_,M=I.clipPathId,D=_.state,R=D.xAxisMap,q=D.yAxisMap,U=D.offset,H=P.type.defaultProps||{},J=P.props,Z=J.xAxisId,F=Z===void 0?H.xAxisId:Z,z=J.yAxisId,ee=z===void 0?H.yAxisId:z;return v.cloneElement(P,{key:P.key||"".concat(O,"-").concat(T),xAxis:R[F],yAxis:q[ee],viewBox:{x:U.left,y:U.top,width:U.width,height:U.height},clipPathId:M})}),xt(_,"renderActivePoints",function(P){var O=P.item,T=P.activePoint,I=P.basePoint,M=P.childIndex,D=P.isRange,R=[],q=O.props.key,U=O.item.type.defaultProps!==void 0?we(we({},O.item.type.defaultProps),O.item.props):O.item.props,H=U.activeDot,J=U.dataKey,Z=we(we({index:M,dataKey:J,cx:T.x,cy:T.y,r:4,fill:dC(O.item),strokeWidth:2,stroke:"#fff",payload:T.payload,value:T.value},gt(H,!1)),Dh(H));return R.push(S.renderActiveDot(H,Z,"".concat(q,"-activePoint-").concat(M))),I?R.push(S.renderActiveDot(H,we(we({},Z),{},{cx:I.x,cy:I.y}),"".concat(q,"-basePoint-").concat(M))):D&&R.push(null),R}),xt(_,"renderGraphicChild",function(P,O,T){var I=_.filterFormatItem(P,O,T);if(!I)return null;var M=_.getTooltipEventType(),D=_.state,R=D.isTooltipActive,q=D.tooltipAxis,U=D.activeTooltipIndex,H=D.activeLabel,J=_.props.children,Z=Jr(J,Mr),F=I.props,z=F.points,ee=F.isRange,B=F.baseLine,L=I.item.type.defaultProps!==void 0?we(we({},I.item.type.defaultProps),I.item.props):I.item.props,te=L.activeDot,ie=L.hide,G=L.activeBar,de=L.activeShape,oe=!!(!ie&&R&&Z&&(te||G||de)),ce={};M!=="axis"&&Z&&Z.props.trigger==="click"?ce={onClick:ch(_.handleItemMouseEnter,P.props.onClick)}:M!=="axis"&&(ce={onMouseLeave:ch(_.handleItemMouseLeave,P.props.onMouseLeave),onMouseEnter:ch(_.handleItemMouseEnter,P.props.onMouseEnter)});var le=v.cloneElement(P,we(we({},I.props),ce));function fe(Ke){return typeof q.dataKey=="function"?q.dataKey(Ke.payload):null}if(oe)if(U>=0){var Ce,ae;if(q.dataKey&&!q.allowDuplicatedCategory){var ke=typeof q.dataKey=="function"?fe:"payload.".concat(q.dataKey.toString());Ce=$h(z,ke,H),ae=ee&&B&&$h(B,ke,H)}else Ce=z?.[U],ae=ee&&B&&B[U];if(de||G){var Ae=P.props.activeIndex!==void 0?P.props.activeIndex:U;return[v.cloneElement(P,we(we(we({},I.props),ce),{},{activeIndex:Ae})),null,null]}if(!At(Ce))return[le].concat(Uc(_.renderActivePoints({item:I,activePoint:Ce,basePoint:ae,childIndex:U,isRange:ee})))}else{var Ye,be=(Ye=_.getItemByXY(_.state.activeCoordinate))!==null&&Ye!==void 0?Ye:{graphicalItem:le},Re=be.graphicalItem,Y=Re.item,xe=Y===void 0?P:Y,ue=Re.childIndex,Oe=we(we(we({},I.props),ce),{},{activeIndex:ue});return[v.cloneElement(xe,Oe),null,null]}return ee?[le,null,null]:[le,null]}),xt(_,"renderCustomized",function(P,O,T){return v.cloneElement(P,we(we({key:"recharts-customized-".concat(T)},_.props),_.state))}),xt(_,"renderMap",{CartesianGrid:{handler:hh,once:!0},ReferenceArea:{handler:_.renderReferenceElement},ReferenceLine:{handler:hh},ReferenceDot:{handler:_.renderReferenceElement},XAxis:{handler:hh},YAxis:{handler:hh},Brush:{handler:_.renderBrush,once:!0},Bar:{handler:_.renderGraphicChild},Line:{handler:_.renderGraphicChild},Area:{handler:_.renderGraphicChild},Radar:{handler:_.renderGraphicChild},RadialBar:{handler:_.renderGraphicChild},Scatter:{handler:_.renderGraphicChild},Pie:{handler:_.renderGraphicChild},Funnel:{handler:_.renderGraphicChild},Tooltip:{handler:_.renderCursor,once:!0},PolarGrid:{handler:_.renderPolarGrid,once:!0},PolarAngleAxis:{handler:_.renderPolarAxis},PolarRadiusAxis:{handler:_.renderPolarAxis},Customized:{handler:_.renderCustomized}}),_.clipPathId="".concat((N=C.id)!==null&&N!==void 0?N:au("recharts"),"-clip"),_.throttleTriggeredAfterMouseMove=F5(_.triggeredAfterMouseMove,(E=C.throttleDelay)!==null&&E!==void 0?E:1e3/60),_.state={},_}return Xde(S,y),Hde(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,_=N.data,P=N.height,O=N.layout,T=Jr(E,Mr);if(T){var I=T.props.defaultIndex;if(!(typeof I!="number"||I<0||I>this.state.tooltipTicks.length-1)){var M=this.state.tooltipTicks[I]&&this.state.tooltipTicks[I].value,D=AS(this.state,_,I,M),R=this.state.tooltipTicks[I].coordinate,q=(this.state.offset.top+P)/2,U=O==="horizontal",H=U?{x:R,y:q}:{y:R,x:q},J=this.state.formattedGraphicalItems.find(function(F){var z=F.item;return z.type.name==="Scatter"});J&&(H=we(we({},H),J.props.points[I].tooltipPosition),D=J.props.points[I].tooltipPayload);var Z={activeTooltipIndex:I,isTooltipActive:!0,activeLabel:M,activePayload:D,activeCoordinate:H};this.setState(Z),this.renderCursor(T),this.accessibilityManager.setIndex(I)}}}},{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 _,P;this.accessibilityManager.setDetails({offset:{left:(_=this.props.margin.left)!==null&&_!==void 0?_:0,top:(P=this.props.margin.top)!==null&&P!==void 0?P:0}})}return null}},{key:"componentDidUpdate",value:function(N){l1([Jr(N.children,Mr)],[Jr(this.props.children,Mr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var N=Jr(this.props.children,Mr);if(N&&typeof N.props.shared=="boolean"){var E=N.props.shared?"axis":"item";return c.indexOf(E)>=0?E:i}return i}},{key:"getMouseInfo",value:function(N){if(!this.container)return null;var E=this.container,_=E.getBoundingClientRect(),P=RZ(_),O={chartX:Math.round(N.pageX-P.left),chartY:Math.round(N.pageY-P.top)},T=_.width/E.offsetWidth||1,I=this.inRange(O.chartX,O.chartY,T);if(!I)return null;var M=this.state,D=M.xAxisMap,R=M.yAxisMap,q=this.getTooltipEventType(),U=hM(this.state,this.props.data,this.props.layout,I);if(q!=="axis"&&D&&R){var H=Hl(D).scale,J=Hl(R).scale,Z=H&&H.invert?H.invert(O.chartX):null,F=J&&J.invert?J.invert(O.chartY):null;return we(we({},O),{},{xValue:Z,yValue:F},U)}return U?we(we({},O),U):null}},{key:"inRange",value:function(N,E){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,P=this.props.layout,O=N/_,T=E/_;if(P==="horizontal"||P==="vertical"){var I=this.state.offset,M=O>=I.left&&O<=I.left+I.width&&T>=I.top&&T<=I.top+I.height;return M?{x:O,y:T}:null}var D=this.state,R=D.angleAxisMap,q=D.radiusAxisMap;if(R&&q){var U=Hl(R);return w2({x:O,y:T},U)}return null}},{key:"parseEventsOfWrapper",value:function(){var N=this.props.children,E=this.getTooltipEventType(),_=Jr(N,Mr),P={};_&&E==="axis"&&(_.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 O=Dh(this.props,this.handleOuterEvent);return we(we({},O),P)}},{key:"addListener",value:function(){_j.on(Ej,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){_j.removeListener(Ej,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(N,E,_){for(var P=this.state.formattedGraphicalItems,O=0,T=P.length;O<T;O++){var I=P[O];if(I.item===N||I.props.key===N.key||E===Gs(I.item.type)&&_===I.childIndex)return I}return null}},{key:"renderClipPath",value:function(){var N=this.clipPathId,E=this.state.offset,_=E.left,P=E.top,O=E.height,T=E.width;return W.createElement("defs",null,W.createElement("clipPath",{id:N},W.createElement("rect",{x:_,y:P,height:O,width:T})))}},{key:"getXScales",value:function(){var N=this.state.xAxisMap;return N?Object.entries(N).reduce(function(E,_){var P=dM(_,2),O=P[0],T=P[1];return we(we({},E),{},xt({},O,T.scale))},{}):null}},{key:"getYScales",value:function(){var N=this.state.yAxisMap;return N?Object.entries(N).reduce(function(E,_){var P=dM(_,2),O=P[0],T=P[1];return we(we({},E),{},xt({},O,T.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(N){var E;return(E=this.state.xAxisMap)===null||E===void 0||(E=E[N])===null||E===void 0?void 0:E.scale}},{key:"getYScaleByAxisId",value:function(N){var E;return(E=this.state.yAxisMap)===null||E===void 0||(E=E[N])===null||E===void 0?void 0:E.scale}},{key:"getItemByXY",value:function(N){var E=this.state,_=E.formattedGraphicalItems,P=E.activeItem;if(_&&_.length)for(var O=0,T=_.length;O<T;O++){var I=_[O],M=I.props,D=I.item,R=D.type.defaultProps!==void 0?we(we({},D.type.defaultProps),D.props):D.props,q=Gs(D.type);if(q==="Bar"){var U=(M.data||[]).find(function(F){return eoe(N,F)});if(U)return{graphicalItem:I,payload:U}}else if(q==="RadialBar"){var H=(M.data||[]).find(function(F){return w2(N,F)});if(H)return{graphicalItem:I,payload:H}}else if(Yv(I,P)||Xv(I,P)||nf(I,P)){var J=Sle({graphicalItem:I,activeTooltipItem:P,itemData:R.data}),Z=R.activeIndex===void 0?J:R.activeIndex;return{graphicalItem:we(we({},I),{},{childIndex:Z}),payload:nf(I,P)?R.data[J]:I.props.data[J]}}}return null}},{key:"render",value:function(){var N=this;if(!Tk(this))return null;var E=this.props,_=E.children,P=E.className,O=E.width,T=E.height,I=E.style,M=E.compact,D=E.title,R=E.desc,q=fM(E,Fde),U=gt(q,!1);if(M)return W.createElement(GI,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},W.createElement(u1,ec({},U,{width:O,height:T,title:D,desc:R}),this.renderClipPath(),Ik(_,this.renderMap)));if(this.props.accessibilityLayer){var H,J;U.tabIndex=(H=this.props.tabIndex)!==null&&H!==void 0?H:0,U.role=(J=this.props.role)!==null&&J!==void 0?J:"application",U.onKeyDown=function(F){N.accessibilityManager.keyboardEvent(F)},U.onFocus=function(){N.accessibilityManager.focus()}}var Z=this.parseEventsOfWrapper();return W.createElement(GI,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},W.createElement("div",ec({className:_t("recharts-wrapper",P),style:we({position:"relative",cursor:"default",width:O,height:T},I)},Z,{ref:function(z){N.container=z}}),W.createElement(u1,ec({},U,{width:O,height:T,title:D,desc:R,style:nfe}),this.renderClipPath(),Ik(_,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(v.Component);xt(j,"displayName",n),xt(j,"defaultProps",we({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},p)),xt(j,"getDerivedStateFromProps",function(y,S){var C=y.dataKey,N=y.data,E=y.children,_=y.width,P=y.height,O=y.layout,T=y.stackOffset,I=y.margin,M=S.dataStartIndex,D=S.dataEndIndex;if(S.updateId===void 0){var R=mM(y);return we(we(we({},R),{},{updateId:0},g(we(we({props:y},R),{},{updateId:0}),S)),{},{prevDataKey:C,prevData:N,prevWidth:_,prevHeight:P,prevLayout:O,prevStackOffset:T,prevMargin:I,prevChildren:E})}if(C!==S.prevDataKey||N!==S.prevData||_!==S.prevWidth||P!==S.prevHeight||O!==S.prevLayout||T!==S.prevStackOffset||!oc(I,S.prevMargin)){var q=mM(y),U={chartX:S.chartX,chartY:S.chartY,isTooltipActive:S.isTooltipActive},H=we(we({},hM(S,N,O)),{},{updateId:S.updateId+1}),J=we(we(we({},q),U),H);return we(we(we({},J),g(we({props:y},J),S)),{},{prevDataKey:C,prevData:N,prevWidth:_,prevHeight:P,prevLayout:O,prevStackOffset:T,prevMargin:I,prevChildren:E})}if(!l1(E,S.prevChildren)){var Z,F,z,ee,B=Jr(E,Tc),L=B&&(Z=(F=B.props)===null||F===void 0?void 0:F.startIndex)!==null&&Z!==void 0?Z:M,te=B&&(z=(ee=B.props)===null||ee===void 0?void 0:ee.endIndex)!==null&&z!==void 0?z:D,ie=L!==M||te!==D,G=!At(N),de=G&&!ie?S.updateId:S.updateId+1;return we(we({updateId:de},g(we(we({props:y},S),{},{updateId:de,dataStartIndex:L,dataEndIndex:te}),S)),{},{prevChildren:E,dataStartIndex:L,dataEndIndex:te})}return null}),xt(j,"renderActiveDot",function(y,S,C){var N;return v.isValidElement(y)?N=v.cloneElement(y,S):Ct(y)?N=y(S):N=W.createElement(Wv,S),W.createElement(qt,{className:"recharts-active-dot",key:C},N)});var b=v.forwardRef(function(S,C){return W.createElement(j,ec({},S,{ref:C}))});return b.displayName=j.displayName,b},_S=gC({chartName:"LineChart",GraphicalChild:zo,axisComponents:[{axisType:"xAxis",AxisComp:Vi},{axisType:"yAxis",AxisComp:Hi}],formatAxisMap:j4}),ffe=gC({chartName:"BarChart",GraphicalChild:sl,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Vi},{axisType:"yAxis",AxisComp:Hi}],formatAxisMap:j4}),pfe=gC({chartName:"PieChart",GraphicalChild:oi,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:Gv},{axisType:"radiusAxis",AxisComp:Hv}],formatAxisMap:dae,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const hfe=()=>{const{configs:e}=Nf(),{source:t}=Rn(),[n,r]=v.useState([]),[a,i]=v.useState("timestamp"),[o,c]=v.useState("desc"),d=y=>{if(a===y){c(S=>S==="asc"?"desc":"asc");return}i(y),c("desc")};v.useEffect(()=>{let y=!0;return t.listResults().then(S=>{y&&r(S)}),()=>{y=!1}},[t]);const f=e.length,h=n.length,p=h===0?0:n.reduce((y,S)=>y+S.overallPassRate,0)/h,x=h===0?0:Math.round(n.reduce((y,S)=>y+S.avgLatency,0)/h),g=v.useMemo(()=>[...n].sort((S,C)=>{let N=0;return a==="timestamp"&&(N=new Date(S.timestamp).getTime()-new Date(C.timestamp).getTime()),a==="passRate"&&(N=S.overallPassRate-C.overallPassRate),a==="latency"&&(N=S.avgLatency-C.avgLatency),a==="scenarios"&&(N=S.totalScenarios-C.totalScenarios),o==="asc"?N:-N}),[n,a,o]),j=[...g].reverse().map(y=>({date:new Date(y.timestamp).toLocaleDateString("en-US",{month:"short",day:"numeric"}),passRate:Math.round(y.overallPassRate*100),latency:y.avgLatency})),b=y=>{const S=Array.from(new Set(y.scenarios.map(_=>_.scenarioId).filter(Boolean))),C=Array.from(new Set(y.scenarios.map(_=>_.agentName).filter(Boolean))),N=S.slice(0,2).join(", "),E=S.length>2?` +${S.length-2}`:"";return{scenarioCount:S.length,agentCount:C.length,scenarioPreview:N?`${N}${E}`:"n/a"}};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(C$,{className:"h-6 w-6"}),"Dashboard"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Overview of your MCP evaluation runs"})]}),s.jsxs("div",{className:"flex gap-3",children:[s.jsx(re,{asChild:!0,children:s.jsxs(jt,{to:"/mcp-evaluations/new",children:[s.jsx(XS,{className:"mr-2 h-4 w-4"}),"New MCP Evaluation"]})}),s.jsx(re,{variant:"outline",asChild:!0,children:s.jsxs(jt,{to:"/run",children:[s.jsx(rc,{className:"mr-2 h-4 w-4"}),"Run Evaluation"]})}),s.jsx(re,{variant:"outline",asChild:!0,children:s.jsxs(jt,{to:"/results",children:[s.jsx(wd,{className:"mr-2 h-4 w-4"}),"Browse Results"]})})]})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsx(os,{title:"MCP Evaluations",value:f,icon:Uj,subtitle:`${f} active`}),s.jsx(os,{title:"Total Runs",value:h,icon:b$,subtitle:"Last 30 days"}),s.jsx(os,{title:"Pass Rate",value:`${Math.round(p*100)}%`,icon:wd,subtitle:"+5% from last week",trend:"up"}),s.jsx(os,{title:"Avg Latency",value:`${x}ms`,icon:k$,subtitle:"-120ms from last week",trend:"up"})]}),s.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Pass Rate Trend"})}),s.jsx(qe,{children:s.jsx(Kh,{width:"100%",height:200,children:s.jsxs(_S,{data:j,children:[s.jsx(Vi,{dataKey:"date",tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(Hi,{domain:[0,100],tick:{fontSize:11},tickLine:!1,axisLine:!1,tickFormatter:y=>`${y}%`}),s.jsx(Mr,{formatter:y=>[`${y}%`,"Pass Rate"]}),s.jsx(zo,{type:"monotone",dataKey:"passRate",stroke:"hsl(38, 92%, 50%)",strokeWidth:2,dot:{r:3,fill:"hsl(38, 92%, 50%)"}})]})})})]}),s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Recent Tool Latency (ms)"})}),s.jsx(qe,{children:s.jsx(Kh,{width:"100%",height:200,children:s.jsxs(_S,{data:j,children:[s.jsx(Vi,{dataKey:"date",tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(Hi,{tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(Mr,{formatter:y=>[`${y}ms`,"Latency"]}),s.jsx(zo,{type:"monotone",dataKey:"latency",stroke:"hsl(200, 80%, 50%)",strokeWidth:2,dot:{r:3,fill:"hsl(200, 80%, 50%)"}})]})})})]})]}),s.jsx("div",{className:"grid gap-6",children:s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Recent Runs"})}),s.jsx(qe,{className:"p-0",children:s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs($t,{children:[s.jsx(tt,{children:"Run ID"}),s.jsx(tt,{children:"Evaluated"}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>d("timestamp"),children:["Timestamp",a==="timestamp"?o==="asc"?s.jsx(fs,{className:"h-3.5 w-3.5"}):s.jsx(Dt,{className:"h-3.5 w-3.5"}):s.jsx(tc,{className:"h-3.5 w-3.5 text-muted-foreground"})]})}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>d("passRate"),children:["Pass Rate",a==="passRate"?o==="asc"?s.jsx(fs,{className:"h-3.5 w-3.5"}):s.jsx(Dt,{className:"h-3.5 w-3.5"}):s.jsx(tc,{className:"h-3.5 w-3.5 text-muted-foreground"})]})}),s.jsx(tt,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>d("scenarios"),children:["Scenarios",a==="scenarios"?o==="asc"?s.jsx(fs,{className:"h-3.5 w-3.5"}):s.jsx(Dt,{className:"h-3.5 w-3.5"}):s.jsx(tc,{className:"h-3.5 w-3.5 text-muted-foreground"})]})})]})}),s.jsx(Lr,{children:g.map(y=>s.jsxs($t,{className:"cursor-pointer",children:[s.jsx(ze,{children:s.jsx(jt,{to:`/results/${y.id}`,className:"font-mono text-xs text-primary hover:underline",children:y.id})}),s.jsx(ze,{className:"text-[11px] text-muted-foreground",children:(()=>{const S=b(y);return s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:["Evaluated: ",S.scenarioCount," scenario",S.scenarioCount===1?"":"s"," · ",S.agentCount," agent",S.agentCount===1?"":"s"]}),s.jsx("div",{className:"font-mono text-xs text-foreground/80",children:S.scenarioPreview})]})})()}),s.jsx(ze,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(vf,{className:"h-3 w-3"}),new Date(y.timestamp).toLocaleString()]})}),s.jsx(ze,{children:s.jsx(Vs,{rate:y.overallPassRate})}),s.jsx(ze,{className:"text-right font-mono text-sm",children:y.totalScenarios})]},y.id))})]})})]})})]})};function xC({value:e,onValueChange:t,placeholder:n="Search...",className:r,inputClassName:a,clearAriaLabel:i="Clear search"}){return s.jsxs("div",{className:Se("relative",r),children:[s.jsx(ft,{value:e,onChange:o=>t(o.target.value),placeholder:n,className:Se("h-9 w-[240px] pr-8",a)}),e&&s.jsx(re,{type:"button",variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 h-7 w-7 -translate-y-1/2 border border-border/60",onClick:()=>t(""),"aria-label":i,children:s.jsx(ys,{className:"h-4 w-4"})})]})}var mfe=v.createContext(void 0);function cu(e){const t=v.useContext(mfe);return e||t||"ltr"}var kj="rovingFocusGroup.onEntryFocus",vfe={bubbles:!1,cancelable:!0},If="RovingFocusGroup",[ES,sF,gfe]=hf(If),[xfe,ag]=lr(If,[gfe]),[yfe,bfe]=xfe(If),iF=v.forwardRef((e,t)=>s.jsx(ES.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(ES.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(wfe,{...e,ref:t})})}));iF.displayName=If;var wfe=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:h=!1,...p}=e,x=v.useRef(null),g=vt(t,x),j=cu(i),[b,y]=oa({prop:o,defaultProp:c??null,onChange:d,caller:If}),[S,C]=v.useState(!1),N=Tn(f),E=sF(n),_=v.useRef(!1),[P,O]=v.useState(0);return v.useEffect(()=>{const T=x.current;if(T)return T.addEventListener(kj,N),()=>T.removeEventListener(kj,N)},[N]),s.jsx(yfe,{scope:n,orientation:r,dir:j,loop:a,currentTabStopId:b,onItemFocus:v.useCallback(T=>y(T),[y]),onItemShiftTab:v.useCallback(()=>C(!0),[]),onFocusableItemAdd:v.useCallback(()=>O(T=>T+1),[]),onFocusableItemRemove:v.useCallback(()=>O(T=>T-1),[]),children:s.jsx(Ge.div,{tabIndex:S||P===0?-1:0,"data-orientation":r,...p,ref:g,style:{outline:"none",...e.style},onMouseDown:Te(e.onMouseDown,()=>{_.current=!0}),onFocus:Te(e.onFocus,T=>{const I=!_.current;if(T.target===T.currentTarget&&I&&!S){const M=new CustomEvent(kj,vfe);if(T.currentTarget.dispatchEvent(M),!M.defaultPrevented){const D=E().filter(J=>J.focusable),R=D.find(J=>J.active),q=D.find(J=>J.id===b),H=[R,q,...D].filter(Boolean).map(J=>J.ref.current);cF(H,h)}}_.current=!1}),onBlur:Te(e.onBlur,()=>C(!1))})})}),oF="RovingFocusGroupItem",lF=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:i,children:o,...c}=e,d=Vn(),f=i||d,h=bfe(oF,n),p=h.currentTabStopId===f,x=sF(n),{onFocusableItemAdd:g,onFocusableItemRemove:j,currentTabStopId:b}=h;return v.useEffect(()=>{if(r)return g(),()=>j()},[r,g,j]),s.jsx(ES.ItemSlot,{scope:n,id:f,focusable:r,active:a,children:s.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=Nfe(y,h.orientation,h.dir);if(S!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let N=x().filter(E=>E.focusable).map(E=>E.ref.current);if(S==="last")N.reverse();else if(S==="prev"||S==="next"){S==="prev"&&N.reverse();const E=N.indexOf(y.currentTarget);N=h.loop?Cfe(N,E+1):N.slice(E+1)}setTimeout(()=>cF(N))}}),children:typeof o=="function"?o({isCurrentTabStop:p,hasTabStop:b!=null}):o})})});lF.displayName=oF;var jfe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Sfe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Nfe(e,t,n){const r=Sfe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return jfe[r]}function cF(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Cfe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var uF=iF,dF=lF;function Afe(e){const t=_fe(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(Pfe);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function _fe(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=Ofe(a),c=kfe(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Cr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Efe=Symbol("radix.slottable");function Pfe(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Efe}function kfe(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function Ofe(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 PS=["Enter"," "],Tfe=["ArrowDown","PageUp","Home"],fF=["ArrowUp","PageDown","End"],Rfe=[...Tfe,...fF],Ife={ltr:[...PS,"ArrowRight"],rtl:[...PS,"ArrowLeft"]},Mfe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Mf="Menu",[uf,$fe,Dfe]=hf(Mf),[il,pF]=lr(Mf,[Dfe,Gi,ag]),sg=Gi(),hF=ag(),[Lfe,ol]=il(Mf),[Ffe,$f]=il(Mf),mF=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:i,modal:o=!0}=e,c=sg(t),[d,f]=v.useState(null),h=v.useRef(!1),p=Tn(i),x=cu(a);return v.useEffect(()=>{const g=()=>{h.current=!0,document.addEventListener("pointerdown",j,{capture:!0,once:!0}),document.addEventListener("pointermove",j,{capture:!0,once:!0})},j=()=>h.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",j,{capture:!0}),document.removeEventListener("pointermove",j,{capture:!0})}},[]),s.jsx(tv,{...c,children:s.jsx(Lfe,{scope:t,open:n,onOpenChange:p,content:d,onContentChange:f,children:s.jsx(Ffe,{scope:t,onClose:v.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:h,dir:x,modal:o,children:r})})})};mF.displayName=Mf;var Bfe="MenuAnchor",yC=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=sg(n);return s.jsx(xf,{...a,...r,ref:t})});yC.displayName=Bfe;var bC="MenuPortal",[zfe,vF]=il(bC,{forceMount:void 0}),gF=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:a}=e,i=ol(bC,t);return s.jsx(zfe,{scope:t,forceMount:n,children:s.jsx(Kn,{present:n||i.open,children:s.jsx(Gc,{asChild:!0,container:a,children:r})})})};gF.displayName=bC;var Na="MenuContent",[Ufe,wC]=il(Na),xF=v.forwardRef((e,t)=>{const n=vF(Na,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=ol(Na,e.__scopeMenu),o=$f(Na,e.__scopeMenu);return s.jsx(uf.Provider,{scope:e.__scopeMenu,children:s.jsx(Kn,{present:r||i.open,children:s.jsx(uf.Slot,{scope:e.__scopeMenu,children:o.modal?s.jsx(qfe,{...a,ref:t}):s.jsx(Wfe,{...a,ref:t})})})})}),qfe=v.forwardRef((e,t)=>{const n=ol(Na,e.__scopeMenu),r=v.useRef(null),a=vt(t,r);return v.useEffect(()=>{const i=r.current;if(i)return mv(i)},[]),s.jsx(jC,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Te(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Wfe=v.forwardRef((e,t)=>{const n=ol(Na,e.__scopeMenu);return s.jsx(jC,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Vfe=Afe("MenuContent.ScrollLock"),jC=v.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:c,onEntryFocus:d,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:x,onDismiss:g,disableOutsideScroll:j,...b}=e,y=ol(Na,n),S=$f(Na,n),C=sg(n),N=hF(n),E=$fe(n),[_,P]=v.useState(null),O=v.useRef(null),T=vt(t,O,y.onContentChange),I=v.useRef(0),M=v.useRef(""),D=v.useRef(0),R=v.useRef(null),q=v.useRef("right"),U=v.useRef(0),H=j?bf:v.Fragment,J=j?{as:Vfe,allowPinchZoom:!0}:void 0,Z=z=>{const ee=M.current+z,B=E().filter(oe=>!oe.disabled),L=document.activeElement,te=B.find(oe=>oe.ref.current===L)?.textValue,ie=B.map(oe=>oe.textValue),G=rpe(ie,ee,te),de=B.find(oe=>oe.textValue===G)?.ref.current;(function oe(ce){M.current=ce,window.clearTimeout(I.current),ce!==""&&(I.current=window.setTimeout(()=>oe(""),1e3))})(ee),de&&setTimeout(()=>de.focus())};v.useEffect(()=>()=>window.clearTimeout(I.current),[]),pv();const F=v.useCallback(z=>q.current===R.current?.side&&spe(z,R.current?.area),[]);return s.jsx(Ufe,{scope:n,searchRef:M,onItemEnter:v.useCallback(z=>{F(z)&&z.preventDefault()},[F]),onItemLeave:v.useCallback(z=>{F(z)||(O.current?.focus(),P(null))},[F]),onTriggerLeave:v.useCallback(z=>{F(z)&&z.preventDefault()},[F]),pointerGraceTimerRef:D,onPointerGraceIntentChange:v.useCallback(z=>{R.current=z},[]),children:s.jsx(H,{...J,children:s.jsx(yf,{asChild:!0,trapped:a,onMountAutoFocus:Te(i,z=>{z.preventDefault(),O.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:s.jsx(Qo,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:x,onDismiss:g,children:s.jsx(uF,{asChild:!0,...N,dir:S.dir,orientation:"vertical",loop:r,currentTabStopId:_,onCurrentTabStopIdChange:P,onEntryFocus:Te(d,z=>{S.isUsingKeyboardRef.current||z.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(nv,{role:"menu","aria-orientation":"vertical","data-state":IF(y.open),"data-radix-menu-content":"",dir:S.dir,...C,...b,ref:T,style:{outline:"none",...b.style},onKeyDown:Te(b.onKeyDown,z=>{const B=z.target.closest("[data-radix-menu-content]")===z.currentTarget,L=z.ctrlKey||z.altKey||z.metaKey,te=z.key.length===1;B&&(z.key==="Tab"&&z.preventDefault(),!L&&te&&Z(z.key));const ie=O.current;if(z.target!==ie||!Rfe.includes(z.key))return;z.preventDefault();const de=E().filter(oe=>!oe.disabled).map(oe=>oe.ref.current);fF.includes(z.key)&&de.reverse(),tpe(de)}),onBlur:Te(e.onBlur,z=>{z.currentTarget.contains(z.target)||(window.clearTimeout(I.current),M.current="")}),onPointerMove:Te(e.onPointerMove,df(z=>{const ee=z.target,B=U.current!==z.clientX;if(z.currentTarget.contains(ee)&&B){const L=z.clientX>U.current?"right":"left";q.current=L,U.current=z.clientX}}))})})})})})})});xF.displayName=Na;var Hfe="MenuGroup",SC=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(Ge.div,{role:"group",...r,ref:t})});SC.displayName=Hfe;var Kfe="MenuLabel",yF=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(Ge.div,{...r,ref:t})});yF.displayName=Kfe;var Dm="MenuItem",gM="menu.itemSelect",ig=v.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...a}=e,i=v.useRef(null),o=$f(Dm,e.__scopeMenu),c=wC(Dm,e.__scopeMenu),d=vt(t,i),f=v.useRef(!1),h=()=>{const p=i.current;if(!n&&p){const x=new CustomEvent(gM,{bubbles:!0,cancelable:!0});p.addEventListener(gM,g=>r?.(g),{once:!0}),WS(p,x),x.defaultPrevented?f.current=!1:o.onClose()}};return s.jsx(bF,{...a,ref:d,disabled:n,onClick:Te(e.onClick,h),onPointerDown:p=>{e.onPointerDown?.(p),f.current=!0},onPointerUp:Te(e.onPointerUp,p=>{f.current||p.currentTarget?.click()}),onKeyDown:Te(e.onKeyDown,p=>{const x=c.searchRef.current!=="";n||x&&p.key===" "||PS.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});ig.displayName=Dm;var bF=v.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:a,...i}=e,o=wC(Dm,n),c=hF(n),d=v.useRef(null),f=vt(t,d),[h,p]=v.useState(!1),[x,g]=v.useState("");return v.useEffect(()=>{const j=d.current;j&&g((j.textContent??"").trim())},[i.children]),s.jsx(uf.ItemSlot,{scope:n,disabled:r,textValue:a??x,children:s.jsx(dF,{asChild:!0,...c,focusable:!r,children:s.jsx(Ge.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:f,onPointerMove:Te(e.onPointerMove,df(j=>{r?o.onItemLeave(j):(o.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Te(e.onPointerLeave,df(j=>o.onItemLeave(j))),onFocus:Te(e.onFocus,()=>p(!0)),onBlur:Te(e.onBlur,()=>p(!1))})})})}),Gfe="MenuCheckboxItem",wF=v.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...a}=e;return s.jsx(AF,{scope:e.__scopeMenu,checked:n,children:s.jsx(ig,{role:"menuitemcheckbox","aria-checked":Lm(n)?"mixed":n,...a,ref:t,"data-state":CC(n),onSelect:Te(a.onSelect,()=>r?.(Lm(n)?!0:!n),{checkForDefaultPrevented:!1})})})});wF.displayName=Gfe;var jF="MenuRadioGroup",[Yfe,Xfe]=il(jF,{value:void 0,onValueChange:()=>{}}),SF=v.forwardRef((e,t)=>{const{value:n,onValueChange:r,...a}=e,i=Tn(r);return s.jsx(Yfe,{scope:e.__scopeMenu,value:n,onValueChange:i,children:s.jsx(SC,{...a,ref:t})})});SF.displayName=jF;var NF="MenuRadioItem",CF=v.forwardRef((e,t)=>{const{value:n,...r}=e,a=Xfe(NF,e.__scopeMenu),i=n===a.value;return s.jsx(AF,{scope:e.__scopeMenu,checked:i,children:s.jsx(ig,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":CC(i),onSelect:Te(r.onSelect,()=>a.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});CF.displayName=NF;var NC="MenuItemIndicator",[AF,Qfe]=il(NC,{checked:!1}),_F=v.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...a}=e,i=Qfe(NC,n);return s.jsx(Kn,{present:r||Lm(i.checked)||i.checked===!0,children:s.jsx(Ge.span,{...a,ref:t,"data-state":CC(i.checked)})})});_F.displayName=NC;var Jfe="MenuSeparator",EF=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(Ge.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});EF.displayName=Jfe;var Zfe="MenuArrow",PF=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=sg(n);return s.jsx(rv,{...a,...r,ref:t})});PF.displayName=Zfe;var epe="MenuSub",[Uge,kF]=il(epe),cd="MenuSubTrigger",OF=v.forwardRef((e,t)=>{const n=ol(cd,e.__scopeMenu),r=$f(cd,e.__scopeMenu),a=kF(cd,e.__scopeMenu),i=wC(cd,e.__scopeMenu),o=v.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:d}=i,f={__scopeMenu:e.__scopeMenu},h=v.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return v.useEffect(()=>h,[h]),v.useEffect(()=>{const p=c.current;return()=>{window.clearTimeout(p),d(null)}},[c,d]),s.jsx(yC,{asChild:!0,...f,children:s.jsx(bF,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":IF(n.open),...e,ref:Cr(t,a.onTriggerChange),onClick:p=>{e.onClick?.(p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Te(e.onPointerMove,df(p=>{i.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),h()},100))})),onPointerLeave:Te(e.onPointerLeave,df(p=>{h();const x=n.content?.getBoundingClientRect();if(x){const g=n.content?.dataset.side,j=g==="right",b=j?-5:5,y=x[j?"left":"right"],S=x[j?"right":"left"];i.onPointerGraceIntentChange({area:[{x:p.clientX+b,y:p.clientY},{x:y,y:x.top},{x:S,y:x.top},{x:S,y:x.bottom},{x:y,y:x.bottom}],side:g}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(p),p.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Te(e.onKeyDown,p=>{const x=i.searchRef.current!=="";e.disabled||x&&p.key===" "||Ife[r.dir].includes(p.key)&&(n.onOpenChange(!0),n.content?.focus(),p.preventDefault())})})})});OF.displayName=cd;var TF="MenuSubContent",RF=v.forwardRef((e,t)=>{const n=vF(Na,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=ol(Na,e.__scopeMenu),o=$f(Na,e.__scopeMenu),c=kF(TF,e.__scopeMenu),d=v.useRef(null),f=vt(t,d);return s.jsx(uf.Provider,{scope:e.__scopeMenu,children:s.jsx(Kn,{present:r||i.open,children:s.jsx(uf.Slot,{scope:e.__scopeMenu,children:s.jsx(jC,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:f,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{o.isUsingKeyboardRef.current&&d.current?.focus(),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:Te(e.onFocusOutside,h=>{h.target!==c.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Te(e.onEscapeKeyDown,h=>{o.onClose(),h.preventDefault()}),onKeyDown:Te(e.onKeyDown,h=>{const p=h.currentTarget.contains(h.target),x=Mfe[o.dir].includes(h.key);p&&x&&(i.onOpenChange(!1),c.trigger?.focus(),h.preventDefault())})})})})})});RF.displayName=TF;function IF(e){return e?"open":"closed"}function Lm(e){return e==="indeterminate"}function CC(e){return Lm(e)?"indeterminate":e?"checked":"unchecked"}function tpe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function npe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function rpe(e,t,n){const a=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=npe(e,Math.max(i,0));a.length===1&&(o=o.filter(f=>f!==n));const d=o.find(f=>f.toLowerCase().startsWith(a.toLowerCase()));return d!==n?d:void 0}function ape(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const c=t[i],d=t[o],f=c.x,h=c.y,p=d.x,x=d.y;h>r!=x>r&&n<(p-f)*(r-h)/(x-h)+f&&(a=!a)}return a}function spe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return ape(n,t)}function df(e){return t=>t.pointerType==="mouse"?e(t):void 0}var ipe=mF,ope=yC,lpe=gF,cpe=xF,upe=SC,dpe=yF,fpe=ig,ppe=wF,hpe=SF,mpe=CF,vpe=_F,gpe=EF,xpe=PF,ype=OF,bpe=RF,og="DropdownMenu",[wpe]=lr(og,[pF]),Ar=pF(),[jpe,MF]=wpe(og),$F=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:a,defaultOpen:i,onOpenChange:o,modal:c=!0}=e,d=Ar(t),f=v.useRef(null),[h,p]=oa({prop:a,defaultProp:i??!1,onChange:o,caller:og});return s.jsx(jpe,{scope:t,triggerId:Vn(),triggerRef:f,contentId:Vn(),open:h,onOpenChange:p,onOpenToggle:v.useCallback(()=>p(x=>!x),[p]),modal:c,children:s.jsx(ipe,{...d,open:h,onOpenChange:p,dir:r,modal:c,children:n})})};$F.displayName=og;var DF="DropdownMenuTrigger",LF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...a}=e,i=MF(DF,n),o=Ar(n);return s.jsx(ope,{asChild:!0,...o,children:s.jsx(Ge.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...a,ref:Cr(t,i.triggerRef),onPointerDown:Te(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(i.onOpenToggle(),i.open||c.preventDefault())}),onKeyDown:Te(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&i.onOpenToggle(),c.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});LF.displayName=DF;var Spe="DropdownMenuPortal",FF=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Ar(t);return s.jsx(lpe,{...r,...n})};FF.displayName=Spe;var BF="DropdownMenuContent",zF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=MF(BF,n),i=Ar(n),o=v.useRef(!1);return s.jsx(cpe,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...r,ref:t,onCloseAutoFocus:Te(e.onCloseAutoFocus,c=>{o.current||a.triggerRef.current?.focus(),o.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;(!a.modal||h)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});zF.displayName=BF;var Npe="DropdownMenuGroup",Cpe=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Ar(n);return s.jsx(upe,{...a,...r,ref:t})});Cpe.displayName=Npe;var Ape="DropdownMenuLabel",UF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Ar(n);return s.jsx(dpe,{...a,...r,ref:t})});UF.displayName=Ape;var _pe="DropdownMenuItem",qF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Ar(n);return s.jsx(fpe,{...a,...r,ref:t})});qF.displayName=_pe;var Epe="DropdownMenuCheckboxItem",WF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Ar(n);return s.jsx(ppe,{...a,...r,ref:t})});WF.displayName=Epe;var Ppe="DropdownMenuRadioGroup",kpe=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Ar(n);return s.jsx(hpe,{...a,...r,ref:t})});kpe.displayName=Ppe;var Ope="DropdownMenuRadioItem",VF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Ar(n);return s.jsx(mpe,{...a,...r,ref:t})});VF.displayName=Ope;var Tpe="DropdownMenuItemIndicator",HF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Ar(n);return s.jsx(vpe,{...a,...r,ref:t})});HF.displayName=Tpe;var Rpe="DropdownMenuSeparator",KF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Ar(n);return s.jsx(gpe,{...a,...r,ref:t})});KF.displayName=Rpe;var Ipe="DropdownMenuArrow",Mpe=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Ar(n);return s.jsx(xpe,{...a,...r,ref:t})});Mpe.displayName=Ipe;var $pe="DropdownMenuSubTrigger",GF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Ar(n);return s.jsx(ype,{...a,...r,ref:t})});GF.displayName=$pe;var Dpe="DropdownMenuSubContent",YF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Ar(n);return s.jsx(bpe,{...a,...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)"}})});YF.displayName=Dpe;var Lpe=$F,Fpe=LF,Bpe=FF,XF=zF,QF=UF,JF=qF,ZF=WF,eB=VF,tB=HF,nB=KF,rB=GF,aB=YF;const uu=Lpe,du=Fpe,zpe=v.forwardRef(({className:e,inset:t,children:n,...r},a)=>s.jsxs(rB,{ref:a,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,s.jsx(w$,{className:"ml-auto h-4 w-4"})]}));zpe.displayName=rB.displayName;const Upe=v.forwardRef(({className:e,...t},n)=>s.jsx(aB,{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}));Upe.displayName=aB.displayName;const ll=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(Bpe,{children:s.jsx(XF,{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})}));ll.displayName=XF.displayName;const xr=v.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(JF,{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}));xr.displayName=JF.displayName;const qpe=v.forwardRef(({className:e,children:t,checked:n,...r},a)=>s.jsxs(ZF,{ref:a,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:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(tB,{children:s.jsx(hc,{className:"h-4 w-4"})})}),t]}));qpe.displayName=ZF.displayName;const Wpe=v.forwardRef(({className:e,children:t,...n},r)=>s.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:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(tB,{children:s.jsx(z7,{className:"h-2 w-2 fill-current"})})}),t]}));Wpe.displayName=eB.displayName;const AC=v.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(QF,{ref:r,className:Se("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));AC.displayName=QF.displayName;const _C=v.forwardRef(({className:e,...t},n)=>s.jsx(nB,{ref:n,className:Se("-mx-1 my-1 h-px bg-muted",e),...t}));_C.displayName=nB.displayName;const Ul=e=>e.configName?.trim()||e.name,Vpe=()=>{const{configs:e,deleteConfig:t,cloneConfig:n,loading:r,reload:a}=Nf(),i=Ea(),[o,c]=v.useState("name"),[d,f]=v.useState("asc"),[h,p]=v.useState(""),x=h.trim().toLowerCase(),g=_=>{if(o===_){f(P=>P==="asc"?"desc":"asc");return}c(_),f(_==="updatedAt"?"desc":"asc")};v.useEffect(()=>{a();const _=()=>{a()};return window.addEventListener("focus",_),()=>{window.removeEventListener("focus",_)}},[a]);const j=async(_,P)=>{await t(_),Pe({title:"Deleted",description:`"${P}" has been removed.`})},b=async _=>{const P=await n(_);Pe({title:"Cloned",description:`Created "${Ul(P)}".`}),i(`/mcp-evaluations/${P.id}`)},y=_=>_.agentEntries?.length??_.agents?.length??0,S=_=>_.scenarioEntries?.length??_.scenarios?.length??0,C=v.useMemo(()=>x.length===0?e:e.filter(_=>[Ul(_),_.id,_.description??"",_.loadError??""].join(" ").toLowerCase().includes(x)),[e,x]),N=v.useMemo(()=>[...C].sort((P,O)=>{let T=0;return o==="name"&&(T=Ul(P).localeCompare(Ul(O))),o==="scenarios"&&(T=S(P)-S(O)),o==="agents"&&(T=y(P)-y(O)),o==="updatedAt"&&(T=new Date(P.updatedAt).getTime()-new Date(O.updatedAt).getTime()),d==="asc"?T:-T}),[C,o,d]),E=_=>o!==_?s.jsx(tc,{className:"h-3.5 w-3.5 text-muted-foreground"}):d==="asc"?s.jsx(fs,{className:"h-3.5 w-3.5"}):s.jsx(Dt,{className:"h-3.5 w-3.5"});return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(N$,{className:"h-6 w-6"}),"MCP Evaluations"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage your MCP evaluation suites"})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(xC,{value:h,onValueChange:p,placeholder:"Search evaluations..."}),s.jsxs(re,{variant:"outline",size:"sm",onClick:()=>{a()},children:[s.jsx(Ca,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(re,{variant:"outline",size:"sm",children:[s.jsx(G7,{className:"mr-2 h-4 w-4"}),"Import YAML"]}),s.jsx(re,{size:"sm",asChild:!0,children:s.jsxs(jt,{to:"/mcp-evaluations/new",children:[s.jsx(xs,{className:"mr-2 h-4 w-4"}),"Create New"]})})]})]}),s.jsx(Ue,{children:s.jsx(qe,{className:"p-0",children:s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs($t,{children:[s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>g("name"),children:["Name",E("name")]})}),s.jsx(tt,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>g("scenarios"),children:["Scenarios",E("scenarios")]})}),s.jsx(tt,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>g("agents"),children:["Agents",E("agents")]})}),s.jsx(tt,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>g("updatedAt"),children:["Last Updated",E("updatedAt")]})}),s.jsx(tt,{className:"w-10"})]})}),s.jsxs(Lr,{children:[N.map(_=>s.jsxs($t,{children:[s.jsx(ze,{children:s.jsxs("div",{children:[s.jsx(jt,{to:`/mcp-evaluations/${_.id}`,className:"font-medium text-sm hover:text-primary",children:Ul(_)}),_.loadError&&s.jsxs(Qe,{variant:"destructive",className:"ml-2 align-middle text-[10px]",children:[s.jsx(wh,{className:"mr-1 h-3 w-3"}),"Broken"]}),_.description&&s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:_.description}),_.loadError&&s.jsx("p",{className:"text-xs text-destructive mt-0.5 break-all",children:_.loadError})]})}),s.jsx(ze,{className:"text-right font-mono text-sm",children:S(_)}),s.jsx(ze,{className:"text-right font-mono text-sm",children:y(_)}),s.jsx(ze,{className:"text-right text-xs text-muted-foreground",children:new Date(_.updatedAt).toLocaleDateString()}),s.jsx(ze,{children:s.jsxs(uu,{children:[s.jsx(du,{asChild:!0,children:s.jsx(re,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Gm,{className:"h-4 w-4"})})}),s.jsxs(ll,{align:"end",children:[s.jsxs(xr,{onClick:()=>i(`/mcp-evaluations/${_.id}`),children:[s.jsx(Ym,{className:"mr-2 h-3.5 w-3.5"}),"Edit"]}),s.jsxs(xr,{onClick:()=>{b(_.id)},children:[s.jsx(Ui,{className:"mr-2 h-3.5 w-3.5"}),"Clone"]}),s.jsxs(xr,{children:[s.jsx(Sa,{className:"mr-2 h-3.5 w-3.5"}),"Download YAML"]}),s.jsxs(xr,{className:"text-destructive",onClick:()=>{j(_.id,Ul(_))},children:[s.jsx(Aa,{className:"mr-2 h-3.5 w-3.5"}),"Delete"]})]})]})})]},_.id)),!r&&e.length===0&&s.jsx($t,{children:s.jsx(ze,{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&&N.length===0&&s.jsx($t,{children:s.jsx(ze,{colSpan:5,className:"text-center py-12 text-muted-foreground",children:"No MCP evaluations match this filter."})}),r&&s.jsx($t,{children:s.jsx(ze,{colSpan:5,className:"text-center py-12 text-muted-foreground",children:"Loading MCP evaluations..."})})]})]})})})]})};var Hpe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Kpe=Hpe.reduce((e,t)=>{const n=fv(`Primitive.${t}`),r=v.forwardRef((a,i)=>{const{asChild:o,...c}=a,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Gpe="Label",sB=v.forwardRef((e,t)=>s.jsx(Kpe.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));sB.displayName=Gpe;var iB=sB;const Ype=Jo("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Fe=v.forwardRef(({className:e,...t},n)=>s.jsx(iB,{ref:n,className:Se(Ype(),e),...t}));Fe.displayName=iB.displayName;const Wa=v.forwardRef(({className:e,...t},n)=>s.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}));Wa.displayName="Textarea";function lg(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var cg="Switch",[Xpe]=lr(cg),[Qpe,Jpe]=Xpe(cg),oB=v.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:a,defaultChecked:i,required:o,disabled:c,value:d="on",onCheckedChange:f,form:h,...p}=e,[x,g]=v.useState(null),j=vt(t,N=>g(N)),b=v.useRef(!1),y=x?h||!!x.closest("form"):!0,[S,C]=oa({prop:a,defaultProp:i??!1,onChange:f,caller:cg});return s.jsxs(Qpe,{scope:n,checked:S,disabled:c,children:[s.jsx(Ge.button,{type:"button",role:"switch","aria-checked":S,"aria-required":o,"data-state":dB(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&&s.jsx(uB,{control:x,bubbles:!b.current,name:r,value:d,checked:S,required:o,disabled:c,form:h,style:{transform:"translateX(-100%)"}})]})});oB.displayName=cg;var lB="SwitchThumb",cB=v.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,a=Jpe(lB,n);return s.jsx(Ge.span,{"data-state":dB(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});cB.displayName=lB;var Zpe="SwitchBubbleInput",uB=v.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...a},i)=>{const o=v.useRef(null),c=vt(o,i),d=lg(n),f=ev(t);return v.useEffect(()=>{const h=o.current;if(!h)return;const p=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(p,"checked").set;if(d!==n&&g){const j=new Event("click",{bubbles:r});g.call(h,n),h.dispatchEvent(j)}},[d,n,r]),s.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:c,style:{...a.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});uB.displayName=Zpe;function dB(e){return e?"checked":"unchecked"}var fB=oB,ehe=cB;const Fm=v.forwardRef(({className:e,...t},n)=>s.jsx(fB,{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:s.jsx(ehe,{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")})}));Fm.displayName=fB.displayName;var ug="Tabs",[the]=lr(ug,[ag]),pB=ag(),[nhe,EC]=the(ug),hB=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:i,orientation:o="horizontal",dir:c,activationMode:d="automatic",...f}=e,h=cu(c),[p,x]=oa({prop:r,onChange:a,defaultProp:i??"",caller:ug});return s.jsx(nhe,{scope:n,baseId:Vn(),value:p,onValueChange:x,orientation:o,dir:h,activationMode:d,children:s.jsx(Ge.div,{dir:h,"data-orientation":o,...f,ref:t})})});hB.displayName=ug;var mB="TabsList",vB=v.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,i=EC(mB,n),o=pB(n);return s.jsx(uF,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:r,children:s.jsx(Ge.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});vB.displayName=mB;var gB="TabsTrigger",xB=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...i}=e,o=EC(gB,n),c=pB(n),d=wB(o.baseId,r),f=jB(o.baseId,r),h=r===o.value;return s.jsx(dF,{asChild:!0,...c,focusable:!a,active:h,children:s.jsx(Ge.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":f,"data-state":h?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:d,...i,ref:t,onMouseDown:Te(e.onMouseDown,p=>{!a&&p.button===0&&p.ctrlKey===!1?o.onValueChange(r):p.preventDefault()}),onKeyDown:Te(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&o.onValueChange(r)}),onFocus:Te(e.onFocus,()=>{const p=o.activationMode!=="manual";!h&&!a&&p&&o.onValueChange(r)})})})});xB.displayName=gB;var yB="TabsContent",bB=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:i,...o}=e,c=EC(yB,n),d=wB(c.baseId,r),f=jB(c.baseId,r),h=r===c.value,p=v.useRef(h);return v.useEffect(()=>{const x=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(x)},[]),s.jsx(Kn,{present:a||h,children:({present:x})=>s.jsx(Ge.div,{"data-state":h?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!x,id:f,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:x&&i})})});bB.displayName=yB;function wB(e,t){return`${e}-trigger-${t}`}function jB(e,t){return`${e}-content-${t}`}var rhe=hB,SB=vB,NB=xB,CB=bB;const dg=rhe,Df=v.forwardRef(({className:e,...t},n)=>s.jsx(SB,{ref:n,className:Se("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Df.displayName=SB.displayName;const gs=v.forwardRef(({className:e,...t},n)=>s.jsx(NB,{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}));gs.displayName=NB.displayName;const ff=v.forwardRef(({className:e,...t},n)=>s.jsx(CB,{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}));ff.displayName=CB.displayName;const xM={openai:"bg-emerald-100 text-emerald-800",anthropic:"bg-orange-100 text-orange-800",azure:"bg-blue-100 text-blue-800",google:"bg-yellow-100 text-yellow-800",custom:"bg-gray-100 text-gray-800"};function AB({provider:e}){return s.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${xM[e]??xM.custom}`,children:e})}function pf(e,[t,n]){return Math.min(n,Math.max(t,e))}function ahe(e){const t=she(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(ohe);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function she(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=che(a),c=lhe(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Cr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ihe=Symbol("radix.slottable");function ohe(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ihe}function lhe(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function che(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 uhe=[" ","Enter","ArrowUp","ArrowDown"],dhe=[" ","Enter"],Uo="Select",[fg,pg,fhe]=hf(Uo),[fu]=lr(Uo,[fhe,Gi]),hg=Gi(),[phe,to]=fu(Uo),[hhe,mhe]=fu(Uo),_B=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:i,value:o,defaultValue:c,onValueChange:d,dir:f,name:h,autoComplete:p,disabled:x,required:g,form:j}=e,b=hg(t),[y,S]=v.useState(null),[C,N]=v.useState(null),[E,_]=v.useState(!1),P=cu(f),[O,T]=oa({prop:r,defaultProp:a??!1,onChange:i,caller:Uo}),[I,M]=oa({prop:o,defaultProp:c,onChange:d,caller:Uo}),D=v.useRef(null),R=y?j||!!y.closest("form"):!0,[q,U]=v.useState(new Set),H=Array.from(q).map(J=>J.props.value).join(";");return s.jsx(tv,{...b,children:s.jsxs(phe,{required:g,scope:t,trigger:y,onTriggerChange:S,valueNode:C,onValueNodeChange:N,valueNodeHasChildren:E,onValueNodeHasChildrenChange:_,contentId:Vn(),value:I,onValueChange:M,open:O,onOpenChange:T,dir:P,triggerPointerDownPosRef:D,disabled:x,children:[s.jsx(fg.Provider,{scope:t,children:s.jsx(hhe,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(J=>{U(Z=>new Set(Z).add(J))},[]),onNativeOptionRemove:v.useCallback(J=>{U(Z=>{const F=new Set(Z);return F.delete(J),F})},[]),children:n})}),R?s.jsxs(QB,{"aria-hidden":!0,required:g,tabIndex:-1,name:h,autoComplete:p,value:I,onChange:J=>M(J.target.value),disabled:x,form:j,children:[I===void 0?s.jsx("option",{value:""}):null,Array.from(q)]},H):null]})})};_B.displayName=Uo;var EB="SelectTrigger",PB=v.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,i=hg(n),o=to(EB,n),c=o.disabled||r,d=vt(t,o.onTriggerChange),f=pg(n),h=v.useRef("touch"),[p,x,g]=ZB(b=>{const y=f().filter(N=>!N.disabled),S=y.find(N=>N.value===o.value),C=ez(y,b,S);C!==void 0&&o.onValueChange(C.value)}),j=b=>{c||(o.onOpenChange(!0),g()),b&&(o.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return s.jsx(xf,{asChild:!0,...i,children:s.jsx(Ge.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":JB(o.value)?"":void 0,...a,ref:d,onClick:Te(a.onClick,b=>{b.currentTarget.focus(),h.current!=="mouse"&&j(b)}),onPointerDown:Te(a.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(a.onKeyDown,b=>{const y=p.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&x(b.key),!(y&&b.key===" ")&&uhe.includes(b.key)&&(j(),b.preventDefault())})})})});PB.displayName=EB;var kB="SelectValue",OB=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:i,placeholder:o="",...c}=e,d=to(kB,n),{onValueNodeHasChildrenChange:f}=d,h=i!==void 0,p=vt(t,d.onValueNodeChange);return Hn(()=>{f(h)},[f,h]),s.jsx(Ge.span,{...c,ref:p,style:{pointerEvents:"none"},children:JB(d.value)?s.jsx(s.Fragment,{children:o}):i})});OB.displayName=kB;var vhe="SelectIcon",TB=v.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return s.jsx(Ge.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});TB.displayName=vhe;var ghe="SelectPortal",RB=e=>s.jsx(Gc,{asChild:!0,...e});RB.displayName=ghe;var qo="SelectContent",IB=v.forwardRef((e,t)=>{const n=to(qo,e.__scopeSelect),[r,a]=v.useState();if(Hn(()=>{a(new DocumentFragment)},[]),!n.open){const i=r;return i?Kc.createPortal(s.jsx(MB,{scope:e.__scopeSelect,children:s.jsx(fg.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),i):null}return s.jsx($B,{...e,ref:t})});IB.displayName=qo;var Fa=10,[MB,no]=fu(qo),xhe="SelectContentImpl",yhe=ahe("SelectContent.RemoveScroll"),$B=v.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:o,side:c,sideOffset:d,align:f,alignOffset:h,arrowPadding:p,collisionBoundary:x,collisionPadding:g,sticky:j,hideWhenDetached:b,avoidCollisions:y,...S}=e,C=to(qo,n),[N,E]=v.useState(null),[_,P]=v.useState(null),O=vt(t,oe=>E(oe)),[T,I]=v.useState(null),[M,D]=v.useState(null),R=pg(n),[q,U]=v.useState(!1),H=v.useRef(!1);v.useEffect(()=>{if(N)return mv(N)},[N]),pv();const J=v.useCallback(oe=>{const[ce,...le]=R().map(ae=>ae.ref.current),[fe]=le.slice(-1),Ce=document.activeElement;for(const ae of oe)if(ae===Ce||(ae?.scrollIntoView({block:"nearest"}),ae===ce&&_&&(_.scrollTop=0),ae===fe&&_&&(_.scrollTop=_.scrollHeight),ae?.focus(),document.activeElement!==Ce))return},[R,_]),Z=v.useCallback(()=>J([T,N]),[J,T,N]);v.useEffect(()=>{q&&Z()},[q,Z]);const{onOpenChange:F,triggerPointerDownPosRef:z}=C;v.useEffect(()=>{if(N){let oe={x:0,y:0};const ce=fe=>{oe={x:Math.abs(Math.round(fe.pageX)-(z.current?.x??0)),y:Math.abs(Math.round(fe.pageY)-(z.current?.y??0))}},le=fe=>{oe.x<=10&&oe.y<=10?fe.preventDefault():N.contains(fe.target)||F(!1),document.removeEventListener("pointermove",ce),z.current=null};return z.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",le,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",le,{capture:!0})}}},[N,F,z]),v.useEffect(()=>{const oe=()=>F(!1);return window.addEventListener("blur",oe),window.addEventListener("resize",oe),()=>{window.removeEventListener("blur",oe),window.removeEventListener("resize",oe)}},[F]);const[ee,B]=ZB(oe=>{const ce=R().filter(Ce=>!Ce.disabled),le=ce.find(Ce=>Ce.ref.current===document.activeElement),fe=ez(ce,oe,le);fe&&setTimeout(()=>fe.ref.current.focus())}),L=v.useCallback((oe,ce,le)=>{const fe=!H.current&&!le;(C.value!==void 0&&C.value===ce||fe)&&(I(oe),fe&&(H.current=!0))},[C.value]),te=v.useCallback(()=>N?.focus(),[N]),ie=v.useCallback((oe,ce,le)=>{const fe=!H.current&&!le;(C.value!==void 0&&C.value===ce||fe)&&D(oe)},[C.value]),G=r==="popper"?kS:DB,de=G===kS?{side:c,sideOffset:d,align:f,alignOffset:h,arrowPadding:p,collisionBoundary:x,collisionPadding:g,sticky:j,hideWhenDetached:b,avoidCollisions:y}:{};return s.jsx(MB,{scope:n,content:N,viewport:_,onViewportChange:P,itemRefCallback:L,selectedItem:T,onItemLeave:te,itemTextRefCallback:ie,focusSelectedItem:Z,selectedItemText:M,position:r,isPositioned:q,searchRef:ee,children:s.jsx(bf,{as:yhe,allowPinchZoom:!0,children:s.jsx(yf,{asChild:!0,trapped:C.open,onMountAutoFocus:oe=>{oe.preventDefault()},onUnmountAutoFocus:Te(a,oe=>{C.trigger?.focus({preventScroll:!0}),oe.preventDefault()}),children:s.jsx(Qo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:oe=>oe.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:s.jsx(G,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:oe=>oe.preventDefault(),...S,...de,onPlaced:()=>U(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:Te(S.onKeyDown,oe=>{const ce=oe.ctrlKey||oe.altKey||oe.metaKey;if(oe.key==="Tab"&&oe.preventDefault(),!ce&&oe.key.length===1&&B(oe.key),["ArrowUp","ArrowDown","Home","End"].includes(oe.key)){let fe=R().filter(Ce=>!Ce.disabled).map(Ce=>Ce.ref.current);if(["ArrowUp","End"].includes(oe.key)&&(fe=fe.slice().reverse()),["ArrowUp","ArrowDown"].includes(oe.key)){const Ce=oe.target,ae=fe.indexOf(Ce);fe=fe.slice(ae+1)}setTimeout(()=>J(fe)),oe.preventDefault()}})})})})})})});$B.displayName=xhe;var bhe="SelectItemAlignedPosition",DB=v.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,i=to(qo,n),o=no(qo,n),[c,d]=v.useState(null),[f,h]=v.useState(null),p=vt(t,O=>h(O)),x=pg(n),g=v.useRef(!1),j=v.useRef(!0),{viewport:b,selectedItem:y,selectedItemText:S,focusSelectedItem:C}=o,N=v.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&f&&b&&y&&S){const O=i.trigger.getBoundingClientRect(),T=f.getBoundingClientRect(),I=i.valueNode.getBoundingClientRect(),M=S.getBoundingClientRect();if(i.dir!=="rtl"){const Ce=M.left-T.left,ae=I.left-Ce,ke=O.left-ae,Ae=O.width+ke,Ye=Math.max(Ae,T.width),be=window.innerWidth-Fa,Re=pf(ae,[Fa,Math.max(Fa,be-Ye)]);c.style.minWidth=Ae+"px",c.style.left=Re+"px"}else{const Ce=T.right-M.right,ae=window.innerWidth-I.right-Ce,ke=window.innerWidth-O.right-ae,Ae=O.width+ke,Ye=Math.max(Ae,T.width),be=window.innerWidth-Fa,Re=pf(ae,[Fa,Math.max(Fa,be-Ye)]);c.style.minWidth=Ae+"px",c.style.right=Re+"px"}const D=x(),R=window.innerHeight-Fa*2,q=b.scrollHeight,U=window.getComputedStyle(f),H=parseInt(U.borderTopWidth,10),J=parseInt(U.paddingTop,10),Z=parseInt(U.borderBottomWidth,10),F=parseInt(U.paddingBottom,10),z=H+J+q+F+Z,ee=Math.min(y.offsetHeight*5,z),B=window.getComputedStyle(b),L=parseInt(B.paddingTop,10),te=parseInt(B.paddingBottom,10),ie=O.top+O.height/2-Fa,G=R-ie,de=y.offsetHeight/2,oe=y.offsetTop+de,ce=H+J+oe,le=z-ce;if(ce<=ie){const Ce=D.length>0&&y===D[D.length-1].ref.current;c.style.bottom="0px";const ae=f.clientHeight-b.offsetTop-b.offsetHeight,ke=Math.max(G,de+(Ce?te:0)+ae+Z),Ae=ce+ke;c.style.height=Ae+"px"}else{const Ce=D.length>0&&y===D[0].ref.current;c.style.top="0px";const ke=Math.max(ie,H+b.offsetTop+(Ce?L:0)+de)+le;c.style.height=ke+"px",b.scrollTop=ce-ie+b.offsetTop}c.style.margin=`${Fa}px 0`,c.style.minHeight=ee+"px",c.style.maxHeight=R+"px",r?.(),requestAnimationFrame(()=>g.current=!0)}},[x,i.trigger,i.valueNode,c,f,b,y,S,i.dir,r]);Hn(()=>N(),[N]);const[E,_]=v.useState();Hn(()=>{f&&_(window.getComputedStyle(f).zIndex)},[f]);const P=v.useCallback(O=>{O&&j.current===!0&&(N(),C?.(),j.current=!1)},[N,C]);return s.jsx(jhe,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:g,onScrollButtonChange:P,children:s.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:s.jsx(Ge.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});DB.displayName=bhe;var whe="SelectPopperPosition",kS=v.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=Fa,...i}=e,o=hg(n);return s.jsx(nv,{...o,...i,ref:t,align:r,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});kS.displayName=whe;var[jhe,PC]=fu(qo,{}),OS="SelectViewport",LB=v.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,i=no(OS,n),o=PC(OS,n),c=vt(t,i.onViewportChange),d=v.useRef(0);return s.jsxs(s.Fragment,{children:[s.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}),s.jsx(fg.Slot,{scope:n,children:s.jsx(Ge.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Te(a.onScroll,f=>{const h=f.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:x}=o;if(x?.current&&p){const g=Math.abs(d.current-h.scrollTop);if(g>0){const j=window.innerHeight-Fa*2,b=parseFloat(p.style.minHeight),y=parseFloat(p.style.height),S=Math.max(b,y);if(S<j){const C=S+g,N=Math.min(j,C),E=C-N;p.style.height=N+"px",p.style.bottom==="0px"&&(h.scrollTop=E>0?E:0,p.style.justifyContent="flex-end")}}}d.current=h.scrollTop})})})]})});LB.displayName=OS;var FB="SelectGroup",[She,Nhe]=fu(FB),Che=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Vn();return s.jsx(She,{scope:n,id:a,children:s.jsx(Ge.div,{role:"group","aria-labelledby":a,...r,ref:t})})});Che.displayName=FB;var BB="SelectLabel",zB=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Nhe(BB,n);return s.jsx(Ge.div,{id:a.id,...r,ref:t})});zB.displayName=BB;var Bm="SelectItem",[Ahe,UB]=fu(Bm),qB=v.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:i,...o}=e,c=to(Bm,n),d=no(Bm,n),f=c.value===r,[h,p]=v.useState(i??""),[x,g]=v.useState(!1),j=vt(t,C=>d.itemRefCallback?.(C,r,a)),b=Vn(),y=v.useRef("touch"),S=()=>{a||(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 s.jsx(Ahe,{scope:n,value:r,disabled:a,textId:b,isSelected:f,onItemTextChange:v.useCallback(C=>{p(N=>N||(C?.textContent??"").trim())},[]),children:s.jsx(fg.ItemSlot,{scope:n,value:r,disabled:a,textValue:h,children:s.jsx(Ge.div,{role:"option","aria-labelledby":b,"data-highlighted":x?"":void 0,"aria-selected":f&&x,"data-state":f?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...o,ref:j,onFocus:Te(o.onFocus,()=>g(!0)),onBlur:Te(o.onBlur,()=>g(!1)),onClick:Te(o.onClick,()=>{y.current!=="mouse"&&S()}),onPointerUp:Te(o.onPointerUp,()=>{y.current==="mouse"&&S()}),onPointerDown:Te(o.onPointerDown,C=>{y.current=C.pointerType}),onPointerMove:Te(o.onPointerMove,C=>{y.current=C.pointerType,a?d.onItemLeave?.():y.current==="mouse"&&C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Te(o.onPointerLeave,C=>{C.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Te(o.onKeyDown,C=>{d.searchRef?.current!==""&&C.key===" "||(dhe.includes(C.key)&&S(),C.key===" "&&C.preventDefault())})})})})});qB.displayName=Bm;var ud="SelectItemText",WB=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...i}=e,o=to(ud,n),c=no(ud,n),d=UB(ud,n),f=mhe(ud,n),[h,p]=v.useState(null),x=vt(t,S=>p(S),d.onItemTextChange,S=>c.itemTextRefCallback?.(S,d.value,d.disabled)),g=h?.textContent,j=v.useMemo(()=>s.jsx("option",{value:d.value,disabled:d.disabled,children:g},d.value),[d.disabled,d.value,g]),{onNativeOptionAdd:b,onNativeOptionRemove:y}=f;return Hn(()=>(b(j),()=>y(j)),[b,y,j]),s.jsxs(s.Fragment,{children:[s.jsx(Ge.span,{id:d.textId,...i,ref:x}),d.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Kc.createPortal(i.children,o.valueNode):null]})});WB.displayName=ud;var VB="SelectItemIndicator",HB=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return UB(VB,n).isSelected?s.jsx(Ge.span,{"aria-hidden":!0,...r,ref:t}):null});HB.displayName=VB;var TS="SelectScrollUpButton",KB=v.forwardRef((e,t)=>{const n=no(TS,e.__scopeSelect),r=PC(TS,e.__scopeSelect),[a,i]=v.useState(!1),o=vt(t,r.onScrollButtonChange);return Hn(()=>{if(n.viewport&&n.isPositioned){let c=function(){const f=d.scrollTop>0;i(f)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),a?s.jsx(YB,{...e,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop-d.offsetHeight)}}):null});KB.displayName=TS;var RS="SelectScrollDownButton",GB=v.forwardRef((e,t)=>{const n=no(RS,e.__scopeSelect),r=PC(RS,e.__scopeSelect),[a,i]=v.useState(!1),o=vt(t,r.onScrollButtonChange);return Hn(()=>{if(n.viewport&&n.isPositioned){let c=function(){const f=d.scrollHeight-d.clientHeight,h=Math.ceil(d.scrollTop)<f;i(h)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),a?s.jsx(YB,{...e,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop+d.offsetHeight)}}):null});GB.displayName=RS;var YB=v.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,i=no("SelectScrollButton",n),o=v.useRef(null),c=pg(n),d=v.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return v.useEffect(()=>()=>d(),[d]),Hn(()=>{c().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),s.jsx(Ge.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:Te(a.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Te(a.onPointerMove,()=>{i.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Te(a.onPointerLeave,()=>{d()})})}),_he="SelectSeparator",XB=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx(Ge.div,{"aria-hidden":!0,...r,ref:t})});XB.displayName=_he;var IS="SelectArrow",Ehe=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=hg(n),i=to(IS,n),o=no(IS,n);return i.open&&o.position==="popper"?s.jsx(rv,{...a,...r,ref:t}):null});Ehe.displayName=IS;var Phe="SelectBubbleInput",QB=v.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=v.useRef(null),i=vt(r,a),o=lg(t);return v.useEffect(()=>{const c=a.current;if(!c)return;const d=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(d,"value").set;if(o!==t&&h){const p=new Event("change",{bubbles:!0});h.call(c,t),c.dispatchEvent(p)}},[o,t]),s.jsx(Ge.select,{...n,style:{...JM,...n.style},ref:i,defaultValue:t})});QB.displayName=Phe;function JB(e){return e===""||e===void 0}function ZB(e){const t=Tn(e),n=v.useRef(""),r=v.useRef(0),a=v.useCallback(o=>{const c=n.current+o;t(c),(function d(f){n.current=f,window.clearTimeout(r.current),f!==""&&(r.current=window.setTimeout(()=>d(""),1e3))})(c)},[t]),i=v.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,i]}function ez(e,t,n){const a=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=khe(e,Math.max(i,0));a.length===1&&(o=o.filter(f=>f!==n));const d=o.find(f=>f.textValue.toLowerCase().startsWith(a.toLowerCase()));return d!==n?d:void 0}function khe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Ohe=_B,tz=PB,The=OB,Rhe=TB,Ihe=RB,nz=IB,Mhe=LB,rz=zB,az=qB,$he=WB,Dhe=HB,sz=KB,iz=GB,oz=XB;const bn=Ohe,wn=The,mn=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(tz,{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,s.jsx(Rhe,{asChild:!0,children:s.jsx(Dt,{className:"h-4 w-4 opacity-50"})})]}));mn.displayName=tz.displayName;const lz=v.forwardRef(({className:e,...t},n)=>s.jsx(sz,{ref:n,className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(fs,{className:"h-4 w-4"})}));lz.displayName=sz.displayName;const cz=v.forwardRef(({className:e,...t},n)=>s.jsx(iz,{ref:n,className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(Dt,{className:"h-4 w-4"})}));cz.displayName=iz.displayName;const vn=v.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>s.jsx(Ihe,{children:s.jsxs(nz,{ref:a,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:[s.jsx(lz,{}),s.jsx(Mhe,{className:Se("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(cz,{})]})}));vn.displayName=nz.displayName;const Lhe=v.forwardRef(({className:e,...t},n)=>s.jsx(rz,{ref:n,className:Se("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Lhe.displayName=rz.displayName;const mt=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(az,{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:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(Dhe,{children:s.jsx(hc,{className:"h-4 w-4"})})}),s.jsx($he,{children:t})]}));mt.displayName=az.displayName;const Fhe=v.forwardRef(({className:e,...t},n)=>s.jsx(oz,{ref:n,className:Se("-mx-1 my-1 h-px bg-muted",e),...t}));Fhe.displayName=oz.displayName;var mg="Collapsible",[Bhe]=lr(mg),[zhe,kC]=Bhe(mg),uz=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:i,onOpenChange:o,...c}=e,[d,f]=oa({prop:r,defaultProp:a??!1,onChange:o,caller:mg});return s.jsx(zhe,{scope:n,disabled:i,contentId:Vn(),open:d,onOpenToggle:v.useCallback(()=>f(h=>!h),[f]),children:s.jsx(Ge.div,{"data-state":TC(d),"data-disabled":i?"":void 0,...c,ref:t})})});uz.displayName=mg;var dz="CollapsibleTrigger",fz=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,a=kC(dz,n);return s.jsx(Ge.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":TC(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...r,ref:t,onClick:Te(e.onClick,a.onOpenToggle)})});fz.displayName=dz;var OC="CollapsibleContent",pz=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=kC(OC,e.__scopeCollapsible);return s.jsx(Kn,{present:n||a.open,children:({present:i})=>s.jsx(Uhe,{...r,ref:t,present:i})})});pz.displayName=OC;var Uhe=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:a,...i}=e,o=kC(OC,n),[c,d]=v.useState(r),f=v.useRef(null),h=vt(t,f),p=v.useRef(0),x=p.current,g=v.useRef(0),j=g.current,b=o.open||c,y=v.useRef(b),S=v.useRef(void 0);return v.useEffect(()=>{const C=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(C)},[]),Hn(()=>{const C=f.current;if(C){S.current=S.current||{transitionDuration:C.style.transitionDuration,animationName:C.style.animationName},C.style.transitionDuration="0s",C.style.animationName="none";const N=C.getBoundingClientRect();p.current=N.height,g.current=N.width,y.current||(C.style.transitionDuration=S.current.transitionDuration,C.style.animationName=S.current.animationName),d(r)}},[o.open,r]),s.jsx(Ge.div,{"data-state":TC(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!b,...i,ref:h,style:{"--radix-collapsible-content-height":x?`${x}px`:void 0,"--radix-collapsible-content-width":j?`${j}px`:void 0,...e.style},children:b&&a})});function TC(e){return e?"open":"closed"}var qhe=uz;const Mi=qhe,Us=fz,$i=pz,Whe=gv,Vhe=xv,hz=v.forwardRef(({className:e,...t},n)=>s.jsx(eu,{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}));hz.displayName=eu.displayName;const mz=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(Vhe,{children:[s.jsx(hz,{}),s.jsxs(tu,{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,s.jsxs(yv,{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:[s.jsx(ys,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));mz.displayName=tu.displayName;const vz=({className:e,...t})=>s.jsx("div",{className:Se("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});vz.displayName="DialogHeader";const gz=v.forwardRef(({className:e,...t},n)=>s.jsx(wf,{ref:n,className:Se("text-lg font-semibold leading-none tracking-tight",e),...t}));gz.displayName=wf.displayName;const xz=v.forwardRef(({className:e,...t},n)=>s.jsx(jf,{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));xz.displayName=jf.displayName;function Hhe(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var RC="ScrollArea",[yz]=lr(RC),[Khe,ka]=yz(RC),bz=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:a,scrollHideDelay:i=600,...o}=e,[c,d]=v.useState(null),[f,h]=v.useState(null),[p,x]=v.useState(null),[g,j]=v.useState(null),[b,y]=v.useState(null),[S,C]=v.useState(0),[N,E]=v.useState(0),[_,P]=v.useState(!1),[O,T]=v.useState(!1),I=vt(t,D=>d(D)),M=cu(a);return s.jsx(Khe,{scope:n,type:r,dir:M,scrollHideDelay:i,scrollArea:c,viewport:f,onViewportChange:h,content:p,onContentChange:x,scrollbarX:g,onScrollbarXChange:j,scrollbarXEnabled:_,onScrollbarXEnabledChange:P,scrollbarY:b,onScrollbarYChange:y,scrollbarYEnabled:O,onScrollbarYEnabledChange:T,onCornerWidthChange:C,onCornerHeightChange:E,children:s.jsx(Ge.div,{dir:M,...o,ref:I,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":N+"px",...e.style}})})});bz.displayName=RC;var wz="ScrollAreaViewport",jz=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:a,...i}=e,o=ka(wz,n),c=v.useRef(null),d=vt(t,c,o.onViewportChange);return s.jsxs(s.Fragment,{children:[s.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:a}),s.jsx(Ge.div,{"data-radix-scroll-area-viewport":"",...i,ref:d,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:s.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});jz.displayName=wz;var Es="ScrollAreaScrollbar",IC=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=ka(Es,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:o}=a,c=e.orientation==="horizontal";return v.useEffect(()=>(c?i(!0):o(!0),()=>{c?i(!1):o(!1)}),[c,i,o]),a.type==="hover"?s.jsx(Ghe,{...r,ref:t,forceMount:n}):a.type==="scroll"?s.jsx(Yhe,{...r,ref:t,forceMount:n}):a.type==="auto"?s.jsx(Sz,{...r,ref:t,forceMount:n}):a.type==="always"?s.jsx(MC,{...r,ref:t}):null});IC.displayName=Es;var Ghe=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=ka(Es,e.__scopeScrollArea),[i,o]=v.useState(!1);return v.useEffect(()=>{const c=a.scrollArea;let d=0;if(c){const f=()=>{window.clearTimeout(d),o(!0)},h=()=>{d=window.setTimeout(()=>o(!1),a.scrollHideDelay)};return c.addEventListener("pointerenter",f),c.addEventListener("pointerleave",h),()=>{window.clearTimeout(d),c.removeEventListener("pointerenter",f),c.removeEventListener("pointerleave",h)}}},[a.scrollArea,a.scrollHideDelay]),s.jsx(Kn,{present:n||i,children:s.jsx(Sz,{"data-state":i?"visible":"hidden",...r,ref:t})})}),Yhe=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=ka(Es,e.__scopeScrollArea),i=e.orientation==="horizontal",o=gg(()=>d("SCROLL_END"),100),[c,d]=Hhe("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 v.useEffect(()=>{if(c==="idle"){const f=window.setTimeout(()=>d("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(f)}},[c,a.scrollHideDelay,d]),v.useEffect(()=>{const f=a.viewport,h=i?"scrollLeft":"scrollTop";if(f){let p=f[h];const x=()=>{const g=f[h];p!==g&&(d("SCROLL"),o()),p=g};return f.addEventListener("scroll",x),()=>f.removeEventListener("scroll",x)}},[a.viewport,i,d,o]),s.jsx(Kn,{present:n||c!=="hidden",children:s.jsx(MC,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Te(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Te(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),Sz=v.forwardRef((e,t)=>{const n=ka(Es,e.__scopeScrollArea),{forceMount:r,...a}=e,[i,o]=v.useState(!1),c=e.orientation==="horizontal",d=gg(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;o(c?f:h)}},10);return qc(n.viewport,d),qc(n.content,d),s.jsx(Kn,{present:r||i,children:s.jsx(MC,{"data-state":i?"visible":"hidden",...a,ref:t})})}),MC=v.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,a=ka(Es,e.__scopeScrollArea),i=v.useRef(null),o=v.useRef(0),[c,d]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=Ez(c.viewport,c.content),h={...r,sizes:c,onSizesChange:d,hasThumb:f>0&&f<1,onThumbChange:x=>i.current=x,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:x=>o.current=x};function p(x,g){return tme(x,o.current,c,g)}return n==="horizontal"?s.jsx(Xhe,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const x=a.viewport.scrollLeft,g=yM(x,c,a.dir);i.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:x=>{a.viewport&&(a.viewport.scrollLeft=x)},onDragScroll:x=>{a.viewport&&(a.viewport.scrollLeft=p(x,a.dir))}}):n==="vertical"?s.jsx(Qhe,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const x=a.viewport.scrollTop,g=yM(x,c);i.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:x=>{a.viewport&&(a.viewport.scrollTop=x)},onDragScroll:x=>{a.viewport&&(a.viewport.scrollTop=p(x))}}):null}),Xhe=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,i=ka(Es,e.__scopeScrollArea),[o,c]=v.useState(),d=v.useRef(null),f=vt(t,d,i.onScrollbarXChange);return v.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),s.jsx(Cz,{"data-orientation":"horizontal",...a,ref:f,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":vg(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,p)=>{if(i.viewport){const x=i.viewport.scrollLeft+h.deltaX;e.onWheelScroll(x),kz(x,p)&&h.preventDefault()}},onResize:()=>{d.current&&i.viewport&&o&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:Um(o.paddingLeft),paddingEnd:Um(o.paddingRight)}})}})}),Qhe=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,i=ka(Es,e.__scopeScrollArea),[o,c]=v.useState(),d=v.useRef(null),f=vt(t,d,i.onScrollbarYChange);return v.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),s.jsx(Cz,{"data-orientation":"vertical",...a,ref:f,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":vg(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,p)=>{if(i.viewport){const x=i.viewport.scrollTop+h.deltaY;e.onWheelScroll(x),kz(x,p)&&h.preventDefault()}},onResize:()=>{d.current&&i.viewport&&o&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:Um(o.paddingTop),paddingEnd:Um(o.paddingBottom)}})}})}),[Jhe,Nz]=yz(Es),Cz=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:a,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:c,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:h,onResize:p,...x}=e,g=ka(Es,n),[j,b]=v.useState(null),y=vt(t,I=>b(I)),S=v.useRef(null),C=v.useRef(""),N=g.viewport,E=r.content-r.viewport,_=Tn(h),P=Tn(d),O=gg(p,10);function T(I){if(S.current){const M=I.clientX-S.current.left,D=I.clientY-S.current.top;f({x:M,y:D})}}return v.useEffect(()=>{const I=M=>{const D=M.target;j?.contains(D)&&_(M,E)};return document.addEventListener("wheel",I,{passive:!1}),()=>document.removeEventListener("wheel",I,{passive:!1})},[N,j,E,_]),v.useEffect(P,[r,P]),qc(j,O),qc(g.content,O),s.jsx(Jhe,{scope:n,scrollbar:j,hasThumb:a,onThumbChange:Tn(i),onThumbPointerUp:Tn(o),onThumbPositionChange:P,onThumbPointerDown:Tn(c),children:s.jsx(Ge.div,{...x,ref:y,style:{position:"absolute",...x.style},onPointerDown:Te(e.onPointerDown,I=>{I.button===0&&(I.target.setPointerCapture(I.pointerId),S.current=j.getBoundingClientRect(),C.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),T(I))}),onPointerMove:Te(e.onPointerMove,T),onPointerUp:Te(e.onPointerUp,I=>{const M=I.target;M.hasPointerCapture(I.pointerId)&&M.releasePointerCapture(I.pointerId),document.body.style.webkitUserSelect=C.current,g.viewport&&(g.viewport.style.scrollBehavior=""),S.current=null})})})}),zm="ScrollAreaThumb",Az=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Nz(zm,e.__scopeScrollArea);return s.jsx(Kn,{present:n||a.hasThumb,children:s.jsx(Zhe,{ref:t,...r})})}),Zhe=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...a}=e,i=ka(zm,n),o=Nz(zm,n),{onThumbPositionChange:c}=o,d=vt(t,p=>o.onThumbChange(p)),f=v.useRef(void 0),h=gg(()=>{f.current&&(f.current(),f.current=void 0)},100);return v.useEffect(()=>{const p=i.viewport;if(p){const x=()=>{if(h(),!f.current){const g=nme(p,c);f.current=g,c()}};return c(),p.addEventListener("scroll",x),()=>p.removeEventListener("scroll",x)}},[i.viewport,h,c]),s.jsx(Ge.div,{"data-state":o.hasThumb?"visible":"hidden",...a,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Te(e.onPointerDownCapture,p=>{const g=p.target.getBoundingClientRect(),j=p.clientX-g.left,b=p.clientY-g.top;o.onThumbPointerDown({x:j,y:b})}),onPointerUp:Te(e.onPointerUp,o.onThumbPointerUp)})});Az.displayName=zm;var $C="ScrollAreaCorner",_z=v.forwardRef((e,t)=>{const n=ka($C,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?s.jsx(eme,{...e,ref:t}):null});_z.displayName=$C;var eme=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,a=ka($C,n),[i,o]=v.useState(0),[c,d]=v.useState(0),f=!!(i&&c);return qc(a.scrollbarX,()=>{const h=a.scrollbarX?.offsetHeight||0;a.onCornerHeightChange(h),d(h)}),qc(a.scrollbarY,()=>{const h=a.scrollbarY?.offsetWidth||0;a.onCornerWidthChange(h),o(h)}),f?s.jsx(Ge.div,{...r,ref:t,style:{width:i,height:c,position:"absolute",right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Um(e){return e?parseInt(e,10):0}function Ez(e,t){const n=e/t;return isNaN(n)?0:n}function vg(e){const t=Ez(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function tme(e,t,n,r="ltr"){const a=vg(n),i=a/2,o=t||i,c=a-o,d=n.scrollbar.paddingStart+o,f=n.scrollbar.size-n.scrollbar.paddingEnd-c,h=n.content-n.viewport,p=r==="ltr"?[0,h]:[h*-1,0];return Pz([d,f],p)(e)}function yM(e,t,n="ltr"){const r=vg(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-a,o=t.content-t.viewport,c=i-r,d=n==="ltr"?[0,o]:[o*-1,0],f=pf(e,d);return Pz([0,o],[0,c])(f)}function Pz(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 kz(e,t){return e>0&&e<t}var nme=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function a(){const i={left:e.scrollLeft,top:e.scrollTop},o=n.left!==i.left,c=n.top!==i.top;(o||c)&&t(),n=i,r=window.requestAnimationFrame(a)})(),()=>window.cancelAnimationFrame(r)};function gg(e,t){const n=Tn(e),r=v.useRef(0);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),v.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function qc(e,t){const n=Tn(t);Hn(()=>{let r=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return a.observe(e),()=>{window.cancelAnimationFrame(r),a.unobserve(e)}}},[e,n])}var Oz=bz,rme=jz,ame=_z;const qm=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(Oz,{ref:r,className:Se("relative overflow-hidden",e),...n,children:[s.jsx(rme,{className:"h-full w-full rounded-[inherit]",children:t}),s.jsx(Tz,{}),s.jsx(ame,{})]}));qm.displayName=Oz.displayName;const Tz=v.forwardRef(({className:e,orientation:t="vertical",...n},r)=>s.jsx(IC,{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:s.jsx(Az,{className:"relative flex-1 rounded-full bg-border"})}));Tz.displayName=IC.displayName;const sme=[{label:"Suggest Checks",description:"Propose stronger evaluation checks for this scenario.",prompt:"Suggest checks"},{label:"Suggest Value Capture Rules",description:"Recommend extract/value capture rules for key outputs.",prompt:"Suggest value capture rules"},{label:"Improve Prompt Determinism",description:"Reduce ambiguity and improve reproducibility.",prompt:"Improve prompt determinism"},{label:"Explain Snapshot Drift Risk",description:"Assess likely causes of drift and stabilization options.",prompt:"Explain snapshot drift risk"},{label:"Generate Scenario Draft",description:"Create a draft scenario from the current context.",prompt:"Generate scenario draft"}];function ime({open:e,onOpenChange:t,configId:n,configPath:r,scenario:a,agents:i,servers:o,snapshotEval:c,defaultAssistantAgentName:d,initialUserMessage:f,onApplyPatch:h}){const{source:p}=Rn(),[x,g]=v.useState(null),[j,b]=v.useState(null),[y,S]=v.useState(""),[C,N]=v.useState(!1),[E,_]=v.useState(new Set),P=v.useRef(null),O=v.useRef(null),T=v.useRef(null),[I,M]=v.useState(!1),D=v.useRef(!1),R=d||i[0]?.id||"";v.useEffect(()=>{if(!e||!R||x)return;let G=!1;return N(!0),p.createScenarioAssistantSession({configId:n,configPath:r,scenarioId:a.id,selectedAssistantAgentName:R,context:{configSnapshotPolicy:c?{enabled:c.enabled,mode:c.mode,baselineSnapshotId:c.baselineSnapshotId}:void 0,scenario:{id:a.id,name:a.name,prompt:a.prompt,serverNames:a.serverIds,evalRules:a.evalRules,extractRules:a.extractRules,snapshotEval:a.snapshotEval?{enabled:a.snapshotEval.enabled,baselineSnapshotId:a.snapshotEval.baselineSnapshotId}:void 0},availableServers:o.map(de=>({name:de.name||de.id,url:de.url})),availableAgents:i.map(de=>({name:de.name||de.id,provider:de.provider,model:de.model}))}}).then(de=>{G||(g(de.sessionId),b(de.session))}).catch(de=>{G||Pe({title:"Could not start Scenario Assistant",description:de instanceof Error?de.message:String(de),variant:"destructive"})}).finally(()=>{G||N(!1)}),()=>{G=!0}},[e,p,x,n,r,a,c,i,o,R]);const q=()=>{g(null),b(null),S(""),_(new Set),T.current=null},U=G=>{q(),p.closeScenarioAssistantSession(G).catch(()=>{})};v.useEffect(()=>{e||x&&(D.current||I||U(x))},[e,x,p,I]),v.useEffect(()=>()=>{x&&p.closeScenarioAssistantSession(x).catch(()=>{})},[x,p]),v.useEffect(()=>{if(!e)return;I&&M(!1),D.current&&(D.current=!1);const G=window.setTimeout(()=>{P.current?.scrollIntoView({behavior:"smooth",block:"end"})},0);return()=>window.clearTimeout(G)},[e,C,j?.messages.length,j?.pendingToolCalls.length,j?.warnings.length]),v.useEffect(()=>{const G=O.current;if(!G)return;G.style.height="0px";const de=Math.min(G.scrollHeight,160);G.style.height=`${Math.max(40,de)}px`},[y,e]);const H=i.length>0&&a.serverIds.length>0&&!!R,J=async G=>{if(!x)return;const de=G.trim();if(!de)return;const oe=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,ce={id:oe,role:"user",text:de,createdAt:new Date().toISOString()};b(le=>le&&{...le,messages:[...le.messages,ce]}),S(""),N(!0);try{const le=await p.sendScenarioAssistantMessage(x,de);b(le.session)}catch(le){b(fe=>fe&&{...fe,messages:fe.messages.filter(Ce=>Ce.id!==oe)}),S(fe=>fe.trim()?fe:de),Pe({title:"Scenario Assistant error",description:le instanceof Error?le.message:String(le),variant:"destructive"})}finally{N(!1)}},Z=G=>{S(G),requestAnimationFrame(()=>O.current?.focus())};v.useEffect(()=>{if(!e||!x||!j||!H||C)return;const G=String(f??"").trim();G&&T.current!==G&&(T.current=G,J(G))},[e,x,j,H,C,f]);const F=async G=>{if(x){N(!0);try{const de=await p.approveScenarioAssistantToolCall(x,G);b(de.session)}catch(de){Pe({title:"Tool call failed",description:de instanceof Error?de.message:String(de),variant:"destructive"})}finally{N(!1)}}},z=async G=>{if(x){N(!0);try{const de=await p.denyScenarioAssistantToolCall(x,G);b(de.session)}catch(de){Pe({title:"Could not deny tool call",description:de instanceof Error?de.message:String(de),variant:"destructive"})}finally{N(!1)}}},ee=async()=>{if(x){N(!0);try{const G=await p.approveAllScenarioAssistantToolCalls(x);b(G.session)}catch(G){Pe({title:"Could not approve all tool calls",description:G instanceof Error?G.message:String(G),variant:"destructive"})}finally{N(!1)}}},B=(G,de,oe)=>{if(!de)return;if(oe==="prompt"&&de.prompt&&h({prompt:de.prompt.replacement}),oe==="evalRules"&&de.evalRules&&h({evalRules:de.evalRules.replacement}),oe==="extractRules"&&de.extractRules&&h({extractRules:de.extractRules.replacement}),oe==="snapshotEval"&&de.snapshotEval&&h({snapshotEval:{enabled:de.snapshotEval.patch.enabled,baselineSnapshotId:de.snapshotEval.patch.baselineSnapshotId}}),G){const le=`${G}:${oe}`;_(fe=>new Set([...fe,le]))}Pe({title:"Applied suggestion",description:`Updated ${{prompt:"Prompt",evalRules:"Checks",extractRules:"Value Capture Rules",snapshotEval:"Snapshot Settings"}[oe]}`})},L=G=>{G||(M(!1),D.current=!1),t(G)},te=()=>{D.current=!0,M(!0),t(!1)},ie=()=>{D.current=!1,M(!1),x&&U(x)};return s.jsxs(s.Fragment,{children:[!e&&x&&s.jsxs("div",{className:"mt-3 flex items-center justify-between gap-2 rounded-md border bg-background px-3 py-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm font-medium",children:"Scenario Assistant (session active)"}),s.jsxs("p",{className:"truncate text-xs text-muted-foreground",children:["Resume conversation for ",s.jsx("span",{className:"font-mono",children:a.id}),j?` · ${j.messages.length} messages`:""]})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>t(!0),children:[s.jsx(ya,{className:"mr-1.5 h-3.5 w-3.5"}),"Resume"]}),s.jsx(re,{type:"button",size:"sm",variant:"ghost",className:"h-8 px-2 text-muted-foreground",onClick:ie,"aria-label":"Discard assistant session",title:"Discard assistant session",children:s.jsx(ys,{className:"h-4 w-4"})})]})]}),s.jsx(Whe,{open:e,onOpenChange:L,children:s.jsxs(mz,{className:"max-w-6xl h-[85vh] flex flex-col",children:[x&&s.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:te,"aria-label":"Minimize assistant",title:"Minimize assistant",children:[s.jsx(V7,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Minimize"})]}),s.jsx(vz,{className:"pr-20",children:s.jsx("div",{className:"flex items-start justify-between gap-3",children:s.jsxs("div",{className:"min-w-0",children:[s.jsxs(gz,{className:"flex items-center gap-2",children:[s.jsx(ya,{className:"h-4 w-4"}),"Scenario Assistant"]}),s.jsx(xz,{children:"LLM-guided scenario authoring with MCP tool introspection and per-tool-call approval."})]})})}),H?s.jsxs("div",{className:"min-h-0 flex flex-1 flex-col gap-3",children:[s.jsx("div",{className:"grid gap-3 sm:grid-cols-1",children:s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"MCP Context"}),s.jsxs("div",{className:"h-8 rounded-md border px-2 text-xs flex items-center gap-2",children:[s.jsx(ls,{className:"h-3.5 w-3.5"}),j?`Loaded ${j.toolsLoaded} tools`:"Preparing..."]})]})}),s.jsx(qm,{className:"min-h-0 flex-1 rounded-md border p-3",children:s.jsxs("div",{className:"space-y-3",children:[j?.warnings?.map((G,de)=>s.jsx("div",{className:"rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-900",children:G},`${G}-${de}`)),j?.messages.map(G=>s.jsxs(v.Fragment,{children:[(()=>{const de=G.pendingToolCallIds??(G.pendingToolCallId?[G.pendingToolCallId]:[]),oe=de.map(ae=>(j?.pendingToolCalls??[]).find(ke=>ke.id===ae)).filter(ae=>!!ae),ce=de.map(ae=>j.pendingToolCalls.find(ke=>ke.id===ae)??j.pendingToolCalls.find(ke=>ke.id===ae)).filter(Boolean);if(!(G.role==="assistant"&&de.length>0))return s.jsx("div",{className:"space-y-2",children:s.jsx(ome,{message:G})});const fe=oe.length,Ce=ce.length-fe;return s.jsxs("div",{className:"flex items-start gap-2",children:[s.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:s.jsx(wa,{className:"h-3 w-3"})}),s.jsxs("div",{className:"w-full max-w-[92%] space-y-2",children:[s.jsx("div",{className:"rounded-md border border-border/60 bg-background px-3 py-2",children:s.jsx(MS,{text:G.text,variant:"assistant"})}),ce.length>1&&fe>0&&s.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:[s.jsxs("span",{className:"text-xs text-amber-900",children:[Ce," of ",ce.length," tool calls resolved"]}),s.jsxs(re,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:C,onClick:()=>{ee()},children:["Approve All (",fe,")"]})]}),ce.map(ae=>{const ke=ae.status==="pending",Ae=ae.tool??ae.publicToolName??"unknown_tool";return s.jsxs("details",{open:ke,className:"group overflow-hidden rounded-md border border-border/60 bg-background",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-3 px-3 py-2",children:[s.jsx("div",{className:"min-w-0 flex-1",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ls,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:`Tool call ${Ae}`}),s.jsx("span",{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${ke?"bg-amber-100 text-amber-900":ae.status==="error"?"bg-red-100 text-red-900":ae.status==="denied"?"bg-gray-100 text-gray-700":"bg-muted text-muted-foreground"}`,children:ke?"Needs approval":ae.status==="error"?"Error":ae.status==="denied"?"Denied":"Approved"})]})}),s.jsx(Dt,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),s.jsxs("div",{className:"space-y-2 border-t border-border/50 px-3 py-2",children:[s.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:s.jsx("code",{children:JSON.stringify(ae.arguments??{},null,2)})}),ke&&s.jsxs("div",{className:"mt-2 flex justify-end gap-2",children:[s.jsx(re,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:C,onClick:()=>{z(ae.id)},children:"Deny"}),s.jsx(re,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:C,onClick:()=>{F(ae.id)},children:"Approve"})]})]})]},ae.id)})]})]})})(),G.suggestions&&s.jsxs("div",{className:"ml-0 space-y-3 rounded-md border border-dashed bg-muted/10 p-3",children:[s.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground",children:[s.jsx(ya,{className:"h-3.5 w-3.5"}),"Structured Suggestions"]}),G.suggestions.prompt&&s.jsx(mh,{title:"Prompt",rationale:G.suggestions.prompt.rationale,preview:G.suggestions.prompt.replacement,applied:E.has(`${G.id}:prompt`),onApply:()=>B(G.id,G.suggestions,"prompt")}),G.suggestions.evalRules&&s.jsx(mh,{title:"Checks",rationale:G.suggestions.evalRules.rationale,preview:JSON.stringify(G.suggestions.evalRules.replacement,null,2),applied:E.has(`${G.id}:evalRules`),onApply:()=>B(G.id,G.suggestions,"evalRules")}),G.suggestions.extractRules&&s.jsx(mh,{title:"Value Capture Rules",rationale:G.suggestions.extractRules.rationale,preview:JSON.stringify(G.suggestions.extractRules.replacement,null,2),applied:E.has(`${G.id}:extractRules`),onApply:()=>B(G.id,G.suggestions,"extractRules")}),G.suggestions.snapshotEval&&s.jsx(mh,{title:"Snapshot Settings",rationale:G.suggestions.snapshotEval.rationale,preview:JSON.stringify(G.suggestions.snapshotEval.patch,null,2),applied:E.has(`${G.id}:snapshotEval`),onApply:()=>B(G.id,G.suggestions,"snapshotEval")}),(()=>{const de=G.suggestions?.notes,oe=Array.isArray(de)?de:typeof de=="string"?[de]:[];return oe.length===0?null:s.jsxs("div",{className:"space-y-2 rounded-md border p-3",children:[s.jsx("h5",{className:"text-sm font-medium",children:"Notes"}),s.jsx("ul",{className:"space-y-1 text-xs text-muted-foreground list-disc pl-4",children:oe.map((ce,le)=>s.jsx("li",{children:ce},`${G.id}-note-${le}`))})]})})()]})]},G.id)),(j?.pendingToolCalls??[]).filter(G=>!(j?.messages??[]).some(de=>de.pendingToolCallId===G.id||de.pendingToolCallIds?.includes(G.id))).map(G=>s.jsxs("details",{open:!0,className:"group min-w-0 rounded-md border bg-background",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-2 p-3",children:[s.jsx("div",{className:"min-w-0 flex-1",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ls,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),s.jsx("p",{className:"min-w-0 truncate font-mono text-xs font-semibold",children:G.publicToolName||G.tool}),s.jsx("span",{className:"shrink-0 rounded bg-amber-100 px-1.5 py-0.5 text-[10px] font-semibold text-amber-900",children:"Needs approval"})]})}),s.jsx(Dt,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),s.jsxs("div",{className:"border-t px-3 pb-3 pt-2",children:[s.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:s.jsx("code",{children:JSON.stringify(G.arguments??{},null,2)})}),s.jsxs("div",{className:"mt-2 flex justify-end gap-2",children:[s.jsx(re,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:C,onClick:()=>{z(G.id)},children:"Deny"}),s.jsx(re,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:C,onClick:()=>{F(G.id)},children:"Approve"})]})]})]},G.id)),!j&&C&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(or,{className:"h-4 w-4 animate-spin"}),"Starting assistant session..."]}),j&&C&&s.jsxs("div",{className:"flex items-start gap-2",children:[s.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:s.jsx(wa,{className:"h-3 w-3"})}),s.jsxs("div",{className:"inline-flex items-center gap-2 rounded-md border bg-background px-3 py-2 text-sm text-muted-foreground",children:[s.jsx(or,{className:"h-4 w-4 animate-spin"}),"Thinking..."]})]}),s.jsx("div",{ref:P})]})}),s.jsxs("div",{className:"rounded-xl border bg-background p-2 shadow-sm",children:[s.jsx(Wa,{ref:O,value:y,onChange:G=>S(G.target.value),placeholder:"Get assistance with creating or refining this scenario ...",disabled:!x||C,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(),J(y))}}),s.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 px-1 pt-1",children:[s.jsxs(uu,{children:[s.jsx(du,{asChild:!0,children:s.jsxs(re,{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:!x||C,children:[s.jsx(xs,{className:"h-3 w-3"}),"Snippets",s.jsx(Dt,{className:"h-3 w-3"})]})}),s.jsxs(ll,{align:"start",className:"w-[320px]",children:[s.jsx(AC,{children:"Scenario Assistant Snippets"}),s.jsx(_C,{}),sme.map(G=>s.jsx(xr,{className:"items-start whitespace-normal px-2 py-2",onSelect:()=>Z(G.prompt),children:s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("div",{className:"text-xs font-medium leading-tight",children:G.label}),s.jsx("div",{className:"text-[11px] leading-snug text-muted-foreground",children:G.description})]})},G.label))]})]}),s.jsx(re,{type:"button",size:"icon",className:"h-8 w-8 rounded-full",onClick:()=>{J(y)},disabled:!x||C||!y.trim(),"aria-label":"Send message",title:"Send message",children:C?s.jsx(or,{className:"h-4 w-4 animate-spin"}):s.jsxs(s.Fragment,{children:[s.jsx(P$,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Send"})]})})]})]})]}):s.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 mh({title:e,rationale:t,preview:n,applied:r=!1,onApply:a}){return s.jsxs("div",{className:`space-y-2 rounded-md border p-3 ${r?"border-emerald-300 bg-emerald-50/40":""}`,children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("h5",{className:"text-sm font-medium",children:e}),s.jsx(re,{type:"button",size:"sm",variant:r?"secondary":"outline",onClick:a,disabled:r,children:r?s.jsxs(s.Fragment,{children:[s.jsx(nc,{className:"mr-1.5 h-3.5 w-3.5"}),"Applied"]}):"Apply"})]}),t&&s.jsx("p",{className:"text-xs text-muted-foreground",children:t}),s.jsx("pre",{className:"max-h-56 overflow-auto rounded bg-muted p-2 text-xs whitespace-pre-wrap",children:n})]})}function ome({message:e}){const t=async o=>{try{await navigator.clipboard.writeText(o),Pe({title:"Copied"})}catch(c){Pe({title:"Could not copy",description:c instanceof Error?c.message:String(c),variant:"destructive"})}},n=e.role;if(n==="tool"){const o=String(e.text??"").trim();return/^(Approved|Denied) tool call\b/i.test(o)?null:s.jsxs("div",{className:"rounded-md border border-sky-500/30 bg-sky-500/10 px-3 py-2 text-sm",children:[s.jsxs("div",{className:"mb-1 flex items-center gap-2 text-[11px] font-semibold uppercase tracking-wide text-sky-700",children:[s.jsx(ls,{className:"h-3.5 w-3.5"}),"Tool",s.jsx("span",{className:"font-normal normal-case text-sky-700/80",children:new Date(e.createdAt).toLocaleTimeString()})]}),s.jsx("p",{className:"whitespace-pre-wrap text-sky-900",children:e.text})]})}if(n==="system")return s.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[s.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:s.jsx(E$,{className:"h-3 w-3"})}),s.jsx("div",{className:"max-w-[92%] rounded-md border border-amber-400/30 bg-amber-50/70 p-3 text-sm",children:s.jsx(MS,{text:e.text,variant:"assistant"})})]});const r=n==="user",a=r?QS:wa,i=n==="user"||n==="assistant";return s.jsxs("div",{className:`flex items-start gap-2 text-xs ${r?"justify-end":"justify-start"}`,children:[!r&&s.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:s.jsx(a,{className:"h-3 w-3"})}),s.jsxs("div",{className:"relative max-w-[92%]",children:[s.jsxs("div",{className:`max-w-full rounded-md border px-3 py-2 text-sm ${r?"border-primary/20 bg-primary/10":"border-border/80 bg-background shadow-sm"}`,children:[!r&&s.jsx("p",{className:"mb-2 text-[11px] font-semibold text-muted-foreground",children:"Assistant"}),r?s.jsx("p",{className:"whitespace-pre-wrap",children:e.text}):s.jsx(MS,{text:e.text,variant:"assistant"})]}),i&&s.jsx(re,{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:s.jsx(Ui,{className:"h-3.5 w-3.5"})})]}),r&&s.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:s.jsx(a,{className:"h-3 w-3"})})]})}function MS({text:e,variant:t="assistant"}){const n=lme(e);return s.jsx("div",{className:Se("space-y-2",t==="system"&&"text-xs"),children:n.map((r,a)=>s.jsx(v.Fragment,{children:cme(r,a,t)},`md-${a}`))})}function lme(e){const t=e.replace(/\r\n/g,`
121
- `).split(`
122
- `),n=[];let r=0;const a=o=>o.trim()==="",i=o=>o.trimStart().startsWith("```");for(;r<t.length;){const o=t[r],c=o.trim();if(a(o)){r+=1;continue}if(i(o)){const x=c.replace(/^```/,"").trim()||void 0;r+=1;const g=[];for(;r<t.length&&!i(t[r]);)g.push(t[r]),r+=1;r<t.length&&i(t[r])&&(r+=1),n.push({type:"code",lang:x,code:g.join(`
123
- `)});continue}if(/^---+$/.test(c)||/^\*\*\*+$/.test(c)){n.push({type:"hr"}),r+=1;continue}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(bM(t,r)){const x=wM(t[r]);r+=2;const g=[];for(;r<t.length&&t[r].includes("|")&&!a(t[r]);)g.push(wM(t[r])),r+=1;n.push({type:"table",headers:x,rows:g});continue}const f=c.match(/^\d+\.\s+/),h=c.match(/^[-*+]\s+/);if(f||h){const x=!!f,g=[];for(;r<t.length;){const j=t[r].trim();if(x?/^\d+\.\s+/.test(j):/^[-*+]\s+/.test(j)){g.push(j.replace(x?/^\d+\.\s+/:/^[-*+]\s+/,"")),r+=1;continue}a(t[r])&&(r+=1);break}n.push({type:"list",ordered:x,items:g});continue}const p=[o];for(r+=1;r<t.length;){const x=t[r],g=x.trim();if(a(x)||i(x)||/^---+$/.test(g)||/^#{1,4}\s+/.test(g)||bM(t,r)||/^\d+\.\s+/.test(g)||/^[-*+]\s+/.test(g))break;p.push(x),r+=1}n.push({type:"paragraph",text:p.join(`
124
- `)})}return n}function bM(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 wM(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(t=>t.trim())}function cme(e,t,n){if(e.type==="hr")return s.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 s.jsx("h4",{className:r,children:ad(e.text,`${t}-h`)})}if(e.type==="paragraph")return s.jsx("p",{className:Se("whitespace-pre-wrap leading-relaxed",n==="system"&&"leading-normal"),children:ad(e.text,`${t}-p`)});if(e.type==="code")return s.jsxs("div",{className:"rounded-md border bg-muted/70",children:[e.lang&&s.jsx("div",{className:"border-b px-2 py-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:e.lang}),s.jsx("pre",{className:"max-h-72 overflow-auto p-2 text-xs",children:s.jsx("code",{children:e.code})})]});if(e.type==="list"){const r=e.ordered?"ol":"ul";return s.jsx(r,{className:Se("space-y-1 pl-5",e.ordered?"list-decimal":"list-disc"),children:e.items.map((a,i)=>s.jsx("li",{className:"leading-relaxed",children:ad(a,`${t}-li-${i}`)},`${t}-li-${i}`))})}return e.type==="table"?s.jsx("div",{className:"overflow-x-auto rounded-md border",children:s.jsxs("table",{className:"w-full min-w-[480px] border-collapse text-xs",children:[s.jsx("thead",{className:"bg-muted/40",children:s.jsx("tr",{children:e.headers.map((r,a)=>s.jsx("th",{className:"border-b px-2 py-1.5 text-left font-semibold align-top",children:ad(r,`${t}-thc-${a}`)},`${t}-th-${a}`))})}),s.jsx("tbody",{children:e.rows.map((r,a)=>s.jsx("tr",{className:"border-t",children:r.map((i,o)=>s.jsx("td",{className:"px-2 py-1.5 align-top",children:ad(i,`${t}-tdc-${a}-${o}`)},`${t}-td-${a}-${o}`))},`${t}-row-${a}`))})]})}):null}function ad(e,t){return e.split(/(`[^`]+`|\*\*[^*]+\*\*)/g).filter(Boolean).map((r,a)=>r.startsWith("`")&&r.endsWith("`")?s.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[0.92em]",children:r.slice(1,-1)},`${t}-${a}`):r.startsWith("**")&&r.endsWith("**")?s.jsx("strong",{children:r.slice(2,-2)},`${t}-${a}`):s.jsx(v.Fragment,{children:r},`${t}-${a}`))}const ume="mcplab.feature.";function xg(e,t=!1){if(typeof window>"u")return t;try{const n=window.localStorage.getItem(`${ume}${e}`);return n==null?t:n==="1"||n==="true"}catch{return t}}const dme=()=>({id:`scn-${Date.now()}`,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]});function $S({scenarios:e,scenarioOrigins:t,agents:n,servers:r,configId:a,configPath:i,defaultAssistantAgentName:o,assistantInitialPromptByScenarioId:c,assistantAutoOpenNonceByScenarioId:d,snapshotEval:f,onChange:h,readOnly:p,allowAdd:x=!p,allowStructureEdits:g=!p}){const j=(C,N)=>{const E=e.map((_,P)=>P===C?{..._,...N}:_);h(E)},b=C=>h(e.filter((N,E)=>E!==C)),y=()=>h([...e,dme()]),S=(C,N)=>{const E=C+N;if(E<0||E>=e.length)return;const _=[...e],[P]=_.splice(C,1);_.splice(E,0,P),h(_)};return s.jsxs("div",{className:p?"space-y-2":"space-y-4",children:[!p&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"Scenarios"}),x&&g&&s.jsxs(re,{type:"button",variant:"outline",size:"sm",onClick:y,children:[s.jsx(xs,{className:"mr-1.5 h-3.5 w-3.5"}),"Add Scenario"]})]}),e.map((C,N)=>s.jsx(fme,{scenario:C,scenarioOrigin:t?.[N],index:N,total:e.length,agents:n,servers:r,configId:a,configPath:i,defaultAssistantAgentName:o,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:g},C.id)),e.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No scenarios configured. Add one to get started."})]})}function fme({scenario:e,scenarioOrigin:t,index:n,total:r,agents:a,servers:i,configId:o,configPath:c,defaultAssistantAgentName:d,assistantInitialPrompt:f,assistantAutoOpenNonce:h,snapshotEval:p,onUpdate:x,onMoveUp:g,onMoveDown:j,onRemove:b,readOnly:y,allowStructureEdits:S}){const{source:C}=Rn(),N=xg("snapshots",!1),[E,_]=v.useState("required_tool"),[P,O]=v.useState(""),[T,I]=v.useState(""),[M,D]=v.useState(null),[R,q]=v.useState(!1),[U,H]=v.useState(null),[J,Z]=v.useState(""),[F,z]=v.useState(""),[ee,B]=v.useState(!1),[L,te]=v.useState(!y),ie=()=>{P.trim()&&(x({evalRules:[...e.evalRules,{type:E,value:P.trim()}]}),O(""),I(""))},G=ue=>{x({evalRules:e.evalRules.filter((Oe,Ke)=>Ke!==ue)})},de=()=>{!J.trim()||!F.trim()||(x({extractRules:[...e.extractRules,{name:J.trim(),pattern:F.trim()}]}),Z(""),z(""))},oe=ue=>{x({extractRules:e.extractRules.filter((Oe,Ke)=>Ke!==ue)})},ce=ue=>{const Oe=e.serverIds.includes(ue)?e.serverIds.filter(Ke=>Ke!==ue):[...e.serverIds,ue];x({serverIds:Oe})},le={required_tool:"Required",forbidden_tool:"Forbidden",response_contains:"Contains",response_not_contains:"Not Contains"},fe={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"},Ce=E==="required_tool"||E==="forbidden_tool",ae=e.serverIds.filter(ue=>i.some(Oe=>Oe.id===ue)),ke=ae.length>0,Ae=e.snapshotEval?.baselineSnapshotId!==void 0,[Ye,be]=v.useState(""),[Re,Y]=v.useState(0);v.useEffect(()=>{const ue=(f??"").trim();ue&&Ye!==ue&&(B(!0),be(ue))},[f,Ye]),v.useEffect(()=>{h&&h!==Re&&(B(!0),Y(h))},[h,Re]),v.useEffect(()=>{D(null),H(null),I("")},[e.serverIds.join("|")]),v.useEffect(()=>{I("")},[E]);const xe=async()=>{if(!(!ke||y)){q(!0),H(null);try{const ue=new Set;for(const Oe of ae){const Ke=await C.discoverToolsForAnalysis({serverNames:[Oe]});for(const bt of Ke.servers)for(const It of bt.tools)ue.add(It.name)}D(Array.from(ue).sort((Oe,Ke)=>Oe.localeCompare(Ke)))}catch(ue){H(ue instanceof Error?ue.message:"Failed to load tools")}finally{q(!1)}}};return s.jsx(Mi,{open:L,onOpenChange:te,children:s.jsxs(Ue,{className:y?"rounded-md border shadow-none":"border-dashed",children:[s.jsxs(St,{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:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[!y&&s.jsx(Us,{asChild:!0,children:s.jsx(re,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",children:s.jsx(Dt,{className:`h-3.5 w-3.5 transition-transform ${L?"rotate-0":"-rotate-90"}`})})}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[n+1,"."]}),s.jsx(Nt,{className:"truncate text-sm font-medium",children:e.name||`Scenario ${n+1}`})]}),y?s.jsxs("div",{className:"flex items-center gap-2",children:[t&&s.jsx(Qe,{variant:t==="inline"?"secondary":"outline",children:t==="referenced"?"Referenced":"Inline"}),s.jsx(Us,{asChild:!0,children:s.jsx(re,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8","aria-label":L?"Collapse scenario details":"Expand scenario details",children:s.jsx(Dt,{className:`h-4 w-4 transition-transform ${L?"rotate-180":""}`})})})]}):S&&s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsxs(re,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>B(!0),title:a.length===0?"Add at least one agent in the config":e.serverIds.length===0?"Select at least one server for this scenario":"Open Scenario Assistant",children:[s.jsx(ya,{className:"h-3.5 w-3.5"}),"Ask Assistant"]}),s.jsx(re,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:g,disabled:n===0,"aria-label":"Move scenario up",children:s.jsx(fs,{className:"h-3.5 w-3.5"})}),s.jsx(re,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:j,disabled:n===r-1,"aria-label":"Move scenario down",children:s.jsx(Dt,{className:"h-3.5 w-3.5"})}),s.jsx(re,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:b,children:s.jsx(Aa,{className:"h-3.5 w-3.5 text-destructive"})})]})]}),s.jsx($i,{children:s.jsxs(qe,{className:"space-y-3",children:[s.jsx(ime,{open:ee,onOpenChange:B,configId:o,configPath:c,scenario:e,agents:a,servers:i,snapshotEval:p,defaultAssistantAgentName:d,initialUserMessage:f,onApplyPatch:ue=>x({...ue.prompt!==void 0?{prompt:ue.prompt}:{},...ue.evalRules!==void 0?{evalRules:ue.evalRules}:{},...ue.extractRules!==void 0?{extractRules:ue.extractRules}:{},...ue.snapshotEval!==void 0?{snapshotEval:{...e.snapshotEval??{},...ue.snapshotEval}}:{}})}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Name"}),s.jsx(ft,{value:e.name,onChange:ue=>x({name:ue.target.value}),disabled:y,placeholder:"e.g. List directory"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Servers"}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[i.map(ue=>s.jsx(Qe,{variant:e.serverIds.includes(ue.id)?"default":"outline",className:`cursor-pointer text-xs ${e.serverIds.includes(ue.id)?"":"opacity-50"}`,onClick:()=>!y&&ce(ue.id),children:ue.name||ue.id},ue.id)),i.length===0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:"Add servers above first"})]})]}),s.jsxs(Ue,{className:"border bg-card",children:[s.jsxs(St,{className:"pb-2",children:[s.jsx(Nt,{className:"text-sm",children:"Prompt"}),s.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."})]}),s.jsx(qe,{className:"pt-0",children:s.jsx(Wa,{value:e.prompt,onChange:ue=>x({prompt:ue.target.value}),disabled:y,placeholder:"The prompt to send to the agent...",rows:4,className:"text-xs"})})]}),s.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[s.jsxs(Ue,{className:"border bg-muted/20",children:[s.jsx(St,{className:"pb-2",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx(Nt,{className:"text-sm",children:"Checks"}),s.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&&s.jsxs(re,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>B(!0),title:"Ask for help improving checks",children:[s.jsx(ya,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})]})}),s.jsx(qe,{className:"space-y-2",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx(Fe,{className:"text-xs",children:"Checks (pass / fail)"}),s.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."}),s.jsx("div",{className:"space-y-1.5",children:e.evalRules.length===0?s.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((ue,Oe)=>s.jsxs("div",{className:"flex items-start justify-between gap-2 rounded-md border bg-background px-2 py-2 text-xs",children:[s.jsx("div",{className:"min-w-0",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:`rounded-full border px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide ${fe[ue.type]}`,children:le[ue.type]}),s.jsx("span",{className:"font-mono break-all",children:ue.value})]})}),!y&&s.jsx(re,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>G(Oe),"aria-label":`Remove check ${Oe+1}`,children:s.jsx(ys,{className:"h-3.5 w-3.5"})})]},Oe))}),!y&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex gap-2 items-end",children:[s.jsxs(bn,{value:E,onValueChange:ue=>_(ue),children:[s.jsx(mn,{className:"h-8 w-[14.5rem] shrink-0 text-xs",children:s.jsx(wn,{})}),s.jsxs(vn,{children:[s.jsx(mt,{value:"required_tool",children:"Required Tool"}),s.jsx(mt,{value:"forbidden_tool",children:"Forbidden Tool"}),s.jsx(mt,{value:"response_contains",children:"Text matches pattern"}),s.jsx(mt,{value:"response_not_contains",children:"Text must not match"})]})]}),s.jsx(ft,{value:P,onChange:ue=>O(ue.target.value),placeholder:"Value",className:"h-8 text-xs font-mono",onKeyDown:ue=>ue.key==="Enter"&&(ue.preventDefault(),ie())}),s.jsx(re,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:ie,children:"Add"})]}),Ce&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx(Fe,{className:"mb-1 block text-[11px] text-muted-foreground",children:"Pick from selected server tools (optional)"}),s.jsxs(bn,{value:T,onValueChange:ue=>{I(ue),O(ue)},disabled:R||!M||M.length===0,children:[s.jsx(mn,{className:"h-8 text-xs",children:s.jsx(wn,{placeholder:R?"Loading tools...":M&&M.length>0?"Select tool to insert in value field":"Load tools first"})}),s.jsx(vn,{children:(M??[]).map(ue=>s.jsx(mt,{value:ue,children:ue},ue))})]})]}),s.jsx(re,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:xe,disabled:!ke||R,children:R?"Loading...":M?"Refresh tools":"Load tools"})]}),!ke&&s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Select at least one server in this scenario to load tool names."}),U&&s.jsxs("p",{className:"text-[11px] text-destructive",children:["Could not load tools: ",U]})]})]})]})})]}),s.jsxs(Ue,{className:"border bg-muted/10",children:[s.jsx(St,{className:"pb-2",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx(Nt,{className:"text-sm",children:"Value Capture Rules"}),s.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&&s.jsxs(re,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>B(!0),title:"Ask for help improving value capture rules",children:[s.jsx(ya,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})]})}),s.jsx(qe,{className:"space-y-2",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx(Fe,{className:"text-xs",children:"Value Capture Rules"}),s.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."}),s.jsx("div",{className:"space-y-1.5",children:e.extractRules.length===0?s.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((ue,Oe)=>s.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border bg-background px-2 py-2 text-xs",children:[s.jsx("div",{className:"min-w-0",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.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:ue.name}),s.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground",children:"regex:"}),s.jsx("code",{className:"font-mono break-all text-foreground",children:ue.pattern})]})}),!y&&s.jsx(re,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>oe(Oe),"aria-label":`Remove value capture rule ${Oe+1}`,children:s.jsx(ys,{className:"h-3.5 w-3.5"})})]},Oe))}),!y&&s.jsxs("div",{className:"flex gap-2 items-end",children:[s.jsx(ft,{value:J,onChange:ue=>Z(ue.target.value),placeholder:"Field name",className:"h-8 text-xs w-36"}),s.jsx(ft,{value:F,onChange:ue=>z(ue.target.value),placeholder:"Regex pattern",className:"h-8 text-xs font-mono",onKeyDown:ue=>ue.key==="Enter"&&(ue.preventDefault(),de())}),s.jsx(re,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:de,children:"Add"})]})]})})]})]}),N&&s.jsxs(Ue,{className:"border bg-amber-50/40",children:[s.jsxs(St,{className:"pb-2",children:[s.jsx(Nt,{className:"text-sm",children:"Snapshot Evaluation"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Per-scenario toggle for config baseline drift checks."})]}),s.jsxs(qe,{className:"space-y-2 text-xs text-muted-foreground",children:[s.jsxs("div",{className:"flex items-center justify-between rounded-md border bg-white/60 px-2 py-1.5",children:[s.jsx("span",{children:"Enabled for this scenario"}),s.jsx(Fm,{checked:e.snapshotEval?.enabled!==!1,disabled:y,onCheckedChange:ue=>x({snapshotEval:{...e.snapshotEval??{},enabled:ue}})})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center justify-between rounded-md border bg-white/60 px-2 py-1.5",children:[s.jsx("span",{children:"Use config baseline"}),s.jsx(Fm,{checked:!Ae,disabled:y,onCheckedChange:ue=>{if(ue){x({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:void 0}});return}x({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:e.snapshotEval?.baselineSnapshotId??""}})}})]}),Ae&&s.jsx(ft,{value:e.snapshotEval?.baselineSnapshotId??"",onChange:ue=>x({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:ue.target.value}}),disabled:y,placeholder:"Override baseline snapshot id",className:"h-8 text-xs font-mono"})]}),s.jsxs("p",{children:["Effective baseline snapshot:"," ",s.jsx("span",{className:"font-mono",children:e.snapshotEval?.baselineSnapshotId||p?.baselineSnapshotId||"Not configured"})]}),s.jsxs("p",{children:["Policy:"," ",s.jsx("span",{className:"font-mono",children:p?.mode??"warn"})," · config-level switch"," ",s.jsx("span",{className:"font-mono",children:p?.enabled?"on":"off"})]})]})]})]})})]})})}function Rz(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 pme=()=>({id:`cfg-${Date.now()}`,name:"",configName:"",description:"",servers:[],serverEntries:[],agents:[],agentEntries:[],scenarios:[],scenarioEntries:[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),jM=()=>{const{id:e,tab:t}=Zo(),n=Ea(),[r,a]=Yi(),{getConfig:i,addConfig:o,updateConfig:c,loading:d}=Nf(),{source:f}=Rn(),h=xg("snapshots",!1),{servers:p,agents:x,scenarios:g}=Ga(),j=e==="new",b=!j&&!!e,y=b?i(e):void 0,[S,C]=v.useState(j),[N,E]=v.useState(()=>y?structuredClone(y):pme()),[_,P]=v.useState([]),[O,T]=v.useState(""),[I,M]=v.useState(""),[D,R]=v.useState(""),[q,U]=v.useState(null),[H,J]=v.useState(!1),[Z,F]=v.useState(!1),[z,ee]=v.useState(""),[B,L]=v.useState(""),[te,ie]=v.useState({}),[G,de]=v.useState({}),[oe,ce]=v.useState({}),le=v.useMemo(()=>{const K=t||r.get("tab");return K==="agents"||K==="scenarios"?K:"scenarios"},[t,r]);v.useEffect(()=>{y&&!S&&E(structuredClone(y))},[y,S]),v.useEffect(()=>{let K=!0;return f.listSnapshots().then(ge=>{K&&P(ge)}).catch(()=>{K&&P([])}),()=>{K=!1}},[f]),v.useEffect(()=>{if(!O.trim()){U(null);return}let K=!0;return f.getResult(O.trim()).then(ge=>{if(!K)return;if(!ge){U(!1);return}const Ve=ge.overallPassRate===1&&ge.scenarios.every(ct=>ct.runs.every(Ot=>Ot.passed));U(Ve)}).catch(()=>{K&&U(!1)}),()=>{K=!1}},[O,f]);const fe=K=>E(ge=>({...ge,...K})),Ce=v.useMemo(()=>N.serverEntries&&N.serverEntries.length>0?N.serverEntries:(N.servers??[]).map(K=>({kind:"inline",server:K})),[N.serverEntries,N.servers]),ae=v.useMemo(()=>N.scenarioEntries&&N.scenarioEntries.length>0?N.scenarioEntries:N.scenarios.map(K=>({kind:"inline",scenario:K})),[N.scenarioEntries,N.scenarios]),ke=K=>{fe({scenarioEntries:K,scenarios:K.filter(ge=>ge.kind==="inline").map(ge=>ge.scenario)})},Ae=v.useMemo(()=>N.agentEntries&&N.agentEntries.length>0?N.agentEntries:N.agents.map(K=>({kind:"inline",agent:K})),[N.agentEntries,N.agents]),Ye=K=>{fe({agentEntries:K,agents:K.filter(ge=>ge.kind==="inline").map(ge=>ge.agent)})},be=!S,Re=N.runDefaults?.selectedAgentNames??[],Y=async K=>{if(!N.id||be===!1){fe({snapshotEval:{enabled:K.enabled,mode:K.mode,baselineSnapshotId:K.baselineSnapshotId,baselineSourceRunId:K.baselineSourceRunId,lastUpdatedAt:new Date().toISOString()}});return}J(!0);try{const ge=await f.updateSnapshotPolicy(N.id,K);E(ge),Pe({title:"Snapshot policy updated"})}catch(ge){Pe({title:"Could not update snapshot policy",description:ge instanceof Error?ge.message:String(ge),variant:"destructive"})}finally{J(!1)}},xe=async()=>{if(!(!N.id||!O.trim())){F(!0);try{const K=await f.generateSnapshotEvalBaseline(O.trim(),N.id,I.trim()||void 0);E(K.config),R(K.snapshot.id),P(ge=>[K.snapshot,...ge.filter(Ve=>Ve.id!==K.snapshot.id)]),Pe({title:"Snapshot baseline generated",description:`${K.snapshot.name} (${K.snapshot.id})`})}catch(K){Pe({title:"Could not generate baseline",description:K instanceof Error?K.message:String(K),variant:"destructive"})}finally{F(!1)}}},ue=async()=>{if(!N.name.trim()){Pe({title:"Validation Error",description:"Config ID is required.",variant:"destructive"});return}const K=Ce.map(He=>He.kind==="referenced"?{kind:"referenced",ref:p.find(Ft=>Ft.id===He.ref)?.id||He.ref}:He),ge=Ae.map(He=>He.kind==="referenced"?{kind:"referenced",ref:x.find(Ft=>Ft.id===He.ref)?.id||He.ref}:He),Ve=ae.map(He=>He.kind==="referenced"?{kind:"referenced",ref:g.find(Ft=>Ft.id===He.ref)?.id||He.ref}:He),ct=K.filter(He=>He.kind==="inline").map(He=>({server:He.server,error:Rz(He.server)})).find(He=>!!He.error);if(ct?.error){Pe({title:"Validation Error",description:ct.error,variant:"destructive"});return}if(Ve.filter(He=>He.kind==="inline").some(He=>!He.scenario.name?.trim())){Pe({title:"Validation Error",description:"Inline scenarios must have a name before saving.",variant:"destructive"});return}const Mt=new Set(ge.map(He=>He.kind==="inline"?He.agent.id:He.ref)),Tt=(N.runDefaults?.selectedAgentNames??[]).filter(He=>Mt.has(He)),Pn={...N,serverEntries:K,servers:K.filter(He=>He.kind==="inline").map(He=>He.server),agentEntries:ge,agents:ge.filter(He=>He.kind==="inline").map(He=>He.agent),scenarioEntries:Ve,scenarios:Ve.filter(He=>He.kind==="inline").map(He=>He.scenario),runDefaults:Tt.length>0?{...N.runDefaults??{},selectedAgentNames:Tt}:void 0,updatedAt:new Date().toISOString()};if(j){const He=await o(Pn);E(He);const Vt=He.configName?.trim()||He.name;Pe({title:"MCP Evaluation Created",description:`"${Vt}" has been saved.`}),n(`/mcp-evaluations/${He.id}`)}else{const He=await c(N.id,Pn);E(He);const Vt=He.configName?.trim()||He.name;Pe({title:"MCP Evaluation Updated",description:`"${Vt}" has been updated.`}),C(!1),He.id!==e&&n(`/mcp-evaluations/${He.id}`,{replace:!0})}},Oe=N.configName?.trim()||N.name,Ke=j?"New MCP Evaluation":S?`Editing: ${Oe}`:Oe,bt=j?"/mcp-evaluations/new":`/mcp-evaluations/${encodeURIComponent(N.id||e||"")}`,It=!!y?.loadError,Q=v.useMemo(()=>x.map(K=>({id:K.id,ref:K.id,label:K.name||K.id,model:K.model})).sort((K,ge)=>K.label.localeCompare(ge.label)),[x]),je=(K,ge)=>{const Ve=ge?Array.from(new Set([...Re,K])):Re.filter(ct=>ct!==K);fe({runDefaults:{...N.runDefaults??{},selectedAgentNames:Ve}})},Ne=K=>{const ge=new Set([...Ae.filter(Mt=>Mt.kind==="inline").map(Mt=>Mt.agent.name||Mt.agent.id),...x.map(Mt=>Mt.name||Mt.id)]),Ve=`${K}-custom`;let ct=Ve,Ot=2;for(;ge.has(ct);)ct=`${Ve}-${Ot}`,Ot+=1;return ct},$e=()=>{const ge={id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096};Ye([{kind:"inline",agent:ge},...Ae]),ie(Ve=>({...Ve,[ge.id]:!0}))},Be=()=>{const K=x.find(ct=>ct.id===B);if(!K)return;const ge=K.id;new Set(Ae.filter(ct=>ct.kind==="referenced").map(ct=>ct.ref)).has(ge)||Ye([...Ae,{kind:"referenced",ref:ge}]),L("")},et=()=>{const K=new Set(Ae.filter(Ve=>Ve.kind==="referenced").map(Ve=>Ve.ref)),ge=x.filter(Ve=>!K.has(Ve.id)).map(Ve=>({kind:"referenced",ref:Ve.id}));ge.length>0&&Ye([...Ae,...ge])},Pt=()=>{const K=x.find(Ot=>Ot.id===B);if(!K)return;const ge=K.name||K.id,Ve=Ne(ge),ct={...structuredClone(K),id:`agt-${Date.now()}`,name:Ve};Ye([...Ae,{kind:"inline",agent:ct}]),ie(Ot=>({...Ot,[ct.id]:!0})),L(""),Pe({title:"Imported agent as inline",description:Ve})},Sn=K=>{const ge=Ae[K];if(!ge)return;const Ve=ge.kind==="inline"?ge.agent.id:ge.ref,ct=Re.filter(Ot=>Ot!==Ve);fe({runDefaults:{...N.runDefaults??{},selectedAgentNames:ct}}),ge.kind==="inline"&&ie(Ot=>{const Mt={...Ot};return delete Mt[ge.agent.id],Mt}),Ye(Ae.filter((Ot,Mt)=>Mt!==K))},Nn=(K,ge)=>{const Ve=K+ge;if(Ve<0||Ve>=Ae.length)return;const ct=[...Ae],[Ot]=ct.splice(K,1);ct.splice(Ve,0,Ot),Ye(ct)},cr=K=>{const ge=Ae[K];if(!ge||ge.kind!=="referenced")return;const Ve=Xt(ge.ref);if(!Ve){Pe({title:"Referenced agent not found",variant:"destructive"});return}const ct=Ve.name||Ve.id,Ot=Ne(ct),Mt={...structuredClone(Ve),id:`agt-${Date.now()}`,name:Ot},Tt=[...Ae];if(Tt[K]={kind:"inline",agent:Mt},Ye(Tt),Re.includes(ge.ref)){const Pn=Re.map(He=>He===ge.ref?Mt.id:He);fe({runDefaults:{...N.runDefaults??{},selectedAgentNames:Array.from(new Set(Pn))}})}ie(Pn=>({...Pn,[Mt.id]:!0})),Pe({title:"Referenced agent converted to inline",description:Ot})},ur=()=>{const K=g.find(Ve=>Ve.id===z);if(!K)return;const ge={...structuredClone(K),id:`scn-${Date.now()}`,serverIds:[...K.serverIds]};ke([...ae,{kind:"inline",scenario:ge}]),ce(Ve=>({...Ve,[ge.id]:!0})),ee("")},Dn=()=>{const ge={id:`scn-${Date.now()}`,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};ke([{kind:"inline",scenario:ge},...ae]),ce(Ve=>({...Ve,[ge.id]:!0}))},dr=()=>{const K=g.find(ct=>ct.id===z);if(!K)return;const ge=K.id;new Set(ae.filter(ct=>ct.kind==="referenced").map(ct=>ct.ref)).has(ge)||ke([...ae,{kind:"referenced",ref:ge}]),ee("")},_r=K=>{const ge=ae[K];ge?.kind==="inline"&&ce(Ve=>{const ct={...Ve};return delete ct[ge.scenario.id],ct}),ke(ae.filter((Ve,ct)=>ct!==K))},Ur=(K,ge)=>{const Ve=K+ge;if(Ve<0||Ve>=ae.length)return;const ct=[...ae],[Ot]=ct.splice(K,1);ct.splice(Ve,0,Ot),ke(ct)},qr=K=>{const ge=ae[K];if(!ge||ge.kind!=="referenced")return;const Ve=En(ge.ref);if(!Ve){Pe({title:"Referenced scenario not found",variant:"destructive"});return}const ct=new Set(ae.filter(Ft=>Ft.kind==="inline").map(Ft=>Ft.scenario.name?.trim().toLowerCase()).filter(Boolean)),Ot=`${(Ve.name||Ve.id).trim()}-custom`;let Mt=Ot,Tt=2;for(;ct.has(Mt.toLowerCase());)Mt=`${Ot}-${Tt}`,Tt+=1;const Pn=Date.now(),He={...structuredClone(Ve),id:`scn-${Pn}`,name:Mt,serverIds:[...Ve.serverIds]},Vt=[...ae];Vt[K]={kind:"inline",scenario:He},ke(Vt),ce(Ft=>({...Ft,[He.id]:!0})),Pe({title:"Referenced scenario converted to inline",description:Mt})},Yn=K=>p.find(ge=>ge.id===K),Xt=K=>x.find(ge=>ge.id===K),En=K=>g.find(ge=>ge.id===K),pe=Ce.filter(K=>K.kind==="referenced").map(K=>K.ref),De=pe.map(Yn).filter(K=>!!K),st=Ae.filter(K=>K.kind==="referenced").map(K=>K.ref),yt=st.map(Xt).filter(K=>!!K);Ae.filter(K=>K.kind==="inline");const Lt=Ae.flatMap(K=>{if(K.kind==="referenced"){const ge=Xt(K.ref);return ge?[{agent:ge,origin:"referenced",ref:K.ref}]:[]}return[{agent:K.agent,origin:"inline",ref:void 0}]}),nn=ae.filter(K=>K.kind==="referenced").map(K=>K.ref),ln=ae.flatMap(K=>{if(K.kind==="referenced"){const ge=En(K.ref);return ge?[{scenario:ge,origin:"referenced"}]:[]}return[{scenario:K.scenario,origin:"inline"}]}),Xn=Array.from(new Map([...x,...N.agents,...yt].map(K=>[K.id,K])).values()),Cn=Array.from(new Map([...p,...N.servers??[],...De].map(K=>[K.id,K])).values()),rr=pe.filter(K=>!Yn(K)),fr=st.filter(K=>!Xt(K)),Wr=nn.filter(K=>!En(K));new Set(rr);const ci=new Set(Wr),ui=Ae.length,cl=ae.length;return v.useEffect(()=>{if(!B)return;x.some(ge=>ge.id===B)||L("")},[x,B]),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(re,{variant:"ghost",size:"icon",asChild:!0,className:"h-8 w-8",children:s.jsx(jt,{to:"/mcp-evaluations",children:s.jsx(Ro,{className:"h-4 w-4"})})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h1",{className:"text-2xl font-bold truncate",children:Ke}),s.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"})]}),s.jsxs("div",{className:"flex gap-2 shrink-0",children:[b&&!S&&s.jsx(re,{size:"sm",onClick:()=>C(!0),children:"Edit"}),b&&!S&&y&&!It&&s.jsx(re,{size:"sm",variant:"outline",asChild:!0,children:s.jsxs(jt,{to:`/run?configId=${encodeURIComponent(y.id)}`,children:[s.jsx(rc,{className:"mr-1.5 h-3.5 w-3.5"}),"Run MCP Evaluation"]})}),b&&!S&&It&&s.jsxs(Qe,{variant:"destructive",className:"py-1 px-3 text-xs",children:[s.jsx(wh,{className:"mr-1 h-3 w-3"}),"Broken config"]}),S&&s.jsxs(s.Fragment,{children:[!j&&s.jsx(re,{variant:"outline",size:"sm",onClick:()=>{E(structuredClone(y)),C(!1)},children:"Cancel"}),s.jsxs(re,{size:"sm",onClick:()=>{ue()},children:[s.jsx(K7,{className:"mr-1.5 h-3.5 w-3.5"}),"Save"]})]})]})]}),It&&!S&&s.jsx(Ue,{className:"border-destructive/40",children:s.jsxs(qe,{className:"pt-6 space-y-3",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(wh,{className:"mt-0.5 h-5 w-5 text-destructive"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold",children:"This configuration is broken"}),s.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."})]})]}),s.jsxs("div",{className:"rounded-md border bg-muted/20 p-3",children:[s.jsx("p",{className:"text-xs font-medium mb-1",children:"File"}),s.jsx("p",{className:"text-xs font-mono break-all",children:y?.sourcePath||y?.description})]}),s.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3",children:[s.jsx("p",{className:"text-xs font-medium mb-1 text-destructive",children:"Load Error"}),s.jsx("p",{className:"text-xs break-all text-destructive",children:y?.loadError})]}),(rr.length>0||fr.length>0||Wr.length>0)&&s.jsxs("div",{className:"rounded-md border border-destructive/30 bg-background p-3 space-y-1.5",children:[s.jsx("p",{className:"text-xs font-medium",children:"Broken references"}),rr.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Servers: ",s.jsx("span",{className:"text-destructive",children:rr.join(", ")})]}),fr.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Agents: ",s.jsx("span",{className:"text-destructive",children:fr.join(", ")})]}),Wr.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Scenarios: ",s.jsx("span",{className:"text-destructive",children:Wr.join(", ")})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Valid items still render below. Only the missing references are marked as broken."})]})}),!It&&(N.loadWarnings?.length??0)>0&&s.jsx(Ue,{className:"border-amber-500/30",children:s.jsxs(qe,{className:"pt-4 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-amber-700 dark:text-amber-300",children:[s.jsx(wh,{className:"h-4 w-4"}),"Migration warnings"]}),N.loadWarnings?.map((K,ge)=>s.jsx("p",{className:"text-xs text-muted-foreground",children:K},`${K}-${ge}`))]})}),s.jsxs("div",{className:"flex gap-4",children:[s.jsx(Qe,{variant:le==="scenarios"?"default":"outline",className:"py-1 px-3 text-xs",children:s.jsxs(jt,{to:`${bt}/scenarios`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[s.jsx(EE,{className:"h-3 w-3"}),cl," scenario",cl!==1?"s":""]})}),s.jsx(Qe,{variant:le==="agents"?"default":"outline",className:"py-1 px-3 text-xs",children:s.jsxs(jt,{to:`${bt}/agents`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[s.jsx(wa,{className:"h-3 w-3"}),ui," agent",ui!==1?"s":""]})})]}),s.jsx(Ue,{children:s.jsx(qe,{className:"pt-6 space-y-3",children:s.jsxs("div",{className:`grid gap-4 ${be||!j?"sm:grid-cols-2":"sm:grid-cols-3"}`,children:[!be&&j&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Config ID"}),s.jsx(ft,{value:N.name,onChange:K=>fe({name:K.target.value}),disabled:be,placeholder:"e.g. check-weather"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Name (optional)"}),s.jsx(ft,{value:N.configName||"",onChange:K=>fe({configName:K.target.value}),disabled:be,placeholder:"e.g. Weather checks baseline"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Description"}),s.jsx(ft,{value:N.description||"",onChange:K=>fe({description:K.target.value}),disabled:be,placeholder:"Brief description..."})]})]})})}),h&&s.jsx(Ue,{children:s.jsxs(qe,{className:"pt-6 space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-semibold",children:"Snapshot Evaluation"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Config baseline versioning. One active baseline is selected; scenarios can opt in/out below."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Fe,{className:"text-xs",children:"Enable snapshot baseline"}),s.jsx(Fm,{checked:N.snapshotEval?.enabled??!1,disabled:H,onCheckedChange:K=>{const ge=N.snapshotEval;Y({enabled:K,mode:ge?.mode??"warn",baselineSnapshotId:ge?.baselineSnapshotId,baselineSourceRunId:ge?.baselineSourceRunId})}})]})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Drift mode"}),s.jsxs(bn,{value:N.snapshotEval?.mode??"warn",onValueChange:K=>{const ge=N.snapshotEval;Y({enabled:ge?.enabled??!1,mode:K,baselineSnapshotId:ge?.baselineSnapshotId,baselineSourceRunId:ge?.baselineSourceRunId})},children:[s.jsx(mn,{className:"h-8",children:s.jsx(wn,{})}),s.jsxs(vn,{children:[s.jsx(mt,{value:"warn",children:"Warn"}),s.jsx(mt,{value:"fail_on_drift",children:"Fail on drift"})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Active baseline"}),s.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&&s.jsxs("div",{className:"grid gap-2 rounded-md border bg-muted/20 p-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Generate baseline from passing run"}),s.jsx(ft,{value:O,onChange:K=>T(K.target.value),placeholder:"Run id (e.g. 20260208-140213)",className:"h-8 font-mono text-xs"}),q===!1&&s.jsx("p",{className:"text-[11px] text-destructive",children:"Run is missing or not fully passing."})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Snapshot name (optional)"}),s.jsx(ft,{value:I,onChange:K=>M(K.target.value),placeholder:"e.g. config-baseline-v1",className:"h-8 text-xs"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Switch baseline"}),s.jsxs(bn,{value:D||N.snapshotEval?.baselineSnapshotId||"",onValueChange:K=>{R(K),Y({enabled:N.snapshotEval?.enabled??!0,mode:N.snapshotEval?.mode??"warn",baselineSnapshotId:K||void 0,baselineSourceRunId:N.snapshotEval?.baselineSourceRunId})},children:[s.jsx(mn,{className:"h-8",children:s.jsx(wn,{placeholder:"Select snapshot"})}),s.jsx(vn,{children:_.map(K=>s.jsx(mt,{value:K.id,children:K.name},K.id))})]})]}),s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsx(re,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:()=>{xe()},disabled:Z||!O.trim()||q!==!0,children:Z?"Generating...":"Generate Baseline"}),s.jsx(re,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:()=>{Y({enabled:N.snapshotEval?.enabled??!1,mode:N.snapshotEval?.mode??"warn",baselineSnapshotId:void 0,baselineSourceRunId:void 0})},disabled:H,children:"Clear Baseline"})]})]})]})}),s.jsxs(dg,{value:le,onValueChange:K=>{if(K!=="servers"&&K!=="agents"&&K!=="scenarios")return;const ge=new URLSearchParams(r);if(ge.delete("tab"),a(ge,{replace:!0}),e&&e!=="new"){n(`/mcp-evaluations/${encodeURIComponent(e)}/${K}`,{replace:!0});return}n(`/mcp-evaluations/${e??"new"}/${K}`,{replace:!0})},className:"space-y-4",children:[s.jsxs(Df,{children:[s.jsxs(gs,{value:"scenarios",className:"gap-1.5",children:[s.jsx(EE,{className:"h-3.5 w-3.5"}),"Scenarios"]}),s.jsxs(gs,{value:"agents",className:"gap-1.5",children:[s.jsx(wa,{className:"h-3.5 w-3.5"}),"Agents"]})]}),s.jsxs(ff,{value:"agents",children:[!be&&s.jsx(Ue,{className:"mb-4",children:s.jsxs(qe,{className:"pt-4 space-y-3",children:[s.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",children:[s.jsxs(bn,{value:B,onValueChange:L,children:[s.jsx(mn,{className:"h-8",children:s.jsx(wn,{placeholder:"Select agent from library"})}),s.jsx(vn,{children:Q.map(K=>s.jsx(mt,{value:K.id,children:K.label},K.id))})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(re,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!B,onClick:Be,children:"Add Ref"}),s.jsx(re,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!B,onClick:Pt,children:"Import Inline"}),s.jsx(re,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:x.length===0||x.every(K=>Ae.some(ge=>ge.kind==="referenced"&&ge.ref===K.id)),onClick:et,children:"Add All Refs"}),s.jsx(re,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:$e,children:"Add agent"})]})]}),s.jsxs("div",{className:"space-y-2",children:[Ae.map((K,ge)=>{const Ve=K.kind==="referenced"?Xt(K.ref):null,ct=K.kind==="inline"?K.agent.name?.trim()||K.agent.id:Ve?.name||K.ref,Ot=K.kind==="inline"?K.agent.model:Ve?.model||"unknown",Mt=K.kind==="inline"?K.agent.id:K.ref,Tt=K.kind==="referenced"&&!Ve,Pn=K.kind==="inline"?K.agent.id:K.ref,He=Re.includes(Pn),Vt=K.kind==="inline"&&!!te[K.agent.id];return s.jsxs("div",{className:"rounded-md border text-sm",children:[s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(re,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>Nn(ge,-1),disabled:ge===0,"aria-label":"Move agent up",children:s.jsx(fs,{className:"h-3 w-3"})}),s.jsx(re,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>Nn(ge,1),disabled:ge===Ae.length-1,"aria-label":"Move agent down",children:s.jsx(Dt,{className:"h-3 w-3"})})]}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[ge+1,"."]}),s.jsx("span",{className:"truncate font-medium",children:ct}),s.jsx(Qe,{variant:K.kind==="inline"?"secondary":"outline",children:K.kind==="inline"?"Inline":"Referenced"}),s.jsx(Qe,{variant:"outline",className:"font-mono text-[10px]",children:Ot}),He&&s.jsx(Qe,{variant:"outline",className:"text-xs border-emerald-300 text-emerald-700 bg-emerald-50",children:"Default"}),Tt&&s.jsx(Qe,{variant:"destructive",children:"Missing"})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsxs("label",{className:"mx-2 flex items-center gap-1.5 text-xs text-muted-foreground",children:[s.jsx("input",{type:"checkbox",checked:He,onChange:Ft=>je(Pn,Ft.target.checked)}),s.jsx("span",{children:"Default"})]}),K.kind==="inline"&&s.jsx(re,{type:"button",size:"sm",variant:"outline",onClick:()=>ie(Ft=>({...Ft,[K.agent.id]:!Ft[K.agent.id]})),children:Vt?"Collapse":"Expand"}),K.kind==="referenced"&&s.jsx(s.Fragment,{children:s.jsx(re,{type:"button",size:"sm",variant:"outline",onClick:()=>cr(ge),disabled:Tt,children:"Convert to inline"})}),s.jsx(re,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>Sn(ge),"aria-label":"Remove agent entry",children:s.jsx(Aa,{className:"h-3.5 w-3.5"})})]})]}),K.kind==="inline"&&Vt&&s.jsxs("div",{className:"border-t px-3 py-3 space-y-3",children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Name"}),s.jsx(ft,{value:K.agent.name,onChange:Ft=>{const kn=[...Ae];kn[ge]={kind:"inline",agent:{...K.agent,name:Ft.target.value}},Ye(kn)},placeholder:"e.g. GPT-5 Mini custom"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Provider"}),s.jsxs(bn,{value:K.agent.provider,onValueChange:Ft=>{const kn=[...Ae];kn[ge]={kind:"inline",agent:{...K.agent,provider:Ft}},Ye(kn)},children:[s.jsx(mn,{children:s.jsx(wn,{})}),s.jsxs(vn,{children:[s.jsx(mt,{value:"openai",children:"OpenAI"}),s.jsx(mt,{value:"anthropic",children:"Anthropic"}),s.jsx(mt,{value:"azure",children:"Azure OpenAI"}),s.jsx(mt,{value:"google",children:"Google"}),s.jsx(mt,{value:"custom",children:"Custom"})]})]})]})]}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Model"}),s.jsx(ft,{value:K.agent.model,onChange:Ft=>{const kn=[...Ae];kn[ge]={kind:"inline",agent:{...K.agent,model:Ft.target.value}},Ye(kn)},className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Max Tokens"}),s.jsx(ft,{type:"number",min:1,max:128e3,value:K.agent.maxTokens,onChange:Ft=>{const kn=[...Ae];kn[ge]={kind:"inline",agent:{...K.agent,maxTokens:parseInt(Ft.target.value)||0}},Ye(kn)},className:"font-mono text-xs"})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Temperature"}),s.jsx(ft,{type:"number",min:0,max:2,step:.01,value:K.agent.temperature,onChange:Ft=>{const kn=[...Ae];kn[ge]={kind:"inline",agent:{...K.agent,temperature:Number(Ft.target.value)||0}},Ye(kn)},className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"System Prompt"}),s.jsx(Wa,{value:K.agent.systemPrompt||"",onChange:Ft=>{const kn=[...Ae];kn[ge]={kind:"inline",agent:{...K.agent,systemPrompt:Ft.target.value}},Ye(kn)},rows:3,className:"text-xs"})]})]})]},`agent-entry-${ge}-${Mt}`)}),Ae.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents configured yet. Add inline agents or references."})]}),fr.length>0&&s.jsxs("p",{className:"text-xs text-destructive",children:["Missing agent refs: ",fr.join(", ")]})]})}),be?s.jsx(Ue,{children:s.jsx(qe,{className:"pt-4",children:s.jsxs("div",{className:"space-y-2",children:[Lt.map((K,ge)=>{const Ve=K.agent.name||K.agent.id,ct=Re.includes(K.origin==="inline"?K.agent.id:K.ref||K.agent.id),Ot=K.ref??K.agent.id,Mt=!!G[Ot];return s.jsxs("div",{className:"rounded-md border p-3",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsxs("span",{className:"text-xs text-muted-foreground",children:[ge+1,"."]}),s.jsx("div",{className:"truncate font-medium text-sm",children:Ve})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[ct&&s.jsx(Qe,{variant:"outline",className:"text-xs border-emerald-300 text-emerald-700 bg-emerald-50",children:"Default"}),s.jsx(Qe,{variant:K.origin==="inline"?"secondary":"outline",children:K.origin==="inline"?"Inline":"Referenced"}),s.jsx(re,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8",onClick:()=>de(Tt=>({...Tt,[Ot]:!Tt[Ot]})),"aria-label":Mt?"Collapse agent details":"Expand agent details",children:s.jsx(Dt,{className:`h-4 w-4 transition-transform ${Mt?"rotate-180":""}`})})]})]}),Mt&&s.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 border-t pt-2",children:[s.jsx(AB,{provider:K.agent.provider}),s.jsx(Qe,{variant:"outline",className:"text-xs font-mono",children:K.agent.model}),s.jsxs(Qe,{variant:"outline",className:"text-xs font-mono",children:["max_tokens: ",K.agent.maxTokens]}),s.jsxs(Qe,{variant:"outline",className:"text-xs font-mono",children:["temperature: ",K.agent.temperature]})]})]},`agent-view-${ge}-${K.ref??K.agent.id}`)}),Lt.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No agents configured."})]})})}):null]}),s.jsxs(ff,{value:"scenarios",children:[!be&&s.jsx(Ue,{className:"mb-4",children:s.jsxs(qe,{className:"pt-4 space-y-3",children:[s.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",children:[s.jsxs(bn,{value:z,onValueChange:ee,children:[s.jsx(mn,{className:"h-8",children:s.jsx(wn,{placeholder:"Select scenario from library"})}),s.jsx(vn,{children:[...g].sort((K,ge)=>(K.name||K.id).localeCompare(ge.name||ge.id)).map(K=>s.jsx(mt,{value:K.id,children:K.name||K.id},K.id))})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(re,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!z,onClick:dr,children:"Add Ref"}),s.jsx(re,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!z,onClick:ur,children:"Import Inline"}),s.jsx(re,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:Dn,children:"Add scenario"})]})]}),s.jsxs("div",{className:"space-y-2",children:[ae.map((K,ge)=>{const Ve=K.kind==="referenced"?En(K.ref):null,ct=K.kind==="inline"?K.scenario.name?.trim()||K.scenario.id:Ve?.name||K.ref,Ot=K.kind==="inline"&&!K.scenario.name?.trim(),Mt=K.kind==="referenced"&&ci.has(K.ref),Tt=K.kind==="inline"&&!!oe[K.scenario.id];return s.jsxs("div",{className:"rounded-md border text-sm",children:[s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(re,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>Ur(ge,-1),disabled:ge===0,"aria-label":"Move scenario up",children:s.jsx(fs,{className:"h-3 w-3"})}),s.jsx(re,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>Ur(ge,1),disabled:ge===ae.length-1,"aria-label":"Move scenario down",children:s.jsx(Dt,{className:"h-3 w-3"})})]}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[ge+1,"."]}),s.jsx("span",{className:"truncate font-medium",children:ct}),s.jsx(Qe,{variant:K.kind==="inline"?"secondary":"outline",children:K.kind==="inline"?"Inline":"Referenced"}),Ot&&s.jsx(Qe,{variant:"destructive",children:"Name required"}),Mt&&s.jsx(Qe,{variant:"destructive",children:"Missing"})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[K.kind==="inline"&&s.jsx(re,{type:"button",size:"icon",variant:"outline",className:"h-7 w-7",onClick:()=>ce(Pn=>({...Pn,[K.scenario.id]:!Pn[K.scenario.id]})),"aria-label":Tt?"Collapse scenario details":"Expand scenario details",children:s.jsx(Dt,{className:`h-3.5 w-3.5 transition-transform ${Tt?"rotate-180":""}`})}),K.kind==="referenced"&&s.jsx(s.Fragment,{children:s.jsx(re,{type:"button",size:"sm",variant:"outline",onClick:()=>qr(ge),disabled:Mt,children:"Convert to inline"})}),s.jsx(re,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>_r(ge),"aria-label":"Remove scenario entry",children:s.jsx(Aa,{className:"h-3.5 w-3.5"})})]})]}),K.kind==="inline"&&Tt&&s.jsx("div",{className:"border-t px-3 py-3",children:s.jsx($S,{scenarios:[K.scenario],scenarioOrigins:["inline"],agents:[...N.agents,...yt],servers:[...N.servers??[],...De],configId:N.id,configPath:N.sourcePath,defaultAssistantAgentName:N.runDefaults?.selectedAgentNames?.[0],snapshotEval:N.snapshotEval,onChange:Pn=>{const He=Pn[0];if(!He)return;const Vt=[...ae];Vt[ge]={kind:"inline",scenario:He},ke(Vt)},readOnly:!1,allowAdd:!1,allowStructureEdits:!1})})]},`scenario-entry-${ge}-${K.kind==="inline"?K.scenario.id:K.ref}`)}),ae.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No scenarios configured yet. Add inline scenarios or references."})]}),Wr.length>0&&s.jsxs("p",{className:"text-xs text-destructive",children:["Missing scenario refs: ",Wr.join(", ")]})]})}),be?s.jsx(Ue,{children:s.jsx(qe,{className:"pt-4",children:s.jsx($S,{scenarios:ln.map(K=>K.scenario),scenarioOrigins:ln.map(K=>K.origin),agents:Xn,servers:Cn,configId:N.id,configPath:N.sourcePath,defaultAssistantAgentName:N.runDefaults?.selectedAgentNames?.[0],snapshotEval:N.snapshotEval,onChange:()=>{},readOnly:!0})})}):null]})]})]})};var hme=Symbol("radix.slottable");function mme(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=hme,t}var Iz="AlertDialog",[vme]=lr(Iz,[QD]),li=QD(),Mz=e=>{const{__scopeAlertDialog:t,...n}=e,r=li(t);return s.jsx(gv,{...r,...n,modal:!0})};Mz.displayName=Iz;var gme="AlertDialogTrigger",xme=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=li(n);return s.jsx(eG,{...a,...r,ref:t})});xme.displayName=gme;var yme="AlertDialogPortal",$z=e=>{const{__scopeAlertDialog:t,...n}=e,r=li(t);return s.jsx(xv,{...r,...n})};$z.displayName=yme;var bme="AlertDialogOverlay",Dz=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=li(n);return s.jsx(eu,{...a,...r,ref:t})});Dz.displayName=bme;var uc="AlertDialogContent",[wme,jme]=vme(uc),Sme=mme("AlertDialogContent"),Lz=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...a}=e,i=li(n),o=v.useRef(null),c=vt(t,o),d=v.useRef(null);return s.jsx(XK,{contentName:uc,titleName:Fz,docsSlug:"alert-dialog",children:s.jsx(wme,{scope:n,cancelRef:d,children:s.jsxs(tu,{role:"alertdialog",...i,...a,ref:c,onOpenAutoFocus:Te(a.onOpenAutoFocus,f=>{f.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[s.jsx(Sme,{children:r}),s.jsx(Cme,{contentRef:o})]})})})});Lz.displayName=uc;var Fz="AlertDialogTitle",Bz=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=li(n);return s.jsx(wf,{...a,...r,ref:t})});Bz.displayName=Fz;var zz="AlertDialogDescription",Uz=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=li(n);return s.jsx(jf,{...a,...r,ref:t})});Uz.displayName=zz;var Nme="AlertDialogAction",qz=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=li(n);return s.jsx(yv,{...a,...r,ref:t})});qz.displayName=Nme;var Wz="AlertDialogCancel",Vz=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=jme(Wz,n),i=li(n),o=vt(t,a);return s.jsx(yv,{...i,...r,ref:o})});Vz.displayName=Wz;var Cme=({contentRef:e})=>{const t=`\`${uc}\` requires a description for the component to be accessible for screen reader users.
125
-
126
- You can add a description to the \`${uc}\` by passing a \`${zz}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
127
-
128
- 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 \`${uc}\`. 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.
129
-
130
- For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return v.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Ame=Mz,_me=$z,Hz=Dz,Kz=Lz,Gz=qz,Yz=Vz,Xz=Bz,Qz=Uz;const Ps=Ame,Eme=_me,Jz=v.forwardRef(({className:e,...t},n)=>s.jsx(Hz,{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}));Jz.displayName=Hz.displayName;const Xa=v.forwardRef(({className:e,...t},n)=>s.jsxs(Eme,{children:[s.jsx(Jz,{}),s.jsx(Kz,{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})]}));Xa.displayName=Kz.displayName;const Qa=({className:e,...t})=>s.jsx("div",{className:Se("flex flex-col space-y-2 text-center sm:text-left",e),...t});Qa.displayName="AlertDialogHeader";const Ja=({className:e,...t})=>s.jsx("div",{className:Se("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Ja.displayName="AlertDialogFooter";const Za=v.forwardRef(({className:e,...t},n)=>s.jsx(Xz,{ref:n,className:Se("text-lg font-semibold",e),...t}));Za.displayName=Xz.displayName;const es=v.forwardRef(({className:e,...t},n)=>s.jsx(Qz,{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));es.displayName=Qz.displayName;const ts=v.forwardRef(({className:e,...t},n)=>s.jsx(Gz,{ref:n,className:Se(hN(),e),...t}));ts.displayName=Gz.displayName;const ns=v.forwardRef(({className:e,...t},n)=>s.jsx(Yz,{ref:n,className:Se(hN({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));ns.displayName=Yz.displayName;const Pme=()=>{const{servers:e,setServers:t,reload:n,loading:r}=Ga(),a=Ea(),[i,o]=v.useState(null),[c,d]=v.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]),Pe({title:"Server duplicated",description:`Created ${S}.`})},x=async b=>{await t(e.filter(y=>y.id!==b.id)),Pe({title:"Server deleted",description:`${h(b)} was removed.`}),o(null)},g=b=>b.transport==="stdio"?[b.command,...b.args||[]].filter(Boolean).join(" "):b.url||"",j=v.useMemo(()=>f.length===0?e:e.filter(b=>[h(b),b.id,b.transport,g(b),b.authType??""].join(" ").toLowerCase().includes(f)),[e,f]);return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(j$,{className:"h-6 w-6"}),"Servers"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Reusable MCP server definitions shared across configurations."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(xC,{value:c,onValueChange:d,placeholder:"Search servers..."}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{n()},disabled:r,children:[s.jsx(Ca,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(re,{type:"button",size:"sm",onClick:()=>a("/libraries/servers/new"),children:[s.jsx(xs,{className:"mr-2 h-4 w-4"}),"Add Server"]})]})]}),e.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed py-16 text-center",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"No servers configured. Add one to get started."}),s.jsxs(re,{type:"button",size:"sm",className:"mt-4",onClick:()=>a("/libraries/servers/new"),children:[s.jsx(xs,{className:"mr-2 h-4 w-4"}),"Add Server"]})]}):j.length===0?s.jsx("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed py-12 text-center",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:"No servers match this filter."})}):s.jsx(Ue,{children:s.jsx(qe,{className:"p-0",children:s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs($t,{children:[s.jsx(tt,{children:"Name"}),s.jsx(tt,{children:"Transport"}),s.jsx(tt,{children:"Endpoint"}),s.jsx(tt,{children:"Auth"}),s.jsx(tt,{className:"text-right",children:"Actions"})]})}),s.jsx(Lr,{children:j.map(b=>s.jsxs($t,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>a(`/libraries/servers/${encodeURIComponent(b.id)}`),children:[s.jsx(ze,{className:"font-medium",children:h(b)}),s.jsx(ze,{children:s.jsx(Qe,{variant:"secondary",className:"font-mono text-xs",children:b.transport})}),s.jsx(ze,{children:s.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:g(b)})}),s.jsx(ze,{children:!b.authType||b.authType==="none"?s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"}):s.jsx(Qe,{variant:"outline",className:"text-xs",children:b.authType})}),s.jsx(ze,{className:"text-right",onClick:y=>y.stopPropagation(),children:s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsxs(re,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>o(b),children:[s.jsx(Aa,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{p(b)},children:[s.jsx(Ui,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>a(`/libraries/servers/${encodeURIComponent(b.id)}`),children:[s.jsx(Ym,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})]})})]},b.id))})]})})}),s.jsx(Ps,{open:!!i,onOpenChange:b=>!b&&o(null),children:s.jsxs(Xa,{children:[s.jsxs(Qa,{children:[s.jsx(Za,{children:"Delete server?"}),s.jsxs(es,{children:["This will permanently remove"," ",s.jsx("span",{className:"font-mono",children:i?h(i):""})," from the library. This action cannot be undone."]})]}),s.jsxs(Ja,{children:[s.jsx(ns,{children:"Cancel"}),s.jsx(ts,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{i&&x(i)},children:"Delete Server"})]})]})})]})},SM={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"},kme=()=>({id:`srv-${Date.now()}`,name:"",transport:"stdio",authType:"none",oauthRedirectUrl:"http://localhost:6274/oauth/"}),Ome=()=>{const{serverId:e}=Zo(),t=Ea(),{servers:n,setServers:r}=Ga(),{source:a}=Rn(),i=e==="new",o=e?decodeURIComponent(e):"",c=i?null:n.find(T=>T.id===o||T.name===o),d=T=>T.name?.trim()||T.id,[f,h]=v.useState(()=>c??kme()),[p,x]=v.useState(!1),[g,j]=v.useState(!1),[b,y]=v.useState({status:"idle"}),[S,C]=v.useState(!1);v.useEffect(()=>{c&&h(c)},[c]);const N=T=>{h(I=>({...I,authType:T,...T!=="bearer"&&T!=="api-key"?{authValue:void 0}:{},...T!=="api-key"?{apiKeyHeaderName:void 0}:{apiKeyHeaderName:I.apiKeyHeaderName||"X-API-Key"},...T!=="oauth2"?{oauthClientId:void 0,oauthClientSecret:void 0,oauthRedirectUrl:void 0,oauthScope:void 0}:{oauthRedirectUrl:I.oauthRedirectUrl||"http://localhost:6274/oauth/"}}))},E=async()=>{C(!0),y({status:"loading"});try{const I=(await a.discoverToolsForAnalysis({serverNames:[f.id]})).servers[0];I&&I.warnings.length===0?y({status:"success",toolNames:I.tools.map(M=>M.name),toolCount:I.tools.length,testedAt:new Date().toISOString()}):y({status:"error",message:I?.warnings[0]??"Connection failed",testedAt:new Date().toISOString()})}catch(T){y({status:"error",message:T instanceof Error?T.message:String(T),testedAt:new Date().toISOString()})}},_=async()=>{if(!f.name.trim()){Pe({title:"Name is required",variant:"destructive"});return}const T=Rz(f);if(T){Pe({title:"Validation Error",description:T,variant:"destructive"});return}const I={...f,authValue:f.authValue?.trim(),apiKeyHeaderName:f.apiKeyHeaderName?.trim()||void 0};j(!0);try{if(i)await r([...n,I]),Pe({title:"Server created"}),t(`/libraries/servers/${encodeURIComponent(I.id)}`);else{const M=n.map(D=>D.id===c?.id?I:D);await r(M),Pe({title:"Server saved"}),I.id!==o&&t(`/libraries/servers/${encodeURIComponent(I.id)}`,{replace:!0})}}finally{j(!1)}},P=async()=>{const T=n.filter(I=>I.id!==c?.id);await r(T),Pe({title:"Server deleted"}),t("/libraries/servers")},O=()=>f.transport==="stdio"?[f.command,...f.args||[]].filter(Boolean).join(" "):f.url||"";return!i&&!c?s.jsxs("div",{className:"space-y-4",children:[s.jsxs(jt,{to:"/libraries/servers",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(Ro,{className:"h-4 w-4"})," Servers"]}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:['Server "',o,'" not found.']})]}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsxs(jt,{to:"/libraries/servers",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(Ro,{className:"h-4 w-4"})," Servers"]}),s.jsx("h1",{className:"text-2xl font-bold",children:i?"New Server":d(f)})]}),!i&&s.jsxs(re,{type:"button",onClick:()=>{E()},children:[s.jsx(O$,{className:"mr-2 h-4 w-4"}),"Test Connection"]})]}),S&&s.jsxs(Ue,{children:[s.jsxs(St,{className:"flex-row items-center justify-between space-y-0",children:[s.jsx(Nt,{className:"text-base",children:"Connection Test"}),s.jsx("button",{type:"button",onClick:()=>C(!1),className:"rounded-sm opacity-70 hover:opacity-100",children:s.jsx(ys,{className:"h-4 w-4"})})]}),s.jsxs(qe,{className:"space-y-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground",children:[s.jsx("span",{children:"Server:"}),s.jsx("span",{className:"font-medium text-foreground",children:d(f)}),s.jsx("span",{className:"mx-1",children:"·"}),s.jsx("span",{children:"Transport:"}),s.jsx("span",{className:"font-medium text-foreground",children:f.transport}),O()&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"mx-1",children:"·"}),s.jsx("span",{children:"Endpoint:"}),s.jsx("code",{className:"font-mono text-xs",children:O()})]})]}),b.status==="loading"&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(or,{className:"h-4 w-4 animate-spin"}),"Connecting to MCP server…"]}),b.status==="success"&&s.jsxs("div",{className:"space-y-3",children:[s.jsxs("p",{className:"flex items-center gap-2 text-sm text-emerald-700",children:[s.jsx(hc,{className:"h-4 w-4 shrink-0"}),"Connected — discovered ",b.toolCount," tool",b.toolCount!==1?"s":""]}),b.toolNames.length>0&&s.jsxs("div",{className:"rounded-md bg-muted p-3",children:[s.jsx("p",{className:"mb-1 text-xs font-medium text-muted-foreground",children:"First 5 tools:"}),s.jsx("ul",{className:"space-y-0.5",children:b.toolNames.slice(0,5).map(T=>s.jsx("li",{className:"font-mono text-xs",children:T},T))})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(b.testedAt).toLocaleString()]})]}),b.status==="error"&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("p",{className:"text-sm text-destructive",children:[s.jsx("span",{className:"font-medium",children:"✗ Connection failed"})," — ",b.message]}),SM[f.transport]&&s.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:["Hint: ",SM[f.transport]]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(b.testedAt).toLocaleString()]})]})]})]}),s.jsxs(Ue,{children:[s.jsx(St,{children:s.jsx(Nt,{className:"text-base",children:"Configuration"})}),s.jsxs(qe,{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:"Name"}),s.jsx(ft,{value:f.name,onChange:T=>h(I=>({...I,name:T.target.value})),placeholder:"e.g. Filesystem MCP"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:"Transport"}),s.jsxs(bn,{value:f.transport,onValueChange:T=>h(I=>({...I,transport:T})),children:[s.jsx(mn,{children:s.jsx(wn,{})}),s.jsxs(vn,{children:[s.jsx(mt,{value:"stdio",children:"stdio"}),s.jsx(mt,{value:"sse",children:"SSE"}),s.jsx(mt,{value:"streamable-http",children:"Streamable HTTP"})]})]})]})]}),f.transport==="stdio"?s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:"Command"}),s.jsx(ft,{value:f.command||"",onChange:T=>h(I=>({...I,command:T.target.value})),placeholder:"npx",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:"Args (comma-separated)"}),s.jsx(ft,{value:(f.args||[]).join(", "),onChange:T=>h(I=>({...I,args:T.target.value.split(",").map(M=>M.trim()).filter(Boolean)})),placeholder:"-y, @mcp/server",className:"font-mono text-xs"})]})]}):s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:"URL"}),s.jsx(ft,{value:f.url||"",onChange:T=>h(I=>({...I,url:T.target.value})),placeholder:"http://localhost:3001/sse",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:"Auth Type"}),s.jsxs(bn,{value:f.authType||"none",onValueChange:T=>N(T),children:[s.jsx(mn,{children:s.jsx(wn,{})}),s.jsxs(vn,{children:[s.jsx(mt,{value:"none",children:"None"}),s.jsx(mt,{value:"bearer",children:"Bearer Token"}),s.jsx(mt,{value:"api-key",children:"API Key"}),s.jsx(mt,{value:"oauth2",children:"OAuth 2.0"})]})]})]}),f.authType==="bearer"&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:"Token"}),s.jsx(ft,{value:f.authValue||"",onChange:T=>h(I=>({...I,authValue:T.target.value})),placeholder:"${DATABRICKS_TOKEN}",className:"font-mono text-xs"})]})]}),f.authType==="bearer"&&s.jsxs("p",{className:"text-xs text-muted-foreground -mt-1",children:["Use ",s.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"&&s.jsxs("div",{className:"space-y-3 rounded-md border p-3",children:[s.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:"API Key"}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Header Name"}),s.jsx(ft,{value:f.apiKeyHeaderName||"X-API-Key",onChange:T=>h(I=>({...I,apiKeyHeaderName:T.target.value})),placeholder:"X-API-Key",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Value"}),s.jsx(ft,{value:f.authValue||"",onChange:T=>h(I=>({...I,authValue:T.target.value})),placeholder:"${MY_API_KEY}",className:"font-mono text-xs"})]})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Use ",s.jsx("code",{className:"rounded bg-muted px-1",children:"${VAR_NAME}"})," to reference an environment variable, or enter a value directly."]})]}),f.authType==="oauth2"&&s.jsxs("div",{className:"space-y-3 rounded-md border p-3",children:[s.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:"OAuth 2.0 Flow"}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Client ID"}),s.jsx(ft,{value:f.oauthClientId||"",onChange:T=>h(I=>({...I,oauthClientId:T.target.value})),placeholder:"your-client-id",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Client Secret (optional)"}),s.jsx(ft,{type:"password",value:f.oauthClientSecret||"",onChange:T=>h(I=>({...I,oauthClientSecret:T.target.value})),placeholder:"••••••••",className:"font-mono text-xs"})]})]}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Redirect URL"}),s.jsx(ft,{value:f.oauthRedirectUrl||"http://localhost:6274/oauth/",onChange:T=>h(I=>({...I,oauthRedirectUrl:T.target.value})),placeholder:"http://localhost:6274/oauth/",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Scope (space-separated)"}),s.jsx(ft,{value:f.oauthScope||"",onChange:T=>h(I=>({...I,oauthScope:T.target.value})),placeholder:"openid profile mcp",className:"font-mono text-xs"})]})]})]}),s.jsxs("div",{className:"flex items-center justify-between pt-2",children:[s.jsx("div",{children:!i&&s.jsx(re,{type:"button",variant:"destructive",size:"sm",onClick:()=>x(!0),children:"Delete"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(re,{type:"button",variant:"outline",size:"sm",onClick:()=>t("/libraries/servers"),children:"Cancel"}),s.jsxs(re,{type:"button",size:"sm",onClick:()=>{_()},disabled:g,children:[g&&s.jsx(or,{className:"mr-2 h-4 w-4 animate-spin"}),i?"Create Server":"Save"]})]})]})]})]}),s.jsx(Ps,{open:p,onOpenChange:x,children:s.jsxs(Xa,{children:[s.jsxs(Qa,{children:[s.jsx(Za,{children:"Delete server?"}),s.jsxs(es,{children:["This will permanently remove the server"," ",s.jsx("span",{className:"font-mono",children:f.name}),". This action cannot be undone."]})]}),s.jsxs(Ja,{children:[s.jsx(ns,{children:"Cancel"}),s.jsx(ts,{onClick:()=>{P()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},Tme=()=>{const{agents:e,setAgents:t,reload:n,loading:r}=Ga(),a=Ea(),[i,o]=v.useState(null),[c,d]=v.useState(""),f=c.trim().toLowerCase(),h=v.useMemo(()=>f.length===0?e:e.filter(g=>{const j=g.name.toLowerCase(),b=g.model.toLowerCase();return j.includes(f)||b.includes(f)}),[e,f]),p=async g=>{const j=`${g.name}-copy`;let b=j,y=1;for(;e.some(C=>C.name===b);)b=`${j}-${y}`,y+=1;const S={...structuredClone(g),id:`agt-${Date.now()}`,name:b};await t([...e,S]),Pe({title:"Agent duplicated",description:`Created ${b}.`})},x=async g=>{await t(e.filter(j=>j.id!==g.id)),Pe({title:"Agent deleted",description:`${g.name} was removed.`}),o(null)};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(wa,{className:"h-6 w-6"}),"Agents"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Reusable agent profiles shared across configurations."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(xC,{value:c,onValueChange:d,placeholder:"Search agents..."}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{n()},disabled:r,children:[s.jsx(Ca,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(re,{type:"button",size:"sm",onClick:()=>a("/libraries/agents/new"),children:[s.jsx(xs,{className:"mr-2 h-4 w-4"}),"Add Agent"]})]})]}),e.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed py-16 text-center",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents configured. Add one to get started."}),s.jsxs(re,{type:"button",size:"sm",className:"mt-4",onClick:()=>a("/libraries/agents/new"),children:[s.jsx(xs,{className:"mr-2 h-4 w-4"}),"Add Agent"]})]}):h.length===0?s.jsx("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed py-12 text-center",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents match this filter."})}):s.jsx(Ue,{children:s.jsx(qe,{className:"p-0",children:s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs($t,{children:[s.jsx(tt,{children:"Name"}),s.jsx(tt,{children:"Provider"}),s.jsx(tt,{children:"Model"}),s.jsx(tt,{children:"Max Tokens"}),s.jsx(tt,{children:"Temperature"}),s.jsx(tt,{className:"text-right",children:"Actions"})]})}),s.jsx(Lr,{children:h.map(g=>s.jsxs($t,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>a(`/libraries/agents/${encodeURIComponent(g.id)}`),children:[s.jsx(ze,{className:"font-medium",children:g.name}),s.jsx(ze,{children:s.jsx(AB,{provider:g.provider})}),s.jsx(ze,{children:s.jsx("span",{className:"font-mono text-xs",children:g.model})}),s.jsx(ze,{className:"font-mono text-xs",children:g.maxTokens}),s.jsx(ze,{className:"font-mono text-xs",children:g.temperature.toFixed(2)}),s.jsx(ze,{className:"text-right",onClick:j=>j.stopPropagation(),children:s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsxs(re,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>o(g),children:[s.jsx(Aa,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{p(g)},children:[s.jsx(Ui,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>a(`/libraries/agents/${encodeURIComponent(g.id)}`),children:[s.jsx(Ym,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})]})})]},g.id))})]})})}),s.jsx(Ps,{open:!!i,onOpenChange:g=>!g&&o(null),children:s.jsxs(Xa,{children:[s.jsxs(Qa,{children:[s.jsx(Za,{children:"Delete agent?"}),s.jsxs(es,{children:["This will permanently remove"," ",s.jsx("span",{className:"font-mono",children:i?.name})," from the library. This action cannot be undone."]})]}),s.jsxs(Ja,{children:[s.jsx(ns,{children:"Cancel"}),s.jsx(ts,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{i&&x(i)},children:"Delete Agent"})]})]})})]})};var Zz=["PageUp","PageDown"],e8=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],t8={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},pu="Slider",[DS,Rme,Ime]=hf(pu),[n8]=lr(pu,[Ime]),[Mme,yg]=n8(pu),r8=v.forwardRef((e,t)=>{const{name:n,min:r=0,max:a=100,step:i=1,orientation:o="horizontal",disabled:c=!1,minStepsBetweenThumbs:d=0,defaultValue:f=[r],value:h,onValueChange:p=()=>{},onValueCommit:x=()=>{},inverted:g=!1,form:j,...b}=e,y=v.useRef(new Set),S=v.useRef(0),N=o==="horizontal"?$me:Dme,[E=[],_]=oa({prop:h,defaultProp:f,onChange:D=>{[...y.current][S.current]?.focus(),p(D)}}),P=v.useRef(E);function O(D){const R=Ume(E,D);M(D,R)}function T(D){M(D,S.current)}function I(){const D=P.current[S.current];E[S.current]!==D&&x(E)}function M(D,R,{commit:q}={commit:!1}){const U=Hme(i),H=Kme(Math.round((D-r)/i)*i+r,U),J=pf(H,[r,a]);_((Z=[])=>{const F=Bme(Z,J,R);if(Vme(F,d*i)){S.current=F.indexOf(J);const z=String(F)!==String(Z);return z&&q&&x(F),z?F:Z}else return Z})}return s.jsx(Mme,{scope:e.__scopeSlider,name:n,disabled:c,min:r,max:a,valueIndexToChangeRef:S,thumbs:y.current,values:E,orientation:o,form:j,children:s.jsx(DS.Provider,{scope:e.__scopeSlider,children:s.jsx(DS.Slot,{scope:e.__scopeSlider,children:s.jsx(N,{"aria-disabled":c,"data-disabled":c?"":void 0,...b,ref:t,onPointerDown:Te(b.onPointerDown,()=>{c||(P.current=E)}),min:r,max:a,inverted:g,onSlideStart:c?void 0:O,onSlideMove:c?void 0:T,onSlideEnd:c?void 0:I,onHomeKeyDown:()=>!c&&M(r,0,{commit:!0}),onEndKeyDown:()=>!c&&M(a,E.length-1,{commit:!0}),onStepKeyDown:({event:D,direction:R})=>{if(!c){const H=Zz.includes(D.key)||D.shiftKey&&e8.includes(D.key)?10:1,J=S.current,Z=E[J],F=i*H*R;M(Z+F,J,{commit:!0})}}})})})})});r8.displayName=pu;var[a8,s8]=n8(pu,{startEdge:"left",endEdge:"right",size:"width",direction:1}),$me=v.forwardRef((e,t)=>{const{min:n,max:r,dir:a,inverted:i,onSlideStart:o,onSlideMove:c,onSlideEnd:d,onStepKeyDown:f,...h}=e,[p,x]=v.useState(null),g=vt(t,N=>x(N)),j=v.useRef(void 0),b=cu(a),y=b==="ltr",S=y&&!i||!y&&i;function C(N){const E=j.current||p.getBoundingClientRect(),_=[0,E.width],O=DC(_,S?[n,r]:[r,n]);return j.current=E,O(N-E.left)}return s.jsx(a8,{scope:e.__scopeSlider,startEdge:S?"left":"right",endEdge:S?"right":"left",direction:S?1:-1,size:"width",children:s.jsx(i8,{dir:b,"data-orientation":"horizontal",...h,ref:g,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:N=>{const E=C(N.clientX);o?.(E)},onSlideMove:N=>{const E=C(N.clientX);c?.(E)},onSlideEnd:()=>{j.current=void 0,d?.()},onStepKeyDown:N=>{const _=t8[S?"from-left":"from-right"].includes(N.key);f?.({event:N,direction:_?-1:1})}})})}),Dme=v.forwardRef((e,t)=>{const{min:n,max:r,inverted:a,onSlideStart:i,onSlideMove:o,onSlideEnd:c,onStepKeyDown:d,...f}=e,h=v.useRef(null),p=vt(t,h),x=v.useRef(void 0),g=!a;function j(b){const y=x.current||h.current.getBoundingClientRect(),S=[0,y.height],N=DC(S,g?[r,n]:[n,r]);return x.current=y,N(b-y.top)}return s.jsx(a8,{scope:e.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:s.jsx(i8,{"data-orientation":"vertical",...f,ref:p,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:b=>{const y=j(b.clientY);i?.(y)},onSlideMove:b=>{const y=j(b.clientY);o?.(y)},onSlideEnd:()=>{x.current=void 0,c?.()},onStepKeyDown:b=>{const S=t8[g?"from-bottom":"from-top"].includes(b.key);d?.({event:b,direction:S?-1:1})}})})}),i8=v.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:a,onSlideEnd:i,onHomeKeyDown:o,onEndKeyDown:c,onStepKeyDown:d,...f}=e,h=yg(pu,n);return s.jsx(Ge.span,{...f,ref:t,onKeyDown:Te(e.onKeyDown,p=>{p.key==="Home"?(o(p),p.preventDefault()):p.key==="End"?(c(p),p.preventDefault()):Zz.concat(e8).includes(p.key)&&(d(p),p.preventDefault())}),onPointerDown:Te(e.onPointerDown,p=>{const x=p.target;x.setPointerCapture(p.pointerId),p.preventDefault(),h.thumbs.has(x)?x.focus():r(p)}),onPointerMove:Te(e.onPointerMove,p=>{p.target.hasPointerCapture(p.pointerId)&&a(p)}),onPointerUp:Te(e.onPointerUp,p=>{const x=p.target;x.hasPointerCapture(p.pointerId)&&(x.releasePointerCapture(p.pointerId),i(p))})})}),o8="SliderTrack",l8=v.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=yg(o8,n);return s.jsx(Ge.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...r,ref:t})});l8.displayName=o8;var LS="SliderRange",c8=v.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=yg(LS,n),i=s8(LS,n),o=v.useRef(null),c=vt(t,o),d=a.values.length,f=a.values.map(x=>f8(x,a.min,a.max)),h=d>1?Math.min(...f):0,p=100-Math.max(...f);return s.jsx(Ge.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,...r,ref:c,style:{...e.style,[i.startEdge]:h+"%",[i.endEdge]:p+"%"}})});c8.displayName=LS;var FS="SliderThumb",u8=v.forwardRef((e,t)=>{const n=Rme(e.__scopeSlider),[r,a]=v.useState(null),i=vt(t,c=>a(c)),o=v.useMemo(()=>r?n().findIndex(c=>c.ref.current===r):-1,[n,r]);return s.jsx(Lme,{...e,ref:i,index:o})}),Lme=v.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:a,...i}=e,o=yg(FS,n),c=s8(FS,n),[d,f]=v.useState(null),h=vt(t,C=>f(C)),p=d?o.form||!!d.closest("form"):!0,x=ev(d),g=o.values[r],j=g===void 0?0:f8(g,o.min,o.max),b=zme(r,o.values.length),y=x?.[c.size],S=y?qme(y,j,c.direction):0;return v.useEffect(()=>{if(d)return o.thumbs.add(d),()=>{o.thumbs.delete(d)}},[d,o.thumbs]),s.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${j}% + ${S}px)`},children:[s.jsx(DS.ItemSlot,{scope:e.__scopeSlider,children:s.jsx(Ge.span,{role:"slider","aria-label":e["aria-label"]||b,"aria-valuemin":o.min,"aria-valuenow":g,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...i,ref:h,style:g===void 0?{display:"none"}:e.style,onFocus:Te(e.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),p&&s.jsx(d8,{name:a??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:g},r)]})});u8.displayName=FS;var Fme="RadioBubbleInput",d8=v.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const a=v.useRef(null),i=vt(a,r),o=lg(t);return v.useEffect(()=>{const c=a.current;if(!c)return;const d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"value").set;if(o!==t&&h){const p=new Event("input",{bubbles:!0});h.call(c,t),c.dispatchEvent(p)}},[o,t]),s.jsx(Ge.input,{style:{display:"none"},...n,ref:i,defaultValue:t})});d8.displayName=Fme;function Bme(e=[],t,n){const r=[...e];return r[n]=t,r.sort((a,i)=>a-i)}function f8(e,t,n){const i=100/(n-t)*(e-t);return pf(i,[0,100])}function zme(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Ume(e,t){if(e.length===1)return 0;const n=e.map(a=>Math.abs(a-t)),r=Math.min(...n);return n.indexOf(r)}function qme(e,t,n){const r=e/2,i=DC([0,50],[0,r]);return(r-i(t)*n)*n}function Wme(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Vme(e,t){if(t>0){const n=Wme(e);return Math.min(...n)>=t}return!0}function DC(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 Hme(e){return(String(e).split(".")[1]||"").length}function Kme(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var p8=r8,Gme=l8,Yme=c8,Xme=u8;const h8=v.forwardRef(({className:e,...t},n)=>s.jsxs(p8,{ref:n,className:Se("relative flex w-full touch-none select-none items-center",e),...t,children:[s.jsx(Gme,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:s.jsx(Yme,{className:"absolute h-full bg-primary"})}),s.jsx(Xme,{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"})]}));h8.displayName=p8.displayName;function Qme(e){const t=Jme(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(eve);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function Jme(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=nve(a),c=tve(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Cr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Zme=Symbol("radix.slottable");function eve(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Zme}function tve(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function nve(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 bg="Popover",[m8]=lr(bg,[Gi]),Lf=Gi(),[rve,ro]=m8(bg),v8=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:o=!1}=e,c=Lf(t),d=v.useRef(null),[f,h]=v.useState(!1),[p,x]=oa({prop:r,defaultProp:a??!1,onChange:i,caller:bg});return s.jsx(tv,{...c,children:s.jsx(rve,{scope:t,contentId:Vn(),triggerRef:d,open:p,onOpenChange:x,onOpenToggle:v.useCallback(()=>x(g=>!g),[x]),hasCustomAnchor:f,onCustomAnchorAdd:v.useCallback(()=>h(!0),[]),onCustomAnchorRemove:v.useCallback(()=>h(!1),[]),modal:o,children:n})})};v8.displayName=bg;var g8="PopoverAnchor",ave=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=ro(g8,n),i=Lf(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:c}=a;return v.useEffect(()=>(o(),()=>c()),[o,c]),s.jsx(xf,{...i,...r,ref:t})});ave.displayName=g8;var x8="PopoverTrigger",y8=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=ro(x8,n),i=Lf(n),o=vt(t,a.triggerRef),c=s.jsx(Ge.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":N8(a.open),...r,ref:o,onClick:Te(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:s.jsx(xf,{asChild:!0,...i,children:c})});y8.displayName=x8;var LC="PopoverPortal",[sve,ive]=m8(LC,{forceMount:void 0}),b8=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=ro(LC,t);return s.jsx(sve,{scope:t,forceMount:n,children:s.jsx(Kn,{present:n||i.open,children:s.jsx(Gc,{asChild:!0,container:a,children:r})})})};b8.displayName=LC;var Wc="PopoverContent",w8=v.forwardRef((e,t)=>{const n=ive(Wc,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,i=ro(Wc,e.__scopePopover);return s.jsx(Kn,{present:r||i.open,children:i.modal?s.jsx(lve,{...a,ref:t}):s.jsx(cve,{...a,ref:t})})});w8.displayName=Wc;var ove=Qme("PopoverContent.RemoveScroll"),lve=v.forwardRef((e,t)=>{const n=ro(Wc,e.__scopePopover),r=v.useRef(null),a=vt(t,r),i=v.useRef(!1);return v.useEffect(()=>{const o=r.current;if(o)return mv(o)},[]),s.jsx(bf,{as:ove,allowPinchZoom:!0,children:s.jsx(j8,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Te(e.onCloseAutoFocus,o=>{o.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Te(e.onPointerDownOutside,o=>{const c=o.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,f=c.button===2||d;i.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:Te(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),cve=v.forwardRef((e,t)=>{const n=ro(Wc,e.__scopePopover),r=v.useRef(!1),a=v.useRef(!1);return s.jsx(j8,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;n.triggerRef.current?.contains(o)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),j8=v.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,...p}=e,x=ro(Wc,n),g=Lf(n);return pv(),s.jsx(yf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(Qo,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:h,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>x.onOpenChange(!1),children:s.jsx(nv,{"data-state":N8(x.open),role:"dialog",id:x.contentId,...g,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),S8="PopoverClose",uve=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=ro(S8,n);return s.jsx(Ge.button,{type:"button",...r,ref:t,onClick:Te(e.onClick,()=>a.onOpenChange(!1))})});uve.displayName=S8;var dve="PopoverArrow",fve=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Lf(n);return s.jsx(rv,{...a,...r,ref:t})});fve.displayName=dve;function N8(e){return e?"open":"closed"}var pve=v8,hve=y8,mve=b8,C8=w8;const Vc=pve,Hc=hve,Wo=v.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>s.jsx(mve,{children:s.jsx(C8,{ref:a,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})}));Wo.displayName=C8.displayName;var NM=1,vve=.9,gve=.8,xve=.17,Oj=.1,Tj=.999,yve=.9999,bve=.99,wve=/[\\\/_+.#"@\[\(\{&]/,jve=/[\\\/_+.#"@\[\(\{&]/g,Sve=/[\s-]/,A8=/[\s-]/g;function BS(e,t,n,r,a,i,o){if(i===t.length)return a===e.length?NM:bve;var c=`${a},${i}`;if(o[c]!==void 0)return o[c];for(var d=r.charAt(i),f=n.indexOf(d,a),h=0,p,x,g,j;f>=0;)p=BS(e,t,n,r,f+1,i+1,o),p>h&&(f===a?p*=NM:wve.test(e.charAt(f-1))?(p*=gve,g=e.slice(a,f-1).match(jve),g&&a>0&&(p*=Math.pow(Tj,g.length))):Sve.test(e.charAt(f-1))?(p*=vve,j=e.slice(a,f-1).match(A8),j&&a>0&&(p*=Math.pow(Tj,j.length))):(p*=xve,a>0&&(p*=Math.pow(Tj,f-a))),e.charAt(f)!==t.charAt(i)&&(p*=yve)),(p<Oj&&n.charAt(f-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(f-1)!==r.charAt(i))&&(x=BS(e,t,n,r,f+1,i+2,o),x*Oj>p&&(p=x*Oj)),p>h&&(h=p),f=n.indexOf(d,f+1);return o[c]=h,h}function CM(e){return e.toLowerCase().replace(A8," ")}function Nve(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,BS(e,t,CM(e),CM(t),0,0,{})}var sd='[cmdk-group=""]',Rj='[cmdk-group-items=""]',Cve='[cmdk-group-heading=""]',_8='[cmdk-item=""]',AM=`${_8}:not([aria-disabled="true"])`,zS="cmdk-item-select",Kl="data-value",Ave=(e,t,n)=>Nve(e,t,n),E8=v.createContext(void 0),Ff=()=>v.useContext(E8),P8=v.createContext(void 0),FC=()=>v.useContext(P8),k8=v.createContext(void 0),O8=v.forwardRef((e,t)=>{let n=Gl(()=>{var L,te;return{search:"",value:(te=(L=e.value)!=null?L:e.defaultValue)!=null?te:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Gl(()=>new Set),a=Gl(()=>new Map),i=Gl(()=>new Map),o=Gl(()=>new Set),c=T8(e),{label:d,children:f,value:h,onValueChange:p,filter:x,shouldFilter:g,loop:j,disablePointerSelection:b=!1,vimBindings:y=!0,...S}=e,C=Vn(),N=Vn(),E=Vn(),_=v.useRef(null),P=Dve();Vo(()=>{if(h!==void 0){let L=h.trim();n.current.value=L,O.emit()}},[h]),Vo(()=>{P(6,q)},[]);let O=v.useMemo(()=>({subscribe:L=>(o.current.add(L),()=>o.current.delete(L)),snapshot:()=>n.current,setState:(L,te,ie)=>{var G,de,oe,ce;if(!Object.is(n.current[L],te)){if(n.current[L]=te,L==="search")R(),M(),P(1,D);else if(L==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let le=document.getElementById(E);le?le.focus():(G=document.getElementById(C))==null||G.focus()}if(P(7,()=>{var le;n.current.selectedItemId=(le=U())==null?void 0:le.id,O.emit()}),ie||P(5,q),((de=c.current)==null?void 0:de.value)!==void 0){let le=te??"";(ce=(oe=c.current).onValueChange)==null||ce.call(oe,le);return}}O.emit()}},emit:()=>{o.current.forEach(L=>L())}}),[]),T=v.useMemo(()=>({value:(L,te,ie)=>{var G;te!==((G=i.current.get(L))==null?void 0:G.value)&&(i.current.set(L,{value:te,keywords:ie}),n.current.filtered.items.set(L,I(te,ie)),P(2,()=>{M(),O.emit()}))},item:(L,te)=>(r.current.add(L),te&&(a.current.has(te)?a.current.get(te).add(L):a.current.set(te,new Set([L]))),P(3,()=>{R(),M(),n.current.value||D(),O.emit()}),()=>{i.current.delete(L),r.current.delete(L),n.current.filtered.items.delete(L);let ie=U();P(4,()=>{R(),ie?.getAttribute("id")===L&&D(),O.emit()})}),group:L=>(a.current.has(L)||a.current.set(L,new Set),()=>{i.current.delete(L),a.current.delete(L)}),filter:()=>c.current.shouldFilter,label:d||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:C,inputId:E,labelId:N,listInnerRef:_}),[]);function I(L,te){var ie,G;let de=(G=(ie=c.current)==null?void 0:ie.filter)!=null?G:Ave;return L?de(L,n.current.search,te):0}function M(){if(!n.current.search||c.current.shouldFilter===!1)return;let L=n.current.filtered.items,te=[];n.current.filtered.groups.forEach(G=>{let de=a.current.get(G),oe=0;de.forEach(ce=>{let le=L.get(ce);oe=Math.max(le,oe)}),te.push([G,oe])});let ie=_.current;H().sort((G,de)=>{var oe,ce;let le=G.getAttribute("id"),fe=de.getAttribute("id");return((oe=L.get(fe))!=null?oe:0)-((ce=L.get(le))!=null?ce:0)}).forEach(G=>{let de=G.closest(Rj);de?de.appendChild(G.parentElement===de?G:G.closest(`${Rj} > *`)):ie.appendChild(G.parentElement===ie?G:G.closest(`${Rj} > *`))}),te.sort((G,de)=>de[1]-G[1]).forEach(G=>{var de;let oe=(de=_.current)==null?void 0:de.querySelector(`${sd}[${Kl}="${encodeURIComponent(G[0])}"]`);oe?.parentElement.appendChild(oe)})}function D(){let L=H().find(ie=>ie.getAttribute("aria-disabled")!=="true"),te=L?.getAttribute(Kl);O.setState("value",te||void 0)}function R(){var L,te,ie,G;if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let de=0;for(let oe of r.current){let ce=(te=(L=i.current.get(oe))==null?void 0:L.value)!=null?te:"",le=(G=(ie=i.current.get(oe))==null?void 0:ie.keywords)!=null?G:[],fe=I(ce,le);n.current.filtered.items.set(oe,fe),fe>0&&de++}for(let[oe,ce]of a.current)for(let le of ce)if(n.current.filtered.items.get(le)>0){n.current.filtered.groups.add(oe);break}n.current.filtered.count=de}function q(){var L,te,ie;let G=U();G&&(((L=G.parentElement)==null?void 0:L.firstChild)===G&&((ie=(te=G.closest(sd))==null?void 0:te.querySelector(Cve))==null||ie.scrollIntoView({block:"nearest"})),G.scrollIntoView({block:"nearest"}))}function U(){var L;return(L=_.current)==null?void 0:L.querySelector(`${_8}[aria-selected="true"]`)}function H(){var L;return Array.from(((L=_.current)==null?void 0:L.querySelectorAll(AM))||[])}function J(L){let te=H()[L];te&&O.setState("value",te.getAttribute(Kl))}function Z(L){var te;let ie=U(),G=H(),de=G.findIndex(ce=>ce===ie),oe=G[de+L];(te=c.current)!=null&&te.loop&&(oe=de+L<0?G[G.length-1]:de+L===G.length?G[0]:G[de+L]),oe&&O.setState("value",oe.getAttribute(Kl))}function F(L){let te=U(),ie=te?.closest(sd),G;for(;ie&&!G;)ie=L>0?Mve(ie,sd):$ve(ie,sd),G=ie?.querySelector(AM);G?O.setState("value",G.getAttribute(Kl)):Z(L)}let z=()=>J(H().length-1),ee=L=>{L.preventDefault(),L.metaKey?z():L.altKey?F(1):Z(1)},B=L=>{L.preventDefault(),L.metaKey?J(0):L.altKey?F(-1):Z(-1)};return v.createElement(Ge.div,{ref:t,tabIndex:-1,...S,"cmdk-root":"",onKeyDown:L=>{var te;(te=S.onKeyDown)==null||te.call(S,L);let ie=L.nativeEvent.isComposing||L.keyCode===229;if(!(L.defaultPrevented||ie))switch(L.key){case"n":case"j":{y&&L.ctrlKey&&ee(L);break}case"ArrowDown":{ee(L);break}case"p":case"k":{y&&L.ctrlKey&&B(L);break}case"ArrowUp":{B(L);break}case"Home":{L.preventDefault(),J(0);break}case"End":{L.preventDefault(),z();break}case"Enter":{L.preventDefault();let G=U();if(G){let de=new Event(zS);G.dispatchEvent(de)}}}}},v.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:Fve},d),wg(e,L=>v.createElement(P8.Provider,{value:O},v.createElement(E8.Provider,{value:T},L))))}),_ve=v.forwardRef((e,t)=>{var n,r;let a=Vn(),i=v.useRef(null),o=v.useContext(k8),c=Ff(),d=T8(e),f=(r=(n=d.current)==null?void 0:n.forceMount)!=null?r:o?.forceMount;Vo(()=>{if(!f)return c.item(a,o?.id)},[f]);let h=R8(a,i,[e.value,e.children,i],e.keywords),p=FC(),x=Ki(P=>P.value&&P.value===h.current),g=Ki(P=>f||c.filter()===!1?!0:P.search?P.filtered.items.get(a)>0:!0);v.useEffect(()=>{let P=i.current;if(!(!P||e.disabled))return P.addEventListener(zS,j),()=>P.removeEventListener(zS,j)},[g,e.onSelect,e.disabled]);function j(){var P,O;b(),(O=(P=d.current).onSelect)==null||O.call(P,h.current)}function b(){p.setState("value",h.current,!0)}if(!g)return null;let{disabled:y,value:S,onSelect:C,forceMount:N,keywords:E,..._}=e;return v.createElement(Ge.div,{ref:Cr(i,t),..._,id:a,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!x,"data-disabled":!!y,"data-selected":!!x,onPointerMove:y||c.getDisablePointerSelection()?void 0:b,onClick:y?void 0:j},e.children)}),Eve=v.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...i}=e,o=Vn(),c=v.useRef(null),d=v.useRef(null),f=Vn(),h=Ff(),p=Ki(g=>a||h.filter()===!1?!0:g.search?g.filtered.groups.has(o):!0);Vo(()=>h.group(o),[]),R8(o,c,[e.value,e.heading,d]);let x=v.useMemo(()=>({id:o,forceMount:a}),[a]);return v.createElement(Ge.div,{ref:Cr(c,t),...i,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},n&&v.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:f},n),wg(e,g=>v.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},v.createElement(k8.Provider,{value:x},g))))}),Pve=v.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=v.useRef(null),i=Ki(o=>!o.search);return!n&&!i?null:v.createElement(Ge.div,{ref:Cr(a,t),...r,"cmdk-separator":"",role:"separator"})}),kve=v.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,i=FC(),o=Ki(f=>f.search),c=Ki(f=>f.selectedItemId),d=Ff();return v.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),v.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:a?e.value:o,onChange:f=>{a||i.setState("search",f.target.value),n?.(f.target.value)}})}),Ove=v.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,i=v.useRef(null),o=v.useRef(null),c=Ki(f=>f.selectedItemId),d=Ff();return v.useEffect(()=>{if(o.current&&i.current){let f=o.current,h=i.current,p,x=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let g=f.offsetHeight;h.style.setProperty("--cmdk-list-height",g.toFixed(1)+"px")})});return x.observe(f),()=>{cancelAnimationFrame(p),x.unobserve(f)}}},[]),v.createElement(Ge.div,{ref:Cr(i,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:d.listId},wg(e,f=>v.createElement("div",{ref:Cr(o,d.listInnerRef),"cmdk-list-sizer":""},f)))}),Tve=v.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:i,container:o,...c}=e;return v.createElement(gv,{open:n,onOpenChange:r},v.createElement(xv,{container:o},v.createElement(eu,{"cmdk-overlay":"",className:a}),v.createElement(tu,{"aria-label":e.label,"cmdk-dialog":"",className:i},v.createElement(O8,{ref:t,...c}))))}),Rve=v.forwardRef((e,t)=>Ki(n=>n.filtered.count===0)?v.createElement(Ge.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Ive=v.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...i}=e;return v.createElement(Ge.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},wg(e,o=>v.createElement("div",{"aria-hidden":!0},o)))}),zr=Object.assign(O8,{List:Ove,Item:_ve,Input:kve,Group:Eve,Separator:Pve,Dialog:Tve,Empty:Rve,Loading:Ive});function Mve(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function $ve(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function T8(e){let t=v.useRef(e);return Vo(()=>{t.current=e}),t}var Vo=typeof window>"u"?v.useEffect:v.useLayoutEffect;function Gl(e){let t=v.useRef();return t.current===void 0&&(t.current=e()),t}function Ki(e){let t=FC(),n=()=>e(t.snapshot());return v.useSyncExternalStore(t.subscribe,n,n)}function R8(e,t,n,r=[]){let a=v.useRef(),i=Ff();return Vo(()=>{var o;let c=(()=>{var f;for(let h of n){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(f=h.current.textContent)==null?void 0:f.trim():a.current}})(),d=r.map(f=>f.trim());i.value(e,c,d),(o=t.current)==null||o.setAttribute(Kl,c),a.current=c}),a}var Dve=()=>{let[e,t]=v.useState(),n=Gl(()=>new Map);return Vo(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function Lve(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function wg({asChild:e,children:t},n){return e&&v.isValidElement(t)?v.cloneElement(Lve(t),{ref:t.ref},n(t.props.children)):n(t)}var Fve={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Ho=v.forwardRef(({className:e,...t},n)=>s.jsx(zr,{ref:n,className:Se("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Ho.displayName=zr.displayName;const Ko=v.forwardRef(({className:e,...t},n)=>s.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[s.jsx(YS,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),s.jsx(zr.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})]}));Ko.displayName=zr.Input.displayName;const Go=v.forwardRef(({className:e,...t},n)=>s.jsx(zr.List,{ref:n,className:Se("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));Go.displayName=zr.List.displayName;const Yo=v.forwardRef((e,t)=>s.jsx(zr.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Yo.displayName=zr.Empty.displayName;const Xo=v.forwardRef(({className:e,...t},n)=>s.jsx(zr.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}));Xo.displayName=zr.Group.displayName;const Bve=v.forwardRef(({className:e,...t},n)=>s.jsx(zr.Separator,{ref:n,className:Se("-mx-1 h-px bg-border",e),...t}));Bve.displayName=zr.Separator.displayName;const na=v.forwardRef(({className:e,...t},n)=>s.jsx(zr.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}));na.displayName=zr.Item.displayName;const _M={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:[]},EM={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"},zve=()=>({id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096}),Uve=()=>{const{agentName:e}=Zo(),t=Ea(),{agents:n,setAgents:r}=Ga(),{source:a}=Rn(),i=e==="new",o=e?decodeURIComponent(e):"",c=i?null:n.find(F=>F.id===o)??n.find(F=>F.name===o),[d,f]=v.useState(()=>c??zve()),[h,p]=v.useState(!1),[x,g]=v.useState(!1),[j,b]=v.useState({status:"idle"}),[y,S]=v.useState(!1),[C,N]=v.useState([]),[E,_]=v.useState(!1),[P,O]=v.useState(!1),[T,I]=v.useState(!1);v.useEffect(()=>{c&&f(c)},[c]);const M=d.provider==="anthropic"||d.provider==="openai"||d.provider==="azure",D=Array.from(new Set([..._M[d.provider]||[],...C])),R=D.includes(d.model),q=T||!!d.model&&!R,U=async()=>{if(S(!0),d.provider==="google"||d.provider==="custom"){b({status:"unsupported"});return}b({status:"loading"});try{const F=await a.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()})}},H=async()=>{if(!M){Pe({title:"Provider discovery not supported",description:"Model discovery is available for Anthropic, OpenAI, and Azure OpenAI."});return}_(!0);try{const F=await a.listProviderModels(d.provider);N(F.items),Pe({title:F.kind==="deployments"?"Deployments loaded":"Models loaded",description:`${F.items.length} ${F.kind} from ${F.source}`})}catch(F){Pe({title:"Could not load provider models",description:String(F instanceof Error?F.message:F),variant:"destructive"})}finally{_(!1)}},J=async()=>{if(!d.name.trim()){Pe({title:"Name is required",variant:"destructive"});return}g(!0);try{if(i)await r([...n,d]),Pe({title:"Agent created"}),t(`/libraries/agents/${encodeURIComponent(d.id)}`);else{const F=n.map(z=>z.id===c?.id?d:z);await r(F),Pe({title:"Agent saved"}),d.id!==o&&t(`/libraries/agents/${encodeURIComponent(d.id)}`,{replace:!0})}}finally{g(!1)}},Z=async()=>{const F=n.filter(z=>z.id!==c?.id);await r(F),Pe({title:"Agent deleted"}),t("/libraries/agents")};return!i&&!c?s.jsxs("div",{className:"space-y-4",children:[s.jsxs(jt,{to:"/libraries/agents",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(Ro,{className:"h-4 w-4"})," Agents"]}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:['Agent "',o,'" not found.']})]}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsxs(jt,{to:"/libraries/agents",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(Ro,{className:"h-4 w-4"})," Agents"]}),s.jsx("h1",{className:"text-2xl font-bold",children:i?"New Agent":d.name})]}),!i&&s.jsxs(re,{type:"button",onClick:()=>{U()},children:[s.jsx(O$,{className:"mr-2 h-4 w-4"}),"Test Connection"]})]}),y&&s.jsxs(Ue,{children:[s.jsxs(St,{className:"flex-row items-center justify-between space-y-0",children:[s.jsx(Nt,{className:"text-base",children:"Connection Test"}),s.jsx("button",{type:"button",onClick:()=>S(!1),className:"rounded-sm opacity-70 hover:opacity-100",children:s.jsx(ys,{className:"h-4 w-4"})})]}),s.jsxs(qe,{className:"space-y-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground",children:[s.jsx("span",{children:"Provider:"}),s.jsx("span",{className:"font-medium text-foreground",children:d.provider}),s.jsx("span",{className:"mx-1",children:"·"}),s.jsx("span",{children:"Endpoint:"}),s.jsxs("code",{className:"font-mono text-xs",children:["/api/providers/models?provider=",d.provider]})]}),j.status==="loading"&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(or,{className:"h-4 w-4 animate-spin"}),"Testing connection..."]}),j.status==="success"&&s.jsxs("div",{className:"space-y-3",children:[s.jsxs("p",{className:"flex items-center gap-2 text-sm text-emerald-700",children:[s.jsx(hc,{className:"h-4 w-4 shrink-0"}),"Connected — discovered ",j.items.length," ",j.kind," from"," ",j.source]}),s.jsxs("div",{className:"rounded-md bg-muted p-3",children:[s.jsxs("p",{className:"mb-1 text-xs font-medium text-muted-foreground",children:["First 5 ",j.kind,":"]}),s.jsx("ul",{className:"space-y-0.5",children:j.items.slice(0,5).map(F=>s.jsx("li",{className:"font-mono text-xs",children:F},F))})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(j.testedAt).toLocaleString()]})]}),j.status==="error"&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("p",{className:"text-sm text-destructive",children:[s.jsx("span",{className:"font-medium",children:"✗ Connection failed"})," —"," ",j.message]}),EM[d.provider]&&s.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:["Hint: ",EM[d.provider]]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(j.testedAt).toLocaleString()]})]}),j.status==="unsupported"&&s.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-sm text-muted-foreground",children:["Connection testing is not supported for the"," ",s.jsx("span",{className:"font-medium",children:d.provider})," provider. Supported providers: Anthropic, OpenAI, Azure OpenAI."]})]})]}),s.jsxs(Ue,{children:[s.jsx(St,{children:s.jsx(Nt,{className:"text-base",children:"Configuration"})}),s.jsxs(qe,{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:"Name"}),s.jsx(ft,{value:d.name,onChange:F=>f(z=>({...z,name:F.target.value})),placeholder:"e.g. GPT-4o"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:"Provider"}),s.jsxs(bn,{value:d.provider,onValueChange:F=>f(z=>({...z,provider:F,model:_M[F]?.[0]||""})),children:[s.jsx(mn,{children:s.jsx(wn,{})}),s.jsxs(vn,{children:[s.jsx(mt,{value:"openai",children:"OpenAI"}),s.jsx(mt,{value:"anthropic",children:"Anthropic"}),s.jsx(mt,{value:"azure",children:"Azure OpenAI"}),s.jsx(mt,{value:"google",children:"Google"}),s.jsx(mt,{value:"custom",children:"Custom"})]})]})]})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:d.provider==="azure"?"Deployment":"Model"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(Vc,{open:P,onOpenChange:O,children:[s.jsx(Hc,{asChild:!0,children:s.jsxs(re,{type:"button",variant:"outline",role:"combobox","aria-expanded":P,className:"h-9 flex-1 justify-between font-mono text-xs",children:[s.jsx("span",{className:"truncate text-left",children:d.model||"Select model..."}),s.jsx(Dt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(Wo,{className:"w-[420px] p-0",align:"start",children:s.jsxs(Ho,{children:[s.jsx(Ko,{placeholder:`Search ${d.provider==="azure"?"deployments":"models"}...`}),s.jsxs(Go,{children:[s.jsxs(Yo,{children:["No ",d.provider==="azure"?"deployments":"models"," found."]}),s.jsxs(Xo,{heading:d.provider==="azure"?"Deployments":"Models",children:[D.map(F=>s.jsxs(na,{value:F,onSelect:z=>{f(ee=>({...ee,model:z})),I(!1),O(!1)},children:[s.jsx(hc,{className:Se("mr-2 h-4 w-4",d.model===F?"opacity-100":"opacity-0")}),s.jsx("span",{className:"font-mono text-xs",children:F})]},F)),s.jsx(na,{value:"__custom_model_id__",onSelect:()=>{I(!0),O(!1)},children:s.jsx("span",{className:"font-medium",children:d.provider==="azure"?"Custom deployment ID...":"Custom model ID..."})})]})]})]})})]}),M&&s.jsxs(re,{type:"button",variant:"outline",size:"sm",className:"h-9 shrink-0 text-xs",onClick:()=>{H()},disabled:E,title:d.provider==="azure"?"Fetch Azure OpenAI deployments":`Fetch ${d.provider} models`,children:[E?s.jsx(or,{className:"mr-1 h-3 w-3 animate-spin"}):s.jsx(Ca,{className:"mr-1 h-3 w-3"}),d.provider==="azure"?"Fetch Deployments":"Fetch Models"]})]}),q&&s.jsx(ft,{value:d.model,onChange:F=>f(z=>({...z,model:F.target.value})),placeholder:d.provider==="azure"?"Type deployment name manually":"Type model name manually",className:"font-mono text-xs"}),C.length>0&&s.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Loaded ",C.length," ",d.provider==="azure"?"deployment names":"models"," from provider discovery."]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:"Max Tokens"}),s.jsx(ft,{type:"number",min:1,max:128e3,value:d.maxTokens,onChange:F=>f(z=>({...z,maxTokens:parseInt(F.target.value)||0})),className:"font-mono text-xs"})]})]}),s.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:"Max Turns"}),s.jsx(ft,{type:"number",min:1,max:50,value:d.maxTurns??"",onChange:F=>{const z=F.target.value.trim();f(ee=>({...ee,maxTurns:z&&parseInt(z)||void 0}))},placeholder:"30 (default)",className:"font-mono text-xs"}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Maximum number of LLM round-trips (tool calls + final answer) per eval run."})]})}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Fe,{children:"Temperature"}),s.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:d.temperature.toFixed(2)})]}),s.jsx(h8,{value:[d.temperature],onValueChange:([F])=>f(z=>({...z,temperature:F})),min:0,max:2,step:.01})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:"System Prompt"}),s.jsx(Wa,{value:d.systemPrompt||"",onChange:F=>f(z=>({...z,systemPrompt:F.target.value})),placeholder:"Optional system prompt...",rows:3,className:"text-xs"})]}),s.jsxs("div",{className:"flex items-center justify-between pt-2",children:[s.jsx("div",{children:!i&&s.jsx(re,{type:"button",variant:"destructive",size:"sm",onClick:()=>p(!0),children:"Delete"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(re,{type:"button",variant:"outline",size:"sm",onClick:()=>t("/libraries/agents"),children:"Cancel"}),s.jsxs(re,{type:"button",size:"sm",onClick:()=>{J()},disabled:x,children:[x&&s.jsx(or,{className:"mr-2 h-4 w-4 animate-spin"}),i?"Create Agent":"Save"]})]})]})]})]}),s.jsx(Ps,{open:h,onOpenChange:p,children:s.jsxs(Xa,{children:[s.jsxs(Qa,{children:[s.jsx(Za,{children:"Delete agent?"}),s.jsxs(es,{children:["This will permanently remove the agent"," ",s.jsx("span",{className:"font-mono",children:d.name}),". This action cannot be undone."]})]}),s.jsxs(Ja,{children:[s.jsx(ns,{children:"Cancel"}),s.jsx(ts,{onClick:()=>{Z()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},PM="mcplab.resultAssistantScenarioHandoff",kM=()=>{const{testCaseId:e}=Zo(),[t,n]=Yi(),r=Ea(),{source:a}=Rn(),{scenarios:i,setScenarios:o,agents:c,servers:d,reload:f,loading:h}=Ga(),[p,x]=v.useState(""),[g,j]=v.useState("all"),[b,y]=v.useState("name"),[S,C]=v.useState("asc"),[N,E]=v.useState(""),[_,P]=v.useState(null),[O,T]=v.useState("idle"),[I,M]=v.useState(""),[D,R]=v.useState(""),[q,U]=v.useState(0),[H,J]=v.useState(null),Z=v.useRef(null),F=v.useRef(!1),z=v.useRef(!1),ee=v.useRef(null),B=v.useRef(0),L=e?decodeURIComponent(e):void 0,te=L?i.findIndex(be=>be.id===L):-1,ie=te>=0?i[te]:void 0,G=async be=>{if(!ie||te<0||!be)return;const Re=[...i];Re[te]=be,await o(Re)},de=async()=>{const be=ee.current;if(!be||!ie)return;if(F.current){z.current=!0;return}F.current=!0,z.current=!1;const Re=++B.current;T("saving"),M("");try{await G(be),Re===B.current&&T("saved")}catch(Y){const xe=Y instanceof Error?Y.message:String(Y);Re===B.current&&(T("error"),M(xe)),Pe({title:"Could not save scenario",description:xe,variant:"destructive"})}finally{F.current=!1,z.current&&(z.current=!1,de())}},oe=be=>{ee.current=be,T("dirty"),M(""),Z.current&&window.clearTimeout(Z.current),Z.current=window.setTimeout(()=>{Z.current=null,de()},700)},ce=async()=>{const be=`scn-${Date.now()}`;let Re=be,Y=1;for(;i.some(ue=>ue.id===Re);)Re=`${be}-${Y}`,Y+=1;const xe={id:Re,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};await o([...i,xe]),r(`/libraries/test-cases/${encodeURIComponent(Re)}`),Pe({title:"Test case created",description:`Opened ${Re} for editing.`})},le=be=>{const Re=(be||`scn-${Date.now()}`).trim().replace(/\s+/g,"-").replace(/[^a-zA-Z0-9_-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")||`scn-${Date.now()}`;let Y=Re,xe=1;for(;i.some(ue=>ue.id===Y);)Y=`${Re}-${xe}`,xe+=1;return Y},fe=async(be,Re=!1)=>{const Y=le(`${be.id}-copy`),xe={...structuredClone(be),id:Y,name:be.name?`${be.name} (Copy)`:""};await o([...i,xe]),Pe({title:"Test case duplicated",description:`Created ${xe.id}.`}),Re&&r(`/libraries/test-cases/${encodeURIComponent(xe.id)}`)},Ce=async be=>{Z.current&&(window.clearTimeout(Z.current),Z.current=null);const Re=i.filter(Y=>Y.id!==be.id);await o(Re),Pe({title:"Test case deleted",description:`${be.id} was removed.`}),ie?.id===be.id&&(P(null),ee.current=null,T("idle"),M(""),r("/libraries/test-cases"))},ae=be=>be.map(Re=>d.find(Y=>Y.id===Re)).filter(Boolean).map(Re=>Re?.name||Re?.id).filter(Boolean),ke=v.useMemo(()=>{const be=new Set;for(const Re of i)for(const Y of ae(Re.serverIds))be.add(Y);return Array.from(be).sort((Re,Y)=>Re.localeCompare(Y))},[i,d]),Ae=v.useMemo(()=>{const be=p.trim().toLowerCase(),Re=i.filter(Y=>{const xe=(Y.name||"").toLowerCase(),ue=Y.id.toLowerCase(),Oe=(Y.prompt||"").toLowerCase(),Ke=ae(Y.serverIds);return g!=="all"&&!Ke.includes(g)?!1:be?xe.includes(be)||ue.includes(be)||Oe.includes(be)||Ke.some(bt=>bt.toLowerCase().includes(be)):!0});return Re.sort((Y,xe)=>{const ue=ae(Y.serverIds),Oe=ae(xe.serverIds);let Ke=0;switch(b){case"id":Ke=Y.id.localeCompare(xe.id);break;case"servers":Ke=ue.length-Oe.length;break;case"evalRules":Ke=Y.evalRules.length-xe.evalRules.length;break;case"extractRules":Ke=Y.extractRules.length-xe.extractRules.length;break;default:Ke=(Y.name||Y.id).localeCompare(xe.name||xe.id);break}return Ke===0&&(Ke=Y.id.localeCompare(xe.id)),S==="asc"?Ke:-Ke}),Re},[i,p,g,b,S,d]);v.useEffect(()=>{let be=!0;return a.getWorkspaceSettings().then(Re=>{!be||!Re||E(Re.scenarioAssistantAgentName??"")}).catch(()=>{be&&E("")}),()=>{be=!1}},[a]),v.useEffect(()=>{if(L&&t.get("assistantHandoff")==="1")try{const be=window.sessionStorage.getItem(PM);if(!be)return;const Re=JSON.parse(be);if(!Re||Re.scenarioId!==L||!Re.prompt)return;R(String(Re.prompt)),U(Date.now()),window.sessionStorage.removeItem(PM);const Y=new URLSearchParams(t);Y.delete("assistantHandoff"),n(Y,{replace:!0}),Pe({title:"Suggestion sent to Scenario Assistant",description:"Review the suggestion and apply changes in the scenario editor."})}catch{}},[L,t,n]),v.useEffect(()=>{ie?(P(structuredClone(ie)),ee.current=structuredClone(ie),T("idle"),M("")):(P(null),ee.current=null,T("idle"),M("")),Z.current&&(window.clearTimeout(Z.current),Z.current=null),F.current=!1,z.current=!1},[ie]),v.useEffect(()=>()=>{Z.current&&window.clearTimeout(Z.current)},[]);const Ye=N||c[0]?.name||"";return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(S$,{className:"h-6 w-6"}),"Manage Test Cases"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Reusable test case templates shared across configurations."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[ie&&s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>r("/libraries/test-cases"),children:[s.jsx(Ro,{className:"mr-2 h-4 w-4"}),"Back to Overview"]}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{f()},disabled:h,children:[s.jsx(Ca,{className:"mr-2 h-4 w-4"}),"Refresh"]}),!ie&&s.jsxs(re,{type:"button",size:"sm",onClick:()=>{ce()},children:[s.jsx(xs,{className:"mr-1.5 h-3.5 w-3.5"}),"Add Test Case"]})]})]}),!ie&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid gap-3 rounded-md border bg-muted/30 p-3 md:grid-cols-[1.6fr_1fr_1fr_auto]",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Search"}),s.jsxs("div",{className:"relative",children:[s.jsx(YS,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),s.jsx(ft,{value:p,onChange:be=>x(be.target.value),placeholder:"Search by name, id, prompt, server...",className:"h-8 pl-8 text-xs"})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Server Filter"}),s.jsxs(bn,{value:g,onValueChange:j,children:[s.jsx(mn,{className:"h-8 text-xs",children:s.jsx(wn,{})}),s.jsxs(vn,{children:[s.jsx(mt,{value:"all",children:"All servers"}),ke.map(be=>s.jsx(mt,{value:be,children:be},be))]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Sort By"}),s.jsxs(bn,{value:b,onValueChange:be=>y(be),children:[s.jsx(mn,{className:"h-8 text-xs",children:s.jsx(wn,{})}),s.jsxs(vn,{children:[s.jsx(mt,{value:"name",children:"Name"}),s.jsx(mt,{value:"id",children:"ID"}),s.jsx(mt,{value:"servers",children:"# Servers"}),s.jsx(mt,{value:"evalRules",children:"# Eval Rules"}),s.jsx(mt,{value:"extractRules",children:"# Extract Rules"})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Direction"}),s.jsxs(bn,{value:S,onValueChange:be=>C(be),children:[s.jsx(mn,{className:"h-8 w-28 text-xs",children:s.jsx(wn,{})}),s.jsxs(vn,{children:[s.jsx(mt,{value:"asc",children:"Ascending"}),s.jsx(mt,{value:"desc",children:"Descending"})]})]})]})]}),s.jsx(Ue,{children:s.jsxs(qe,{className:"space-y-3 pt-6",children:[s.jsxs("div",{className:"text-xs text-muted-foreground",children:["Showing ",Ae.length," of ",i.length," test case",i.length!==1?"s":"","."]}),L&&!ie&&s.jsxs("div",{className:"rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900",children:["Test case ",s.jsx("code",{className:"font-mono",children:L})," was not found."]}),i.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No library test cases yet."}):Ae.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No test cases match the current filters."}):s.jsx("div",{className:"grid gap-3",children:Ae.map(be=>{const Re=L===be.id,Y=`/libraries/test-cases/${encodeURIComponent(be.id)}`,xe=ae(be.serverIds);return s.jsx("div",{className:`rounded-lg border p-3 ${Re?"border-primary bg-primary/5":""}`,children:s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"space-y-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx(jt,{to:Y,className:"font-medium truncate hover:underline",children:be.name||be.id}),s.jsx(Qe,{variant:"outline",className:"font-mono text-[10px]",children:be.id}),Re&&s.jsx(Qe,{children:"Selected"})]}),s.jsxs("div",{className:"text-xs text-muted-foreground flex flex-wrap gap-x-3 gap-y-1",children:[s.jsxs("span",{children:[xe.length," server",xe.length!==1?"s":""]}),s.jsxs("span",{children:[be.evalRules.length," eval rule",be.evalRules.length!==1?"s":""]}),s.jsxs("span",{children:[be.extractRules.length," extract rule",be.extractRules.length!==1?"s":""]})]}),xe.length>0&&s.jsx("div",{className:"flex flex-wrap gap-1",children:xe.map(ue=>s.jsx(Qe,{variant:"secondary",className:"text-[10px]",children:ue},`${be.id}-${ue}`))})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(re,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>J(be),children:[s.jsx(Aa,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{fe(be)},children:[s.jsx(Ui,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsx(re,{type:"button",size:"sm",variant:Re?"default":"outline",asChild:!0,children:s.jsxs(jt,{to:Y,children:[s.jsx(Ym,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})})]})]})},be.id)})})]})})]}),ie&&_?s.jsxs(Ue,{children:[s.jsxs(St,{className:"pb-3",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsx("div",{children:s.jsx(Nt,{className:"text-base",children:"Edit Test Case"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{fe(_,!0)},children:[s.jsx(Ui,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>J(_),children:[s.jsx(Aa,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]})]})]}),s.jsx("div",{className:"text-sm text-muted-foreground",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs("span",{children:["Focused editor for ",s.jsx("code",{className:"font-mono",children:ie.id}),"."]}),s.jsx(Qe,{variant:"outline",className:`text-[10px] ${O==="saving"?"border-amber-300 text-amber-700":O==="saved"?"border-emerald-300 text-emerald-700":O==="error"?"border-destructive/40 text-destructive":O==="dirty"?"border-sky-300 text-sky-700":""}`,children:O==="saving"?"Saving...":O==="saved"?"Saved":O==="error"?"Save failed":O==="dirty"?"Unsaved changes":"Ready"}),O==="error"&&I&&s.jsx("span",{className:"text-[11px] text-destructive",children:I})]})})]}),s.jsx(qe,{className:"pt-3",children:s.jsx($S,{scenarios:[_],agents:c,servers:d,defaultAssistantAgentName:Ye,assistantInitialPromptByScenarioId:D&&_?.id?{[_.id]:D}:void 0,assistantAutoOpenNonceByScenarioId:_?.id&&q?{[_.id]:q}:void 0,onChange:be=>{const Re=be[0];Re&&(P(Re),oe(Re))},allowAdd:!1})})]}):null,s.jsx(Ps,{open:!!H,onOpenChange:be=>!be&&J(null),children:s.jsxs(Xa,{children:[s.jsxs(Qa,{children:[s.jsx(Za,{children:"Delete test case?"}),s.jsxs(es,{children:["This will permanently remove"," ",s.jsx("span",{className:"font-medium",children:H?.name||H?.id})," ","from the library. This action cannot be undone."]})]}),s.jsxs(Ja,{children:[s.jsx(ns,{children:"Cancel"}),s.jsx(ts,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{H&&(Ce(H),J(null))},children:"Delete Test Case"})]})]})})]})},qve=()=>{const{source:e}=Rn(),{agents:t,reload:n,loading:r}=Ga(),[a,i]=v.useState(!1),[o,c]=v.useState(!1),[d,f]=v.useState(""),h=v.useMemo(()=>d||t[0]?.name||"",[d,t]),p=async()=>{i(!0);try{const j=await e.getWorkspaceSettings();f(j?.scenarioAssistantAgentName??"")}catch(j){f(""),Pe({title:"Could not load settings",description:j instanceof Error?j.message:String(j),variant:"destructive"})}finally{i(!1)}};v.useEffect(()=>{p()},[e]);const x=async j=>{f(j),c(!0);try{await e.updateWorkspaceSettings({scenarioAssistantAgentName:j||void 0}),Pe({title:"Settings updated",description:j?`Scenario Assistant Agent set to ${j}.`:"Scenario Assistant Agent cleared (will use first available agent by default)."})}catch(b){Pe({title:"Could not save settings",description:b instanceof Error?b.message:String(b),variant:"destructive"})}finally{c(!1)}},g=async()=>{await Promise.all([n(),p()])};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(XS,{className:"h-6 w-6"}),"Settings"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Workspace-level MCP Lab settings and defaults."})]}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{g()},disabled:r||a,children:[s.jsx(Ca,{className:"mr-2 h-4 w-4"}),"Refresh"]})]}),s.jsxs(Ue,{children:[s.jsxs(St,{className:"pb-3",children:[s.jsx(Nt,{className:"text-base",children:"Scenario Assistant"}),s.jsx(hs,{children:"Default assistant model used on library test case pages. If unset, MCP Lab uses the first available agent automatically."})]}),s.jsxs(qe,{className:"grid gap-3 md:grid-cols-[1.3fr_auto] md:items-end",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Assistant Agent"}),s.jsxs(bn,{value:h||"__none__",onValueChange:j=>{x(j==="__none__"?"":j)},disabled:o,children:[s.jsx(mn,{className:"h-9 text-sm",children:s.jsx(wn,{placeholder:"Select assistant agent"})}),s.jsxs(vn,{children:[s.jsx(mt,{value:"__none__",children:"None (use first agent)"}),t.map(j=>s.jsxs(mt,{value:j.id,children:[j.name||j.id," · ",j.model]},j.id))]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Applies to `/libraries/test-cases/:testCaseId`. MCP Evaluation editors can still override the assistant agent from their evaluation context."})]}),s.jsx("div",{className:"text-xs text-muted-foreground",children:"Saved in workspace settings"})]})]})]})};var jg="Checkbox",[Wve]=lr(jg),[Vve,BC]=Wve(jg);function Hve(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:a,disabled:i,form:o,name:c,onCheckedChange:d,required:f,value:h="on",internal_do_not_use_render:p}=e,[x,g]=oa({prop:n,defaultProp:a??!1,onChange:d,caller:jg}),[j,b]=v.useState(null),[y,S]=v.useState(null),C=v.useRef(!1),N=j?!!o||!!j.closest("form"):!0,E={checked:x,disabled:i,setChecked:g,control:j,setControl:b,name:c,form:o,value:h,hasConsumerStoppedPropagationRef:C,required:f,defaultChecked:zi(a)?!1:a,isFormControl:N,bubbleInput:y,setBubbleInput:S};return s.jsx(Vve,{scope:t,...E,children:Kve(p)?p(E):r})}var I8="CheckboxTrigger",M8=v.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},a)=>{const{control:i,value:o,disabled:c,checked:d,required:f,setControl:h,setChecked:p,hasConsumerStoppedPropagationRef:x,isFormControl:g,bubbleInput:j}=BC(I8,e),b=vt(a,h),y=v.useRef(d);return v.useEffect(()=>{const S=i?.form;if(S){const C=()=>p(y.current);return S.addEventListener("reset",C),()=>S.removeEventListener("reset",C)}},[i,p]),s.jsx(Ge.button,{type:"button",role:"checkbox","aria-checked":zi(d)?"mixed":d,"aria-required":f,"data-state":B8(d),"data-disabled":c?"":void 0,disabled:c,value:o,...r,ref:b,onKeyDown:Te(t,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:Te(n,S=>{p(C=>zi(C)?!0:!C),j&&g&&(x.current=S.isPropagationStopped(),x.current||S.stopPropagation())})})});M8.displayName=I8;var zC=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:a,defaultChecked:i,required:o,disabled:c,value:d,onCheckedChange:f,form:h,...p}=e;return s.jsx(Hve,{__scopeCheckbox:n,checked:a,defaultChecked:i,disabled:c,required:o,onCheckedChange:f,name:r,form:h,value:d,internal_do_not_use_render:({isFormControl:x})=>s.jsxs(s.Fragment,{children:[s.jsx(M8,{...p,ref:t,__scopeCheckbox:n}),x&&s.jsx(F8,{__scopeCheckbox:n})]})})});zC.displayName=jg;var $8="CheckboxIndicator",D8=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,i=BC($8,n);return s.jsx(Kn,{present:r||zi(i.checked)||i.checked===!0,children:s.jsx(Ge.span,{"data-state":B8(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});D8.displayName=$8;var L8="CheckboxBubbleInput",F8=v.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:a,checked:i,defaultChecked:o,required:c,disabled:d,name:f,value:h,form:p,bubbleInput:x,setBubbleInput:g}=BC(L8,e),j=vt(n,g),b=lg(i),y=ev(r);v.useEffect(()=>{const C=x;if(!C)return;const N=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(N,"checked").set,P=!a.current;if(b!==i&&_){const O=new Event("click",{bubbles:P});C.indeterminate=zi(i),_.call(C,zi(i)?!1:i),C.dispatchEvent(O)}},[x,b,i,a]);const S=v.useRef(zi(i)?!1:i);return s.jsx(Ge.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??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%)"}})});F8.displayName=L8;function Kve(e){return typeof e=="function"}function zi(e){return e==="indeterminate"}function B8(e){return zi(e)?"indeterminate":e?"checked":"unchecked"}const ra=v.forwardRef(({className:e,...t},n)=>s.jsx(zC,{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:s.jsx(D8,{className:Se("flex items-center justify-center text-current"),children:s.jsx(hc,{className:"h-4 w-4"})})}));ra.displayName=zC.displayName;const Gve=Jo("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"}}),dc=v.forwardRef(({className:e,variant:t,...n},r)=>s.jsx("div",{ref:r,role:"alert",className:Se(Gve({variant:t}),e),...n}));dc.displayName="Alert";const fc=v.forwardRef(({className:e,...t},n)=>s.jsx("h5",{ref:n,className:Se("mb-1 font-medium leading-none tracking-tight",e),...t}));fc.displayName="AlertTitle";const pc=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Se("text-sm [&_p]:leading-relaxed",e),...t}));pc.displayName="AlertDescription";function Yve(e,t=[]){let n=[];function r(i,o){const c=v.createContext(o);c.displayName=i+"Context";const d=n.length;n=[...n,o];const f=p=>{const{scope:x,children:g,...j}=p,b=x?.[e]?.[d]||c,y=v.useMemo(()=>j,Object.values(j));return s.jsx(b.Provider,{value:y,children:g})};f.displayName=i+"Provider";function h(p,x){const g=x?.[e]?.[d]||c,j=v.useContext(g);if(j)return j;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[f,h]}const a=()=>{const i=n.map(o=>v.createContext(o));return function(c){const d=c?.[e]||i;return v.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return a.scopeName=e,[r,Xve(a,...t)]}function Xve(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=r.reduce((c,{useScope:d,scopeName:f})=>{const p=d(i)[`__scope${f}`];return{...c,...p}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var Qve=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],z8=Qve.reduce((e,t)=>{const n=fv(`Primitive.${t}`),r=v.forwardRef((a,i)=>{const{asChild:o,...c}=a,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),UC="Progress",qC=100,[Jve]=Yve(UC),[Zve,ege]=Jve(UC),U8=v.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:a,getValueLabel:i=tge,...o}=e;(a||a===0)&&!OM(a)&&console.error(nge(`${a}`,"Progress"));const c=OM(a)?a:qC;r!==null&&!TM(r,c)&&console.error(rge(`${r}`,"Progress"));const d=TM(r,c)?r:null,f=Wm(d)?i(d,c):void 0;return s.jsx(Zve,{scope:n,value:d,max:c,children:s.jsx(z8.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":Wm(d)?d:void 0,"aria-valuetext":f,role:"progressbar","data-state":V8(d,c),"data-value":d??void 0,"data-max":c,...o,ref:t})})});U8.displayName=UC;var q8="ProgressIndicator",W8=v.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,a=ege(q8,n);return s.jsx(z8.div,{"data-state":V8(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...r,ref:t})});W8.displayName=q8;function tge(e,t){return`${Math.round(e/t*100)}%`}function V8(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Wm(e){return typeof e=="number"}function OM(e){return Wm(e)&&!isNaN(e)&&e>0}function TM(e,t){return Wm(e)&&!isNaN(e)&&e<=t&&e>=0}function nge(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${qC}\`.`}function rge(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
131
- - a positive number
132
- - less than the value passed to \`max\` (or ${qC} if no \`max\` prop is set)
133
- - \`null\` or \`undefined\` if the progress is indeterminate.
134
-
135
- Defaulting to \`null\`.`}var H8=U8,age=W8;const Sg=v.forwardRef(({className:e,value:t,...n},r)=>s.jsx(H8,{ref:r,className:Se("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:s.jsx(age,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Sg.displayName=H8.displayName;const bo=["critical","high","medium","low","info"];function vh(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 sge(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 RM(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"tool"}function Ij({text:e}){return s.jsxs("div",{className:"mt-2 rounded-md border px-2.5 py-2 text-[11px] text-slate-800",children:[s.jsxs("div",{className:"mb-1 inline-flex items-center gap-1 font-medium text-slate-700",children:[s.jsx(W7,{className:"h-3.5 w-3.5"}),"Suggested improvement"]}),s.jsx("p",{children:e})]})}function WC(e){const t=[];t.push("# MCP Tool Analysis Report",""),t.push(`- Created: ${e.createdAt}`),t.push(`- Assistant Agent: ${e.assistantAgentName}`),t.push(`- Assistant Model: ${e.assistantAgentModel}`),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 n of e.servers){t.push(`## Server: ${n.serverName}`),n.warnings.length>0&&t.push(...n.warnings.map(r=>`- Warning: ${r}`),"");for(const r of n.tools){if(t.push(`### ${r.publicToolName}`),t.push(`- Safety: ${r.safetyClassification} (${r.classificationReason})`),r.metadataReview?.issues.length){t.push("#### Metadata issues");for(const a of r.metadataReview.issues)t.push(` - [${a.severity}] ${a.title}: ${a.detail}`)}if(r.deeperAnalysis)if(!r.deeperAnalysis.attempted)t.push(`- Deeper analysis: skipped (${r.deeperAnalysis.skippedReason??"unknown"})`);else{t.push(`- Deeper analysis sample calls: ${r.deeperAnalysis.sampleCalls.length}`);for(const a of r.deeperAnalysis.sampleCalls){t.push(` - Call ${a.callIndex}: ${a.ok?"ok":"error"}${a.durationMs?` (${a.durationMs}ms)`:""}`),a.error&&t.push(` - Error: ${a.error}`);for(const i of a.observations)t.push(` - ${i}`)}}if(r.overallRecommendations.length>0){t.push("#### Recommendations");for(const a of r.overallRecommendations)t.push(` - ${a}`)}if(r.metadataReview?.evalReadinessNotes.length){t.push("#### Agent/Eval readiness notes");for(const a of r.metadataReview.evalReadinessNotes)t.push(` - ${a}`)}t.push("")}}return`${t.join(`
136
- `)}
137
- `}function K8({report:e}){const[t,n]=Yi(),[r,a]=v.useState([...bo]),[i,o]=v.useState(new Set),[c,d]=v.useState(""),[f,h]=v.useState(!1),p=t.get("groupBy")==="severity"?"severity":"tool",x=v.useRef(null),g=c.trim().toLowerCase(),j=v.useMemo(()=>new Set(r),[r]),b=T=>{a(I=>{const M=I.includes(T)?I.filter(D=>D!==T):[...I,T];return M.length===0?[...bo]:M})},y=T=>{const I=new URLSearchParams(t);T==="severity"?I.set("groupBy","severity"):I.delete("groupBy"),n(I,{replace:!0})},S=v.useMemo(()=>{const T={critical:[],high:[],medium:[],low:[],info:[]};for(const I of e.servers)for(const M of I.tools){const D=`tool-${RM(`${I.serverName}-${M.publicToolName}`)}`,R=`${I.serverName}::${M.publicToolName}`,q=M.publicToolName.split("::").pop()??M.publicToolName;for(const U of M.metadataReview?.issues??[]){const H=U.severity;T[H].push({key:`${R}-metadata-${U.id}`,toolAnchorId:D,toolLabel:R,toolDisplayName:q,sourceLabel:"Metadata review",issue:{id:U.id,title:U.title,detail:U.detail,severity:H,suggestion:U.suggestion}})}for(const U of M.deeperAnalysis?.sampleCalls??[])for(const H of U.issues){const J=H.severity;T[J].push({key:`${R}-call-${U.callIndex}-${H.id}`,toolAnchorId:D,toolLabel:R,toolDisplayName:q,sourceLabel:`Sample call ${U.callIndex}`,issue:{id:H.id,title:H.title,detail:H.detail,severity:J,suggestion:H.suggestion}})}}return T},[e.servers]),C=v.useMemo(()=>Array.from(new Set(e.servers.flatMap(T=>T.tools.map(I=>I.publicToolName)).map(T=>T.split("::").pop()??T))).sort((T,I)=>T.localeCompare(I)),[e.servers]),N=T=>g.length===0?!0:(T.toLowerCase().split("::").pop()??T.toLowerCase()).includes(g),E=T=>{if(!x.current)return;x.current.querySelectorAll("details").forEach(M=>{M.open=T})},_=()=>o(new Set(bo)),P=()=>o(new Set),O=T=>{o(I=>{const M=new Set(I);return M.has(T)?M.delete(T):M.add(T),M})};return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[s.jsx(Ue,{children:s.jsxs(qe,{className:"pt-6",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Tools analyzed"}),s.jsx("div",{className:"text-2xl font-semibold",children:e.summary.toolsAnalyzed})]})}),s.jsx(Ue,{children:s.jsxs(qe,{className:"pt-6",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Tools skipped"}),s.jsx("div",{className:"text-2xl font-semibold",children:e.summary.toolsSkipped})]})}),s.jsx(Ue,{children:s.jsxs(qe,{className:"pt-6",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Findings"}),s.jsx("div",{className:"text-2xl font-semibold",children:e.findings.length})]})})]}),s.jsxs(Ue,{children:[s.jsxs(St,{className:"pb-3",children:[s.jsx(Nt,{className:"text-base",children:"Analysis Overview"}),s.jsx(hs,{children:"Visual breakdown of findings by severity. Click badges to filter the report."})]}),s.jsx(qe,{children:s.jsxs("div",{className:"flex flex-wrap gap-2",children:[bo.filter(T=>e.summary.issueCounts[T]>0).map(T=>{const I=j.has(T);return s.jsx("button",{type:"button",onClick:()=>b(T),className:"rounded-full","aria-pressed":I,children:s.jsxs(Qe,{variant:"outline",className:`capitalize font-normal ${I?vh(T):sge(T)} ${I?"ring-1 ring-current":"opacity-70"}`,children:[T,": ",e.summary.issueCounts[T]]})},T)}),s.jsx(re,{type:"button",size:"sm",variant:"ghost",onClick:()=>a([...bo]),className:"h-7 px-2 text-xs",children:"Reset"})]})})]}),s.jsxs("div",{className:"space-y-0",children:[s.jsx(dg,{value:p,onValueChange:T=>{(T==="tool"||T==="severity")&&y(T)},className:"min-w-0 px-3 pt-1",children:s.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-2 border-b",children:[s.jsxs(Df,{className:"h-auto justify-start rounded-none bg-transparent p-0",children:[s.jsx(gs,{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"}),s.jsx(gs,{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"})]}),s.jsxs("div",{className:"mb-2 flex min-w-0 items-center gap-2",children:[s.jsx("span",{className:"whitespace-nowrap text-xs text-muted-foreground",children:"Filter tools"}),s.jsxs(Vc,{open:f,onOpenChange:h,children:[s.jsx(Hc,{asChild:!0,children:s.jsxs(re,{type:"button",variant:"outline",role:"combobox","aria-expanded":f,className:"h-8 w-[320px] max-w-full justify-between text-xs font-normal",children:[s.jsx("span",{className:"truncate text-left",children:c||"All tools"}),s.jsx(Dt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(Wo,{className:"w-[320px] p-0",align:"end",children:s.jsxs(Ho,{children:[s.jsx(Ko,{placeholder:"Search tools..."}),s.jsxs(Go,{children:[s.jsx(Yo,{children:"No tools found."}),s.jsxs(Xo,{children:[s.jsx(na,{value:"all tools",onSelect:()=>{d(""),h(!1)},children:"All tools"}),C.map(T=>s.jsx(na,{value:T,onSelect:()=>{d(T),h(!1)},children:T},T))]})]})]})})]}),p==="severity"&&s.jsxs(s.Fragment,{children:[s.jsx(re,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:P,children:"Expand all"}),s.jsx(re,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:_,children:"Collapse all"})]}),p==="tool"&&s.jsxs(s.Fragment,{children:[s.jsx(re,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>E(!0),children:"Expand all"}),s.jsx(re,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>E(!1),children:"Collapse all"})]})]})]})}),p==="severity"?s.jsx("div",{className:"space-y-4",children:bo.filter(T=>j.has(T)).map(T=>{const I=S[T].filter(D=>N(D.toolLabel));if(I.length===0)return null;const M=i.has(T);return s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx(Nt,{className:"text-base capitalize",children:T}),s.jsxs(hs,{children:[I.length," finding(s)"]})]}),s.jsx("div",{className:"flex gap-2",children:s.jsx(re,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>O(T),children:M?"Expand":"Collapse"})})]})}),!M&&s.jsx(qe,{className:"space-y-2",children:I.map((D,R)=>s.jsxs("div",{className:"rounded border p-2 text-xs",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.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:R+1}),s.jsx("span",{className:"min-w-0 font-bold leading-tight",children:D.issue.title})]}),s.jsx(Qe,{variant:"outline",className:`shrink-0 text-[10px] ${vh(D.issue.severity)}`,children:D.issue.severity})]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",D.issue.detail]}),s.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-[11px]",children:[s.jsx(Qe,{variant:"secondary",className:"font-normal",children:D.sourceLabel}),s.jsx(re,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 font-mono text-[11px]",title:D.toolLabel,onClick:()=>{y("tool"),requestAnimationFrame(()=>{document.getElementById(D.toolAnchorId)?.scrollIntoView({behavior:"smooth",block:"start"})})},children:D.toolDisplayName})]}),D.issue.suggestion&&s.jsx(Ij,{text:D.issue.suggestion})]},D.key))})]},T)})}):s.jsx("div",{ref:x,className:"space-y-4",children:e.servers.map(T=>{const I=T.tools.filter(M=>{const D=`${T.serverName}::${M.publicToolName}`;if(!N(D))return!1;const R=[...M.metadataReview?.issues??[],...M.deeperAnalysis?.sampleCalls.flatMap(q=>q.issues)??[]];return R.length===0?r.length===bo.length:R.some(q=>j.has(q.severity))});return I.length===0?null:s.jsxs(Ue,{children:[s.jsxs(St,{className:"pb-3",children:[s.jsx(Nt,{className:"text-base",children:T.serverName}),s.jsxs(hs,{children:["Discovered ",T.toolCountDiscovered," · Showing ",I.length," of ",T.toolCountAnalyzed," analyzed · Skipped ",T.toolCountSkipped]})]}),s.jsxs(qe,{className:"space-y-3",children:[T.warnings.length>0&&s.jsxs(dc,{children:[s.jsx(fc,{children:"Warnings"}),s.jsx(pc,{children:s.jsx("ul",{className:"ml-4 list-disc space-y-1",children:T.warnings.map(M=>s.jsx("li",{children:M},`${T.serverName}-${M}`))})})]}),I.map(M=>{const D=M.publicToolName.split("::").pop()??M.publicToolName;return s.jsxs("details",{id:`tool-${RM(`${T.serverName}-${M.publicToolName}`)}`,className:"group rounded-md border p-3",children:[s.jsx("summary",{className:"cursor-pointer list-none",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("div",{className:"font-mono text-sm",title:M.publicToolName,children:D}),M.description&&s.jsx("p",{className:"text-xs text-muted-foreground",children:M.description})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Qe,{variant:M.safetyClassification==="read_like"?"secondary":"outline",children:M.safetyClassification}),s.jsx(Dt,{className:"h-4 w-4 text-muted-foreground transition-transform group-open:rotate-180"})]})]})}),s.jsxs("div",{className:"mt-3 space-y-2",children:[M.metadataReview&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-xs font-medium",children:"Metadata review"}),M.metadataReview.issues.filter(R=>j.has(R.severity)).length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No metadata issues reported."}):s.jsx("div",{className:"space-y-1",children:M.metadataReview.issues.filter(R=>j.has(R.severity)).map((R,q)=>s.jsxs("div",{className:"rounded border p-2 text-xs",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.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:q+1}),s.jsx("span",{className:"min-w-0 font-bold leading-tight",children:R.title})]}),s.jsx(Qe,{variant:"outline",className:`shrink-0 text-[10px] ${vh(R.severity)}`,children:R.severity})]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",R.detail]}),R.suggestion&&s.jsx(Ij,{text:R.suggestion})]},R.id))})]}),M.deeperAnalysis&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-xs font-medium",children:"Deeper analysis"}),M.deeperAnalysis.attempted?s.jsx("div",{className:"space-y-2",children:M.deeperAnalysis.sampleCalls.map(R=>s.jsxs("div",{className:"rounded border p-2 text-xs",children:[s.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[s.jsx(Qe,{variant:R.ok?"secondary":"destructive",className:"text-[10px]",children:R.ok?"ok":"error"}),s.jsxs("span",{children:["Call ",R.callIndex]}),R.durationMs!==void 0&&s.jsxs("span",{className:"text-muted-foreground",children:[R.durationMs,"ms"]})]}),R.error&&s.jsx("p",{className:"text-destructive",children:R.error}),R.observations.length>0&&s.jsxs("div",{className:"mt-2",children:[s.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"}),s.jsx("ul",{className:"ml-4 list-disc space-y-1",children:R.observations.map((q,U)=>s.jsx("li",{children:q},`${M.publicToolName}-obs-${R.callIndex}-${U}`))})]}),R.issues.filter(q=>j.has(q.severity)).length>0&&s.jsx("div",{className:"mt-2 space-y-1",children:R.issues.filter(q=>j.has(q.severity)).map((q,U)=>s.jsxs("div",{className:"rounded border p-2",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.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:U+1}),s.jsx("span",{className:"min-w-0 font-bold leading-tight",children:q.title})]}),s.jsx(Qe,{variant:"outline",className:`shrink-0 text-[10px] ${vh(q.severity)}`,children:q.severity})]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",q.detail]}),q.suggestion&&s.jsx(Ij,{text:q.suggestion})]},`${R.callIndex}-${q.id}`))})]},`${M.publicToolName}-call-${R.callIndex}`))}):s.jsx("p",{className:"text-xs text-muted-foreground",children:M.deeperAnalysis.skippedReason??"Skipped"})]})]})]},M.publicToolName)})]})]},T.serverName)})})]})]})}const Mj="mcplab.toolAnalysis.activeJobId";function IM(e,t,n){const r=new Blob([t],{type:n}),a=URL.createObjectURL(r),i=document.createElement("a");i.href=a,i.download=e,i.click(),URL.revokeObjectURL(a)}function MM({text:e}){return s.jsxs(xD,{children:[s.jsx(yD,{asChild:!0,children:s.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:s.jsx(B7,{className:"h-3.5 w-3.5"})})}),s.jsx(lN,{className:"max-w-xs text-xs",children:s.jsx("p",{children:e})})]})}function ige(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}const oge=()=>{const{source:e}=Rn(),{servers:t,agents:n,loading:r,reload:a}=Ga(),[i,o]=v.useState(""),[c,d]=v.useState([]),[f,h]=v.useState(!1),[p,x]=v.useState([]),[g,j]=v.useState({}),[b,y]=v.useState(""),[S,C]=v.useState(!0),[N,E]=v.useState(!1),[_,P]=v.useState(2),[O,T]=v.useState(1),[I,M]=v.useState(1e4),[D,R]=v.useState(null),[q,U]=v.useState([]),[H,J]=v.useState(null),[Z,F]=v.useState(null),[z,ee]=v.useState(!1),[B,L]=v.useState("configure"),[te,ie]=v.useState("idle"),G=v.useRef(null),de=i||n[0]?.name||"",oe=v.useMemo(()=>{let Q=0;const je=new Set,Ne=new Set;for(const Be of q){const et=typeof Be.payload?.message=="string"?Be.payload.message:"";if(!et)continue;const Pt=et.match(/\((\d+)\s+tools?\)/i);Pt&&(Q=Math.max(Q,Number(Pt[1])||0));const Sn=et.match(/^Started\s+(.+)$/);Sn&&je.add(Sn[1]);const Nn=et.match(/^Finished\s+(.+)$/);Nn&&Ne.add(Nn[1])}const $e=Q>0?Math.max(0,Math.min(100,Math.round(Ne.size/Q*100))):0;return{totalTools:Q,startedTools:je.size,finishedTools:Ne.size,percent:$e}},[q]);v.useEffect(()=>{let Q=!0;return e.getWorkspaceSettings().then(je=>{!Q||!je||o(je.scenarioAssistantAgentName??"")}).catch(()=>{Q&&o("")}),()=>{Q=!1}},[e]),v.useEffect(()=>()=>{G.current?.()},[]);const ce=()=>{try{sessionStorage.removeItem(Mj)}catch{}},le=Q=>{try{sessionStorage.setItem(Mj,Q)}catch{}},fe=Q=>{G.current?.(),G.current=e.subscribeToolAnalysisJob(Q,je=>{if(U(Ne=>[...Ne,je]),je.type==="completed")e.getToolAnalysisResult(Q).then(Ne=>{J(Ne.report),F(Ne.savedReportId??null)}).catch(Ne=>Pe({title:"Could not load analysis report",description:Ne instanceof Error?Ne.message:String(Ne),variant:"destructive"})).finally(()=>{ce(),R(null),ee(!1),ie("idle"),L("run")});else if(je.type==="error"){const Ne=String(je.payload?.message??"");ce(),ie(Ne.toLowerCase().includes("abort")?"stopped":"error"),R(null),ee(!1)}})};v.useEffect(()=>{if(D||H)return;let Q="";try{Q=sessionStorage.getItem(Mj)??""}catch{Q=""}if(Q)return L("run"),ie("running"),ee(!0),R(Q),U([]),fe(Q),()=>{}},[e,D,H]);const Ce=async()=>{if(c.length===0){x([]),j({});return}h(!0);try{const Q=await e.discoverToolsForAnalysis({serverNames:c});x(Q.servers),j(je=>{const Ne={};for(const $e of Q.servers){const Be=je[$e.serverName]??[],et=$e.tools.map(Sn=>Sn.name),Pt=Be.filter(Sn=>et.includes(Sn));Ne[$e.serverName]=Pt.length>0?Pt:et}return Ne})}catch(Q){Pe({title:"Could not discover MCP tools",description:Q instanceof Error?Q.message:String(Q),variant:"destructive"})}finally{h(!1)}};v.useEffect(()=>{Ce()},[c.join("|")]);const ae=v.useMemo(()=>{const Q=b.trim().toLowerCase();return Q?p.map(je=>({...je,tools:je.tools.filter(Ne=>Ne.name.toLowerCase().includes(Q)||(Ne.description||"").toLowerCase().includes(Q))})).filter(je=>je.tools.length>0):p},[p,b]),ke=v.useMemo(()=>Object.values(g).reduce((Q,je)=>Q+je.length,0),[g]),Ae=c[0]??"",Ye=async()=>{if(!S&&!N){Pe({title:"Select at least one mode",variant:"destructive"});return}if(c.length!==1){Pe({title:"Select exactly one server",variant:"destructive"});return}if(ke===0){Pe({title:"Select at least one tool",variant:"destructive"});return}ee(!0),U([]),J(null),F(null),L("run"),ie("running");try{const{jobId:Q}=await e.startToolAnalysis({serverNames:c,selectedToolsByServer:g,maxParallelTools:_,modes:{metadataReview:S,deeperAnalysis:N},deeperAnalysisOptions:{autoRunPolicy:"read_only_allowlist",sampleCallsPerTool:O,toolCallTimeoutMs:I}});R(Q),le(Q),fe(Q)}catch(Q){ee(!1),ie("error"),L("run"),Pe({title:"Could not start tool analysis",description:Q instanceof Error?Q.message:String(Q),variant:"destructive"})}},be=async()=>{if(!D)return;const Q=D;try{const je=await e.stopToolAnalysis(Q);if(je.status==="completed"){G.current?.(),G.current=null;const Ne=await e.getToolAnalysisResult(Q);J(Ne.report),F(Ne.savedReportId??null),ce(),R(null),ee(!1),ie("idle"),L("run"),Pe({title:"Analysis already finished",description:"Showing the result overview."});return}if(je.status==="stopped"){G.current?.(),G.current=null,ce(),R(null),ee(!1),ie("stopped"),Pe({title:"Analysis stopped"});return}if(je.status==="error"){G.current?.(),G.current=null,ce(),R(null),ee(!1),ie("error"),Pe({title:"Analysis already ended with an error",description:"Review the progress log and return to Configure Analysis."});return}Pe({title:"Stopping analysis..."})}catch(je){Pe({title:"Could not stop analysis",description:je instanceof Error?je.message:String(je),variant:"destructive"})}},Re=()=>{L("configure"),ie("idle"),R(null)},Y=(Q,je)=>{d(Ne=>je?[Q]:Ne.filter($e=>$e!==Q))},xe=(Q,je,Ne)=>{j($e=>{const Be=new Set($e[Q]??[]);return Ne?Be.add(je):Be.delete(je),{...$e,[Q]:Array.from(Be)}})},ue=(Q,je)=>{j(Ne=>({...Ne,[Q]:je}))},Oe=!0,Ke=D!==null||q.length>0||te==="stopped"||te==="error",bt=!!H,It=Q=>{if(Q==="configure"&&Oe){L("configure");return}if(Q==="run"&&Ke){L("run");return}Q==="report"&&bt&&L("report")};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(A$,{className:"h-6 w-6"}),"Analyze MCP Tools"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Review MCP tools for schema quality, ergonomics, and agent/eval readiness."})]}),s.jsxs("div",{className:"hidden flex-wrap items-center gap-2 md:flex",children:[s.jsx("button",{type:"button",onClick:()=>It("configure"),className:"rounded-full","aria-label":"Open Configure Analysis",children:s.jsx(Qe,{variant:B==="configure"?"default":"outline",className:"cursor-pointer",children:"Configure Analysis"})}),s.jsx("button",{type:"button",onClick:()=>It("run"),disabled:!Ke,className:"rounded-full disabled:cursor-not-allowed disabled:opacity-60","aria-label":"Open Run Analysis",children:s.jsx(Qe,{variant:B==="run"?"default":"outline",className:Ke?"cursor-pointer":"cursor-not-allowed",children:"Run Analysis"})}),s.jsx("button",{type:"button",onClick:()=>It("report"),disabled:!bt,className:"rounded-full disabled:cursor-not-allowed disabled:opacity-60","aria-label":"Open Report",children:s.jsx(Qe,{variant:B==="report"?"default":"outline",className:bt?"cursor-pointer":"cursor-not-allowed",children:"Report"})})]})]}),B==="configure"&&s.jsxs(Ue,{children:[s.jsxs(St,{children:[s.jsx(Nt,{className:"text-base",children:"Run MCP analysis"}),s.jsx(hs,{children:"Select servers and tools, choose metadata review and/or deeper sample-call analysis, then run the report."})]}),s.jsxs(qe,{className:"space-y-5",children:[!de&&s.jsxs(dc,{children:[s.jsx(fc,{children:"No assistant agent available"}),s.jsxs(pc,{children:["Add a library agent in"," ",s.jsx(jt,{to:"/libraries/agents",className:"underline",children:"Agents"})," ","and optionally set the default Scenario Assistant Agent in"," ",s.jsx(jt,{to:"/settings",className:"underline",children:"Settings"}),"."]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx(Fe,{className:"text-xs",children:"Servers"}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{a()},disabled:r,children:[s.jsx(Ca,{className:"mr-2 h-4 w-4"}),"Refresh Servers"]})]}),s.jsx("div",{className:"grid gap-2 rounded-md border p-3 md:grid-cols-2",children:t.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No library servers configured."}):t.map(Q=>{const je=c.includes(Q.id);return s.jsxs("label",{className:"flex items-start gap-2 rounded-md border p-2 text-sm",children:[s.jsx(ra,{checked:je,onCheckedChange:Ne=>Y(Q.id,!!Ne)}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"font-medium",children:Q.name||Q.id}),Q.url&&s.jsx("div",{className:"truncate text-xs text-muted-foreground",children:Q.url})]})]},Q.id)})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Select exactly one MCP server for analysis."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Fe,{className:"text-xs",children:"Filter visible tools"}),s.jsxs("div",{className:"relative",children:[s.jsx(YS,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),s.jsx(ft,{className:"h-9 pl-8",placeholder:"Filter tools by name or description...",value:b,onChange:Q=>y(Q.target.value)})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Filtering only changes what is shown; selected tools remain selected."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx(Fe,{className:"text-xs",children:Ae?`Tools for ${Ae}`:"Tools"}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{Ce()},disabled:f||c.length===0,children:[f&&s.jsx(or,{className:"mr-2 h-4 w-4 animate-spin"}),"Discover Tools"]})]}),s.jsx("div",{className:"space-y-3 rounded-md border p-3",children:c.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"Select a server to discover tools."}):f&&p.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading tools..."}):ae.length===0&&!f?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No discovered tools match the current filters."}):ae.map(Q=>{const je=new Set(g[Q.serverName]??[]);return s.jsxs("div",{className:"rounded-md border p-3",children:[s.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[s.jsx("div",{className:"font-medium",children:Q.serverName}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(re,{type:"button",size:"sm",variant:"ghost",onClick:()=>ue(Q.serverName,Q.tools.map(Ne=>Ne.name)),children:"Select all"}),s.jsx(re,{type:"button",size:"sm",variant:"ghost",onClick:()=>ue(Q.serverName,[]),children:"Clear"})]})]}),Q.warnings.length>0&&s.jsx("div",{className:"mb-2 space-y-1",children:Q.warnings.map(Ne=>s.jsx("div",{className:"text-xs text-amber-700",children:ige(Q.serverName,Ne)},`${Q.serverName}-${Ne}`))}),s.jsx("div",{className:"grid gap-2",children:Q.tools.map(Ne=>s.jsxs("label",{className:"flex items-start gap-2 rounded border p-2",children:[s.jsx(ra,{checked:je.has(Ne.name),onCheckedChange:$e=>xe(Q.serverName,Ne.name,!!$e)}),s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx("span",{className:"font-mono text-xs",children:Ne.name}),s.jsx(Qe,{variant:Ne.safetyClassification==="read_like"?"secondary":"outline",className:"text-[10px]",children:Ne.safetyClassification==="read_like"?"read-like":"unsafe/unknown"})]}),Ne.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:Ne.description}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:Ne.classificationReason})]})]},`${Q.serverName}-${Ne.name}`))})]},Q.serverName)})}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Selected tools: ",ke]})]}),s.jsxs("div",{className:"space-y-3 rounded-md border p-3",children:[s.jsx("div",{className:"text-sm font-medium",children:"Analysis Modes"}),s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx(ra,{checked:S,onCheckedChange:Q=>C(!!Q)}),s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Metadata / schema review",s.jsx(MM,{text:"No tool execution. Reviews tool names, descriptions, and schemas only."})]})]}),s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx(ra,{checked:N,onCheckedChange:Q=>E(!!Q)}),s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Deeper analysis",s.jsx(MM,{text:"Runs sample MCP tool calls automatically for read-like tools only (based on the safety allowlist)."})]})]}),s.jsxs("div",{className:"grid gap-3 rounded-md border bg-muted/20 p-3 md:grid-cols-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Max parallel tools"}),s.jsx(ft,{type:"number",min:1,max:8,value:_,onChange:Q=>P(Math.max(1,Math.min(8,Number(Q.target.value)||2))),className:"h-8"})]}),N?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Safety profile"}),s.jsx("div",{className:"text-sm",children:"Read-only allowlist only"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Sample calls per tool"}),s.jsx(ft,{type:"number",min:1,max:5,value:O,onChange:Q=>T(Math.max(1,Math.min(5,Number(Q.target.value)||1))),className:"h-8"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Tool call timeout (ms)"}),s.jsx(ft,{type:"number",min:1e3,max:6e4,step:500,value:I,onChange:Q=>M(Math.max(1e3,Math.min(6e4,Number(Q.target.value)||1e4))),className:"h-8"})]}),s.jsx("div",{className:"md:col-span-3 text-xs text-amber-700",children:"Deeper analysis may execute read-only MCP tools automatically."})]}):s.jsx("div",{className:"md:col-span-2 text-xs text-muted-foreground",children:"Deeper analysis is disabled. Only metadata/schema review will run."})]})]}),s.jsx("div",{className:"flex flex-wrap items-center gap-2",children:s.jsxs(re,{type:"button",onClick:()=>{Ye()},disabled:z||!!D,children:[(z||!!D)&&s.jsx(or,{className:"mr-2 h-4 w-4 animate-spin"}),"Analyze Tools"]})})]})]}),B==="run"&&s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(Nt,{className:"flex items-center gap-2 text-base",children:s.jsx("span",{children:"Progress"})}),s.jsx(hs,{children:D?"Live tool-analysis job events:":H?"Analysis finished. Review the summary below or open the saved report details.":te==="stopped"?"Analysis was stopped. You can return to Configure Analysis.":te==="error"?"Analysis ended with an error. Review the log and go back to Configure Analysis.":"Analysis finished."})]}),D?s.jsx(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{be()},children:"Stop Analysis"}):s.jsx(re,{type:"button",size:"sm",variant:"outline",onClick:Re,children:"Back to Configure Analysis"})]})}),s.jsxs(qe,{className:"space-y-2",children:[D&&s.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:[s.jsx(or,{className:"h-3.5 w-3.5 animate-spin"}),"Analysis is still running..."]}),(oe.totalTools>0||D)&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[s.jsx("span",{children:oe.totalTools>0?`${oe.finishedTools}/${oe.totalTools} tools finished`:"Preparing analysis..."}),s.jsx("span",{children:oe.totalTools>0?`${oe.percent}%`:"0%"})]}),s.jsx(Sg,{value:oe.totalTools>0?oe.percent:0,className:"h-2"})]}),q.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:D?"Starting analysis...":"No progress events captured."}):s.jsx("div",{className:"max-h-64 space-y-1 overflow-auto rounded border bg-muted/20 p-2",children:q.map((Q,je)=>s.jsxs("div",{className:"text-xs",children:[s.jsx("span",{className:"mr-2 font-mono text-muted-foreground",children:new Date(Q.ts).toLocaleTimeString()}),s.jsx(Qe,{variant:"outline",className:"mr-2 text-[10px]",children:Q.type}),s.jsx("span",{className:"break-all",children:typeof Q.payload.message=="string"?Q.payload.message:JSON.stringify(Q.payload)})]},`${Q.ts}-${je}`))}),!D&&H&&s.jsx(Ue,{className:"mt-2 border-green-200 bg-green-50/40 dark:border-green-900/40 dark:bg-green-950/10",children:s.jsxs(qe,{className:"pt-4 space-y-3",children:[s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-semibold",children:"Result overview"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[H.summary.toolsAnalyzed," tools analyzed, ",H.summary.toolsSkipped," skipped, across"," ",H.summary.serversAnalyzed," server",H.summary.serversAnalyzed!==1?"s":"","."]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[Z&&s.jsx(re,{asChild:!0,size:"sm",children:s.jsx(jt,{to:`/tool-analysis-results/${Z}`,children:"Open result details"})}),s.jsx(re,{asChild:!0,size:"sm",variant:"outline",children:s.jsx(jt,{to:"/tool-analysis-results",children:"View all results"})}),s.jsx(re,{type:"button",size:"sm",variant:"outline",onClick:()=>It("report"),children:"View inline report"})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[H.summary.issueCounts.critical>0&&s.jsxs(Qe,{className:"bg-red-600 text-white hover:bg-red-600",children:["Critical: ",H.summary.issueCounts.critical]}),H.summary.issueCounts.high>0&&s.jsxs(Qe,{className:"bg-orange-500 text-white hover:bg-orange-500",children:["High: ",H.summary.issueCounts.high]}),H.summary.issueCounts.medium>0&&s.jsxs(Qe,{className:"bg-amber-500 text-white hover:bg-amber-500",children:["Medium: ",H.summary.issueCounts.medium]}),H.summary.issueCounts.low>0&&s.jsxs(Qe,{className:"bg-blue-500 text-white hover:bg-blue-500",children:["Low: ",H.summary.issueCounts.low]}),H.summary.issueCounts.info>0&&s.jsxs(Qe,{variant:"outline",children:["Info: ",H.summary.issueCounts.info]}),Object.values(H.summary.issueCounts).every(Q=>Q===0)&&s.jsx(Qe,{className:"bg-green-600 text-white hover:bg-green-600",children:"No findings"})]})]})})]})]}),B==="report"&&H&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-semibold",children:"Report"}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:[H.summary.toolsAnalyzed," tools analyzed across ",H.summary.serversAnalyzed," server",H.summary.serversAnalyzed!==1?"s":"","."]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(re,{type:"button",size:"sm",variant:"outline",onClick:Re,children:"Back to Configure Analysis"}),Z&&s.jsxs(s.Fragment,{children:[s.jsx(re,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx(jt,{to:`/tool-analysis-results/${Z}`,children:"Open saved report"})}),s.jsx(re,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx(jt,{to:"/tool-analysis-results",children:"View all reports"})})]}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>IM(`tool-analysis-${Date.now()}.json`,`${JSON.stringify(H,null,2)}
138
- `,"application/json"),children:[s.jsx(Sa,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>IM(`tool-analysis-${Date.now()}.md`,WC(H),"text/markdown"),children:[s.jsx(Sa,{className:"mr-2 h-4 w-4"}),"Export Markdown"]})]})]}),s.jsx(K8,{report:H})]})]})};function $M(e,t,n){const r=new Blob([t],{type:n}),a=URL.createObjectURL(r),i=document.createElement("a");i.href=a,i.download=e,i.click(),URL.revokeObjectURL(a)}function lge(){const{source:e}=Rn(),[t,n]=v.useState([]),[r,a]=v.useState(!0),[i,o]=v.useState(null),[c,d]=v.useState(!1),[f,h]=v.useState("all"),[p,x]=v.useState(!1),g=async()=>{a(!0);try{n(await e.listToolAnalysisResults())}catch(N){Pe({title:"Could not load tool analysis results",description:N instanceof Error?N.message:String(N),variant:"destructive"})}finally{a(!1)}};v.useEffect(()=>{g()},[]);const j=v.useMemo(()=>Array.from(new Set(t.flatMap(N=>N.serverNames))).sort((N,E)=>N.localeCompare(E)),[t]),b=v.useMemo(()=>f==="all"?t:t.filter(N=>N.serverNames.includes(f)),[t,f]),y=v.useMemo(()=>t.find(N=>N.reportId===i)??null,[t,i]),S=async()=>{if(i){d(!0);try{await e.deleteToolAnalysisSavedResult(i),n(N=>N.filter(E=>E.reportId!==i)),Pe({title:"Tool analysis report deleted"}),o(null)}catch(N){Pe({title:"Could not delete report",description:N instanceof Error?N.message:String(N),variant:"destructive"})}finally{d(!1)}}},C=async(N,E)=>{try{const _=await e.getToolAnalysisSavedResult(N);E==="json"?$M(`${N}.json`,`${JSON.stringify(_,null,2)}
139
- `,"application/json"):$M(`${N}.md`,WC(_.report),"text/markdown")}catch(_){Pe({title:"Could not export saved report",description:_ instanceof Error?_.message:String(_),variant:"destructive"})}};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(_$,{className:"h-6 w-6"}),"Tool Analysis Results"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Browse persisted Analyze MCP Tools reports."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"MCP server"}),s.jsxs(Vc,{open:p,onOpenChange:x,children:[s.jsx(Hc,{asChild:!0,children:s.jsxs(re,{type:"button",variant:"outline",role:"combobox","aria-expanded":p,className:"h-9 w-[240px] justify-between font-normal",children:[s.jsx("span",{className:"truncate text-left",children:f==="all"?"All servers":f}),s.jsx(Dt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(Wo,{className:"w-[240px] p-0",align:"start",children:s.jsxs(Ho,{children:[s.jsx(Ko,{placeholder:"Search servers..."}),s.jsxs(Go,{children:[s.jsx(Yo,{children:"No servers found."}),s.jsxs(Xo,{children:[s.jsx(na,{value:"all servers",onSelect:()=>{h("all"),x(!1)},children:"All servers"}),j.map(N=>s.jsx(na,{value:N,onSelect:()=>{h(N),x(!1)},children:N},N))]})]})]})})]})]}),s.jsx(re,{variant:"outline",onClick:()=>{g()},disabled:r,children:r?"Refreshing...":"Refresh"}),s.jsx(re,{asChild:!0,variant:"outline",children:s.jsx(jt,{to:"/tool-analysis",children:"Analyze MCP Tools"})})]})]}),s.jsx(Ue,{children:s.jsx(qe,{className:"p-0",children:r?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"Loading tool analysis results..."}):t.length===0?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"No saved tool analysis reports yet."}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"border-b px-4 py-3",children:s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Showing ",s.jsx("span",{className:"font-medium text-foreground",children:b.length})," of"," ",s.jsx("span",{className:"font-medium text-foreground",children:t.length})," reports"]})}),b.length===0?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"No reports for the selected MCP server."}):s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs($t,{children:[s.jsx(tt,{children:"Report ID"}),s.jsx(tt,{children:"Evaluated"}),s.jsx(tt,{children:"Timestamp"}),s.jsx(tt,{children:"Issues"}),s.jsx(tt,{children:"Modes"}),s.jsx(tt,{className:"w-10"})]})}),s.jsx(Lr,{children:b.map(N=>s.jsxs($t,{children:[s.jsx(ze,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(jt,{to:`/tool-analysis-results/${N.reportId}`,className:"font-mono text-xs text-primary hover:underline",children:N.reportId}),s.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[N.assistantAgentName," · ",N.assistantAgentModel]})]})}),s.jsx(ze,{className:"text-[11px] text-muted-foreground",children:s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:["Servers: ",s.jsx("span",{className:"font-medium text-foreground",children:N.serverNames.length})," · Tools:"," ",s.jsx("span",{className:"font-medium text-foreground",children:N.summary.toolsAnalyzed})," · ","Skipped: ",s.jsx("span",{className:"font-medium text-foreground",children:N.summary.toolsSkipped})]}),s.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}`:""]})]})}),s.jsx(ze,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(vf,{className:"h-3 w-3"}),new Date(N.createdAt).toLocaleString()]})}),s.jsx(ze,{children:s.jsxs("div",{className:"flex flex-wrap gap-1",children:[["critical","high","medium","low","info"].map(E=>N.summary.issueCounts[E]>0?s.jsxs(Qe,{variant:"outline",className:"capitalize",children:[E,": ",N.summary.issueCounts[E]]},`${N.reportId}-${E}`):null),Object.values(N.summary.issueCounts).every(E=>E===0)&&s.jsx(Qe,{variant:"outline",children:"No issues"})]})}),s.jsx(ze,{children:s.jsxs("div",{className:"flex flex-wrap gap-1",children:[N.modes.metadataReview&&s.jsx(Qe,{variant:"outline",children:"metadata"}),N.modes.deeperAnalysis&&s.jsx(Qe,{variant:"outline",children:"deeper"})]})}),s.jsx(ze,{children:s.jsxs(uu,{children:[s.jsx(du,{asChild:!0,children:s.jsx(re,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Gm,{className:"h-4 w-4"})})}),s.jsxs(ll,{align:"end",children:[s.jsx(xr,{asChild:!0,children:s.jsx(jt,{to:`/tool-analysis-results/${N.reportId}`,children:"View"})}),s.jsxs(xr,{onSelect:()=>{C(N.reportId,"json")},children:[s.jsx(Sa,{className:"mr-2 h-3.5 w-3.5"})," Export JSON"]}),s.jsxs(xr,{onSelect:()=>{C(N.reportId,"markdown")},children:[s.jsx(Sa,{className:"mr-2 h-3.5 w-3.5"})," Export Markdown"]}),s.jsxs(xr,{className:"text-destructive",onSelect:E=>{E.preventDefault(),o(N.reportId)},children:[s.jsx(Aa,{className:"mr-2 h-3.5 w-3.5"})," Delete"]})]})]})})]},N.reportId))})]})]})})}),s.jsx(Ps,{open:!!i,onOpenChange:N=>!N&&o(null),children:s.jsxs(Xa,{children:[s.jsxs(Qa,{children:[s.jsx(Za,{children:"Delete tool analysis report?"}),s.jsx(es,{children:y?`Delete saved report '${y.reportId}' from disk? This cannot be undone.`:"Delete this saved report from disk? This cannot be undone."})]}),s.jsxs(Ja,{children:[s.jsx(ns,{disabled:c,children:"Cancel"}),s.jsx(ts,{onClick:N=>{N.preventDefault(),S()},disabled:c,children:c?"Deleting...":"Delete"})]})]})})]})}function DM(e,t,n){const r=new Blob([t],{type:n}),a=URL.createObjectURL(r),i=document.createElement("a");i.href=a,i.download=e,i.click(),URL.revokeObjectURL(a)}function cge(){const{id:e=""}=Zo(),t=Ea(),{source:n}=Rn(),[r,a]=v.useState(null),[i,o]=v.useState(!0),[c,d]=v.useState(!1),[f,h]=v.useState(!1),[p,x]=v.useState(!1);v.useEffect(()=>{let j=!0;return o(!0),d(!1),n.getToolAnalysisSavedResult(e).then(b=>{j&&a(b)}).catch(b=>{if(!j)return;const y=b instanceof Error?b.message:String(b);if(y.includes("(404)")){d(!0),a(null);return}Pe({title:"Could not load saved tool analysis report",description:y,variant:"destructive"})}).finally(()=>{j&&o(!1)}),()=>{j=!1}},[e,n]);const g=async()=>{x(!0);try{await n.deleteToolAnalysisSavedResult(e),Pe({title:"Tool analysis report deleted"}),t("/tool-analysis-results")}catch(j){Pe({title:"Could not delete report",description:j instanceof Error?j.message:String(j),variant:"destructive"})}finally{x(!1),h(!1)}};return i?s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading saved tool analysis report..."}):c||!r?s.jsxs("div",{className:"space-y-4",children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Tool Analysis Result"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Saved report not found."}),s.jsx(re,{asChild:!0,variant:"outline",children:s.jsx(jt,{to:"/tool-analysis-results",children:"Back to Tool Analysis Results"})})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"font-mono text-xl font-semibold",children:r.reportId}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:[new Date(r.createdAt).toLocaleString()," · ",r.serverNames.join(", ")||"—"]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(re,{asChild:!0,size:"sm",variant:"outline",children:s.jsx(jt,{to:"/tool-analysis-results",children:"Back to results"})}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>DM(`${r.reportId}.json`,`${JSON.stringify(r,null,2)}
140
- `,"application/json"),children:[s.jsx(Sa,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>DM(`${r.reportId}.md`,WC(r.report),"text/markdown"),children:[s.jsx(Sa,{className:"mr-2 h-4 w-4"}),"Export Markdown"]}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>h(!0),children:[s.jsx(Aa,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]}),s.jsx(K8,{report:r.report}),s.jsx(Ps,{open:f,onOpenChange:h,children:s.jsxs(Xa,{children:[s.jsxs(Qa,{children:[s.jsx(Za,{children:"Delete tool analysis report?"}),s.jsxs(es,{children:["Delete saved report '",r.reportId,"' from disk? This cannot be undone."]})]}),s.jsxs(Ja,{children:[s.jsx(ns,{disabled:p,children:"Cancel"}),s.jsx(ts,{onClick:j=>{j.preventDefault(),g()},disabled:p,children:p?"Deleting...":"Delete"})]})]})})]})}const uge=[{id:"configure",label:"Configure Debug Session"},{id:"run",label:"Run / Inspect Flow"},{id:"report",label:"Report / Export"}];function dge(e){return navigator.clipboard.writeText(e)}function fge(){return typeof window>"u"?"":window.location.port==="8685"?"http://127.0.0.1:8787":""}function pge(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 a=typeof r.payload.message=="string"?r.payload.message:JSON.stringify(r.payload);n.push(`- ${new Date(r.ts).toLocaleTimeString()} [${r.type}] ${a}`)}return`${n.join(`
141
- `)}
142
- `}function hge(){const{source:e}=Rn(),{servers:t,reload:n,loading:r}=Ga(),[a,i]=v.useState("configure"),[o,c]=v.useState(""),[d,f]=v.useState("pre_registered"),[h,p]=v.useState("local_callback"),[x,g]=v.useState(!0),[j,b]=v.useState(!0),[y,S]=v.useState(""),[C,N]=v.useState(""),[E,_]=v.useState(""),[P,O]=v.useState(""),[T,I]=v.useState("client_secret_basic"),[M,D]=v.useState("{}"),[R,q]=v.useState(""),[U,H]=v.useState(""),[J,Z]=v.useState(""),[F,z]=v.useState(""),[ee,B]=v.useState(""),[L,te]=v.useState(""),[ie,G]=v.useState(""),[de,oe]=v.useState(""),[ce,le]=v.useState(null),[fe,Ce]=v.useState(null),[ae,ke]=v.useState([]),[Ae,Ye]=v.useState(!1),[be,Re]=v.useState(!1),[Y,xe]=v.useState(!1),[ue,Oe]=v.useState("all"),[Ke,bt]=v.useState("all"),[It,Q]=v.useState("inspector"),je=v.useRef(null),Ne=v.useRef(null);v.useEffect(()=>()=>{je.current?.(),je.current=null},[]),v.useEffect(()=>{Ne.current?.scrollIntoView({behavior:"smooth",block:"end"})},[ae.length]);const $e=v.useMemo(()=>t.filter(pe=>pe.authType==="oauth2"),[t]),Be=$e.find(pe=>pe.id===o);v.useEffect(()=>{o&&($e.some(pe=>pe.id===o)||c(""))},[$e,o]);const et=v.useMemo(()=>{const pe=ce?.stepStates.length??0,De=ce?.stepStates.filter(Lt=>Lt.status==="completed"||Lt.status==="skipped").length??0,st=ce?.stepStates.filter(Lt=>Lt.status==="failed").length??0,yt=pe>0?Math.round((De+st)/pe*100):0;return{total:pe,completed:De,failed:st,percent:yt}},[ce]),Pt=v.useMemo(()=>(ce?.network??[]).filter(De=>!(ue!=="all"&&De.stepId!==ue||Ke==="error"&&!(De.phase==="response"&&(De.status??0)>=400)||Ke==="ok"&&!(De.phase==="response"&&(De.status??0)<400))),[ce?.network,ue,Ke]),Sn=!!fe,Nn=!!(ce&&(ce.status==="completed"||ce.status==="error"||ce.status==="stopped")),cr=pe=>{if(pe==="configure"||pe==="run"&&Sn||pe==="report"&&Nn)return i(pe)},ur=()=>{let pe;if(d==="dcr"&&M.trim())try{pe=JSON.parse(M)}catch{throw new Error("DCR metadata JSON is invalid")}if(!Be)throw new Error("Select an MCP server");return{profile:"latest",target:{serverName:Be.id,overrides:{authorizationServerMetadataUrl:J||void 0,authorizationEndpoint:F||void 0,tokenEndpoint:ee||void 0,registrationEndpoint:L||void 0,cimdUrl:R||void 0,resourceBaseUrl:ie||void 0}},registrationMethod:d,clientConfig:{preRegistered:d==="pre_registered"?{clientId:E.trim(),clientSecret:P.trim()||void 0,tokenEndpointAuthMethod:T||void 0}:void 0,dcr:d==="dcr"?{metadata:pe,tokenEndpointAuthMethod:T||void 0}:void 0,cimd:d==="cimd"?{cimdUrl:R||void 0,expectedClientId:U||void 0}:void 0},runtime:{redirectMode:h,scopes:y.split(/[,\s]+/).map(De=>De.trim()).filter(Boolean),resource:C.trim()||void 0,usePkce:j,codeChallengeMethod:"S256"},display:{showSensitiveValues:x}}},Dn=pe=>{je.current?.(),je.current=e.subscribeOAuthDebuggerSession(pe,De=>{ke(yt=>[...yt,De]),(De.type==="completed"||De.type==="error"||De.type==="stopped")&&Ye(!1),e.getOAuthDebuggerSession(pe).then(yt=>{le(yt.session),yt.session.status==="completed"&&i("report")}).catch(()=>{})})},dr=async()=>{Re(!0);try{const pe=ur(),De=await e.createOAuthDebuggerSession(pe);Ce(De.sessionId),le(De.session),ke([]),i("run"),Dn(De.sessionId);const st=await e.startOAuthDebuggerSession(De.sessionId);le(st.session),Ye(!0),(st.session.status==="waiting_for_user"||st.session.status==="waiting_for_browser_callback")&&Ye(!1)}catch(pe){Pe({title:"Could not start OAuth Debugger session",description:pe instanceof Error?pe.message:String(pe),variant:"destructive"})}finally{Re(!1)}},_r=async()=>{if(fe)try{Re(!0);const pe=await e.submitOAuthDebuggerManualCallback(fe,{redirectUrl:de.trim()||void 0});le(pe.session),oe(""),Ye(!0)}catch(pe){Pe({title:"Could not submit callback",description:pe instanceof Error?pe.message:String(pe),variant:"destructive"})}finally{Re(!1)}},Ur=async()=>{if(fe){xe(!0);try{const pe=await e.stopOAuthDebuggerSession(fe);if(Ye(!1),pe.status!=="running"){const De=await e.getOAuthDebuggerSession(fe);le(De.session),De.session.status==="completed"?i("report"):i("run")}}catch(pe){Pe({title:"Could not stop session",description:pe instanceof Error?pe.message:String(pe),variant:"destructive"})}finally{xe(!1)}}},qr=async()=>{je.current?.(),je.current=null,le(null),Ce(null),ke([]),Ye(!1),xe(!1),Re(!1),oe(""),Oe("all"),bt("all"),Q("inspector"),i("run"),await dr()},Yn=async pe=>{if(!(!fe||!ce))try{const De=await e.exportOAuthDebuggerSession(fe,pe);let st="";const yt=pe==="json"?"json":pe==="raw"?"txt":"md";typeof De=="string"?st=De:st=`${JSON.stringify(De,null,2)}
143
- `;const Lt=new Blob([st],{type:"text/plain;charset=utf-8"}),nn=URL.createObjectURL(Lt),ln=document.createElement("a");ln.href=nn,ln.download=`oauth-debugger-${fe}.${yt}`,ln.click(),URL.revokeObjectURL(nn)}catch(De){if(pe==="markdown"){const st=pge(ce,ae),yt=new Blob([st],{type:"text/markdown;charset=utf-8"}),Lt=URL.createObjectURL(yt),nn=document.createElement("a");nn.href=Lt,nn.download=`oauth-debugger-${ce.id}.md`,nn.click(),URL.revokeObjectURL(Lt);return}Pe({title:"Export failed",description:De instanceof Error?De.message:String(De),variant:"destructive"})}},Xt=fe?`${fge()}/api/oauth-debugger/sessions/${fe}/authorize`:void 0,En=pe=>pe==="error"?"destructive":pe==="warning"?"outline":"secondary";return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"OAuth Debugger"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Step-by-step OAuth flow debugging for MCP servers (latest MCP authorization draft profile)."})]}),s.jsx("div",{className:"flex flex-wrap items-center gap-2",children:uge.map(pe=>{const De=a===pe.id,st=pe.id==="configure"||pe.id==="run"&&Sn||pe.id==="report"&&Nn;return s.jsx("button",{type:"button",onClick:()=>st&&cr(pe.id),disabled:!st,className:"rounded-full",children:s.jsx(Qe,{variant:De?"default":"outline",className:st?"":"opacity-50",children:pe.label})},pe.id)})})]}),a==="configure"&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(Nt,{className:"text-base",children:"Target MCP Server"}),s.jsx(hs,{children:"Select one MCP server from Libraries and optionally override endpoints."})]}),s.jsxs(re,{type:"button",variant:"outline",size:"sm",onClick:()=>{n()},disabled:r,children:[s.jsx(Ca,{className:`mr-2 h-4 w-4 ${r?"animate-spin":""}`}),"Refresh Servers"]})]})}),s.jsx(qe,{className:"space-y-3",children:s.jsxs("div",{className:"max-w-xl space-y-2",children:[s.jsx(Fe,{children:"MCP Server"}),s.jsxs(bn,{value:o,onValueChange:c,children:[s.jsx(mn,{children:s.jsx(wn,{placeholder:"Select an MCP server"})}),s.jsx(vn,{children:$e.map(pe=>s.jsx(mt,{value:pe.id,children:pe.name||pe.id},pe.id))})]}),$e.length===0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["No MCP servers with OAuth configured found. Add OAuth 2.0 auth in"," ",s.jsx("a",{href:"/libraries/servers",className:"underline text-primary",children:"Manage Servers"}),"."]}),Be&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:[Be.transport," · ",Be.url||Be.command||"No URL/command"]})]})})]}),s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Client Registration Method"})}),s.jsxs(qe,{className:"space-y-3",children:[s.jsx("div",{className:"grid gap-2 md:grid-cols-3",children:[{id:"pre_registered",label:"Pre-registered client"},{id:"dcr",label:"Dynamic Client Registration (DCR)"},{id:"cimd",label:"Client ID Metadata Document (CIMD)"}].map(pe=>s.jsx("button",{type:"button",onClick:()=>f(pe.id),className:"rounded-md border p-3 text-left",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:`h-2.5 w-2.5 rounded-full ${d===pe.id?"bg-primary":"bg-muted-foreground/30"}`}),s.jsx("span",{className:"text-sm font-medium",children:pe.label})]})},pe.id))}),s.jsx("div",{className:"grid gap-3 md:grid-cols-1",children:s.jsxs("div",{className:"max-w-md space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Redirect mode"}),s.jsxs(bn,{value:h,onValueChange:pe=>p(pe),children:[s.jsx(mn,{children:s.jsx(wn,{})}),s.jsxs(vn,{children:[s.jsx(mt,{value:"local_callback",children:"Local callback (recommended)"}),s.jsx(mt,{value:"manual",children:"Manual paste redirect URL"})]})]})]})}),d==="pre_registered"&&s.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"client_id"}),s.jsx(ft,{value:E,onChange:pe=>_(pe.target.value)})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"client_secret (optional)"}),s.jsx(ft,{value:P,onChange:pe=>O(pe.target.value),type:"password"})]})]}),d==="cimd"&&s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"CIMD URL"}),s.jsx(ft,{value:R,onChange:pe=>q(pe.target.value),placeholder:"https://.../client-metadata.json"})]})]})]}),s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Runtime OAuth Inputs"})}),s.jsxs(qe,{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Scopes (space or comma separated)"}),s.jsx(ft,{value:y,onChange:pe=>S(pe.target.value),placeholder:"openid profile mcp"})]}),s.jsxs("div",{className:"flex items-center gap-2 md:col-span-2",children:[s.jsx(ra,{checked:j,onCheckedChange:pe=>b(!!pe)}),s.jsx(Fe,{children:"Use PKCE (S256)"})]})]})]}),s.jsxs("details",{className:"rounded-md border bg-card p-3 shadow-sm",children:[s.jsx("summary",{className:"cursor-pointer text-sm font-medium",children:"Advanced"}),s.jsxs("div",{className:"mt-3 space-y-4",children:[s.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Token endpoint auth method"}),s.jsx(ft,{value:T,onChange:pe=>I(pe.target.value),placeholder:"client_secret_basic / none / client_secret_post"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Resource / audience (optional)"}),s.jsx(ft,{value:C,onChange:pe=>N(pe.target.value),placeholder:"https://resource.example.com"})]})]}),d==="dcr"&&s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"DCR metadata JSON (optional overrides)"}),s.jsx(Wa,{value:M,onChange:pe=>D(pe.target.value),className:"min-h-32 font-mono text-xs"})]}),d==="cimd"&&s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Expected client_id (optional)"}),s.jsx(ft,{value:U,onChange:pe=>H(pe.target.value)})]}),s.jsxs("div",{className:"rounded-md border bg-background p-3",children:[s.jsx("div",{className:"mb-3 text-sm font-medium",children:"Endpoint overrides"}),s.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Authorization server metadata URL"}),s.jsx(ft,{value:J,onChange:pe=>Z(pe.target.value),placeholder:"https://.../.well-known/oauth-authorization-server"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Resource server base URL"}),s.jsx(ft,{value:ie,onChange:pe=>G(pe.target.value),placeholder:"https://resource.example.com"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Authorization endpoint"}),s.jsx(ft,{value:F,onChange:pe=>z(pe.target.value),placeholder:"https://.../authorize"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Token endpoint"}),s.jsx(ft,{value:ee,onChange:pe=>B(pe.target.value),placeholder:"https://.../token"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Registration endpoint (DCR)"}),s.jsx(ft,{value:L,onChange:pe=>te(pe.target.value),placeholder:"https://.../register"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"CIMD URL override"}),s.jsx(ft,{value:R,onChange:pe=>q(pe.target.value),placeholder:"https://.../client-metadata.json"})]})]})]}),s.jsxs(dc,{children:[s.jsx(fy,{className:"h-4 w-4"}),s.jsx(fc,{children:"Secrets display"}),s.jsxs(pc,{className:"space-y-2",children:[s.jsx("p",{children:"This debugger is configured to show full tokens/secrets in network logs and exports."}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ra,{checked:!x,onCheckedChange:pe=>g(pe===!1)}),s.jsx(Fe,{children:"Hide sensitive values in inspector"})]})]})]})]})]}),s.jsx("div",{className:"flex justify-end",children:s.jsxs(re,{type:"button",onClick:()=>{dr()},disabled:be,children:[be&&s.jsx(or,{className:"mr-2 h-4 w-4 animate-spin"}),"Start OAuth Debug Session"]})})]}),a==="run"&&s.jsx("div",{className:"space-y-4",children:s.jsxs("div",{className:"grid gap-4 xl:grid-cols-[1.2fr_1fr]",children:[s.jsxs(Ue,{className:"xl:col-span-1",children:[s.jsx(St,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(Nt,{className:"text-base",children:"Progress"}),s.jsx(hs,{children:"Visual OAuth flow guide with live session events and next-step actions."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[ce?.uiHints.authorizationUrl&&Xt&&s.jsx(re,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsxs("a",{href:Xt,target:"_blank",rel:"noopener noreferrer",children:[s.jsx(Ah,{className:"mr-2 h-4 w-4"}),"Open Authorization URL"]})}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{qr()},disabled:be,children:[s.jsx(Ca,{className:"mr-2 h-4 w-4"}),"Restart"]}),fe&&s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{Ur()},disabled:Y||!fe,children:[(Y||Ae)&&Y&&s.jsx(or,{className:"mr-2 h-4 w-4 animate-spin"}),s.jsx(bh,{className:"mr-2 h-4 w-4"}),"Stop Debug Session"]})]})]})}),s.jsxs(qe,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[s.jsxs("span",{children:[et.completed+et.failed,"/",et.total," steps"]}),s.jsxs("span",{children:[et.percent,"%"]})]}),s.jsx(Sg,{value:et.percent,className:"h-2"})]}),ce?.status==="waiting_for_user"&&s.jsx(Ue,{children:s.jsxs(qe,{className:"pt-4 space-y-2",children:[s.jsx("div",{className:"text-sm font-medium",children:"Manual callback required"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Open the authorization URL, complete authentication, then paste the final redirect URL here."}),s.jsx(Wa,{value:de,onChange:pe=>oe(pe.target.value),placeholder:"Paste the final redirect URL (with code and state)",className:"min-h-24 text-xs font-mono"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(re,{type:"button",size:"sm",onClick:()=>{_r()},disabled:be||!de.trim(),children:[be&&s.jsx(or,{className:"mr-2 h-4 w-4 animate-spin"}),"Continue"]}),ce.uiHints.authorizationUrl&&Xt&&s.jsx(re,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx("a",{href:Xt,target:"_blank",rel:"noopener noreferrer",children:"Open Authorization URL"})})]})]})}),ce?.status==="waiting_for_browser_callback"&&s.jsxs(dc,{children:[s.jsx(fy,{className:"h-4 w-4"}),s.jsx(fc,{children:"Waiting for browser callback"}),s.jsxs(pc,{className:"space-y-1",children:[s.jsx("p",{className:"text-xs",children:"Complete the authorization flow in your browser. MCP Lab is listening for the callback at:"}),s.jsx("p",{className:"text-xs font-mono break-all",children:ce.uiHints.callbackUrl}),ce.uiHints.authorizationUrl&&Xt&&s.jsx("div",{className:"pt-2",children:s.jsx(re,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsxs("a",{href:Xt,target:"_blank",rel:"noopener noreferrer",children:[s.jsx(Ah,{className:"mr-2 h-4 w-4"}),"Open Authorization URL"]})})})]})]}),s.jsx("div",{className:"space-y-2",children:ce?.stepStates.map(pe=>s.jsxs("div",{className:"rounded-md border p-3",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium",children:pe.title}),s.jsx("div",{className:"text-xs text-muted-foreground",children:pe.description})]}),s.jsx(Qe,{variant:pe.status==="failed"?"destructive":pe.status==="completed"?"outline":pe.status==="active"?"secondary":"outline",className:pe.status==="completed"?"border-emerald-300 bg-emerald-50 text-emerald-700":void 0,children:pe.status})]}),pe.outcomeSummary&&s.jsx("p",{className:"mt-2 text-xs text-muted-foreground break-all",children:pe.outcomeSummary})]},pe.id))||s.jsx("p",{className:"text-sm text-muted-foreground",children:"No steps yet."})})]})]}),s.jsx("div",{className:"space-y-4 xl:col-span-1",children:s.jsxs(Ue,{children:[s.jsxs(St,{className:"pb-3",children:[s.jsx(Nt,{className:"text-base",children:"Inspect"}),s.jsx(hs,{children:"Live events and network requests/responses for the OAuth flow."})]}),s.jsx(qe,{className:"space-y-3",children:s.jsxs(dg,{value:It,onValueChange:pe=>Q(pe),children:[s.jsxs(Df,{className:"grid grid-cols-2",children:[s.jsx(gs,{value:"inspector",children:"Network Inspector"}),s.jsx(gs,{value:"events",children:"Live Debug"})]}),s.jsx(ff,{value:"events",className:"mt-3",children:s.jsxs("div",{className:"max-h-64 space-y-1 overflow-auto rounded-md border bg-muted/10 p-3 text-xs",children:[ae.length===0?s.jsx("p",{className:"text-muted-foreground",children:"No events yet."}):ae.map((pe,De)=>s.jsxs("div",{className:"break-all",children:[s.jsx("span",{className:"mr-2 font-mono text-muted-foreground",children:new Date(pe.ts).toLocaleTimeString()}),s.jsx(Qe,{variant:"outline",className:"mr-2 text-[10px]",children:pe.type}),typeof pe.payload.message=="string"?pe.payload.message:JSON.stringify(pe.payload)]},`${pe.ts}-${De}`)),s.jsx("div",{ref:Ne})]})}),s.jsxs(ff,{value:"inspector",className:"space-y-3 mt-3",children:[s.jsxs("div",{className:"grid gap-2 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Filter by step"}),s.jsxs(bn,{value:ue,onValueChange:Oe,children:[s.jsx(mn,{className:"h-8",children:s.jsx(wn,{})}),s.jsxs(vn,{children:[s.jsx(mt,{value:"all",children:"All steps"}),(ce?.stepStates??[]).map(pe=>s.jsx(mt,{value:pe.id,children:pe.title},pe.id))]})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Filter by status"}),s.jsxs(bn,{value:Ke,onValueChange:bt,children:[s.jsx(mn,{className:"h-8",children:s.jsx(wn,{})}),s.jsxs(vn,{children:[s.jsx(mt,{value:"all",children:"All"}),s.jsx(mt,{value:"ok",children:"Successful responses"}),s.jsx(mt,{value:"error",children:"Error responses"})]})]})]})]}),s.jsx("div",{className:"max-h-[34rem] space-y-2 overflow-auto",children:Pt.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No network exchanges captured yet."}):Pt.map(pe=>s.jsxs("details",{className:"rounded-md border p-3",children:[s.jsx("summary",{className:"cursor-pointer list-none",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium",children:pe.label}),s.jsxs("div",{className:"text-xs text-muted-foreground break-all",children:[pe.method?`${pe.method} `:"",pe.url]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Qe,{variant:"outline",children:pe.phase}),typeof pe.status=="number"&&s.jsx(Qe,{variant:pe.status>=400?"destructive":"secondary",children:pe.status})]})]})}),s.jsxs("div",{className:"mt-3 space-y-3",children:[s.jsxs("div",{children:[s.jsx("div",{className:"mb-1 text-xs font-medium",children:"Headers"}),s.jsx("pre",{className:"max-h-40 overflow-auto whitespace-pre rounded bg-muted p-2 text-xs",children:JSON.stringify(pe.headers,null,2)})]}),pe.bodyText&&s.jsxs("div",{children:[s.jsx("div",{className:"mb-1 text-xs font-medium",children:"Body"}),s.jsx("pre",{className:"max-h-64 overflow-auto whitespace-pre rounded bg-muted p-2 text-xs",children:pe.bodyText})]}),s.jsx("div",{className:"flex gap-2",children:s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{dge(JSON.stringify(pe,null,2))},children:[s.jsx(Ui,{className:"mr-2 h-4 w-4"}),"Copy JSON"]})})]})]},pe.id))})]})]})})]})})]})}),a==="report"&&ce&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-semibold",children:"Report / Export"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"OAuth debug session summary, validations, and trace exports."})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(re,{type:"button",size:"sm",variant:"outline",onClick:()=>i("configure"),children:"Back to Configure"}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{Yn("json")},children:[s.jsx(Sa,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{Yn("markdown")},children:[s.jsx(Sa,{className:"mr-2 h-4 w-4"}),"Export Markdown"]}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{Yn("raw")},children:[s.jsx(Sa,{className:"mr-2 h-4 w-4"}),"Copy/Export Raw Trace"]})]})]}),s.jsxs(dc,{children:[s.jsx(fy,{className:"h-4 w-4"}),s.jsx(fc,{children:"Secrets display mode"}),s.jsx(pc,{children:x?"This session is configured to show full tokens and secrets in network logs/exports.":"Sensitive values are hidden in the inspector for this session."})]}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[s.jsx(Ue,{children:s.jsxs(qe,{className:"pt-4",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Status"}),s.jsx("div",{className:"text-lg font-semibold",children:ce.status})]})}),s.jsx(Ue,{children:s.jsxs(qe,{className:"pt-4",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Requests"}),s.jsx("div",{className:"text-lg font-semibold",children:ce.networkSummary.requestCount})]})}),s.jsx(Ue,{children:s.jsxs(qe,{className:"pt-4",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Network errors"}),s.jsx("div",{className:"text-lg font-semibold",children:ce.networkSummary.errorCount})]})}),s.jsx(Ue,{children:s.jsxs(qe,{className:"pt-4",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Validation findings"}),s.jsx("div",{className:"text-lg font-semibold",children:ce.validations.length})]})})]}),s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Key values"})}),s.jsxs(qe,{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx(Fe,{className:"text-xs",children:"Issuer"}),s.jsx("p",{className:"text-sm break-all",children:ce.summary?.issuer||"-"})]}),s.jsxs("div",{children:[s.jsx(Fe,{className:"text-xs",children:"Client ID"}),s.jsx("p",{className:"text-sm break-all",children:ce.summary?.clientId||"-"})]}),s.jsxs("div",{children:[s.jsx(Fe,{className:"text-xs",children:"Redirect URI"}),s.jsx("p",{className:"text-sm break-all",children:ce.summary?.redirectUri||"-"})]}),s.jsxs("div",{children:[s.jsx(Fe,{className:"text-xs",children:"Token endpoint status"}),s.jsx("p",{className:"text-sm",children:ce.summary?.tokenEndpointStatus??"-"})]}),s.jsxs("div",{children:[s.jsx(Fe,{className:"text-xs",children:"Token type"}),s.jsx("p",{className:"text-sm",children:ce.summary?.tokenType||"-"})]}),s.jsxs("div",{children:[s.jsx(Fe,{className:"text-xs",children:"Scopes granted"}),s.jsx("p",{className:"text-sm break-all",children:(ce.summary?.grantedScopes??[]).join(", ")||"-"})]})]})]}),s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Validation findings"})}),s.jsx(qe,{className:"space-y-2",children:ce.validations.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No validation findings recorded."}):ce.validations.map((pe,De)=>s.jsxs("div",{className:"rounded-md border p-3",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.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:De+1}),s.jsx("span",{className:"font-bold",children:pe.title})]}),s.jsx(Qe,{variant:En(pe.severity),children:pe.severity})]}),s.jsxs("p",{className:"text-sm",children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",pe.detail]}),pe.recommendation&&s.jsxs("div",{className:"mt-2 rounded-md border px-2.5 py-2 text-xs",children:[s.jsx("div",{className:"mb-1 font-medium text-muted-foreground",children:"Suggested improvement"}),s.jsx("p",{children:pe.recommendation})]}),s.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Step: ",pe.stepId,pe.specReference&&s.jsxs(s.Fragment,{children:[" · ",s.jsx("a",{href:pe.specReference,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"Spec reference"})]})]})]},pe.id))})]})]})]})}const $j="mcplab.runEvaluation.activeJobId",mge=()=>{const[e]=Yi(),[t,n]=v.useState(""),[r,a]=v.useState("1"),[i,o]=v.useState(!1),[c,d]=v.useState(0),[f,h]=v.useState([]),[p,x]=v.useState(!1),[g,j]=v.useState(!1),[b,y]=v.useState(""),[S,C]=v.useState(null),[N,E]=v.useState([]),[_,P]=v.useState([]),[O,T]=v.useState(!0),[I,M]=v.useState(""),[D,R]=v.useState(""),[q,U]=v.useState(!1),[H,J]=v.useState([]),[Z,F]=v.useState(null),z=v.useRef(null),ee=v.useRef(null),{configs:B,reload:L}=Nf(),{source:te}=Rn(),ie=xg("snapshots",!1),{agents:G,scenarios:de,reload:oe}=Ga(),ce=b.trim(),le=ce?`/results/${encodeURIComponent(ce)}${t?`?configId=${encodeURIComponent(t)}`:""}`:"/results",fe=B.find(Q=>Q.id===t),Ce=e.get("configId"),ae=v.useMemo(()=>{if(!fe)return[];const Q=new Map,je=fe.agentEntries&&fe.agentEntries.length>0?fe.agentEntries:fe.agents.map(Ne=>({kind:"inline",agent:Ne}));for(const Ne of je){if(Ne.kind==="inline"){const Be=Ne.agent.id;Q.has(Be)||Q.set(Be,Ne.agent);continue}const $e=G.find(Be=>Be.id===Ne.ref);$e&&!Q.has($e.id)&&Q.set($e.id,$e)}for(const Ne of G)Q.has(Ne.id)||Q.set(Ne.id,Ne);return Array.from(Q.values())},[fe,G]),ke=v.useMemo(()=>{if(!fe)return[];const Q=new Map,je=fe.scenarioEntries&&fe.scenarioEntries.length>0?fe.scenarioEntries:fe.scenarios.map(Ne=>({kind:"inline",scenario:Ne}));for(const Ne of je){if(Ne.kind==="inline"){Q.has(Ne.scenario.id)||Q.set(Ne.scenario.id,Ne.scenario);continue}const $e=de.find(Be=>Be.id===Ne.ref);$e&&!Q.has($e.id)&&Q.set($e.id,$e)}return Array.from(Q.values())},[fe,de]);v.useEffect(()=>{Ce&&B.some(Q=>Q.id===Ce)&&n(Ce)},[Ce,B]);const Ae=v.useRef("");v.useEffect(()=>{const Q=fe?`${fe.id}::${fe.sourcePath??""}`:"";if(Q===Ae.current)return;if(Ae.current=Q,!fe){E([]),P([]);return}const je=ae.filter(Ne=>(fe.runDefaults?.selectedAgentNames??[]).includes(Ne.id)).map(Ne=>Ne.id);E(je.length>0?je:ae.map(Ne=>Ne.id)),P(ke.map(Ne=>Ne.id)),T(!0)},[fe?.id,fe?.sourcePath,ae,ke]);const Ye=async()=>{if(!fe?.sourcePath){h($e=>[...$e,`[${new Date().toLocaleTimeString()}] Missing source path for selected config.`]);return}const Q=ae.filter($e=>N.includes($e.id));if(Q.length===0){h($e=>[...$e,`[${new Date().toLocaleTimeString()}] Select at least one agent.`]);return}const je=ke.filter($e=>_.includes($e.id));if(je.length===0){h($e=>[...$e,`[${new Date().toLocaleTimeString()}] Select at least one test.`]);return}o(!0),x(!1),j(!1),y("");const Ne=(fe.serverEntries??[]).some($e=>$e.kind==="referenced")||(fe.agentEntries??[]).some($e=>$e.kind==="referenced")||(fe.scenarioEntries??[]).some($e=>$e.kind==="referenced")?"refs-composed":"single-file/inline";h([`[${new Date().toLocaleTimeString()}] Starting evaluation run...`,`[${new Date().toLocaleTimeString()}] Config=${fe.name} mode=${Ne} agents=${Q.map($e=>$e.name||$e.id).join(", ")} tests=${je.map($e=>$e.id).join(", ")} runs=${Number(r)} snapshotEval=${ie&&O?"on":"off"}${I.trim()?` note=${I.trim()}`:""}`]),d(10);try{const{jobId:$e}=await te.startRun({configPath:fe.sourcePath,runsPerScenario:Number(r),agents:Q.map(Be=>Be.id),scenarioIds:je.map(Be=>Be.id),applySnapshotEval:ie?O:!1,runNote:I.trim()?I.trim():void 0});C($e),ue($e),It($e),Oe()}catch($e){const Be=$e instanceof Error?$e.message:String($e),et=Be.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(Pt=>[...Pt,`[${new Date().toLocaleTimeString()}] Error: ${Be}${et}`]),o(!1),d(0),C(null)}},be=()=>{Ye()},Re=()=>{S&&te.stopRun(S),ee.current?.(),ee.current=null,xe(),C(null),o(!1),x(!1),j(!0),h(Q=>[...Q,`[${new Date().toLocaleTimeString()}] Run aborted by user.`]),Oe()},Y=async()=>{if(b){U(!0);try{const Q=await te.createSnapshotFromRun(b,D.trim()||void 0);Pe({title:"Snapshot saved",description:`Created ${Q.name} (${Q.id})`}),D.trim()||R(Q.name)}catch(Q){Pe({title:"Could not save snapshot",description:Q instanceof Error?Q.message:String(Q),variant:"destructive"})}finally{U(!1)}}};v.useEffect(()=>{z.current&&(z.current.scrollTop=z.current.scrollHeight)},[f]),v.useEffect(()=>()=>{ee.current?.()},[]),v.useEffect(()=>{if(S||p)return;let Q="";try{Q=sessionStorage.getItem($j)??""}catch{Q=""}if(Q)return C(Q),o(!0),x(!1),j(!1),h(je=>je.length>0?je:[`[${new Date().toLocaleTimeString()}] Reattached to in-progress evaluation run...`]),It(Q),()=>{}},[S,p]);const xe=()=>{try{sessionStorage.removeItem($j)}catch{}},ue=Q=>{try{sessionStorage.setItem($j,Q)}catch{}},Oe=async()=>{try{const Q=await te.getRunQueue();J(Q.queued),F(Q.active)}catch{}},Ke=()=>{L(),oe()};v.useEffect(()=>{Ke(),Oe();const Q=()=>{Ke(),Oe()};return window.addEventListener("focus",Q),()=>{window.removeEventListener("focus",Q)}},[L,oe]);const bt=async Q=>{try{await te.removeQueuedRun(Q),J(je=>je.filter(Ne=>Ne.jobId!==Q))}catch(je){const Ne=je instanceof Error?je.message:String(je);if(Ne.includes("Use the /stop endpoint"))try{await te.stopRun(Q)}catch{}else Pe({title:"Could not remove queued run",description:Ne,variant:"destructive"})}Oe()},It=Q=>{ee.current?.(),ee.current=te.subscribeRunJob(Q,je=>{const Ne=new Date(je.ts).toLocaleTimeString();if(je.type==="queued"){h($e=>{const Be=je.payload.position?` (position ${je.payload.position})`:"",et=`[${Ne}] Run queued${Be}. Waiting for active run to finish...`;return $e.includes(et)?$e:[...$e,et]}),d(5);return}if(je.type==="started"&&(h($e=>{const Be=`[${Ne}] Run started.`;return $e.includes(Be)?$e:[...$e,Be]}),d($e=>Math.max($e,30)),j(!1)),je.type==="log"){const $e=String(je.payload.message??"").trim();$e&&(h(Be=>{const et=`[${Ne}] ${$e}`;return Be.includes(et)?Be:[...Be,et]}),d(Be=>{const et=$e.toLowerCase();if(et.startsWith("loading mcp evaluation config"))return Math.max(Be,15);if(et.startsWith("loaded config"))return Math.max(Be,20);if(et.startsWith("selected "))return Math.max(Be,30);if(et.startsWith("using requested agents")||et.startsWith("using resolved default agents"))return Math.max(Be,35);if(et.startsWith("expanded to "))return Math.max(Be,45);if(et.startsWith("running evaluation"))return Math.max(Be,50);const Pt=et.match(/^scenario (\d+)\/(\d+) finished:/);if(Pt){const Sn=Number(Pt[1]),Nn=Number(Pt[2]);return Math.max(Be,50+Math.round(Sn/Nn*25))}return et.startsWith("evaluation execution finished")?Math.max(Be,78):et.startsWith("applying snapshot evaluation policy")?Math.max(Be,82):et.includes("snapshot evaluation applied")||et.includes("snapshot evaluation enabled")?Math.max(Be,88):et.startsWith("writing results to ")?Math.max(Be,94):et.startsWith("run finished:")?Math.max(Be,98):Be}))}if(je.type==="completed"){const $e=String(je.payload.runId??"").trim();if(h(Be=>{const et=`[${Ne}] Run completed.`;return Be.includes(et)?Be:[...Be,et]}),je.payload.snapshotEval&&typeof je.payload.snapshotEval=="object"){const Be=je.payload.snapshotEval;h(et=>{const Pt=`[${Ne}] Snapshot eval (${Be.mode??"warn"}) baseline=${Be.baseline_snapshot_id??"-"} score=${Be.overall_score??"-"} status=${Be.status??"-"}`;return et.includes(Pt)?et:[...et,Pt]})}d(100),o(!1),x(!0),j(!1),y($e),xe(),C(null),ee.current?.(),ee.current=null,Oe()}if(je.type==="error"){const $e=String(je.payload.message??"Unknown error"),Be=$e.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(et=>[...et,`[${Ne}] Error: ${$e}${Be}`]),o(!1),x(!1),j(!1),d(0),xe(),C(null),ee.current?.(),ee.current=null,Oe()}})};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(rc,{className:"h-6 w-6"}),"Run Evaluation"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Execute evaluation scenarios against MCP servers"})]}),s.jsx(Ue,{children:s.jsxs(qe,{className:"pt-6 space-y-4",children:[s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Fe,{children:"MCP Evaluation"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(bn,{value:t,onValueChange:n,children:[s.jsx(mn,{children:s.jsx(wn,{placeholder:"Select a config"})}),s.jsx(vn,{children:B.map(Q=>s.jsx(mt,{value:Q.id,children:Q.name},Q.id))})]}),s.jsx(re,{type:"button",variant:"outline",size:"icon",className:"h-10 w-10 shrink-0",onClick:Ke,"aria-label":"Refresh configs",title:"Refresh configs",children:s.jsx(Ca,{className:"h-4 w-4"})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Fe,{children:"Variance Runs"}),s.jsx(ft,{type:"number",min:"1",max:"10",value:r,onChange:Q=>a(Q.target.value)})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Fe,{htmlFor:"run-note",children:"Run Note"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[I.length,"/500"]})]}),s.jsx(Wa,{id:"run-note",value:I,onChange:Q=>M(Q.target.value.slice(0,500)),placeholder:"Optional context for this run (for example: mcp-server v1.8.2 #staging)",rows:2})]}),fe&&s.jsxs("div",{className:"space-y-2",children:[ie&&fe.snapshotEval?.enabled&&s.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 (",fe.snapshotEval.mode,") · baseline:"," ",s.jsx("span",{className:"font-mono",children:fe.snapshotEval.baselineSnapshotId??"none"})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Fe,{children:"Agents"}),s.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[s.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>E(ae.map(Q=>Q.id)),children:"Select all"}),s.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>E([]),children:"Clear"})]})]}),s.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:ae.map(Q=>{const je=N.includes(Q.id);return s.jsxs("label",{className:"flex items-center gap-2 text-sm rounded-md border p-2",children:[s.jsx(ra,{checked:je,onCheckedChange:Ne=>{const $e=Ne===!0;E(Be=>$e?[...Be,Q.id]:Be.filter(et=>et!==Q.id))}}),s.jsx("span",{children:Q.name||Q.id})]},Q.id)})}),ae.length===0&&s.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."})]}),fe&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Fe,{children:"Tests"}),s.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[s.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>P(ke.map(Q=>Q.id)),children:"Select all"}),s.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>P([]),children:"Clear"})]})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[_.length," of ",ke.length," selected"]}),s.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:ke.map(Q=>{const je=_.includes(Q.id);return s.jsxs("label",{className:"flex items-start gap-2 text-sm rounded-md border p-2",children:[s.jsx(ra,{checked:je,onCheckedChange:Ne=>{const $e=Ne===!0;P(Be=>$e?[...Be,Q.id]:Be.filter(et=>et!==Q.id))}}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:"block font-medium",children:Q.name||Q.id}),s.jsx("span",{className:"block font-mono text-xs text-muted-foreground truncate",children:Q.id})]})]},Q.id)})})]}),ie&&s.jsxs("label",{className:"flex items-center gap-2 text-sm rounded-md border p-2",children:[s.jsx(ra,{checked:O,onCheckedChange:Q=>T(Q===!0)}),s.jsx("span",{children:"Apply snapshot evaluation policy (if configured)"})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(re,{onClick:be,disabled:!t||ae.length>0&&N.length===0||ke.length>0&&_.length===0,children:[s.jsx(rc,{className:"mr-2 h-4 w-4"}),Z?"Queue Run":"Run"]}),i&&s.jsxs(re,{variant:"destructive",onClick:Re,children:[s.jsx(bh,{className:"mr-2 h-4 w-4"}),"Stop"]})]})]})}),(i||f.length>0)&&s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Nt,{className:"text-base",children:"Progress"}),s.jsxs("span",{className:"text-xs text-muted-foreground font-mono",children:[Math.round(c),"%"]})]})}),s.jsxs(qe,{className:"space-y-4",children:[s.jsx(Sg,{value:c,className:"h-2"}),s.jsx("div",{ref:z,className:"h-64 overflow-auto rounded-md border bg-muted/30 p-3 font-mono text-xs space-y-0.5",children:f.map((Q,je)=>s.jsx("div",{className:Q.includes("✓")?"text-success":Q.includes("aborted")?"text-destructive":"text-foreground",children:Q},je))})]})]}),s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(Nt,{className:"inline-flex items-center gap-2 text-base",children:[s.jsx(vf,{className:"h-4 w-4"}),"Run Queue"]}),s.jsx(re,{variant:"ghost",size:"sm",onClick:()=>{Oe()},children:s.jsx(Ca,{className:"h-3 w-3"})})]})}),s.jsx(qe,{children:!Z&&H.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No active or queued runs. Start a run above."}):s.jsxs("div",{className:"space-y-2",children:[Z&&s.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===Z.jobId?"ring-2 ring-primary/40":""}`,onClick:()=>{S!==Z.jobId&&(C(Z.jobId),ue(Z.jobId),o(!0),x(!1),j(!1),h([`[${new Date().toLocaleTimeString()}] Attached to running job ${Z.jobId}...`]),d(10),It(Z.jobId))},title:"Click to view progress",children:[s.jsxs("div",{className:"min-w-0 flex items-center gap-2",children:[s.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"}),s.jsx("span",{className:"font-mono text-xs",children:Z.runParams.configPath.split("/").pop()??Z.runParams.configPath}),Z.runParams.agents&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:["agents: ",Z.runParams.agents.join(", ")]}),Z.runParams.runNote&&s.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["note: ",Z.runParams.runNote]})]}),s.jsxs(re,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-destructive hover:text-destructive hover:bg-destructive/10",onClick:Q=>{Q.stopPropagation(),Z&&(te.stopRun(Z.jobId),Oe())},title:"Stop running job",children:[s.jsx(bh,{className:"mr-1 h-3 w-3"}),"Stop"]})]}),H.map((Q,je)=>{const Ne=Q.runParams.configPath.split("/").pop()??Q.runParams.configPath;return s.jsxs("div",{className:"flex items-center justify-between rounded-md border p-2 text-sm",children:[s.jsxs("div",{className:"min-w-0 flex items-center gap-2",children:[s.jsxs("span",{className:"inline-flex items-center rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",children:["#",je+1," Queued"]}),s.jsx("span",{className:"font-mono text-xs",children:Ne}),Q.runParams.agents&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:["agents: ",Q.runParams.agents.join(", ")]}),Q.runParams.runNote&&s.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["note: ",Q.runParams.runNote]})]}),s.jsx(re,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:()=>{bt(Q.jobId)},title:"Remove from queue",children:s.jsx(ys,{className:"h-4 w-4"})})]},Q.jobId)})]})})]}),g&&!i&&!p&&s.jsx(Ue,{className:"border-amber-300/60 bg-amber-50/40",children:s.jsx(qe,{className:"pt-6",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[s.jsx(bh,{className:"h-5 w-5 text-amber-700"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"font-medium",children:"Run stopped"}),s.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."})]}),s.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[s.jsx(re,{type:"button",variant:"outline",onClick:()=>{h([]),d(0),j(!1)},children:"Clear Progress"}),s.jsxs(re,{type:"button",onClick:be,disabled:!t,children:[s.jsx(rc,{className:"mr-2 h-4 w-4"}),"Run Again"]})]})]})})}),p&&s.jsx(Ue,{className:"border-success/50",children:s.jsxs(qe,{className:"pt-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(nc,{className:"h-6 w-6 text-success"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Evaluation Complete"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"All scenarios have been evaluated successfully."})]}),s.jsx(re,{asChild:!0,className:"ml-auto",children:s.jsx(jt,{to:le,children:ce?"View Results":"View Runs"})})]}),ie&&ce&&s.jsxs("div",{className:"mt-4 flex flex-wrap items-end gap-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Snapshot name (optional)"}),s.jsx(ft,{value:D,onChange:Q=>R(Q.target.value),placeholder:"e.g. baseline-v1",className:"h-8 w-64"})]}),s.jsx(re,{type:"button",variant:"outline",size:"sm",onClick:()=>{Y()},disabled:q,children:q?"Saving...":"Save Snapshot"})]})]})})]})};function vge(e){const t=Array.from(new Map(e.scenarios.map(i=>{const o=String(i.scenarioId??"").trim(),c=String(i.scenarioName??"").trim();return!o&&!c?null:[o||c,c||o]}).filter(i=>!!i)).values()),n=Array.from(new Set(e.scenarios.map(i=>i.agentName).filter(Boolean))),r=t.slice(0,2).join(", "),a=t.length>2?` +${t.length-2}`:"";return{scenarioCount:t.length,agentCount:n.length,scenarioPreview:r?`${r}${a}`:"n/a"}}const gge=()=>{const{source:e}=Rn(),[t,n]=v.useState([]),[r,a]=v.useState(!1),[i,o]=v.useState(null),[c,d]=v.useState(!1),[f,h]=v.useState("timestamp"),[p,x]=v.useState("desc"),[g,j]=v.useState("all"),[b,y]=v.useState(!1),S=M=>{if(f===M){x(D=>D==="asc"?"desc":"asc");return}h(M),x(M==="timestamp"?"desc":"asc")},C=async()=>{a(!0);try{n(await e.listResults())}catch(M){Pe({title:"Could not load results",description:M instanceof Error?M.message:String(M),variant:"destructive"})}finally{a(!1)}};v.useEffect(()=>{let M=!0;return a(!0),e.listResults().then(D=>{M&&n(D)}).catch(D=>{M&&Pe({title:"Could not load results",description:D instanceof Error?D.message:String(D),variant:"destructive"})}).finally(()=>{M&&a(!1)}),()=>{M=!1}},[e]);const N=v.useMemo(()=>{const M=new Set;return t.forEach(D=>{D.scenarios.forEach(R=>{const q=String(R.scenarioName??"").trim(),U=String(R.scenarioId??"").trim(),H=q||U;H&&M.add(H)})}),Array.from(M).sort((D,R)=>D.localeCompare(R))},[t]),E=v.useMemo(()=>g==="all"?t:t.filter(M=>M.scenarios.some(D=>{const R=String(D.scenarioName??"").trim(),q=String(D.scenarioId??"").trim();return(R||q)===g})),[t,g]),_=v.useMemo(()=>{const M=(R,q)=>R===null&&q===null?0:R===null?1:q===null?-1:p==="asc"?R-q:q-R;return[...E].sort((R,q)=>{if(f==="toolTokens")return M(R.toolTokenUsage?.totalTokens??null,q.toolTokenUsage?.totalTokens??null);let U=0;return f==="id"&&(U=R.id.localeCompare(q.id)),f==="timestamp"&&(U=new Date(R.timestamp).getTime()-new Date(q.timestamp).getTime()),f==="passRate"&&(U=R.overallPassRate-q.overallPassRate),f==="scenarios"&&(U=R.totalScenarios-q.totalScenarios),f==="avgToolCalls"&&(U=R.avgToolCalls-q.avgToolCalls),p==="asc"?U:-U})},[E,f,p]),P=M=>f!==M?s.jsx(tc,{className:"h-3.5 w-3.5 text-muted-foreground"}):p==="asc"?s.jsx(fs,{className:"h-3.5 w-3.5"}):s.jsx(Dt,{className:"h-3.5 w-3.5"}),O=M=>{const D=M.toolTokenUsage?.totalTokens;return typeof D=="number"?D.toLocaleString():"n/a"},T=v.useMemo(()=>{const M=new Map;for(const D of _)M.set(D.id,vge(D));return M},[_]),I=async M=>{d(!0);try{await e.deleteResult(M),n(D=>D.filter(R=>R.id!==M)),Pe({title:"Run deleted",description:M}),o(null)}catch(D){Pe({title:"Could not delete run",description:D instanceof Error?D.message:String(D),variant:"destructive"})}finally{d(!1)}};return s.jsxs("div",{className:"space-y-6",children:[s.jsx(Ps,{open:i!==null,onOpenChange:M=>{!M&&!c&&o(null)},children:s.jsxs(Xa,{children:[s.jsxs(Qa,{children:[s.jsx(Za,{children:"Delete run?"}),s.jsxs(es,{children:["This will permanently remove the run artifacts from disk for"," ",s.jsx("span",{className:"font-mono",children:i??""}),"."]})]}),s.jsxs(Ja,{children:[s.jsx(ns,{disabled:c,children:"Cancel"}),s.jsx(ts,{disabled:c||!i,onClick:M=>{M.preventDefault(),i&&I(i)},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:c?"Deleting...":"Delete run"})]})]})}),s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(wd,{className:"h-6 w-6"}),"Results"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Browse evaluation runs and open detailed results"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(Vc,{open:b,onOpenChange:y,children:[s.jsx(Hc,{asChild:!0,children:s.jsxs(re,{type:"button",variant:"outline",role:"combobox","aria-expanded":b,className:"w-[260px] justify-between font-normal",children:[s.jsx("span",{className:"truncate text-left",children:g==="all"?"All scenarios":g}),s.jsx(Dt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(Wo,{className:"w-[260px] p-0",align:"start",children:s.jsxs(Ho,{children:[s.jsx(Ko,{placeholder:"Search scenarios..."}),s.jsxs(Go,{children:[s.jsx(Yo,{children:"No scenarios found."}),s.jsxs(Xo,{children:[s.jsx(na,{value:"all scenarios",onSelect:()=>{j("all"),y(!1)},children:"All scenarios"}),N.map(M=>s.jsx(na,{value:M,onSelect:()=>{j(M),y(!1)},children:M},M))]})]})]})})]}),s.jsx(re,{variant:"outline",onClick:()=>{C()},disabled:r,children:r?"Refreshing...":"Refresh"})]})]}),s.jsx(Ue,{children:s.jsx(qe,{className:"p-0",children:s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs($t,{children:[s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>S("id"),children:["Run ID",P("id")]})}),s.jsx(tt,{children:"Evaluated"}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>S("timestamp"),children:["Timestamp",P("timestamp")]})}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>S("passRate"),children:["Pass Rate",P("passRate")]})}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>S("scenarios"),children:["Scenarios",P("scenarios")]})}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>S("avgToolCalls"),children:["Avg Tool Calls",P("avgToolCalls")]})}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>S("toolTokens"),children:["Tool Tokens",P("toolTokens")]})}),s.jsx(tt,{className:"w-10"})]})}),s.jsx(Lr,{children:_.map(M=>s.jsxs($t,{children:[s.jsx(ze,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(jt,{to:`/results/${M.id}`,className:"font-mono text-xs text-primary hover:underline",children:M.id}),M.configId?s.jsx("div",{className:"text-[11px] text-muted-foreground",children:M.configId}):null,M.runNote?s.jsxs("div",{className:"text-[11px] text-muted-foreground break-words",children:["Note: ",M.runNote]}):null]})}),s.jsx(ze,{className:"text-[11px] text-muted-foreground",children:(()=>{const D=T.get(M.id);return s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:["Evaluated: ",D.scenarioCount," scenario",D.scenarioCount===1?"":"s"," · ",D.agentCount," agent",D.agentCount===1?"":"s"]}),s.jsx("div",{className:"font-mono text-xs text-foreground/80",children:D.scenarioPreview})]})})()}),s.jsx(ze,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(vf,{className:"h-3 w-3"}),new Date(M.timestamp).toLocaleString()]})}),s.jsx(ze,{children:s.jsx(Vs,{rate:M.overallPassRate})}),s.jsx(ze,{className:"font-mono text-sm",children:M.totalScenarios}),s.jsx(ze,{className:"font-mono text-sm",children:M.avgToolCalls.toFixed(0)}),s.jsx(ze,{className:"font-mono text-sm",children:O(M)}),s.jsx(ze,{children:s.jsxs(uu,{children:[s.jsx(du,{asChild:!0,children:s.jsx(re,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Gm,{className:"h-4 w-4"})})}),s.jsxs(ll,{align:"end",children:[s.jsx(xr,{asChild:!0,children:s.jsxs(jt,{to:`/results/${M.id}`,children:[s.jsx(U7,{className:"mr-2 h-3.5 w-3.5"}),"View"]})}),s.jsxs(xr,{children:[s.jsx(Sa,{className:"mr-2 h-3.5 w-3.5"}),"Export JSON"]}),s.jsxs(xr,{className:"text-destructive",onSelect:D=>{D.preventDefault(),o(M.id)},children:[s.jsx(Aa,{className:"mr-2 h-3.5 w-3.5"}),"Delete"]})]})]})})]},M.id))})]})})})]})};function bd({text:e,variant:t="assistant",className:n}){const r=xge(e);return s.jsx("div",{className:Se("space-y-2",t==="system"&&"text-xs",n),children:r.map((a,i)=>s.jsx(v.Fragment,{children:yge(a,i,t)},`md-${i}`))})}function xge(e){const t=e.replace(/\r\n/g,`
144
- `).split(`
145
- `),n=[];let r=0;const a=o=>o.trim()==="",i=o=>o.trimStart().startsWith("```");for(;r<t.length;){const o=t[r],c=o.trim();if(a(o)){r+=1;continue}if(i(o)){const x=c.replace(/^```/,"").trim()||void 0;r+=1;const g=[];for(;r<t.length&&!i(t[r]);)g.push(t[r]),r+=1;r<t.length&&i(t[r])&&(r+=1),n.push({type:"code",lang:x,code:g.join(`
146
- `)});continue}if(/^---+$/.test(c)||/^\*\*\*+$/.test(c)){n.push({type:"hr"}),r+=1;continue}if(c.startsWith(">")){const x=[];for(;r<t.length&&t[r].trim().startsWith(">");)x.push(t[r].trim().replace(/^>\s?/,"")),r+=1;n.push({type:"blockquote",text:x.join(`
147
- `)});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(LM(t,r)){const x=FM(t[r]);r+=2;const g=[];for(;r<t.length&&t[r].includes("|")&&!a(t[r]);)g.push(FM(t[r])),r+=1;n.push({type:"table",headers:x,rows:g});continue}const f=c.match(/^\d+\.\s+/),h=c.match(/^[-*+]\s+/);if(f||h){const x=!!f,g=[];for(;r<t.length;){const j=t[r].trim();if(x?/^\d+\.\s+/.test(j):/^[-*+]\s+/.test(j)){g.push(j.replace(x?/^\d+\.\s+/:/^[-*+]\s+/,"")),r+=1;continue}a(t[r])&&(r+=1);break}n.push({type:"list",ordered:x,items:g});continue}const p=[o];for(r+=1;r<t.length;){const x=t[r],g=x.trim();if(a(x)||i(x)||/^---+$/.test(g)||/^#{1,4}\s+/.test(g)||g.startsWith(">")||LM(t,r)||/^\d+\.\s+/.test(g)||/^[-*+]\s+/.test(g))break;p.push(x),r+=1}n.push({type:"paragraph",text:p.join(`
148
- `)})}return n}function LM(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 FM(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(t=>t.trim())}function yge(e,t,n){if(e.type==="hr")return s.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 s.jsx("h4",{className:r,children:ql(e.text,`${t}-h`)})}if(e.type==="paragraph")return s.jsx("p",{className:Se("whitespace-pre-wrap leading-relaxed",n==="system"&&"leading-normal"),children:ql(e.text,`${t}-p`)});if(e.type==="blockquote")return s.jsx("blockquote",{className:"border-l-2 border-muted-foreground/30 pl-3 text-muted-foreground italic",children:ql(e.text,`${t}-bq`)});if(e.type==="code")return s.jsxs("div",{className:"rounded-md border bg-muted/70",children:[e.lang&&s.jsx("div",{className:"border-b px-2 py-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:e.lang}),s.jsx("pre",{className:"max-h-72 overflow-auto p-2 text-xs",children:s.jsx("code",{children:e.code})})]});if(e.type==="list"){const r=e.ordered?"ol":"ul";return s.jsx(r,{className:Se("space-y-1 pl-5",e.ordered?"list-decimal":"list-disc"),children:e.items.map((a,i)=>s.jsx("li",{className:"leading-relaxed",children:ql(a,`${t}-li-${i}`)},`${t}-li-${i}`))})}return e.type==="table"?s.jsx("div",{className:"overflow-x-auto rounded-md border",children:s.jsxs("table",{className:"w-full min-w-[480px] border-collapse text-xs",children:[s.jsx("thead",{className:"bg-muted/40",children:s.jsx("tr",{children:e.headers.map((r,a)=>s.jsx("th",{className:"border-b px-2 py-1.5 text-left font-semibold align-top",children:ql(r,`${t}-thc-${a}`)},`${t}-th-${a}`))})}),s.jsx("tbody",{children:e.rows.map((r,a)=>s.jsx("tr",{className:"border-t",children:r.map((i,o)=>s.jsx("td",{className:"px-2 py-1.5 align-top",children:ql(i,`${t}-tdc-${a}-${o}`)},`${t}-td-${a}-${o}`))},`${t}-row-${a}`))})]})}):null}function ql(e,t){return e.split(/(`[^`]+`|\*\*[^*]+\*\*|\*[^*\n]+\*|_[^_\n]+_|~~[^~\n]+~~|\[[^\]]+\]\([^)]+\))/g).filter(Boolean).map((r,a)=>{if(r.startsWith("`")&&r.endsWith("`"))return s.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[0.92em]",children:r.slice(1,-1)},`${t}-${a}`);if(r.startsWith("**")&&r.endsWith("**"))return s.jsx("strong",{children:r.slice(2,-2)},`${t}-${a}`);if(r.startsWith("*")&&r.endsWith("*"))return s.jsx("em",{children:r.slice(1,-1)},`${t}-${a}`);if(r.startsWith("_")&&r.endsWith("_"))return s.jsx("em",{children:r.slice(1,-1)},`${t}-${a}`);if(r.startsWith("~~")&&r.endsWith("~~"))return s.jsx("s",{children:r.slice(2,-2)},`${t}-${a}`);const i=r.match(/^\[([^\]]+)\]\(([^)]+)\)$/);return i?s.jsx("a",{href:i[2],target:"_blank",rel:"noreferrer",className:"underline underline-offset-2",children:i[1]},`${t}-${a}`):s.jsx(v.Fragment,{children:r},`${t}-${a}`)})}function bge(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 a=Object.keys(r),i=Object.values(r),o=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">${wo(c.scenarioName)}</span>
153
- <span class="scenario-agent">${wo(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">${wo(f.name)} <small>${f.duration}ms</small></span>`).join("")}
166
- </div>
167
- ${d.failureReasons.length?`<div class="failure-reasons">${d.failureReasons.map(f=>wo(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 — ${wo(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">${wo(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">${wo(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
- ${o}
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(a)},datasets:[{data:${JSON.stringify(i)},backgroundColor:'#f59e0b',borderRadius:4}]},options:{indexAxis:'y',plugins:{legend:{display:false}},scales:{x:{grid:{display:false}},y:{grid:{display:false},ticks:{font:{family:'monospace',size:11}}}}}});
246
- <\/script>
247
- </body>
248
- </html>`}function wo(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}const wge="mcplab.resultAssistantScenarioHandoff",jge=[{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 BM(e){const t=new Date().toISOString().replace(/[:]/g,"-").replace(/\..+/,"");return`mcplab/reports/result-assistant/${e}-${t}.md`}function zM(e){const t=e.toFixed(1);return t.endsWith(".0")?t.slice(0,-2):t}function jo(e){return typeof e=="number"?e.toLocaleString():"n/a"}const Sge=()=>{const{id:e}=Zo(),t=Ea(),[n]=Yi(),{source:r}=Rn(),a=xg("snapshots",!1),{configs:i}=Nf(),{scenarios:o}=Ga(),[c,d]=v.useState(void 0),[f,h]=v.useState(!0),[p,x]=v.useState(!1),[g,j]=v.useState(""),[b,y]=v.useState(!1),[S,C]=v.useState(new Set),[N,E]=v.useState(new Set),[_,P]=v.useState([]),[O,T]=v.useState(""),[I,M]=v.useState(null),[D,R]=v.useState(!1),[q,U]=v.useState(""),[H,J]=v.useState(""),[Z,F]=v.useState(!1),[z,ee]=v.useState(!1),[B,L]=v.useState(null),[te,ie]=v.useState([]),[G,de]=v.useState([]),[oe,ce]=v.useState(""),[le,fe]=v.useState(!1),[Ce,ae]=v.useState(!1),[ke,Ae]=v.useState("assistant"),[Ye,be]=v.useState(null),[Re,Y]=v.useState(null),[xe,ue]=v.useState(!1),[Oe,Ke]=v.useState(""),[bt,It]=v.useState(""),[Q,je]=v.useState(!1),[Ne,$e]=v.useState(!1),[Be,et]=v.useState(!1),[Pt,Sn]=v.useState([]),[Nn,cr]=v.useState(!1),[ur,Dn]=v.useState(""),[dr,_r]=v.useState(null),[Ur,qr]=v.useState(!1),[Yn,Xt]=v.useState(null),En=v.useRef(null),pe=v.useRef(null),De=v.useCallback(async(V,ye)=>{cr(!0);try{const Me=(await r.listMarkdownReports()).filter(kt=>{const dt=String(kt.relativePath??""),Ht=String(kt.name??"");return dt.includes(V)||Ht.includes(V)});if(Sn(Me),ye&&Me.length>0){const kt=Me.find(dt=>dt.relativePath===ye||dt.path===ye||dt.relativePath.endsWith(ye)||dt.path.endsWith(ye));kt&&Dn(kt.relativePath)}return Me}catch{return Sn([]),[]}finally{cr(!1)}},[r]);v.useEffect(()=>{if(!e)return;let V=!0;const ye=B;return ye&&(r.closeResultAssistantSession(ye).catch(()=>{}),L(null),ie([]),de([]),Y(null)),h(!0),r.getResult(e).then(rt=>{V&&(d(rt),j(rt?.runNote??""),x(!1),h(!1))}),()=>{V=!1}},[e,r]),v.useEffect(()=>{let V=!0;return r.listSnapshots().then(ye=>{V&&P(ye)}).catch(()=>{V&&P([])}),()=>{V=!1}},[r]),v.useEffect(()=>{if(!c?.id){Sn([]);return}let V=!0;return(async()=>{const ye=await De(c.id)})(),()=>{V=!1}},[c?.id,De]),v.useEffect(()=>{if(Pt.length===0){Dn(""),_r(null),Xt(null);return}(!ur||!Pt.some(V=>V.relativePath===ur))&&Dn(Pt[0].relativePath)},[Pt,ur]),v.useEffect(()=>{if(!z||ke!=="reports")return;if(!ur){_r(null),Xt(null);return}let V=!0;return qr(!0),Xt(null),r.getMarkdownReport(ur).then(ye=>{V&&_r(ye)}).catch(ye=>{V&&(_r(null),Xt(ye instanceof Error?ye.message:String(ye)))}).finally(()=>{V&&qr(!1)}),()=>{V=!1}},[z,ke,ur,r]);const st=n.get("configId")??"",yt=(n.get("agent")??"").trim(),Lt=v.useMemo(()=>{const V=st?i.find(ye=>ye.id===st):void 0;return V||(c?i.find(ye=>ye.id===c.configId):void 0)},[i,st,c]),nn=v.useMemo(()=>{const V=new Map;if(Lt){for(const ye of Lt.scenarios)V.set(ye.id,ye),ye.name&&!V.has(ye.name)&&V.set(ye.name,ye);for(const ye of Lt.scenarioEntries??[]){if(ye.kind!=="referenced")continue;const rt=o.find(Me=>Me.id===ye.ref);rt&&(V.set(rt.id,rt),rt.name&&V.set(rt.name,rt),V.has(ye.ref)||V.set(ye.ref,rt))}}for(const ye of o)V.has(ye.id)||V.set(ye.id,ye),ye.name&&!V.has(ye.name)&&V.set(ye.name,ye);return V},[Lt,o]),ln=v.useMemo(()=>{if(!c?.snapshotEval?.baselineSnapshotId)return"";const V=i.filter(ye=>ye.snapshotEval?.baselineSnapshotId===c.snapshotEval?.baselineSnapshotId);return V.length===1?V[0].id:""},[i,c?.snapshotEval?.baselineSnapshotId]);v.useEffect(()=>{c?.snapshotEval?.baselineSnapshotId&&T(V=>V||c.snapshotEval.baselineSnapshotId)},[c?.snapshotEval?.baselineSnapshotId]),v.useEffect(()=>{if(st&&i.some(V=>V.id===st)){U(st);return}ln&&U(V=>V||ln)},[st,i,ln]),v.useEffect(()=>{if(!z)return;const V=window.setTimeout(()=>{En.current?.scrollIntoView({behavior:"smooth",block:"end"})},0);return()=>window.clearTimeout(V)},[z,te.length,le]),v.useEffect(()=>()=>{B&&r.closeResultAssistantSession(B).catch(()=>{})},[B,r]),v.useEffect(()=>{const V=pe.current;if(!V)return;V.style.height="0px";const ye=Math.min(V.scrollHeight,160);V.style.height=`${Math.max(40,ye)}px`},[oe,z]);const{filteredScenarios:Xn,filteredTotalRuns:Cn,filteredPassCount:rr,displayPassRate:fr,displayAvgToolCalls:Wr,displayAvgLatency:ci,displayToolTokenUsage:ui}=v.useMemo(()=>{if(!c)return{filteredScenarios:[],filteredTotalRuns:0,filteredPassCount:0,displayPassRate:0,displayAvgToolCalls:0,displayAvgLatency:0,displayToolTokenUsage:null};const V=yt?c.scenarios.filter(dt=>dt.agentId===yt||dt.agentName===yt):c.scenarios,ye=V.reduce((dt,Ht)=>dt+Ht.runs.length,0),rt=V.reduce((dt,Ht)=>dt+Ht.runs.filter(Ln=>Ln.passed).length,0),Me=V.reduce((dt,Ht)=>dt+Ht.runs.reduce((Ln,Qt)=>Ln+Qt.toolCalls.length,0),0),kt=V.reduce((dt,Ht)=>dt+Ht.runs.reduce((Ln,Qt)=>Ln+Qt.duration,0),0);return{filteredScenarios:V,filteredTotalRuns:ye,filteredPassCount:rt,displayPassRate:ye===0?0:rt/ye,displayAvgToolCalls:ye===0?0:Me/ye,displayAvgLatency:ye===0?0:Math.round(kt/ye),displayToolTokenUsage:NG(V.map(dt=>dt.toolTokenUsage))}},[c,yt]),cl=v.useMemo(()=>{const V={};return Xn.forEach(ye=>ye.runs.forEach(rt=>rt.toolCalls.forEach(Me=>{V[Me.name]=(V[Me.name]||0)+1}))),Object.entries(V).map(([ye,rt])=>({name:ye,count:rt})).sort((ye,rt)=>rt.count-ye.count)},[Xn]);if(f)return s.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Loading result..."});if(!c)return s.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Result not found"});const ge=Object.entries(c.mcpServerVersions??{}).map(([V,ye])=>`${V}: ${ye??"unknown"}`).join(", "),Ve=rr,ct=Math.max(0,Cn-Ve),Ot=[{name:"Pass",value:Ve,color:"hsl(152, 69%, 40%)"},{name:"Fail",value:ct,color:"hsl(0, 72%, 51%)"}],Mt=V=>{C(ye=>{const rt=new Set(ye);return rt.has(V)?rt.delete(V):rt.add(V),rt})},Tt=(V,ye,rt,Me)=>`${V}:${ye}:${rt}:${Me}`,Pn=(V,ye)=>`${V}::${ye}`,He=V=>{E(ye=>{const rt=new Set(ye);return rt.has(V)?rt.delete(V):rt.add(V),rt})},Vt=V=>{const ye=!V.endsWith(":conversation");return N.has(V)?!ye:ye},Ft=new Map((I?.scenario_results??[]).map(V=>[V.scenario_id,V])),kn=async()=>{if(!(!c||!O)){R(!0);try{const V=await r.compareSnapshot(O,c.id);M(V)}finally{R(!1)}}},cn=async V=>{const ye=V||c.snapshotEval?.baselineSnapshotId;if(ye){T(ye),R(!0);try{const rt=await r.compareSnapshot(ye,c.id);M(rt)}catch(rt){Pe({title:"Could not review drift",description:rt instanceof Error?rt.message:String(rt),variant:"destructive"})}finally{R(!1)}}},Ng=async()=>{if(!q){Pe({title:"Select a configuration",description:"Choose which config should receive the new baseline.",variant:"destructive"});return}F(!0);try{const V=await r.generateSnapshotEvalBaseline(c.id,q,H.trim()||void 0);P(ye=>[V.snapshot,...ye.filter(rt=>rt.id!==V.snapshot.id)]),T(V.snapshot.id),Pe({title:"Baseline updated",description:`${V.snapshot.name} is now linked to the selected config.`}),H.trim()||J(V.snapshot.name),c.snapshotEval?.applied&&cn(V.snapshot.id)}catch(V){Pe({title:"Could not accept new baseline",description:V instanceof Error?V.message:String(V),variant:"destructive"})}finally{F(!1)}},ul=async()=>{const V=oe.trim();if(!V||!c)return;const ye=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,rt={id:ye,role:"user",text:V,createdAt:new Date().toISOString()};ce(""),ie(Me=>[...Me,rt]),fe(!0);try{let Me=B;if(!Me){const dt=await r.createResultAssistantSession(c.id);Me=dt.sessionId,L(dt.session.id),de(dt.session.pendingToolCalls),Y({assistantAgentName:dt.session.selectedAssistantAgentName,provider:dt.session.provider,model:dt.session.model}),ie(Ht=>{const Ln=Ht.some(ca=>ca.id===ye),Qt=dt.session.messages;return Ln?[...Qt,rt]:Qt})}const kt=await r.sendResultAssistantMessage(Me,V);di(kt.session)}catch(Me){ie(kt=>kt.filter(dt=>dt.id!==ye)),Pe({title:"MCP Labs Assistant error",description:Me instanceof Error?Me.message:String(Me),variant:"destructive"})}finally{fe(!1)}},Bf=V=>{ce(V),requestAnimationFrame(()=>pe.current?.focus())},di=V=>{L(V.id),ie(V.messages),de(V.pendingToolCalls),Y({assistantAgentName:V.selectedAssistantAgentName,provider:V.provider,model:V.model})},zf=async V=>{if(B){fe(!0);try{const ye=await r.approveResultAssistantToolCall(B,V);di(ye.session)}catch(ye){Pe({title:"Could not approve assistant action",description:ye instanceof Error?ye.message:String(ye),variant:"destructive"})}finally{fe(!1)}}},hu=async V=>{if(B){fe(!0);try{const ye=await r.denyResultAssistantToolCall(B,V);di(ye.session)}catch(ye){Pe({title:"Could not deny assistant action",description:ye instanceof Error?ye.message:String(ye),variant:"destructive"})}finally{fe(!1)}}},ks=(V,ye)=>{Ae("assistant"),ee(!0),be(ye?.scenarioId??null),te.length===0&&ie([{id:`msg-${Date.now()}`,role:"assistant",text:"Ask me to explain failures, tool usage, snapshot drift, or suggest what to inspect next in this result.",createdAt:new Date().toISOString()}]),V&&ce(V)},la=V=>{Ae("reports"),ee(!0)},Cg=()=>{Ae("note"),ee(!0)},Vr=V=>{if(!c)return;if(!Ye){Pe({title:"No scenario context",description:"Ask about a specific scenario or run first, then send the suggestion.",variant:"destructive"});return}const ye=o.find(Me=>Me.id===Ye)??o.find(Me=>Me.name===Ye);if(!ye){Pe({title:"Scenario not found in library",description:`Could not find library scenario '${Ye}' to open in Scenario Assistant.`,variant:"destructive"});return}const rt=[`I am sending a suggestion from the Result Assistant for scenario '${Ye}' based on run '${c.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:",V].join(`
249
- `);try{window.sessionStorage.setItem(wge,JSON.stringify({type:"result-assistant-handoff-v1",runId:c.id,configId:st||c.configId||"",scenarioId:ye.id,prompt:rt,sourceReply:V})),t(`/libraries/test-cases/${encodeURIComponent(ye.id)}?assistantHandoff=1`)}catch(Me){Pe({title:"Could not create handoff",description:Me instanceof Error?Me.message:String(Me),variant:"destructive"})}},Uf=V=>{c&&(et(!1),Ke(V),It(BM(c.id)),je(!1),ue(!0))},Ag=()=>{c&&(et(!0),Ke(""),It(BM(c.id)),je(!1),ue(!0))},_g=async()=>{if(!c)return;if(!Oe.trim()){Pe({title:"No markdown to write",description:"The selected assistant response is empty.",variant:"destructive"});return}$e(!0);try{const ye=await r.applyResultAssistantReport({runId:c.id,markdown:Oe,outputPath:bt.trim()||void 0,overwrite:Q});Pe({title:"Markdown report written",description:typeof ye.path=="string"&&ye.path?ye.path:ye.outputPath}),await De(c.id,typeof ye.path=="string"&&ye.path||ye.outputPath||void 0),z&&Ae("reports"),ue(!1)}catch(ye){Pe({title:"Could not write markdown report",description:ye instanceof Error?ye.message:String(ye),variant:"destructive"})}finally{$e(!1)}},dl=async V=>{try{await navigator.clipboard.writeText(V),Pe({title:"Copied"})}catch(ye){Pe({title:"Could not copy",description:ye instanceof Error?ye.message:String(ye),variant:"destructive"})}},fl=async()=>{if(c){y(!0);try{const V=g.trim();await r.updateRunNote(c.id,V||void 0),d(ye=>ye&&{...ye,runNote:V||void 0}),j(V),x(!1),Pe({title:"Run note saved"})}catch(V){Pe({title:"Could not save run note",description:V instanceof Error?V.message:String(V),variant:"destructive"})}finally{y(!1)}}};return s.jsxs("div",{className:`${z?"xl:flex xl:h-[calc(100vh-2rem-48px)] xl:min-h-0 xl:flex-col xl:overflow-hidden":""}`,children:[s.jsx("div",{className:`${z?"xl:shrink-0 xl:pb-6":"mb-6"}`,children:s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[s.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[s.jsx(re,{variant:"ghost",size:"icon",asChild:!0,children:s.jsx(jt,{to:"/results",children:s.jsx(Ro,{className:"h-4 w-4"})})}),s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("h1",{className:"text-2xl font-bold font-mono",children:c.id}),s.jsx(Vs,{rate:fr}),a&&c.snapshotEval?.applied&&s.jsxs(Qe,{variant:"outline",className:"text-xs",children:["Snapshot policy · ",c.snapshotEval.mode," · ",c.snapshotEval.status]})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[new Date(c.timestamp).toLocaleString()," ","·",yt?` Agent: ${yt} ·`:""," Config hash: ",s.jsx("span",{className:"font-mono",children:c.configHash})]}),a&&c.snapshotEval?.applied&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Baseline: ",s.jsx("span",{className:"font-mono",children:c.snapshotEval.baselineSnapshotId})," · score: ",c.snapshotEval.overallScore]})]})]}),s.jsxs("div",{className:"ml-auto flex shrink-0 flex-wrap items-center justify-end gap-2",children:[ge?s.jsxs("span",{className:"inline-flex items-center rounded-sm border border-border/60 bg-muted/30 px-1.5 py-1 text-[11px] text-muted-foreground",children:[s.jsx("span",{className:"font-medium",children:"MCP:"}),s.jsx("span",{className:"ml-1 font-mono",children:ge})]}):null,a&&c.snapshotEval?.applied&&s.jsxs(re,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>{cn()},disabled:D,children:[s.jsx(GS,{className:"h-3.5 w-3.5"}),D?"Reviewing drift...":"Review Drift"]}),s.jsxs(re,{variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>{const V=bge(c),ye=new Blob([V],{type:"text/html"}),rt=URL.createObjectURL(ye),Me=document.createElement("a");Me.href=rt,Me.download=`mcplab-report-${c.id}.html`,Me.click(),URL.revokeObjectURL(rt)},children:[s.jsx(Sa,{className:"h-3.5 w-3.5"}),"Download Report"]}),s.jsxs(re,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>la(),disabled:Nn,children:[s.jsx(Yl,{className:"h-3.5 w-3.5"}),Nn?"Reference Reports...":`Reference Reports${Pt.length?` (${Pt.length})`:""}`]}),s.jsxs(re,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>Cg(),children:[s.jsx(Yl,{className:"h-3.5 w-3.5"}),"Run Note"]}),s.jsxs(re,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>ks(),children:[s.jsx(ya,{className:"h-3.5 w-3.5"}),"MCP Labs Assistant"]})]})]})}),s.jsxs("div",{className:`grid gap-6 items-start ${z?Ce?"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:[s.jsxs("div",{className:`min-w-0 space-y-6 ${z?"xl:h-full xl:min-h-0 xl:overflow-y-auto xl:pr-2":""}`,children:[a&&c.snapshotEval?.applied&&s.jsxs(Ue,{className:"border-amber-500/30",children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Snapshot Drift Review"})}),s.jsxs(qe,{className:"space-y-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[s.jsxs(Qe,{variant:"outline",children:["Mode: ",c.snapshotEval.mode]}),s.jsxs(Qe,{variant:"outline",children:["Status: ",c.snapshotEval.status]}),s.jsxs(Qe,{variant:"outline",children:["Overall score: ",c.snapshotEval.overallScore]}),s.jsxs(Qe,{variant:"outline",className:"font-mono",children:["Baseline: ",c.snapshotEval.baselineSnapshotId]})]}),c.snapshotEval.impactedScenarios.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Impacted scenarios: ",c.snapshotEval.impactedScenarios.join(", ")]}),s.jsxs("div",{className:"grid gap-3 lg:grid-cols-[1.2fr_1fr_auto] items-end",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Target config for baseline update"}),s.jsxs(bn,{value:q,onValueChange:U,children:[s.jsx(mn,{className:"h-8",children:s.jsx(wn,{placeholder:"Select config to update"})}),s.jsx(vn,{children:i.map(V=>s.jsx(mt,{value:V.id,children:V.name},V.id))})]}),!q&&s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Tip: open results from the Run page to prefill the config automatically."})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"New snapshot name (optional)"}),s.jsx("div",{className:"relative",children:s.jsx("input",{value:H,onChange:V=>J(V.target.value),placeholder:`Snapshot ${c.id}`,className:"h-8 w-full rounded-md border bg-background px-2 text-xs"})})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(re,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5",onClick:()=>{cn()},disabled:D,children:[s.jsx(Ca,{className:`h-3.5 w-3.5 ${D?"animate-spin":""}`}),"Review Drift"]}),s.jsx(re,{type:"button",size:"sm",className:"h-8",onClick:()=>{Ng()},disabled:Z||fr!==1,children:Z?"Accepting...":"Accept as New Baseline"})]})]}),fr!==1&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"Baseline updates require a fully passing run (same rule as snapshot creation)."})]})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-6",children:[s.jsx(os,{title:"Scenarios",value:Xn.length,icon:Uj}),s.jsx(os,{title:"Total Runs",value:Cn,icon:b$}),s.jsx(os,{title:"Pass Rate",value:`${Math.round(fr*100)}%`,icon:wd}),s.jsx(os,{title:"Avg Tool Calls",value:zM(Wr),icon:nc}),s.jsx(os,{title:"Avg Latency",value:`${ci}ms`,icon:k$}),s.jsx(os,{title:"Tool Tokens",value:jo(ui?.totalTokens),icon:ls})]}),s.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-2",children:s.jsx(Nt,{className:"text-base",children:"Pass / Fail"})}),s.jsxs(qe,{className:"flex items-center justify-center",children:[s.jsxs(pfe,{width:180,height:180,children:[s.jsx(oi,{data:Ot,dataKey:"value",innerRadius:50,outerRadius:75,paddingAngle:3,children:Ot.map((V,ye)=>s.jsx(Tv,{fill:V.color},ye))}),s.jsx(Mr,{})]}),s.jsxs("div",{className:"ml-4 space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[s.jsx("div",{className:"h-3 w-3 rounded-full bg-success"}),Ve," passed"]}),s.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[s.jsx("div",{className:"h-3 w-3 rounded-full bg-destructive"}),ct," failed"]})]})]})]}),s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-2",children:s.jsx(Nt,{className:"text-base",children:"Tool Usage"})}),s.jsx(qe,{children:s.jsx(Kh,{width:"100%",height:180,children:s.jsxs(ffe,{data:cl,layout:"vertical",children:[s.jsx(Vi,{type:"number",tick:{fontSize:11}}),s.jsx(Hi,{type:"category",dataKey:"name",tick:{fontSize:11},width:120}),s.jsx(Mr,{}),s.jsx(sl,{dataKey:"count",fill:"hsl(38, 92%, 50%)",radius:[0,4,4,0]})]})})})]})]}),s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx(Nt,{className:"text-base",children:"Scenarios"}),s.jsxs(re,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5 px-2 text-xs",onClick:()=>ks("Summarize the scenario results in this run. Highlight failed scenarios/checks first, then mention notable tool usage and extracted values."),children:[s.jsx(ya,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})]})}),s.jsxs(qe,{className:"p-0",children:[a&&s.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-b p-3",children:[s.jsxs("div",{className:"min-w-60 space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Snapshot"}),s.jsxs(bn,{value:O,onValueChange:T,children:[s.jsx(mn,{className:"h-8",children:s.jsx(wn,{placeholder:"Select snapshot"})}),s.jsx(vn,{children:_.map(V=>s.jsx(mt,{value:V.id,children:V.name},V.id))})]})]}),s.jsx(re,{type:"button",variant:"outline",size:"sm",disabled:!O||D,onClick:()=>{kn()},children:D?"Comparing...":"Compare Snapshot"}),I&&s.jsxs(Qe,{variant:"outline",className:"h-8 px-2 py-0 text-xs",children:["Overall snapshot score: ",I.overall_score]})]}),s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs($t,{children:[s.jsx(tt,{className:"w-8"}),s.jsx(tt,{children:"Scenario"}),s.jsx(tt,{children:"Agent"}),s.jsx(tt,{children:"Runs"}),s.jsx(tt,{children:"Pass Rate"}),s.jsx(tt,{children:"Tool Calls"}),s.jsx(tt,{children:"Tool Tokens"}),s.jsx(tt,{children:"Snapshot"})]})}),s.jsx(Lr,{children:Xn.map(V=>{const ye=Pn(V.scenarioId,V.agentName),rt=V.scenarioName||V.scenarioId;return s.jsx(Mi,{open:S.has(ye),onOpenChange:()=>Mt(ye),asChild:!0,children:s.jsxs(s.Fragment,{children:[s.jsx(Us,{asChild:!0,children:s.jsxs($t,{className:"cursor-pointer hover:bg-muted/50",children:[s.jsx(ze,{children:s.jsx(Dt,{className:`h-4 w-4 transition-transform ${S.has(ye)?"rotate-180":""}`})}),s.jsx(ze,{className:"font-medium text-sm",children:V.scenarioName}),s.jsx(ze,{className:"text-sm",children:V.agentName}),s.jsx(ze,{className:"font-mono text-sm",children:V.runs.length}),s.jsx(ze,{children:s.jsx(Vs,{rate:V.passRate})}),s.jsx(ze,{className:"font-mono text-sm",children:zM(V.avgToolCalls)}),s.jsx(ze,{className:"font-mono text-sm",children:jo(V.toolTokenUsage?.totalTokens)}),s.jsx(ze,{children:(()=>{const Me=Ft.get(V.scenarioId);if(!Me)return s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"});const kt=Me.status==="Match"?"bg-success/15 text-success":Me.status==="Warn"?"bg-amber-500/15 text-amber-600":"bg-destructive/15 text-destructive";return s.jsxs(Qe,{variant:"outline",className:`text-xs ${kt}`,children:[Me.status," · ",Me.score]})})()})]})}),s.jsx($i,{asChild:!0,children:s.jsx("tr",{children:s.jsx("td",{colSpan:8,className:"p-0",children:s.jsxs("div",{className:"bg-muted/30 p-4 space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border bg-card px-3 py-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-xs font-semibold",children:"Scenario details"}),s.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[rt," · ",V.agentName," · ",Math.round(V.passRate*100),"% pass rate · ",jo(V.toolTokenUsage?.totalTokens)," tool tokens"]})]}),s.jsxs(re,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>ks(`Explain why scenario '${rt}' failed (agent: ${V.agentName}). Summarize the likely cause from the result details and suggest what to inspect next.`,{scenarioId:V.scenarioId}),children:[s.jsx(ya,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})]}),(()=>{const Me=Ft.get(V.scenarioId);return!Me||Me.reasons.length===0?null:s.jsxs("div",{className:"rounded-md border bg-card p-2",children:[s.jsx("p",{className:"mb-1 text-xs font-semibold text-muted-foreground",children:"Snapshot reasons"}),s.jsxs("p",{className:"mb-1 text-[11px] text-muted-foreground",children:["Baseline agents: ",Me.baseline_agents.join(", ")||"—"," · observed agents: ",Me.observed_agents.join(", ")||"—"]}),s.jsx("ul",{className:"space-y-1 text-xs text-muted-foreground",children:Me.reasons.map((kt,dt)=>s.jsxs("li",{children:["• ",kt]},dt))})]})})(),V.runs.map(Me=>s.jsxs("div",{className:"flex items-start gap-3 rounded-md border bg-card p-3 text-sm",children:[s.jsx("div",{className:"mt-0.5",children:Me.passed?s.jsx(nc,{className:"h-4 w-4 text-success"}):s.jsx(yh,{className:"h-4 w-4 text-destructive"})}),s.jsxs("div",{className:"flex-1 space-y-1",children:[(()=>{const kt=nn.get(V.scenarioId),dt=kt?Age(kt.evalRules,Me.failureReasons):[],Ht=dt.filter(Qt=>Qt.status==="failed"),Ln=dt.filter(Qt=>Qt.status==="passed");return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:["Run #",Me.runIndex+1]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[Me.duration,"ms"]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[jo(Me.toolTokenUsage?.totalTokens)," tool tokens"]}),!Me.passed&&s.jsx(Qe,{variant:"outline",className:"h-5 border-destructive/30 bg-destructive/10 text-destructive text-[10px]",children:"Failed"})]}),Me.failureReasons.length>0&&s.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-2",children:[s.jsxs("p",{className:"mb-1 flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-destructive",children:[s.jsx(yh,{className:"h-3.5 w-3.5"}),"Failure reasons"]}),s.jsx("ul",{className:"space-y-1 text-xs text-destructive",children:Me.failureReasons.map((Qt,ca)=>s.jsxs("li",{children:["• ",WM(Qt)]},ca))})]}),dt.length>0&&s.jsx(Mi,{open:Vt(Tt(V.scenarioId,V.agentName,Me.runIndex,"checks")),onOpenChange:()=>He(Tt(V.scenarioId,V.agentName,Me.runIndex,"checks")),children:s.jsxs("div",{className:"rounded-md border bg-muted/20 p-2",children:[s.jsx(Us,{asChild:!0,children:s.jsxs("button",{type:"button",className:"mb-2 flex w-full flex-wrap items-center gap-2 text-left",children:[s.jsx(Dt,{className:`h-3.5 w-3.5 transition-transform ${Vt(Tt(V.scenarioId,V.agentName,Me.runIndex,"checks"))?"rotate-180":""}`}),s.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Checks"}),s.jsxs(Qe,{variant:"outline",className:"h-5 border-success/30 bg-success/10 text-success text-[10px]",children:[Ln.length," passed"]}),s.jsxs(Qe,{variant:"outline",className:`h-5 text-[10px] ${Ht.length>0?"border-destructive/30 bg-destructive/10 text-destructive":""}`,children:[Ht.length," failed"]})]})}),s.jsx($i,{children:s.jsx("div",{className:"space-y-1",children:dt.map((Qt,ca)=>s.jsxs("div",{className:`flex items-start justify-between gap-2 rounded-md border px-2 py-1.5 text-xs ${Qt.status==="failed"?"border-destructive/20 bg-destructive/5":"border-success/20 bg-success/5"}`,children:[s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[Qt.status==="failed"?s.jsx(yh,{className:"h-3.5 w-3.5 shrink-0 text-destructive"}):s.jsx(nc,{className:"h-3.5 w-3.5 shrink-0 text-success"}),s.jsx("span",{className:"font-medium",children:Ege(Qt.rule)})]}),Qt.failureReason&&s.jsx("p",{className:"mt-1 pl-5 text-[11px] text-destructive",children:WM(Qt.failureReason)})]}),s.jsx(Qe,{variant:"outline",className:`shrink-0 text-[10px] ${Qt.status==="failed"?"border-destructive/30 text-destructive":"border-success/30 text-success"}`,children:Qt.status})]},`${Qt.rule.type}-${Qt.rule.value}-${ca}`))})})]})})]})})(),s.jsx(Mi,{open:Vt(Tt(V.scenarioId,V.agentName,Me.runIndex,"extracts")),onOpenChange:()=>He(Tt(V.scenarioId,V.agentName,Me.runIndex,"extracts")),children:s.jsxs("div",{className:"rounded-md border border-violet-500/20 bg-violet-500/5 p-2",children:[s.jsx(Us,{asChild:!0,children:s.jsxs("button",{type:"button",className:"mb-2 flex w-full flex-wrap items-center justify-between gap-2 text-left",children:[s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[s.jsx(Dt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${Vt(Tt(V.scenarioId,V.agentName,Me.runIndex,"extracts"))?"rotate-180":""}`}),s.jsxs("p",{className:"flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:[s.jsx(Uj,{className:"h-3.5 w-3.5 text-violet-600"}),"Extracted values"]})]}),s.jsxs(Qe,{variant:"outline",className:"h-5 text-[10px]",children:[Object.keys(Me.extractedValues??{}).length," total"]})]})}),s.jsx($i,{children:Object.keys(Me.extractedValues??{}).length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No extracted values captured for this run."}):s.jsx("div",{className:"grid gap-1.5 sm:grid-cols-2",children:Object.entries(Me.extractedValues??{}).map(([kt,dt])=>s.jsxs("div",{className:"rounded-md border bg-background px-2 py-1.5 text-xs",children:[s.jsx("div",{className:"mb-0.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:kt}),s.jsx("div",{className:"font-mono break-all text-foreground",children:dt===null?"null":String(dt)})]},kt))})})]})}),s.jsx(Mi,{open:Vt(Tt(V.scenarioId,V.agentName,Me.runIndex,"tools")),onOpenChange:()=>He(Tt(V.scenarioId,V.agentName,Me.runIndex,"tools")),children:s.jsxs("div",{className:"rounded-md border border-sky-500/20 bg-sky-500/5 p-2",children:[s.jsx(Us,{asChild:!0,children:s.jsxs("button",{type:"button",className:"mb-2 flex w-full flex-wrap items-center justify-between gap-2 text-left",children:[s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[s.jsx(Dt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${Vt(Tt(V.scenarioId,V.agentName,Me.runIndex,"tools"))?"rotate-180":""}`}),s.jsxs("p",{className:"flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:[s.jsx(ls,{className:"h-3.5 w-3.5 text-sky-600"}),"Tool call sequence"]})]}),s.jsxs(Qe,{variant:"outline",className:"h-5 text-[10px]",children:[Me.toolCalls.length," total"]})]})}),s.jsx($i,{children:Me.toolCalls.length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No tool calls captured for this run."}):s.jsxs("div",{className:"space-y-2",children:[s.jsx("div",{className:"flex flex-wrap gap-1",children:Me.toolCalls.map((kt,dt)=>s.jsxs(Qe,{variant:"outline",className:"font-mono text-xs bg-background",children:[s.jsxs("span",{className:"mr-1 text-muted-foreground",children:["#",dt+1]}),kt.name,s.jsxs("span",{className:"ml-1 text-muted-foreground",children:[kt.duration,"ms"]})]},dt))}),s.jsxs("div",{className:"rounded-md border bg-background p-2",children:[s.jsxs("div",{className:"mb-1.5 flex items-center justify-between gap-2",children:[s.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Tool token estimate"}),s.jsx(Qe,{variant:"outline",className:"h-5 text-[10px]",children:"estimated"})]}),Object.keys(Me.toolTokenUsageByTool??{}).length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"n/a"}):s.jsx("div",{className:"grid gap-1.5 sm:grid-cols-2",children:Object.entries(Me.toolTokenUsageByTool??{}).map(([kt,dt])=>s.jsxs("div",{className:"rounded border bg-muted/30 px-2 py-1.5 text-xs",children:[s.jsx("div",{className:"font-mono text-[11px]",children:kt}),s.jsxs("div",{className:"text-muted-foreground",children:["total: ",jo(dt.totalTokens)," · in: ",jo(dt.inputTokens)," · out: ",jo(dt.outputTokens)]})]},kt))})]})]})})]})}),s.jsx(Mi,{open:Vt(Tt(V.scenarioId,V.agentName,Me.runIndex,"final")),onOpenChange:()=>He(Tt(V.scenarioId,V.agentName,Me.runIndex,"final")),children:s.jsxs("div",{className:"rounded-md border border-muted-foreground/20 bg-card p-2",children:[s.jsx(Us,{asChild:!0,children:s.jsxs("button",{type:"button",className:"mb-2 flex w-full items-center gap-2 text-left",children:[s.jsx(Dt,{className:`h-3.5 w-3.5 transition-transform ${Vt(Tt(V.scenarioId,V.agentName,Me.runIndex,"final"))?"rotate-180":""}`}),s.jsxs("p",{className:"flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:[s.jsx(wa,{className:"h-3.5 w-3.5"}),"Final answer"]})]})}),s.jsx($i,{children:s.jsx(US,{text:Me.finalAnswer||"No final answer captured.",maxLength:1200,className:"text-xs text-foreground"})})]})}),s.jsx(Mi,{open:Vt(Tt(V.scenarioId,V.agentName,Me.runIndex,"conversation")),onOpenChange:()=>He(Tt(V.scenarioId,V.agentName,Me.runIndex,"conversation")),children:s.jsxs("div",{className:"rounded-md border bg-muted/10 p-2",children:[s.jsxs("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[s.jsx(Us,{asChild:!0,children:s.jsxs("button",{type:"button",className:"flex min-w-0 items-center gap-2 text-left",children:[s.jsx(Dt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${Vt(Tt(V.scenarioId,V.agentName,Me.runIndex,"conversation"))?"rotate-180":""}`}),s.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Conversation trace"})]})}),s.jsx("div",{className:"flex flex-wrap gap-2",children:s.jsxs(re,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>ks(`Explain Run #${Me.runIndex+1} for scenario '${rt}'. 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:V.scenarioId}),children:[s.jsx(ya,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})})]}),s.jsx($i,{children:s.jsx("div",{className:"space-y-2 rounded-md border bg-muted/20 p-2",children:Me.conversation.length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No conversation trace captured."}):Me.conversation.map(kt=>s.jsx(Nge,{item:kt,fallbackUserPrompt:nn.get(V.scenarioId)?.prompt},kt.id))})}),!Vt(Tt(V.scenarioId,V.agentName,Me.runIndex,"conversation"))&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"Expand to inspect user/assistant/tool messages for this run."})]})})]})]},Me.runIndex))]})})})})]})},ye)})})]})]})]})]}),z&&s.jsxs("div",{className:"min-w-0 space-y-0 xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[s.jsx(dg,{value:ke,onValueChange:V=>Ae(V),className:"min-w-0 -mb-px px-3 pt-1",children:s.jsxs(Df,{className:"h-auto w-full justify-start rounded-none border-b bg-transparent p-0",children:[s.jsx(gs,{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"}),s.jsx(gs,{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"}),s.jsx(gs,{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"})]})}),ke==="assistant"?s.jsxs(Ue,{className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[s.jsx(St,{className:"border-b px-4 py-3",children:s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs(Nt,{className:"flex items-center gap-2 text-base",children:[s.jsx(ya,{className:"h-4 w-4 text-amber-500"}),"MCP Labs Assistant"]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(re,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>ae(V=>!V),children:[Ce?s.jsx(py,{className:"h-3.5 w-3.5"}):s.jsx(hy,{className:"h-3.5 w-3.5"}),Ce?"Compact":"Expand"]}),s.jsx(re,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>ee(!1),children:"Hide"})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Ask questions about this run result, failures, tool usage, and snapshot drift."})]})}),s.jsxs(qe,{className:"flex h-[70vh] min-h-[520px] flex-col p-0 xl:h-auto xl:min-h-0 xl:flex-1",children:[s.jsx(qm,{className:"min-h-0 flex-1 bg-muted/15 px-4 py-4",children:s.jsxs("div",{className:"space-y-3 pr-2",children:[te.map((V,ye)=>{const rt=V.role==="user",Me=V.role==="assistant",kt=V.role==="system",dt=V.role==="tool",Ht=V.pendingToolCallId?G.find(pl=>pl.id===V.pendingToolCallId):void 0,Ln=Me&&!!V.pendingToolCallId;if(dt&&/^(Approved|Denied) tool call\b/i.test(String(V.text??"").trim()))return null;Ht?.server??V.toolRequestServer;const Qt=Ht?.tool??V.toolRequestName,ca=Ht?.publicToolName??V.toolRequestPublicName,zt=Me&&!Ln&&Cge(V.text,!!Ye);if(Ln){const pl=Qt??ca??"unknown_tool";return Qt&&Qt.replace(/^mcplab_/,"").replace(/_/g," "),s.jsxs("div",{className:"flex items-start gap-2",children:[s.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:s.jsx(wa,{className:"h-3 w-3"})}),s.jsxs("details",{open:!!Ht,className:"group min-w-0 w-full max-w-[92%] overflow-hidden rounded-md border border-border/60 bg-background",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-3 px-3 py-2",children:[s.jsx("div",{className:"min-w-0 flex-1",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ls,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:`Tool call ${pl}`}),s.jsx("span",{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${Ht?"bg-amber-100 text-amber-900":"bg-muted text-muted-foreground"}`,children:Ht?"Needs approval":"Completed"})]})}),s.jsx(Dt,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),s.jsxs("div",{className:"min-w-0 space-y-2 border-t border-border/50 px-3 py-2",children:[s.jsx(bd,{text:V.text,className:"text-sm"}),Ht&&s.jsxs(s.Fragment,{children:[s.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:s.jsx("code",{className:"break-words",children:JSON.stringify(Ht.arguments??{},null,2)})}),s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx(re,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:le,onClick:()=>{hu(Ht.id)},children:"Deny"}),s.jsx(re,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:le,onClick:()=>{zf(Ht.id)},children:"Approve"})]})]})]})]})]},`${V.id??`${V.role}-${ye}`}:${Ht?"pending":"completed"}`)}const qf=rt||Me&&!dt&&!kt;return s.jsxs("div",{className:`flex items-start gap-2 ${rt?"justify-end":"justify-start"}`,children:[!rt&&s.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:kt?s.jsx(E$,{className:"h-3 w-3"}):s.jsx(wa,{className:"h-3 w-3"})}),s.jsxs("div",{className:"relative max-w-[92%]",children:[s.jsxs("div",{className:`max-w-full rounded-md border p-3 text-sm ${rt?"border-primary/20 bg-primary/10":kt?"border-amber-400/30 bg-amber-50/70":dt?"border-blue-300/30 bg-blue-50/50":"border-border/80 bg-background shadow-sm"}`,children:[!(rt||kt)&&s.jsx("p",{className:`mb-2 text-[11px] font-semibold text-muted-foreground ${rt?"text-right":""}`,children:dt?"Tool":"Assistant"}),s.jsx(bd,{text:V.text,className:"text-sm"}),zt&&s.jsxs("div",{className:"mt-3 flex max-w-full flex-wrap justify-end gap-2 overflow-x-auto pb-1",children:[s.jsxs(re,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>Vr(V.text),children:[s.jsx(ya,{className:"h-3.5 w-3.5"}),"Send to Scenario Assistant"]}),s.jsxs(re,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>Uf(V.text),children:[s.jsx(ls,{className:"h-3.5 w-3.5"}),"Apply: Write Markdown Report"]})]}),!zt&&Me&&!Ln&&s.jsx("div",{className:"mt-3 flex max-w-full justify-end overflow-x-auto pb-1",children:s.jsxs(re,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>Uf(V.text),children:[s.jsx(ls,{className:"h-3.5 w-3.5"}),"Apply: Write Markdown Report"]})})]}),qf&&s.jsx(re,{type:"button",variant:"ghost",size:"icon",className:"absolute -right-8 bottom-1 h-6 w-6 text-muted-foreground",onClick:()=>{dl(V.text)},"aria-label":"Copy message",title:"Copy message",children:s.jsx(Ui,{className:"h-3.5 w-3.5"})})]}),rt&&s.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:s.jsx(QS,{className:"h-3 w-3"})})]},V.id??`${V.role}-${ye}`)}),G.filter(V=>!te.some(ye=>ye.pendingToolCallId===V.id)).length>0&&s.jsxs("div",{className:"space-y-2",children:[s.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Pending actions (approve/deny)"}),G.filter(V=>!te.some(ye=>ye.pendingToolCallId===V.id)).map(V=>s.jsxs("details",{open:!0,className:"group min-w-0 rounded-md border bg-background",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-2 p-3",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"break-all font-mono text-xs font-semibold",children:V.publicToolName}),s.jsxs("p",{className:"break-all text-xs text-muted-foreground",children:[V.server,"::",V.tool]})]}),s.jsx(Dt,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),s.jsxs("div",{className:"border-t px-3 pb-3 pt-2",children:[s.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:s.jsx("code",{className:"break-words",children:JSON.stringify(V.arguments??{},null,2)})}),s.jsxs("div",{className:"mt-2 flex justify-end gap-2",children:[s.jsx(re,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:le,onClick:()=>{hu(V.id)},children:"Deny"}),s.jsx(re,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:le,onClick:()=>{zf(V.id)},children:"Approve"})]})]})]},V.id))]}),le&&s.jsxs("div",{className:"flex items-start gap-2",children:[s.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:s.jsx(wa,{className:"h-3 w-3"})}),s.jsxs("div",{className:"inline-flex items-center gap-2 rounded-md border bg-background px-3 py-2 text-sm text-muted-foreground",children:[s.jsx(or,{className:"h-4 w-4 animate-spin"}),"Thinking..."]})]}),s.jsx("div",{ref:En})]})}),s.jsx("div",{className:"border-t bg-background px-4 py-3",children:s.jsxs("div",{className:"rounded-xl border bg-background p-2 shadow-sm",children:[s.jsx(Wa,{ref:pe,value:oe,onChange:V=>ce(V.target.value),placeholder:"Ask about this result...",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:V=>{V.key==="Enter"&&!V.shiftKey&&(V.preventDefault(),le||ul())}}),s.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 px-1 pt-1",children:[s.jsxs(uu,{children:[s.jsx(du,{asChild:!0,children:s.jsxs(re,{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:le,children:[s.jsx(xs,{className:"h-3 w-3"}),"Snippets",s.jsx(Dt,{className:"h-3 w-3"})]})}),s.jsxs(ll,{align:"start",className:"w-[360px]",children:[s.jsx(AC,{children:"Result Assistant Snippets"}),s.jsx(_C,{}),jge.map(V=>s.jsx(xr,{className:"items-start whitespace-normal px-2 py-2",onSelect:()=>Bf(V.prompt),children:s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("div",{className:"text-xs font-medium leading-tight",children:V.label}),s.jsx("div",{className:"text-[11px] leading-snug text-muted-foreground",children:V.description})]})},V.label))]})]}),s.jsx(re,{type:"button",size:"icon",className:"h-8 w-8 shrink-0 rounded-full",onClick:()=>{ul()},disabled:le||!oe.trim(),"aria-label":"Send assistant message",title:"Send assistant message",children:le?s.jsx(or,{className:"h-4 w-4 animate-spin"}):s.jsxs(s.Fragment,{children:[s.jsx(P$,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Ask"})]})})]})]})})]})]}):ke==="reports"?s.jsxs(Ue,{className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[s.jsx(St,{className:"border-b px-4 py-3",children:s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs(Nt,{className:"flex items-center gap-2 text-base",children:[s.jsx(Yl,{className:"h-4 w-4 text-muted-foreground"}),"Reference Reports"]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(re,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>ae(V=>!V),children:[Ce?s.jsx(py,{className:"h-3.5 w-3.5"}):s.jsx(hy,{className:"h-3.5 w-3.5"}),Ce?"Compact":"Expand"]}),s.jsx(re,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>ee(!1),children:"Hide"})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Review markdown reports for this run while keeping the result visible."})]})}),s.jsxs(qe,{className:"flex h-[70vh] min-h-[520px] flex-col p-0 xl:h-auto xl:min-h-0 xl:flex-1",children:[(Nn||Pt.length===0||Pt.length>1)&&s.jsx("div",{className:"border-b px-4 py-3",children:Nn?s.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading reference reports..."}):Pt.length===0?s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"No reference reports for this run yet."}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",className:"shrink-0 gap-1.5",onClick:()=>Ag(),children:[s.jsx(xs,{className:"h-3.5 w-3.5"}),"New Report"]})]}):s.jsx("div",{className:"space-y-2",children:Pt.length>1?s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Selected report"}),s.jsxs(bn,{value:ur,onValueChange:Dn,children:[s.jsx(mn,{className:"h-8",children:s.jsx(wn,{placeholder:"Select a report"})}),s.jsx(vn,{children:Pt.map(V=>s.jsx(mt,{value:V.relativePath,children:V.name},V.path))})]})]}):null})}),s.jsx(qm,{className:"min-h-0 flex-1 bg-muted/15 px-4 py-4",children:Pt.length===0?s.jsx("div",{className:"text-sm text-muted-foreground",children:"No report selected."}):Ur?s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(or,{className:"h-4 w-4 animate-spin"}),"Loading report..."]}):Yn?s.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive",children:["Could not load report: ",Yn]}):dr?s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"rounded-md border bg-background p-3",children:[s.jsx("p",{className:"font-mono text-xs font-semibold",children:dr.name}),s.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:dr.relativePath}),s.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:new Date(dr.mtime).toLocaleString()})]}),s.jsx("div",{className:"rounded-md border bg-background p-3",children:s.jsx(bd,{text:dr.content,className:"text-sm"})})]}):s.jsx("div",{className:"text-sm text-muted-foreground",children:"Select a report to preview."})})]})]}):s.jsxs(Ue,{className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[s.jsx(St,{className:"border-b px-4 py-3",children:s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs(Nt,{className:"flex items-center gap-2 text-base",children:[s.jsx(Yl,{className:"h-4 w-4 text-muted-foreground"}),"Run Note"]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(re,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>ae(V=>!V),children:[Ce?s.jsx(py,{className:"h-3.5 w-3.5"}):s.jsx(hy,{className:"h-3.5 w-3.5"}),Ce?"Compact":"Expand"]}),s.jsx(re,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>ee(!1),children:"Hide"})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Add context for this run, such as server version or environment details."})]})}),s.jsx(qe,{className:"flex h-[70vh] min-h-[520px] flex-col p-4 xl:h-auto xl:min-h-0 xl:flex-1",children:p?s.jsxs("div",{className:"w-full max-w-xl space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("p",{className:"text-xs font-medium",children:"Run note"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[g.length,"/500"]})]}),s.jsx(Wa,{value:g,onChange:V=>j(V.target.value.slice(0,500)),placeholder:"Optional context for this run",rows:3,className:"min-h-20 resize"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(re,{size:"sm",onClick:()=>{fl()},disabled:b,children:b?"Saving...":"Save note"}),s.jsx(re,{size:"sm",variant:"outline",onClick:()=>{j(c.runNote??""),x(!1)},disabled:b,children:"Cancel"})]})]}):s.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:[s.jsxs("div",{className:"min-w-0 flex items-center gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"Run note:"}),s.jsx("span",{className:`break-words ${c.runNote?"text-foreground":"text-muted-foreground"}`,children:c.runNote||"none"})]}),s.jsx(re,{size:"sm",variant:"ghost",className:"ml-auto h-6 px-2 text-xs",onClick:()=>x(!0),children:c.runNote?"Edit":"Add note"})]})})]})]}),s.jsx(Ps,{open:xe,onOpenChange:V=>!Ne&&ue(V),children:s.jsxs(Xa,{className:"max-w-2xl",children:[s.jsxs(Qa,{children:[s.jsx(Za,{children:Be?"Create markdown report":"Approve MCP action: write markdown report"}),s.jsx(es,{children:Be?"Write a custom markdown report and save it to the workspace.":s.jsxs(s.Fragment,{children:["This will call ",s.jsx("code",{children:"mcplab_write_markdown_report"})," via the local MCPLab MCP server."]})})]}),s.jsxs("div",{className:"space-y-3",children:[!Be&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Output path"}),s.jsx(ft,{value:bt,onChange:V=>It(V.target.value),placeholder:"mcplab/reports/result-assistant/my-report.md",disabled:Ne})]}),s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx(ra,{checked:Q,onCheckedChange:V=>je(V===!0),disabled:Ne}),s.jsx("span",{children:"Overwrite if file exists"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:Be?"Markdown content":"Markdown preview (to be written)"}),s.jsx(Wa,{value:Oe,onChange:V=>Ke(V.target.value),rows:10,className:"font-mono text-xs",disabled:Ne})]})]}),s.jsxs(Ja,{children:[s.jsx(ns,{disabled:Ne,children:"Cancel"}),s.jsx(ts,{onClick:V=>{V.preventDefault(),_g()},disabled:Ne,children:Ne?"Writing...":Be?"Save Report":"Approve & Write"})]})]})})]})]})};function Nge({item:e,fallbackUserPrompt:t}){if(e.kind==="tool_call")return s.jsx(qM,{variant:"call",title:`Tool call · ${e.toolName||"unknown"}`,text:e.text});if(e.kind==="tool_result"){const d=e.ok?s.jsx(nc,{className:"h-3.5 w-3.5 text-emerald-700 dark:text-emerald-300"}):s.jsx(yh,{className:"h-3.5 w-3.5 text-rose-700 dark:text-rose-300"});return s.jsx(qM,{variant:e.ok?"result_ok":"result_error",title:`Tool result · ${e.toolName||"unknown"} · ${e.ok?"ok":"error"}${typeof e.durationMs=="number"?` · ${e.durationMs}ms`:""}`,text:e.text,icon:d})}const n=e.kind==="user_prompt",r=UM(e.text,e.kind),a=t?UM(t,"user_prompt"):"",i=n&&!r&&a?a:r,o=n?"User prompt":e.kind==="assistant_final"?"Agent final":"Agent",c=n?QS:wa;return s.jsxs("div",{className:`flex items-start gap-2 text-xs ${n?"justify-end":"justify-start"}`,children:[!n&&s.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:s.jsx(c,{className:"h-3 w-3"})}),s.jsxs("div",{className:`max-w-[90%] rounded-md p-2 ${n?"bg-primary/10":"bg-muted/50"}`,children:[s.jsx("p",{className:`mb-1 text-[11px] font-semibold text-muted-foreground ${n?"text-right":""}`,children:o}),n?s.jsx(US,{text:i,maxLength:280,className:"text-xs"}):s.jsx(US,{text:i,maxLength:500,className:"text-xs"})]}),n&&s.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:s.jsx(c,{className:"h-3 w-3"})})]})}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 Cge(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 "],a=["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))&&!a.some(h=>n.includes(h)))return!1;const o=r.some(h=>n.includes(h)),c=a.some(h=>n.includes(h)),d=/(^|\n)\s*[-*]\s+/.test(e)||/(^|\n)\s*\d+\.\s+/.test(e),f=/["'`][^"'`\n]{2,}["'`]/.test(e);return o&&(c||d||f)}function qM({variant:e,title:t,text:n,icon:r}){const[a,i]=v.useState(!1),o={call:"border-sky-500/30 bg-sky-500/10 text-sky-700 dark:text-sky-300",result_ok:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",result_error:"border-rose-500/30 bg-rose-500/10 text-rose-700 dark:text-rose-300"};return s.jsx(Mi,{open:a,onOpenChange:i,children:s.jsxs("div",{className:`rounded-md border p-2 text-xs ${o[e]}`,children:[s.jsx(Us,{asChild:!0,children:s.jsxs("button",{type:"button",className:"flex w-full items-center justify-between gap-2 text-left",children:[s.jsxs("div",{className:"flex items-center gap-1.5 font-mono text-[11px]",children:[r??s.jsx(ls,{className:"h-3.5 w-3.5"}),s.jsx("span",{children:t})]}),s.jsx("span",{className:"text-[11px] font-semibold",children:a?"Hide content":"Show content"})]})}),s.jsx($i,{children:s.jsx("p",{className:"mt-2 font-mono whitespace-pre-wrap text-foreground",children:n})})]})})}function US({text:e,maxLength:t,className:n}){const[r,a]=v.useState(!1),i=e.length>t,o=r||!i?e:`${e.slice(0,t)}...`;return s.jsxs("div",{children:[s.jsx(bd,{text:o,className:n}),i&&s.jsx("button",{type:"button",className:"mt-1 text-[11px] font-medium text-primary hover:underline",onClick:()=>a(c=>!c),children:r?"Show less":"Show all"})]})}function Age(e,t){return e.map(n=>{const r=_ge(n,t);return{rule:n,status:r?"failed":"passed",failureReason:r}})}function _ge(e,t){const n=e.type==="required_tool"?`Required tool not used: ${e.value}`:e.type==="forbidden_tool"?`Forbidden tool used: ${e.value}`:`Regex assertion failed: ${e.value}`,r=t.find(a=>a===n);if(r)return r;if(e.type==="response_contains"||e.type==="response_not_contains")return t.find(a=>a.startsWith("Regex assertion failed:")&&a.includes(e.value))}function Ege(e){return e.type==="required_tool"?`Required tool · ${e.value}`:e.type==="forbidden_tool"?`Forbidden tool · ${e.value}`:e.type==="response_contains"?`Text must match pattern · ${e.value}`:e.type==="response_not_contains"?`Text must not match pattern · ${e.value}`:`${e.type} · ${e.value}`}function WM(e){const t=String(e??"").trim(),n=t.match(/^Regex assertion failed:\s*(.+)$/i);return n?`Text match failed: ${n[1]}`:t}const Dj=["hsl(38, 92%, 50%)","hsl(200, 80%, 50%)","hsl(152, 69%, 40%)","hsl(280, 60%, 50%)","hsl(0, 72%, 51%)"];function Pge(e){const t=Array.from(new Set(e.scenarios.map(i=>i.scenarioId).filter(Boolean))),n=Array.from(new Set(e.scenarios.map(i=>i.agentId).filter(Boolean))),r=t.slice(0,2).join(", "),a=t.length>2?` +${t.length-2}`:"";return{scenarioCount:t.length,agentCount:n.length,scenarioPreview:r?`${r}${a}`:"n/a"}}const kge=()=>{const{source:e}=Rn(),[t,n]=Yi(),[r,a]=v.useState([]),[i,o]=v.useState(!1),[c,d]=v.useState(new Set),[f,h]=v.useState("timestamp"),[p,x]=v.useState("desc"),[g,j]=v.useState("all"),[b,y]=v.useState(!1),C=t.get("mode")==="within-run"?"within-run":"runs",N=t.get("runId")??"",E=(t.get("agents")??"").split(",").map(Y=>Y.trim()).filter(Boolean),_=t.get("scenario")??"all",[P,O]=v.useState(C),[T,I]=v.useState(N),[M,D]=v.useState(E),[R,q]=v.useState(_),[U,H]=v.useState(!1),J=async()=>{o(!0);try{a(await e.listResults())}catch(Y){Pe({title:"Could not load results",description:Y instanceof Error?Y.message:String(Y),variant:"destructive"})}finally{o(!1)}};v.useEffect(()=>{let Y=!0;return o(!0),e.listResults().then(xe=>{Y&&a(xe)}).catch(xe=>{Y&&Pe({title:"Could not load results",description:xe instanceof Error?xe.message:String(xe),variant:"destructive"})}).finally(()=>{Y&&o(!1)}),()=>{Y=!1}},[e]);const Z=Y=>{if(f===Y){x(xe=>xe==="asc"?"desc":"asc");return}h(Y),x(Y==="timestamp"?"desc":"asc")},F=Y=>{d(xe=>{const ue=new Set(xe);return ue.has(Y)?ue.delete(Y):ue.add(Y),ue})},z=v.useMemo(()=>{const Y=new Set;return r.forEach(xe=>{xe.scenarios.forEach(ue=>{const Oe=String(ue.scenarioName??"").trim(),Ke=String(ue.scenarioId??"").trim(),bt=Oe||Ke;bt&&Y.add(bt)})}),Array.from(Y).sort((xe,ue)=>xe.localeCompare(ue))},[r]),ee=v.useMemo(()=>g==="all"?r:r.filter(Y=>Y.scenarios.some(xe=>{const ue=String(xe.scenarioName??"").trim(),Oe=String(xe.scenarioId??"").trim();return(ue||Oe)===g})),[r,g]),B=v.useMemo(()=>[...ee].sort((xe,ue)=>{let Oe=0;return f==="id"&&(Oe=xe.id.localeCompare(ue.id)),f==="timestamp"&&(Oe=new Date(xe.timestamp).getTime()-new Date(ue.timestamp).getTime()),f==="passRate"&&(Oe=xe.overallPassRate-ue.overallPassRate),f==="scenarios"&&(Oe=xe.totalScenarios-ue.totalScenarios),p==="asc"?Oe:-Oe}),[ee,f,p]),L=v.useMemo(()=>B.filter(Y=>c.has(Y.id)),[B,c]),te=Y=>f!==Y?s.jsx(tc,{className:"h-3.5 w-3.5 text-muted-foreground"}):p==="asc"?s.jsx(fs,{className:"h-3.5 w-3.5"}):s.jsx(Dt,{className:"h-3.5 w-3.5"}),ie=v.useMemo(()=>{const Y=new Map;for(const xe of B)Y.set(xe.id,Pge(xe));return Y},[B]),G=Y=>{const xe=Array.from(new Set(Y.scenarios.map(ue=>ue.agentId).filter(Boolean)));return xe.slice(0,Math.min(2,xe.length))},de=Y=>{O("within-run"),I(Y.id),D(G(Y)),q("all")},oe=v.useMemo(()=>[...new Set(L.flatMap(Y=>Y.scenarios.map(xe=>xe.scenarioId)))],[L]),ce=v.useMemo(()=>r.find(Y=>Y.id===T),[r,T]),le=v.useMemo(()=>{if(!ce)return[];const Y=new Map;for(const xe of ce.scenarios)Y.set(xe.agentId,xe.agentName||xe.agentId);return Array.from(Y.entries()).map(([xe,ue])=>({id:xe,name:ue})).sort((xe,ue)=>xe.name.localeCompare(ue.name))},[ce]),fe=v.useMemo(()=>{if(!ce)return[];const Y=new Set;for(const xe of ce.scenarios){const ue=String(xe.scenarioName??"").trim(),Oe=String(xe.scenarioId??"").trim(),Ke=ue||Oe;Ke&&Y.add(Ke)}return Array.from(Y).sort((xe,ue)=>xe.localeCompare(ue))},[ce]),Ce=v.useMemo(()=>M.join(","),[M]);v.useEffect(()=>{if(P!=="within-run"||r.length===0)return;let Y=T;(!Y||!r.some(Q=>Q.id===Y))&&(Y=r[0].id);const xe=r.find(Q=>Q.id===Y),ue=(()=>{if(!xe)return[];const Q=new Map;for(const je of xe.scenarios)Q.set(je.agentId,je.agentName||je.agentId);return Array.from(Q.keys())})(),Oe=new Set(ue);let Ke=Ce.split(",").map(Q=>Q.trim()).filter(Q=>!!Q).filter(Q=>Oe.has(Q));Ke.length===0&&ue.length>0&&(Ke=ue.slice(0,Math.min(2,ue.length)));const bt=(()=>{if(!xe)return[];const Q=new Set;for(const je of xe.scenarios){const Ne=String(je.scenarioName??"").trim(),$e=String(je.scenarioId??"").trim(),Be=Ne||$e;Be&&Q.add(Be)}return new Set(Q)})(),It=R!=="all"&&!bt.has(R)?"all":R;Y!==T&&I(Y),Ke.join(",")!==Ce&&D(Ke),It!==R&&q(It)},[P,r,T,Ce,R]),v.useEffect(()=>{const Y=new URLSearchParams(t);P==="within-run"?(Y.set("mode","within-run"),T?Y.set("runId",T):Y.delete("runId"),M.length>0?Y.set("agents",M.join(",")):Y.delete("agents"),R!=="all"?Y.set("scenario",R):Y.delete("scenario")):(Y.delete("mode"),Y.delete("runId"),Y.delete("agents"),Y.delete("scenario"));const xe=t.toString(),ue=Y.toString();xe!==ue&&n(Y,{replace:!0})},[P,T,M,R,n]);const ae=v.useMemo(()=>{if(!ce)return[];const Y=new Map;for(const ue of ce.scenarios){const Oe=String(ue.scenarioId??"").trim(),Ke=String(ue.scenarioName??"").trim(),bt=Ke||Oe;if(!Oe&&!bt)continue;const It=Oe||bt,Q=Y.get(It);if(Q){Q.byAgent[ue.agentId]=ue;continue}Y.set(It,{scenarioId:Oe||bt,scenarioName:Ke,displayLabel:bt||Oe,byAgent:{[ue.agentId]:ue}})}const xe=Array.from(Y.values()).sort((ue,Oe)=>{const Ke=(ue.displayLabel||ue.scenarioId).toLowerCase(),bt=(Oe.displayLabel||Oe.scenarioId).toLowerCase();return Ke.localeCompare(bt)});return R==="all"?xe:xe.filter(ue=>ue.displayLabel===R)},[ce,R]),ke=v.useMemo(()=>{const Y=new Map(le.map(xe=>[xe.id,xe]));return M.map(xe=>Y.get(xe)).filter(xe=>!!xe)},[M,le]),Ae=v.useMemo(()=>{if(!ce||ke.length!==2)return null;const[Y,xe]=ke;return{left:Y,right:xe,link:`/compare/results?left=${encodeURIComponent(ce.id)}&right=${encodeURIComponent(ce.id)}&leftConfig=${encodeURIComponent(ce.configId)}&rightConfig=${encodeURIComponent(ce.configId)}&leftAgent=${encodeURIComponent(Y.id)}&rightAgent=${encodeURIComponent(xe.id)}`}},[ce,ke]),Ye=v.useMemo(()=>!ce||ke.length===0?[]:ke.map(Y=>{const ue=ae.map(Q=>Q.byAgent[Y.id]).filter(Q=>!!Q).flatMap(Q=>Q.runs),Oe=ue.length,Ke=ue.filter(Q=>Q.passed).length,bt=ue.reduce((Q,je)=>Q+je.toolCalls.length,0),It=ue.reduce((Q,je)=>Q+je.duration,0);return{agentId:Y.id,agentName:Y.name,passRate:Oe===0?0:Ke/Oe,totalRuns:Oe,avgToolCalls:Oe===0?0:bt/Oe,avgLatency:Oe===0?0:It/Oe}}),[ce,ke,ae]),be=Y=>{D(xe=>xe.includes(Y)?xe.filter(ue=>ue!==Y):[...xe,Y])},Re=Y=>s.jsxs("div",{className:"rounded border bg-muted/20 px-2 py-1.5",children:[s.jsxs("div",{className:"text-xs",children:[s.jsxs("span",{className:"font-mono",children:["#",Y.runIndex+1]})," ",s.jsx("span",{className:Y.passed?"text-emerald-700":"text-destructive",children:Y.passed?"PASS":"FAIL"})," ","· tools: ",Y.toolCalls.length," · ",Y.duration,"ms"]}),!Y.passed&&Y.failureReasons.length>0&&s.jsx("div",{className:"mt-1 text-[11px] text-muted-foreground",children:Y.failureReasons.join("; ")})]},Y.runIndex);return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(GS,{className:"h-6 w-6"}),"Compare Runs"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:P==="runs"?"Select 2–5 runs to compare":"Compare agents side-by-side within one run"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[P==="runs"&&s.jsxs(Vc,{open:b,onOpenChange:y,children:[s.jsx(Hc,{asChild:!0,children:s.jsxs(re,{type:"button",variant:"outline",role:"combobox","aria-expanded":b,className:"w-[260px] justify-between font-normal",children:[s.jsx("span",{className:"truncate text-left",children:g==="all"?"All scenarios":g}),s.jsx(Dt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(Wo,{className:"w-[260px] p-0",align:"start",children:s.jsxs(Ho,{children:[s.jsx(Ko,{placeholder:"Search scenarios..."}),s.jsxs(Go,{children:[s.jsx(Yo,{children:"No scenarios found."}),s.jsxs(Xo,{children:[s.jsx(na,{value:"all scenarios",onSelect:()=>{j("all"),y(!1)},children:"All scenarios"}),z.map(Y=>s.jsx(na,{value:Y,onSelect:()=>{j(Y),y(!1)},children:Y},Y))]})]})]})})]}),s.jsx(re,{variant:"outline",onClick:()=>{J()},disabled:i,children:i?"Refreshing...":"Refresh"})]})]}),s.jsx(Ue,{children:s.jsx(qe,{className:"pt-6",children:s.jsx("div",{className:"flex flex-wrap gap-2",children:s.jsx(re,{type:"button",variant:P==="runs"?"default":"outline",size:"sm",onClick:()=>O("runs"),children:"Run vs Run"})})})}),P==="within-run"&&s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(Nt,{className:"text-base",children:"Within One Run Controls"}),s.jsx(re,{type:"button",variant:"outline",size:"sm",onClick:()=>O("runs"),children:"Back to run list"})]})}),s.jsxs(qe,{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Run"}),s.jsxs(bn,{value:T,onValueChange:I,children:[s.jsx(mn,{children:s.jsx(wn,{placeholder:"Select run"})}),s.jsx(vn,{children:r.map(Y=>s.jsx(mt,{value:Y.id,children:Y.id},Y.id))})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Scenario filter"}),s.jsxs(Vc,{open:U,onOpenChange:H,children:[s.jsx(Hc,{asChild:!0,children:s.jsxs(re,{type:"button",variant:"outline",role:"combobox","aria-expanded":U,className:"w-full justify-between font-normal",children:[s.jsx("span",{className:"truncate text-left",children:R==="all"?"All scenarios":R}),s.jsx(Dt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(Wo,{className:"w-[var(--radix-popover-trigger-width)] p-0",align:"start",children:s.jsxs(Ho,{children:[s.jsx(Ko,{placeholder:"Search scenarios..."}),s.jsxs(Go,{children:[s.jsx(Yo,{children:"No scenarios found."}),s.jsxs(Xo,{children:[s.jsx(na,{value:"all scenarios",onSelect:()=>{q("all"),H(!1)},children:"All scenarios"}),fe.map(Y=>s.jsx(na,{value:Y,onSelect:()=>{q(Y),H(!1)},children:Y},Y))]})]})]})})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Agents (select 2+)"}),s.jsxs("div",{className:"flex flex-wrap gap-3 rounded-md border p-3",children:[le.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents available for selected run."}),le.map(Y=>s.jsxs("label",{className:"inline-flex items-center gap-2 text-sm",children:[s.jsx(ra,{checked:M.includes(Y.id),onCheckedChange:()=>be(Y.id)}),s.jsx("span",{children:Y.name})]},Y.id))]})]})]})]}),P==="runs"&&s.jsx(Ue,{children:s.jsx(qe,{className:"p-0",children:s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs($t,{children:[s.jsx(tt,{className:"w-10"}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>Z("id"),children:["Run ID",te("id")]})}),s.jsx(tt,{children:"Evaluated"}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>Z("timestamp"),children:["Timestamp",te("timestamp")]})}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>Z("passRate"),children:["Pass Rate",te("passRate")]})}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>Z("scenarios"),children:["Scenarios",te("scenarios")]})}),s.jsx(tt,{children:"Agents"}),s.jsx(tt,{className:"w-[140px] text-right",children:"Action"})]})}),s.jsx(Lr,{children:B.map(Y=>s.jsxs($t,{children:[s.jsx(ze,{children:s.jsx(ra,{checked:c.has(Y.id),onCheckedChange:()=>F(Y.id),disabled:!c.has(Y.id)&&c.size>=5})}),s.jsx(ze,{className:"font-mono text-xs",children:Y.id}),s.jsx(ze,{className:"text-[11px] text-muted-foreground",children:(()=>{const xe=ie.get(Y.id);return s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:["Evaluated: ",xe.scenarioCount," scenario",xe.scenarioCount===1?"":"s"," · ",xe.agentCount," agent",xe.agentCount===1?"":"s"]}),s.jsx("div",{className:"font-mono text-xs text-foreground/80",children:xe.scenarioPreview})]})})()}),s.jsx(ze,{className:"text-xs text-muted-foreground",children:new Date(Y.timestamp).toLocaleString()}),s.jsx(ze,{children:s.jsx(Vs,{rate:Y.overallPassRate})}),s.jsx(ze,{className:"font-mono text-sm",children:Y.totalScenarios}),s.jsx(ze,{className:"font-mono text-sm",children:ie.get(Y.id)?.agentCount??0}),s.jsx(ze,{className:"text-right",children:(ie.get(Y.id)?.agentCount??0)>1?s.jsx(re,{type:"button",size:"sm",variant:"outline",onClick:()=>de(Y),children:"Compare agents"}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})})]},Y.id))})]})})}),P==="runs"&&L.length>=2&&s.jsxs(s.Fragment,{children:[L.length===2&&s.jsx(Ue,{children:s.jsx(qe,{className:"pt-6",children:s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"Need a deeper comparison?"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Open the two selected runs in a dedicated side-by-side full result compare view."})]}),s.jsx(re,{asChild:!0,size:"sm",children:s.jsx(jt,{to:`/compare/results?left=${encodeURIComponent(L[0].id)}&right=${encodeURIComponent(L[1].id)}&leftConfig=${encodeURIComponent(L[0].configId)}&rightConfig=${encodeURIComponent(L[1].configId)}`,children:"Compare full results"})})]})})}),s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Summary Comparison"})}),s.jsx(qe,{className:"p-0",children:s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs($t,{children:[s.jsx(tt,{children:"Metric"}),L.map((Y,xe)=>s.jsx(tt,{style:{color:Dj[xe]},className:"font-mono text-xs",children:Y.id},Y.id))]})}),s.jsxs(Lr,{children:[s.jsxs($t,{children:[s.jsx(ze,{className:"font-medium",children:"Pass Rate"}),L.map(Y=>s.jsx(ze,{children:s.jsx(Vs,{rate:Y.overallPassRate})},Y.id))]}),s.jsxs($t,{children:[s.jsx(ze,{className:"font-medium",children:"Total Runs"}),L.map(Y=>s.jsx(ze,{className:"font-mono",children:Y.totalRuns},Y.id))]}),s.jsxs($t,{children:[s.jsx(ze,{className:"font-medium",children:"Tool Calls"}),L.map(Y=>s.jsx(ze,{className:"font-mono",children:Y.avgToolCalls.toFixed(1)},Y.id))]}),s.jsxs($t,{children:[s.jsx(ze,{className:"font-medium",children:"Avg Latency"}),L.map(Y=>s.jsxs(ze,{className:"font-mono",children:[Y.avgLatency,"ms"]},Y.id))]})]})]})})]}),s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Scenario Breakdown"})}),s.jsx(qe,{className:"p-0",children:s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs($t,{children:[s.jsx(tt,{children:"Scenario"}),L.map((Y,xe)=>s.jsx(tt,{style:{color:Dj[xe]},className:"font-mono text-xs",children:Y.id},Y.id))]})}),s.jsx(Lr,{children:oe.map(Y=>s.jsxs($t,{children:[s.jsx(ze,{className:"font-medium text-sm",children:Y}),L.map(xe=>{const ue=xe.scenarios.find(Oe=>Oe.scenarioId===Y);return s.jsx(ze,{children:ue?s.jsx(Vs,{rate:ue.passRate}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})},xe.id)})]},Y))})]})})]})]}),P==="runs"&&L.length>=2&&s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Pass Rate Trend"})}),s.jsx(qe,{className:"h-72",children:s.jsx(Kh,{width:"100%",height:"100%",children:s.jsxs(_S,{data:L.map((Y,xe)=>({idx:xe+1,runId:Y.id,passRate:Number((Y.overallPassRate*100).toFixed(1))})),children:[s.jsx(Vi,{dataKey:"idx",tickFormatter:Y=>String(Y)}),s.jsx(Hi,{unit:"%",domain:[0,100]}),s.jsx(Mr,{formatter:Y=>[`${Y}%`,"Pass Rate"],labelFormatter:Y=>`Run ${Y}`}),s.jsx(ko,{}),s.jsx(zo,{type:"monotone",dataKey:"passRate",stroke:Dj[0],strokeWidth:2.5,dot:!0})]})})})]}),P==="within-run"&&ce&&ke.length<2&&s.jsx(Ue,{children:s.jsx(qe,{className:"pt-6 text-sm text-muted-foreground",children:"Select at least 2 agents to compare side-by-side within this run."})}),P==="within-run"&&ce&&ke.length>=2&&s.jsxs(s.Fragment,{children:[s.jsx(Ue,{children:s.jsx(qe,{className:"pt-6",children:s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"Need full result details?"}),s.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."})]}),s.jsx(re,{asChild:!0,size:"sm",children:Ae?s.jsx(jt,{to:Ae.link,children:"Compare full results"}):s.jsx(jt,{to:`/results/${encodeURIComponent(ce.id)}${ce.configId?`?configId=${encodeURIComponent(ce.configId)}`:""}`,children:"Open full result"})})]})})}),s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Agent Summary"})}),s.jsx(qe,{className:"p-0",children:s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs($t,{children:[s.jsx(tt,{children:"Metric"}),Ye.map(Y=>s.jsx(tt,{className:"font-mono text-xs",children:Y.agentName},Y.agentId))]})}),s.jsxs(Lr,{children:[s.jsxs($t,{children:[s.jsx(ze,{className:"font-medium",children:"Pass Rate"}),Ye.map(Y=>s.jsx(ze,{children:s.jsx(Vs,{rate:Y.passRate})},Y.agentId))]}),s.jsxs($t,{children:[s.jsx(ze,{className:"font-medium",children:"Total Runs"}),Ye.map(Y=>s.jsx(ze,{className:"font-mono",children:Y.totalRuns},Y.agentId))]}),s.jsxs($t,{children:[s.jsx(ze,{className:"font-medium",children:"Avg Tool Calls"}),Ye.map(Y=>s.jsx(ze,{className:"font-mono",children:Y.avgToolCalls.toFixed(1)},Y.agentId))]}),s.jsxs($t,{children:[s.jsx(ze,{className:"font-medium",children:"Avg Latency"}),Ye.map(Y=>s.jsxs(ze,{className:"font-mono",children:[Math.round(Y.avgLatency),"ms"]},Y.agentId))]})]})]})})]}),s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Scenario × Agent Matrix"})}),s.jsx(qe,{className:"p-0",children:s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs($t,{children:[s.jsx(tt,{className:"w-[260px]",children:"Scenario"}),ke.map(Y=>s.jsx(tt,{className:"font-mono text-xs",children:Y.name},Y.id))]})}),s.jsx(Lr,{children:ae.map(Y=>s.jsxs($t,{children:[s.jsx(ze,{className:"font-medium text-sm",children:Y.displayLabel}),ke.map(xe=>{const ue=Y.byAgent[xe.id];return ue?s.jsx(ze,{className:"align-top",children:s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"text-xs text-muted-foreground",children:[s.jsx(Vs,{rate:ue.passRate})," ",s.jsxs("span",{className:"ml-2",children:["runs: ",ue.runs.length]})," ","· calls: ",ue.avgToolCalls.toFixed(1)," · latency: ",Math.round(ue.avgDuration),"ms"]}),ue.runs.length>0?s.jsx("div",{className:"space-y-1.5",children:ue.runs.map(Oe=>Re(Oe))}):s.jsx("div",{className:"text-xs text-muted-foreground",children:"No runs captured."})]})},xe.id):s.jsx(ze,{children:s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})},xe.id)})]},Y.scenarioId))})]})})]})]})]})},VM=(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()}`},HM=(e,t,n)=>{const r=new URLSearchParams;t&&r.set("configId",t),n&&r.set("agent",n);const a=r.toString();return`/results/${encodeURIComponent(e)}${a?`?${a}`:""}`},Oge=()=>{const[e]=Yi(),t=e.get("left")??"",n=e.get("right")??"",r=e.get("leftConfig"),a=e.get("rightConfig"),i=e.get("leftAgent"),o=e.get("rightAgent"),c=i?`${t} · ${i}`:t,d=o?`${n} · ${o}`:n;return!t||!n?s.jsxs(Ue,{children:[s.jsx(St,{children:s.jsx(Nt,{className:"text-base",children:"Full Result Compare"})}),s.jsxs(qe,{className:"space-y-3",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Select exactly two runs in Compare and use the “Compare full results” action."}),s.jsx(re,{asChild:!0,variant:"outline",children:s.jsx(jt,{to:"/compare",children:"Back to Compare"})})]})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Full Result Compare"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:i||o?"Side-by-side Result Detail views for deep inspection, filtered by selected agents.":"Side-by-side Result Detail views for deep inspection."})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(re,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs(jt,{to:"/compare",children:[s.jsx(F7,{className:"mr-1.5 h-4 w-4"}),"Back to Compare"]})}),s.jsx(re,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs("a",{href:HM(t,r,i),target:"_blank",rel:"noreferrer",children:["Open Left",s.jsx(Ah,{className:"ml-1.5 h-3.5 w-3.5"})]})}),s.jsx(re,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs("a",{href:HM(n,a,o),target:"_blank",rel:"noreferrer",children:["Open Right",s.jsx(Ah,{className:"ml-1.5 h-3.5 w-3.5"})]})})]})]}),s.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[s.jsxs(Ue,{className:"overflow-hidden",children:[s.jsx(St,{className:"py-3",children:s.jsx(Nt,{className:"text-sm font-mono",children:c})}),s.jsx(qe,{className:"p-0",children:s.jsx("iframe",{title:`Result ${c}`,src:VM(t,r,i),className:"h-[calc(100vh-15rem)] w-full border-0"})})]}),s.jsxs(Ue,{className:"overflow-hidden",children:[s.jsx(St,{className:"py-3",children:s.jsx(Nt,{className:"text-sm font-mono",children:d})}),s.jsx(qe,{className:"p-0",children:s.jsx("iframe",{title:`Result ${d}`,src:VM(n,a,o),className:"h-[calc(100vh-15rem)] w-full border-0"})})]})]})]})};function Tge(e){return e.match(/(?:^|\/)(?:result-assistant|results?)\/([0-9]{8}-[0-9]{6})(?:-|\/)/i)?.[1]??null}function Rge(){const{source:e}=Rn(),[t,n]=v.useState([]),[r,a]=v.useState(!0),[i,o]=v.useState(null),[c,d]=v.useState(!1),f=async()=>{a(!0);try{n(await e.listMarkdownReports())}catch(g){Pe({title:"Could not load markdown reports",description:g instanceof Error?g.message:String(g),variant:"destructive"})}finally{a(!1)}};v.useEffect(()=>{f()},[]);const h=v.useMemo(()=>t[0],[t]),p=v.useMemo(()=>t.find(g=>g.relativePath===i)??null,[t,i]),x=async()=>{if(i){d(!0);try{await e.deleteMarkdownReport(i),n(g=>g.filter(j=>j.relativePath!==i)),Pe({title:"Markdown report deleted"}),o(null)}catch(g){Pe({title:"Could not delete markdown report",description:g instanceof Error?g.message:String(g),variant:"destructive"})}finally{d(!1)}}};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(Yl,{className:"h-6 w-6"}),"Markdown Reports"]}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Browse Markdown files under ",s.jsx("code",{children:"mcplab/reports"}),"."]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(re,{variant:"outline",onClick:()=>{f()},children:"Refresh"}),h?s.jsx(re,{asChild:!0,variant:"outline",children:s.jsx(jt,{to:`/markdown-reports/view?path=${encodeURIComponent(h.relativePath)}`,children:"Open latest"})}):null]})]}),s.jsx(Ue,{children:s.jsx(qe,{className:"p-0",children:r?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"Loading markdown reports..."}):t.length===0?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"No markdown reports found yet."}):s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs($t,{children:[s.jsx(tt,{children:"Report"}),s.jsx(tt,{children:"Result"}),s.jsx(tt,{children:"Folder"}),s.jsx(tt,{children:"Timestamp"}),s.jsx(tt,{className:"w-10"})]})}),s.jsx(Lr,{children:t.map(g=>s.jsxs($t,{children:[s.jsx(ze,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(jt,{to:`/markdown-reports/view?path=${encodeURIComponent(g.relativePath)}`,className:"font-mono text-xs text-primary hover:underline",children:g.name}),s.jsx("div",{className:"font-mono text-[11px] text-muted-foreground",children:g.relativePath})]})}),s.jsx(ze,{className:"text-xs text-muted-foreground font-mono",children:(()=>{const j=Tge(g.relativePath);return j?s.jsx(jt,{to:`/results/${encodeURIComponent(j)}`,className:"text-primary hover:underline",children:j}):s.jsx("span",{className:"text-muted-foreground",children:"—"})})()}),s.jsx(ze,{className:"text-xs text-muted-foreground font-mono",children:g.relativePath.includes("/")?g.relativePath.slice(0,g.relativePath.lastIndexOf("/")):"."}),s.jsx(ze,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(vf,{className:"h-3 w-3"}),new Date(g.mtime).toLocaleString()]})}),s.jsx(ze,{children:s.jsxs(uu,{children:[s.jsx(du,{asChild:!0,children:s.jsx(re,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Gm,{className:"h-4 w-4"})})}),s.jsxs(ll,{align:"end",children:[s.jsx(xr,{asChild:!0,children:s.jsx(jt,{to:`/markdown-reports/view?path=${encodeURIComponent(g.relativePath)}`,children:"View"})}),s.jsxs(xr,{className:"text-destructive",onSelect:j=>{j.preventDefault(),o(g.relativePath)},children:[s.jsx(Aa,{className:"mr-2 h-3.5 w-3.5"})," Delete"]})]})]})})]},g.path))})]})})}),s.jsx(Ps,{open:!!i,onOpenChange:g=>!g&&o(null),children:s.jsxs(Xa,{children:[s.jsxs(Qa,{children:[s.jsx(Za,{children:"Delete markdown report?"}),s.jsx(es,{children:p?`Delete '${p.name}' from disk? This cannot be undone.`:"Delete this report from disk? This cannot be undone."})]}),s.jsxs(Ja,{children:[s.jsx(ns,{disabled:c,children:"Cancel"}),s.jsx(ts,{onClick:g=>{g.preventDefault(),x()},disabled:c,children:c?"Deleting...":"Delete"})]})]})})]})}function Ige(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Mge(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 $ge(){const{source:e}=Rn(),[t]=Yi(),n=(t.get("path")??"").trim(),[r,a]=v.useState(null),[i,o]=v.useState(!0),[c,d]=v.useState(!1),[f,h]=v.useState(!1);if(v.useEffect(()=>{let x=!0;if(a(null),d(!1),!n){o(!1);return}return o(!0),e.getMarkdownReport(n).then(g=>{x&&a(g)}).catch(g=>{if(!x)return;const j=g instanceof Error?g.message:String(g);if(j.includes("(404)")){d(!0);return}Pe({title:"Could not load markdown report",description:j,variant:"destructive"})}).finally(()=>{x&&o(!1)}),()=>{x=!1}},[n,e]),!n)return s.jsxs("div",{className:"space-y-4",children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Markdown Report"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Missing report path."}),s.jsx(re,{asChild:!0,variant:"outline",children:s.jsx(jt,{to:"/markdown-reports",children:"Back to Markdown Reports"})})]});if(i)return s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading markdown report..."});if(c||!r)return s.jsxs("div",{className:"space-y-4",children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Markdown Report"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Report not found."}),s.jsx(re,{asChild:!0,variant:"outline",children:s.jsx(jt,{to:"/markdown-reports",children:"Back to Markdown Reports"})})]});const p=Mge(r);return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("h1",{className:"font-mono text-xl font-semibold",children:r.name}),s.jsx("p",{className:"truncate text-sm text-muted-foreground",children:r.relativePath}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[new Date(r.mtime).toLocaleString()," "," · "," ",Ige(r.sizeBytes)]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[p?s.jsxs(s.Fragment,{children:[s.jsx(re,{variant:"outline",size:"sm",onClick:()=>h(!0),children:"Open Result Panel"}),s.jsx(re,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(jt,{to:`/results/${encodeURIComponent(p)}`,children:"Open Result"})})]}):null,s.jsx(re,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(jt,{to:"/markdown-reports",children:"Back to reports"})})]})]}),s.jsx(Ue,{children:s.jsx(qe,{className:"pt-6",children:s.jsx(bd,{text:r.content,variant:"assistant"})})}),p?s.jsx(p3,{open:f,onOpenChange:h,children:s.jsxs(xN,{side:"right",className:"w-[96vw] max-w-none p-0 sm:max-w-5xl",children:[s.jsx(m3,{className:"border-b px-4 py-3 pr-12",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs(v3,{className:"text-base",children:["Result ",p]}),s.jsx(re,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(jt,{to:`/results/${encodeURIComponent(p)}`,target:"_blank",rel:"noreferrer",children:"Open full page"})})]})}),s.jsx("div",{className:"h-[calc(100vh-64px)]",children:s.jsx("iframe",{title:`Result ${p}`,src:`/results/${encodeURIComponent(p)}?embed=1`,className:"h-full w-full border-0"})})]})}):null]})}const Dge=()=>{const e=Cs();return v.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),s.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),s.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})},Lge=new SV;function Fge(){const{scenarioId:e}=Zo();return s.jsx(MD,{to:e?`/libraries/test-cases/${encodeURIComponent(e)}`:"/libraries/test-cases",replace:!0})}const Bge=()=>s.jsx(CV,{client:Lge,children:s.jsx(gD,{children:s.jsx(DG,{children:s.jsx(zG,{children:s.jsxs(BG,{children:[s.jsx(kq,{}),s.jsx(l9,{}),s.jsx(AH,{children:s.jsxs(gH,{children:[s.jsxs(Zt,{element:s.jsx(FG,{}),children:[s.jsx(Zt,{path:"/",element:s.jsx(hfe,{})}),s.jsx(Zt,{path:"/mcp-evaluations",element:s.jsx(Vpe,{})}),s.jsx(Zt,{path:"/mcp-evaluations/:id",element:s.jsx(jM,{})}),s.jsx(Zt,{path:"/mcp-evaluations/:id/:tab",element:s.jsx(jM,{})}),s.jsx(Zt,{path:"/tool-analysis",element:s.jsx(oge,{})}),s.jsx(Zt,{path:"/tool-analysis-results",element:s.jsx(lge,{})}),s.jsx(Zt,{path:"/tool-analysis-results/:id",element:s.jsx(cge,{})}),s.jsx(Zt,{path:"/oauth-debugger",element:s.jsx(hge,{})}),s.jsx(Zt,{path:"/libraries/servers",element:s.jsx(Pme,{})}),s.jsx(Zt,{path:"/libraries/servers/:serverId",element:s.jsx(Ome,{})}),s.jsx(Zt,{path:"/libraries/agents",element:s.jsx(Tme,{})}),s.jsx(Zt,{path:"/libraries/agents/:agentName",element:s.jsx(Uve,{})}),s.jsx(Zt,{path:"/libraries/test-cases",element:s.jsx(kM,{})}),s.jsx(Zt,{path:"/libraries/test-cases/:testCaseId",element:s.jsx(kM,{})}),s.jsx(Zt,{path:"/libraries/scenarios",element:s.jsx(MD,{to:"/libraries/test-cases",replace:!0})}),s.jsx(Zt,{path:"/libraries/scenarios/:scenarioId",element:s.jsx(Fge,{})}),s.jsx(Zt,{path:"/settings",element:s.jsx(qve,{})}),s.jsx(Zt,{path:"/run",element:s.jsx(mge,{})}),s.jsx(Zt,{path:"/results",element:s.jsx(gge,{})}),s.jsx(Zt,{path:"/results/:id",element:s.jsx(Sge,{})}),s.jsx(Zt,{path:"/markdown-reports",element:s.jsx(Rge,{})}),s.jsx(Zt,{path:"/markdown-reports/view",element:s.jsx($ge,{})}),s.jsx(Zt,{path:"/compare",element:s.jsx(kge,{})}),s.jsx(Zt,{path:"/compare/results",element:s.jsx(Oge,{})})]}),s.jsx(Zt,{path:"*",element:s.jsx(Dge,{})})]})})]})})})})});IU.createRoot(document.getElementById("root")).render(s.jsx(Bge,{}));