@inspectr/mcplab 1.0.1 → 1.1.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.
@@ -0,0 +1,249 @@
1
+ function h7(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 Cp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Vt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ly={exports:{}},Au={},Fy={exports:{}},Et={};var KA;function m7(){if(KA)return Et;KA=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 y(F){return F===null||typeof F!="object"?null:(F=p&&F[p]||F["@@iterator"],typeof F=="function"?F:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,b={};function x(F,$,ee){this.props=F,this.context=$,this.refs=b,this.updater=ee||g}x.prototype.isReactComponent={},x.prototype.setState=function(F,$){if(typeof F!="object"&&typeof F!="function"&&F!=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,F,$,"setState")},x.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function S(){}S.prototype=x.prototype;function N(F,$,ee){this.props=F,this.context=$,this.refs=b,this.updater=ee||g}var _=N.prototype=new S;_.constructor=N,j(_,x.prototype),_.isPureReactComponent=!0;var P=Array.isArray,A=Object.prototype.hasOwnProperty,O={current:null},R={key:!0,ref:!0,__self:!0,__source:!0};function k(F,$,ee){var ae,K={},le=null,te=null;if($!=null)for(ae in $.ref!==void 0&&(te=$.ref),$.key!==void 0&&(le=""+$.key),$)A.call($,ae)&&!R.hasOwnProperty(ae)&&(K[ae]=$[ae]);var de=arguments.length-2;if(de===1)K.children=ee;else if(1<de){for(var oe=Array(de),pe=0;pe<de;pe++)oe[pe]=arguments[pe+2];K.children=oe}if(F&&F.defaultProps)for(ae in de=F.defaultProps,de)K[ae]===void 0&&(K[ae]=de[ae]);return{$$typeof:e,type:F,key:le,ref:te,props:K,_owner:O.current}}function M(F,$){return{$$typeof:e,type:F.type,key:$,ref:F.ref,props:F.props,_owner:F._owner}}function z(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function B(F){var $={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(ee){return $[ee]})}var L=/\/+/g;function G(F,$){return typeof F=="object"&&F!==null&&F.key!=null?B(""+F.key):$.toString(36)}function U(F,$,ee,ae,K){var le=typeof F;(le==="undefined"||le==="boolean")&&(F=null);var te=!1;if(F===null)te=!0;else switch(le){case"string":case"number":te=!0;break;case"object":switch(F.$$typeof){case e:case t:te=!0}}if(te)return te=F,K=K(te),F=ae===""?"."+G(te,0):ae,P(K)?(ee="",F!=null&&(ee=F.replace(L,"$&/")+"/"),U(K,$,ee,"",function(pe){return pe})):K!=null&&(z(K)&&(K=M(K,ee+(!K.key||te&&te.key===K.key?"":(""+K.key).replace(L,"$&/")+"/")+F)),$.push(K)),1;if(te=0,ae=ae===""?".":ae+":",P(F))for(var de=0;de<F.length;de++){le=F[de];var oe=ae+G(le,de);te+=U(le,$,ee,oe,K)}else if(oe=y(F),typeof oe=="function")for(F=oe.call(F),de=0;!(le=F.next()).done;)le=le.value,oe=ae+G(le,de++),te+=U(le,$,ee,oe,K);else if(le==="object")throw $=String(F),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(F).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.");return te}function H(F,$,ee){if(F==null)return F;var ae=[],K=0;return U(F,ae,"","",function(le){return $.call(ee,le,K++)}),ae}function Q(F){if(F._status===-1){var $=F._result;$=$(),$.then(function(ee){(F._status===0||F._status===-1)&&(F._status=1,F._result=ee)},function(ee){(F._status===0||F._status===-1)&&(F._status=2,F._result=ee)}),F._status===-1&&(F._status=0,F._result=$)}if(F._status===1)return F._result.default;throw F._result}var J={current:null},T={transition:null},D={ReactCurrentDispatcher:J,ReactCurrentBatchConfig:T,ReactCurrentOwner:O};function X(){throw Error("act(...) is not supported in production builds of React.")}return Et.Children={map:H,forEach:function(F,$,ee){H(F,function(){$.apply(this,arguments)},ee)},count:function(F){var $=0;return H(F,function(){$++}),$},toArray:function(F){return H(F,function($){return $})||[]},only:function(F){if(!z(F))throw Error("React.Children.only expected to receive a single React element child.");return F}},Et.Component=x,Et.Fragment=n,Et.Profiler=a,Et.PureComponent=N,Et.StrictMode=r,Et.Suspense=d,Et.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=D,Et.act=X,Et.cloneElement=function(F,$,ee){if(F==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+F+".");var ae=j({},F.props),K=F.key,le=F.ref,te=F._owner;if($!=null){if($.ref!==void 0&&(le=$.ref,te=O.current),$.key!==void 0&&(K=""+$.key),F.type&&F.type.defaultProps)var de=F.type.defaultProps;for(oe in $)A.call($,oe)&&!R.hasOwnProperty(oe)&&(ae[oe]=$[oe]===void 0&&de!==void 0?de[oe]:$[oe])}var oe=arguments.length-2;if(oe===1)ae.children=ee;else if(1<oe){de=Array(oe);for(var pe=0;pe<oe;pe++)de[pe]=arguments[pe+2];ae.children=de}return{$$typeof:e,type:F.type,key:K,ref:le,props:ae,_owner:te}},Et.createContext=function(F){return F={$$typeof:o,_currentValue:F,_currentValue2:F,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},F.Provider={$$typeof:i,_context:F},F.Consumer=F},Et.createElement=k,Et.createFactory=function(F){var $=k.bind(null,F);return $.type=F,$},Et.createRef=function(){return{current:null}},Et.forwardRef=function(F){return{$$typeof:c,render:F}},Et.isValidElement=z,Et.lazy=function(F){return{$$typeof:h,_payload:{_status:-1,_result:F},_init:Q}},Et.memo=function(F,$){return{$$typeof:f,type:F,compare:$===void 0?null:$}},Et.startTransition=function(F){var $=T.transition;T.transition={};try{F()}finally{T.transition=$}},Et.unstable_act=X,Et.useCallback=function(F,$){return J.current.useCallback(F,$)},Et.useContext=function(F){return J.current.useContext(F)},Et.useDebugValue=function(){},Et.useDeferredValue=function(F){return J.current.useDeferredValue(F)},Et.useEffect=function(F,$){return J.current.useEffect(F,$)},Et.useId=function(){return J.current.useId()},Et.useImperativeHandle=function(F,$,ee){return J.current.useImperativeHandle(F,$,ee)},Et.useInsertionEffect=function(F,$){return J.current.useInsertionEffect(F,$)},Et.useLayoutEffect=function(F,$){return J.current.useLayoutEffect(F,$)},Et.useMemo=function(F,$){return J.current.useMemo(F,$)},Et.useReducer=function(F,$,ee){return J.current.useReducer(F,$,ee)},Et.useRef=function(F){return J.current.useRef(F)},Et.useState=function(F){return J.current.useState(F)},Et.useSyncExternalStore=function(F,$,ee){return J.current.useSyncExternalStore(F,$,ee)},Et.useTransition=function(){return J.current.useTransition()},Et.version="18.3.1",Et}var GA;function jS(){return GA||(GA=1,Fy.exports=m7()),Fy.exports}var YA;function v7(){if(YA)return Au;YA=1;var e=jS(),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={},y=null,g=null;f!==void 0&&(y=""+f),d.key!==void 0&&(y=""+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:y,ref:g,props:p,_owner:a.current}}return Au.Fragment=n,Au.jsx=o,Au.jsxs=o,Au}var XA;function g7(){return XA||(XA=1,Ly.exports=v7()),Ly.exports}var s=g7(),_p={},By={exports:{}},Tr={},zy={exports:{}},Uy={};var QA;function y7(){return QA||(QA=1,(function(e){function t(T,D){var X=T.length;T.push(D);e:for(;0<X;){var F=X-1>>>1,$=T[F];if(0<a($,D))T[F]=D,T[X]=$,X=F;else break e}}function n(T){return T.length===0?null:T[0]}function r(T){if(T.length===0)return null;var D=T[0],X=T.pop();if(X!==D){T[0]=X;e:for(var F=0,$=T.length,ee=$>>>1;F<ee;){var ae=2*(F+1)-1,K=T[ae],le=ae+1,te=T[le];if(0>a(K,X))le<$&&0>a(te,K)?(T[F]=te,T[le]=X,F=le):(T[F]=K,T[ae]=X,F=ae);else if(le<$&&0>a(te,X))T[F]=te,T[le]=X,F=le;else break e}}return D}function a(T,D){var X=T.sortIndex-D.sortIndex;return X!==0?X:T.id-D.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,y=3,g=!1,j=!1,b=!1,x=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(T){for(var D=n(f);D!==null;){if(D.callback===null)r(f);else if(D.startTime<=T)r(f),D.sortIndex=D.expirationTime,t(d,D);else break;D=n(f)}}function P(T){if(b=!1,_(T),!j)if(n(d)!==null)j=!0,Q(A);else{var D=n(f);D!==null&&J(P,D.startTime-T)}}function A(T,D){j=!1,b&&(b=!1,S(k),k=-1),g=!0;var X=y;try{for(_(D),p=n(d);p!==null&&(!(p.expirationTime>D)||T&&!B());){var F=p.callback;if(typeof F=="function"){p.callback=null,y=p.priorityLevel;var $=F(p.expirationTime<=D);D=e.unstable_now(),typeof $=="function"?p.callback=$:p===n(d)&&r(d),_(D)}else r(d);p=n(d)}if(p!==null)var ee=!0;else{var ae=n(f);ae!==null&&J(P,ae.startTime-D),ee=!1}return ee}finally{p=null,y=X,g=!1}}var O=!1,R=null,k=-1,M=5,z=-1;function B(){return!(e.unstable_now()-z<M)}function L(){if(R!==null){var T=e.unstable_now();z=T;var D=!0;try{D=R(!0,T)}finally{D?G():(O=!1,R=null)}}else O=!1}var G;if(typeof N=="function")G=function(){N(L)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,H=U.port2;U.port1.onmessage=L,G=function(){H.postMessage(null)}}else G=function(){x(L,0)};function Q(T){R=T,O||(O=!0,G())}function J(T,D){k=x(function(){T(e.unstable_now())},D)}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(T){T.callback=null},e.unstable_continueExecution=function(){j||g||(j=!0,Q(A))},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(T){switch(y){case 1:case 2:case 3:var D=3;break;default:D=y}var X=y;y=D;try{return T()}finally{y=X}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(T,D){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var X=y;y=T;try{return D()}finally{y=X}},e.unstable_scheduleCallback=function(T,D,X){var F=e.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?F+X:F):X=F,T){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=X+$,T={id:h++,callback:D,priorityLevel:T,startTime:X,expirationTime:$,sortIndex:-1},X>F?(T.sortIndex=X,t(f,T),n(d)===null&&T===n(f)&&(b?(S(k),k=-1):b=!0,J(P,X-F))):(T.sortIndex=$,t(d,T),j||g||(j=!0,Q(A))),T},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(T){var D=y;return function(){var X=y;y=D;try{return T.apply(this,arguments)}finally{y=X}}}})(Uy)),Uy}var JA;function x7(){return JA||(JA=1,zy.exports=y7()),zy.exports}var ZA;function b7(){if(ZA)return Tr;ZA=1;var e=jS(),t=x7();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 y(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,C,E,I){this.acceptsBooleans=u===2||u===3||u===4,this.attributeName=w,this.attributeNamespace=C,this.mustUseProperty=m,this.propertyName=l,this.type=u,this.sanitizeURL=E,this.removeEmptyString=I}var x={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(l){x[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];x[u]=new b(u,1,!1,l[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(l){x[l]=new b(l,2,!1,l.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(l){x[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){x[l]=new b(l,3,!1,l.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(l){x[l]=new b(l,3,!0,l,null,!1,!1)}),["capture","download"].forEach(function(l){x[l]=new b(l,4,!1,l,null,!1,!1)}),["cols","rows","size","span"].forEach(function(l){x[l]=new b(l,6,!1,l,null,!1,!1)}),["rowSpan","start"].forEach(function(l){x[l]=new b(l,5,!1,l.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function N(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,N);x[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,N);x[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,N);x[u]=new b(u,1,!1,l,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(l){x[l]=new b(l,1,!1,l.toLowerCase(),null,!1,!1)}),x.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(l){x[l]=new b(l,1,!1,l.toLowerCase(),null,!0,!0)});function _(l,u,m,w){var C=x.hasOwnProperty(u)?x[u]:null;(C!==null?C.type!==0:w||!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(j(u,m,C,w)&&(m=null),w||C===null?y(u)&&(m===null?l.removeAttribute(u):l.setAttribute(u,""+m)):C.mustUseProperty?l[C.propertyName]=m===null?C.type===3?!1:"":m:(u=C.attributeName,w=C.attributeNamespace,m===null?l.removeAttribute(u):(C=C.type,m=C===3||C===4&&m===!0?"":""+m,w?l.setAttributeNS(w,u,m):l.setAttribute(u,m))))}var P=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,A=Symbol.for("react.element"),O=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),z=Symbol.for("react.provider"),B=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),J=Symbol.for("react.offscreen"),T=Symbol.iterator;function D(l){return l===null||typeof l!="object"?null:(l=T&&l[T]||l["@@iterator"],typeof l=="function"?l:null)}var X=Object.assign,F;function $(l){if(F===void 0)try{throw Error()}catch(m){var u=m.stack.trim().match(/\n( *(at )?)/);F=u&&u[1]||""}return`
2
+ `+F+l}var ee=!1;function ae(l,u){if(!l||ee)return"";ee=!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(me){var w=me}Reflect.construct(l,[],u)}else{try{u.call()}catch(me){w=me}l.call(u.prototype)}else{try{throw Error()}catch(me){w=me}l()}}catch(me){if(me&&w&&typeof me.stack=="string"){for(var C=me.stack.split(`
3
+ `),E=w.stack.split(`
4
+ `),I=C.length-1,Y=E.length-1;1<=I&&0<=Y&&C[I]!==E[Y];)Y--;for(;1<=I&&0<=Y;I--,Y--)if(C[I]!==E[Y]){if(I!==1||Y!==1)do if(I--,Y--,0>Y||C[I]!==E[Y]){var ne=`
5
+ `+C[I].replace(" at new "," at ");return l.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",l.displayName)),ne}while(1<=I&&0<=Y);break}}}finally{ee=!1,Error.prepareStackTrace=m}return(l=l?l.displayName||l.name:"")?$(l):""}function K(l){switch(l.tag){case 5:return $(l.type);case 16:return $("Lazy");case 13:return $("Suspense");case 19:return $("SuspenseList");case 0:case 2:case 15:return l=ae(l.type,!1),l;case 11:return l=ae(l.type.render,!1),l;case 1:return l=ae(l.type,!0),l;default:return""}}function le(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 R:return"Fragment";case O:return"Portal";case M:return"Profiler";case k:return"StrictMode";case G:return"Suspense";case U:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case B:return(l.displayName||"Context")+".Consumer";case z:return(l._context.displayName||"Context")+".Provider";case L: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:le(l.type)||"Memo";case Q:u=l._payload,l=l._init;try{return le(l(u))}catch{}}return null}function te(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 le(u);case 8:return u===k?"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 de(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function oe(l){var u=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function pe(l){var u=oe(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 C=m.get,E=m.set;return Object.defineProperty(l,u,{configurable:!0,get:function(){return C.call(this)},set:function(I){w=""+I,E.call(this,I)}}),Object.defineProperty(l,u,{enumerable:m.enumerable}),{getValue:function(){return w},setValue:function(I){w=""+I},stopTracking:function(){l._valueTracker=null,delete l[u]}}}}function je(l){l._valueTracker||(l._valueTracker=pe(l))}function se(l){if(!l)return!1;var u=l._valueTracker;if(!u)return!0;var m=u.getValue(),w="";return l&&(w=oe(l)?l.checked?"true":"false":l.value),l=w,l!==m?(u.setValue(l),!0):!1}function $e(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 X({},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=de(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 ye(l,u){u=u.checked,u!=null&&_(l,"checked",u,!1)}function Se(l,u){ye(l,u);var m=de(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")?ct(l,u.type,m):u.hasOwnProperty("defaultValue")&&ct(l,u.type,de(u.defaultValue)),u.checked==null&&u.defaultChecked!=null&&(l.defaultChecked=!!u.defaultChecked)}function ze(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 ct(l,u,m){(u!=="number"||$e(l.ownerDocument)!==l)&&(m==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+m&&(l.defaultValue=""+m))}var Z=Array.isArray;function Ne(l,u,m,w){if(l=l.options,u){u={};for(var C=0;C<m.length;C++)u["$"+m[C]]=!0;for(m=0;m<l.length;m++)C=u.hasOwnProperty("$"+l[m].value),l[m].selected!==C&&(l[m].selected=C),C&&w&&(l[m].defaultSelected=!0)}else{for(m=""+de(m),u=null,C=0;C<l.length;C++){if(l[C].value===m){l[C].selected=!0,w&&(l[C].defaultSelected=!0);return}u!==null||l[C].disabled||(u=l[C])}u!==null&&(u.selected=!0)}}function Ie(l,u){if(u.dangerouslySetInnerHTML!=null)throw Error(n(91));return X({},u,{value:void 0,defaultValue:void 0,children:""+l._wrapperState.initialValue})}function Re(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(Z(m)){if(1<m.length)throw Error(n(93));m=m[0]}u=m}u==null&&(u=""),m=u}l._wrapperState={initialValue:de(m)}}function De(l,u){var m=de(u.value),w=de(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 he(l){var u=l.textContent;u===l._wrapperState.initialValue&&u!==""&&u!==null&&(l.value=u)}function Fe(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 Ue(l,u){return l==null||l==="http://www.w3.org/1999/xhtml"?Fe(u):l==="http://www.w3.org/2000/svg"&&u==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var Rt,Ht=(function(l){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(u,m,w,C){MSApp.execUnsafeLocalFunction(function(){return l(u,m,w,C)})}:l})(function(l,u){if(l.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in l)l.innerHTML=u;else{for(Rt=Rt||document.createElement("div"),Rt.innerHTML="<svg>"+u.valueOf().toString()+"</svg>",u=Rt.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;u.firstChild;)l.appendChild(u.firstChild)}});function zt(l,u){if(u){var m=l.firstChild;if(m&&m===l.lastChild&&m.nodeType===3){m.nodeValue=u;return}}l.textContent=u}var $t={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},Rn=["Webkit","ms","Moz","O"];Object.keys($t).forEach(function(l){Rn.forEach(function(u){u=u+l.charAt(0).toUpperCase()+l.substring(1),$t[u]=$t[l]})});function kn(l,u,m){return u==null||typeof u=="boolean"||u===""?"":m||typeof u!="number"||u===0||$t.hasOwnProperty(l)&&$t[l]?(""+u).trim():u+"px"}function lr(l,u){l=l.style;for(var m in u)if(u.hasOwnProperty(m)){var w=m.indexOf("--")===0,C=kn(m,u[m],w);m==="float"&&(m="cssFloat"),w?l.setProperty(m,C):l[m]=C}}var cr=X({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 Ln(l,u){if(u){if(cr[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 ur(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 Lr(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var Fr=null,Xn=null,Kt=null;function _n(l){if(l=fu(l)){if(typeof Fr!="function")throw Error(n(280));var u=l.stateNode;u&&(u=Bf(u),Fr(l.stateNode,l.type,u))}}function ce(l){Xn?Kt?Kt.push(l):Kt=[l]:Xn=l}function ke(){if(Xn){var l=Xn,u=Kt;if(Kt=Xn=null,_n(l),u)for(l=0;l<u.length;l++)_n(u[l])}}function nt(l,u){return l(u)}function yt(){}var Dt=!1;function Yt(l,u,m){if(Dt)return l(u,m);Dt=!0;try{return nt(l,u,m)}finally{Dt=!1,(Xn!==null||Kt!==null)&&(yt(),ke())}}function cn(l,u){var m=l.stateNode;if(m===null)return null;var w=Bf(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 dr=!1;if(c)try{var Sn={};Object.defineProperty(Sn,"passive",{get:function(){dr=!0}}),window.addEventListener("test",Sn,Sn),window.removeEventListener("test",Sn,Sn)}catch{dr=!1}function Fn(l,u,m,w,C,E,I,Y,ne){var me=Array.prototype.slice.call(arguments,3);try{u.apply(m,me)}catch(Ce){this.onError(Ce)}}var Br=!1,zr=null,gn=!1,ri=null,ts={onError:function(l){Br=!0,zr=l}};function W(l,u,m,w,C,E,I,Y,ne){Br=!1,zr=null,Fn.apply(ts,arguments)}function ve(l,u,m,w,C,E,I,Y,ne){if(W.apply(this,arguments),Br){if(Br){var me=zr;Br=!1,zr=null}else throw Error(n(198));gn||(gn=!0,ri=me)}}function Be(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 ut(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 _t(l){if(Be(l)!==l)throw Error(n(188))}function At(l){var u=l.alternate;if(!u){if(u=Be(l),u===null)throw Error(n(188));return u!==l?null:l}for(var m=l,w=u;;){var C=m.return;if(C===null)break;var E=C.alternate;if(E===null){if(w=C.return,w!==null){m=w;continue}break}if(C.child===E.child){for(E=C.child;E;){if(E===m)return _t(C),l;if(E===w)return _t(C),u;E=E.sibling}throw Error(n(188))}if(m.return!==w.return)m=C,w=E;else{for(var I=!1,Y=C.child;Y;){if(Y===m){I=!0,m=C,w=E;break}if(Y===w){I=!0,w=C,m=E;break}Y=Y.sibling}if(!I){for(Y=E.child;Y;){if(Y===m){I=!0,m=E,w=C;break}if(Y===w){I=!0,w=E,m=C;break}Y=Y.sibling}if(!I)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 yn(l){return l=At(l),l!==null?Ge(l):null}function Ge(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var u=Ge(l);if(u!==null)return u;l=l.sibling}return null}var hn=t.unstable_scheduleCallback,Tn=t.unstable_cancelCallback,Ut=t.unstable_shouldYield,An=t.unstable_requestPaint,xn=t.unstable_now,ng=t.unstable_getCurrentPriorityLevel,Ko=t.unstable_ImmediatePriority,Sf=t.unstable_UserBlockingPriority,Go=t.unstable_NormalPriority,rg=t.unstable_LowPriority,Nf=t.unstable_IdlePriority,V=null,ge=null;function st(l){if(ge&&typeof ge.onCommitFiberRoot=="function")try{ge.onCommitFiberRoot(V,l,void 0,(l.current.flags&128)===128)}catch{}}var Pe=Math.clz32?Math.clz32:In,kt=Math.log,Pt=Math.LN2;function In(l){return l>>>=0,l===0?32:31-(kt(l)/Pt|0)|0}var ia=64,Xt=4194304;function Ar(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 Gi(l,u){var m=l.pendingLanes;if(m===0)return 0;var w=0,C=l.suspendedLanes,E=l.pingedLanes,I=m&268435455;if(I!==0){var Y=I&~C;Y!==0?w=Ar(Y):(E&=I,E!==0&&(w=Ar(E)))}else I=m&~C,I!==0?w=Ar(I):E!==0&&(w=Ar(E));if(w===0)return 0;if(u!==0&&u!==w&&(u&C)===0&&(C=w&-w,E=u&-u,C>=E||C===16&&(E&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-Pe(u),C=1<<m,w|=l[m],u&=~C;return w}function ag(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 Gc(l,u){for(var m=l.suspendedLanes,w=l.pingedLanes,C=l.expirationTimes,E=l.pendingLanes;0<E;){var I=31-Pe(E),Y=1<<I,ne=C[I];ne===-1?((Y&m)===0||(Y&w)!==0)&&(C[I]=ag(Y,u)):ne<=u&&(l.expiredLanes|=Y),E&=~Y}}function sg(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function NC(){var l=ia;return ia<<=1,(ia&4194240)===0&&(ia=64),l}function ig(l){for(var u=[],m=0;31>m;m++)u.push(l);return u}function Yc(l,u,m){l.pendingLanes|=u,u!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,u=31-Pe(u),l[u]=m}function Mz(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 C=31-Pe(m),E=1<<C;u[C]=0,w[C]=-1,l[C]=-1,m&=~E}}function og(l,u){var m=l.entangledLanes|=u;for(l=l.entanglements;m;){var w=31-Pe(m),C=1<<w;C&u|l[w]&u&&(l[w]|=u),m&=~C}}var qt=0;function CC(l){return l&=-l,1<l?4<l?(l&268435455)!==0?16:536870912:4:1}var _C,lg,AC,EC,PC,cg=!1,Cf=[],ai=null,si=null,ii=null,Xc=new Map,Qc=new Map,oi=[],$z="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 OC(l,u){switch(l){case"focusin":case"focusout":ai=null;break;case"dragenter":case"dragleave":si=null;break;case"mouseover":case"mouseout":ii=null;break;case"pointerover":case"pointerout":Xc.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qc.delete(u.pointerId)}}function Jc(l,u,m,w,C,E){return l===null||l.nativeEvent!==E?(l={blockedOn:u,domEventName:m,eventSystemFlags:w,nativeEvent:E,targetContainers:[C]},u!==null&&(u=fu(u),u!==null&&lg(u)),l):(l.eventSystemFlags|=w,u=l.targetContainers,C!==null&&u.indexOf(C)===-1&&u.push(C),l)}function Dz(l,u,m,w,C){switch(u){case"focusin":return ai=Jc(ai,l,u,m,w,C),!0;case"dragenter":return si=Jc(si,l,u,m,w,C),!0;case"mouseover":return ii=Jc(ii,l,u,m,w,C),!0;case"pointerover":var E=C.pointerId;return Xc.set(E,Jc(Xc.get(E)||null,l,u,m,w,C)),!0;case"gotpointercapture":return E=C.pointerId,Qc.set(E,Jc(Qc.get(E)||null,l,u,m,w,C)),!0}return!1}function RC(l){var u=Yi(l.target);if(u!==null){var m=Be(u);if(m!==null){if(u=m.tag,u===13){if(u=ut(m),u!==null){l.blockedOn=u,PC(l.priority,function(){AC(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 _f(l){if(l.blockedOn!==null)return!1;for(var u=l.targetContainers;0<u.length;){var m=dg(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=fu(m),u!==null&&lg(u),l.blockedOn=m,!1;u.shift()}return!0}function kC(l,u,m){_f(l)&&m.delete(u)}function Lz(){cg=!1,ai!==null&&_f(ai)&&(ai=null),si!==null&&_f(si)&&(si=null),ii!==null&&_f(ii)&&(ii=null),Xc.forEach(kC),Qc.forEach(kC)}function Zc(l,u){l.blockedOn===u&&(l.blockedOn=null,cg||(cg=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Lz)))}function eu(l){function u(C){return Zc(C,l)}if(0<Cf.length){Zc(Cf[0],l);for(var m=1;m<Cf.length;m++){var w=Cf[m];w.blockedOn===l&&(w.blockedOn=null)}}for(ai!==null&&Zc(ai,l),si!==null&&Zc(si,l),ii!==null&&Zc(ii,l),Xc.forEach(u),Qc.forEach(u),m=0;m<oi.length;m++)w=oi[m],w.blockedOn===l&&(w.blockedOn=null);for(;0<oi.length&&(m=oi[0],m.blockedOn===null);)RC(m),m.blockedOn===null&&oi.shift()}var Yo=P.ReactCurrentBatchConfig,Af=!0;function Fz(l,u,m,w){var C=qt,E=Yo.transition;Yo.transition=null;try{qt=1,ug(l,u,m,w)}finally{qt=C,Yo.transition=E}}function Bz(l,u,m,w){var C=qt,E=Yo.transition;Yo.transition=null;try{qt=4,ug(l,u,m,w)}finally{qt=C,Yo.transition=E}}function ug(l,u,m,w){if(Af){var C=dg(l,u,m,w);if(C===null)Eg(l,u,w,Ef,m),OC(l,w);else if(Dz(C,l,u,m,w))w.stopPropagation();else if(OC(l,w),u&4&&-1<$z.indexOf(l)){for(;C!==null;){var E=fu(C);if(E!==null&&_C(E),E=dg(l,u,m,w),E===null&&Eg(l,u,w,Ef,m),E===C)break;C=E}C!==null&&w.stopPropagation()}else Eg(l,u,w,null,m)}}var Ef=null;function dg(l,u,m,w){if(Ef=null,l=Lr(w),l=Yi(l),l!==null)if(u=Be(l),u===null)l=null;else if(m=u.tag,m===13){if(l=ut(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 Ef=l,null}function TC(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 Ko:return 1;case Sf:return 4;case Go:case rg:return 16;case Nf:return 536870912;default:return 16}default:return 16}}var li=null,fg=null,Pf=null;function IC(){if(Pf)return Pf;var l,u=fg,m=u.length,w,C="value"in li?li.value:li.textContent,E=C.length;for(l=0;l<m&&u[l]===C[l];l++);var I=m-l;for(w=1;w<=I&&u[m-w]===C[E-w];w++);return Pf=C.slice(l,1<w?1-w:void 0)}function Of(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 Rf(){return!0}function MC(){return!1}function Ur(l){function u(m,w,C,E,I){this._reactName=m,this._targetInst=C,this.type=w,this.nativeEvent=E,this.target=I,this.currentTarget=null;for(var Y in l)l.hasOwnProperty(Y)&&(m=l[Y],this[Y]=m?m(E):E[Y]);return this.isDefaultPrevented=(E.defaultPrevented!=null?E.defaultPrevented:E.returnValue===!1)?Rf:MC,this.isPropagationStopped=MC,this}return X(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=Rf)},stopPropagation:function(){var m=this.nativeEvent;m&&(m.stopPropagation?m.stopPropagation():typeof m.cancelBubble!="unknown"&&(m.cancelBubble=!0),this.isPropagationStopped=Rf)},persist:function(){},isPersistent:Rf}),u}var Xo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pg=Ur(Xo),tu=X({},Xo,{view:0,detail:0}),zz=Ur(tu),hg,mg,nu,kf=X({},tu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:gg,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!==nu&&(nu&&l.type==="mousemove"?(hg=l.screenX-nu.screenX,mg=l.screenY-nu.screenY):mg=hg=0,nu=l),hg)},movementY:function(l){return"movementY"in l?l.movementY:mg}}),$C=Ur(kf),Uz=X({},kf,{dataTransfer:0}),qz=Ur(Uz),Wz=X({},tu,{relatedTarget:0}),vg=Ur(Wz),Vz=X({},Xo,{animationName:0,elapsedTime:0,pseudoElement:0}),Hz=Ur(Vz),Kz=X({},Xo,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),Gz=Ur(Kz),Yz=X({},Xo,{data:0}),DC=Ur(Yz),Xz={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Qz={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"},Jz={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Zz(l){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(l):(l=Jz[l])?!!u[l]:!1}function gg(){return Zz}var e6=X({},tu,{key:function(l){if(l.key){var u=Xz[l.key]||l.key;if(u!=="Unidentified")return u}return l.type==="keypress"?(l=Of(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?Qz[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:gg,charCode:function(l){return l.type==="keypress"?Of(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?Of(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),t6=Ur(e6),n6=X({},kf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),LC=Ur(n6),r6=X({},tu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:gg}),a6=Ur(r6),s6=X({},Xo,{propertyName:0,elapsedTime:0,pseudoElement:0}),i6=Ur(s6),o6=X({},kf,{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}),l6=Ur(o6),c6=[9,13,27,32],yg=c&&"CompositionEvent"in window,ru=null;c&&"documentMode"in document&&(ru=document.documentMode);var u6=c&&"TextEvent"in window&&!ru,FC=c&&(!yg||ru&&8<ru&&11>=ru),BC=" ",zC=!1;function UC(l,u){switch(l){case"keyup":return c6.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qC(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var Qo=!1;function d6(l,u){switch(l){case"compositionend":return qC(u);case"keypress":return u.which!==32?null:(zC=!0,BC);case"textInput":return l=u.data,l===BC&&zC?null:l;default:return null}}function f6(l,u){if(Qo)return l==="compositionend"||!yg&&UC(l,u)?(l=IC(),Pf=fg=li=null,Qo=!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 FC&&u.locale!=="ko"?null:u.data;default:return null}}var p6={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 WC(l){var u=l&&l.nodeName&&l.nodeName.toLowerCase();return u==="input"?!!p6[l.type]:u==="textarea"}function VC(l,u,m,w){ce(w),u=Df(u,"onChange"),0<u.length&&(m=new pg("onChange","change",null,m,w),l.push({event:m,listeners:u}))}var au=null,su=null;function h6(l){c_(l,0)}function Tf(l){var u=nl(l);if(se(u))return l}function m6(l,u){if(l==="change")return u}var HC=!1;if(c){var xg;if(c){var bg="oninput"in document;if(!bg){var KC=document.createElement("div");KC.setAttribute("oninput","return;"),bg=typeof KC.oninput=="function"}xg=bg}else xg=!1;HC=xg&&(!document.documentMode||9<document.documentMode)}function GC(){au&&(au.detachEvent("onpropertychange",YC),su=au=null)}function YC(l){if(l.propertyName==="value"&&Tf(su)){var u=[];VC(u,su,l,Lr(l)),Yt(h6,u)}}function v6(l,u,m){l==="focusin"?(GC(),au=u,su=m,au.attachEvent("onpropertychange",YC)):l==="focusout"&&GC()}function g6(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return Tf(su)}function y6(l,u){if(l==="click")return Tf(u)}function x6(l,u){if(l==="input"||l==="change")return Tf(u)}function b6(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var Pa=typeof Object.is=="function"?Object.is:b6;function iu(l,u){if(Pa(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 C=m[w];if(!d.call(u,C)||!Pa(l[C],u[C]))return!1}return!0}function XC(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function QC(l,u){var m=XC(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=XC(m)}}function JC(l,u){return l&&u?l===u?!0:l&&l.nodeType===3?!1:u&&u.nodeType===3?JC(l,u.parentNode):"contains"in l?l.contains(u):l.compareDocumentPosition?!!(l.compareDocumentPosition(u)&16):!1:!1}function ZC(){for(var l=window,u=$e();u instanceof l.HTMLIFrameElement;){try{var m=typeof u.contentWindow.location.href=="string"}catch{m=!1}if(m)l=u.contentWindow;else break;u=$e(l.document)}return u}function wg(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 w6(l){var u=ZC(),m=l.focusedElem,w=l.selectionRange;if(u!==m&&m&&m.ownerDocument&&JC(m.ownerDocument.documentElement,m)){if(w!==null&&wg(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 C=m.textContent.length,E=Math.min(w.start,C);w=w.end===void 0?E:Math.min(w.end,C),!l.extend&&E>w&&(C=w,w=E,E=C),C=QC(m,E);var I=QC(m,w);C&&I&&(l.rangeCount!==1||l.anchorNode!==C.node||l.anchorOffset!==C.offset||l.focusNode!==I.node||l.focusOffset!==I.offset)&&(u=u.createRange(),u.setStart(C.node,C.offset),l.removeAllRanges(),E>w?(l.addRange(u),l.extend(I.node,I.offset)):(u.setEnd(I.node,I.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 j6=c&&"documentMode"in document&&11>=document.documentMode,Jo=null,jg=null,ou=null,Sg=!1;function e_(l,u,m){var w=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;Sg||Jo==null||Jo!==$e(w)||(w=Jo,"selectionStart"in w&&wg(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}),ou&&iu(ou,w)||(ou=w,w=Df(jg,"onSelect"),0<w.length&&(u=new pg("onSelect","select",null,u,m),l.push({event:u,listeners:w}),u.target=Jo)))}function If(l,u){var m={};return m[l.toLowerCase()]=u.toLowerCase(),m["Webkit"+l]="webkit"+u,m["Moz"+l]="moz"+u,m}var Zo={animationend:If("Animation","AnimationEnd"),animationiteration:If("Animation","AnimationIteration"),animationstart:If("Animation","AnimationStart"),transitionend:If("Transition","TransitionEnd")},Ng={},t_={};c&&(t_=document.createElement("div").style,"AnimationEvent"in window||(delete Zo.animationend.animation,delete Zo.animationiteration.animation,delete Zo.animationstart.animation),"TransitionEvent"in window||delete Zo.transitionend.transition);function Mf(l){if(Ng[l])return Ng[l];if(!Zo[l])return l;var u=Zo[l],m;for(m in u)if(u.hasOwnProperty(m)&&m in t_)return Ng[l]=u[m];return l}var n_=Mf("animationend"),r_=Mf("animationiteration"),a_=Mf("animationstart"),s_=Mf("transitionend"),i_=new Map,o_="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 ci(l,u){i_.set(l,u),i(u,[l])}for(var Cg=0;Cg<o_.length;Cg++){var _g=o_[Cg],S6=_g.toLowerCase(),N6=_g[0].toUpperCase()+_g.slice(1);ci(S6,"on"+N6)}ci(n_,"onAnimationEnd"),ci(r_,"onAnimationIteration"),ci(a_,"onAnimationStart"),ci("dblclick","onDoubleClick"),ci("focusin","onFocus"),ci("focusout","onBlur"),ci(s_,"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 lu="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(" "),C6=new Set("cancel close invalid load scroll toggle".split(" ").concat(lu));function l_(l,u,m){var w=l.type||"unknown-event";l.currentTarget=m,ve(w,u,void 0,l),l.currentTarget=null}function c_(l,u){u=(u&4)!==0;for(var m=0;m<l.length;m++){var w=l[m],C=w.event;w=w.listeners;e:{var E=void 0;if(u)for(var I=w.length-1;0<=I;I--){var Y=w[I],ne=Y.instance,me=Y.currentTarget;if(Y=Y.listener,ne!==E&&C.isPropagationStopped())break e;l_(C,Y,me),E=ne}else for(I=0;I<w.length;I++){if(Y=w[I],ne=Y.instance,me=Y.currentTarget,Y=Y.listener,ne!==E&&C.isPropagationStopped())break e;l_(C,Y,me),E=ne}}}if(gn)throw l=ri,gn=!1,ri=null,l}function un(l,u){var m=u[Ig];m===void 0&&(m=u[Ig]=new Set);var w=l+"__bubble";m.has(w)||(u_(u,l,2,!1),m.add(w))}function Ag(l,u,m){var w=0;u&&(w|=4),u_(m,l,w,u)}var $f="_reactListening"+Math.random().toString(36).slice(2);function cu(l){if(!l[$f]){l[$f]=!0,r.forEach(function(m){m!=="selectionchange"&&(C6.has(m)||Ag(m,!1,l),Ag(m,!0,l))});var u=l.nodeType===9?l:l.ownerDocument;u===null||u[$f]||(u[$f]=!0,Ag("selectionchange",!1,u))}}function u_(l,u,m,w){switch(TC(u)){case 1:var C=Fz;break;case 4:C=Bz;break;default:C=ug}m=C.bind(null,u,m,l),C=void 0,!dr||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(C=!0),w?C!==void 0?l.addEventListener(u,m,{capture:!0,passive:C}):l.addEventListener(u,m,!0):C!==void 0?l.addEventListener(u,m,{passive:C}):l.addEventListener(u,m,!1)}function Eg(l,u,m,w,C){var E=w;if((u&1)===0&&(u&2)===0&&w!==null)e:for(;;){if(w===null)return;var I=w.tag;if(I===3||I===4){var Y=w.stateNode.containerInfo;if(Y===C||Y.nodeType===8&&Y.parentNode===C)break;if(I===4)for(I=w.return;I!==null;){var ne=I.tag;if((ne===3||ne===4)&&(ne=I.stateNode.containerInfo,ne===C||ne.nodeType===8&&ne.parentNode===C))return;I=I.return}for(;Y!==null;){if(I=Yi(Y),I===null)return;if(ne=I.tag,ne===5||ne===6){w=E=I;continue e}Y=Y.parentNode}}w=w.return}Yt(function(){var me=E,Ce=Lr(m),Oe=[];e:{var we=i_.get(l);if(we!==void 0){var He=pg,Ze=l;switch(l){case"keypress":if(Of(m)===0)break e;case"keydown":case"keyup":He=t6;break;case"focusin":Ze="focus",He=vg;break;case"focusout":Ze="blur",He=vg;break;case"beforeblur":case"afterblur":He=vg;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":He=$C;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":He=qz;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":He=a6;break;case n_:case r_:case a_:He=Hz;break;case s_:He=i6;break;case"scroll":He=zz;break;case"wheel":He=l6;break;case"copy":case"cut":case"paste":He=Gz;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":He=LC}var et=(u&4)!==0,En=!et&&l==="scroll",ue=et?we!==null?we+"Capture":null:we;et=[];for(var re=me,fe;re!==null;){fe=re;var Te=fe.stateNode;if(fe.tag===5&&Te!==null&&(fe=Te,ue!==null&&(Te=cn(re,ue),Te!=null&&et.push(uu(re,Te,fe)))),En)break;re=re.return}0<et.length&&(we=new He(we,Ze,null,m,Ce),Oe.push({event:we,listeners:et}))}}if((u&7)===0){e:{if(we=l==="mouseover"||l==="pointerover",He=l==="mouseout"||l==="pointerout",we&&m!==_r&&(Ze=m.relatedTarget||m.fromElement)&&(Yi(Ze)||Ze[Ns]))break e;if((He||we)&&(we=Ce.window===Ce?Ce:(we=Ce.ownerDocument)?we.defaultView||we.parentWindow:window,He?(Ze=m.relatedTarget||m.toElement,He=me,Ze=Ze?Yi(Ze):null,Ze!==null&&(En=Be(Ze),Ze!==En||Ze.tag!==5&&Ze.tag!==6)&&(Ze=null)):(He=null,Ze=me),He!==Ze)){if(et=$C,Te="onMouseLeave",ue="onMouseEnter",re="mouse",(l==="pointerout"||l==="pointerover")&&(et=LC,Te="onPointerLeave",ue="onPointerEnter",re="pointer"),En=He==null?we:nl(He),fe=Ze==null?we:nl(Ze),we=new et(Te,re+"leave",He,m,Ce),we.target=En,we.relatedTarget=fe,Te=null,Yi(Ce)===me&&(et=new et(ue,re+"enter",Ze,m,Ce),et.target=fe,et.relatedTarget=En,Te=et),En=Te,He&&Ze)t:{for(et=He,ue=Ze,re=0,fe=et;fe;fe=el(fe))re++;for(fe=0,Te=ue;Te;Te=el(Te))fe++;for(;0<re-fe;)et=el(et),re--;for(;0<fe-re;)ue=el(ue),fe--;for(;re--;){if(et===ue||ue!==null&&et===ue.alternate)break t;et=el(et),ue=el(ue)}et=null}else et=null;He!==null&&d_(Oe,we,He,et,!1),Ze!==null&&En!==null&&d_(Oe,En,Ze,et,!0)}}e:{if(we=me?nl(me):window,He=we.nodeName&&we.nodeName.toLowerCase(),He==="select"||He==="input"&&we.type==="file")var at=m6;else if(WC(we))if(HC)at=x6;else{at=g6;var dt=v6}else(He=we.nodeName)&&He.toLowerCase()==="input"&&(we.type==="checkbox"||we.type==="radio")&&(at=y6);if(at&&(at=at(l,me))){VC(Oe,at,m,Ce);break e}dt&&dt(l,we,me),l==="focusout"&&(dt=we._wrapperState)&&dt.controlled&&we.type==="number"&&ct(we,"number",we.value)}switch(dt=me?nl(me):window,l){case"focusin":(WC(dt)||dt.contentEditable==="true")&&(Jo=dt,jg=me,ou=null);break;case"focusout":ou=jg=Jo=null;break;case"mousedown":Sg=!0;break;case"contextmenu":case"mouseup":case"dragend":Sg=!1,e_(Oe,m,Ce);break;case"selectionchange":if(j6)break;case"keydown":case"keyup":e_(Oe,m,Ce)}var ft;if(yg)e:{switch(l){case"compositionstart":var gt="onCompositionStart";break e;case"compositionend":gt="onCompositionEnd";break e;case"compositionupdate":gt="onCompositionUpdate";break e}gt=void 0}else Qo?UC(l,m)&&(gt="onCompositionEnd"):l==="keydown"&&m.keyCode===229&&(gt="onCompositionStart");gt&&(FC&&m.locale!=="ko"&&(Qo||gt!=="onCompositionStart"?gt==="onCompositionEnd"&&Qo&&(ft=IC()):(li=Ce,fg="value"in li?li.value:li.textContent,Qo=!0)),dt=Df(me,gt),0<dt.length&&(gt=new DC(gt,l,null,m,Ce),Oe.push({event:gt,listeners:dt}),ft?gt.data=ft:(ft=qC(m),ft!==null&&(gt.data=ft)))),(ft=u6?d6(l,m):f6(l,m))&&(me=Df(me,"onBeforeInput"),0<me.length&&(Ce=new DC("onBeforeInput","beforeinput",null,m,Ce),Oe.push({event:Ce,listeners:me}),Ce.data=ft))}c_(Oe,u)})}function uu(l,u,m){return{instance:l,listener:u,currentTarget:m}}function Df(l,u){for(var m=u+"Capture",w=[];l!==null;){var C=l,E=C.stateNode;C.tag===5&&E!==null&&(C=E,E=cn(l,m),E!=null&&w.unshift(uu(l,E,C)),E=cn(l,u),E!=null&&w.push(uu(l,E,C))),l=l.return}return w}function el(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5);return l||null}function d_(l,u,m,w,C){for(var E=u._reactName,I=[];m!==null&&m!==w;){var Y=m,ne=Y.alternate,me=Y.stateNode;if(ne!==null&&ne===w)break;Y.tag===5&&me!==null&&(Y=me,C?(ne=cn(m,E),ne!=null&&I.unshift(uu(m,ne,Y))):C||(ne=cn(m,E),ne!=null&&I.push(uu(m,ne,Y)))),m=m.return}I.length!==0&&l.push({event:u,listeners:I})}var _6=/\r\n?/g,A6=/\u0000|\uFFFD/g;function f_(l){return(typeof l=="string"?l:""+l).replace(_6,`
6
+ `).replace(A6,"")}function Lf(l,u,m){if(u=f_(u),f_(l)!==u&&m)throw Error(n(425))}function Ff(){}var Pg=null,Og=null;function Rg(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 kg=typeof setTimeout=="function"?setTimeout:void 0,E6=typeof clearTimeout=="function"?clearTimeout:void 0,p_=typeof Promise=="function"?Promise:void 0,P6=typeof queueMicrotask=="function"?queueMicrotask:typeof p_<"u"?function(l){return p_.resolve(null).then(l).catch(O6)}:kg;function O6(l){setTimeout(function(){throw l})}function Tg(l,u){var m=u,w=0;do{var C=m.nextSibling;if(l.removeChild(m),C&&C.nodeType===8)if(m=C.data,m==="/$"){if(w===0){l.removeChild(C),eu(u);return}w--}else m!=="$"&&m!=="$?"&&m!=="$!"||w++;m=C}while(m);eu(u)}function ui(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 h_(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 tl=Math.random().toString(36).slice(2),ns="__reactFiber$"+tl,du="__reactProps$"+tl,Ns="__reactContainer$"+tl,Ig="__reactEvents$"+tl,R6="__reactListeners$"+tl,k6="__reactHandles$"+tl;function Yi(l){var u=l[ns];if(u)return u;for(var m=l.parentNode;m;){if(u=m[Ns]||m[ns]){if(m=u.alternate,u.child!==null||m!==null&&m.child!==null)for(l=h_(l);l!==null;){if(m=l[ns])return m;l=h_(l)}return u}l=m,m=l.parentNode}return null}function fu(l){return l=l[ns]||l[Ns],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function nl(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(n(33))}function Bf(l){return l[du]||null}var Mg=[],rl=-1;function di(l){return{current:l}}function dn(l){0>rl||(l.current=Mg[rl],Mg[rl]=null,rl--)}function nn(l,u){rl++,Mg[rl]=l.current,l.current=u}var fi={},fr=di(fi),Er=di(!1),Xi=fi;function al(l,u){var m=l.type.contextTypes;if(!m)return fi;var w=l.stateNode;if(w&&w.__reactInternalMemoizedUnmaskedChildContext===u)return w.__reactInternalMemoizedMaskedChildContext;var C={},E;for(E in m)C[E]=u[E];return w&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=u,l.__reactInternalMemoizedMaskedChildContext=C),C}function Pr(l){return l=l.childContextTypes,l!=null}function zf(){dn(Er),dn(fr)}function m_(l,u,m){if(fr.current!==fi)throw Error(n(168));nn(fr,u),nn(Er,m)}function v_(l,u,m){var w=l.stateNode;if(u=u.childContextTypes,typeof w.getChildContext!="function")return m;w=w.getChildContext();for(var C in w)if(!(C in u))throw Error(n(108,te(l)||"Unknown",C));return X({},m,w)}function Uf(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||fi,Xi=fr.current,nn(fr,l),nn(Er,Er.current),!0}function g_(l,u,m){var w=l.stateNode;if(!w)throw Error(n(169));m?(l=v_(l,u,Xi),w.__reactInternalMemoizedMergedChildContext=l,dn(Er),dn(fr),nn(fr,l)):dn(Er),nn(Er,m)}var Cs=null,qf=!1,$g=!1;function y_(l){Cs===null?Cs=[l]:Cs.push(l)}function T6(l){qf=!0,y_(l)}function pi(){if(!$g&&Cs!==null){$g=!0;var l=0,u=qt;try{var m=Cs;for(qt=1;l<m.length;l++){var w=m[l];do w=w(!0);while(w!==null)}Cs=null,qf=!1}catch(C){throw Cs!==null&&(Cs=Cs.slice(l+1)),hn(Ko,pi),C}finally{qt=u,$g=!1}}return null}var sl=[],il=0,Wf=null,Vf=0,oa=[],la=0,Qi=null,_s=1,As="";function Ji(l,u){sl[il++]=Vf,sl[il++]=Wf,Wf=l,Vf=u}function x_(l,u,m){oa[la++]=_s,oa[la++]=As,oa[la++]=Qi,Qi=l;var w=_s;l=As;var C=32-Pe(w)-1;w&=~(1<<C),m+=1;var E=32-Pe(u)+C;if(30<E){var I=C-C%5;E=(w&(1<<I)-1).toString(32),w>>=I,C-=I,_s=1<<32-Pe(u)+C|m<<C|w,As=E+l}else _s=1<<E|m<<C|w,As=l}function Dg(l){l.return!==null&&(Ji(l,1),x_(l,1,0))}function Lg(l){for(;l===Wf;)Wf=sl[--il],sl[il]=null,Vf=sl[--il],sl[il]=null;for(;l===Qi;)Qi=oa[--la],oa[la]=null,As=oa[--la],oa[la]=null,_s=oa[--la],oa[la]=null}var qr=null,Wr=null,mn=!1,Oa=null;function b_(l,u){var m=fa(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 w_(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,qr=l,Wr=ui(u.firstChild),!0):!1;case 6:return u=l.pendingProps===""||u.nodeType!==3?null:u,u!==null?(l.stateNode=u,qr=l,Wr=null,!0):!1;case 13:return u=u.nodeType!==8?null:u,u!==null?(m=Qi!==null?{id:_s,overflow:As}:null,l.memoizedState={dehydrated:u,treeContext:m,retryLane:1073741824},m=fa(18,null,null,0),m.stateNode=u,m.return=l,l.child=m,qr=l,Wr=null,!0):!1;default:return!1}}function Fg(l){return(l.mode&1)!==0&&(l.flags&128)===0}function Bg(l){if(mn){var u=Wr;if(u){var m=u;if(!w_(l,u)){if(Fg(l))throw Error(n(418));u=ui(m.nextSibling);var w=qr;u&&w_(l,u)?b_(w,m):(l.flags=l.flags&-4097|2,mn=!1,qr=l)}}else{if(Fg(l))throw Error(n(418));l.flags=l.flags&-4097|2,mn=!1,qr=l}}}function j_(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;qr=l}function Hf(l){if(l!==qr)return!1;if(!mn)return j_(l),mn=!0,!1;var u;if((u=l.tag!==3)&&!(u=l.tag!==5)&&(u=l.type,u=u!=="head"&&u!=="body"&&!Rg(l.type,l.memoizedProps)),u&&(u=Wr)){if(Fg(l))throw S_(),Error(n(418));for(;u;)b_(l,u),u=ui(u.nextSibling)}if(j_(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){Wr=ui(l.nextSibling);break e}u--}else m!=="$"&&m!=="$!"&&m!=="$?"||u++}l=l.nextSibling}Wr=null}}else Wr=qr?ui(l.stateNode.nextSibling):null;return!0}function S_(){for(var l=Wr;l;)l=ui(l.nextSibling)}function ol(){Wr=qr=null,mn=!1}function zg(l){Oa===null?Oa=[l]:Oa.push(l)}var I6=P.ReactCurrentBatchConfig;function pu(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 C=w,E=""+l;return u!==null&&u.ref!==null&&typeof u.ref=="function"&&u.ref._stringRef===E?u.ref:(u=function(I){var Y=C.refs;I===null?delete Y[E]:Y[E]=I},u._stringRef=E,u)}if(typeof l!="string")throw Error(n(284));if(!m._owner)throw Error(n(290,l))}return l}function Kf(l,u){throw l=Object.prototype.toString.call(u),Error(n(31,l==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":l))}function N_(l){var u=l._init;return u(l._payload)}function C_(l){function u(ue,re){if(l){var fe=ue.deletions;fe===null?(ue.deletions=[re],ue.flags|=16):fe.push(re)}}function m(ue,re){if(!l)return null;for(;re!==null;)u(ue,re),re=re.sibling;return null}function w(ue,re){for(ue=new Map;re!==null;)re.key!==null?ue.set(re.key,re):ue.set(re.index,re),re=re.sibling;return ue}function C(ue,re){return ue=wi(ue,re),ue.index=0,ue.sibling=null,ue}function E(ue,re,fe){return ue.index=fe,l?(fe=ue.alternate,fe!==null?(fe=fe.index,fe<re?(ue.flags|=2,re):fe):(ue.flags|=2,re)):(ue.flags|=1048576,re)}function I(ue){return l&&ue.alternate===null&&(ue.flags|=2),ue}function Y(ue,re,fe,Te){return re===null||re.tag!==6?(re=ky(fe,ue.mode,Te),re.return=ue,re):(re=C(re,fe),re.return=ue,re)}function ne(ue,re,fe,Te){var at=fe.type;return at===R?Ce(ue,re,fe.props.children,Te,fe.key):re!==null&&(re.elementType===at||typeof at=="object"&&at!==null&&at.$$typeof===Q&&N_(at)===re.type)?(Te=C(re,fe.props),Te.ref=pu(ue,re,fe),Te.return=ue,Te):(Te=gp(fe.type,fe.key,fe.props,null,ue.mode,Te),Te.ref=pu(ue,re,fe),Te.return=ue,Te)}function me(ue,re,fe,Te){return re===null||re.tag!==4||re.stateNode.containerInfo!==fe.containerInfo||re.stateNode.implementation!==fe.implementation?(re=Ty(fe,ue.mode,Te),re.return=ue,re):(re=C(re,fe.children||[]),re.return=ue,re)}function Ce(ue,re,fe,Te,at){return re===null||re.tag!==7?(re=io(fe,ue.mode,Te,at),re.return=ue,re):(re=C(re,fe),re.return=ue,re)}function Oe(ue,re,fe){if(typeof re=="string"&&re!==""||typeof re=="number")return re=ky(""+re,ue.mode,fe),re.return=ue,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case A:return fe=gp(re.type,re.key,re.props,null,ue.mode,fe),fe.ref=pu(ue,null,re),fe.return=ue,fe;case O:return re=Ty(re,ue.mode,fe),re.return=ue,re;case Q:var Te=re._init;return Oe(ue,Te(re._payload),fe)}if(Z(re)||D(re))return re=io(re,ue.mode,fe,null),re.return=ue,re;Kf(ue,re)}return null}function we(ue,re,fe,Te){var at=re!==null?re.key:null;if(typeof fe=="string"&&fe!==""||typeof fe=="number")return at!==null?null:Y(ue,re,""+fe,Te);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case A:return fe.key===at?ne(ue,re,fe,Te):null;case O:return fe.key===at?me(ue,re,fe,Te):null;case Q:return at=fe._init,we(ue,re,at(fe._payload),Te)}if(Z(fe)||D(fe))return at!==null?null:Ce(ue,re,fe,Te,null);Kf(ue,fe)}return null}function He(ue,re,fe,Te,at){if(typeof Te=="string"&&Te!==""||typeof Te=="number")return ue=ue.get(fe)||null,Y(re,ue,""+Te,at);if(typeof Te=="object"&&Te!==null){switch(Te.$$typeof){case A:return ue=ue.get(Te.key===null?fe:Te.key)||null,ne(re,ue,Te,at);case O:return ue=ue.get(Te.key===null?fe:Te.key)||null,me(re,ue,Te,at);case Q:var dt=Te._init;return He(ue,re,fe,dt(Te._payload),at)}if(Z(Te)||D(Te))return ue=ue.get(fe)||null,Ce(re,ue,Te,at,null);Kf(re,Te)}return null}function Ze(ue,re,fe,Te){for(var at=null,dt=null,ft=re,gt=re=0,Zn=null;ft!==null&&gt<fe.length;gt++){ft.index>gt?(Zn=ft,ft=null):Zn=ft.sibling;var Tt=we(ue,ft,fe[gt],Te);if(Tt===null){ft===null&&(ft=Zn);break}l&&ft&&Tt.alternate===null&&u(ue,ft),re=E(Tt,re,gt),dt===null?at=Tt:dt.sibling=Tt,dt=Tt,ft=Zn}if(gt===fe.length)return m(ue,ft),mn&&Ji(ue,gt),at;if(ft===null){for(;gt<fe.length;gt++)ft=Oe(ue,fe[gt],Te),ft!==null&&(re=E(ft,re,gt),dt===null?at=ft:dt.sibling=ft,dt=ft);return mn&&Ji(ue,gt),at}for(ft=w(ue,ft);gt<fe.length;gt++)Zn=He(ft,ue,gt,fe[gt],Te),Zn!==null&&(l&&Zn.alternate!==null&&ft.delete(Zn.key===null?gt:Zn.key),re=E(Zn,re,gt),dt===null?at=Zn:dt.sibling=Zn,dt=Zn);return l&&ft.forEach(function(ji){return u(ue,ji)}),mn&&Ji(ue,gt),at}function et(ue,re,fe,Te){var at=D(fe);if(typeof at!="function")throw Error(n(150));if(fe=at.call(fe),fe==null)throw Error(n(151));for(var dt=at=null,ft=re,gt=re=0,Zn=null,Tt=fe.next();ft!==null&&!Tt.done;gt++,Tt=fe.next()){ft.index>gt?(Zn=ft,ft=null):Zn=ft.sibling;var ji=we(ue,ft,Tt.value,Te);if(ji===null){ft===null&&(ft=Zn);break}l&&ft&&ji.alternate===null&&u(ue,ft),re=E(ji,re,gt),dt===null?at=ji:dt.sibling=ji,dt=ji,ft=Zn}if(Tt.done)return m(ue,ft),mn&&Ji(ue,gt),at;if(ft===null){for(;!Tt.done;gt++,Tt=fe.next())Tt=Oe(ue,Tt.value,Te),Tt!==null&&(re=E(Tt,re,gt),dt===null?at=Tt:dt.sibling=Tt,dt=Tt);return mn&&Ji(ue,gt),at}for(ft=w(ue,ft);!Tt.done;gt++,Tt=fe.next())Tt=He(ft,ue,gt,Tt.value,Te),Tt!==null&&(l&&Tt.alternate!==null&&ft.delete(Tt.key===null?gt:Tt.key),re=E(Tt,re,gt),dt===null?at=Tt:dt.sibling=Tt,dt=Tt);return l&&ft.forEach(function(p7){return u(ue,p7)}),mn&&Ji(ue,gt),at}function En(ue,re,fe,Te){if(typeof fe=="object"&&fe!==null&&fe.type===R&&fe.key===null&&(fe=fe.props.children),typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case A:e:{for(var at=fe.key,dt=re;dt!==null;){if(dt.key===at){if(at=fe.type,at===R){if(dt.tag===7){m(ue,dt.sibling),re=C(dt,fe.props.children),re.return=ue,ue=re;break e}}else if(dt.elementType===at||typeof at=="object"&&at!==null&&at.$$typeof===Q&&N_(at)===dt.type){m(ue,dt.sibling),re=C(dt,fe.props),re.ref=pu(ue,dt,fe),re.return=ue,ue=re;break e}m(ue,dt);break}else u(ue,dt);dt=dt.sibling}fe.type===R?(re=io(fe.props.children,ue.mode,Te,fe.key),re.return=ue,ue=re):(Te=gp(fe.type,fe.key,fe.props,null,ue.mode,Te),Te.ref=pu(ue,re,fe),Te.return=ue,ue=Te)}return I(ue);case O:e:{for(dt=fe.key;re!==null;){if(re.key===dt)if(re.tag===4&&re.stateNode.containerInfo===fe.containerInfo&&re.stateNode.implementation===fe.implementation){m(ue,re.sibling),re=C(re,fe.children||[]),re.return=ue,ue=re;break e}else{m(ue,re);break}else u(ue,re);re=re.sibling}re=Ty(fe,ue.mode,Te),re.return=ue,ue=re}return I(ue);case Q:return dt=fe._init,En(ue,re,dt(fe._payload),Te)}if(Z(fe))return Ze(ue,re,fe,Te);if(D(fe))return et(ue,re,fe,Te);Kf(ue,fe)}return typeof fe=="string"&&fe!==""||typeof fe=="number"?(fe=""+fe,re!==null&&re.tag===6?(m(ue,re.sibling),re=C(re,fe),re.return=ue,ue=re):(m(ue,re),re=ky(fe,ue.mode,Te),re.return=ue,ue=re),I(ue)):m(ue,re)}return En}var ll=C_(!0),__=C_(!1),Gf=di(null),Yf=null,cl=null,Ug=null;function qg(){Ug=cl=Yf=null}function Wg(l){var u=Gf.current;dn(Gf),l._currentValue=u}function Vg(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 ul(l,u){Yf=l,Ug=cl=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&u)!==0&&(Or=!0),l.firstContext=null)}function ca(l){var u=l._currentValue;if(Ug!==l)if(l={context:l,memoizedValue:u,next:null},cl===null){if(Yf===null)throw Error(n(308));cl=l,Yf.dependencies={lanes:0,firstContext:l}}else cl=cl.next=l;return u}var Zi=null;function Hg(l){Zi===null?Zi=[l]:Zi.push(l)}function A_(l,u,m,w){var C=u.interleaved;return C===null?(m.next=m,Hg(u)):(m.next=C.next,C.next=m),u.interleaved=m,Es(l,w)}function Es(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 hi=!1;function Kg(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function E_(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 Ps(l,u){return{eventTime:l,lane:u,tag:0,payload:null,callback:null,next:null}}function mi(l,u,m){var w=l.updateQueue;if(w===null)return null;if(w=w.shared,(Ot&2)!==0){var C=w.pending;return C===null?u.next=u:(u.next=C.next,C.next=u),w.pending=u,Es(l,m)}return C=w.interleaved,C===null?(u.next=u,Hg(w)):(u.next=C.next,C.next=u),w.interleaved=u,Es(l,m)}function Xf(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,og(l,m)}}function P_(l,u){var m=l.updateQueue,w=l.alternate;if(w!==null&&(w=w.updateQueue,m===w)){var C=null,E=null;if(m=m.firstBaseUpdate,m!==null){do{var I={eventTime:m.eventTime,lane:m.lane,tag:m.tag,payload:m.payload,callback:m.callback,next:null};E===null?C=E=I:E=E.next=I,m=m.next}while(m!==null);E===null?C=E=u:E=E.next=u}else C=E=u;m={baseState:w.baseState,firstBaseUpdate:C,lastBaseUpdate:E,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 Qf(l,u,m,w){var C=l.updateQueue;hi=!1;var E=C.firstBaseUpdate,I=C.lastBaseUpdate,Y=C.shared.pending;if(Y!==null){C.shared.pending=null;var ne=Y,me=ne.next;ne.next=null,I===null?E=me:I.next=me,I=ne;var Ce=l.alternate;Ce!==null&&(Ce=Ce.updateQueue,Y=Ce.lastBaseUpdate,Y!==I&&(Y===null?Ce.firstBaseUpdate=me:Y.next=me,Ce.lastBaseUpdate=ne))}if(E!==null){var Oe=C.baseState;I=0,Ce=me=ne=null,Y=E;do{var we=Y.lane,He=Y.eventTime;if((w&we)===we){Ce!==null&&(Ce=Ce.next={eventTime:He,lane:0,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null});e:{var Ze=l,et=Y;switch(we=u,He=m,et.tag){case 1:if(Ze=et.payload,typeof Ze=="function"){Oe=Ze.call(He,Oe,we);break e}Oe=Ze;break e;case 3:Ze.flags=Ze.flags&-65537|128;case 0:if(Ze=et.payload,we=typeof Ze=="function"?Ze.call(He,Oe,we):Ze,we==null)break e;Oe=X({},Oe,we);break e;case 2:hi=!0}}Y.callback!==null&&Y.lane!==0&&(l.flags|=64,we=C.effects,we===null?C.effects=[Y]:we.push(Y))}else He={eventTime:He,lane:we,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null},Ce===null?(me=Ce=He,ne=Oe):Ce=Ce.next=He,I|=we;if(Y=Y.next,Y===null){if(Y=C.shared.pending,Y===null)break;we=Y,Y=we.next,we.next=null,C.lastBaseUpdate=we,C.shared.pending=null}}while(!0);if(Ce===null&&(ne=Oe),C.baseState=ne,C.firstBaseUpdate=me,C.lastBaseUpdate=Ce,u=C.shared.interleaved,u!==null){C=u;do I|=C.lane,C=C.next;while(C!==u)}else E===null&&(C.shared.lanes=0);no|=I,l.lanes=I,l.memoizedState=Oe}}function O_(l,u,m){if(l=u.effects,u.effects=null,l!==null)for(u=0;u<l.length;u++){var w=l[u],C=w.callback;if(C!==null){if(w.callback=null,w=m,typeof C!="function")throw Error(n(191,C));C.call(w)}}}var hu={},rs=di(hu),mu=di(hu),vu=di(hu);function eo(l){if(l===hu)throw Error(n(174));return l}function Gg(l,u){switch(nn(vu,u),nn(mu,l),nn(rs,hu),l=u.nodeType,l){case 9:case 11:u=(u=u.documentElement)?u.namespaceURI:Ue(null,"");break;default:l=l===8?u.parentNode:u,u=l.namespaceURI||null,l=l.tagName,u=Ue(u,l)}dn(rs),nn(rs,u)}function dl(){dn(rs),dn(mu),dn(vu)}function R_(l){eo(vu.current);var u=eo(rs.current),m=Ue(u,l.type);u!==m&&(nn(mu,l),nn(rs,m))}function Yg(l){mu.current===l&&(dn(rs),dn(mu))}var bn=di(0);function Jf(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 Xg=[];function Qg(){for(var l=0;l<Xg.length;l++)Xg[l]._workInProgressVersionPrimary=null;Xg.length=0}var Zf=P.ReactCurrentDispatcher,Jg=P.ReactCurrentBatchConfig,to=0,wn=null,Bn=null,Qn=null,ep=!1,gu=!1,yu=0,M6=0;function pr(){throw Error(n(321))}function Zg(l,u){if(u===null)return!1;for(var m=0;m<u.length&&m<l.length;m++)if(!Pa(l[m],u[m]))return!1;return!0}function ey(l,u,m,w,C,E){if(to=E,wn=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,Zf.current=l===null||l.memoizedState===null?F6:B6,l=m(w,C),gu){E=0;do{if(gu=!1,yu=0,25<=E)throw Error(n(301));E+=1,Qn=Bn=null,u.updateQueue=null,Zf.current=z6,l=m(w,C)}while(gu)}if(Zf.current=rp,u=Bn!==null&&Bn.next!==null,to=0,Qn=Bn=wn=null,ep=!1,u)throw Error(n(300));return l}function ty(){var l=yu!==0;return yu=0,l}function as(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qn===null?wn.memoizedState=Qn=l:Qn=Qn.next=l,Qn}function ua(){if(Bn===null){var l=wn.alternate;l=l!==null?l.memoizedState:null}else l=Bn.next;var u=Qn===null?wn.memoizedState:Qn.next;if(u!==null)Qn=u,Bn=l;else{if(l===null)throw Error(n(310));Bn=l,l={memoizedState:Bn.memoizedState,baseState:Bn.baseState,baseQueue:Bn.baseQueue,queue:Bn.queue,next:null},Qn===null?wn.memoizedState=Qn=l:Qn=Qn.next=l}return Qn}function xu(l,u){return typeof u=="function"?u(l):u}function ny(l){var u=ua(),m=u.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=l;var w=Bn,C=w.baseQueue,E=m.pending;if(E!==null){if(C!==null){var I=C.next;C.next=E.next,E.next=I}w.baseQueue=C=E,m.pending=null}if(C!==null){E=C.next,w=w.baseState;var Y=I=null,ne=null,me=E;do{var Ce=me.lane;if((to&Ce)===Ce)ne!==null&&(ne=ne.next={lane:0,action:me.action,hasEagerState:me.hasEagerState,eagerState:me.eagerState,next:null}),w=me.hasEagerState?me.eagerState:l(w,me.action);else{var Oe={lane:Ce,action:me.action,hasEagerState:me.hasEagerState,eagerState:me.eagerState,next:null};ne===null?(Y=ne=Oe,I=w):ne=ne.next=Oe,wn.lanes|=Ce,no|=Ce}me=me.next}while(me!==null&&me!==E);ne===null?I=w:ne.next=Y,Pa(w,u.memoizedState)||(Or=!0),u.memoizedState=w,u.baseState=I,u.baseQueue=ne,m.lastRenderedState=w}if(l=m.interleaved,l!==null){C=l;do E=C.lane,wn.lanes|=E,no|=E,C=C.next;while(C!==l)}else C===null&&(m.lanes=0);return[u.memoizedState,m.dispatch]}function ry(l){var u=ua(),m=u.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=l;var w=m.dispatch,C=m.pending,E=u.memoizedState;if(C!==null){m.pending=null;var I=C=C.next;do E=l(E,I.action),I=I.next;while(I!==C);Pa(E,u.memoizedState)||(Or=!0),u.memoizedState=E,u.baseQueue===null&&(u.baseState=E),m.lastRenderedState=E}return[E,w]}function k_(){}function T_(l,u){var m=wn,w=ua(),C=u(),E=!Pa(w.memoizedState,C);if(E&&(w.memoizedState=C,Or=!0),w=w.queue,ay($_.bind(null,m,w,l),[l]),w.getSnapshot!==u||E||Qn!==null&&Qn.memoizedState.tag&1){if(m.flags|=2048,bu(9,M_.bind(null,m,w,C,u),void 0,null),Jn===null)throw Error(n(349));(to&30)!==0||I_(m,u,C)}return C}function I_(l,u,m){l.flags|=16384,l={getSnapshot:u,value:m},u=wn.updateQueue,u===null?(u={lastEffect:null,stores:null},wn.updateQueue=u,u.stores=[l]):(m=u.stores,m===null?u.stores=[l]:m.push(l))}function M_(l,u,m,w){u.value=m,u.getSnapshot=w,D_(u)&&L_(l)}function $_(l,u,m){return m(function(){D_(u)&&L_(l)})}function D_(l){var u=l.getSnapshot;l=l.value;try{var m=u();return!Pa(l,m)}catch{return!0}}function L_(l){var u=Es(l,1);u!==null&&Ia(u,l,1,-1)}function F_(l){var u=as();return typeof l=="function"&&(l=l()),u.memoizedState=u.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:xu,lastRenderedState:l},u.queue=l,l=l.dispatch=L6.bind(null,wn,l),[u.memoizedState,l]}function bu(l,u,m,w){return l={tag:l,create:u,destroy:m,deps:w,next:null},u=wn.updateQueue,u===null?(u={lastEffect:null,stores:null},wn.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 B_(){return ua().memoizedState}function tp(l,u,m,w){var C=as();wn.flags|=l,C.memoizedState=bu(1|u,m,void 0,w===void 0?null:w)}function np(l,u,m,w){var C=ua();w=w===void 0?null:w;var E=void 0;if(Bn!==null){var I=Bn.memoizedState;if(E=I.destroy,w!==null&&Zg(w,I.deps)){C.memoizedState=bu(u,m,E,w);return}}wn.flags|=l,C.memoizedState=bu(1|u,m,E,w)}function z_(l,u){return tp(8390656,8,l,u)}function ay(l,u){return np(2048,8,l,u)}function U_(l,u){return np(4,2,l,u)}function q_(l,u){return np(4,4,l,u)}function W_(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 V_(l,u,m){return m=m!=null?m.concat([l]):null,np(4,4,W_.bind(null,u,l),m)}function sy(){}function H_(l,u){var m=ua();u=u===void 0?null:u;var w=m.memoizedState;return w!==null&&u!==null&&Zg(u,w[1])?w[0]:(m.memoizedState=[l,u],l)}function K_(l,u){var m=ua();u=u===void 0?null:u;var w=m.memoizedState;return w!==null&&u!==null&&Zg(u,w[1])?w[0]:(l=l(),m.memoizedState=[l,u],l)}function G_(l,u,m){return(to&21)===0?(l.baseState&&(l.baseState=!1,Or=!0),l.memoizedState=m):(Pa(m,u)||(m=NC(),wn.lanes|=m,no|=m,l.baseState=!0),u)}function $6(l,u){var m=qt;qt=m!==0&&4>m?m:4,l(!0);var w=Jg.transition;Jg.transition={};try{l(!1),u()}finally{qt=m,Jg.transition=w}}function Y_(){return ua().memoizedState}function D6(l,u,m){var w=xi(l);if(m={lane:w,action:m,hasEagerState:!1,eagerState:null,next:null},X_(l))Q_(u,m);else if(m=A_(l,u,m,w),m!==null){var C=xr();Ia(m,l,w,C),J_(m,u,w)}}function L6(l,u,m){var w=xi(l),C={lane:w,action:m,hasEagerState:!1,eagerState:null,next:null};if(X_(l))Q_(u,C);else{var E=l.alternate;if(l.lanes===0&&(E===null||E.lanes===0)&&(E=u.lastRenderedReducer,E!==null))try{var I=u.lastRenderedState,Y=E(I,m);if(C.hasEagerState=!0,C.eagerState=Y,Pa(Y,I)){var ne=u.interleaved;ne===null?(C.next=C,Hg(u)):(C.next=ne.next,ne.next=C),u.interleaved=C;return}}catch{}m=A_(l,u,C,w),m!==null&&(C=xr(),Ia(m,l,w,C),J_(m,u,w))}}function X_(l){var u=l.alternate;return l===wn||u!==null&&u===wn}function Q_(l,u){gu=ep=!0;var m=l.pending;m===null?u.next=u:(u.next=m.next,m.next=u),l.pending=u}function J_(l,u,m){if((m&4194240)!==0){var w=u.lanes;w&=l.pendingLanes,m|=w,u.lanes=m,og(l,m)}}var rp={readContext:ca,useCallback:pr,useContext:pr,useEffect:pr,useImperativeHandle:pr,useInsertionEffect:pr,useLayoutEffect:pr,useMemo:pr,useReducer:pr,useRef:pr,useState:pr,useDebugValue:pr,useDeferredValue:pr,useTransition:pr,useMutableSource:pr,useSyncExternalStore:pr,useId:pr,unstable_isNewReconciler:!1},F6={readContext:ca,useCallback:function(l,u){return as().memoizedState=[l,u===void 0?null:u],l},useContext:ca,useEffect:z_,useImperativeHandle:function(l,u,m){return m=m!=null?m.concat([l]):null,tp(4194308,4,W_.bind(null,u,l),m)},useLayoutEffect:function(l,u){return tp(4194308,4,l,u)},useInsertionEffect:function(l,u){return tp(4,2,l,u)},useMemo:function(l,u){var m=as();return u=u===void 0?null:u,l=l(),m.memoizedState=[l,u],l},useReducer:function(l,u,m){var w=as();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=D6.bind(null,wn,l),[w.memoizedState,l]},useRef:function(l){var u=as();return l={current:l},u.memoizedState=l},useState:F_,useDebugValue:sy,useDeferredValue:function(l){return as().memoizedState=l},useTransition:function(){var l=F_(!1),u=l[0];return l=$6.bind(null,l[1]),as().memoizedState=l,[u,l]},useMutableSource:function(){},useSyncExternalStore:function(l,u,m){var w=wn,C=as();if(mn){if(m===void 0)throw Error(n(407));m=m()}else{if(m=u(),Jn===null)throw Error(n(349));(to&30)!==0||I_(w,u,m)}C.memoizedState=m;var E={value:m,getSnapshot:u};return C.queue=E,z_($_.bind(null,w,E,l),[l]),w.flags|=2048,bu(9,M_.bind(null,w,E,m,u),void 0,null),m},useId:function(){var l=as(),u=Jn.identifierPrefix;if(mn){var m=As,w=_s;m=(w&~(1<<32-Pe(w)-1)).toString(32)+m,u=":"+u+"R"+m,m=yu++,0<m&&(u+="H"+m.toString(32)),u+=":"}else m=M6++,u=":"+u+"r"+m.toString(32)+":";return l.memoizedState=u},unstable_isNewReconciler:!1},B6={readContext:ca,useCallback:H_,useContext:ca,useEffect:ay,useImperativeHandle:V_,useInsertionEffect:U_,useLayoutEffect:q_,useMemo:K_,useReducer:ny,useRef:B_,useState:function(){return ny(xu)},useDebugValue:sy,useDeferredValue:function(l){var u=ua();return G_(u,Bn.memoizedState,l)},useTransition:function(){var l=ny(xu)[0],u=ua().memoizedState;return[l,u]},useMutableSource:k_,useSyncExternalStore:T_,useId:Y_,unstable_isNewReconciler:!1},z6={readContext:ca,useCallback:H_,useContext:ca,useEffect:ay,useImperativeHandle:V_,useInsertionEffect:U_,useLayoutEffect:q_,useMemo:K_,useReducer:ry,useRef:B_,useState:function(){return ry(xu)},useDebugValue:sy,useDeferredValue:function(l){var u=ua();return Bn===null?u.memoizedState=l:G_(u,Bn.memoizedState,l)},useTransition:function(){var l=ry(xu)[0],u=ua().memoizedState;return[l,u]},useMutableSource:k_,useSyncExternalStore:T_,useId:Y_,unstable_isNewReconciler:!1};function Ra(l,u){if(l&&l.defaultProps){u=X({},u),l=l.defaultProps;for(var m in l)u[m]===void 0&&(u[m]=l[m]);return u}return u}function iy(l,u,m,w){u=l.memoizedState,m=m(w,u),m=m==null?u:X({},u,m),l.memoizedState=m,l.lanes===0&&(l.updateQueue.baseState=m)}var ap={isMounted:function(l){return(l=l._reactInternals)?Be(l)===l:!1},enqueueSetState:function(l,u,m){l=l._reactInternals;var w=xr(),C=xi(l),E=Ps(w,C);E.payload=u,m!=null&&(E.callback=m),u=mi(l,E,C),u!==null&&(Ia(u,l,C,w),Xf(u,l,C))},enqueueReplaceState:function(l,u,m){l=l._reactInternals;var w=xr(),C=xi(l),E=Ps(w,C);E.tag=1,E.payload=u,m!=null&&(E.callback=m),u=mi(l,E,C),u!==null&&(Ia(u,l,C,w),Xf(u,l,C))},enqueueForceUpdate:function(l,u){l=l._reactInternals;var m=xr(),w=xi(l),C=Ps(m,w);C.tag=2,u!=null&&(C.callback=u),u=mi(l,C,w),u!==null&&(Ia(u,l,w,m),Xf(u,l,w))}};function Z_(l,u,m,w,C,E,I){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(w,E,I):u.prototype&&u.prototype.isPureReactComponent?!iu(m,w)||!iu(C,E):!0}function eA(l,u,m){var w=!1,C=fi,E=u.contextType;return typeof E=="object"&&E!==null?E=ca(E):(C=Pr(u)?Xi:fr.current,w=u.contextTypes,E=(w=w!=null)?al(l,C):fi),u=new u(m,E),l.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=ap,l.stateNode=u,u._reactInternals=l,w&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=C,l.__reactInternalMemoizedMaskedChildContext=E),u}function tA(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&&ap.enqueueReplaceState(u,u.state,null)}function oy(l,u,m,w){var C=l.stateNode;C.props=m,C.state=l.memoizedState,C.refs={},Kg(l);var E=u.contextType;typeof E=="object"&&E!==null?C.context=ca(E):(E=Pr(u)?Xi:fr.current,C.context=al(l,E)),C.state=l.memoizedState,E=u.getDerivedStateFromProps,typeof E=="function"&&(iy(l,u,E,m),C.state=l.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(u=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),u!==C.state&&ap.enqueueReplaceState(C,C.state,null),Qf(l,m,C,w),C.state=l.memoizedState),typeof C.componentDidMount=="function"&&(l.flags|=4194308)}function fl(l,u){try{var m="",w=u;do m+=K(w),w=w.return;while(w);var C=m}catch(E){C=`
7
+ Error generating stack: `+E.message+`
8
+ `+E.stack}return{value:l,source:u,stack:C,digest:null}}function ly(l,u,m){return{value:l,source:null,stack:m??null,digest:u??null}}function cy(l,u){try{console.error(u.value)}catch(m){setTimeout(function(){throw m})}}var U6=typeof WeakMap=="function"?WeakMap:Map;function nA(l,u,m){m=Ps(-1,m),m.tag=3,m.payload={element:null};var w=u.value;return m.callback=function(){dp||(dp=!0,Ny=w),cy(l,u)},m}function rA(l,u,m){m=Ps(-1,m),m.tag=3;var w=l.type.getDerivedStateFromError;if(typeof w=="function"){var C=u.value;m.payload=function(){return w(C)},m.callback=function(){cy(l,u)}}var E=l.stateNode;return E!==null&&typeof E.componentDidCatch=="function"&&(m.callback=function(){cy(l,u),typeof w!="function"&&(gi===null?gi=new Set([this]):gi.add(this));var I=u.stack;this.componentDidCatch(u.value,{componentStack:I!==null?I:""})}),m}function aA(l,u,m){var w=l.pingCache;if(w===null){w=l.pingCache=new U6;var C=new Set;w.set(u,C)}else C=w.get(u),C===void 0&&(C=new Set,w.set(u,C));C.has(m)||(C.add(m),l=n7.bind(null,l,u,m),u.then(l,l))}function sA(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 iA(l,u,m,w,C){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=Ps(-1,1),u.tag=2,mi(m,u,1))),m.lanes|=1),l):(l.flags|=65536,l.lanes=C,l)}var q6=P.ReactCurrentOwner,Or=!1;function yr(l,u,m,w){u.child=l===null?__(u,null,m,w):ll(u,l.child,m,w)}function oA(l,u,m,w,C){m=m.render;var E=u.ref;return ul(u,C),w=ey(l,u,m,w,E,C),m=ty(),l!==null&&!Or?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~C,Os(l,u,C)):(mn&&m&&Dg(u),u.flags|=1,yr(l,u,w,C),u.child)}function lA(l,u,m,w,C){if(l===null){var E=m.type;return typeof E=="function"&&!Ry(E)&&E.defaultProps===void 0&&m.compare===null&&m.defaultProps===void 0?(u.tag=15,u.type=E,cA(l,u,E,w,C)):(l=gp(m.type,null,w,u,u.mode,C),l.ref=u.ref,l.return=u,u.child=l)}if(E=l.child,(l.lanes&C)===0){var I=E.memoizedProps;if(m=m.compare,m=m!==null?m:iu,m(I,w)&&l.ref===u.ref)return Os(l,u,C)}return u.flags|=1,l=wi(E,w),l.ref=u.ref,l.return=u,u.child=l}function cA(l,u,m,w,C){if(l!==null){var E=l.memoizedProps;if(iu(E,w)&&l.ref===u.ref)if(Or=!1,u.pendingProps=w=E,(l.lanes&C)!==0)(l.flags&131072)!==0&&(Or=!0);else return u.lanes=l.lanes,Os(l,u,C)}return uy(l,u,m,w,C)}function uA(l,u,m){var w=u.pendingProps,C=w.children,E=l!==null?l.memoizedState:null;if(w.mode==="hidden")if((u.mode&1)===0)u.memoizedState={baseLanes:0,cachePool:null,transitions:null},nn(hl,Vr),Vr|=m;else{if((m&1073741824)===0)return l=E!==null?E.baseLanes|m:m,u.lanes=u.childLanes=1073741824,u.memoizedState={baseLanes:l,cachePool:null,transitions:null},u.updateQueue=null,nn(hl,Vr),Vr|=l,null;u.memoizedState={baseLanes:0,cachePool:null,transitions:null},w=E!==null?E.baseLanes:m,nn(hl,Vr),Vr|=w}else E!==null?(w=E.baseLanes|m,u.memoizedState=null):w=m,nn(hl,Vr),Vr|=w;return yr(l,u,C,m),u.child}function dA(l,u){var m=u.ref;(l===null&&m!==null||l!==null&&l.ref!==m)&&(u.flags|=512,u.flags|=2097152)}function uy(l,u,m,w,C){var E=Pr(m)?Xi:fr.current;return E=al(u,E),ul(u,C),m=ey(l,u,m,w,E,C),w=ty(),l!==null&&!Or?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~C,Os(l,u,C)):(mn&&w&&Dg(u),u.flags|=1,yr(l,u,m,C),u.child)}function fA(l,u,m,w,C){if(Pr(m)){var E=!0;Uf(u)}else E=!1;if(ul(u,C),u.stateNode===null)ip(l,u),eA(u,m,w),oy(u,m,w,C),w=!0;else if(l===null){var I=u.stateNode,Y=u.memoizedProps;I.props=Y;var ne=I.context,me=m.contextType;typeof me=="object"&&me!==null?me=ca(me):(me=Pr(m)?Xi:fr.current,me=al(u,me));var Ce=m.getDerivedStateFromProps,Oe=typeof Ce=="function"||typeof I.getSnapshotBeforeUpdate=="function";Oe||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(Y!==w||ne!==me)&&tA(u,I,w,me),hi=!1;var we=u.memoizedState;I.state=we,Qf(u,w,I,C),ne=u.memoizedState,Y!==w||we!==ne||Er.current||hi?(typeof Ce=="function"&&(iy(u,m,Ce,w),ne=u.memoizedState),(Y=hi||Z_(u,m,Y,w,we,ne,me))?(Oe||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount()),typeof I.componentDidMount=="function"&&(u.flags|=4194308)):(typeof I.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=w,u.memoizedState=ne),I.props=w,I.state=ne,I.context=me,w=Y):(typeof I.componentDidMount=="function"&&(u.flags|=4194308),w=!1)}else{I=u.stateNode,E_(l,u),Y=u.memoizedProps,me=u.type===u.elementType?Y:Ra(u.type,Y),I.props=me,Oe=u.pendingProps,we=I.context,ne=m.contextType,typeof ne=="object"&&ne!==null?ne=ca(ne):(ne=Pr(m)?Xi:fr.current,ne=al(u,ne));var He=m.getDerivedStateFromProps;(Ce=typeof He=="function"||typeof I.getSnapshotBeforeUpdate=="function")||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(Y!==Oe||we!==ne)&&tA(u,I,w,ne),hi=!1,we=u.memoizedState,I.state=we,Qf(u,w,I,C);var Ze=u.memoizedState;Y!==Oe||we!==Ze||Er.current||hi?(typeof He=="function"&&(iy(u,m,He,w),Ze=u.memoizedState),(me=hi||Z_(u,m,me,w,we,Ze,ne)||!1)?(Ce||typeof I.UNSAFE_componentWillUpdate!="function"&&typeof I.componentWillUpdate!="function"||(typeof I.componentWillUpdate=="function"&&I.componentWillUpdate(w,Ze,ne),typeof I.UNSAFE_componentWillUpdate=="function"&&I.UNSAFE_componentWillUpdate(w,Ze,ne)),typeof I.componentDidUpdate=="function"&&(u.flags|=4),typeof I.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof I.componentDidUpdate!="function"||Y===l.memoizedProps&&we===l.memoizedState||(u.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||Y===l.memoizedProps&&we===l.memoizedState||(u.flags|=1024),u.memoizedProps=w,u.memoizedState=Ze),I.props=w,I.state=Ze,I.context=ne,w=me):(typeof I.componentDidUpdate!="function"||Y===l.memoizedProps&&we===l.memoizedState||(u.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||Y===l.memoizedProps&&we===l.memoizedState||(u.flags|=1024),w=!1)}return dy(l,u,m,w,E,C)}function dy(l,u,m,w,C,E){dA(l,u);var I=(u.flags&128)!==0;if(!w&&!I)return C&&g_(u,m,!1),Os(l,u,E);w=u.stateNode,q6.current=u;var Y=I&&typeof m.getDerivedStateFromError!="function"?null:w.render();return u.flags|=1,l!==null&&I?(u.child=ll(u,l.child,null,E),u.child=ll(u,null,Y,E)):yr(l,u,Y,E),u.memoizedState=w.state,C&&g_(u,m,!0),u.child}function pA(l){var u=l.stateNode;u.pendingContext?m_(l,u.pendingContext,u.pendingContext!==u.context):u.context&&m_(l,u.context,!1),Gg(l,u.containerInfo)}function hA(l,u,m,w,C){return ol(),zg(C),u.flags|=256,yr(l,u,m,w),u.child}var fy={dehydrated:null,treeContext:null,retryLane:0};function py(l){return{baseLanes:l,cachePool:null,transitions:null}}function mA(l,u,m){var w=u.pendingProps,C=bn.current,E=!1,I=(u.flags&128)!==0,Y;if((Y=I)||(Y=l!==null&&l.memoizedState===null?!1:(C&2)!==0),Y?(E=!0,u.flags&=-129):(l===null||l.memoizedState!==null)&&(C|=1),nn(bn,C&1),l===null)return Bg(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):(I=w.children,l=w.fallback,E?(w=u.mode,E=u.child,I={mode:"hidden",children:I},(w&1)===0&&E!==null?(E.childLanes=0,E.pendingProps=I):E=yp(I,w,0,null),l=io(l,w,m,null),E.return=u,l.return=u,E.sibling=l,u.child=E,u.child.memoizedState=py(m),u.memoizedState=fy,l):hy(u,I));if(C=l.memoizedState,C!==null&&(Y=C.dehydrated,Y!==null))return W6(l,u,I,w,Y,C,m);if(E){E=w.fallback,I=u.mode,C=l.child,Y=C.sibling;var ne={mode:"hidden",children:w.children};return(I&1)===0&&u.child!==C?(w=u.child,w.childLanes=0,w.pendingProps=ne,u.deletions=null):(w=wi(C,ne),w.subtreeFlags=C.subtreeFlags&14680064),Y!==null?E=wi(Y,E):(E=io(E,I,m,null),E.flags|=2),E.return=u,w.return=u,w.sibling=E,u.child=w,w=E,E=u.child,I=l.child.memoizedState,I=I===null?py(m):{baseLanes:I.baseLanes|m,cachePool:null,transitions:I.transitions},E.memoizedState=I,E.childLanes=l.childLanes&~m,u.memoizedState=fy,w}return E=l.child,l=E.sibling,w=wi(E,{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 hy(l,u){return u=yp({mode:"visible",children:u},l.mode,0,null),u.return=l,l.child=u}function sp(l,u,m,w){return w!==null&&zg(w),ll(u,l.child,null,m),l=hy(u,u.pendingProps.children),l.flags|=2,u.memoizedState=null,l}function W6(l,u,m,w,C,E,I){if(m)return u.flags&256?(u.flags&=-257,w=ly(Error(n(422))),sp(l,u,I,w)):u.memoizedState!==null?(u.child=l.child,u.flags|=128,null):(E=w.fallback,C=u.mode,w=yp({mode:"visible",children:w.children},C,0,null),E=io(E,C,I,null),E.flags|=2,w.return=u,E.return=u,w.sibling=E,u.child=w,(u.mode&1)!==0&&ll(u,l.child,null,I),u.child.memoizedState=py(I),u.memoizedState=fy,E);if((u.mode&1)===0)return sp(l,u,I,null);if(C.data==="$!"){if(w=C.nextSibling&&C.nextSibling.dataset,w)var Y=w.dgst;return w=Y,E=Error(n(419)),w=ly(E,w,void 0),sp(l,u,I,w)}if(Y=(I&l.childLanes)!==0,Or||Y){if(w=Jn,w!==null){switch(I&-I){case 4:C=2;break;case 16:C=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:C=32;break;case 536870912:C=268435456;break;default:C=0}C=(C&(w.suspendedLanes|I))!==0?0:C,C!==0&&C!==E.retryLane&&(E.retryLane=C,Es(l,C),Ia(w,l,C,-1))}return Oy(),w=ly(Error(n(421))),sp(l,u,I,w)}return C.data==="$?"?(u.flags|=128,u.child=l.child,u=r7.bind(null,l),C._reactRetry=u,null):(l=E.treeContext,Wr=ui(C.nextSibling),qr=u,mn=!0,Oa=null,l!==null&&(oa[la++]=_s,oa[la++]=As,oa[la++]=Qi,_s=l.id,As=l.overflow,Qi=u),u=hy(u,w.children),u.flags|=4096,u)}function vA(l,u,m){l.lanes|=u;var w=l.alternate;w!==null&&(w.lanes|=u),Vg(l.return,u,m)}function my(l,u,m,w,C){var E=l.memoizedState;E===null?l.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:w,tail:m,tailMode:C}:(E.isBackwards=u,E.rendering=null,E.renderingStartTime=0,E.last=w,E.tail=m,E.tailMode=C)}function gA(l,u,m){var w=u.pendingProps,C=w.revealOrder,E=w.tail;if(yr(l,u,w.children,m),w=bn.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&&vA(l,m,u);else if(l.tag===19)vA(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(nn(bn,w),(u.mode&1)===0)u.memoizedState=null;else switch(C){case"forwards":for(m=u.child,C=null;m!==null;)l=m.alternate,l!==null&&Jf(l)===null&&(C=m),m=m.sibling;m=C,m===null?(C=u.child,u.child=null):(C=m.sibling,m.sibling=null),my(u,!1,C,m,E);break;case"backwards":for(m=null,C=u.child,u.child=null;C!==null;){if(l=C.alternate,l!==null&&Jf(l)===null){u.child=C;break}l=C.sibling,C.sibling=m,m=C,C=l}my(u,!0,m,null,E);break;case"together":my(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function ip(l,u){(u.mode&1)===0&&l!==null&&(l.alternate=null,u.alternate=null,u.flags|=2)}function Os(l,u,m){if(l!==null&&(u.dependencies=l.dependencies),no|=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=wi(l,l.pendingProps),u.child=m,m.return=u;l.sibling!==null;)l=l.sibling,m=m.sibling=wi(l,l.pendingProps),m.return=u;m.sibling=null}return u.child}function V6(l,u,m){switch(u.tag){case 3:pA(u),ol();break;case 5:R_(u);break;case 1:Pr(u.type)&&Uf(u);break;case 4:Gg(u,u.stateNode.containerInfo);break;case 10:var w=u.type._context,C=u.memoizedProps.value;nn(Gf,w._currentValue),w._currentValue=C;break;case 13:if(w=u.memoizedState,w!==null)return w.dehydrated!==null?(nn(bn,bn.current&1),u.flags|=128,null):(m&u.child.childLanes)!==0?mA(l,u,m):(nn(bn,bn.current&1),l=Os(l,u,m),l!==null?l.sibling:null);nn(bn,bn.current&1);break;case 19:if(w=(m&u.childLanes)!==0,(l.flags&128)!==0){if(w)return gA(l,u,m);u.flags|=128}if(C=u.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),nn(bn,bn.current),w)break;return null;case 22:case 23:return u.lanes=0,uA(l,u,m)}return Os(l,u,m)}var yA,vy,xA,bA;yA=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}},vy=function(){},xA=function(l,u,m,w){var C=l.memoizedProps;if(C!==w){l=u.stateNode,eo(rs.current);var E=null;switch(m){case"input":C=Ae(l,C),w=Ae(l,w),E=[];break;case"select":C=X({},C,{value:void 0}),w=X({},w,{value:void 0}),E=[];break;case"textarea":C=Ie(l,C),w=Ie(l,w),E=[];break;default:typeof C.onClick!="function"&&typeof w.onClick=="function"&&(l.onclick=Ff)}Ln(m,w);var I;m=null;for(me in C)if(!w.hasOwnProperty(me)&&C.hasOwnProperty(me)&&C[me]!=null)if(me==="style"){var Y=C[me];for(I in Y)Y.hasOwnProperty(I)&&(m||(m={}),m[I]="")}else me!=="dangerouslySetInnerHTML"&&me!=="children"&&me!=="suppressContentEditableWarning"&&me!=="suppressHydrationWarning"&&me!=="autoFocus"&&(a.hasOwnProperty(me)?E||(E=[]):(E=E||[]).push(me,null));for(me in w){var ne=w[me];if(Y=C?.[me],w.hasOwnProperty(me)&&ne!==Y&&(ne!=null||Y!=null))if(me==="style")if(Y){for(I in Y)!Y.hasOwnProperty(I)||ne&&ne.hasOwnProperty(I)||(m||(m={}),m[I]="");for(I in ne)ne.hasOwnProperty(I)&&Y[I]!==ne[I]&&(m||(m={}),m[I]=ne[I])}else m||(E||(E=[]),E.push(me,m)),m=ne;else me==="dangerouslySetInnerHTML"?(ne=ne?ne.__html:void 0,Y=Y?Y.__html:void 0,ne!=null&&Y!==ne&&(E=E||[]).push(me,ne)):me==="children"?typeof ne!="string"&&typeof ne!="number"||(E=E||[]).push(me,""+ne):me!=="suppressContentEditableWarning"&&me!=="suppressHydrationWarning"&&(a.hasOwnProperty(me)?(ne!=null&&me==="onScroll"&&un("scroll",l),E||Y===ne||(E=[])):(E=E||[]).push(me,ne))}m&&(E=E||[]).push("style",m);var me=E;(u.updateQueue=me)&&(u.flags|=4)}},bA=function(l,u,m,w){m!==w&&(u.flags|=4)};function wu(l,u){if(!mn)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 hr(l){var u=l.alternate!==null&&l.alternate.child===l.child,m=0,w=0;if(u)for(var C=l.child;C!==null;)m|=C.lanes|C.childLanes,w|=C.subtreeFlags&14680064,w|=C.flags&14680064,C.return=l,C=C.sibling;else for(C=l.child;C!==null;)m|=C.lanes|C.childLanes,w|=C.subtreeFlags,w|=C.flags,C.return=l,C=C.sibling;return l.subtreeFlags|=w,l.childLanes=m,u}function H6(l,u,m){var w=u.pendingProps;switch(Lg(u),u.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return hr(u),null;case 1:return Pr(u.type)&&zf(),hr(u),null;case 3:return w=u.stateNode,dl(),dn(Er),dn(fr),Qg(),w.pendingContext&&(w.context=w.pendingContext,w.pendingContext=null),(l===null||l.child===null)&&(Hf(u)?u.flags|=4:l===null||l.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,Oa!==null&&(Ay(Oa),Oa=null))),vy(l,u),hr(u),null;case 5:Yg(u);var C=eo(vu.current);if(m=u.type,l!==null&&u.stateNode!=null)xA(l,u,m,w,C),l.ref!==u.ref&&(u.flags|=512,u.flags|=2097152);else{if(!w){if(u.stateNode===null)throw Error(n(166));return hr(u),null}if(l=eo(rs.current),Hf(u)){w=u.stateNode,m=u.type;var E=u.memoizedProps;switch(w[ns]=u,w[du]=E,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(C=0;C<lu.length;C++)un(lu[C],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,E),un("invalid",w);break;case"select":w._wrapperState={wasMultiple:!!E.multiple},un("invalid",w);break;case"textarea":Re(w,E),un("invalid",w)}Ln(m,E),C=null;for(var I in E)if(E.hasOwnProperty(I)){var Y=E[I];I==="children"?typeof Y=="string"?w.textContent!==Y&&(E.suppressHydrationWarning!==!0&&Lf(w.textContent,Y,l),C=["children",Y]):typeof Y=="number"&&w.textContent!==""+Y&&(E.suppressHydrationWarning!==!0&&Lf(w.textContent,Y,l),C=["children",""+Y]):a.hasOwnProperty(I)&&Y!=null&&I==="onScroll"&&un("scroll",w)}switch(m){case"input":je(w),ze(w,E,!0);break;case"textarea":je(w),he(w);break;case"select":case"option":break;default:typeof E.onClick=="function"&&(w.onclick=Ff)}w=C,u.updateQueue=w,w!==null&&(u.flags|=4)}else{I=C.nodeType===9?C:C.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=Fe(m)),l==="http://www.w3.org/1999/xhtml"?m==="script"?(l=I.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild)):typeof w.is=="string"?l=I.createElement(m,{is:w.is}):(l=I.createElement(m),m==="select"&&(I=l,w.multiple?I.multiple=!0:w.size&&(I.size=w.size))):l=I.createElementNS(l,m),l[ns]=u,l[du]=w,yA(l,u,!1,!1),u.stateNode=l;e:{switch(I=ur(m,w),m){case"dialog":un("cancel",l),un("close",l),C=w;break;case"iframe":case"object":case"embed":un("load",l),C=w;break;case"video":case"audio":for(C=0;C<lu.length;C++)un(lu[C],l);C=w;break;case"source":un("error",l),C=w;break;case"img":case"image":case"link":un("error",l),un("load",l),C=w;break;case"details":un("toggle",l),C=w;break;case"input":Ye(l,w),C=Ae(l,w),un("invalid",l);break;case"option":C=w;break;case"select":l._wrapperState={wasMultiple:!!w.multiple},C=X({},w,{value:void 0}),un("invalid",l);break;case"textarea":Re(l,w),C=Ie(l,w),un("invalid",l);break;default:C=w}Ln(m,C),Y=C;for(E in Y)if(Y.hasOwnProperty(E)){var ne=Y[E];E==="style"?lr(l,ne):E==="dangerouslySetInnerHTML"?(ne=ne?ne.__html:void 0,ne!=null&&Ht(l,ne)):E==="children"?typeof ne=="string"?(m!=="textarea"||ne!=="")&&zt(l,ne):typeof ne=="number"&&zt(l,""+ne):E!=="suppressContentEditableWarning"&&E!=="suppressHydrationWarning"&&E!=="autoFocus"&&(a.hasOwnProperty(E)?ne!=null&&E==="onScroll"&&un("scroll",l):ne!=null&&_(l,E,ne,I))}switch(m){case"input":je(l),ze(l,w,!1);break;case"textarea":je(l),he(l);break;case"option":w.value!=null&&l.setAttribute("value",""+de(w.value));break;case"select":l.multiple=!!w.multiple,E=w.value,E!=null?Ne(l,!!w.multiple,E,!1):w.defaultValue!=null&&Ne(l,!!w.multiple,w.defaultValue,!0);break;default:typeof C.onClick=="function"&&(l.onclick=Ff)}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 hr(u),null;case 6:if(l&&u.stateNode!=null)bA(l,u,l.memoizedProps,w);else{if(typeof w!="string"&&u.stateNode===null)throw Error(n(166));if(m=eo(vu.current),eo(rs.current),Hf(u)){if(w=u.stateNode,m=u.memoizedProps,w[ns]=u,(E=w.nodeValue!==m)&&(l=qr,l!==null))switch(l.tag){case 3:Lf(w.nodeValue,m,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&Lf(w.nodeValue,m,(l.mode&1)!==0)}E&&(u.flags|=4)}else w=(m.nodeType===9?m:m.ownerDocument).createTextNode(w),w[ns]=u,u.stateNode=w}return hr(u),null;case 13:if(dn(bn),w=u.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(mn&&Wr!==null&&(u.mode&1)!==0&&(u.flags&128)===0)S_(),ol(),u.flags|=98560,E=!1;else if(E=Hf(u),w!==null&&w.dehydrated!==null){if(l===null){if(!E)throw Error(n(318));if(E=u.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(n(317));E[ns]=u}else ol(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;hr(u),E=!1}else Oa!==null&&(Ay(Oa),Oa=null),E=!0;if(!E)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||(bn.current&1)!==0?zn===0&&(zn=3):Oy())),u.updateQueue!==null&&(u.flags|=4),hr(u),null);case 4:return dl(),vy(l,u),l===null&&cu(u.stateNode.containerInfo),hr(u),null;case 10:return Wg(u.type._context),hr(u),null;case 17:return Pr(u.type)&&zf(),hr(u),null;case 19:if(dn(bn),E=u.memoizedState,E===null)return hr(u),null;if(w=(u.flags&128)!==0,I=E.rendering,I===null)if(w)wu(E,!1);else{if(zn!==0||l!==null&&(l.flags&128)!==0)for(l=u.child;l!==null;){if(I=Jf(l),I!==null){for(u.flags|=128,wu(E,!1),w=I.updateQueue,w!==null&&(u.updateQueue=w,u.flags|=4),u.subtreeFlags=0,w=m,m=u.child;m!==null;)E=m,l=w,E.flags&=14680066,I=E.alternate,I===null?(E.childLanes=0,E.lanes=l,E.child=null,E.subtreeFlags=0,E.memoizedProps=null,E.memoizedState=null,E.updateQueue=null,E.dependencies=null,E.stateNode=null):(E.childLanes=I.childLanes,E.lanes=I.lanes,E.child=I.child,E.subtreeFlags=0,E.deletions=null,E.memoizedProps=I.memoizedProps,E.memoizedState=I.memoizedState,E.updateQueue=I.updateQueue,E.type=I.type,l=I.dependencies,E.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),m=m.sibling;return nn(bn,bn.current&1|2),u.child}l=l.sibling}E.tail!==null&&xn()>ml&&(u.flags|=128,w=!0,wu(E,!1),u.lanes=4194304)}else{if(!w)if(l=Jf(I),l!==null){if(u.flags|=128,w=!0,m=l.updateQueue,m!==null&&(u.updateQueue=m,u.flags|=4),wu(E,!0),E.tail===null&&E.tailMode==="hidden"&&!I.alternate&&!mn)return hr(u),null}else 2*xn()-E.renderingStartTime>ml&&m!==1073741824&&(u.flags|=128,w=!0,wu(E,!1),u.lanes=4194304);E.isBackwards?(I.sibling=u.child,u.child=I):(m=E.last,m!==null?m.sibling=I:u.child=I,E.last=I)}return E.tail!==null?(u=E.tail,E.rendering=u,E.tail=u.sibling,E.renderingStartTime=xn(),u.sibling=null,m=bn.current,nn(bn,w?m&1|2:m&1),u):(hr(u),null);case 22:case 23:return Py(),w=u.memoizedState!==null,l!==null&&l.memoizedState!==null!==w&&(u.flags|=8192),w&&(u.mode&1)!==0?(Vr&1073741824)!==0&&(hr(u),u.subtreeFlags&6&&(u.flags|=8192)):hr(u),null;case 24:return null;case 25:return null}throw Error(n(156,u.tag))}function K6(l,u){switch(Lg(u),u.tag){case 1:return Pr(u.type)&&zf(),l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 3:return dl(),dn(Er),dn(fr),Qg(),l=u.flags,(l&65536)!==0&&(l&128)===0?(u.flags=l&-65537|128,u):null;case 5:return Yg(u),null;case 13:if(dn(bn),l=u.memoizedState,l!==null&&l.dehydrated!==null){if(u.alternate===null)throw Error(n(340));ol()}return l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 19:return dn(bn),null;case 4:return dl(),null;case 10:return Wg(u.type._context),null;case 22:case 23:return Py(),null;case 24:return null;default:return null}}var op=!1,mr=!1,G6=typeof WeakSet=="function"?WeakSet:Set,Xe=null;function pl(l,u){var m=l.ref;if(m!==null)if(typeof m=="function")try{m(null)}catch(w){Nn(l,u,w)}else m.current=null}function gy(l,u,m){try{m()}catch(w){Nn(l,u,w)}}var wA=!1;function Y6(l,u){if(Pg=Af,l=ZC(),wg(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 C=w.anchorOffset,E=w.focusNode;w=w.focusOffset;try{m.nodeType,E.nodeType}catch{m=null;break e}var I=0,Y=-1,ne=-1,me=0,Ce=0,Oe=l,we=null;t:for(;;){for(var He;Oe!==m||C!==0&&Oe.nodeType!==3||(Y=I+C),Oe!==E||w!==0&&Oe.nodeType!==3||(ne=I+w),Oe.nodeType===3&&(I+=Oe.nodeValue.length),(He=Oe.firstChild)!==null;)we=Oe,Oe=He;for(;;){if(Oe===l)break t;if(we===m&&++me===C&&(Y=I),we===E&&++Ce===w&&(ne=I),(He=Oe.nextSibling)!==null)break;Oe=we,we=Oe.parentNode}Oe=He}m=Y===-1||ne===-1?null:{start:Y,end:ne}}else m=null}m=m||{start:0,end:0}}else m=null;for(Og={focusedElem:l,selectionRange:m},Af=!1,Xe=u;Xe!==null;)if(u=Xe,l=u.child,(u.subtreeFlags&1028)!==0&&l!==null)l.return=u,Xe=l;else for(;Xe!==null;){u=Xe;try{var Ze=u.alternate;if((u.flags&1024)!==0)switch(u.tag){case 0:case 11:case 15:break;case 1:if(Ze!==null){var et=Ze.memoizedProps,En=Ze.memoizedState,ue=u.stateNode,re=ue.getSnapshotBeforeUpdate(u.elementType===u.type?et:Ra(u.type,et),En);ue.__reactInternalSnapshotBeforeUpdate=re}break;case 3:var fe=u.stateNode.containerInfo;fe.nodeType===1?fe.textContent="":fe.nodeType===9&&fe.documentElement&&fe.removeChild(fe.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Te){Nn(u,u.return,Te)}if(l=u.sibling,l!==null){l.return=u.return,Xe=l;break}Xe=u.return}return Ze=wA,wA=!1,Ze}function ju(l,u,m){var w=u.updateQueue;if(w=w!==null?w.lastEffect:null,w!==null){var C=w=w.next;do{if((C.tag&l)===l){var E=C.destroy;C.destroy=void 0,E!==void 0&&gy(u,m,E)}C=C.next}while(C!==w)}}function lp(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 yy(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 jA(l){var u=l.alternate;u!==null&&(l.alternate=null,jA(u)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(u=l.stateNode,u!==null&&(delete u[ns],delete u[du],delete u[Ig],delete u[R6],delete u[k6])),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 SA(l){return l.tag===5||l.tag===3||l.tag===4}function NA(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||SA(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 xy(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=Ff));else if(w!==4&&(l=l.child,l!==null))for(xy(l,u,m),l=l.sibling;l!==null;)xy(l,u,m),l=l.sibling}function by(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(by(l,u,m),l=l.sibling;l!==null;)by(l,u,m),l=l.sibling}var rr=null,ka=!1;function vi(l,u,m){for(m=m.child;m!==null;)CA(l,u,m),m=m.sibling}function CA(l,u,m){if(ge&&typeof ge.onCommitFiberUnmount=="function")try{ge.onCommitFiberUnmount(V,m)}catch{}switch(m.tag){case 5:mr||pl(m,u);case 6:var w=rr,C=ka;rr=null,vi(l,u,m),rr=w,ka=C,rr!==null&&(ka?(l=rr,m=m.stateNode,l.nodeType===8?l.parentNode.removeChild(m):l.removeChild(m)):rr.removeChild(m.stateNode));break;case 18:rr!==null&&(ka?(l=rr,m=m.stateNode,l.nodeType===8?Tg(l.parentNode,m):l.nodeType===1&&Tg(l,m),eu(l)):Tg(rr,m.stateNode));break;case 4:w=rr,C=ka,rr=m.stateNode.containerInfo,ka=!0,vi(l,u,m),rr=w,ka=C;break;case 0:case 11:case 14:case 15:if(!mr&&(w=m.updateQueue,w!==null&&(w=w.lastEffect,w!==null))){C=w=w.next;do{var E=C,I=E.destroy;E=E.tag,I!==void 0&&((E&2)!==0||(E&4)!==0)&&gy(m,u,I),C=C.next}while(C!==w)}vi(l,u,m);break;case 1:if(!mr&&(pl(m,u),w=m.stateNode,typeof w.componentWillUnmount=="function"))try{w.props=m.memoizedProps,w.state=m.memoizedState,w.componentWillUnmount()}catch(Y){Nn(m,u,Y)}vi(l,u,m);break;case 21:vi(l,u,m);break;case 22:m.mode&1?(mr=(w=mr)||m.memoizedState!==null,vi(l,u,m),mr=w):vi(l,u,m);break;default:vi(l,u,m)}}function _A(l){var u=l.updateQueue;if(u!==null){l.updateQueue=null;var m=l.stateNode;m===null&&(m=l.stateNode=new G6),u.forEach(function(w){var C=a7.bind(null,l,w);m.has(w)||(m.add(w),w.then(C,C))})}}function Ta(l,u){var m=u.deletions;if(m!==null)for(var w=0;w<m.length;w++){var C=m[w];try{var E=l,I=u,Y=I;e:for(;Y!==null;){switch(Y.tag){case 5:rr=Y.stateNode,ka=!1;break e;case 3:rr=Y.stateNode.containerInfo,ka=!0;break e;case 4:rr=Y.stateNode.containerInfo,ka=!0;break e}Y=Y.return}if(rr===null)throw Error(n(160));CA(E,I,C),rr=null,ka=!1;var ne=C.alternate;ne!==null&&(ne.return=null),C.return=null}catch(me){Nn(C,u,me)}}if(u.subtreeFlags&12854)for(u=u.child;u!==null;)AA(u,l),u=u.sibling}function AA(l,u){var m=l.alternate,w=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(Ta(u,l),ss(l),w&4){try{ju(3,l,l.return),lp(3,l)}catch(et){Nn(l,l.return,et)}try{ju(5,l,l.return)}catch(et){Nn(l,l.return,et)}}break;case 1:Ta(u,l),ss(l),w&512&&m!==null&&pl(m,m.return);break;case 5:if(Ta(u,l),ss(l),w&512&&m!==null&&pl(m,m.return),l.flags&32){var C=l.stateNode;try{zt(C,"")}catch(et){Nn(l,l.return,et)}}if(w&4&&(C=l.stateNode,C!=null)){var E=l.memoizedProps,I=m!==null?m.memoizedProps:E,Y=l.type,ne=l.updateQueue;if(l.updateQueue=null,ne!==null)try{Y==="input"&&E.type==="radio"&&E.name!=null&&ye(C,E),ur(Y,I);var me=ur(Y,E);for(I=0;I<ne.length;I+=2){var Ce=ne[I],Oe=ne[I+1];Ce==="style"?lr(C,Oe):Ce==="dangerouslySetInnerHTML"?Ht(C,Oe):Ce==="children"?zt(C,Oe):_(C,Ce,Oe,me)}switch(Y){case"input":Se(C,E);break;case"textarea":De(C,E);break;case"select":var we=C._wrapperState.wasMultiple;C._wrapperState.wasMultiple=!!E.multiple;var He=E.value;He!=null?Ne(C,!!E.multiple,He,!1):we!==!!E.multiple&&(E.defaultValue!=null?Ne(C,!!E.multiple,E.defaultValue,!0):Ne(C,!!E.multiple,E.multiple?[]:"",!1))}C[du]=E}catch(et){Nn(l,l.return,et)}}break;case 6:if(Ta(u,l),ss(l),w&4){if(l.stateNode===null)throw Error(n(162));C=l.stateNode,E=l.memoizedProps;try{C.nodeValue=E}catch(et){Nn(l,l.return,et)}}break;case 3:if(Ta(u,l),ss(l),w&4&&m!==null&&m.memoizedState.isDehydrated)try{eu(u.containerInfo)}catch(et){Nn(l,l.return,et)}break;case 4:Ta(u,l),ss(l);break;case 13:Ta(u,l),ss(l),C=l.child,C.flags&8192&&(E=C.memoizedState!==null,C.stateNode.isHidden=E,!E||C.alternate!==null&&C.alternate.memoizedState!==null||(Sy=xn())),w&4&&_A(l);break;case 22:if(Ce=m!==null&&m.memoizedState!==null,l.mode&1?(mr=(me=mr)||Ce,Ta(u,l),mr=me):Ta(u,l),ss(l),w&8192){if(me=l.memoizedState!==null,(l.stateNode.isHidden=me)&&!Ce&&(l.mode&1)!==0)for(Xe=l,Ce=l.child;Ce!==null;){for(Oe=Xe=Ce;Xe!==null;){switch(we=Xe,He=we.child,we.tag){case 0:case 11:case 14:case 15:ju(4,we,we.return);break;case 1:pl(we,we.return);var Ze=we.stateNode;if(typeof Ze.componentWillUnmount=="function"){w=we,m=we.return;try{u=w,Ze.props=u.memoizedProps,Ze.state=u.memoizedState,Ze.componentWillUnmount()}catch(et){Nn(w,m,et)}}break;case 5:pl(we,we.return);break;case 22:if(we.memoizedState!==null){OA(Oe);continue}}He!==null?(He.return=we,Xe=He):OA(Oe)}Ce=Ce.sibling}e:for(Ce=null,Oe=l;;){if(Oe.tag===5){if(Ce===null){Ce=Oe;try{C=Oe.stateNode,me?(E=C.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none"):(Y=Oe.stateNode,ne=Oe.memoizedProps.style,I=ne!=null&&ne.hasOwnProperty("display")?ne.display:null,Y.style.display=kn("display",I))}catch(et){Nn(l,l.return,et)}}}else if(Oe.tag===6){if(Ce===null)try{Oe.stateNode.nodeValue=me?"":Oe.memoizedProps}catch(et){Nn(l,l.return,et)}}else if((Oe.tag!==22&&Oe.tag!==23||Oe.memoizedState===null||Oe===l)&&Oe.child!==null){Oe.child.return=Oe,Oe=Oe.child;continue}if(Oe===l)break e;for(;Oe.sibling===null;){if(Oe.return===null||Oe.return===l)break e;Ce===Oe&&(Ce=null),Oe=Oe.return}Ce===Oe&&(Ce=null),Oe.sibling.return=Oe.return,Oe=Oe.sibling}}break;case 19:Ta(u,l),ss(l),w&4&&_A(l);break;case 21:break;default:Ta(u,l),ss(l)}}function ss(l){var u=l.flags;if(u&2){try{e:{for(var m=l.return;m!==null;){if(SA(m)){var w=m;break e}m=m.return}throw Error(n(160))}switch(w.tag){case 5:var C=w.stateNode;w.flags&32&&(zt(C,""),w.flags&=-33);var E=NA(l);by(l,E,C);break;case 3:case 4:var I=w.stateNode.containerInfo,Y=NA(l);xy(l,Y,I);break;default:throw Error(n(161))}}catch(ne){Nn(l,l.return,ne)}l.flags&=-3}u&4096&&(l.flags&=-4097)}function X6(l,u,m){Xe=l,EA(l)}function EA(l,u,m){for(var w=(l.mode&1)!==0;Xe!==null;){var C=Xe,E=C.child;if(C.tag===22&&w){var I=C.memoizedState!==null||op;if(!I){var Y=C.alternate,ne=Y!==null&&Y.memoizedState!==null||mr;Y=op;var me=mr;if(op=I,(mr=ne)&&!me)for(Xe=C;Xe!==null;)I=Xe,ne=I.child,I.tag===22&&I.memoizedState!==null?RA(C):ne!==null?(ne.return=I,Xe=ne):RA(C);for(;E!==null;)Xe=E,EA(E),E=E.sibling;Xe=C,op=Y,mr=me}PA(l)}else(C.subtreeFlags&8772)!==0&&E!==null?(E.return=C,Xe=E):PA(l)}}function PA(l){for(;Xe!==null;){var u=Xe;if((u.flags&8772)!==0){var m=u.alternate;try{if((u.flags&8772)!==0)switch(u.tag){case 0:case 11:case 15:mr||lp(5,u);break;case 1:var w=u.stateNode;if(u.flags&4&&!mr)if(m===null)w.componentDidMount();else{var C=u.elementType===u.type?m.memoizedProps:Ra(u.type,m.memoizedProps);w.componentDidUpdate(C,m.memoizedState,w.__reactInternalSnapshotBeforeUpdate)}var E=u.updateQueue;E!==null&&O_(u,E,w);break;case 3:var I=u.updateQueue;if(I!==null){if(m=null,u.child!==null)switch(u.child.tag){case 5:m=u.child.stateNode;break;case 1:m=u.child.stateNode}O_(u,I,m)}break;case 5:var Y=u.stateNode;if(m===null&&u.flags&4){m=Y;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 me=u.alternate;if(me!==null){var Ce=me.memoizedState;if(Ce!==null){var Oe=Ce.dehydrated;Oe!==null&&eu(Oe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}mr||u.flags&512&&yy(u)}catch(we){Nn(u,u.return,we)}}if(u===l){Xe=null;break}if(m=u.sibling,m!==null){m.return=u.return,Xe=m;break}Xe=u.return}}function OA(l){for(;Xe!==null;){var u=Xe;if(u===l){Xe=null;break}var m=u.sibling;if(m!==null){m.return=u.return,Xe=m;break}Xe=u.return}}function RA(l){for(;Xe!==null;){var u=Xe;try{switch(u.tag){case 0:case 11:case 15:var m=u.return;try{lp(4,u)}catch(ne){Nn(u,m,ne)}break;case 1:var w=u.stateNode;if(typeof w.componentDidMount=="function"){var C=u.return;try{w.componentDidMount()}catch(ne){Nn(u,C,ne)}}var E=u.return;try{yy(u)}catch(ne){Nn(u,E,ne)}break;case 5:var I=u.return;try{yy(u)}catch(ne){Nn(u,I,ne)}}}catch(ne){Nn(u,u.return,ne)}if(u===l){Xe=null;break}var Y=u.sibling;if(Y!==null){Y.return=u.return,Xe=Y;break}Xe=u.return}}var Q6=Math.ceil,cp=P.ReactCurrentDispatcher,wy=P.ReactCurrentOwner,da=P.ReactCurrentBatchConfig,Ot=0,Jn=null,Mn=null,ar=0,Vr=0,hl=di(0),zn=0,Su=null,no=0,up=0,jy=0,Nu=null,Rr=null,Sy=0,ml=1/0,Rs=null,dp=!1,Ny=null,gi=null,fp=!1,yi=null,pp=0,Cu=0,Cy=null,hp=-1,mp=0;function xr(){return(Ot&6)!==0?xn():hp!==-1?hp:hp=xn()}function xi(l){return(l.mode&1)===0?1:(Ot&2)!==0&&ar!==0?ar&-ar:I6.transition!==null?(mp===0&&(mp=NC()),mp):(l=qt,l!==0||(l=window.event,l=l===void 0?16:TC(l.type)),l)}function Ia(l,u,m,w){if(50<Cu)throw Cu=0,Cy=null,Error(n(185));Yc(l,m,w),((Ot&2)===0||l!==Jn)&&(l===Jn&&((Ot&2)===0&&(up|=m),zn===4&&bi(l,ar)),kr(l,w),m===1&&Ot===0&&(u.mode&1)===0&&(ml=xn()+500,qf&&pi()))}function kr(l,u){var m=l.callbackNode;Gc(l,u);var w=Gi(l,l===Jn?ar:0);if(w===0)m!==null&&Tn(m),l.callbackNode=null,l.callbackPriority=0;else if(u=w&-w,l.callbackPriority!==u){if(m!=null&&Tn(m),u===1)l.tag===0?T6(TA.bind(null,l)):y_(TA.bind(null,l)),P6(function(){(Ot&6)===0&&pi()}),m=null;else{switch(CC(w)){case 1:m=Ko;break;case 4:m=Sf;break;case 16:m=Go;break;case 536870912:m=Nf;break;default:m=Go}m=zA(m,kA.bind(null,l))}l.callbackPriority=u,l.callbackNode=m}}function kA(l,u){if(hp=-1,mp=0,(Ot&6)!==0)throw Error(n(327));var m=l.callbackNode;if(vl()&&l.callbackNode!==m)return null;var w=Gi(l,l===Jn?ar:0);if(w===0)return null;if((w&30)!==0||(w&l.expiredLanes)!==0||u)u=vp(l,w);else{u=w;var C=Ot;Ot|=2;var E=MA();(Jn!==l||ar!==u)&&(Rs=null,ml=xn()+500,ao(l,u));do try{e7();break}catch(Y){IA(l,Y)}while(!0);qg(),cp.current=E,Ot=C,Mn!==null?u=0:(Jn=null,ar=0,u=zn)}if(u!==0){if(u===2&&(C=sg(l),C!==0&&(w=C,u=_y(l,C))),u===1)throw m=Su,ao(l,0),bi(l,w),kr(l,xn()),m;if(u===6)bi(l,w);else{if(C=l.current.alternate,(w&30)===0&&!J6(C)&&(u=vp(l,w),u===2&&(E=sg(l),E!==0&&(w=E,u=_y(l,E))),u===1))throw m=Su,ao(l,0),bi(l,w),kr(l,xn()),m;switch(l.finishedWork=C,l.finishedLanes=w,u){case 0:case 1:throw Error(n(345));case 2:so(l,Rr,Rs);break;case 3:if(bi(l,w),(w&130023424)===w&&(u=Sy+500-xn(),10<u)){if(Gi(l,0)!==0)break;if(C=l.suspendedLanes,(C&w)!==w){xr(),l.pingedLanes|=l.suspendedLanes&C;break}l.timeoutHandle=kg(so.bind(null,l,Rr,Rs),u);break}so(l,Rr,Rs);break;case 4:if(bi(l,w),(w&4194240)===w)break;for(u=l.eventTimes,C=-1;0<w;){var I=31-Pe(w);E=1<<I,I=u[I],I>C&&(C=I),w&=~E}if(w=C,w=xn()-w,w=(120>w?120:480>w?480:1080>w?1080:1920>w?1920:3e3>w?3e3:4320>w?4320:1960*Q6(w/1960))-w,10<w){l.timeoutHandle=kg(so.bind(null,l,Rr,Rs),w);break}so(l,Rr,Rs);break;case 5:so(l,Rr,Rs);break;default:throw Error(n(329))}}}return kr(l,xn()),l.callbackNode===m?kA.bind(null,l):null}function _y(l,u){var m=Nu;return l.current.memoizedState.isDehydrated&&(ao(l,u).flags|=256),l=vp(l,u),l!==2&&(u=Rr,Rr=m,u!==null&&Ay(u)),l}function Ay(l){Rr===null?Rr=l:Rr.push.apply(Rr,l)}function J6(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 C=m[w],E=C.getSnapshot;C=C.value;try{if(!Pa(E(),C))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 bi(l,u){for(u&=~jy,u&=~up,l.suspendedLanes|=u,l.pingedLanes&=~u,l=l.expirationTimes;0<u;){var m=31-Pe(u),w=1<<m;l[m]=-1,u&=~w}}function TA(l){if((Ot&6)!==0)throw Error(n(327));vl();var u=Gi(l,0);if((u&1)===0)return kr(l,xn()),null;var m=vp(l,u);if(l.tag!==0&&m===2){var w=sg(l);w!==0&&(u=w,m=_y(l,w))}if(m===1)throw m=Su,ao(l,0),bi(l,u),kr(l,xn()),m;if(m===6)throw Error(n(345));return l.finishedWork=l.current.alternate,l.finishedLanes=u,so(l,Rr,Rs),kr(l,xn()),null}function Ey(l,u){var m=Ot;Ot|=1;try{return l(u)}finally{Ot=m,Ot===0&&(ml=xn()+500,qf&&pi())}}function ro(l){yi!==null&&yi.tag===0&&(Ot&6)===0&&vl();var u=Ot;Ot|=1;var m=da.transition,w=qt;try{if(da.transition=null,qt=1,l)return l()}finally{qt=w,da.transition=m,Ot=u,(Ot&6)===0&&pi()}}function Py(){Vr=hl.current,dn(hl)}function ao(l,u){l.finishedWork=null,l.finishedLanes=0;var m=l.timeoutHandle;if(m!==-1&&(l.timeoutHandle=-1,E6(m)),Mn!==null)for(m=Mn.return;m!==null;){var w=m;switch(Lg(w),w.tag){case 1:w=w.type.childContextTypes,w!=null&&zf();break;case 3:dl(),dn(Er),dn(fr),Qg();break;case 5:Yg(w);break;case 4:dl();break;case 13:dn(bn);break;case 19:dn(bn);break;case 10:Wg(w.type._context);break;case 22:case 23:Py()}m=m.return}if(Jn=l,Mn=l=wi(l.current,null),ar=Vr=u,zn=0,Su=null,jy=up=no=0,Rr=Nu=null,Zi!==null){for(u=0;u<Zi.length;u++)if(m=Zi[u],w=m.interleaved,w!==null){m.interleaved=null;var C=w.next,E=m.pending;if(E!==null){var I=E.next;E.next=C,w.next=I}m.pending=w}Zi=null}return l}function IA(l,u){do{var m=Mn;try{if(qg(),Zf.current=rp,ep){for(var w=wn.memoizedState;w!==null;){var C=w.queue;C!==null&&(C.pending=null),w=w.next}ep=!1}if(to=0,Qn=Bn=wn=null,gu=!1,yu=0,wy.current=null,m===null||m.return===null){zn=1,Su=u,Mn=null;break}e:{var E=l,I=m.return,Y=m,ne=u;if(u=ar,Y.flags|=32768,ne!==null&&typeof ne=="object"&&typeof ne.then=="function"){var me=ne,Ce=Y,Oe=Ce.tag;if((Ce.mode&1)===0&&(Oe===0||Oe===11||Oe===15)){var we=Ce.alternate;we?(Ce.updateQueue=we.updateQueue,Ce.memoizedState=we.memoizedState,Ce.lanes=we.lanes):(Ce.updateQueue=null,Ce.memoizedState=null)}var He=sA(I);if(He!==null){He.flags&=-257,iA(He,I,Y,E,u),He.mode&1&&aA(E,me,u),u=He,ne=me;var Ze=u.updateQueue;if(Ze===null){var et=new Set;et.add(ne),u.updateQueue=et}else Ze.add(ne);break e}else{if((u&1)===0){aA(E,me,u),Oy();break e}ne=Error(n(426))}}else if(mn&&Y.mode&1){var En=sA(I);if(En!==null){(En.flags&65536)===0&&(En.flags|=256),iA(En,I,Y,E,u),zg(fl(ne,Y));break e}}E=ne=fl(ne,Y),zn!==4&&(zn=2),Nu===null?Nu=[E]:Nu.push(E),E=I;do{switch(E.tag){case 3:E.flags|=65536,u&=-u,E.lanes|=u;var ue=nA(E,ne,u);P_(E,ue);break e;case 1:Y=ne;var re=E.type,fe=E.stateNode;if((E.flags&128)===0&&(typeof re.getDerivedStateFromError=="function"||fe!==null&&typeof fe.componentDidCatch=="function"&&(gi===null||!gi.has(fe)))){E.flags|=65536,u&=-u,E.lanes|=u;var Te=rA(E,Y,u);P_(E,Te);break e}}E=E.return}while(E!==null)}DA(m)}catch(at){u=at,Mn===m&&m!==null&&(Mn=m=m.return);continue}break}while(!0)}function MA(){var l=cp.current;return cp.current=rp,l===null?rp:l}function Oy(){(zn===0||zn===3||zn===2)&&(zn=4),Jn===null||(no&268435455)===0&&(up&268435455)===0||bi(Jn,ar)}function vp(l,u){var m=Ot;Ot|=2;var w=MA();(Jn!==l||ar!==u)&&(Rs=null,ao(l,u));do try{Z6();break}catch(C){IA(l,C)}while(!0);if(qg(),Ot=m,cp.current=w,Mn!==null)throw Error(n(261));return Jn=null,ar=0,zn}function Z6(){for(;Mn!==null;)$A(Mn)}function e7(){for(;Mn!==null&&!Ut();)$A(Mn)}function $A(l){var u=BA(l.alternate,l,Vr);l.memoizedProps=l.pendingProps,u===null?DA(l):Mn=u,wy.current=null}function DA(l){var u=l;do{var m=u.alternate;if(l=u.return,(u.flags&32768)===0){if(m=H6(m,u,Vr),m!==null){Mn=m;return}}else{if(m=K6(m,u),m!==null){m.flags&=32767,Mn=m;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{zn=6,Mn=null;return}}if(u=u.sibling,u!==null){Mn=u;return}Mn=u=l}while(u!==null);zn===0&&(zn=5)}function so(l,u,m){var w=qt,C=da.transition;try{da.transition=null,qt=1,t7(l,u,m,w)}finally{da.transition=C,qt=w}return null}function t7(l,u,m,w){do vl();while(yi!==null);if((Ot&6)!==0)throw Error(n(327));m=l.finishedWork;var C=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 E=m.lanes|m.childLanes;if(Mz(l,E),l===Jn&&(Mn=Jn=null,ar=0),(m.subtreeFlags&2064)===0&&(m.flags&2064)===0||fp||(fp=!0,zA(Go,function(){return vl(),null})),E=(m.flags&15990)!==0,(m.subtreeFlags&15990)!==0||E){E=da.transition,da.transition=null;var I=qt;qt=1;var Y=Ot;Ot|=4,wy.current=null,Y6(l,m),AA(m,l),w6(Og),Af=!!Pg,Og=Pg=null,l.current=m,X6(m),An(),Ot=Y,qt=I,da.transition=E}else l.current=m;if(fp&&(fp=!1,yi=l,pp=C),E=l.pendingLanes,E===0&&(gi=null),st(m.stateNode),kr(l,xn()),u!==null)for(w=l.onRecoverableError,m=0;m<u.length;m++)C=u[m],w(C.value,{componentStack:C.stack,digest:C.digest});if(dp)throw dp=!1,l=Ny,Ny=null,l;return(pp&1)!==0&&l.tag!==0&&vl(),E=l.pendingLanes,(E&1)!==0?l===Cy?Cu++:(Cu=0,Cy=l):Cu=0,pi(),null}function vl(){if(yi!==null){var l=CC(pp),u=da.transition,m=qt;try{if(da.transition=null,qt=16>l?16:l,yi===null)var w=!1;else{if(l=yi,yi=null,pp=0,(Ot&6)!==0)throw Error(n(331));var C=Ot;for(Ot|=4,Xe=l.current;Xe!==null;){var E=Xe,I=E.child;if((Xe.flags&16)!==0){var Y=E.deletions;if(Y!==null){for(var ne=0;ne<Y.length;ne++){var me=Y[ne];for(Xe=me;Xe!==null;){var Ce=Xe;switch(Ce.tag){case 0:case 11:case 15:ju(8,Ce,E)}var Oe=Ce.child;if(Oe!==null)Oe.return=Ce,Xe=Oe;else for(;Xe!==null;){Ce=Xe;var we=Ce.sibling,He=Ce.return;if(jA(Ce),Ce===me){Xe=null;break}if(we!==null){we.return=He,Xe=we;break}Xe=He}}}var Ze=E.alternate;if(Ze!==null){var et=Ze.child;if(et!==null){Ze.child=null;do{var En=et.sibling;et.sibling=null,et=En}while(et!==null)}}Xe=E}}if((E.subtreeFlags&2064)!==0&&I!==null)I.return=E,Xe=I;else e:for(;Xe!==null;){if(E=Xe,(E.flags&2048)!==0)switch(E.tag){case 0:case 11:case 15:ju(9,E,E.return)}var ue=E.sibling;if(ue!==null){ue.return=E.return,Xe=ue;break e}Xe=E.return}}var re=l.current;for(Xe=re;Xe!==null;){I=Xe;var fe=I.child;if((I.subtreeFlags&2064)!==0&&fe!==null)fe.return=I,Xe=fe;else e:for(I=re;Xe!==null;){if(Y=Xe,(Y.flags&2048)!==0)try{switch(Y.tag){case 0:case 11:case 15:lp(9,Y)}}catch(at){Nn(Y,Y.return,at)}if(Y===I){Xe=null;break e}var Te=Y.sibling;if(Te!==null){Te.return=Y.return,Xe=Te;break e}Xe=Y.return}}if(Ot=C,pi(),ge&&typeof ge.onPostCommitFiberRoot=="function")try{ge.onPostCommitFiberRoot(V,l)}catch{}w=!0}return w}finally{qt=m,da.transition=u}}return!1}function LA(l,u,m){u=fl(m,u),u=nA(l,u,1),l=mi(l,u,1),u=xr(),l!==null&&(Yc(l,1,u),kr(l,u))}function Nn(l,u,m){if(l.tag===3)LA(l,l,m);else for(;u!==null;){if(u.tag===3){LA(u,l,m);break}else if(u.tag===1){var w=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof w.componentDidCatch=="function"&&(gi===null||!gi.has(w))){l=fl(m,l),l=rA(u,l,1),u=mi(u,l,1),l=xr(),u!==null&&(Yc(u,1,l),kr(u,l));break}}u=u.return}}function n7(l,u,m){var w=l.pingCache;w!==null&&w.delete(u),u=xr(),l.pingedLanes|=l.suspendedLanes&m,Jn===l&&(ar&m)===m&&(zn===4||zn===3&&(ar&130023424)===ar&&500>xn()-Sy?ao(l,0):jy|=m),kr(l,u)}function FA(l,u){u===0&&((l.mode&1)===0?u=1:(u=Xt,Xt<<=1,(Xt&130023424)===0&&(Xt=4194304)));var m=xr();l=Es(l,u),l!==null&&(Yc(l,u,m),kr(l,m))}function r7(l){var u=l.memoizedState,m=0;u!==null&&(m=u.retryLane),FA(l,m)}function a7(l,u){var m=0;switch(l.tag){case 13:var w=l.stateNode,C=l.memoizedState;C!==null&&(m=C.retryLane);break;case 19:w=l.stateNode;break;default:throw Error(n(314))}w!==null&&w.delete(u),FA(l,m)}var BA;BA=function(l,u,m){if(l!==null)if(l.memoizedProps!==u.pendingProps||Er.current)Or=!0;else{if((l.lanes&m)===0&&(u.flags&128)===0)return Or=!1,V6(l,u,m);Or=(l.flags&131072)!==0}else Or=!1,mn&&(u.flags&1048576)!==0&&x_(u,Vf,u.index);switch(u.lanes=0,u.tag){case 2:var w=u.type;ip(l,u),l=u.pendingProps;var C=al(u,fr.current);ul(u,m),C=ey(null,u,w,l,C,m);var E=ty();return u.flags|=1,typeof C=="object"&&C!==null&&typeof C.render=="function"&&C.$$typeof===void 0?(u.tag=1,u.memoizedState=null,u.updateQueue=null,Pr(w)?(E=!0,Uf(u)):E=!1,u.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,Kg(u),C.updater=ap,u.stateNode=C,C._reactInternals=u,oy(u,w,l,m),u=dy(null,u,w,!0,E,m)):(u.tag=0,mn&&E&&Dg(u),yr(null,u,C,m),u=u.child),u;case 16:w=u.elementType;e:{switch(ip(l,u),l=u.pendingProps,C=w._init,w=C(w._payload),u.type=w,C=u.tag=i7(w),l=Ra(w,l),C){case 0:u=uy(null,u,w,l,m);break e;case 1:u=fA(null,u,w,l,m);break e;case 11:u=oA(null,u,w,l,m);break e;case 14:u=lA(null,u,w,Ra(w.type,l),m);break e}throw Error(n(306,w,""))}return u;case 0:return w=u.type,C=u.pendingProps,C=u.elementType===w?C:Ra(w,C),uy(l,u,w,C,m);case 1:return w=u.type,C=u.pendingProps,C=u.elementType===w?C:Ra(w,C),fA(l,u,w,C,m);case 3:e:{if(pA(u),l===null)throw Error(n(387));w=u.pendingProps,E=u.memoizedState,C=E.element,E_(l,u),Qf(u,w,null,m);var I=u.memoizedState;if(w=I.element,E.isDehydrated)if(E={element:w,isDehydrated:!1,cache:I.cache,pendingSuspenseBoundaries:I.pendingSuspenseBoundaries,transitions:I.transitions},u.updateQueue.baseState=E,u.memoizedState=E,u.flags&256){C=fl(Error(n(423)),u),u=hA(l,u,w,m,C);break e}else if(w!==C){C=fl(Error(n(424)),u),u=hA(l,u,w,m,C);break e}else for(Wr=ui(u.stateNode.containerInfo.firstChild),qr=u,mn=!0,Oa=null,m=__(u,null,w,m),u.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if(ol(),w===C){u=Os(l,u,m);break e}yr(l,u,w,m)}u=u.child}return u;case 5:return R_(u),l===null&&Bg(u),w=u.type,C=u.pendingProps,E=l!==null?l.memoizedProps:null,I=C.children,Rg(w,C)?I=null:E!==null&&Rg(w,E)&&(u.flags|=32),dA(l,u),yr(l,u,I,m),u.child;case 6:return l===null&&Bg(u),null;case 13:return mA(l,u,m);case 4:return Gg(u,u.stateNode.containerInfo),w=u.pendingProps,l===null?u.child=ll(u,null,w,m):yr(l,u,w,m),u.child;case 11:return w=u.type,C=u.pendingProps,C=u.elementType===w?C:Ra(w,C),oA(l,u,w,C,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,C=u.pendingProps,E=u.memoizedProps,I=C.value,nn(Gf,w._currentValue),w._currentValue=I,E!==null)if(Pa(E.value,I)){if(E.children===C.children&&!Er.current){u=Os(l,u,m);break e}}else for(E=u.child,E!==null&&(E.return=u);E!==null;){var Y=E.dependencies;if(Y!==null){I=E.child;for(var ne=Y.firstContext;ne!==null;){if(ne.context===w){if(E.tag===1){ne=Ps(-1,m&-m),ne.tag=2;var me=E.updateQueue;if(me!==null){me=me.shared;var Ce=me.pending;Ce===null?ne.next=ne:(ne.next=Ce.next,Ce.next=ne),me.pending=ne}}E.lanes|=m,ne=E.alternate,ne!==null&&(ne.lanes|=m),Vg(E.return,m,u),Y.lanes|=m;break}ne=ne.next}}else if(E.tag===10)I=E.type===u.type?null:E.child;else if(E.tag===18){if(I=E.return,I===null)throw Error(n(341));I.lanes|=m,Y=I.alternate,Y!==null&&(Y.lanes|=m),Vg(I,m,u),I=E.sibling}else I=E.child;if(I!==null)I.return=E;else for(I=E;I!==null;){if(I===u){I=null;break}if(E=I.sibling,E!==null){E.return=I.return,I=E;break}I=I.return}E=I}yr(l,u,C.children,m),u=u.child}return u;case 9:return C=u.type,w=u.pendingProps.children,ul(u,m),C=ca(C),w=w(C),u.flags|=1,yr(l,u,w,m),u.child;case 14:return w=u.type,C=Ra(w,u.pendingProps),C=Ra(w.type,C),lA(l,u,w,C,m);case 15:return cA(l,u,u.type,u.pendingProps,m);case 17:return w=u.type,C=u.pendingProps,C=u.elementType===w?C:Ra(w,C),ip(l,u),u.tag=1,Pr(w)?(l=!0,Uf(u)):l=!1,ul(u,m),eA(u,w,C),oy(u,w,C,m),dy(null,u,w,!0,l,m);case 19:return gA(l,u,m);case 22:return uA(l,u,m)}throw Error(n(156,u.tag))};function zA(l,u){return hn(l,u)}function s7(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 fa(l,u,m,w){return new s7(l,u,m,w)}function Ry(l){return l=l.prototype,!(!l||!l.isReactComponent)}function i7(l){if(typeof l=="function")return Ry(l)?1:0;if(l!=null){if(l=l.$$typeof,l===L)return 11;if(l===H)return 14}return 2}function wi(l,u){var m=l.alternate;return m===null?(m=fa(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 gp(l,u,m,w,C,E){var I=2;if(w=l,typeof l=="function")Ry(l)&&(I=1);else if(typeof l=="string")I=5;else e:switch(l){case R:return io(m.children,C,E,u);case k:I=8,C|=8;break;case M:return l=fa(12,m,u,C|2),l.elementType=M,l.lanes=E,l;case G:return l=fa(13,m,u,C),l.elementType=G,l.lanes=E,l;case U:return l=fa(19,m,u,C),l.elementType=U,l.lanes=E,l;case J:return yp(m,C,E,u);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case z:I=10;break e;case B:I=9;break e;case L:I=11;break e;case H:I=14;break e;case Q:I=16,w=null;break e}throw Error(n(130,l==null?l:typeof l,""))}return u=fa(I,m,u,C),u.elementType=l,u.type=w,u.lanes=E,u}function io(l,u,m,w){return l=fa(7,l,w,u),l.lanes=m,l}function yp(l,u,m,w){return l=fa(22,l,w,u),l.elementType=J,l.lanes=m,l.stateNode={isHidden:!1},l}function ky(l,u,m){return l=fa(6,l,null,u),l.lanes=m,l}function Ty(l,u,m){return u=fa(4,l.children!==null?l.children:[],l.key,u),u.lanes=m,u.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},u}function o7(l,u,m,w,C){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=ig(0),this.expirationTimes=ig(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ig(0),this.identifierPrefix=w,this.onRecoverableError=C,this.mutableSourceEagerHydrationData=null}function Iy(l,u,m,w,C,E,I,Y,ne){return l=new o7(l,u,m,Y,ne),u===1?(u=1,E===!0&&(u|=8)):u=0,E=fa(3,null,null,u),l.current=E,E.stateNode=l,E.memoizedState={element:w,isDehydrated:m,cache:null,transitions:null,pendingSuspenseBoundaries:null},Kg(E),l}function l7(l,u,m){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:O,key:w==null?null:""+w,children:l,containerInfo:u,implementation:m}}function UA(l){if(!l)return fi;l=l._reactInternals;e:{if(Be(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 v_(l,m,u)}return u}function qA(l,u,m,w,C,E,I,Y,ne){return l=Iy(m,w,!0,l,C,E,I,Y,ne),l.context=UA(null),m=l.current,w=xr(),C=xi(m),E=Ps(w,C),E.callback=u??null,mi(m,E,C),l.current.lanes=C,Yc(l,C,w),kr(l,w),l}function xp(l,u,m,w){var C=u.current,E=xr(),I=xi(C);return m=UA(m),u.context===null?u.context=m:u.pendingContext=m,u=Ps(E,I),u.payload={element:l},w=w===void 0?null:w,w!==null&&(u.callback=w),l=mi(C,u,I),l!==null&&(Ia(l,C,I,E),Xf(l,C,I)),I}function bp(l){return l=l.current,l.child?(l.child.tag===5,l.child.stateNode):null}function WA(l,u){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var m=l.retryLane;l.retryLane=m!==0&&m<u?m:u}}function My(l,u){WA(l,u),(l=l.alternate)&&WA(l,u)}function c7(){return null}var VA=typeof reportError=="function"?reportError:function(l){console.error(l)};function $y(l){this._internalRoot=l}wp.prototype.render=$y.prototype.render=function(l){var u=this._internalRoot;if(u===null)throw Error(n(409));xp(l,u,null,null)},wp.prototype.unmount=$y.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var u=l.containerInfo;ro(function(){xp(null,l,null,null)}),u[Ns]=null}};function wp(l){this._internalRoot=l}wp.prototype.unstable_scheduleHydration=function(l){if(l){var u=EC();l={blockedOn:null,target:l,priority:u};for(var m=0;m<oi.length&&u!==0&&u<oi[m].priority;m++);oi.splice(m,0,l),m===0&&RC(l)}};function Dy(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function jp(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function HA(){}function u7(l,u,m,w,C){if(C){if(typeof w=="function"){var E=w;w=function(){var me=bp(I);E.call(me)}}var I=qA(u,w,l,0,null,!1,!1,"",HA);return l._reactRootContainer=I,l[Ns]=I.current,cu(l.nodeType===8?l.parentNode:l),ro(),I}for(;C=l.lastChild;)l.removeChild(C);if(typeof w=="function"){var Y=w;w=function(){var me=bp(ne);Y.call(me)}}var ne=Iy(l,0,!1,null,null,!1,!1,"",HA);return l._reactRootContainer=ne,l[Ns]=ne.current,cu(l.nodeType===8?l.parentNode:l),ro(function(){xp(u,ne,m,w)}),ne}function Sp(l,u,m,w,C){var E=m._reactRootContainer;if(E){var I=E;if(typeof C=="function"){var Y=C;C=function(){var ne=bp(I);Y.call(ne)}}xp(u,I,l,C)}else I=u7(m,u,l,C,w);return bp(I)}_C=function(l){switch(l.tag){case 3:var u=l.stateNode;if(u.current.memoizedState.isDehydrated){var m=Ar(u.pendingLanes);m!==0&&(og(u,m|1),kr(u,xn()),(Ot&6)===0&&(ml=xn()+500,pi()))}break;case 13:ro(function(){var w=Es(l,1);if(w!==null){var C=xr();Ia(w,l,1,C)}}),My(l,1)}},lg=function(l){if(l.tag===13){var u=Es(l,134217728);if(u!==null){var m=xr();Ia(u,l,134217728,m)}My(l,134217728)}},AC=function(l){if(l.tag===13){var u=xi(l),m=Es(l,u);if(m!==null){var w=xr();Ia(m,l,u,w)}My(l,u)}},EC=function(){return qt},PC=function(l,u){var m=qt;try{return qt=l,u()}finally{qt=m}},Fr=function(l,u,m){switch(u){case"input":if(Se(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 C=Bf(w);if(!C)throw Error(n(90));se(w),Se(w,C)}}}break;case"textarea":De(l,m);break;case"select":u=m.value,u!=null&&Ne(l,!!m.multiple,u,!1)}},nt=Ey,yt=ro;var d7={usingClientEntryPoint:!1,Events:[fu,nl,Bf,ce,ke,Ey]},_u={findFiberByHostInstance:Yi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},f7={bundleType:_u.bundleType,version:_u.version,rendererPackageName:_u.rendererPackageName,rendererConfig:_u.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:P.ReactCurrentDispatcher,findHostInstanceByFiber:function(l){return l=yn(l),l===null?null:l.stateNode},findFiberByHostInstance:_u.findFiberByHostInstance||c7,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 Np=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Np.isDisabled&&Np.supportsFiber)try{V=Np.inject(f7),ge=Np}catch{}}return Tr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=d7,Tr.createPortal=function(l,u){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Dy(u))throw Error(n(200));return l7(l,u,null,m)},Tr.createRoot=function(l,u){if(!Dy(l))throw Error(n(299));var m=!1,w="",C=VA;return u!=null&&(u.unstable_strictMode===!0&&(m=!0),u.identifierPrefix!==void 0&&(w=u.identifierPrefix),u.onRecoverableError!==void 0&&(C=u.onRecoverableError)),u=Iy(l,1,!1,null,null,m,!1,w,C),l[Ns]=u.current,cu(l.nodeType===8?l.parentNode:l),new $y(u)},Tr.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=yn(u),l=l===null?null:l.stateNode,l},Tr.flushSync=function(l){return ro(l)},Tr.hydrate=function(l,u,m){if(!jp(u))throw Error(n(200));return Sp(null,l,u,!0,m)},Tr.hydrateRoot=function(l,u,m){if(!Dy(l))throw Error(n(405));var w=m!=null&&m.hydratedSources||null,C=!1,E="",I=VA;if(m!=null&&(m.unstable_strictMode===!0&&(C=!0),m.identifierPrefix!==void 0&&(E=m.identifierPrefix),m.onRecoverableError!==void 0&&(I=m.onRecoverableError)),u=qA(u,null,l,1,m??null,C,!1,E,I),l[Ns]=u.current,cu(l),w)for(l=0;l<w.length;l++)m=w[l],C=m._getVersion,C=C(m._source),u.mutableSourceEagerHydrationData==null?u.mutableSourceEagerHydrationData=[m,C]:u.mutableSourceEagerHydrationData.push(m,C);return new wp(u)},Tr.render=function(l,u,m){if(!jp(u))throw Error(n(200));return Sp(null,l,u,!1,m)},Tr.unmountComponentAtNode=function(l){if(!jp(l))throw Error(n(40));return l._reactRootContainer?(ro(function(){Sp(null,null,l,!1,function(){l._reactRootContainer=null,l[Ns]=null})}),!0):!1},Tr.unstable_batchedUpdates=Ey,Tr.unstable_renderSubtreeIntoContainer=function(l,u,m,w){if(!jp(m))throw Error(n(200));if(l==null||l._reactInternals===void 0)throw Error(n(38));return Sp(l,u,m,!1,w)},Tr.version="18.3.1-next-f1338f8080-20240426",Tr}var eE;function PM(){if(eE)return By.exports;eE=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(),By.exports=b7(),By.exports}var tE;function w7(){if(tE)return _p;tE=1;var e=PM();return _p.createRoot=e.createRoot,_p.hydrateRoot=e.hydrateRoot,_p}var j7=w7(),v=jS();const q=Vt(v),Nm=h7({__proto__:null,default:q},[v]),S7=1,N7=1e6;let qy=0;function C7(){return qy=(qy+1)%Number.MAX_SAFE_INTEGER,qy.toString()}const Wy=new Map,nE=e=>{if(Wy.has(e))return;const t=setTimeout(()=>{Wy.delete(e),Gu({type:"REMOVE_TOAST",toastId:e})},N7);Wy.set(e,t)},_7=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,S7)};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?nE(n):e.toasts.forEach(r=>{nE(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)}}},Qp=[];let Jp={toasts:[]};function Gu(e){Jp=_7(Jp,e),Qp.forEach(t=>{t(Jp)})}function _e({...e}){const t=C7(),n=a=>Gu({type:"UPDATE_TOAST",toast:{...a,id:t}}),r=()=>Gu({type:"DISMISS_TOAST",toastId:t});return Gu({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||r()}}}),{id:t,dismiss:r,update:n}}function A7(){const[e,t]=v.useState(Jp);return v.useEffect(()=>(Qp.push(t),()=>{const n=Qp.indexOf(t);n>-1&&Qp.splice(n,1)}),[e]),{...e,toast:_e,dismiss:n=>Gu({type:"DISMISS_TOAST",toastId:n})}}var _c=PM();const OM=Vt(_c);function Ee(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e?.(a),n===!1||!a.defaultPrevented)return t?.(a)}}function rE(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Nr(...e){return t=>{let n=!1;const r=e.map(a=>{const i=rE(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():rE(e[a],null)}}}}function pt(...e){return v.useCallback(Nr(...e),e)}function E7(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 or(e,t=[]){let n=[];function r(i,o){const c=v.createContext(o),d=n.length;n=[...n,o];const f=p=>{const{scope:y,children:g,...j}=p,b=y?.[e]?.[d]||c,x=v.useMemo(()=>j,Object.values(j));return s.jsx(b.Provider,{value:x,children:g})};f.displayName=i+"Provider";function h(p,y){const g=y?.[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,P7(a,...t)]}function P7(...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 aE(e){const t=O7(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(k7);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 O7(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=I7(a),c=T7(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Nr(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 R7=Symbol("radix.slottable");function k7(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===R7}function T7(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 I7(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 Xd(e){const t=e+"CollectionProvider",[n,r]=or(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=b=>{const{scope:x,children:S}=b,N=q.useRef(null),_=q.useRef(new Map).current;return s.jsx(a,{scope:x,itemMap:_,collectionRef:N,children:S})};o.displayName=t;const c=e+"CollectionSlot",d=aE(c),f=q.forwardRef((b,x)=>{const{scope:S,children:N}=b,_=i(c,S),P=pt(x,_.collectionRef);return s.jsx(d,{ref:P,children:N})});f.displayName=c;const h=e+"CollectionItemSlot",p="data-radix-collection-item",y=aE(h),g=q.forwardRef((b,x)=>{const{scope:S,children:N,..._}=b,P=q.useRef(null),A=pt(x,P),O=i(h,S);return q.useEffect(()=>(O.itemMap.set(P,{ref:P,..._}),()=>{O.itemMap.delete(P)})),s.jsx(y,{[p]:"",ref:A,children:N})});g.displayName=h;function j(b){const x=i(e+"CollectionConsumer",b);return q.useCallback(()=>{const N=x.collectionRef.current;if(!N)return[];const _=Array.from(N.querySelectorAll(`[${p}]`));return Array.from(x.itemMap.values()).sort((O,R)=>_.indexOf(O.ref.current)-_.indexOf(R.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:o,Slot:f,ItemSlot:g},j,r]}function M7(e){const t=$7(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(L7);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 $7(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=B7(a),c=F7(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Nr(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 D7=Symbol("radix.slottable");function L7(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===D7}function F7(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 B7(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 z7=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],qe=z7.reduce((e,t)=>{const n=M7(`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 SS(e,t){e&&_c.flushSync(()=>e.dispatchEvent(t))}function Pn(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>t.current?.(...n),[])}function U7(e,t=globalThis?.document){const n=Pn(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 q7="DismissableLayer",v1="dismissableLayer.update",W7="dismissableLayer.pointerDownOutside",V7="dismissableLayer.focusOutside",sE,RM=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Mo=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:c,...d}=e,f=v.useContext(RM),[h,p]=v.useState(null),y=h?.ownerDocument??globalThis?.document,[,g]=v.useState({}),j=pt(t,R=>p(R)),b=Array.from(f.layers),[x]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),S=b.indexOf(x),N=h?b.indexOf(h):-1,_=f.layersWithOutsidePointerEventsDisabled.size>0,P=N>=S,A=K7(R=>{const k=R.target,M=[...f.branches].some(z=>z.contains(k));!P||M||(a?.(R),o?.(R),R.defaultPrevented||c?.())},y),O=G7(R=>{const k=R.target;[...f.branches].some(z=>z.contains(k))||(i?.(R),o?.(R),R.defaultPrevented||c?.())},y);return U7(R=>{N===f.layers.size-1&&(r?.(R),!R.defaultPrevented&&c&&(R.preventDefault(),c()))},y),v.useEffect(()=>{if(h)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(sE=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),iE(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=sE)}},[h,y,n,f]),v.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),iE())},[h,f]),v.useEffect(()=>{const R=()=>g({});return document.addEventListener(v1,R),()=>document.removeEventListener(v1,R)},[]),s.jsx(qe.div,{...d,ref:j,style:{pointerEvents:_?P?"auto":"none":void 0,...e.style},onFocusCapture:Ee(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Ee(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Ee(e.onPointerDownCapture,A.onPointerDownCapture)})});Mo.displayName=q7;var H7="DismissableLayerBranch",kM=v.forwardRef((e,t)=>{const n=v.useContext(RM),r=v.useRef(null),a=pt(t,r);return v.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),s.jsx(qe.div,{...e,ref:a})});kM.displayName=H7;function K7(e,t=globalThis?.document){const n=Pn(e),r=v.useRef(!1),a=v.useRef(()=>{});return v.useEffect(()=>{const i=c=>{if(c.target&&!r.current){let d=function(){TM(W7,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 G7(e,t=globalThis?.document){const n=Pn(e),r=v.useRef(!1);return v.useEffect(()=>{const a=i=>{i.target&&!r.current&&TM(V7,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 iE(){const e=new CustomEvent(v1);document.dispatchEvent(e)}function TM(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?SS(a,i):a.dispatchEvent(i)}var Y7=Mo,X7=kM,Kn=globalThis?.document?v.useLayoutEffect:()=>{},Q7="Portal",Ac=v.forwardRef((e,t)=>{const{container:n,...r}=e,[a,i]=v.useState(!1);Kn(()=>i(!0),[]);const o=n||a&&globalThis?.document?.body;return o?OM.createPortal(s.jsx(qe.div,{...r,ref:t}),o):null});Ac.displayName=Q7;function J7(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var Gn=e=>{const{present:t,children:n}=e,r=Z7(t),a=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),i=pt(r.ref,eU(a));return typeof n=="function"||r.isPresent?v.cloneElement(a,{ref:i}):null};Gn.displayName="Presence";function Z7(e){const[t,n]=v.useState(),r=v.useRef(null),a=v.useRef(e),i=v.useRef("none"),o=e?"mounted":"unmounted",[c,d]=J7(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const f=Ap(r.current);i.current=c==="mounted"?f:"none"},[c]),Kn(()=>{const f=r.current,h=a.current;if(h!==e){const y=i.current,g=Ap(f);e?d("MOUNT"):g==="none"||f?.display==="none"?d("UNMOUNT"):d(h&&y!==g?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,d]),Kn(()=>{if(t){let f;const h=t.ownerDocument.defaultView??window,p=g=>{const b=Ap(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&b&&(d("ANIMATION_END"),!a.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",f=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},y=g=>{g.target===t&&(i.current=Ap(r.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{h.clearTimeout(f),t.removeEventListener("animationstart",y),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 Ap(e){return e?.animationName||"none"}function eU(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 tU=Nm[" useInsertionEffect ".trim().toString()]||Kn;function sa({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,o]=nU({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=rU(h)?h(e):h;p!==e&&o.current?.(p)}else i(h)},[c,e,i,o]);return[d,f]}function nU({defaultProp:e,onChange:t}){const[n,r]=v.useState(e),a=v.useRef(n),i=v.useRef(t);return tU(()=>{i.current=t},[t]),v.useEffect(()=>{a.current!==n&&(i.current?.(n),a.current=n)},[n,a]),[n,r,i]}function rU(e){return typeof e=="function"}var IM=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"}),aU="VisuallyHidden",Cm=v.forwardRef((e,t)=>s.jsx(qe.span,{...e,ref:t,style:{...IM,...e.style}}));Cm.displayName=aU;var sU=Cm,NS="ToastProvider",[CS,iU,oU]=Xd("Toast"),[MM]=or("Toast",[oU]),[lU,_m]=MM(NS),$M=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),y=v.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${NS}\`. Expected non-empty \`string\`.`),s.jsx(CS.Provider,{scope:t,children:s.jsx(lU,{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:y,children:o})})};$M.displayName=NS;var DM="ToastViewport",cU=["F8"],g1="toast.viewportPause",y1="toast.viewportResume",LM=v.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=cU,label:a="Notifications ({hotkey})",...i}=e,o=_m(DM,n),c=iU(n),d=v.useRef(null),f=v.useRef(null),h=v.useRef(null),p=v.useRef(null),y=pt(t,p,o.onViewportChange),g=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=o.toastCount>0;v.useEffect(()=>{const x=S=>{r.length!==0&&r.every(_=>S[_]||S.code===_)&&p.current?.focus()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[r]),v.useEffect(()=>{const x=d.current,S=p.current;if(j&&x&&S){const N=()=>{if(!o.isClosePausedRef.current){const O=new CustomEvent(g1);S.dispatchEvent(O),o.isClosePausedRef.current=!0}},_=()=>{if(o.isClosePausedRef.current){const O=new CustomEvent(y1);S.dispatchEvent(O),o.isClosePausedRef.current=!1}},P=O=>{!x.contains(O.relatedTarget)&&_()},A=()=>{x.contains(document.activeElement)||_()};return x.addEventListener("focusin",N),x.addEventListener("focusout",P),x.addEventListener("pointermove",N),x.addEventListener("pointerleave",A),window.addEventListener("blur",N),window.addEventListener("focus",_),()=>{x.removeEventListener("focusin",N),x.removeEventListener("focusout",P),x.removeEventListener("pointermove",N),x.removeEventListener("pointerleave",A),window.removeEventListener("blur",N),window.removeEventListener("focus",_)}}},[j,o.isClosePausedRef]);const b=v.useCallback(({tabbingDirection:x})=>{const N=c().map(_=>{const P=_.ref.current,A=[P,...jU(P)];return x==="forwards"?A:A.reverse()});return(x==="forwards"?N.reverse():N).flat()},[c]);return v.useEffect(()=>{const x=p.current;if(x){const S=N=>{const _=N.altKey||N.ctrlKey||N.metaKey;if(N.key==="Tab"&&!_){const A=document.activeElement,O=N.shiftKey;if(N.target===x&&O){f.current?.focus();return}const M=b({tabbingDirection:O?"backwards":"forwards"}),z=M.findIndex(B=>B===A);Vy(M.slice(z+1))?N.preventDefault():O?f.current?.focus():h.current?.focus()}};return x.addEventListener("keydown",S),()=>x.removeEventListener("keydown",S)}},[c,b]),s.jsxs(X7,{ref:d,role:"region","aria-label":a.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:j?void 0:"none"},children:[j&&s.jsx(x1,{ref:f,onFocusFromOutsideViewport:()=>{const x=b({tabbingDirection:"forwards"});Vy(x)}}),s.jsx(CS.Slot,{scope:n,children:s.jsx(qe.ol,{tabIndex:-1,...i,ref:y})}),j&&s.jsx(x1,{ref:h,onFocusFromOutsideViewport:()=>{const x=b({tabbingDirection:"backwards"});Vy(x)}})]})});LM.displayName=DM;var FM="ToastFocusProxy",x1=v.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...a}=e,i=_m(FM,n);return s.jsx(Cm,{tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:o=>{const c=o.relatedTarget;!i.viewport?.contains(c)&&r()}})});x1.displayName=FM;var Qd="Toast",uU="toast.swipeStart",dU="toast.swipeMove",fU="toast.swipeCancel",pU="toast.swipeEnd",BM=v.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:a,onOpenChange:i,...o}=e,[c,d]=sa({prop:r,defaultProp:a??!0,onChange:i,caller:Qd});return s.jsx(Gn,{present:n||c,children:s.jsx(vU,{open:c,...o,ref:t,onClose:()=>d(!1),onPause:Pn(e.onPause),onResume:Pn(e.onResume),onSwipeStart:Ee(e.onSwipeStart,f=>{f.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ee(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:Ee(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:Ee(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)})})})});BM.displayName=Qd;var[hU,mU]=MM(Qd,{onClose(){}}),vU=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:y,onSwipeEnd:g,...j}=e,b=_m(Qd,n),[x,S]=v.useState(null),N=pt(t,U=>S(U)),_=v.useRef(null),P=v.useRef(null),A=a||b.duration,O=v.useRef(0),R=v.useRef(A),k=v.useRef(0),{onToastAdd:M,onToastRemove:z}=b,B=Pn(()=>{x?.contains(document.activeElement)&&b.viewport?.focus(),o()}),L=v.useCallback(U=>{!U||U===1/0||(window.clearTimeout(k.current),O.current=new Date().getTime(),k.current=window.setTimeout(B,U))},[B]);v.useEffect(()=>{const U=b.viewport;if(U){const H=()=>{L(R.current),f?.()},Q=()=>{const J=new Date().getTime()-O.current;R.current=R.current-J,window.clearTimeout(k.current),d?.()};return U.addEventListener(g1,Q),U.addEventListener(y1,H),()=>{U.removeEventListener(g1,Q),U.removeEventListener(y1,H)}}},[b.viewport,A,d,f,L]),v.useEffect(()=>{i&&!b.isClosePausedRef.current&&L(A)},[i,A,b.isClosePausedRef,L]),v.useEffect(()=>(M(),()=>z()),[M,z]);const G=v.useMemo(()=>x?KM(x):null,[x]);return b.viewport?s.jsxs(s.Fragment,{children:[G&&s.jsx(gU,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:G}),s.jsx(hU,{scope:n,onClose:B,children:_c.createPortal(s.jsx(CS.ItemSlot,{scope:n,children:s.jsx(Y7,{asChild:!0,onEscapeKeyDown:Ee(c,()=>{b.isFocusedToastEscapeKeyDownRef.current||B(),b.isFocusedToastEscapeKeyDownRef.current=!1}),children:s.jsx(qe.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":b.swipeDirection,...j,ref:N,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Ee(e.onKeyDown,U=>{U.key==="Escape"&&(c?.(U.nativeEvent),U.nativeEvent.defaultPrevented||(b.isFocusedToastEscapeKeyDownRef.current=!0,B()))}),onPointerDown:Ee(e.onPointerDown,U=>{U.button===0&&(_.current={x:U.clientX,y:U.clientY})}),onPointerMove:Ee(e.onPointerMove,U=>{if(!_.current)return;const H=U.clientX-_.current.x,Q=U.clientY-_.current.y,J=!!P.current,T=["left","right"].includes(b.swipeDirection),D=["left","up"].includes(b.swipeDirection)?Math.min:Math.max,X=T?D(0,H):0,F=T?0:D(0,Q),$=U.pointerType==="touch"?10:2,ee={x:X,y:F},ae={originalEvent:U,delta:ee};J?(P.current=ee,Ep(dU,p,ae,{discrete:!1})):oE(ee,b.swipeDirection,$)?(P.current=ee,Ep(uU,h,ae,{discrete:!1}),U.target.setPointerCapture(U.pointerId)):(Math.abs(H)>$||Math.abs(Q)>$)&&(_.current=null)}),onPointerUp:Ee(e.onPointerUp,U=>{const H=P.current,Q=U.target;if(Q.hasPointerCapture(U.pointerId)&&Q.releasePointerCapture(U.pointerId),P.current=null,_.current=null,H){const J=U.currentTarget,T={originalEvent:U,delta:H};oE(H,b.swipeDirection,b.swipeThreshold)?Ep(pU,g,T,{discrete:!0}):Ep(fU,y,T,{discrete:!0}),J.addEventListener("click",D=>D.preventDefault(),{once:!0})}})})})}),b.viewport)})]}):null}),gU=e=>{const{__scopeToast:t,children:n,...r}=e,a=_m(Qd,t),[i,o]=v.useState(!1),[c,d]=v.useState(!1);return bU(()=>o(!0)),v.useEffect(()=>{const f=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(f)},[]),c?null:s.jsx(Ac,{asChild:!0,children:s.jsx(Cm,{...r,children:i&&s.jsxs(s.Fragment,{children:[a.label," ",n]})})})},yU="ToastTitle",zM=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(qe.div,{...r,ref:t})});zM.displayName=yU;var xU="ToastDescription",UM=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(qe.div,{...r,ref:t})});UM.displayName=xU;var qM="ToastAction",WM=v.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?s.jsx(HM,{altText:n,asChild:!0,children:s.jsx(_S,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${qM}\`. Expected non-empty \`string\`.`),null)});WM.displayName=qM;var VM="ToastClose",_S=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,a=mU(VM,n);return s.jsx(HM,{asChild:!0,children:s.jsx(qe.button,{type:"button",...r,ref:t,onClick:Ee(e.onClick,a.onClose)})})});_S.displayName=VM;var HM=v.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...a}=e;return s.jsx(qe.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...a,ref:t})});function KM(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),wU(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(...KM(r))}}),t}function Ep(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?SS(a,i):a.dispatchEvent(i)}var oE=(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 bU(e=()=>{}){const t=Pn(e);Kn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function wU(e){return e.nodeType===e.ELEMENT_NODE}function jU(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 Vy(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var SU=$M,GM=LM,YM=BM,XM=zM,QM=UM,JM=WM,ZM=_S;function e$(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=e$(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function jt(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=e$(e))&&(r&&(r+=" "),r+=t);return r}const lE=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,cE=jt,$o=(e,t)=>n=>{var r;if(t?.variants==null)return cE(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 y=lE(h)||lE(p);return a[f][y]}),c=n&&Object.entries(n).reduce((f,h)=>{let[p,y]=h;return y===void 0||(f[p]=y),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,h)=>{let{class:p,className:y,...g}=h;return Object.entries(g).every(j=>{let[b,x]=j;return Array.isArray(x)?x.includes({...i,...c}[b]):{...i,...c}[b]===x})?[...f,p,y]:f},[]);return cE(e,o,d,n?.class,n?.className)};const NU=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),t$=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();var CU={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 _U=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,...CU,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:t$("lucide",a),...c},[...o.map(([f,h])=>v.createElement(f,h)),...Array.isArray(i)?i:[i]]));const ot=(e,t)=>{const n=v.forwardRef(({className:r,...a},i)=>v.createElement(_U,{ref:i,iconNode:t,className:t$(`lucide-${NU(e)}`,r),...a}));return n.displayName=`${e}`,n};const n$=ot("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 AU=ot("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 jo=ot("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const ya=ot("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 ad=ot("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 Gl=ot("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Wt=ot("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const r$=ot("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const cs=ot("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const Il=ot("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);const Hy=ot("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 Ml=ot("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const EU=ot("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 Zp=ot("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 PU=ot("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const Jd=ot("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Mi=ot("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 a$=ot("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 wa=ot("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 Am=ot("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);const ih=ot("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 OU=ot("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$=ot("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 uE=ot("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 i$=ot("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 AS=ot("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 RU=ot("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 b1=ot("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 o$=ot("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 kU=ot("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 ir=ot("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const l$=ot("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 TU=ot("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 c$=ot("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 El=ot("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 IU=ot("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);const Ky=ot("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 Gy=ot("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 Em=ot("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 $l=ot("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const ps=ot("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const u$=ot("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 Sa=ot("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 MU=ot("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 ES=ot("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);const d$=ot("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 PS=ot("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 va=ot("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 eh=ot("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);const f$=ot("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 Na=ot("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 th=ot("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 $U=ot("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 OS=ot("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 p$=ot("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 Ds=ot("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 Vs=ot("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),RS="-",DU=e=>{const t=FU(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const c=o.split(RS);return c[0]===""&&c.length!==1&&c.shift(),h$(c,t)||LU(o)},getConflictingClassGroupIds:(o,c)=>{const d=n[o]||[];return c&&r[o]?[...d,...r[o]]:d}}},h$=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?h$(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(RS);return t.validators.find(({validator:o})=>o(i))?.classGroupId},dE=/^\[(.+)\]$/,LU=e=>{if(dE.test(e)){const t=dE.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},FU=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return zU(Object.entries(e.classGroups),n).forEach(([i,o])=>{w1(o,r,i,t)}),r},w1=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:fE(t,a);i.classGroupId=n;return}if(typeof a=="function"){if(BU(a)){w1(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([i,o])=>{w1(o,fE(t,i),n,r)})})},fE=(e,t)=>{let n=e;return t.split(RS).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},BU=e=>e.isThemeGetter,zU=(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,UU=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)}}},m$="!",qU=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 x=0;x<c.length;x++){let S=c[x];if(f===0){if(S===a&&(r||c.slice(x,x+i)===t)){d.push(c.slice(h,x)),h=x+i;continue}if(S==="/"){p=x;continue}}S==="["?f++:S==="]"&&f--}const y=d.length===0?c:c.substring(h),g=y.startsWith(m$),j=g?y.substring(1):y,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},WU=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},VU=e=>({cache:UU(e.cacheSize),parseClassName:qU(e),...DU(e)}),HU=/\s+/,KU=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,i=[],o=e.trim().split(HU);let c="";for(let d=o.length-1;d>=0;d-=1){const f=o[d],{modifiers:h,hasImportantModifier:p,baseClassName:y,maybePostfixModifierPosition:g}=n(f);let j=!!g,b=r(j?y.substring(0,g):y);if(!b){if(!j){c=f+(c.length>0?" "+c:c);continue}if(b=r(y),!b){c=f+(c.length>0?" "+c:c);continue}j=!1}const x=WU(h).join(":"),S=p?x+m$:x,N=S+b;if(i.includes(N))continue;i.push(N);const _=a(b,j);for(let P=0;P<_.length;++P){const A=_[P];i.push(S+A)}c=f+(c.length>0?" "+c:c)}return c};function GU(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=v$(t))&&(r&&(r+=" "),r+=n);return r}const v$=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=v$(e[r]))&&(n&&(n+=" "),n+=t);return n};function YU(e,...t){let n,r,a,i=o;function o(d){const f=t.reduce((h,p)=>p(h),e());return n=VU(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=KU(d,n);return a(d,h),h}return function(){return i(GU.apply(null,arguments))}}const fn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},g$=/^\[(?:([a-z-]+):)?(.+)\]$/i,XU=/^\d+\/\d+$/,QU=new Set(["px","full","screen"]),JU=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ZU=/\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$/,eq=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,tq=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,nq=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ks=e=>Dl(e)||QU.has(e)||XU.test(e),Si=e=>Ec(e,"length",uq),Dl=e=>!!e&&!Number.isNaN(Number(e)),Yy=e=>Ec(e,"number",Dl),Eu=e=>!!e&&Number.isInteger(Number(e)),rq=e=>e.endsWith("%")&&Dl(e.slice(0,-1)),St=e=>g$.test(e),Ni=e=>JU.test(e),aq=new Set(["length","size","percentage"]),sq=e=>Ec(e,aq,y$),iq=e=>Ec(e,"position",y$),oq=new Set(["image","url"]),lq=e=>Ec(e,oq,fq),cq=e=>Ec(e,"",dq),Pu=()=>!0,Ec=(e,t,n)=>{const r=g$.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},uq=e=>ZU.test(e)&&!eq.test(e),y$=()=>!1,dq=e=>tq.test(e),fq=e=>nq.test(e),pq=()=>{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"),y=fn("gap"),g=fn("gradientColorStops"),j=fn("gradientColorStopPositions"),b=fn("inset"),x=fn("margin"),S=fn("opacity"),N=fn("padding"),_=fn("saturate"),P=fn("scale"),A=fn("sepia"),O=fn("skew"),R=fn("space"),k=fn("translate"),M=()=>["auto","contain","none"],z=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto",St,t],L=()=>[St,t],G=()=>["",ks,Si],U=()=>["auto",Dl,St],H=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Q=()=>["solid","dashed","dotted","double","none"],J=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],T=()=>["start","end","center","between","around","evenly","stretch"],D=()=>["","0",St],X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],F=()=>[Dl,St];return{cacheSize:500,separator:":",theme:{colors:[Pu],spacing:[ks,Si],blur:["none","",Ni,St],brightness:F(),borderColor:[e],borderRadius:["none","","full",Ni,St],borderSpacing:L(),borderWidth:G(),contrast:F(),grayscale:D(),hueRotate:F(),invert:D(),gap:L(),gradientColorStops:[e],gradientColorStopPositions:[rq,Si],inset:B(),margin:B(),opacity:F(),padding:L(),saturate:F(),scale:F(),sepia:D(),skew:F(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",St]}],container:["container"],columns:[{columns:[Ni]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"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(),St]}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],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",Eu,St]}],basis:[{basis:B()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",St]}],grow:[{grow:D()}],shrink:[{shrink:D()}],order:[{order:["first","last","none",Eu,St]}],"grid-cols":[{"grid-cols":[Pu]}],"col-start-end":[{col:["auto",{span:["full",Eu,St]},St]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[Pu]}],"row-start-end":[{row:["auto",{span:[Eu,St]},St]}],"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",St]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",St]}],gap:[{gap:[y]}],"gap-x":[{"gap-x":[y]}],"gap-y":[{"gap-y":[y]}],"justify-content":[{justify:["normal",...T()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...T(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...T(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[N]}],px:[{px:[N]}],py:[{py:[N]}],ps:[{ps:[N]}],pe:[{pe:[N]}],pt:[{pt:[N]}],pr:[{pr:[N]}],pb:[{pb:[N]}],pl:[{pl:[N]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",St,t]}],"min-w":[{"min-w":[St,t,"min","max","fit"]}],"max-w":[{"max-w":[St,t,"none","full","min","max","fit","prose",{screen:[Ni]},Ni]}],h:[{h:[St,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[St,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[St,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[St,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ni,Si]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Yy]}],"font-family":[{font:[Pu]}],"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",St]}],"line-clamp":[{"line-clamp":["none",Dl,Yy]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ks,St]}],"list-image":[{"list-image":["none",St]}],"list-style-type":[{list:["none","disc","decimal",St]}],"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:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ks,Si]}],"underline-offset":[{"underline-offset":["auto",ks,St]}],"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:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",St]}],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",St]}],"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(),iq]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",sq]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},lq]}],"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:[...Q(),"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:Q()}],"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:["",...Q()]}],"outline-offset":[{"outline-offset":[ks,St]}],"outline-w":[{outline:[ks,Si]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[ks,Si]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ni,cq]}],"shadow-color":[{shadow:[Pu]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...J(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":J()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",Ni,St]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[p]}],saturate:[{saturate:[_]}],sepia:[{sepia:[A]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[S]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",St]}],duration:[{duration:F()}],ease:[{ease:["linear","in","out","in-out",St]}],delay:[{delay:F()}],animate:[{animate:["none","spin","ping","pulse","bounce",St]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[P]}],"scale-x":[{"scale-x":[P]}],"scale-y":[{"scale-y":[P]}],rotate:[{rotate:[Eu,St]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[O]}],"skew-y":[{"skew-y":[O]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",St]}],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",St]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"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",St]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ks,Si,Yy]}],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"]}}},hq=YU(pq);function be(...e){return hq(jt(e))}const mq=SU,x$=v.forwardRef(({className:e,...t},n)=>s.jsx(GM,{ref:n,className:be("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}));x$.displayName=GM.displayName;const vq=$o("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"}}),b$=v.forwardRef(({className:e,variant:t,...n},r)=>s.jsx(YM,{ref:r,className:be(vq({variant:t}),e),...n}));b$.displayName=YM.displayName;const gq=v.forwardRef(({className:e,...t},n)=>s.jsx(JM,{ref:n,className:be("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}));gq.displayName=JM.displayName;const w$=v.forwardRef(({className:e,...t},n)=>s.jsx(ZM,{ref:n,className:be("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(Vs,{className:"h-4 w-4"})}));w$.displayName=ZM.displayName;const j$=v.forwardRef(({className:e,...t},n)=>s.jsx(XM,{ref:n,className:be("text-sm font-semibold",e),...t}));j$.displayName=XM.displayName;const S$=v.forwardRef(({className:e,...t},n)=>s.jsx(QM,{ref:n,className:be("text-sm opacity-90",e),...t}));S$.displayName=QM.displayName;function yq(){const{toasts:e}=A7();return s.jsxs(mq,{children:[e.map(function({id:t,title:n,description:r,action:a,...i}){return s.jsxs(b$,{...i,children:[s.jsxs("div",{className:"grid gap-1",children:[n&&s.jsx(j$,{children:n}),r&&s.jsx(S$,{children:r})]}),a,s.jsx(w$,{})]},t)}),s.jsx(x$,{})]})}var pE=["light","dark"],xq="(prefers-color-scheme: dark)",bq=v.createContext(void 0),wq={setTheme:e=>{},themes:[]},jq=()=>{var e;return(e=v.useContext(bq))!=null?e:wq};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?pE.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",y=(j,b=!1,x=!0)=>{let S=o?o[j]:j,N=b?j+"|| ''":`'${S}'`,_="";return a&&x&&!b&&pE.includes(j)&&(_+=`d.style.colorScheme = '${j}';`),n==="class"?b||S?_+=`c.add(${N})`:_+="null":S&&(_+=`d[s](n,${N})`),_},g=e?`!function(){${h}${y(e)}}()`:r?`!function(){try{${h}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${f})){var t='${xq}',m=window.matchMedia(t);if(m.media!==t||m.matches){${y("dark")}}else{${y("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${y(o?"x[e]":"e",!0)}}${f?"":"else{"+y(i,!1,!1)+"}"}${p}}catch(e){}}()`:`!function(){try{${h}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${y(o?"x[e]":"e",!0)}}else{${y(i,!1,!1)};}${p}}catch(t){}}();`;return v.createElement("script",{nonce:d,dangerouslySetInnerHTML:{__html:g}})});var Sq=e=>{switch(e){case"success":return _q;case"info":return Eq;case"warning":return Aq;case"error":return Pq;default:return null}},Nq=Array(12).fill(0),Cq=({visible:e,className:t})=>q.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},q.createElement("div",{className:"sonner-spinner"},Nq.map((n,r)=>q.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),_q=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},q.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"})),Aq=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},q.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"})),Eq=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},q.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"})),Pq=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},q.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"})),Oq=q.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"},q.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),q.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Rq=()=>{let[e,t]=q.useState(document.hidden);return q.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},j1=1,kq=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:j1++,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],q.isValidElement(d))a=!1,this.create({id:n,type:"default",message:d});else if(Iq(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||j1++;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 kq,Tq=(e,t)=>{let n=t?.id||j1++;return Ir.addToast({title:e,...t,id:n}),n},Iq=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Mq=Tq,$q=()=>Ir.toasts,Dq=()=>Ir.getActiveToasts();Object.assign(Mq,{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:$q,getToasts:Dq});function Lq(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))}Lq(`: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 Pp(e){return e.label!==void 0}var Fq=3,Bq="32px",zq="16px",hE=4e3,Uq=356,qq=14,Wq=20,Vq=200;function Ma(...e){return e.filter(Boolean).join(" ")}function Hq(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var Kq=e=>{var t,n,r,a,i,o,c,d,f,h,p;let{invert:y,toast:g,unstyled:j,interacting:b,setHeights:x,visibleToasts:S,heights:N,index:_,toasts:P,expanded:A,removeToast:O,defaultRichColors:R,closeButton:k,style:M,cancelButtonStyle:z,actionButtonStyle:B,className:L="",descriptionClassName:G="",duration:U,position:H,gap:Q,loadingIcon:J,expandByDefault:T,classNames:D,icons:X,closeButtonAriaLabel:F="Close toast",pauseWhenPageIsHidden:$}=e,[ee,ae]=q.useState(null),[K,le]=q.useState(null),[te,de]=q.useState(!1),[oe,pe]=q.useState(!1),[je,se]=q.useState(!1),[$e,Ae]=q.useState(!1),[Ye,ye]=q.useState(!1),[Se,ze]=q.useState(0),[ct,Z]=q.useState(0),Ne=q.useRef(g.duration||U||hE),Ie=q.useRef(null),Re=q.useRef(null),De=_===0,he=_+1<=S,Fe=g.type,Ue=g.dismissible!==!1,Rt=g.className||"",Ht=g.descriptionClassName||"",zt=q.useMemo(()=>N.findIndex(ke=>ke.toastId===g.id)||0,[N,g.id]),$t=q.useMemo(()=>{var ke;return(ke=g.closeButton)!=null?ke:k},[g.closeButton,k]),Rn=q.useMemo(()=>g.duration||U||hE,[g.duration,U]),kn=q.useRef(0),lr=q.useRef(0),cr=q.useRef(0),Ln=q.useRef(null),[ur,_r]=H.split("-"),Lr=q.useMemo(()=>N.reduce((ke,nt,yt)=>yt>=zt?ke:ke+nt.height,0),[N,zt]),Fr=Rq(),Xn=g.invert||y,Kt=Fe==="loading";lr.current=q.useMemo(()=>zt*Q+Lr,[zt,Lr]),q.useEffect(()=>{Ne.current=Rn},[Rn]),q.useEffect(()=>{de(!0)},[]),q.useEffect(()=>{let ke=Re.current;if(ke){let nt=ke.getBoundingClientRect().height;return Z(nt),x(yt=>[{toastId:g.id,height:nt,position:g.position},...yt]),()=>x(yt=>yt.filter(Dt=>Dt.toastId!==g.id))}},[x,g.id]),q.useLayoutEffect(()=>{if(!te)return;let ke=Re.current,nt=ke.style.height;ke.style.height="auto";let yt=ke.getBoundingClientRect().height;ke.style.height=nt,Z(yt),x(Dt=>Dt.find(Yt=>Yt.toastId===g.id)?Dt.map(Yt=>Yt.toastId===g.id?{...Yt,height:yt}:Yt):[{toastId:g.id,height:yt,position:g.position},...Dt])},[te,g.title,g.description,x,g.id]);let _n=q.useCallback(()=>{pe(!0),ze(lr.current),x(ke=>ke.filter(nt=>nt.toastId!==g.id)),setTimeout(()=>{O(g)},Vq)},[g,O,x,lr]);q.useEffect(()=>{if(g.promise&&Fe==="loading"||g.duration===1/0||g.type==="loading")return;let ke;return A||b||$&&Fr?(()=>{if(cr.current<kn.current){let nt=new Date().getTime()-kn.current;Ne.current=Ne.current-nt}cr.current=new Date().getTime()})():Ne.current!==1/0&&(kn.current=new Date().getTime(),ke=setTimeout(()=>{var nt;(nt=g.onAutoClose)==null||nt.call(g,g),_n()},Ne.current)),()=>clearTimeout(ke)},[A,b,g,Fe,$,Fr,_n]),q.useEffect(()=>{g.delete&&_n()},[_n,g.delete]);function ce(){var ke,nt,yt;return X!=null&&X.loading?q.createElement("div",{className:Ma(D?.loader,(ke=g?.classNames)==null?void 0:ke.loader,"sonner-loader"),"data-visible":Fe==="loading"},X.loading):J?q.createElement("div",{className:Ma(D?.loader,(nt=g?.classNames)==null?void 0:nt.loader,"sonner-loader"),"data-visible":Fe==="loading"},J):q.createElement(Cq,{className:Ma(D?.loader,(yt=g?.classNames)==null?void 0:yt.loader),visible:Fe==="loading"})}return q.createElement("li",{tabIndex:0,ref:Re,className:Ma(L,Rt,D?.toast,(t=g?.classNames)==null?void 0:t.toast,D?.default,D?.[Fe],(n=g?.classNames)==null?void 0:n[Fe]),"data-sonner-toast":"","data-rich-colors":(r=g.richColors)!=null?r:R,"data-styled":!(g.jsx||g.unstyled||j),"data-mounted":te,"data-promise":!!g.promise,"data-swiped":Ye,"data-removed":oe,"data-visible":he,"data-y-position":ur,"data-x-position":_r,"data-index":_,"data-front":De,"data-swiping":je,"data-dismissible":Ue,"data-type":Fe,"data-invert":Xn,"data-swipe-out":$e,"data-swipe-direction":K,"data-expanded":!!(A||T&&te),style:{"--index":_,"--toasts-before":_,"--z-index":P.length-_,"--offset":`${oe?Se:lr.current}px`,"--initial-height":T?"auto":`${ct}px`,...M,...g.style},onDragEnd:()=>{se(!1),ae(null),Ln.current=null},onPointerDown:ke=>{Kt||!Ue||(Ie.current=new Date,ze(lr.current),ke.target.setPointerCapture(ke.pointerId),ke.target.tagName!=="BUTTON"&&(se(!0),Ln.current={x:ke.clientX,y:ke.clientY}))},onPointerUp:()=>{var ke,nt,yt,Dt;if($e||!Ue)return;Ln.current=null;let Yt=Number(((ke=Re.current)==null?void 0:ke.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),cn=Number(((nt=Re.current)==null?void 0:nt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),dr=new Date().getTime()-((yt=Ie.current)==null?void 0:yt.getTime()),Sn=ee==="x"?Yt:cn,Fn=Math.abs(Sn)/dr;if(Math.abs(Sn)>=Wq||Fn>.11){ze(lr.current),(Dt=g.onDismiss)==null||Dt.call(g,g),le(ee==="x"?Yt>0?"right":"left":cn>0?"down":"up"),_n(),Ae(!0),ye(!1);return}se(!1),ae(null)},onPointerMove:ke=>{var nt,yt,Dt,Yt;if(!Ln.current||!Ue||((nt=window.getSelection())==null?void 0:nt.toString().length)>0)return;let cn=ke.clientY-Ln.current.y,dr=ke.clientX-Ln.current.x,Sn=(yt=e.swipeDirections)!=null?yt:Hq(H);!ee&&(Math.abs(dr)>1||Math.abs(cn)>1)&&ae(Math.abs(dr)>Math.abs(cn)?"x":"y");let Fn={x:0,y:0};ee==="y"?(Sn.includes("top")||Sn.includes("bottom"))&&(Sn.includes("top")&&cn<0||Sn.includes("bottom")&&cn>0)&&(Fn.y=cn):ee==="x"&&(Sn.includes("left")||Sn.includes("right"))&&(Sn.includes("left")&&dr<0||Sn.includes("right")&&dr>0)&&(Fn.x=dr),(Math.abs(Fn.x)>0||Math.abs(Fn.y)>0)&&ye(!0),(Dt=Re.current)==null||Dt.style.setProperty("--swipe-amount-x",`${Fn.x}px`),(Yt=Re.current)==null||Yt.style.setProperty("--swipe-amount-y",`${Fn.y}px`)}},$t&&!g.jsx?q.createElement("button",{"aria-label":F,"data-disabled":Kt,"data-close-button":!0,onClick:Kt||!Ue?()=>{}:()=>{var ke;_n(),(ke=g.onDismiss)==null||ke.call(g,g)},className:Ma(D?.closeButton,(a=g?.classNames)==null?void 0:a.closeButton)},(i=X?.close)!=null?i:Oq):null,g.jsx||v.isValidElement(g.title)?g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title:q.createElement(q.Fragment,null,Fe||g.icon||g.promise?q.createElement("div",{"data-icon":"",className:Ma(D?.icon,(o=g?.classNames)==null?void 0:o.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||ce():null,g.type!=="loading"?g.icon||X?.[Fe]||Sq(Fe):null):null,q.createElement("div",{"data-content":"",className:Ma(D?.content,(c=g?.classNames)==null?void 0:c.content)},q.createElement("div",{"data-title":"",className:Ma(D?.title,(d=g?.classNames)==null?void 0:d.title)},typeof g.title=="function"?g.title():g.title),g.description?q.createElement("div",{"data-description":"",className:Ma(G,Ht,D?.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&&Pp(g.cancel)?q.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||z,onClick:ke=>{var nt,yt;Pp(g.cancel)&&Ue&&((yt=(nt=g.cancel).onClick)==null||yt.call(nt,ke),_n())},className:Ma(D?.cancelButton,(h=g?.classNames)==null?void 0:h.cancelButton)},g.cancel.label):null,v.isValidElement(g.action)?g.action:g.action&&Pp(g.action)?q.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||B,onClick:ke=>{var nt,yt;Pp(g.action)&&((yt=(nt=g.action).onClick)==null||yt.call(nt,ke),!ke.defaultPrevented&&_n())},className:Ma(D?.actionButton,(p=g?.classNames)==null?void 0:p.actionButton)},g.action.label):null))};function mE(){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 Gq(e,t){let n={};return[e,t].forEach((r,a)=>{let i=a===1,o=i?"--mobile-offset":"--offset",c=i?zq:Bq;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 Yq=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:y,style:g,visibleToasts:j=Fq,toastOptions:b,dir:x=mE(),gap:S=qq,loadingIcon:N,icons:_,containerAriaLabel:P="Notifications",pauseWhenPageIsHidden:A}=e,[O,R]=q.useState([]),k=q.useMemo(()=>Array.from(new Set([r].concat(O.filter($=>$.position).map($=>$.position)))),[O,r]),[M,z]=q.useState([]),[B,L]=q.useState(!1),[G,U]=q.useState(!1),[H,Q]=q.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),J=q.useRef(null),T=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),D=q.useRef(null),X=q.useRef(!1),F=q.useCallback($=>{R(ee=>{var ae;return(ae=ee.find(K=>K.id===$.id))!=null&&ae.delete||Ir.dismiss($.id),ee.filter(({id:K})=>K!==$.id)})},[]);return q.useEffect(()=>Ir.subscribe($=>{if($.dismiss){R(ee=>ee.map(ae=>ae.id===$.id?{...ae,delete:!0}:ae));return}setTimeout(()=>{OM.flushSync(()=>{R(ee=>{let ae=ee.findIndex(K=>K.id===$.id);return ae!==-1?[...ee.slice(0,ae),{...ee[ae],...$},...ee.slice(ae+1)]:[$,...ee]})})})}),[]),q.useEffect(()=>{if(h!=="system"){Q(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Q("dark"):Q("light")),typeof window>"u")return;let $=window.matchMedia("(prefers-color-scheme: dark)");try{$.addEventListener("change",({matches:ee})=>{Q(ee?"dark":"light")})}catch{$.addListener(({matches:ae})=>{try{Q(ae?"dark":"light")}catch(K){console.error(K)}})}},[h]),q.useEffect(()=>{O.length<=1&&L(!1)},[O]),q.useEffect(()=>{let $=ee=>{var ae,K;a.every(le=>ee[le]||ee.code===le)&&(L(!0),(ae=J.current)==null||ae.focus()),ee.code==="Escape"&&(document.activeElement===J.current||(K=J.current)!=null&&K.contains(document.activeElement))&&L(!1)};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[a]),q.useEffect(()=>{if(J.current)return()=>{D.current&&(D.current.focus({preventScroll:!0}),D.current=null,X.current=!1)}},[J.current]),q.createElement("section",{ref:t,"aria-label":`${P} ${T}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},k.map(($,ee)=>{var ae;let[K,le]=$.split("-");return O.length?q.createElement("ol",{key:$,dir:x==="auto"?mE():x,tabIndex:-1,ref:J,className:c,"data-sonner-toaster":!0,"data-theme":H,"data-y-position":K,"data-lifted":B&&O.length>1&&!i,"data-x-position":le,style:{"--front-toast-height":`${((ae=M[0])==null?void 0:ae.height)||0}px`,"--width":`${Uq}px`,"--gap":`${S}px`,...g,...Gq(d,f)},onBlur:te=>{X.current&&!te.currentTarget.contains(te.relatedTarget)&&(X.current=!1,D.current&&(D.current.focus({preventScroll:!0}),D.current=null))},onFocus:te=>{te.target instanceof HTMLElement&&te.target.dataset.dismissible==="false"||X.current||(X.current=!0,D.current=te.relatedTarget)},onMouseEnter:()=>L(!0),onMouseMove:()=>L(!0),onMouseLeave:()=>{G||L(!1)},onDragEnd:()=>L(!1),onPointerDown:te=>{te.target instanceof HTMLElement&&te.target.dataset.dismissible==="false"||U(!0)},onPointerUp:()=>U(!1)},O.filter(te=>!te.position&&ee===0||te.position===$).map((te,de)=>{var oe,pe;return q.createElement(Kq,{key:te.id,icons:_,index:de,toast:te,defaultRichColors:p,duration:(oe=b?.duration)!=null?oe:y,className:b?.className,descriptionClassName:b?.descriptionClassName,invert:n,visibleToasts:j,closeButton:(pe=b?.closeButton)!=null?pe:o,interacting:G,position:$,style:b?.style,unstyled:b?.unstyled,classNames:b?.classNames,cancelButtonStyle:b?.cancelButtonStyle,actionButtonStyle:b?.actionButtonStyle,removeToast:F,toasts:O.filter(je=>je.position==te.position),heights:M.filter(je=>je.position==te.position),setHeights:z,expandByDefault:i,gap:S,loadingIcon:N,expanded:B,pauseWhenPageIsHidden:A,swipeDirections:e.swipeDirections})})):null}))});const Xq=({...e})=>{const{theme:t="system"}=jq();return s.jsx(Yq,{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 Qq=Nm[" useId ".trim().toString()]||(()=>{}),Jq=0;function Hn(e){const[t,n]=v.useState(Qq());return Kn(()=>{n(r=>r??String(Jq++))},[e]),e||(t?`radix-${t}`:"")}const Zq=["top","right","bottom","left"],$i=Math.min,Xr=Math.max,oh=Math.round,Op=Math.floor,us=e=>({x:e,y:e}),e9={left:"right",right:"left",bottom:"top",top:"bottom"},t9={start:"end",end:"start"};function S1(e,t,n){return Xr(e,$i(t,n))}function Hs(e,t){return typeof e=="function"?e(t):e}function Ks(e){return e.split("-")[0]}function Pc(e){return e.split("-")[1]}function kS(e){return e==="x"?"y":"x"}function TS(e){return e==="y"?"height":"width"}const n9=new Set(["top","bottom"]);function os(e){return n9.has(Ks(e))?"y":"x"}function IS(e){return kS(os(e))}function r9(e,t,n){n===void 0&&(n=!1);const r=Pc(e),a=IS(e),i=TS(a);let o=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=lh(o)),[o,lh(o)]}function a9(e){const t=lh(e);return[N1(e),t,N1(t)]}function N1(e){return e.replace(/start|end/g,t=>t9[t])}const vE=["left","right"],gE=["right","left"],s9=["top","bottom"],i9=["bottom","top"];function o9(e,t,n){switch(e){case"top":case"bottom":return n?t?gE:vE:t?vE:gE;case"left":case"right":return t?s9:i9;default:return[]}}function l9(e,t,n,r){const a=Pc(e);let i=o9(Ks(e),n==="start",r);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map(N1)))),i}function lh(e){return e.replace(/left|right|bottom|top/g,t=>e9[t])}function c9(e){return{top:0,right:0,bottom:0,left:0,...e}}function N$(e){return typeof e!="number"?c9(e):{top:e,right:e,bottom:e,left:e}}function ch(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 yE(e,t,n){let{reference:r,floating:a}=e;const i=os(t),o=IS(t),c=TS(o),d=Ks(t),f=i==="y",h=r.x+r.width/2-a.width/2,p=r.y+r.height/2-a.height/2,y=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(Pc(t)){case"start":g[o]-=y*(n&&f?-1:1);break;case"end":g[o]+=y*(n&&f?-1:1);break}return g}async function u9(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:y=!1,padding:g=0}=Hs(t,e),j=N$(g),x=c[y?p==="floating"?"reference":"floating":p],S=ch(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:f,rootBoundary:h,strategy:d})),N=p==="floating"?{x:r,y:a,width:o.floating.width,height:o.floating.height}:o.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),P=await(i.isElement==null?void 0:i.isElement(_))?await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1}:{x:1,y:1},A=ch(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:N,offsetParent:_,strategy:d}):N);return{top:(S.top-A.top+j.top)/P.y,bottom:(A.bottom-S.bottom+j.bottom)/P.y,left:(S.left-A.left+j.left)/P.x,right:(A.right-S.right+j.right)/P.x}}const d9=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}=yE(f,r,d),y=r,g={},j=0;for(let x=0;x<c.length;x++){var b;const{name:S,fn:N}=c[x],{x:_,y:P,data:A,reset:O}=await N({x:h,y:p,initialPlacement:r,placement:y,strategy:a,middlewareData:g,rects:f,platform:{...o,detectOverflow:(b=o.detectOverflow)!=null?b:u9},elements:{reference:e,floating:t}});h=_??h,p=P??p,g={...g,[S]:{...g[S],...A}},O&&j<=50&&(j++,typeof O=="object"&&(O.placement&&(y=O.placement),O.rects&&(f=O.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:a}):O.rects),{x:h,y:p}=yE(f,y,d)),x=-1)}return{x:h,y:p,placement:y,strategy:a,middlewareData:g}},f9=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}=Hs(e,t)||{};if(f==null)return{};const p=N$(h),y={x:n,y:r},g=IS(a),j=TS(g),b=await o.getDimensions(f),x=g==="y",S=x?"top":"left",N=x?"bottom":"right",_=x?"clientHeight":"clientWidth",P=i.reference[j]+i.reference[g]-y[g]-i.floating[j],A=y[g]-i.reference[g],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(f));let R=O?O[_]:0;(!R||!await(o.isElement==null?void 0:o.isElement(O)))&&(R=c.floating[_]||i.floating[j]);const k=P/2-A/2,M=R/2-b[j]/2-1,z=$i(p[S],M),B=$i(p[N],M),L=z,G=R-b[j]-B,U=R/2-b[j]/2+k,H=S1(L,U,G),Q=!d.arrow&&Pc(a)!=null&&U!==H&&i.reference[j]/2-(U<L?z:B)-b[j]/2<0,J=Q?U<L?U-L:U-G:0;return{[g]:y[g]+J,data:{[g]:H,centerOffset:U-H-J,...Q&&{alignmentOffset:J}},reset:Q}}}),p9=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:y,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:j="none",flipAlignment:b=!0,...x}=Hs(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const S=Ks(a),N=os(c),_=Ks(c)===c,P=await(d.isRTL==null?void 0:d.isRTL(f.floating)),A=y||(_||!b?[lh(c)]:a9(c)),O=j!=="none";!y&&O&&A.push(...l9(c,b,j,P));const R=[c,...A],k=await d.detectOverflow(t,x),M=[];let z=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&M.push(k[S]),p){const U=r9(a,o,P);M.push(k[U[0]],k[U[1]])}if(z=[...z,{placement:a,overflows:M}],!M.every(U=>U<=0)){var B,L;const U=(((B=i.flip)==null?void 0:B.index)||0)+1,H=R[U];if(H&&(!(p==="alignment"?N!==os(H):!1)||z.every(T=>os(T.placement)===N?T.overflows[0]>0:!0)))return{data:{index:U,overflows:z},reset:{placement:H}};let Q=(L=z.filter(J=>J.overflows[0]<=0).sort((J,T)=>J.overflows[1]-T.overflows[1])[0])==null?void 0:L.placement;if(!Q)switch(g){case"bestFit":{var G;const J=(G=z.filter(T=>{if(O){const D=os(T.placement);return D===N||D==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(D=>D>0).reduce((D,X)=>D+X,0)]).sort((T,D)=>T[1]-D[1])[0])==null?void 0:G[0];J&&(Q=J);break}case"initialPlacement":Q=c;break}if(a!==Q)return{reset:{placement:Q}}}return{}}}};function xE(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bE(e){return Zq.some(t=>e[t]>=0)}const h9=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...i}=Hs(e,t);switch(a){case"referenceHidden":{const o=await r.detectOverflow(t,{...i,elementContext:"reference"}),c=xE(o,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:bE(c)}}}case"escaped":{const o=await r.detectOverflow(t,{...i,altBoundary:!0}),c=xE(o,n.floating);return{data:{escapedOffsets:c,escaped:bE(c)}}}default:return{}}}}},C$=new Set(["left","top"]);async function m9(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),o=Ks(n),c=Pc(n),d=os(n)==="y",f=C$.has(o)?-1:1,h=i&&d?-1:1,p=Hs(t,e);let{mainAxis:y,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:y*f}:{x:y*f,y:g*h}}const v9=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 m9(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}}}}},g9=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:N,y:_}=S;return{x:N,y:_}}},...f}=Hs(e,t),h={x:n,y:r},p=await i.detectOverflow(t,f),y=os(Ks(a)),g=kS(y);let j=h[g],b=h[y];if(o){const S=g==="y"?"top":"left",N=g==="y"?"bottom":"right",_=j+p[S],P=j-p[N];j=S1(_,j,P)}if(c){const S=y==="y"?"top":"left",N=y==="y"?"bottom":"right",_=b+p[S],P=b-p[N];b=S1(_,b,P)}const x=d.fn({...t,[g]:j,[y]:b});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[g]:o,[y]:c}}}}}},y9=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}=Hs(e,t),h={x:n,y:r},p=os(a),y=kS(p);let g=h[y],j=h[p];const b=Hs(c,t),x=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(d){const _=y==="y"?"height":"width",P=i.reference[y]-i.floating[_]+x.mainAxis,A=i.reference[y]+i.reference[_]-x.mainAxis;g<P?g=P:g>A&&(g=A)}if(f){var S,N;const _=y==="y"?"width":"height",P=C$.has(Ks(a)),A=i.reference[p]-i.floating[_]+(P&&((S=o.offset)==null?void 0:S[p])||0)+(P?0:x.crossAxis),O=i.reference[p]+i.reference[_]+(P?0:((N=o.offset)==null?void 0:N[p])||0)-(P?x.crossAxis:0);j<A?j=A:j>O&&(j=O)}return{[y]:g,[p]:j}}}},x9=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}=Hs(e,t),h=await o.detectOverflow(t,f),p=Ks(a),y=Pc(a),g=os(a)==="y",{width:j,height:b}=i.floating;let x,S;p==="top"||p==="bottom"?(x=p,S=y===(await(o.isRTL==null?void 0:o.isRTL(c.floating))?"start":"end")?"left":"right"):(S=p,x=y==="end"?"top":"bottom");const N=b-h.top-h.bottom,_=j-h.left-h.right,P=$i(b-h[x],N),A=$i(j-h[S],_),O=!t.middlewareData.shift;let R=P,k=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(k=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=N),O&&!y){const z=Xr(h.left,0),B=Xr(h.right,0),L=Xr(h.top,0),G=Xr(h.bottom,0);g?k=j-2*(z!==0||B!==0?z+B:Xr(h.left,h.right)):R=b-2*(L!==0||G!==0?L+G:Xr(h.top,h.bottom))}await d({...t,availableWidth:k,availableHeight:R});const M=await o.getDimensions(c.floating);return j!==M.width||b!==M.height?{reset:{rects:!0}}:{}}}};function Pm(){return typeof window<"u"}function Oc(e){return _$(e)?(e.nodeName||"").toLowerCase():"#document"}function na(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function gs(e){var t;return(t=(_$(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function _$(e){return Pm()?e instanceof Node||e instanceof na(e).Node:!1}function qa(e){return Pm()?e instanceof Element||e instanceof na(e).Element:!1}function hs(e){return Pm()?e instanceof HTMLElement||e instanceof na(e).HTMLElement:!1}function wE(e){return!Pm()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof na(e).ShadowRoot}const b9=new Set(["inline","contents"]);function Zd(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Wa(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!b9.has(a)}const w9=new Set(["table","td","th"]);function j9(e){return w9.has(Oc(e))}const S9=[":popover-open",":modal"];function Om(e){return S9.some(t=>{try{return e.matches(t)}catch{return!1}})}const N9=["transform","translate","scale","rotate","perspective"],C9=["transform","translate","scale","rotate","perspective","filter"],_9=["paint","layout","strict","content"];function MS(e){const t=$S(),n=qa(e)?Wa(e):e;return N9.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)||C9.some(r=>(n.willChange||"").includes(r))||_9.some(r=>(n.contain||"").includes(r))}function A9(e){let t=Di(e);for(;hs(t)&&!Yl(t);){if(MS(t))return t;if(Om(t))return null;t=Di(t)}return null}function $S(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const E9=new Set(["html","body","#document"]);function Yl(e){return E9.has(Oc(e))}function Wa(e){return na(e).getComputedStyle(e)}function Rm(e){return qa(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Di(e){if(Oc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||wE(e)&&e.host||gs(e);return wE(t)?t.host:t}function A$(e){const t=Di(e);return Yl(t)?e.ownerDocument?e.ownerDocument.body:e.body:hs(t)&&Zd(t)?t:A$(t)}function sd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=A$(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),o=na(a);if(i){const c=C1(o);return t.concat(o,o.visualViewport||[],Zd(a)?a:[],c&&n?sd(c):[])}return t.concat(a,sd(a,[],n))}function C1(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function E$(e){const t=Wa(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=hs(e),i=a?e.offsetWidth:n,o=a?e.offsetHeight:r,c=oh(n)!==i||oh(r)!==o;return c&&(n=i,r=o),{width:n,height:r,$:c}}function DS(e){return qa(e)?e:e.contextElement}function Ll(e){const t=DS(e);if(!hs(t))return us(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=E$(t);let o=(i?oh(n.width):n.width)/r,c=(i?oh(n.height):n.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!c||!Number.isFinite(c))&&(c=1),{x:o,y:c}}const P9=us(0);function P$(e){const t=na(e);return!$S()||!t.visualViewport?P9:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function O9(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==na(e)?!1:t}function So(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=DS(e);let o=us(1);t&&(r?qa(r)&&(o=Ll(r)):o=Ll(e));const c=O9(i,n,r)?P$(i):us(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 y=na(i),g=r&&qa(r)?na(r):r;let j=y,b=C1(j);for(;b&&r&&g!==j;){const x=Ll(b),S=b.getBoundingClientRect(),N=Wa(b),_=S.left+(b.clientLeft+parseFloat(N.paddingLeft))*x.x,P=S.top+(b.clientTop+parseFloat(N.paddingTop))*x.y;d*=x.x,f*=x.y,h*=x.x,p*=x.y,d+=_,f+=P,j=na(b),b=C1(j)}}return ch({width:h,height:p,x:d,y:f})}function km(e,t){const n=Rm(e).scrollLeft;return t?t.left+n:So(gs(e)).left+n}function O$(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-km(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function R9(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",o=gs(r),c=t?Om(t.floating):!1;if(r===o||c&&i)return n;let d={scrollLeft:0,scrollTop:0},f=us(1);const h=us(0),p=hs(r);if((p||!p&&!i)&&((Oc(r)!=="body"||Zd(o))&&(d=Rm(r)),hs(r))){const g=So(r);f=Ll(r),h.x=g.x+r.clientLeft,h.y=g.y+r.clientTop}const y=o&&!p&&!i?O$(o,d):us(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+h.x+y.x,y:n.y*f.y-d.scrollTop*f.y+h.y+y.y}}function k9(e){return Array.from(e.getClientRects())}function T9(e){const t=gs(e),n=Rm(e),r=e.ownerDocument.body,a=Xr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Xr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+km(e);const c=-n.scrollTop;return Wa(r).direction==="rtl"&&(o+=Xr(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:o,y:c}}const jE=25;function I9(e,t){const n=na(e),r=gs(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=$S();(!h||h&&t==="fixed")&&(c=a.offsetLeft,d=a.offsetTop)}const f=km(r);if(f<=0){const h=r.ownerDocument,p=h.body,y=getComputedStyle(p),g=h.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,j=Math.abs(r.clientWidth-p.clientWidth-g);j<=jE&&(i-=j)}else f<=jE&&(i+=f);return{width:i,height:o,x:c,y:d}}const M9=new Set(["absolute","fixed"]);function $9(e,t){const n=So(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=hs(e)?Ll(e):us(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 SE(e,t,n){let r;if(t==="viewport")r=I9(e,n);else if(t==="document")r=T9(gs(e));else if(qa(t))r=$9(t,n);else{const a=P$(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return ch(r)}function R$(e,t){const n=Di(e);return n===t||!qa(n)||Yl(n)?!1:Wa(n).position==="fixed"||R$(n,t)}function D9(e,t){const n=t.get(e);if(n)return n;let r=sd(e,[],!1).filter(c=>qa(c)&&Oc(c)!=="body"),a=null;const i=Wa(e).position==="fixed";let o=i?Di(e):e;for(;qa(o)&&!Yl(o);){const c=Wa(o),d=MS(o);!d&&c.position==="fixed"&&(a=null),(i?!d&&!a:!d&&c.position==="static"&&!!a&&M9.has(a.position)||Zd(o)&&!d&&R$(e,o))?r=r.filter(h=>h!==o):a=c,o=Di(o)}return t.set(e,r),r}function L9(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const o=[...n==="clippingAncestors"?Om(t)?[]:D9(t,this._c):[].concat(n),r],c=o[0],d=o.reduce((f,h)=>{const p=SE(t,h,a);return f.top=Xr(p.top,f.top),f.right=$i(p.right,f.right),f.bottom=$i(p.bottom,f.bottom),f.left=Xr(p.left,f.left),f},SE(t,c,a));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function F9(e){const{width:t,height:n}=E$(e);return{width:t,height:n}}function B9(e,t,n){const r=hs(t),a=gs(t),i=n==="fixed",o=So(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const d=us(0);function f(){d.x=km(a)}if(r||!r&&!i)if((Oc(t)!=="body"||Zd(a))&&(c=Rm(t)),r){const g=So(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?O$(a,c):us(0),p=o.left+c.scrollLeft-d.x-h.x,y=o.top+c.scrollTop-d.y-h.y;return{x:p,y,width:o.width,height:o.height}}function Xy(e){return Wa(e).position==="static"}function NE(e,t){if(!hs(e)||Wa(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return gs(e)===n&&(n=n.ownerDocument.body),n}function k$(e,t){const n=na(e);if(Om(e))return n;if(!hs(e)){let a=Di(e);for(;a&&!Yl(a);){if(qa(a)&&!Xy(a))return a;a=Di(a)}return n}let r=NE(e,t);for(;r&&j9(r)&&Xy(r);)r=NE(r,t);return r&&Yl(r)&&Xy(r)&&!MS(r)?n:r||A9(e)||n}const z9=async function(e){const t=this.getOffsetParent||k$,n=this.getDimensions,r=await n(e.floating);return{reference:B9(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function U9(e){return Wa(e).direction==="rtl"}const q9={convertOffsetParentRelativeRectToViewportRelativeRect:R9,getDocumentElement:gs,getClippingRect:L9,getOffsetParent:k$,getElementRects:z9,getClientRects:k9,getDimensions:F9,getScale:Ll,isElement:qa,isRTL:U9};function T$(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function W9(e,t){let n=null,r;const a=gs(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:y,height:g}=f;if(c||t(),!y||!g)return;const j=Op(p),b=Op(a.clientWidth-(h+y)),x=Op(a.clientHeight-(p+g)),S=Op(h),_={rootMargin:-j+"px "+-b+"px "+-x+"px "+-S+"px",threshold:Xr(0,$i(1,d))||1};let P=!0;function A(O){const R=O[0].intersectionRatio;if(R!==d){if(!P)return o();R?o(!1,R):r=setTimeout(()=>{o(!1,1e-7)},1e3)}R===1&&!T$(f,e.getBoundingClientRect())&&o(),P=!1}try{n=new IntersectionObserver(A,{..._,root:a.ownerDocument})}catch{n=new IntersectionObserver(A,_)}n.observe(e)}return o(!0),i}function V9(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=DS(e),h=a||i?[...f?sd(f):[],...sd(t)]:[];h.forEach(S=>{a&&S.addEventListener("scroll",n,{passive:!0}),i&&S.addEventListener("resize",n)});const p=f&&c?W9(f,n):null;let y=-1,g=null;o&&(g=new ResizeObserver(S=>{let[N]=S;N&&N.target===f&&g&&(g.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var _;(_=g)==null||_.observe(t)})),n()}),f&&!d&&g.observe(f),g.observe(t));let j,b=d?So(e):null;d&&x();function x(){const S=So(e);b&&!T$(b,S)&&n(),b=S,j=requestAnimationFrame(x)}return n(),()=>{var S;h.forEach(N=>{a&&N.removeEventListener("scroll",n),i&&N.removeEventListener("resize",n)}),p?.(),(S=g)==null||S.disconnect(),g=null,d&&cancelAnimationFrame(j)}}const H9=v9,K9=g9,G9=p9,Y9=x9,X9=h9,CE=f9,Q9=y9,J9=(e,t,n)=>{const r=new Map,a={platform:q9,...n},i={...a.platform,_c:r};return d9(e,t,{...a,platform:i})};var Z9=typeof document<"u",eW=function(){},nh=Z9?v.useLayoutEffect:eW;function uh(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(!uh(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)&&!uh(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function I$(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function _E(e,t){const n=I$(e);return Math.round(t*n)/n}function Qy(e){const t=v.useRef(e);return nh(()=>{t.current=e}),t}function tW(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}),[y,g]=v.useState(r);uh(y,r)||g(r);const[j,b]=v.useState(null),[x,S]=v.useState(null),N=v.useCallback(T=>{T!==O.current&&(O.current=T,b(T))},[]),_=v.useCallback(T=>{T!==R.current&&(R.current=T,S(T))},[]),P=i||j,A=o||x,O=v.useRef(null),R=v.useRef(null),k=v.useRef(h),M=d!=null,z=Qy(d),B=Qy(a),L=Qy(f),G=v.useCallback(()=>{if(!O.current||!R.current)return;const T={placement:t,strategy:n,middleware:y};B.current&&(T.platform=B.current),J9(O.current,R.current,T).then(D=>{const X={...D,isPositioned:L.current!==!1};U.current&&!uh(k.current,X)&&(k.current=X,_c.flushSync(()=>{p(X)}))})},[y,t,n,B,L]);nh(()=>{f===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,p(T=>({...T,isPositioned:!1})))},[f]);const U=v.useRef(!1);nh(()=>(U.current=!0,()=>{U.current=!1}),[]),nh(()=>{if(P&&(O.current=P),A&&(R.current=A),P&&A){if(z.current)return z.current(P,A,G);G()}},[P,A,G,z,M]);const H=v.useMemo(()=>({reference:O,floating:R,setReference:N,setFloating:_}),[N,_]),Q=v.useMemo(()=>({reference:P,floating:A}),[P,A]),J=v.useMemo(()=>{const T={position:n,left:0,top:0};if(!Q.floating)return T;const D=_E(Q.floating,h.x),X=_E(Q.floating,h.y);return c?{...T,transform:"translate("+D+"px, "+X+"px)",...I$(Q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:D,top:X}},[n,c,Q.floating,h.x,h.y]);return v.useMemo(()=>({...h,update:G,refs:H,elements:Q,floatingStyles:J}),[h,G,H,Q,J])}const nW=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?CE({element:r.current,padding:a}).fn(n):{}:r?CE({element:r,padding:a}).fn(n):{}}}},rW=(e,t)=>({...H9(e),options:[e,t]}),aW=(e,t)=>({...K9(e),options:[e,t]}),sW=(e,t)=>({...Q9(e),options:[e,t]}),iW=(e,t)=>({...G9(e),options:[e,t]}),oW=(e,t)=>({...Y9(e),options:[e,t]}),lW=(e,t)=>({...X9(e),options:[e,t]}),cW=(e,t)=>({...nW(e),options:[e,t]});var uW="Arrow",M$=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return s.jsx(qe.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"})})});M$.displayName=uW;var dW=M$;function Tm(e){const[t,n]=v.useState(void 0);return Kn(()=>{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 LS="Popper",[$$,Fi]=or(LS),[fW,D$]=$$(LS),L$=e=>{const{__scopePopper:t,children:n}=e,[r,a]=v.useState(null);return s.jsx(fW,{scope:t,anchor:r,onAnchorChange:a,children:n})};L$.displayName=LS;var F$="PopperAnchor",B$=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=D$(F$,n),o=v.useRef(null),c=pt(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(qe.div,{...a,ref:c})});B$.displayName=F$;var FS="PopperContent",[pW,hW]=$$(FS),z$=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:y=!1,updatePositionStrategy:g="optimized",onPlaced:j,...b}=e,x=D$(FS,n),[S,N]=v.useState(null),_=pt(t,te=>N(te)),[P,A]=v.useState(null),O=Tm(P),R=O?.width??0,k=O?.height??0,M=r+(i!=="center"?"-"+i:""),z=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},B=Array.isArray(f)?f:[f],L=B.length>0,G={padding:z,boundary:B.filter(vW),altBoundary:L},{refs:U,floatingStyles:H,placement:Q,isPositioned:J,middlewareData:T}=tW({strategy:"fixed",placement:M,whileElementsMounted:(...te)=>V9(...te,{animationFrame:g==="always"}),elements:{reference:x.anchor},middleware:[rW({mainAxis:a+k,alignmentAxis:o}),d&&aW({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?sW():void 0,...G}),d&&iW({...G}),oW({...G,apply:({elements:te,rects:de,availableWidth:oe,availableHeight:pe})=>{const{width:je,height:se}=de.reference,$e=te.floating.style;$e.setProperty("--radix-popper-available-width",`${oe}px`),$e.setProperty("--radix-popper-available-height",`${pe}px`),$e.setProperty("--radix-popper-anchor-width",`${je}px`),$e.setProperty("--radix-popper-anchor-height",`${se}px`)}}),P&&cW({element:P,padding:c}),gW({arrowWidth:R,arrowHeight:k}),y&&lW({strategy:"referenceHidden",...G})]}),[D,X]=W$(Q),F=Pn(j);Kn(()=>{J&&F?.()},[J,F]);const $=T.arrow?.x,ee=T.arrow?.y,ae=T.arrow?.centerOffset!==0,[K,le]=v.useState();return Kn(()=>{S&&le(window.getComputedStyle(S).zIndex)},[S]),s.jsx("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:J?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[T.transformOrigin?.x,T.transformOrigin?.y].join(" "),...T.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(pW,{scope:n,placedSide:D,onArrowChange:A,arrowX:$,arrowY:ee,shouldHideArrow:ae,children:s.jsx(qe.div,{"data-side":D,"data-align":X,...b,ref:_,style:{...b.style,animation:J?void 0:"none"}})})})});z$.displayName=FS;var U$="PopperArrow",mW={top:"bottom",right:"left",bottom:"top",left:"right"},q$=v.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=hW(U$,r),o=mW[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(dW,{...a,ref:n,style:{...a.style,display:"block"}})})});q$.displayName=U$;function vW(e){return e!==null}var gW=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]=W$(n),p={start:"0%",center:"50%",end:"100%"}[h],y=(a.arrow?.x??0)+c/2,g=(a.arrow?.y??0)+d/2;let j="",b="";return f==="bottom"?(j=o?p:`${y}px`,b=`${-d}px`):f==="top"?(j=o?p:`${y}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 W$(e){const[t,n="center"]=e.split("-");return[t,n]}var Im=L$,ef=B$,Mm=z$,$m=q$,yW=Symbol("radix.slottable");function xW(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=yW,t}var[Dm]=or("Tooltip",[Fi]),Lm=Fi(),V$="TooltipProvider",bW=700,_1="tooltip.open",[wW,BS]=Dm(V$),H$=e=>{const{__scopeTooltip:t,delayDuration:n=bW,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(wW,{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})};H$.displayName=V$;var id="Tooltip",[jW,Fm]=Dm(id),K$=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:i,disableHoverableContent:o,delayDuration:c}=e,d=BS(id,e.__scopeTooltip),f=Lm(t),[h,p]=v.useState(null),y=Hn(),g=v.useRef(0),j=o??d.disableHoverableContent,b=c??d.delayDuration,x=v.useRef(!1),[S,N]=sa({prop:r,defaultProp:a??!1,onChange:R=>{R?(d.onOpen(),document.dispatchEvent(new CustomEvent(_1))):d.onClose(),i?.(R)},caller:id}),_=v.useMemo(()=>S?x.current?"delayed-open":"instant-open":"closed",[S]),P=v.useCallback(()=>{window.clearTimeout(g.current),g.current=0,x.current=!1,N(!0)},[N]),A=v.useCallback(()=>{window.clearTimeout(g.current),g.current=0,N(!1)},[N]),O=v.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{x.current=!0,N(!0),g.current=0},b)},[b,N]);return v.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),s.jsx(Im,{...f,children:s.jsx(jW,{scope:t,contentId:y,open:S,stateAttribute:_,trigger:h,onTriggerChange:p,onTriggerEnter:v.useCallback(()=>{d.isOpenDelayedRef.current?O():P()},[d.isOpenDelayedRef,O,P]),onTriggerLeave:v.useCallback(()=>{j?A():(window.clearTimeout(g.current),g.current=0)},[A,j]),onOpen:P,onClose:A,disableHoverableContent:j,children:n})})};K$.displayName=id;var A1="TooltipTrigger",G$=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Fm(A1,n),i=BS(A1,n),o=Lm(n),c=v.useRef(null),d=pt(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(ef,{asChild:!0,...o,children:s.jsx(qe.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:d,onPointerMove:Ee(e.onPointerMove,y=>{y.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),h.current=!0)}),onPointerLeave:Ee(e.onPointerLeave,()=>{a.onTriggerLeave(),h.current=!1}),onPointerDown:Ee(e.onPointerDown,()=>{a.open&&a.onClose(),f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Ee(e.onFocus,()=>{f.current||a.onOpen()}),onBlur:Ee(e.onBlur,a.onClose),onClick:Ee(e.onClick,a.onClose)})})});G$.displayName=A1;var SW="TooltipPortal",[Age,NW]=Dm(SW,{forceMount:void 0}),Xl="TooltipContent",Y$=v.forwardRef((e,t)=>{const n=NW(Xl,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...i}=e,o=Fm(Xl,e.__scopeTooltip);return s.jsx(Gn,{present:r||o.open,children:o.disableHoverableContent?s.jsx(X$,{side:a,...i,ref:t}):s.jsx(CW,{side:a,...i,ref:t})})}),CW=v.forwardRef((e,t)=>{const n=Fm(Xl,e.__scopeTooltip),r=BS(Xl,e.__scopeTooltip),a=v.useRef(null),i=pt(t,a),[o,c]=v.useState(null),{trigger:d,onClose:f}=n,h=a.current,{onPointerInTransitChange:p}=r,y=v.useCallback(()=>{c(null),p(!1)},[p]),g=v.useCallback((j,b)=>{const x=j.currentTarget,S={x:j.clientX,y:j.clientY},N=OW(S,x.getBoundingClientRect()),_=RW(S,N),P=kW(b.getBoundingClientRect()),A=IW([..._,...P]);c(A),p(!0)},[p]);return v.useEffect(()=>()=>y(),[y]),v.useEffect(()=>{if(d&&h){const j=x=>g(x,h),b=x=>g(x,d);return d.addEventListener("pointerleave",j),h.addEventListener("pointerleave",b),()=>{d.removeEventListener("pointerleave",j),h.removeEventListener("pointerleave",b)}}},[d,h,g,y]),v.useEffect(()=>{if(o){const j=b=>{const x=b.target,S={x:b.clientX,y:b.clientY},N=d?.contains(x)||h?.contains(x),_=!TW(S,o);N?y():_&&(y(),f())};return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[d,h,o,f,y]),s.jsx(X$,{...e,ref:i})}),[_W,AW]=Dm(id,{isInside:!1}),EW=xW("TooltipContent"),X$=v.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:o,...c}=e,d=Fm(Xl,n),f=Lm(n),{onClose:h}=d;return v.useEffect(()=>(document.addEventListener(_1,h),()=>document.removeEventListener(_1,h)),[h]),v.useEffect(()=>{if(d.trigger){const p=y=>{y.target?.contains(d.trigger)&&h()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[d.trigger,h]),s.jsx(Mo,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:p=>p.preventDefault(),onDismiss:h,children:s.jsxs(Mm,{"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(EW,{children:r}),s.jsx(_W,{scope:n,isInside:!0,children:s.jsx(sU,{id:d.contentId,role:"tooltip",children:a||r})})]})})});Y$.displayName=Xl;var Q$="TooltipArrow",PW=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Lm(n);return AW(Q$,n).isInside?null:s.jsx($m,{...a,...r,ref:t})});PW.displayName=Q$;function OW(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 RW(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 kW(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 TW(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,y=d.y;h>r!=y>r&&n<(p-f)*(r-h)/(y-h)+f&&(a=!a)}return a}function IW(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),MW(t)}function MW(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 $W=H$,DW=K$,LW=G$,J$=Y$;const Z$=$W,eD=DW,tD=LW,zS=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(J$,{ref:r,sideOffset:t,className:be("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}));zS.displayName=J$.displayName;var Bm=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(){}},FW={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},BW=class{#e=FW;#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)}},E1=new BW;function zW(e){setTimeout(e,0)}var zm=typeof window>"u"||"Deno"in globalThis;function La(){}function UW(e,t){return typeof e=="function"?e(t):e}function qW(e){return typeof e=="number"&&e>=0&&e!==1/0}function WW(e,t){return Math.max(e+(t||0)-Date.now(),0)}function P1(e,t){return typeof e=="function"?e(t):e}function VW(e,t){return typeof e=="function"?e(t):e}function AE(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:i,queryKey:o,stale:c}=e;if(o){if(r){if(t.queryHash!==US(o,t.options))return!1}else if(!ld(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 EE(e,t){const{exact:n,status:r,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(od(t.options.mutationKey)!==od(i))return!1}else if(!ld(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function US(e,t){return(t?.queryKeyHashFn||od)(e)}function od(e){return JSON.stringify(e,(t,n)=>O1(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function ld(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>ld(e[n],t[n])):!1}var HW=Object.prototype.hasOwnProperty;function nD(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=PE(e)&&PE(t);if(!r&&!(O1(e)&&O1(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],y=e[p],g=t[p];if(y===g){d[p]=y,(r?h<i:HW.call(e,p))&&f++;continue}if(y===null||g===null||typeof y!="object"||typeof g!="object"){d[p]=g;continue}const j=nD(y,g,n+1);d[p]=j,j===y&&f++}return i===c&&f===i?e:d}function PE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function O1(e){if(!OE(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!OE(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function OE(e){return Object.prototype.toString.call(e)==="[object Object]"}function KW(e){return new Promise(t=>{E1.setTimeout(t,e)})}function GW(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?nD(e,t):t}function YW(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function XW(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var qS=Symbol();function rD(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===qS?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function QW(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 JW=class extends Bm{#e;#n;#t;constructor(){super(),this.#t=e=>{if(!zm&&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"}},aD=new JW;function ZW(){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 eV=zW;function tV(){let e=[],t=0,n=c=>{c()},r=c=>{c()},a=eV;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 br=tV(),nV=class extends Bm{#e=!0;#n;#t;constructor(){super(),this.#t=e=>{if(!zm&&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}},dh=new nV;function rV(e){return Math.min(1e3*2**e,3e4)}function sD(e){return(e??"online")==="online"?dh.isOnline():!0}var R1=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function iD(e){let t=!1,n=0,r;const a=ZW(),i=()=>a.status!=="pending",o=b=>{if(!i()){const x=new R1(b);y(x),e.onCancel?.(x)}},c=()=>{t=!0},d=()=>{t=!1},f=()=>aD.isFocused()&&(e.networkMode==="always"||dh.isOnline())&&e.canRun(),h=()=>sD(e.networkMode)&&e.canRun(),p=b=>{i()||(r?.(),a.resolve(b))},y=b=>{i()||(r?.(),a.reject(b))},g=()=>new Promise(b=>{r=x=>{(i()||f())&&b(x)},e.onPause?.()}).then(()=>{r=void 0,i()||e.onContinue?.()}),j=()=>{if(i())return;let b;const x=n===0?e.initialPromise:void 0;try{b=x??e.fn()}catch(S){b=Promise.reject(S)}Promise.resolve(b).then(p).catch(S=>{if(i())return;const N=e.retry??(zm?0:3),_=e.retryDelay??rV,P=typeof _=="function"?_(n,S):_,A=N===!0||typeof N=="number"&&n<N||typeof N=="function"&&N(n,S);if(t||!A){y(S);return}n++,e.onFail?.(n,S),KW(P).then(()=>f()?void 0:g()).then(()=>{t?y(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 oD=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),qW(this.gcTime)&&(this.#e=E1.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(zm?1/0:300*1e3))}clearGcTimeout(){this.#e&&(E1.clearTimeout(this.#e),this.#e=void 0)}},aV=class extends oD{#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=kE(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=kE(this.options);t.data!==void 0&&(this.setState(RE(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#t.remove(this)}setData(e,t){const n=GW(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(La).catch(La):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>VW(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===qS||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>P1(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:!WW(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=rD(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=iD({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:c=>{c instanceof R1&&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 R1){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,...sV(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...RE(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),br.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#t.notify({query:this,type:"updated",action:e})})}};function sV(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:sD(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function RE(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function kE(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 TE(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=>{QW(j,()=>t.signal,()=>h=!0)},y=rD(t.options,t.fetchOptions),g=async(j,b,x)=>{if(h)return Promise.reject();if(b==null&&j.pages.length)return Promise.resolve(j);const N=(()=>{const O={client:t.client,queryKey:t.queryKey,pageParam:b,direction:x?"backward":"forward",meta:t.options.meta};return p(O),O})(),_=await y(N),{maxPages:P}=t.options,A=x?XW:YW;return{pages:A(j.pages,_,P),pageParams:A(j.pageParams,b,P)}};if(a&&i.length){const j=a==="backward",b=j?iV:IE,x={pages:i,pageParams:o},S=b(r,x);c=await g(x,S,j)}else{const j=e??i.length;do{const b=d===0?o[0]??r.initialPageParam:IE(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 IE(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 iV(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var oV=class extends oD{#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||lV(),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=iD({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),br.batch(()=>{this.#n.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function lV(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var cV=class extends Bm{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 oV({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=Rp(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=Rp(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=Rp(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=Rp(e);return typeof t=="string"?this.#n.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){br.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=>EE(t,n))}findAll(e={}){return this.getAll().filter(t=>EE(e,t))}notify(e){br.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return br.batch(()=>Promise.all(e.map(t=>t.continue().catch(La))))}};function Rp(e){return e.options.scope?.id}var uV=class extends Bm{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,a=t.queryHash??US(r,t);let i=this.get(a);return i||(i=new aV({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(){br.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=>AE(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>AE(e,n)):t}notify(e){br.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){br.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){br.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},dV=class{#e;#n;#t;#a;#r;#i;#o;#s;constructor(e={}){this.#e=e.queryCache||new uV,this.#n=e.mutationCache||new cV,this.#t=e.defaultOptions||{},this.#a=new Map,this.#r=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=aD.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=dh.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(P1(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=UW(t,i);if(o!==void 0)return this.#e.build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return br.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;br.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return br.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=br.batch(()=>this.#e.findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(La).catch(La)}invalidateQueries(e,t={}){return br.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=br.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(La)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(La)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(P1(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(La).catch(La)}fetchInfiniteQuery(e){return e.behavior=TE(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(La).catch(La)}ensureInfiniteQueryData(e){return e.behavior=TE(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return dh.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(od(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#a.values()],n={};return t.forEach(r=>{ld(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(od(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{ld(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=US(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===qS&&(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()}},fV=v.createContext(void 0),pV=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(fV.Provider,{value:e,children:t}));function cd(){return cd=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},cd.apply(this,arguments)}var Pi;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Pi||(Pi={}));const ME="popstate";function hV(e){e===void 0&&(e={});function t(r,a){let{pathname:i,search:o,hash:c}=r.location;return k1("",{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:fh(a)}return vV(t,n,null,e)}function jn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function WS(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function mV(){return Math.random().toString(36).substr(2,8)}function $E(e,t){return{usr:e.state,key:e.key,idx:t}}function k1(e,t,n,r){return n===void 0&&(n=null),cd({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Rc(t):t,{state:n,key:t&&t.key||r||mV()})}function fh(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 Rc(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 vV(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:i=!1}=r,o=a.history,c=Pi.Pop,d=null,f=h();f==null&&(f=0,o.replaceState(cd({},o.state,{idx:f}),""));function h(){return(o.state||{idx:null}).idx}function p(){c=Pi.Pop;let x=h(),S=x==null?null:x-f;f=x,d&&d({action:c,location:b.location,delta:S})}function y(x,S){c=Pi.Push;let N=k1(b.location,x,S);f=h()+1;let _=$E(N,f),P=b.createHref(N);try{o.pushState(_,"",P)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;a.location.assign(P)}i&&d&&d({action:c,location:b.location,delta:1})}function g(x,S){c=Pi.Replace;let N=k1(b.location,x,S);f=h();let _=$E(N,f),P=b.createHref(N);o.replaceState(_,"",P),i&&d&&d({action:c,location:b.location,delta:0})}function j(x){let S=a.location.origin!=="null"?a.location.origin:a.location.href,N=typeof x=="string"?x:fh(x);return N=N.replace(/ $/,"%20"),jn(S,"No window.location.(origin|href) available to create URL for href: "+N),new URL(N,S)}let b={get action(){return c},get location(){return e(a,o)},listen(x){if(d)throw new Error("A history only accepts one active listener");return a.addEventListener(ME,p),d=x,()=>{a.removeEventListener(ME,p),d=null}},createHref(x){return t(a,x)},createURL:j,encodeLocation(x){let S=j(x);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:y,replace:g,go(x){return o.go(x)}};return b}var DE;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(DE||(DE={}));function gV(e,t,n){return n===void 0&&(n="/"),yV(e,t,n)}function yV(e,t,n,r){let a=typeof t=="string"?Rc(t):t,i=Ql(a.pathname||"/",n);if(i==null)return null;let o=lD(e);xV(o);let c=null;for(let d=0;c==null&&d<o.length;++d){let f=OV(i);c=EV(o[d],f)}return c}function lD(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=Ri([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+'".')),lD(i.children,t,h,f)),!(i.path==null&&!i.index)&&t.push({path:f,score:_V(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 cD(i.path))a(i,o,d)}),t}function cD(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=cD(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 xV(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:AV(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const bV=/^:[\w-]+$/,wV=3,jV=2,SV=1,NV=10,CV=-2,LE=e=>e==="*";function _V(e,t){let n=e.split("/"),r=n.length;return n.some(LE)&&(r+=CV),t&&(r+=jV),n.filter(a=>!LE(a)).reduce((a,i)=>a+(bV.test(i)?wV:i===""?SV:NV),r)}function AV(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 EV(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=Jt({path:d.relativePath,caseSensitive:d.caseSensitive,end:f},h),y=d.route;if(!p)return null;Object.assign(a,p.params),o.push({params:a,pathname:Ri([i,p.pathname]),pathnameBase:MV(Ri([i,p.pathnameBase])),route:y}),p.pathnameBase!=="/"&&(i=Ri([i,p.pathnameBase]))}return o}function Jt(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=PV(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:y,isOptional:g}=h;if(y==="*"){let b=c[p]||"";o=i.slice(0,i.length-b.length).replace(/(.)\/+$/,"$1")}const j=c[p];return g&&!j?f[y]=void 0:f[y]=(j||"").replace(/%2F/g,"/"),f},{}),pathname:i,pathnameBase:o,pattern:e}}function PV(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),WS(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 OV(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return WS(!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 Ql(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 RV=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,kV=e=>RV.test(e);function TV(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Rc(e):e,i;if(n)if(kV(n))i=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),WS(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?i=FE(n.substring(1),"/"):i=FE(n,t)}else i=t;return{pathname:i,search:$V(r),hash:DV(a)}}function FE(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 Jy(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 IV(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function VS(e,t){let n=IV(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function HS(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=Rc(e):(a=cd({},e),jn(!a.pathname||!a.pathname.includes("?"),Jy("?","pathname","search",a)),jn(!a.pathname||!a.pathname.includes("#"),Jy("#","pathname","hash",a)),jn(!a.search||!a.search.includes("#"),Jy("#","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 y=o.split("/");for(;y[0]==="..";)y.shift(),p-=1;a.pathname=y.join("/")}c=p>=0?t[p]:"/"}let d=TV(a,c),f=o&&o!=="/"&&o.endsWith("/"),h=(i||o===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(f||h)&&(d.pathname+="/"),d}const Ri=e=>e.join("/").replace(/\/\/+/g,"/"),MV=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),$V=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,DV=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function LV(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const uD=["post","put","patch","delete"];new Set(uD);const FV=["get",...uD];new Set(FV);function ud(){return ud=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},ud.apply(this,arguments)}const Um=v.createContext(null),dD=v.createContext(null),Qs=v.createContext(null),qm=v.createContext(null),ys=v.createContext({outlet:null,matches:[],isDataRoute:!1}),fD=v.createContext(null);function BV(e,t){let{relative:n}=t===void 0?{}:t;kc()||jn(!1);let{basename:r,navigator:a}=v.useContext(Qs),{hash:i,pathname:o,search:c}=Wm(e,{relative:n}),d=o;return r!=="/"&&(d=o==="/"?r:Ri([r,o])),a.createHref({pathname:d,search:c,hash:i})}function kc(){return v.useContext(qm)!=null}function xs(){return kc()||jn(!1),v.useContext(qm).location}function pD(e){v.useContext(Qs).static||v.useLayoutEffect(e)}function _a(){let{isDataRoute:e}=v.useContext(ys);return e?tH():zV()}function zV(){kc()||jn(!1);let e=v.useContext(Um),{basename:t,future:n,navigator:r}=v.useContext(Qs),{matches:a}=v.useContext(ys),{pathname:i}=xs(),o=JSON.stringify(VS(a,n.v7_relativeSplatPath)),c=v.useRef(!1);return pD(()=>{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=HS(f,JSON.parse(o),i,h.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Ri([t,p.pathname])),(h.replace?r.replace:r.push)(p,h.state,h)},[t,r,o,i,e])}const UV=v.createContext(null);function qV(e){let t=v.useContext(ys).outlet;return t&&v.createElement(UV.Provider,{value:e},t)}function Do(){let{matches:e}=v.useContext(ys),t=e[e.length-1];return t?t.params:{}}function Wm(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=v.useContext(Qs),{matches:a}=v.useContext(ys),{pathname:i}=xs(),o=JSON.stringify(VS(a,r.v7_relativeSplatPath));return v.useMemo(()=>HS(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function WV(e,t){return VV(e,t)}function VV(e,t,n,r){kc()||jn(!1);let{navigator:a}=v.useContext(Qs),{matches:i}=v.useContext(ys),o=i[i.length-1],c=o?o.params:{};o&&o.pathname;let d=o?o.pathnameBase:"/";o&&o.route;let f=xs(),h;if(t){var p;let x=typeof t=="string"?Rc(t):t;d==="/"||(p=x.pathname)!=null&&p.startsWith(d)||jn(!1),h=x}else h=f;let y=h.pathname||"/",g=y;if(d!=="/"){let x=d.replace(/^\//,"").split("/");g="/"+y.replace(/^\//,"").split("/").slice(x.length).join("/")}let j=gV(e,{pathname:g}),b=XV(j&&j.map(x=>Object.assign({},x,{params:Object.assign({},c,x.params),pathname:Ri([d,a.encodeLocation?a.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?d:Ri([d,a.encodeLocation?a.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),i,n,r);return t&&b?v.createElement(qm.Provider,{value:{location:ud({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:Pi.Pop}},b):b}function HV(){let e=eH(),t=LV(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 KV=v.createElement(HV,null);class GV 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(ys.Provider,{value:this.props.routeContext},v.createElement(fD.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function YV(e){let{routeContext:t,match:n,children:r}=e,a=v.useContext(Um);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(ys.Provider,{value:t},r)}function XV(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:y,errors:g}=n,j=p.route.loader&&y[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,y)=>{let g,j=!1,b=null,x=null;n&&(g=c&&p.route.id?c[p.route.id]:void 0,b=p.route.errorElement||KV,d&&(f<0&&y===0?(nH("route-fallback"),j=!0,x=null):f===y&&(j=!0,x=p.route.hydrateFallbackElement||null)));let S=t.concat(o.slice(0,y+1)),N=()=>{let _;return g?_=b:j?_=x:p.route.Component?_=v.createElement(p.route.Component,null):p.route.element?_=p.route.element:_=h,v.createElement(YV,{match:p,routeContext:{outlet:h,matches:S,isDataRoute:n!=null},children:_})};return n&&(p.route.ErrorBoundary||p.route.errorElement||y===0)?v.createElement(GV,{location:n.location,revalidation:n.revalidation,component:b,error:g,children:N(),routeContext:{outlet:null,matches:S,isDataRoute:!0}}):N()},null)}var hD=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(hD||{}),mD=(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})(mD||{});function QV(e){let t=v.useContext(Um);return t||jn(!1),t}function JV(e){let t=v.useContext(dD);return t||jn(!1),t}function ZV(e){let t=v.useContext(ys);return t||jn(!1),t}function vD(e){let t=ZV(),n=t.matches[t.matches.length-1];return n.route.id||jn(!1),n.route.id}function eH(){var e;let t=v.useContext(fD),n=JV(),r=vD();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function tH(){let{router:e}=QV(hD.UseNavigateStable),t=vD(mD.UseNavigateStable),n=v.useRef(!1);return pD(()=>{n.current=!0}),v.useCallback(function(a,i){i===void 0&&(i={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,ud({fromRouteId:t},i)))},[e,t])}const BE={};function nH(e,t,n){BE[e]||(BE[e]=!0)}function rH(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function gD(e){let{to:t,replace:n,state:r,relative:a}=e;kc()||jn(!1);let{future:i,static:o}=v.useContext(Qs),{matches:c}=v.useContext(ys),{pathname:d}=xs(),f=_a(),h=HS(t,VS(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 zE(e){return qV(e.context)}function Qt(e){jn(!1)}function aH(e){let{basename:t="/",children:n=null,location:r,navigationType:a=Pi.Pop,navigator:i,static:o=!1,future:c}=e;kc()&&jn(!1);let d=t.replace(/^\/*/,"/"),f=v.useMemo(()=>({basename:d,navigator:i,static:o,future:ud({v7_relativeSplatPath:!1},c)}),[d,c,i,o]);typeof r=="string"&&(r=Rc(r));let{pathname:h="/",search:p="",hash:y="",state:g=null,key:j="default"}=r,b=v.useMemo(()=>{let x=Ql(h,d);return x==null?null:{location:{pathname:x,search:p,hash:y,state:g,key:j},navigationType:a}},[d,h,p,y,g,j,a]);return b==null?null:v.createElement(Qs.Provider,{value:f},v.createElement(qm.Provider,{children:n,value:b}))}function sH(e){let{children:t,location:n}=e;return WV(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!==Qt&&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 ph(){return ph=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},ph.apply(this,arguments)}function yD(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 iH(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function oH(e,t){return e.button===0&&(!t||t==="_self")&&!iH(e)}function I1(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 lH(e,t){let n=I1(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(i=>{n.append(a,i)})}),n}const cH=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],uH=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],dH="6";try{window.__reactRouterVersion=dH}catch{}const fH=v.createContext({isTransitioning:!1}),pH="startTransition",UE=Nm[pH];function hH(e){let{basename:t,children:n,future:r,window:a}=e,i=v.useRef();i.current==null&&(i.current=hV({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&&UE?UE(()=>d(p)):d(p)},[d,f]);return v.useLayoutEffect(()=>o.listen(h),[o,h]),v.useEffect(()=>rH(r),[r]),v.createElement(aH,{basename:t,children:n,location:c.location,navigationType:c.action,navigator:o,future:r})}const mH=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",vH=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,xt=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,y=yD(t,cH),{basename:g}=v.useContext(Qs),j,b=!1;if(typeof f=="string"&&vH.test(f)&&(j=f,mH))try{let _=new URL(window.location.href),P=f.startsWith("//")?new URL(_.protocol+f):new URL(f),A=Ql(P.pathname,g);P.origin===_.origin&&A!=null?f=A+P.search+P.hash:b=!0}catch{}let x=BV(f,{relative:a}),S=xH(f,{replace:o,state:c,target:d,preventScrollReset:h,relative:a,viewTransition:p});function N(_){r&&r(_),_.defaultPrevented||S(_)}return v.createElement("a",ph({},y,{href:j||x,onClick:b||i?r:N,ref:n,target:d}))}),gH=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=yD(t,uH),y=Wm(d,{relative:p.relative}),g=xs(),j=v.useContext(dD),{navigator:b,basename:x}=v.useContext(Qs),S=j!=null&&bH(y)&&f===!0,N=b.encodeLocation?b.encodeLocation(y).pathname:y.pathname,_=g.pathname,P=j&&j.navigation&&j.navigation.location?j.navigation.location.pathname:null;a||(_=_.toLowerCase(),P=P?P.toLowerCase():null,N=N.toLowerCase()),P&&x&&(P=Ql(P,x)||P);const A=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let O=_===N||!o&&_.startsWith(N)&&_.charAt(A)==="/",R=P!=null&&(P===N||!o&&P.startsWith(N)&&P.charAt(N.length)==="/"),k={isActive:O,isPending:R,isTransitioning:S},M=O?r:void 0,z;typeof i=="function"?z=i(k):z=[i,O?"active":null,R?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let B=typeof c=="function"?c(k):c;return v.createElement(xt,ph({},p,{"aria-current":M,className:z,ref:n,style:B,to:d,viewTransition:f}),typeof h=="function"?h(k):h)});var M1;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(M1||(M1={}));var qE;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(qE||(qE={}));function yH(e){let t=v.useContext(Um);return t||jn(!1),t}function xH(e,t){let{target:n,replace:r,state:a,preventScrollReset:i,relative:o,viewTransition:c}=t===void 0?{}:t,d=_a(),f=xs(),h=Wm(e,{relative:o});return v.useCallback(p=>{if(oH(p,n)){p.preventDefault();let y=r!==void 0?r:fh(f)===fh(h);d(e,{replace:y,state:a,preventScrollReset:i,relative:o,viewTransition:c})}},[f,d,h,r,a,n,e,i,o,c])}function Tc(e){let t=v.useRef(I1(e)),n=v.useRef(!1),r=xs(),a=v.useMemo(()=>lH(r.search,n.current?null:t.current),[r.search]),i=_a(),o=v.useCallback((c,d)=>{const f=I1(typeof c=="function"?c(a):c);n.current=!0,i("?"+f,d)},[i,a]);return[a,o]}function bH(e,t){t===void 0&&(t={});let n=v.useContext(fH);n==null&&jn(!1);let{basename:r}=yH(M1.useViewTransitionState),a=Wm(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=Ql(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Ql(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Jt(a.pathname,o)!=null||Jt(a.pathname,i)!=null}var wH=Symbol.for("react.lazy"),hh=Nm[" use ".trim().toString()];function jH(e){return typeof e=="object"&&e!==null&&"then"in e}function xD(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===wH&&"_payload"in e&&jH(e._payload)}function Vm(e){const t=SH(e),n=v.forwardRef((r,a)=>{let{children:i,...o}=r;xD(i)&&typeof hh=="function"&&(i=hh(i._payload));const c=v.Children.toArray(i),d=c.find(CH);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 Bi=Vm("Slot");function SH(e){const t=v.forwardRef((n,r)=>{let{children:a,...i}=n;if(xD(a)&&typeof hh=="function"&&(a=hh(a._payload)),v.isValidElement(a)){const o=AH(a),c=_H(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Nr(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 NH=Symbol("radix.slottable");function CH(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===NH}function _H(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 AH(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 Zy=768;function EH(){const[e,t]=v.useState(void 0);return v.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Zy-1}px)`),r=()=>{t(window.innerWidth<Zy)};return n.addEventListener("change",r),t(window.innerWidth<Zy),()=>n.removeEventListener("change",r)},[]),!!e}const KS=$o("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"}}),ie=v.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},i)=>{const o=r?Bi:"button";return s.jsx(o,{className:be(KS({variant:t,size:n,className:e})),ref:i,...a})});ie.displayName="Button";const vt=v.forwardRef(({className:e,type:t,...n},r)=>s.jsx("input",{type:t,className:be("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));vt.displayName="Input";var PH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],OH=PH.reduce((e,t)=>{const n=Vm(`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}},{}),RH="Separator",WE="horizontal",kH=["horizontal","vertical"],bD=v.forwardRef((e,t)=>{const{decorative:n,orientation:r=WE,...a}=e,i=TH(r)?r:WE,c=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return s.jsx(OH.div,{"data-orientation":i,...c,...a,ref:t})});bD.displayName=RH;function TH(e){return kH.includes(e)}var wD=bD;const jD=v.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},a)=>s.jsx(wD,{ref:a,decorative:n,orientation:t,className:be("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));jD.displayName=wD.displayName;var ex="focusScope.autoFocusOnMount",tx="focusScope.autoFocusOnUnmount",VE={bubbles:!1,cancelable:!0},IH="FocusScope",tf=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[c,d]=v.useState(null),f=Pn(a),h=Pn(i),p=v.useRef(null),y=pt(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(_){if(g.paused||!c)return;const P=_.target;c.contains(P)?p.current=P:Ci(p.current,{select:!0})},x=function(_){if(g.paused||!c)return;const P=_.relatedTarget;P!==null&&(c.contains(P)||Ci(p.current,{select:!0}))},S=function(_){if(document.activeElement===document.body)for(const A of _)A.removedNodes.length>0&&Ci(c)};document.addEventListener("focusin",b),document.addEventListener("focusout",x);const N=new MutationObserver(S);return c&&N.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",x),N.disconnect()}}},[r,c,g.paused]),v.useEffect(()=>{if(c){KE.add(g);const b=document.activeElement;if(!c.contains(b)){const S=new CustomEvent(ex,VE);c.addEventListener(ex,f),c.dispatchEvent(S),S.defaultPrevented||(MH(BH(SD(c)),{select:!0}),document.activeElement===b&&Ci(c))}return()=>{c.removeEventListener(ex,f),setTimeout(()=>{const S=new CustomEvent(tx,VE);c.addEventListener(tx,h),c.dispatchEvent(S),S.defaultPrevented||Ci(b??document.body,{select:!0}),c.removeEventListener(tx,h),KE.remove(g)},0)}}},[c,f,h,g]);const j=v.useCallback(b=>{if(!n&&!r||g.paused)return;const x=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,S=document.activeElement;if(x&&S){const N=b.currentTarget,[_,P]=$H(N);_&&P?!b.shiftKey&&S===P?(b.preventDefault(),n&&Ci(_,{select:!0})):b.shiftKey&&S===_&&(b.preventDefault(),n&&Ci(P,{select:!0})):S===N&&b.preventDefault()}},[n,r,g.paused]);return s.jsx(qe.div,{tabIndex:-1,...o,ref:y,onKeyDown:j})});tf.displayName=IH;function MH(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ci(r,{select:t}),document.activeElement!==n)return}function $H(e){const t=SD(e),n=HE(t,e),r=HE(t.reverse(),e);return[n,r]}function SD(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 HE(e,t){for(const n of e)if(!DH(n,{upTo:t}))return n}function DH(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 LH(e){return e instanceof HTMLInputElement&&"select"in e}function Ci(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&LH(e)&&t&&e.select()}}var KE=FH();function FH(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=GE(e,t),e.unshift(t)},remove(t){e=GE(e,t),e[0]?.resume()}}}function GE(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function BH(e){return e.filter(t=>t.tagName!=="A")}var nx=0;function Hm(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??YE()),document.body.insertAdjacentElement("beforeend",e[1]??YE()),nx++,()=>{nx===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),nx--}},[])}function YE(){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 is=function(){return is=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},is.apply(this,arguments)};function ND(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 rh="right-scroll-bar-position",ah="width-before-scroll-bar",UH="with-scroll-bars-hidden",qH="--removed-body-scroll-bar-size";function rx(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function WH(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 VH=typeof window<"u"?v.useLayoutEffect:v.useEffect,XE=new WeakMap;function HH(e,t){var n=WH(null,function(r){return e.forEach(function(a){return rx(a,r)})});return VH(function(){var r=XE.get(n);if(r){var a=new Set(r),i=new Set(e),o=n.current;a.forEach(function(c){i.has(c)||rx(c,null)}),i.forEach(function(c){a.has(c)||rx(c,o)})}XE.set(n,e)},[e]),n}function KH(e){return e}function GH(e,t){t===void 0&&(t=KH);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 YH(e){e===void 0&&(e={});var t=GH(null);return t.options=is({async:!0,ssr:!1},e),t}var CD=function(e){var t=e.sideCar,n=ND(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,is({},n))};CD.isSideCarExport=!0;function XH(e,t){return e.useMedium(t),CD}var _D=YH(),ax=function(){},Km=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:ax,onWheelCapture:ax,onTouchMoveCapture:ax}),a=r[0],i=r[1],o=e.forwardProps,c=e.children,d=e.className,f=e.removeScrollBar,h=e.enabled,p=e.shards,y=e.sideCar,g=e.noRelative,j=e.noIsolation,b=e.inert,x=e.allowPinchZoom,S=e.as,N=S===void 0?"div":S,_=e.gapMode,P=ND(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=y,O=HH([n,t]),R=is(is({},P),a);return v.createElement(v.Fragment,null,h&&v.createElement(A,{sideCar:_D,removeScrollBar:f,shards:p,noRelative:g,noIsolation:j,inert:b,setCallbacks:i,allowPinchZoom:!!x,lockRef:n,gapMode:_}),o?v.cloneElement(v.Children.only(c),is(is({},R),{ref:O})):v.createElement(N,is({},R,{className:d,ref:O}),c))});Km.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Km.classNames={fullWidth:ah,zeroRight:rh};var QH=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function JH(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=QH();return t&&e.setAttribute("nonce",t),e}function ZH(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function eK(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var tK=function(){var e=0,t=null;return{add:function(n){e==0&&(t=JH())&&(ZH(t,n),eK(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},nK=function(){var e=tK();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},AD=function(){var e=nK(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},rK={left:0,top:0,right:0,gap:0},sx=function(e){return parseInt(e||"",10)||0},aK=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[sx(n),sx(r),sx(a)]},sK=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return rK;var t=aK(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])}},iK=AD(),Fl="data-scroll-locked",oK=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(UH,` {
11
+ overflow: hidden `).concat(r,`;
12
+ padding-right: `).concat(c,"px ").concat(r,`;
13
+ }
14
+ body[`).concat(Fl,`] {
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(rh,` {
28
+ right: `).concat(c,"px ").concat(r,`;
29
+ }
30
+
31
+ .`).concat(ah,` {
32
+ margin-right: `).concat(c,"px ").concat(r,`;
33
+ }
34
+
35
+ .`).concat(rh," .").concat(rh,` {
36
+ right: 0 `).concat(r,`;
37
+ }
38
+
39
+ .`).concat(ah," .").concat(ah,` {
40
+ margin-right: 0 `).concat(r,`;
41
+ }
42
+
43
+ body[`).concat(Fl,`] {
44
+ `).concat(qH,": ").concat(c,`px;
45
+ }
46
+ `)},QE=function(){var e=parseInt(document.body.getAttribute(Fl)||"0",10);return isFinite(e)?e:0},lK=function(){v.useEffect(function(){return document.body.setAttribute(Fl,(QE()+1).toString()),function(){var e=QE()-1;e<=0?document.body.removeAttribute(Fl):document.body.setAttribute(Fl,e.toString())}},[])},cK=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;lK();var i=v.useMemo(function(){return sK(a)},[a]);return v.createElement(iK,{styles:oK(i,!t,a,n?"":"!important")})},$1=!1;if(typeof window<"u")try{var kp=Object.defineProperty({},"passive",{get:function(){return $1=!0,!0}});window.addEventListener("test",kp,kp),window.removeEventListener("test",kp,kp)}catch{$1=!1}var gl=$1?{passive:!1}:!1,uK=function(e){return e.tagName==="TEXTAREA"},ED=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!uK(e)&&n[t]==="visible")},dK=function(e){return ED(e,"overflowY")},fK=function(e){return ED(e,"overflowX")},JE=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=PD(e,r);if(a){var i=OD(e,r),o=i[1],c=i[2];if(o>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},pK=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},hK=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},PD=function(e,t){return e==="v"?dK(t):fK(t)},OD=function(e,t){return e==="v"?pK(t):hK(t)},mK=function(e,t){return e==="h"&&t==="rtl"?-1:1},vK=function(e,t,n,r,a){var i=mK(e,window.getComputedStyle(t).direction),o=i*r,c=n.target,d=t.contains(c),f=!1,h=o>0,p=0,y=0;do{if(!c)break;var g=OD(e,c),j=g[0],b=g[1],x=g[2],S=b-x-i*j;(j||S)&&PD(e,c)&&(p+=S,y+=j);var N=c.parentNode;c=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!d&&c!==document.body||d&&(t.contains(c)||t===c));return(h&&Math.abs(p)<1||!h&&Math.abs(y)<1)&&(f=!0),f},Tp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ZE=function(e){return[e.deltaX,e.deltaY]},eP=function(e){return e&&"current"in e?e.current:e},gK=function(e,t){return e[0]===t[0]&&e[1]===t[1]},yK=function(e){return`
47
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
48
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
49
+ `)},xK=0,yl=[];function bK(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),a=v.useState(xK++)[0],i=v.useState(AD)[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(eP),!0).filter(Boolean);return b.forEach(function(x){return x.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),b.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var c=v.useCallback(function(b,x){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!o.current.allowPinchZoom;var S=Tp(b),N=n.current,_="deltaX"in b?b.deltaX:N[0]-S[0],P="deltaY"in b?b.deltaY:N[1]-S[1],A,O=b.target,R=Math.abs(_)>Math.abs(P)?"h":"v";if("touches"in b&&R==="h"&&O.type==="range")return!1;var k=window.getSelection(),M=k&&k.anchorNode,z=M?M===O||M.contains(O):!1;if(z)return!1;var B=JE(R,O);if(!B)return!0;if(B?A=R:(A=R==="v"?"h":"v",B=JE(R,O)),!B)return!1;if(!r.current&&"changedTouches"in b&&(_||P)&&(r.current=A),!A)return!0;var L=r.current||A;return vK(L,x,b,L==="h"?_:P)},[]),d=v.useCallback(function(b){var x=b;if(!(!yl.length||yl[yl.length-1]!==i)){var S="deltaY"in x?ZE(x):Tp(x),N=t.current.filter(function(A){return A.name===x.type&&(A.target===x.target||x.target===A.shadowParent)&&gK(A.delta,S)})[0];if(N&&N.should){x.cancelable&&x.preventDefault();return}if(!N){var _=(o.current.shards||[]).map(eP).filter(Boolean).filter(function(A){return A.contains(x.target)}),P=_.length>0?c(x,_[0]):!o.current.noIsolation;P&&x.cancelable&&x.preventDefault()}}},[]),f=v.useCallback(function(b,x,S,N){var _={name:b,delta:x,target:S,should:N,shadowParent:wK(S)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(P){return P!==_})},1)},[]),h=v.useCallback(function(b){n.current=Tp(b),r.current=void 0},[]),p=v.useCallback(function(b){f(b.type,ZE(b),b.target,c(b,e.lockRef.current))},[]),y=v.useCallback(function(b){f(b.type,Tp(b),b.target,c(b,e.lockRef.current))},[]);v.useEffect(function(){return yl.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:y}),document.addEventListener("wheel",d,gl),document.addEventListener("touchmove",d,gl),document.addEventListener("touchstart",h,gl),function(){yl=yl.filter(function(b){return b!==i}),document.removeEventListener("wheel",d,gl),document.removeEventListener("touchmove",d,gl),document.removeEventListener("touchstart",h,gl)}},[]);var g=e.removeScrollBar,j=e.inert;return v.createElement(v.Fragment,null,j?v.createElement(i,{styles:yK(a)}):null,g?v.createElement(cK,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function wK(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const jK=XH(_D,bK);var nf=v.forwardRef(function(e,t){return v.createElement(Km,is({},e,{ref:t,sideCar:jK}))});nf.classNames=Km.classNames;var SK=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},xl=new WeakMap,Ip=new WeakMap,Mp={},ix=0,RD=function(e){return e&&(e.host||RD(e.parentNode))},NK=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=RD(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})},CK=function(e,t,n,r){var a=NK(t,Array.isArray(e)?e:[e]);Mp[n]||(Mp[n]=new WeakMap);var i=Mp[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(y){if(c.has(y))h(y);else try{var g=y.getAttribute(r),j=g!==null&&g!=="false",b=(xl.get(y)||0)+1,x=(i.get(y)||0)+1;xl.set(y,b),i.set(y,x),o.push(y),b===1&&j&&Ip.set(y,!0),x===1&&y.setAttribute(n,"true"),j||y.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",y,S)}})};return h(t),c.clear(),ix++,function(){o.forEach(function(p){var y=xl.get(p)-1,g=i.get(p)-1;xl.set(p,y),i.set(p,g),y||(Ip.has(p)||p.removeAttribute(r),Ip.delete(p)),g||p.removeAttribute(n)}),ix--,ix||(xl=new WeakMap,xl=new WeakMap,Ip=new WeakMap,Mp={})}},Gm=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=SK(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),CK(r,a,n,"aria-hidden")):function(){return null}};function _K(e){const t=AK(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(PK);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 AK(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=RK(a),c=OK(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Nr(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 EK=Symbol("radix.slottable");function PK(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===EK}function OK(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 RK(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 Ym="Dialog",[kD,TD]=or(Ym),[kK,Va]=kD(Ym),ID=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]=sa({prop:r,defaultProp:a??!1,onChange:i,caller:Ym});return s.jsx(kK,{scope:t,triggerRef:c,contentRef:d,contentId:Hn(),titleId:Hn(),descriptionId:Hn(),open:f,onOpenChange:h,onOpenToggle:v.useCallback(()=>h(p=>!p),[h]),modal:o,children:n})};ID.displayName=Ym;var MD="DialogTrigger",$D=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Va(MD,n),i=pt(t,a.triggerRef);return s.jsx(qe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":XS(a.open),...r,ref:i,onClick:Ee(e.onClick,a.onOpenToggle)})});$D.displayName=MD;var GS="DialogPortal",[TK,DD]=kD(GS,{forceMount:void 0}),LD=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=Va(GS,t);return s.jsx(TK,{scope:t,forceMount:n,children:v.Children.map(r,o=>s.jsx(Gn,{present:n||i.open,children:s.jsx(Ac,{asChild:!0,container:a,children:o})}))})};LD.displayName=GS;var mh="DialogOverlay",FD=v.forwardRef((e,t)=>{const n=DD(mh,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Va(mh,e.__scopeDialog);return i.modal?s.jsx(Gn,{present:r||i.open,children:s.jsx(MK,{...a,ref:t})}):null});FD.displayName=mh;var IK=_K("DialogOverlay.RemoveScroll"),MK=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Va(mh,n);return s.jsx(nf,{as:IK,allowPinchZoom:!0,shards:[a.contentRef],children:s.jsx(qe.div,{"data-state":XS(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),No="DialogContent",BD=v.forwardRef((e,t)=>{const n=DD(No,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Va(No,e.__scopeDialog);return s.jsx(Gn,{present:r||i.open,children:i.modal?s.jsx($K,{...a,ref:t}):s.jsx(DK,{...a,ref:t})})});BD.displayName=No;var $K=v.forwardRef((e,t)=>{const n=Va(No,e.__scopeDialog),r=v.useRef(null),a=pt(t,n.contentRef,r);return v.useEffect(()=>{const i=r.current;if(i)return Gm(i)},[]),s.jsx(zD,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ee(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Ee(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0;(o.button===2||c)&&i.preventDefault()}),onFocusOutside:Ee(e.onFocusOutside,i=>i.preventDefault())})}),DK=v.forwardRef((e,t)=>{const n=Va(No,e.__scopeDialog),r=v.useRef(!1),a=v.useRef(!1);return s.jsx(zD,{...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()}})}),zD=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,c=Va(No,n),d=v.useRef(null),f=pt(t,d);return Hm(),s.jsxs(s.Fragment,{children:[s.jsx(tf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(Mo,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":XS(c.open),...o,ref:f,onDismiss:()=>c.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(FK,{titleId:c.titleId}),s.jsx(zK,{contentRef:d,descriptionId:c.descriptionId})]})]})}),YS="DialogTitle",UD=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Va(YS,n);return s.jsx(qe.h2,{id:a.titleId,...r,ref:t})});UD.displayName=YS;var qD="DialogDescription",WD=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Va(qD,n);return s.jsx(qe.p,{id:a.descriptionId,...r,ref:t})});WD.displayName=qD;var VD="DialogClose",HD=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Va(VD,n);return s.jsx(qe.button,{type:"button",...r,ref:t,onClick:Ee(e.onClick,()=>a.onOpenChange(!1))})});HD.displayName=VD;function XS(e){return e?"open":"closed"}var KD="DialogTitleWarning",[LK,GD]=E7(KD,{contentName:No,titleName:YS,docsSlug:"dialog"}),FK=({titleId:e})=>{const t=GD(KD),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},BK="DialogDescriptionWarning",zK=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${GD(BK).contentName}}.`;return v.useEffect(()=>{const a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Xm=ID,UK=$D,Qm=LD,Ic=FD,Mc=BD,rf=UD,af=WD,Jm=HD;const YD=Xm,qK=Qm,XD=v.forwardRef(({className:e,...t},n)=>s.jsx(Ic,{className:be("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}));XD.displayName=Ic.displayName;const WK=$o("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"}}),QS=v.forwardRef(({side:e="right",className:t,children:n,...r},a)=>s.jsxs(qK,{children:[s.jsx(XD,{}),s.jsxs(Mc,{ref:a,className:be(WK({side:e}),t),...r,children:[n,s.jsxs(Jm,{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(Vs,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));QS.displayName=Mc.displayName;const QD=({className:e,...t})=>s.jsx("div",{className:be("flex flex-col space-y-2 text-center sm:text-left",e),...t});QD.displayName="SheetHeader";const JD=v.forwardRef(({className:e,...t},n)=>s.jsx(rf,{ref:n,className:be("text-lg font-semibold text-foreground",e),...t}));JD.displayName=rf.displayName;const VK=v.forwardRef(({className:e,...t},n)=>s.jsx(af,{ref:n,className:be("text-sm text-muted-foreground",e),...t}));VK.displayName=af.displayName;function tP({className:e,...t}){return s.jsx("div",{className:be("animate-pulse rounded-md bg-muted",e),...t})}const HK="sidebar:state",KK=3600*24*7,GK="16rem",YK="18rem",XK="3rem",QK="b",ZD=v.createContext(null);function sf(){const e=v.useContext(ZD);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const e3=v.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:a,children:i,...o},c)=>{const d=EH(),[f,h]=v.useState(!1),[p,y]=v.useState(e),g=t??p,j=v.useCallback(N=>{const _=typeof N=="function"?N(g):N;n?n(_):y(_),document.cookie=`${HK}=${_}; path=/; max-age=${KK}`},[n,g]),b=v.useCallback(()=>d?h(N=>!N):j(N=>!N),[d,j,h]);v.useEffect(()=>{const N=_=>{_.key===QK&&(_.metaKey||_.ctrlKey)&&(_.preventDefault(),b())};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[b]);const x=g?"expanded":"collapsed",S=v.useMemo(()=>({state:x,open:g,setOpen:j,isMobile:d,openMobile:f,setOpenMobile:h,toggleSidebar:b}),[x,g,j,d,f,h,b]);return s.jsx(ZD.Provider,{value:S,children:s.jsx(Z$,{delayDuration:0,children:s.jsx("div",{style:{"--sidebar-width":GK,"--sidebar-width-icon":XK,...a},className:be("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",r),ref:c,...o,children:i})})})});e3.displayName="SidebarProvider";const t3=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:be("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",r),ref:o,...i,children:a}):c?s.jsx(YD,{open:f,onOpenChange:h,...i,children:s.jsx(QS,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":YK},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:be("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:be("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})})]})});t3.displayName="Sidebar";const n3=v.forwardRef(({className:e,onClick:t,...n},r)=>{const{toggleSidebar:a}=sf();return s.jsxs(ie,{ref:r,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:be("h-7 w-7",e),onClick:i=>{t?.(i),a()},...n,children:[s.jsx(IU,{}),s.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});n3.displayName="SidebarTrigger";const JK=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:be("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})});JK.displayName="SidebarRail";const ZK=v.forwardRef(({className:e,...t},n)=>s.jsx("main",{ref:n,className:be("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}));ZK.displayName="SidebarInset";const eG=v.forwardRef(({className:e,...t},n)=>s.jsx(vt,{ref:n,"data-sidebar":"input",className:be("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));eG.displayName="SidebarInput";const r3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"header",className:be("flex flex-col gap-2 p-2",e),...t}));r3.displayName="SidebarHeader";const a3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"footer",className:be("flex flex-col gap-2 p-2",e),...t}));a3.displayName="SidebarFooter";const D1=v.forwardRef(({className:e,...t},n)=>s.jsx(jD,{ref:n,"data-sidebar":"separator",className:be("mx-2 w-auto bg-sidebar-border",e),...t}));D1.displayName="SidebarSeparator";const s3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"content",className:be("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));s3.displayName="SidebarContent";const i3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"group",className:be("relative flex w-full min-w-0 flex-col p-2",e),...t}));i3.displayName="SidebarGroup";const o3=v.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const a=t?Bi:"div";return s.jsx(a,{ref:r,"data-sidebar":"group-label",className:be("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})});o3.displayName="SidebarGroupLabel";const tG=v.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const a=t?Bi:"button";return s.jsx(a,{ref:r,"data-sidebar":"group-action",className:be("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})});tG.displayName="SidebarGroupAction";const l3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"group-content",className:be("w-full text-sm",e),...t}));l3.displayName="SidebarGroupContent";const c3=v.forwardRef(({className:e,...t},n)=>s.jsx("ul",{ref:n,"data-sidebar":"menu",className:be("flex w-full min-w-0 flex-col gap-1",e),...t}));c3.displayName="SidebarMenu";const u3=v.forwardRef(({className:e,...t},n)=>s.jsx("li",{ref:n,"data-sidebar":"menu-item",className:be("group/menu-item relative",e),...t}));u3.displayName="SidebarMenuItem";const nG=$o("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"}}),d3=v.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:a,className:i,...o},c)=>{const d=e?Bi:"button",{isMobile:f,state:h}=sf(),p=s.jsx(d,{ref:c,"data-sidebar":"menu-button","data-size":r,"data-active":t,className:be(nG({variant:n,size:r}),i),...o});return a?(typeof a=="string"&&(a={children:a}),s.jsxs(eD,{children:[s.jsx(tD,{asChild:!0,children:p}),s.jsx(zS,{side:"right",align:"center",hidden:h!=="collapsed"||f,...a})]})):p});d3.displayName="SidebarMenuButton";const rG=v.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},a)=>{const i=t?Bi:"button";return s.jsx(i,{ref:a,"data-sidebar":"menu-action",className:be("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})});rG.displayName="SidebarMenuAction";const aG=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:be("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}));aG.displayName="SidebarMenuBadge";const sG=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:be("flex h-8 items-center gap-2 rounded-md px-2",e),...n,children:[t&&s.jsx(tP,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),s.jsx(tP,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":a}})]})});sG.displayName="SidebarMenuSkeleton";const iG=v.forwardRef(({className:e,...t},n)=>s.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:be("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}));iG.displayName="SidebarMenuSub";const oG=v.forwardRef(({...e},t)=>s.jsx("li",{ref:t,...e}));oG.displayName="SidebarMenuSubItem";const lG=v.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:r,...a},i)=>{const o=e?Bi:"a";return s.jsx(o,{ref:i,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:be("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})});lG.displayName="SidebarMenuSubButton";const f3=v.forwardRef(({className:e,activeClassName:t,pendingClassName:n,to:r,...a},i)=>s.jsx(gH,{ref:i,to:r,className:({isActive:o,isPending:c})=>be(e,o&&t,c&&n),...a}));f3.displayName="NavLink";function cG({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 uG=[{title:"Home",items:[{title:"Dashboard",url:"/",icon:o$}]},{title:"Lab",items:[{title:"MCP Evaluations",url:"/mcp-evaluations",icon:i$},{title:"Analyze MCP",url:"/tool-analysis",icon:l$}]},{title:"Libraries",items:[{title:"Test Cases",url:"/libraries/test-cases",icon:s$},{title:"Servers",url:"/libraries/servers",icon:a$},{title:"Agents",url:"/libraries/agents",icon:ya}]},{title:"Execution",items:[{title:"Run Evaluation",url:"/run",icon:$l},{title:"Evaluation Results",url:"/results",icon:ad},{title:"Compare Evaluations",url:"/compare",icon:AS},{title:"MCP Analysis Results",url:"/tool-analysis-results",icon:c$},{title:"Custom Reports",url:"/markdown-reports",icon:El}]},{title:"Workspace",items:[{title:"Settings",url:"/settings",icon:PS}]}];function dG(e={version:null}){const t=e.version??null,{state:n}=sf(),r=n==="collapsed",a=xs(),i=v.useMemo(()=>uG,[]);return s.jsxs(t3,{collapsible:"icon",children:[s.jsx(r3,{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(cG,{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(D1,{className:"my-1.5"}),s.jsxs(i3,{className:r?"px-2":"px-3 py-2",children:[!r&&s.jsx(o3,{className:"px-1 pb-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-muted-foreground/90",children:o.title}),s.jsx(l3,{children:s.jsx(c3,{children:o.items.map(d=>s.jsx(u3,{children:s.jsx(d3,{asChild:!0,isActive:d.url==="/"?a.pathname==="/":a.pathname.startsWith(d.url),tooltip:d.title,children:s.jsxs(f3,{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(a3,{className:r?"px-2 py-2":"px-3 py-3",children:[s.jsx(D1,{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(RU,{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 p3=v.forwardRef(({...e},t)=>s.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));p3.displayName="Breadcrumb";const h3=v.forwardRef(({className:e,...t},n)=>s.jsx("ol",{ref:n,className:be("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));h3.displayName="BreadcrumbList";const m3=v.forwardRef(({className:e,...t},n)=>s.jsx("li",{ref:n,className:be("inline-flex items-center gap-1.5",e),...t}));m3.displayName="BreadcrumbItem";const v3=v.forwardRef(({asChild:e,className:t,...n},r)=>{const a=e?Bi:"a";return s.jsx(a,{ref:r,className:be("transition-colors hover:text-foreground",t),...n})});v3.displayName="BreadcrumbLink";const g3=v.forwardRef(({className:e,...t},n)=>s.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:be("font-normal text-foreground",e),...t}));g3.displayName="BreadcrumbPage";const y3=({children:e,className:t,...n})=>s.jsx("li",{role:"presentation","aria-hidden":"true",className:be("[&>svg]:size-3.5",t),...n,children:e??s.jsx(r$,{})});y3.displayName="BreadcrumbSeparator";function fG(e,t){return`${e}-${t+1}`}function Nl(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 x=String(p.ref||"").trim();if(!x)continue;a.set(x,x),o.push({kind:"referenced",ref:x});continue}const y=String(p.id||p.name||"").trim();if(!y)continue;const g=y;a.set(y,g);const j=p.auth?.type==="bearer"?"bearer":p.auth?.type==="oauth_client_credentials"?"api-key":p.auth?.type==="oauth_authorization_code"?"oauth2":"none",b={id:g,name:String(p.name||y),transport:"streamable-http",url:p.url,authType:j,authValue:p.auth?.type==="bearer"?p.auth.env: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 x=String(p.ref||"").trim();if(!x)continue;d.push({kind:"referenced",ref:x});continue}const y=String(p.id||p.name||"").trim();if(!y)continue;const g=y,j=p.provider==="azure_openai"?"azure":p.provider,b={id:g,name:String(p.name||y),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,y)=>{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||fG("scn",y),name:p.name||p.id||`Scenario ${y+1}`,serverIds:(()=>{if((p.servers??[]).length>0)return p.servers.map(x=>a.get(x)??x).filter(Boolean);const b=p.mcp_servers;return Array.isArray(b)?b.flatMap(x=>{if("ref"in x&&x.ref)return[String(x.ref)];if("id"in x&&x.id){const S=String(x.id);if(!a.has(S)){a.set(S,S);const N=x.auth,_=N?.type==="bearer"?"bearer":N?.type==="oauth_client_credentials"?"api-key":N?.type==="oauth_authorization_code"?"oauth2":"none";i.push({id:S,name:String(x.name||S),transport:"streamable-http",url:String(x.url||""),authType:_,authValue:N?.type==="bearer"?String(N.env||""):void 0,oauthClientId:N?.type==="oauth_authorization_code"?String(N.client_id||""):void 0,oauthClientSecret:N?.type==="oauth_authorization_code"?String(N.client_secret||""):void 0,oauthRedirectUrl:N?.type==="oauth_authorization_code"?String(N.redirect_url||""):void 0,oauthScope:(N?.type==="oauth_authorization_code"||N?.type==="oauth_client_credentials")&&String(N.scope||"")||void 0,oauthTokenUrl:N?.type==="oauth_client_credentials"?String(N.token_url||""):void 0,oauthClientIdEnv:N?.type==="oauth_client_credentials"?String(N.client_id_env||""):void 0,oauthClientSecretEnv:N?.type==="oauth_client_credentials"?String(N.client_secret_env||""):void 0,oauthAudience:N?.type==="oauth_client_credentials"&&String(N.audience||"")||void 0}),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 pG(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=Nl(t);return{servers:n.servers,agents:n.agents,scenarios:n.scenarios}}function nP(e){const t=new Map,n=g=>{const j=g.id,b=g.authType==="bearer"?{type:"bearer",env:g.authValue||"MCP_TOKEN"}: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",...b!==void 0?{auth:b}:{}}},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),x=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 N=t.get(S)??S;return i.get(N)??{ref:N}}):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:x},extract:g.extractRules.map(S=>({name:S.name,from:"final_text",regex:S.pattern}))}},y=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:y,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 hG(e){const t=Object.fromEntries((e.servers??[]).map(r=>[r.id,{...r.name&&r.name!==r.id?{name:r.name}:{},transport:"http",url:r.url||"http://localhost:3000/mcp",auth:r.authType==="bearer"?{type:"bearer",env:r.authValue||"MCP_TOKEN"}: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 mG(e,t){if(e)return`${e}::${t??""}`}function $p(e){return e.type==="text"}function vG(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 gG(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($p);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 y of d.content)y.type==="tool_result"&&(y.tool_use_id?h.set(y.tool_use_id,y):p.push(y));for(const y of c){n.push({id:`tool_call-${n.length}`,kind:"tool_call",text:rP(y.input??{}),toolName:y.name,timestamp:o.ts});const g=h.get(y.id);if(!g)continue;const j=g.content.filter($p).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(y.id)}for(const y of[...h.values(),...p]){const g=y.content.filter($p).map(j=>j.text).join(`
55
+ `);n.push({id:`tool_result-${n.length}`,kind:"tool_result",text:g,toolName:y.name,ok:!y.is_error,durationMs:y.duration_ms,timestamp:y.ts_end??d.ts})}i+=1}else for(const h of c)n.push({id:`tool_call-${n.length}`,kind:"tool_call",text:rP(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($p).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 rP(e){try{return JSON.stringify(e)}catch{return String(e)}}function aP(e,t=[]){const n=new Map;for(const a of t){const i=mG(a.scenario_id,a.agent);if(!i)continue;const o=n.get(i)??[];o.push(a),n.set(i,o)}const r=e.scenarios.map(a=>{const i=n.get(`${a.scenario_id}::${a.agent}`)??[],o=new Map;for(const h of i)o.set(h.run_index,h);const c=a.runs.map((h,p)=>{const y=o.get(h.run_index)??i[p];return{runIndex:h.run_index,passed:h.pass,toolCalls:vG(h,y),finalAnswer:h.final_text,conversation:gG(y),duration:h.tool_durations_ms.reduce((g,j)=>g+j,0),extractedValues:Object.fromEntries(Object.entries(h.extracted).map(([g,j])=>[g,String(j??"")])),failureReasons:h.failures}}),d=c.length===0?0:Math.round(c.reduce((h,p)=>h+p.duration,0)/c.length),f=c.length===0?0:c.reduce((h,p)=>h+p.toolCalls.length,0)/c.length;return{scenarioId:a.scenario_id,scenarioName:a.scenario_name||a.scenario_id,agentId:a.agent,agentName:a.agent,runs:c,passRate:a.pass_rate,avgToolCalls:f,avgDuration:d}});return{id:e.metadata.run_id,configId:"",configHash:e.metadata.config_hash,timestamp:e.metadata.timestamp,runNote:e.metadata.run_note,scenarios:r,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 yG(){return typeof window>"u"?"":window.location.port==="8685"?"http://127.0.0.1:8787":""}const Yu=yG();async function lt(e,t){const n=await fetch(`${Yu}${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 xG(e,t){const n=await fetch(`${Yu}${e}`,{...t,headers:{}});if(!n.ok){const r=await n.text();throw new Error(`Request failed (${n.status}): ${r}`)}return n.text()}const rt={health:()=>lt("/api/health"),getSettings:()=>lt("/api/settings"),updateSettings:e=>lt("/api/settings",{method:"PUT",body:JSON.stringify(e)}),listConfigs:()=>lt("/api/evals"),createConfig:(e,t)=>lt("/api/evals",{method:"POST",body:JSON.stringify({fileName:e,config:t})}),updateConfig:(e,t,n)=>lt(`/api/evals/${e}`,{method:"PUT",body:JSON.stringify({config:t,fileName:n})}),deleteConfig:e=>lt(`/api/evals/${e}`,{method:"DELETE"}),listRuns:()=>lt("/api/runs"),listMarkdownReports:()=>lt("/api/markdown-reports").then(e=>e.items),getMarkdownReport:e=>lt(`/api/markdown-reports/content?path=${encodeURIComponent(e)}`),deleteMarkdownReport:e=>lt(`/api/markdown-reports?path=${encodeURIComponent(e)}`,{method:"DELETE"}).then(()=>{}),getRun:e=>lt(`/api/runs/${e}`),deleteRun:e=>lt(`/api/runs/${e}`,{method:"DELETE"}),updateRunNote:(e,t)=>lt(`/api/runs/${encodeURIComponent(e)}/note`,{method:"PATCH",body:JSON.stringify({runNote:t??""})}).then(()=>{}),getRunTrace:e=>lt(`/api/runs/${e}/trace`),listSnapshots:()=>lt("/api/snapshots"),createSnapshotFromRun:(e,t)=>lt("/api/snapshots",{method:"POST",body:JSON.stringify({runId:e,name:t})}),getSnapshot:e=>lt(`/api/snapshots/${e}`),compareSnapshot:(e,t)=>lt(`/api/snapshots/${e}/compare`,{method:"POST",body:JSON.stringify({runId:t})}),askResultAssistant:(e,t)=>lt(`/api/runs/${encodeURIComponent(e)}/assistant`,{method:"POST",body:JSON.stringify({messages:t})}),applyResultAssistantReport:e=>lt(`/api/runs/${encodeURIComponent(e.runId)}/assistant/apply-report`,{method:"POST",body:JSON.stringify({markdown:e.markdown,outputPath:e.outputPath,overwrite:e.overwrite})}),createResultAssistantSession:e=>lt("/api/result-assistant/sessions",{method:"POST",body:JSON.stringify({runId:e})}),getResultAssistantSession:e=>lt(`/api/result-assistant/sessions/${e}`),sendResultAssistantMessage:(e,t)=>lt(`/api/result-assistant/sessions/${e}/messages`,{method:"POST",body:JSON.stringify({message:t})}),approveResultAssistantToolCall:(e,t,n)=>lt(`/api/result-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:"POST",body:JSON.stringify(n===void 0?{}:{argumentsOverride:n})}),denyResultAssistantToolCall:(e,t)=>lt(`/api/result-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:"POST",body:JSON.stringify({})}),closeResultAssistantSession:e=>lt(`/api/result-assistant/sessions/${e}`,{method:"DELETE"}).then(()=>{}),generateSnapshotEvalBaseline:(e,t,n)=>lt("/api/snapshots/generate-eval",{method:"POST",body:JSON.stringify({runId:e,configId:t,name:n})}),updateSnapshotPolicy:(e,t)=>lt(`/api/evals/${e}/snapshot-policy`,{method:"POST",body:JSON.stringify(t)}),getLibraries:()=>lt("/api/libraries"),saveLibraries:e=>lt("/api/libraries",{method:"PUT",body:JSON.stringify(e)}),startRun:e=>lt("/api/runs",{method:"POST",body:JSON.stringify(e)}),listProviderModels:e=>lt(`/api/providers/models?provider=${encodeURIComponent(e)}`),createScenarioAssistantSession:e=>lt("/api/scenario-assistant/sessions",{method:"POST",body:JSON.stringify(e)}),getScenarioAssistantSession:e=>lt(`/api/scenario-assistant/sessions/${e}`),sendScenarioAssistantMessage:(e,t)=>lt(`/api/scenario-assistant/sessions/${e}/messages`,{method:"POST",body:JSON.stringify({message:t})}),approveScenarioAssistantToolCall:(e,t)=>lt(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:"POST",body:JSON.stringify({})}),denyScenarioAssistantToolCall:(e,t)=>lt(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:"POST",body:JSON.stringify({})}),approveAllScenarioAssistantToolCalls:e=>lt(`/api/scenario-assistant/sessions/${e}/tool-calls/approve-all`,{method:"POST",body:JSON.stringify({})}),closeScenarioAssistantSession:e=>lt(`/api/scenario-assistant/sessions/${e}`,{method:"DELETE"}),discoverToolsForAnalysis:e=>lt("/api/tool-analysis/discover-tools",{method:"POST",body:JSON.stringify(e)}),startToolAnalysis:e=>lt("/api/tool-analysis/jobs",{method:"POST",body:JSON.stringify(e)}),getToolAnalysisResult:e=>lt(`/api/tool-analysis/jobs/${e}/result`),stopToolAnalysis:e=>lt(`/api/tool-analysis/jobs/${e}/stop`,{method:"POST"}),subscribeToolAnalysisJob:(e,t)=>{const n=new EventSource(`${Yu}/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:()=>lt("/api/tool-analysis-results").then(e=>e.items),getToolAnalysisSavedResult:e=>lt(`/api/tool-analysis-results/${e}`),deleteToolAnalysisSavedResult:e=>lt(`/api/tool-analysis-results/${e}`,{method:"DELETE"}).then(()=>{}),createOAuthDebuggerSession:e=>lt("/api/oauth-debugger/sessions",{method:"POST",body:JSON.stringify(e)}),getOAuthDebuggerSession:e=>lt(`/api/oauth-debugger/sessions/${e}`),startOAuthDebuggerSession:e=>lt(`/api/oauth-debugger/sessions/${e}/start`,{method:"POST",body:JSON.stringify({})}),subscribeOAuthDebuggerSession:(e,t)=>{const n=new EventSource(`${Yu}/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)=>lt(`/api/oauth-debugger/sessions/${e}/manual-callback`,{method:"POST",body:JSON.stringify(t)}),stopOAuthDebuggerSession:e=>lt(`/api/oauth-debugger/sessions/${e}/stop`,{method:"POST",body:JSON.stringify({})}),exportOAuthDebuggerSession:(e,t)=>t==="json"?lt(`/api/oauth-debugger/sessions/${e}/export?format=json`):xG(`/api/oauth-debugger/sessions/${e}/export?format=${t}`),stopRun:e=>lt(`/api/runs/jobs/${e}/stop`,{method:"POST"}),getRunQueue:()=>lt("/api/runs/queue"),removeQueuedRun:e=>lt(`/api/runs/queue/${e}`,{method:"DELETE"}).then(()=>{}),subscribeRunJob:(e,t)=>{const n=new EventSource(`${Yu}/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 bG(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 wG(e){return e||`config-${Date.now()}`}const jG={async listConfigs(){return(await rt.listConfigs()).map(Nl)},async createConfig(e){const t=await rt.createConfig(bG(e),nP(e));return Nl(t)},async updateConfig(e){const t=await rt.updateConfig(e.id,nP(e),wG(e.name));return Nl(t)},async deleteConfig(e){await rt.deleteConfig(e)},async listResults(){const t=(await rt.listRuns()).map(async n=>{const[{results:r},a]=await Promise.all([rt.getRun(n.runId),rt.getRunTrace(n.runId)]);return aP(r,a.records)});return Promise.all(t)},async getResult(e){try{const[{results:t},n]=await Promise.all([rt.getRun(e),rt.getRunTrace(e)]);return aP(t,n.records)}catch{return}},async deleteResult(e){await rt.deleteRun(e)},async updateRunNote(e,t){await rt.updateRunNote(e,t)},async listMarkdownReports(){return rt.listMarkdownReports()},async getMarkdownReport(e){return rt.getMarkdownReport(e)},async deleteMarkdownReport(e){await rt.deleteMarkdownReport(e)},async startRun(e){return rt.startRun(e)},async stopRun(e){await rt.stopRun(e)},async getRunQueue(){return rt.getRunQueue()},async removeQueuedRun(e){await rt.removeQueuedRun(e)},subscribeRunJob(e,t){return rt.subscribeRunJob(e,t)},async listSnapshots(){return rt.listSnapshots()},async createSnapshotFromRun(e,t){return rt.createSnapshotFromRun(e,t)},async getSnapshot(e){try{return await rt.getSnapshot(e)}catch{return}},async compareSnapshot(e,t){return rt.compareSnapshot(e,t)},async askResultAssistant(e,t){return rt.askResultAssistant(e,t)},async applyResultAssistantReport(e){return rt.applyResultAssistantReport(e)},async createResultAssistantSession(e){return rt.createResultAssistantSession(e)},async getResultAssistantSession(e){return rt.getResultAssistantSession(e)},async sendResultAssistantMessage(e,t){return rt.sendResultAssistantMessage(e,t)},async approveResultAssistantToolCall(e,t,n){return rt.approveResultAssistantToolCall(e,t,n)},async denyResultAssistantToolCall(e,t){return rt.denyResultAssistantToolCall(e,t)},async closeResultAssistantSession(e){await rt.closeResultAssistantSession(e)},async generateSnapshotEvalBaseline(e,t,n){const r=await rt.generateSnapshotEvalBaseline(e,t,n);return{snapshot:r.snapshot,config:Nl(r.config)}},async updateSnapshotPolicy(e,t){const n=await rt.updateSnapshotPolicy(e,t);return Nl(n)},async getLibraries(){const e=await rt.getLibraries();return pG(e)},async saveLibraries(e){await rt.saveLibraries(hG(e))},async listProviderModels(e){return rt.listProviderModels(e)},async getWorkspaceSettings(){return rt.getSettings()},async updateWorkspaceSettings(e){return rt.updateSettings(e)},async createScenarioAssistantSession(e){return rt.createScenarioAssistantSession(e)},async getScenarioAssistantSession(e){return rt.getScenarioAssistantSession(e)},async sendScenarioAssistantMessage(e,t){return rt.sendScenarioAssistantMessage(e,t)},async approveScenarioAssistantToolCall(e,t){return rt.approveScenarioAssistantToolCall(e,t)},async denyScenarioAssistantToolCall(e,t){return rt.denyScenarioAssistantToolCall(e,t)},async approveAllScenarioAssistantToolCalls(e){return rt.approveAllScenarioAssistantToolCalls(e)},async closeScenarioAssistantSession(e){await rt.closeScenarioAssistantSession(e)},async discoverToolsForAnalysis(e){return rt.discoverToolsForAnalysis(e)},async startToolAnalysis(e){return rt.startToolAnalysis(e)},subscribeToolAnalysisJob(e,t){return rt.subscribeToolAnalysisJob(e,t)},async getToolAnalysisResult(e){return rt.getToolAnalysisResult(e)},async stopToolAnalysis(e){return rt.stopToolAnalysis(e)},async listToolAnalysisResults(){return rt.listToolAnalysisResults()},async getToolAnalysisSavedResult(e){return rt.getToolAnalysisSavedResult(e)},async deleteToolAnalysisSavedResult(e){await rt.deleteToolAnalysisSavedResult(e)},async createOAuthDebuggerSession(e){return rt.createOAuthDebuggerSession(e)},async getOAuthDebuggerSession(e){return rt.getOAuthDebuggerSession(e)},async startOAuthDebuggerSession(e){return rt.startOAuthDebuggerSession(e)},subscribeOAuthDebuggerSession(e,t){return rt.subscribeOAuthDebuggerSession(e,t)},async submitOAuthDebuggerManualCallback(e,t){return rt.submitOAuthDebuggerManualCallback(e,t)},async stopOAuthDebuggerSession(e){return rt.stopOAuthDebuggerSession(e)},async exportOAuthDebuggerSession(e,t){return rt.exportOAuthDebuggerSession(e,t)}},x3=v.createContext(null);function SG({children:e}){const t="workspace",[n,r]=v.useState("checking"),[a,i]=v.useState(null);v.useEffect(()=>{r("checking"),rt.health().then(c=>{r("connected"),i(typeof c?.version=="string"?c.version:null)}).catch(()=>{r("disconnected"),i(null)})},[t]);const o=v.useMemo(()=>jG,[]);return s.jsx(x3.Provider,{value:{mode:t,connection:n,version:a,source:o},children:e})}function On(){const e=v.useContext(x3);if(!e)throw new Error("useDataSource must be used within DataSourceProvider");return e}const NG=e=>{if(e==="/")return[{label:"Dashboard"}];const t=[{label:"Dashboard",to:"/"}];if(Jt("/mcp-evaluations/:id",e))return t.push({label:"MCP Evaluations",to:"/mcp-evaluations"},{label:"MCP Evaluation"}),t;if(Jt("/mcp-evaluations",e))return t.push({label:"MCP Evaluations"}),t;if(Jt("/settings",e))return t.push({label:"Settings"}),t;if(Jt("/tool-analysis",e))return t.push({label:"Analyze MCP Tools"}),t;if(Jt("/tool-analysis-results/:id",e)){const n=Jt("/tool-analysis-results/:id",e);return t.push({label:"Tool Analysis Results",to:"/tool-analysis-results"},{label:n?.params.id??"Report"}),t}if(Jt("/tool-analysis-results",e))return t.push({label:"Tool Analysis Results"}),t;if(Jt("/markdown-reports/view",e))return t.push({label:"Markdown Reports",to:"/markdown-reports"},{label:"View Report"}),t;if(Jt("/markdown-reports",e))return t.push({label:"Markdown Reports"}),t;if(Jt("/oauth-debugger",e))return t.push({label:"OAuth Debugger"}),t;if(Jt("/results/:id",e))return t.push({label:"Evaluation Results",to:"/results"},{label:"Result"}),t;if(Jt("/results",e))return t.push({label:"Evaluation Results"}),t;if(Jt("/run",e))return t.push({label:"Run Evaluation"}),t;if(Jt("/libraries/servers/:serverId",e)){const n=Jt("/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(Jt("/libraries/servers",e))return t.push({label:"Libraries",to:"/libraries/servers"},{label:"Servers"}),t;if(Jt("/libraries/agents/:agentName",e)){const n=Jt("/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(Jt("/libraries/agents",e))return t.push({label:"Libraries",to:"/libraries/agents"},{label:"Agents"}),t;if(Jt("/libraries/test-cases/:testCaseId",e)){const n=Jt("/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 Jt("/libraries/test-cases",e)?(t.push({label:"Libraries",to:"/libraries/test-cases"},{label:"Test Cases"}),t):Jt("/compare",e)?(t.push({label:"Compare Evaluations"}),t):(Jt("/compare/results",e)&&t.push({label:"Compare Evaluations",to:"/compare"},{label:"Full Result Compare"}),t)};function CG(){const e=xs(),t=new URLSearchParams(e.search).get("embed")==="1",n=NG(e.pathname),{connection:r,version:a}=On();return t?s.jsx("main",{className:"min-h-screen overflow-auto bg-background p-4",children:s.jsx(zE,{})}):s.jsx(e3,{children:s.jsxs("div",{className:"flex min-h-screen w-full",children:[s.jsx(dG,{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(n3,{}),s.jsx(p3,{children:s.jsx(h3,{children:n.map((i,o)=>{const c=o===n.length-1;return s.jsxs(v.Fragment,{children:[s.jsx(m3,{children:i.to&&!c?s.jsx(v3,{asChild:!0,children:s.jsx(xt,{to:i.to,children:i.label})}):s.jsx(g3,{children:i.label})}),!c&&s.jsx(y3,{})]},`${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(zE,{})})]})]})})}const b3=v.createContext(null);function _G({children:e}){const{source:t}=On(),[n,r]=v.useState([]),[a,i]=v.useState(!0),o=v.useCallback(async()=>{i(!0);try{const y=await t.listConfigs();r(y)}finally{i(!1)}},[t]);v.useEffect(()=>{o()},[o]);const c=v.useCallback(y=>n.find(g=>g.id===y),[n]),d=v.useCallback(async y=>{const g=await t.createConfig(y);return r(j=>[...j,g]),g},[t]),f=v.useCallback(async(y,g)=>{const j=await t.updateConfig({...g,id:y});return r(b=>b.map(x=>x.id===y?j:x)),j},[t]),h=v.useCallback(async y=>{await t.deleteConfig(y),r(g=>g.filter(j=>j.id!==y))},[t]),p=v.useCallback(async y=>{const g=n.find(x=>x.id===y);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(x=>[...x,b]),b},[n,t]);return s.jsx(b3.Provider,{value:{configs:n,loading:a,getConfig:c,addConfig:d,updateConfig:f,deleteConfig:h,cloneConfig:p,reload:o},children:e})}function of(){const e=v.useContext(b3);if(!e)throw new Error("useConfigs must be used within ConfigProvider");return e}const w3=v.createContext(null);function AG({children:e}){const{source:t}=On(),[n,r]=v.useState({servers:[],agents:[],scenarios:[]}),[a,i]=v.useState(!0),o=async()=>{i(!0);try{const f=await t.getLibraries();r(f)}finally{i(!1)}};v.useEffect(()=>{o()},[t]),v.useEffect(()=>{const f=()=>{o()};return window.addEventListener("focus",f),()=>{window.removeEventListener("focus",f)}},[t]);const c=async f=>{r(f),await t.saveLibraries(f)},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]);return s.jsx(w3.Provider,{value:d,children:e})}function Ha(){const e=v.useContext(w3);if(!e)throw new Error("useLibraries must be used within LibraryProvider");return e}const We=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:be("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));We.displayName="Card";const Nt=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:be("flex flex-col space-y-1.5 p-6",e),...t}));Nt.displayName="CardHeader";const Ct=v.forwardRef(({className:e,...t},n)=>s.jsx("h3",{ref:n,className:be("text-2xl font-semibold leading-none tracking-tight",e),...t}));Ct.displayName="CardTitle";const Bs=v.forwardRef(({className:e,...t},n)=>s.jsx("p",{ref:n,className:be("text-sm text-muted-foreground",e),...t}));Bs.displayName="CardDescription";const Ve=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:be("p-6 pt-0",e),...t}));Ve.displayName="CardContent";const EG=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:be("flex items-center p-6 pt-0",e),...t}));EG.displayName="CardFooter";const Zr=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{className:"relative w-full overflow-auto",children:s.jsx("table",{ref:n,className:be("w-full caption-bottom text-sm",e),...t})}));Zr.displayName="Table";const ea=v.forwardRef(({className:e,...t},n)=>s.jsx("thead",{ref:n,className:be("[&_tr]:border-b",e),...t}));ea.displayName="TableHeader";const ta=v.forwardRef(({className:e,...t},n)=>s.jsx("tbody",{ref:n,className:be("[&_tr:last-child]:border-0",e),...t}));ta.displayName="TableBody";const PG=v.forwardRef(({className:e,...t},n)=>s.jsx("tfoot",{ref:n,className:be("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));PG.displayName="TableFooter";const Bt=v.forwardRef(({className:e,...t},n)=>s.jsx("tr",{ref:n,className:be("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",e),...t}));Bt.displayName="TableRow";const tt=v.forwardRef(({className:e,...t},n)=>s.jsx("th",{ref:n,className:be("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));tt.displayName="TableHead";const Ke=v.forwardRef(({className:e,...t},n)=>s.jsx("td",{ref:n,className:be("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Ke.displayName="TableCell";const OG=v.forwardRef(({className:e,...t},n)=>s.jsx("caption",{ref:n,className:be("mt-4 text-sm text-muted-foreground",e),...t}));OG.displayName="TableCaption";function $s({title:e,value:t,subtitle:n,icon:r,trend:a}){return s.jsx(We,{children:s.jsx(Ve,{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 RG=$o("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 Je({className:e,variant:t,asChild:n,...r}){const a=n?Bi:"div";return s.jsx(a,{className:be(RG({variant:t}),e),...r})}function xo({rate:e,className:t}){const n=Math.round(e*100),r=n>=80?"default":n>=50?"secondary":"destructive";return s.jsxs(Je,{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 ox,sP;function $r(){if(sP)return ox;sP=1;var e=Array.isArray;return ox=e,ox}var lx,iP;function j3(){if(iP)return lx;iP=1;var e=typeof Cp=="object"&&Cp&&Cp.Object===Object&&Cp;return lx=e,lx}var cx,oP;function bs(){if(oP)return cx;oP=1;var e=j3(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return cx=n,cx}var ux,lP;function lf(){if(lP)return ux;lP=1;var e=bs(),t=e.Symbol;return ux=t,ux}var dx,cP;function kG(){if(cP)return dx;cP=1;var e=lf(),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 dx=i,dx}var fx,uP;function TG(){if(uP)return fx;uP=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return fx=n,fx}var px,dP;function Js(){if(dP)return px;dP=1;var e=lf(),t=kG(),n=TG(),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 px=o,px}var hx,fP;function Zs(){if(fP)return hx;fP=1;function e(t){return t!=null&&typeof t=="object"}return hx=e,hx}var mx,pP;function $c(){if(pP)return mx;pP=1;var e=Js(),t=Zs(),n="[object Symbol]";function r(a){return typeof a=="symbol"||t(a)&&e(a)==n}return mx=r,mx}var vx,hP;function JS(){if(hP)return vx;hP=1;var e=$r(),t=$c(),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 vx=a,vx}var gx,mP;function zi(){if(mP)return gx;mP=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return gx=e,gx}var yx,vP;function ZS(){if(vP)return yx;vP=1;var e=Js(),t=zi(),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 yx=o,yx}var xx,gP;function IG(){if(gP)return xx;gP=1;var e=bs(),t=e["__core-js_shared__"];return xx=t,xx}var bx,yP;function MG(){if(yP)return bx;yP=1;var e=IG(),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 bx=n,bx}var wx,xP;function S3(){if(xP)return wx;xP=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 wx=n,wx}var jx,bP;function $G(){if(bP)return jx;bP=1;var e=ZS(),t=MG(),n=zi(),r=S3(),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(y){if(!n(y)||t(y))return!1;var g=e(y)?h:i;return g.test(r(y))}return jx=p,jx}var Sx,wP;function DG(){if(wP)return Sx;wP=1;function e(t,n){return t?.[n]}return Sx=e,Sx}var Nx,jP;function Lo(){if(jP)return Nx;jP=1;var e=$G(),t=DG();function n(r,a){var i=t(r,a);return e(i)?i:void 0}return Nx=n,Nx}var Cx,SP;function Zm(){if(SP)return Cx;SP=1;var e=Lo(),t=e(Object,"create");return Cx=t,Cx}var _x,NP;function LG(){if(NP)return _x;NP=1;var e=Zm();function t(){this.__data__=e?e(null):{},this.size=0}return _x=t,_x}var Ax,CP;function FG(){if(CP)return Ax;CP=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return Ax=e,Ax}var Ex,_P;function BG(){if(_P)return Ex;_P=1;var e=Zm(),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 Ex=a,Ex}var Px,AP;function zG(){if(AP)return Px;AP=1;var e=Zm(),t=Object.prototype,n=t.hasOwnProperty;function r(a){var i=this.__data__;return e?i[a]!==void 0:n.call(i,a)}return Px=r,Px}var Ox,EP;function UG(){if(EP)return Ox;EP=1;var e=Zm(),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 Ox=n,Ox}var Rx,PP;function qG(){if(PP)return Rx;PP=1;var e=LG(),t=FG(),n=BG(),r=zG(),a=UG();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,Rx=i,Rx}var kx,OP;function WG(){if(OP)return kx;OP=1;function e(){this.__data__=[],this.size=0}return kx=e,kx}var Tx,RP;function eN(){if(RP)return Tx;RP=1;function e(t,n){return t===n||t!==t&&n!==n}return Tx=e,Tx}var Ix,kP;function ev(){if(kP)return Ix;kP=1;var e=eN();function t(n,r){for(var a=n.length;a--;)if(e(n[a][0],r))return a;return-1}return Ix=t,Ix}var Mx,TP;function VG(){if(TP)return Mx;TP=1;var e=ev(),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 Mx=r,Mx}var $x,IP;function HG(){if(IP)return $x;IP=1;var e=ev();function t(n){var r=this.__data__,a=e(r,n);return a<0?void 0:r[a][1]}return $x=t,$x}var Dx,MP;function KG(){if(MP)return Dx;MP=1;var e=ev();function t(n){return e(this.__data__,n)>-1}return Dx=t,Dx}var Lx,$P;function GG(){if($P)return Lx;$P=1;var e=ev();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 Lx=t,Lx}var Fx,DP;function tv(){if(DP)return Fx;DP=1;var e=WG(),t=VG(),n=HG(),r=KG(),a=GG();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,Fx=i,Fx}var Bx,LP;function tN(){if(LP)return Bx;LP=1;var e=Lo(),t=bs(),n=e(t,"Map");return Bx=n,Bx}var zx,FP;function YG(){if(FP)return zx;FP=1;var e=qG(),t=tv(),n=tN();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return zx=r,zx}var Ux,BP;function XG(){if(BP)return Ux;BP=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return Ux=e,Ux}var qx,zP;function nv(){if(zP)return qx;zP=1;var e=XG();function t(n,r){var a=n.__data__;return e(r)?a[typeof r=="string"?"string":"hash"]:a.map}return qx=t,qx}var Wx,UP;function QG(){if(UP)return Wx;UP=1;var e=nv();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return Wx=t,Wx}var Vx,qP;function JG(){if(qP)return Vx;qP=1;var e=nv();function t(n){return e(this,n).get(n)}return Vx=t,Vx}var Hx,WP;function ZG(){if(WP)return Hx;WP=1;var e=nv();function t(n){return e(this,n).has(n)}return Hx=t,Hx}var Kx,VP;function eY(){if(VP)return Kx;VP=1;var e=nv();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 Kx=t,Kx}var Gx,HP;function nN(){if(HP)return Gx;HP=1;var e=YG(),t=QG(),n=JG(),r=ZG(),a=eY();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,Gx=i,Gx}var Yx,KP;function N3(){if(KP)return Yx;KP=1;var e=nN(),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,Yx=n,Yx}var Xx,GP;function tY(){if(GP)return Xx;GP=1;var e=N3(),t=500;function n(r){var a=e(r,function(o){return i.size===t&&i.clear(),o}),i=a.cache;return a}return Xx=n,Xx}var Qx,YP;function nY(){if(YP)return Qx;YP=1;var e=tY(),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 Qx=r,Qx}var Jx,XP;function rN(){if(XP)return Jx;XP=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 Jx=e,Jx}var Zx,QP;function rY(){if(QP)return Zx;QP=1;var e=lf(),t=rN(),n=$r(),r=$c(),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 Zx=o,Zx}var eb,JP;function C3(){if(JP)return eb;JP=1;var e=rY();function t(n){return n==null?"":e(n)}return eb=t,eb}var tb,ZP;function _3(){if(ZP)return tb;ZP=1;var e=$r(),t=JS(),n=nY(),r=C3();function a(i,o){return e(i)?i:t(i,o)?[i]:n(r(i))}return tb=a,tb}var nb,eO;function rv(){if(eO)return nb;eO=1;var e=$c();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return nb=t,nb}var rb,tO;function aN(){if(tO)return rb;tO=1;var e=_3(),t=rv();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 rb=n,rb}var ab,nO;function A3(){if(nO)return ab;nO=1;var e=aN();function t(n,r,a){var i=n==null?void 0:e(n,r);return i===void 0?a:i}return ab=t,ab}var aY=A3();const ra=Vt(aY);var sb,rO;function sY(){if(rO)return sb;rO=1;function e(t){return t==null}return sb=e,sb}var iY=sY();const wt=Vt(iY);var ib,aO;function oY(){if(aO)return ib;aO=1;var e=Js(),t=$r(),n=Zs(),r="[object String]";function a(i){return typeof i=="string"||!t(i)&&n(i)&&e(i)==r}return ib=a,ib}var lY=oY();const Co=Vt(lY);var cY=ZS();const bt=Vt(cY);var uY=zi();const Dc=Vt(uY);var ob={exports:{}},Lt={};var sO;function dY(){if(sO)return Lt;sO=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"),y=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),j;j=Symbol.for("react.module.reference");function b(x){if(typeof x=="object"&&x!==null){var S=x.$$typeof;switch(S){case e:switch(x=x.type,x){case n:case a:case r:case f:case h:return x;default:switch(x=x&&x.$$typeof,x){case c:case o:case d:case y:case p:case i:return x;default:return S}}case t:return S}}}return Lt.ContextConsumer=o,Lt.ContextProvider=i,Lt.Element=e,Lt.ForwardRef=d,Lt.Fragment=n,Lt.Lazy=y,Lt.Memo=p,Lt.Portal=t,Lt.Profiler=a,Lt.StrictMode=r,Lt.Suspense=f,Lt.SuspenseList=h,Lt.isAsyncMode=function(){return!1},Lt.isConcurrentMode=function(){return!1},Lt.isContextConsumer=function(x){return b(x)===o},Lt.isContextProvider=function(x){return b(x)===i},Lt.isElement=function(x){return typeof x=="object"&&x!==null&&x.$$typeof===e},Lt.isForwardRef=function(x){return b(x)===d},Lt.isFragment=function(x){return b(x)===n},Lt.isLazy=function(x){return b(x)===y},Lt.isMemo=function(x){return b(x)===p},Lt.isPortal=function(x){return b(x)===t},Lt.isProfiler=function(x){return b(x)===a},Lt.isStrictMode=function(x){return b(x)===r},Lt.isSuspense=function(x){return b(x)===f},Lt.isSuspenseList=function(x){return b(x)===h},Lt.isValidElementType=function(x){return typeof x=="string"||typeof x=="function"||x===n||x===a||x===r||x===f||x===h||x===g||typeof x=="object"&&x!==null&&(x.$$typeof===y||x.$$typeof===p||x.$$typeof===i||x.$$typeof===o||x.$$typeof===d||x.$$typeof===j||x.getModuleId!==void 0)},Lt.typeOf=b,Lt}var iO;function fY(){return iO||(iO=1,ob.exports=dY()),ob.exports}var pY=fY(),lb,oO;function E3(){if(oO)return lb;oO=1;var e=Js(),t=Zs(),n="[object Number]";function r(a){return typeof a=="number"||t(a)&&e(a)==n}return lb=r,lb}var cb,lO;function hY(){if(lO)return cb;lO=1;var e=E3();function t(n){return e(n)&&n!=+n}return cb=t,cb}var mY=hY();const cf=Vt(mY);var vY=E3();const gY=Vt(vY);var wr=function(t){return t===0?0:t>0?1:-1},mo=function(t){return Co(t)&&t.indexOf("%")===t.length-1},Le=function(t){return gY(t)&&!cf(t)},yY=function(t){return wt(t)},Vn=function(t){return Le(t)||Co(t)},xY=0,Lc=function(t){var n=++xY;return"".concat(t||"").concat(n)},jr=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(!Le(t)&&!Co(t))return r;var i;if(mo(t)){var o=t.indexOf("%");i=n*parseFloat(t.slice(0,o))/100}else i=+t;return cf(i)&&(i=r),a&&i>n&&(i=n),i},Cl=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},bY=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},Qr=function(t,n){return Le(t)&&Le(n)?function(r){return t+r*(n-t)}:function(){return n}};function vh(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):ra(r,t))===n})}var wY=function(t,n){return Le(t)&&Le(n)?t-n:Co(t)&&Co(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function Bl(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 L1(e){"@babel/helpers - typeof";return L1=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},L1(e)}var jY=["viewBox","children"],SY=["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"],cO=["points","pathLength"],ub={svg:jY,polygon:cO,polyline:cO},sN=["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"],gh=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(v.isValidElement(t)&&(r=t.props),!Dc(r))return null;var a={};return Object.keys(r).forEach(function(i){sN.includes(i)&&(a[i]=n||function(o){return r[i](r,o)})}),a},NY=function(t,n,r){return function(a){return t(n,r,a),null}},_o=function(t,n,r){if(!Dc(t)||L1(t)!=="object")return null;var a=null;return Object.keys(t).forEach(function(i){var o=t[i];sN.includes(i)&&typeof o=="function"&&(a||(a={}),a[i]=NY(o,n,r))}),a},CY=["children"],_Y=["children"];function uO(e,t){if(e==null)return{};var n=AY(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 AY(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 F1(e){"@babel/helpers - typeof";return F1=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},F1(e)}var dO={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"},zs=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},fO=null,db=null,iN=function e(t){if(t===fO&&Array.isArray(db))return db;var n=[];return v.Children.forEach(t,function(r){wt(r)||(pY.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),db=n,fO=t,n};function aa(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(a){return zs(a)}):r=[zs(t)],iN(e).forEach(function(a){var i=ra(a,"type.displayName")||ra(a,"type.name");r.indexOf(i)!==-1&&n.push(a)}),n}function Gr(e,t){var n=aa(e,t);return n&&n[0]}var pO=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,a=n.height;return!(!Le(r)||r<=0||!Le(a)||a<=0)},EY=["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"],PY=function(t){return t&&t.type&&Co(t.type)&&EY.indexOf(t.type)>=0},OY=function(t){return t&&F1(t)==="object"&&"clipDot"in t},RY=function(t,n,r,a){var i,o=(i=ub?.[a])!==null&&i!==void 0?i:[];return n.startsWith("data-")||!bt(t)&&(a&&o.includes(n)||SY.includes(n))||r&&sN.includes(n)},ht=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(v.isValidElement(t)&&(a=t.props),!Dc(a))return null;var i={};return Object.keys(a).forEach(function(o){var c;RY((c=a)===null||c===void 0?void 0:c[o],o,n,r)&&(i[o]=a[o])}),i},B1=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 hO(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(!hO(i,o))return!1}return!0},hO=function(t,n){if(wt(t)&&wt(n))return!0;if(!wt(t)&&!wt(n)){var r=t.props||{},a=r.children,i=uO(r,CY),o=n.props||{},c=o.children,d=uO(o,_Y);return a&&c?Bl(i,d)&&B1(a,c):!a&&!c?Bl(i,d):!1}return!1},mO=function(t,n){var r=[],a={};return iN(t).forEach(function(i,o){if(PY(i))r.push(i);else if(i){var c=zs(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},kY=function(t){var n=t&&t.type;return n&&dO[n]?dO[n]:null},TY=function(t,n){return iN(n).indexOf(t)},IY=["children","width","height","viewBox","className","style","title","desc"];function z1(){return z1=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},z1.apply(this,arguments)}function MY(e,t){if(e==null)return{};var n=$Y(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 $Y(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=MY(e,IY),h=a||{width:n,height:r,x:0,y:0},p=jt("recharts-surface",i);return q.createElement("svg",z1({},ht(f,!0,"svg"),{className:p,width:n,height:r,style:o,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height)}),q.createElement("title",null,c),q.createElement("desc",null,d),t)}var DY=["children","className"];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 LY(e,t){if(e==null)return{};var n=FY(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 FY(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 It=q.forwardRef(function(e,t){var n=e.children,r=e.className,a=LY(e,DY),i=jt("recharts-layer",r);return q.createElement("g",q1({className:i},ht(a,!0),{ref:t}),n)}),Us=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]},fb,vO;function BY(){if(vO)return fb;vO=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 fb=e,fb}var pb,gO;function zY(){if(gO)return pb;gO=1;var e=BY();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 pb=t,pb}var hb,yO;function P3(){if(yO)return hb;yO=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 hb=d,hb}var mb,xO;function UY(){if(xO)return mb;xO=1;function e(t){return t.split("")}return mb=e,mb}var vb,bO;function qY(){if(bO)return vb;bO=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}",y="[\\ud800-\\udbff][\\udc00-\\udfff]",g="\\u200d",j=f+"?",b="["+i+"]?",x="(?:"+g+"(?:"+[h,p,y].join("|")+")"+b+j+")*",S=b+j+x,N="(?:"+[h+c+"?",c,p,y,o].join("|")+")",_=RegExp(d+"(?="+d+")|"+N+S,"g");function P(A){return A.match(_)||[]}return vb=P,vb}var gb,wO;function WY(){if(wO)return gb;wO=1;var e=UY(),t=P3(),n=qY();function r(a){return t(a)?n(a):e(a)}return gb=r,gb}var yb,jO;function VY(){if(jO)return yb;jO=1;var e=zY(),t=P3(),n=WY(),r=C3();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 yb=a,yb}var xb,SO;function HY(){if(SO)return xb;SO=1;var e=VY(),t=e("toUpperCase");return xb=t,xb}var KY=HY();const av=Vt(KY);function an(e){return function(){return e}}const O3=Math.cos,yh=Math.sin,Ka=Math.sqrt,xh=Math.PI,sv=2*xh,W1=Math.PI,V1=2*W1,fo=1e-6,GY=V1-fo;function R3(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function YY(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return R3;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 XY{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?R3:YY(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,y=h*h+p*p;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(y>fo)if(!(Math.abs(p*d-f*h)>fo)||!i)this._append`L${this._x1=t},${this._y1=n}`;else{let g=r-o,j=a-c,b=d*d+f*f,x=g*g+j*j,S=Math.sqrt(b),N=Math.sqrt(y),_=i*Math.tan((W1-Math.acos((b+y-x)/(2*S*N)))/2),P=_/N,A=_/S;Math.abs(P-1)>fo&&this._append`L${t+P*h},${n+P*p}`,this._append`A${i},${i},0,0,${+(p*g>h*j)},${this._x1=t+A*d},${this._y1=n+A*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,y=o?a-i:i-a;this._x1===null?this._append`M${f},${h}`:(Math.abs(this._x1-f)>fo||Math.abs(this._y1-h)>fo)&&this._append`L${f},${h}`,r&&(y<0&&(y=y%V1+V1),y>GY?this._append`A${r},${r},0,1,${p},${t-c},${n-d}A${r},${r},0,1,${p},${this._x1=f},${this._y1=h}`:y>fo&&this._append`A${r},${r},0,${+(y>=W1)},${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 oN(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 XY(t)}function lN(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function k3(e){this._context=e}k3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function iv(e){return new k3(e)}function T3(e){return e[0]}function I3(e){return e[1]}function M3(e,t){var n=an(!0),r=null,a=iv,i=null,o=oN(c);e=typeof e=="function"?e:e===void 0?T3:an(e),t=typeof t=="function"?t:t===void 0?I3:an(t);function c(d){var f,h=(d=lN(d)).length,p,y=!1,g;for(r==null&&(i=a(g=o())),f=0;f<=h;++f)!(f<h&&n(p=d[f],f,d))===y&&((y=!y)?i.lineStart():i.lineEnd()),y&&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:an(+d),c):e},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:an(+d),c):t},c.defined=function(d){return arguments.length?(n=typeof d=="function"?d:an(!!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 Dp(e,t,n){var r=null,a=an(!0),i=null,o=iv,c=null,d=oN(f);e=typeof e=="function"?e:e===void 0?T3:an(+e),t=typeof t=="function"?t:an(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?I3:an(+n);function f(p){var y,g,j,b=(p=lN(p)).length,x,S=!1,N,_=new Array(b),P=new Array(b);for(i==null&&(c=o(N=d())),y=0;y<=b;++y){if(!(y<b&&a(x=p[y],y,p))===S)if(S=!S)g=y,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),j=y-1;j>=g;--j)c.point(_[j],P[j]);c.lineEnd(),c.areaEnd()}S&&(_[y]=+e(x,y,p),P[y]=+t(x,y,p),c.point(r?+r(x,y,p):_[y],n?+n(x,y,p):P[y]))}if(N)return c=null,N+""||null}function h(){return M3().defined(a).curve(o).context(i)}return f.x=function(p){return arguments.length?(e=typeof p=="function"?p:an(+p),r=null,f):e},f.x0=function(p){return arguments.length?(e=typeof p=="function"?p:an(+p),f):e},f.x1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:an(+p),f):r},f.y=function(p){return arguments.length?(t=typeof p=="function"?p:an(+p),n=null,f):t},f.y0=function(p){return arguments.length?(t=typeof p=="function"?p:an(+p),f):t},f.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:an(+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:an(!!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 $3{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 QY(e){return new $3(e,!0)}function JY(e){return new $3(e,!1)}const cN={draw(e,t){const n=Ka(t/xh);e.moveTo(n,0),e.arc(0,0,n,0,sv)}},ZY={draw(e,t){const n=Ka(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()}},D3=Ka(1/3),eX=D3*2,tX={draw(e,t){const n=Ka(t/eX),r=n*D3;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},nX={draw(e,t){const n=Ka(t),r=-n/2;e.rect(r,r,n,n)}},rX=.8908130915292852,L3=yh(xh/10)/yh(7*xh/10),aX=yh(sv/10)*L3,sX=-O3(sv/10)*L3,iX={draw(e,t){const n=Ka(t*rX),r=aX*n,a=sX*n;e.moveTo(0,-n),e.lineTo(r,a);for(let i=1;i<5;++i){const o=sv*i/5,c=O3(o),d=yh(o);e.lineTo(d*n,-c*n),e.lineTo(c*r-d*a,d*r+c*a)}e.closePath()}},bb=Ka(3),oX={draw(e,t){const n=-Ka(t/(bb*3));e.moveTo(0,n*2),e.lineTo(-bb*n,-n),e.lineTo(bb*n,-n),e.closePath()}},pa=-.5,ha=Ka(3)/2,H1=1/Ka(12),lX=(H1/2+1)*3,cX={draw(e,t){const n=Ka(t/lX),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(pa*r-ha*a,ha*r+pa*a),e.lineTo(pa*i-ha*o,ha*i+pa*o),e.lineTo(pa*c-ha*d,ha*c+pa*d),e.lineTo(pa*r+ha*a,pa*a-ha*r),e.lineTo(pa*i+ha*o,pa*o-ha*i),e.lineTo(pa*c+ha*d,pa*d-ha*c),e.closePath()}};function uX(e,t){let n=null,r=oN(a);e=typeof e=="function"?e:an(e||cN),t=typeof t=="function"?t:an(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:an(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:an(+i),a):t},a.context=function(i){return arguments.length?(n=i??null,a):n},a}function bh(){}function wh(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 F3(e){this._context=e}F3.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:wh(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:wh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function dX(e){return new F3(e)}function B3(e){this._context=e}B3.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:wh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function fX(e){return new B3(e)}function z3(e){this._context=e}z3.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:wh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function pX(e){return new z3(e)}function U3(e){this._context=e}U3.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 hX(e){return new U3(e)}function NO(e){return e<0?-1:1}function CO(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(NO(i)+NO(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(c))||0}function _O(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function wb(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 jh(e){this._context=e}jh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:wb(this,this._t0,_O(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,wb(this,_O(this,n=CO(this,e,t)),n);break;default:wb(this,this._t0,n=CO(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function q3(e){this._context=new W3(e)}(q3.prototype=Object.create(jh.prototype)).point=function(e,t){jh.prototype.point.call(this,t,e)};function W3(e){this._context=e}W3.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 mX(e){return new jh(e)}function vX(e){return new q3(e)}function V3(e){this._context=e}V3.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=AO(e),a=AO(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 AO(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 gX(e){return new V3(e)}function ov(e,t){this._context=e,this._t=t}ov.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 yX(e){return new ov(e,.5)}function xX(e){return new ov(e,0)}function bX(e){return new ov(e,1)}function Jl(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 K1(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function wX(e,t){return e[t]}function jX(e){const t=[];return t.key=e,t}function SX(){var e=an([]),t=K1,n=Jl,r=wX;function a(i){var o=Array.from(e.apply(this,arguments),jX),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=lN(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:an(Array.from(i)),a):e},a.value=function(i){return arguments.length?(r=typeof i=="function"?i:an(+i),a):r},a.order=function(i){return arguments.length?(t=i==null?K1:typeof i=="function"?i:an(Array.from(i)),a):t},a.offset=function(i){return arguments.length?(n=i??Jl,a):n},a}function NX(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}Jl(e,t)}}function CX(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}Jl(e,t)}}function _X(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,y=h[r-1][1]||0,g=(p-y)/2,j=0;j<c;++j){var b=e[t[j]],x=b[r][1]||0,S=b[r-1][1]||0;g+=x-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,Jl(e,t)}}function dd(e){"@babel/helpers - typeof";return dd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dd(e)}var AX=["type","size","sizeType"];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 EO(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 PO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?EO(Object(n),!0).forEach(function(r){EX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function EX(e,t,n){return t=PX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PX(e){var t=OX(e,"string");return dd(t)=="symbol"?t:t+""}function OX(e,t){if(dd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(dd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function RX(e,t){if(e==null)return{};var n=kX(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 kX(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 H3={symbolCircle:cN,symbolCross:ZY,symbolDiamond:tX,symbolSquare:nX,symbolStar:iX,symbolTriangle:oX,symbolWye:cX},TX=Math.PI/180,IX=function(t){var n="symbol".concat(av(t));return H3[n]||cN},MX=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*TX;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}},$X=function(t,n){H3["symbol".concat(av(t))]=n},uN=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=RX(t,AX),f=PO(PO({},d),{},{type:r,size:i,sizeType:c}),h=function(){var x=IX(r),S=uX().type(x).size(MX(i,c,r));return S()},p=f.className,y=f.cx,g=f.cy,j=ht(f,!0);return y===+y&&g===+g&&i===+i?q.createElement("path",G1({},j,{className:jt("recharts-symbols",p),transform:"translate(".concat(y,", ").concat(g,")"),d:h()})):null};uN.registerSymbol=$X;function Zl(e){"@babel/helpers - typeof";return Zl=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},Zl(e)}function Y1(){return Y1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y1.apply(this,arguments)}function OO(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 DX(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OO(Object(n),!0).forEach(function(r){fd(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function LX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FX(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,G3(r.key),r)}}function BX(e,t,n){return t&&FX(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function zX(e,t,n){return t=Sh(t),UX(e,K3()?Reflect.construct(t,n||[],Sh(e).constructor):t.apply(e,n))}function UX(e,t){if(t&&(Zl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qX(e)}function qX(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function K3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(K3=function(){return!!e})()}function Sh(e){return Sh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Sh(e)}function WX(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 fd(e,t,n){return t=G3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G3(e){var t=VX(e,"string");return Zl(t)=="symbol"?t:t+""}function VX(e,t){if(Zl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Zl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var ma=32,dN=(function(e){function t(){return LX(this,t),zX(this,t,arguments)}return WX(t,e),BX(t,[{key:"renderIcon",value:function(r){var a=this.props.inactiveColor,i=ma/2,o=ma/6,c=ma/3,d=r.inactive?a:r.color;if(r.type==="plainline")return q.createElement("line",{strokeWidth:4,fill:"none",stroke:d,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:i,x2:ma,y2:i,className:"recharts-legend-icon"});if(r.type==="line")return q.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(ma,"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 q.createElement("path",{stroke:"none",fill:d,d:"M0,".concat(ma/8,"h").concat(ma,"v").concat(ma*3/4,"h").concat(-ma,"z"),className:"recharts-legend-icon"});if(q.isValidElement(r.legendIcon)){var f=DX({},r);return delete f.legendIcon,q.cloneElement(r.legendIcon,f)}return q.createElement(uN,{fill:d,cx:i,cy:i,size:ma,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:ma,height:ma},p={display:c==="horizontal"?"inline-block":"block",marginRight:10},y={display:"inline-block",verticalAlign:"middle",marginRight:4};return i.map(function(g,j){var b=g.formatter||d,x=jt(fd(fd({"recharts-legend-item":!0},"legend-item-".concat(j),!0),"inactive",g.inactive));if(g.type==="none")return null;var S=bt(g.value)?null:g.value;Us(!bt(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 N=g.inactive?f:g.color;return q.createElement("li",Y1({className:x,style:p,key:"legend-item-".concat(j)},_o(r.props,g,j)),q.createElement(U1,{width:o,height:o,viewBox:h,style:y},r.renderIcon(g)),q.createElement("span",{className:"recharts-legend-item-text",style:{color:N}},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 q.createElement("ul",{className:"recharts-default-legend",style:c},this.renderItems())}}])})(v.PureComponent);fd(dN,"displayName","Legend");fd(dN,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var jb,RO;function HX(){if(RO)return jb;RO=1;var e=tv();function t(){this.__data__=new e,this.size=0}return jb=t,jb}var Sb,kO;function KX(){if(kO)return Sb;kO=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return Sb=e,Sb}var Nb,TO;function GX(){if(TO)return Nb;TO=1;function e(t){return this.__data__.get(t)}return Nb=e,Nb}var Cb,IO;function YX(){if(IO)return Cb;IO=1;function e(t){return this.__data__.has(t)}return Cb=e,Cb}var _b,MO;function XX(){if(MO)return _b;MO=1;var e=tv(),t=tN(),n=nN(),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 _b=a,_b}var Ab,$O;function Y3(){if($O)return Ab;$O=1;var e=tv(),t=HX(),n=KX(),r=GX(),a=YX(),i=XX();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,Ab=o,Ab}var Eb,DO;function QX(){if(DO)return Eb;DO=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return Eb=t,Eb}var Pb,LO;function JX(){if(LO)return Pb;LO=1;function e(t){return this.__data__.has(t)}return Pb=e,Pb}var Ob,FO;function X3(){if(FO)return Ob;FO=1;var e=nN(),t=QX(),n=JX();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,Ob=r,Ob}var Rb,BO;function Q3(){if(BO)return Rb;BO=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 Rb=e,Rb}var kb,zO;function J3(){if(zO)return kb;zO=1;function e(t,n){return t.has(n)}return kb=e,kb}var Tb,UO;function Z3(){if(UO)return Tb;UO=1;var e=X3(),t=Q3(),n=J3(),r=1,a=2;function i(o,c,d,f,h,p){var y=d&r,g=o.length,j=c.length;if(g!=j&&!(y&&j>g))return!1;var b=p.get(o),x=p.get(c);if(b&&x)return b==c&&x==o;var S=-1,N=!0,_=d&a?new e:void 0;for(p.set(o,c),p.set(c,o);++S<g;){var P=o[S],A=c[S];if(f)var O=y?f(A,P,S,c,o,p):f(P,A,S,o,c,p);if(O!==void 0){if(O)continue;N=!1;break}if(_){if(!t(c,function(R,k){if(!n(_,k)&&(P===R||h(P,R,d,f,p)))return _.push(k)})){N=!1;break}}else if(!(P===A||h(P,A,d,f,p))){N=!1;break}}return p.delete(o),p.delete(c),N}return Tb=i,Tb}var Ib,qO;function ZX(){if(qO)return Ib;qO=1;var e=bs(),t=e.Uint8Array;return Ib=t,Ib}var Mb,WO;function eQ(){if(WO)return Mb;WO=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(a,i){r[++n]=[i,a]}),r}return Mb=e,Mb}var $b,VO;function fN(){if(VO)return $b;VO=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(a){r[++n]=a}),r}return $b=e,$b}var Db,HO;function tQ(){if(HO)return Db;HO=1;var e=lf(),t=ZX(),n=eN(),r=Z3(),a=eQ(),i=fN(),o=1,c=2,d="[object Boolean]",f="[object Date]",h="[object Error]",p="[object Map]",y="[object Number]",g="[object RegExp]",j="[object Set]",b="[object String]",x="[object Symbol]",S="[object ArrayBuffer]",N="[object DataView]",_=e?e.prototype:void 0,P=_?_.valueOf:void 0;function A(O,R,k,M,z,B,L){switch(k){case N:if(O.byteLength!=R.byteLength||O.byteOffset!=R.byteOffset)return!1;O=O.buffer,R=R.buffer;case S:return!(O.byteLength!=R.byteLength||!B(new t(O),new t(R)));case d:case f:case y:return n(+O,+R);case h:return O.name==R.name&&O.message==R.message;case g:case b:return O==R+"";case p:var G=a;case j:var U=M&o;if(G||(G=i),O.size!=R.size&&!U)return!1;var H=L.get(O);if(H)return H==R;M|=c,L.set(O,R);var Q=r(G(O),G(R),M,z,B,L);return L.delete(O),Q;case x:if(P)return P.call(O)==P.call(R)}return!1}return Db=A,Db}var Lb,KO;function e5(){if(KO)return Lb;KO=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 Lb=e,Lb}var Fb,GO;function nQ(){if(GO)return Fb;GO=1;var e=e5(),t=$r();function n(r,a,i){var o=a(r);return t(r)?o:e(o,i(r))}return Fb=n,Fb}var Bb,YO;function rQ(){if(YO)return Bb;YO=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 Bb=e,Bb}var zb,XO;function aQ(){if(XO)return zb;XO=1;function e(){return[]}return zb=e,zb}var Ub,QO;function sQ(){if(QO)return Ub;QO=1;var e=rQ(),t=aQ(),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 Ub=i,Ub}var qb,JO;function iQ(){if(JO)return qb;JO=1;function e(t,n){for(var r=-1,a=Array(t);++r<t;)a[r]=n(r);return a}return qb=e,qb}var Wb,ZO;function oQ(){if(ZO)return Wb;ZO=1;var e=Js(),t=Zs(),n="[object Arguments]";function r(a){return t(a)&&e(a)==n}return Wb=r,Wb}var Vb,eR;function pN(){if(eR)return Vb;eR=1;var e=oQ(),t=Zs(),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 Vb=i,Vb}var qu={exports:{}},Hb,tR;function lQ(){if(tR)return Hb;tR=1;function e(){return!1}return Hb=e,Hb}qu.exports;var nR;function t5(){return nR||(nR=1,(function(e,t){var n=bs(),r=lQ(),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})(qu,qu.exports)),qu.exports}var Kb,rR;function hN(){if(rR)return Kb;rR=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 Kb=n,Kb}var Gb,aR;function mN(){if(aR)return Gb;aR=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return Gb=t,Gb}var Yb,sR;function cQ(){if(sR)return Yb;sR=1;var e=Js(),t=mN(),n=Zs(),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]",y="[object RegExp]",g="[object Set]",j="[object String]",b="[object WeakMap]",x="[object ArrayBuffer]",S="[object DataView]",N="[object Float32Array]",_="[object Float64Array]",P="[object Int8Array]",A="[object Int16Array]",O="[object Int32Array]",R="[object Uint8Array]",k="[object Uint8ClampedArray]",M="[object Uint16Array]",z="[object Uint32Array]",B={};B[N]=B[_]=B[P]=B[A]=B[O]=B[R]=B[k]=B[M]=B[z]=!0,B[r]=B[a]=B[x]=B[i]=B[S]=B[o]=B[c]=B[d]=B[f]=B[h]=B[p]=B[y]=B[g]=B[j]=B[b]=!1;function L(G){return n(G)&&t(G.length)&&!!B[e(G)]}return Yb=L,Yb}var Xb,iR;function n5(){if(iR)return Xb;iR=1;function e(t){return function(n){return t(n)}}return Xb=e,Xb}var Wu={exports:{}};Wu.exports;var oR;function uQ(){return oR||(oR=1,(function(e,t){var n=j3(),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})(Wu,Wu.exports)),Wu.exports}var Qb,lR;function r5(){if(lR)return Qb;lR=1;var e=cQ(),t=n5(),n=uQ(),r=n&&n.isTypedArray,a=r?t(r):e;return Qb=a,Qb}var Jb,cR;function dQ(){if(cR)return Jb;cR=1;var e=iQ(),t=pN(),n=$r(),r=t5(),a=hN(),i=r5(),o=Object.prototype,c=o.hasOwnProperty;function d(f,h){var p=n(f),y=!p&&t(f),g=!p&&!y&&r(f),j=!p&&!y&&!g&&i(f),b=p||y||g||j,x=b?e(f.length,String):[],S=x.length;for(var N in f)(h||c.call(f,N))&&!(b&&(N=="length"||g&&(N=="offset"||N=="parent")||j&&(N=="buffer"||N=="byteLength"||N=="byteOffset")||a(N,S)))&&x.push(N);return x}return Jb=d,Jb}var Zb,uR;function fQ(){if(uR)return Zb;uR=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,a=typeof r=="function"&&r.prototype||e;return n===a}return Zb=t,Zb}var e0,dR;function a5(){if(dR)return e0;dR=1;function e(t,n){return function(r){return t(n(r))}}return e0=e,e0}var t0,fR;function pQ(){if(fR)return t0;fR=1;var e=a5(),t=e(Object.keys,Object);return t0=t,t0}var n0,pR;function hQ(){if(pR)return n0;pR=1;var e=fQ(),t=pQ(),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 n0=a,n0}var r0,hR;function uf(){if(hR)return r0;hR=1;var e=ZS(),t=mN();function n(r){return r!=null&&t(r.length)&&!e(r)}return r0=n,r0}var a0,mR;function lv(){if(mR)return a0;mR=1;var e=dQ(),t=hQ(),n=uf();function r(a){return n(a)?e(a):t(a)}return a0=r,a0}var s0,vR;function mQ(){if(vR)return s0;vR=1;var e=nQ(),t=sQ(),n=lv();function r(a){return e(a,n,t)}return s0=r,s0}var i0,gR;function vQ(){if(gR)return i0;gR=1;var e=mQ(),t=1,n=Object.prototype,r=n.hasOwnProperty;function a(i,o,c,d,f,h){var p=c&t,y=e(i),g=y.length,j=e(o),b=j.length;if(g!=b&&!p)return!1;for(var x=g;x--;){var S=y[x];if(!(p?S in o:r.call(o,S)))return!1}var N=h.get(i),_=h.get(o);if(N&&_)return N==o&&_==i;var P=!0;h.set(i,o),h.set(o,i);for(var A=p;++x<g;){S=y[x];var O=i[S],R=o[S];if(d)var k=p?d(R,O,S,o,i,h):d(O,R,S,i,o,h);if(!(k===void 0?O===R||f(O,R,c,d,h):k)){P=!1;break}A||(A=S=="constructor")}if(P&&!A){var M=i.constructor,z=o.constructor;M!=z&&"constructor"in i&&"constructor"in o&&!(typeof M=="function"&&M instanceof M&&typeof z=="function"&&z instanceof z)&&(P=!1)}return h.delete(i),h.delete(o),P}return i0=a,i0}var o0,yR;function gQ(){if(yR)return o0;yR=1;var e=Lo(),t=bs(),n=e(t,"DataView");return o0=n,o0}var l0,xR;function yQ(){if(xR)return l0;xR=1;var e=Lo(),t=bs(),n=e(t,"Promise");return l0=n,l0}var c0,bR;function s5(){if(bR)return c0;bR=1;var e=Lo(),t=bs(),n=e(t,"Set");return c0=n,c0}var u0,wR;function xQ(){if(wR)return u0;wR=1;var e=Lo(),t=bs(),n=e(t,"WeakMap");return u0=n,u0}var d0,jR;function bQ(){if(jR)return d0;jR=1;var e=gQ(),t=tN(),n=yQ(),r=s5(),a=xQ(),i=Js(),o=S3(),c="[object Map]",d="[object Object]",f="[object Promise]",h="[object Set]",p="[object WeakMap]",y="[object DataView]",g=o(e),j=o(t),b=o(n),x=o(r),S=o(a),N=i;return(e&&N(new e(new ArrayBuffer(1)))!=y||t&&N(new t)!=c||n&&N(n.resolve())!=f||r&&N(new r)!=h||a&&N(new a)!=p)&&(N=function(_){var P=i(_),A=P==d?_.constructor:void 0,O=A?o(A):"";if(O)switch(O){case g:return y;case j:return c;case b:return f;case x:return h;case S:return p}return P}),d0=N,d0}var f0,SR;function wQ(){if(SR)return f0;SR=1;var e=Y3(),t=Z3(),n=tQ(),r=vQ(),a=bQ(),i=$r(),o=t5(),c=r5(),d=1,f="[object Arguments]",h="[object Array]",p="[object Object]",y=Object.prototype,g=y.hasOwnProperty;function j(b,x,S,N,_,P){var A=i(b),O=i(x),R=A?h:a(b),k=O?h:a(x);R=R==f?p:R,k=k==f?p:k;var M=R==p,z=k==p,B=R==k;if(B&&o(b)){if(!o(x))return!1;A=!0,M=!1}if(B&&!M)return P||(P=new e),A||c(b)?t(b,x,S,N,_,P):n(b,x,R,S,N,_,P);if(!(S&d)){var L=M&&g.call(b,"__wrapped__"),G=z&&g.call(x,"__wrapped__");if(L||G){var U=L?b.value():b,H=G?x.value():x;return P||(P=new e),_(U,H,S,N,P)}}return B?(P||(P=new e),r(b,x,S,N,_,P)):!1}return f0=j,f0}var p0,NR;function vN(){if(NR)return p0;NR=1;var e=wQ(),t=Zs();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 p0=n,p0}var h0,CR;function jQ(){if(CR)return h0;CR=1;var e=Y3(),t=vN(),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 y=c[f];if(p&&y[2]?y[1]!==i[y[0]]:!(y[0]in i))return!1}for(;++f<h;){y=c[f];var g=y[0],j=i[g],b=y[1];if(p&&y[2]){if(j===void 0&&!(g in i))return!1}else{var x=new e;if(d)var S=d(j,b,g,i,o,x);if(!(S===void 0?t(b,j,n|r,d,x):S))return!1}}return!0}return h0=a,h0}var m0,_R;function i5(){if(_R)return m0;_R=1;var e=zi();function t(n){return n===n&&!e(n)}return m0=t,m0}var v0,AR;function SQ(){if(AR)return v0;AR=1;var e=i5(),t=lv();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 v0=n,v0}var g0,ER;function o5(){if(ER)return g0;ER=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return g0=e,g0}var y0,PR;function NQ(){if(PR)return y0;PR=1;var e=jQ(),t=SQ(),n=o5();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 y0=r,y0}var x0,OR;function CQ(){if(OR)return x0;OR=1;function e(t,n){return t!=null&&n in Object(t)}return x0=e,x0}var b0,RR;function _Q(){if(RR)return b0;RR=1;var e=_3(),t=pN(),n=$r(),r=hN(),a=mN(),i=rv();function o(c,d,f){d=e(d,c);for(var h=-1,p=d.length,y=!1;++h<p;){var g=i(d[h]);if(!(y=c!=null&&f(c,g)))break;c=c[g]}return y||++h!=p?y:(p=c==null?0:c.length,!!p&&a(p)&&r(g,p)&&(n(c)||t(c)))}return b0=o,b0}var w0,kR;function AQ(){if(kR)return w0;kR=1;var e=CQ(),t=_Q();function n(r,a){return r!=null&&t(r,a,e)}return w0=n,w0}var j0,TR;function EQ(){if(TR)return j0;TR=1;var e=vN(),t=A3(),n=AQ(),r=JS(),a=i5(),i=o5(),o=rv(),c=1,d=2;function f(h,p){return r(h)&&a(p)?i(o(h),p):function(y){var g=t(y,h);return g===void 0&&g===p?n(y,h):e(p,g,c|d)}}return j0=f,j0}var S0,IR;function Fc(){if(IR)return S0;IR=1;function e(t){return t}return S0=e,S0}var N0,MR;function PQ(){if(MR)return N0;MR=1;function e(t){return function(n){return n?.[t]}}return N0=e,N0}var C0,$R;function OQ(){if($R)return C0;$R=1;var e=aN();function t(n){return function(r){return e(r,n)}}return C0=t,C0}var _0,DR;function RQ(){if(DR)return _0;DR=1;var e=PQ(),t=OQ(),n=JS(),r=rv();function a(i){return n(i)?e(r(i)):t(i)}return _0=a,_0}var A0,LR;function ws(){if(LR)return A0;LR=1;var e=NQ(),t=EQ(),n=Fc(),r=$r(),a=RQ();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 A0=i,A0}var E0,FR;function l5(){if(FR)return E0;FR=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 E0=e,E0}var P0,BR;function kQ(){if(BR)return P0;BR=1;function e(t){return t!==t}return P0=e,P0}var O0,zR;function TQ(){if(zR)return O0;zR=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 O0=e,O0}var R0,UR;function IQ(){if(UR)return R0;UR=1;var e=l5(),t=kQ(),n=TQ();function r(a,i,o){return i===i?n(a,i,o):e(a,t,o)}return R0=r,R0}var k0,qR;function MQ(){if(qR)return k0;qR=1;var e=IQ();function t(n,r){var a=n==null?0:n.length;return!!a&&e(n,r,0)>-1}return k0=t,k0}var T0,WR;function $Q(){if(WR)return T0;WR=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 T0=e,T0}var I0,VR;function DQ(){if(VR)return I0;VR=1;function e(){}return I0=e,I0}var M0,HR;function LQ(){if(HR)return M0;HR=1;var e=s5(),t=DQ(),n=fN(),r=1/0,a=e&&1/n(new e([,-0]))[1]==r?function(i){return new e(i)}:t;return M0=a,M0}var $0,KR;function FQ(){if(KR)return $0;KR=1;var e=X3(),t=MQ(),n=$Q(),r=J3(),a=LQ(),i=fN(),o=200;function c(d,f,h){var p=-1,y=t,g=d.length,j=!0,b=[],x=b;if(h)j=!1,y=n;else if(g>=o){var S=f?null:a(d);if(S)return i(S);j=!1,y=r,x=new e}else x=f?[]:b;e:for(;++p<g;){var N=d[p],_=f?f(N):N;if(N=h||N!==0?N:0,j&&_===_){for(var P=x.length;P--;)if(x[P]===_)continue e;f&&x.push(_),b.push(N)}else y(x,_,h)||(x!==b&&x.push(_),b.push(N))}return b}return $0=c,$0}var D0,GR;function BQ(){if(GR)return D0;GR=1;var e=ws(),t=FQ();function n(r,a){return r&&r.length?t(r,e(a,2)):[]}return D0=n,D0}var zQ=BQ();const YR=Vt(zQ);function c5(e,t,n){return t===!0?YR(e,n):bt(t)?YR(e,t):e}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)}var UQ=["ref"];function XR(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 Ts(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?XR(Object(n),!0).forEach(function(r){cv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function QR(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 WQ(e,t,n){return t&&QR(e.prototype,t),n&&QR(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function VQ(e,t,n){return t=Nh(t),HQ(e,u5()?Reflect.construct(t,n||[],Nh(e).constructor):t.apply(e,n))}function HQ(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 KQ(e)}function KQ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(u5=function(){return!!e})()}function Nh(e){return Nh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Nh(e)}function GQ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&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 cv(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=YQ(e,"string");return ec(t)=="symbol"?t:t+""}function YQ(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 String(e)}function XQ(e,t){if(e==null)return{};var n=QQ(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 QQ(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 JQ(e){return e.value}function ZQ(e,t){if(q.isValidElement(e))return q.cloneElement(e,t);if(typeof e=="function")return q.createElement(e,t);t.ref;var n=XQ(t,UQ);return q.createElement(dN,n)}var JR=1,zl=(function(e){function t(){var n;qQ(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=VQ(this,t,[].concat(a)),cv(n,"lastBoundingBox",{width:-1,height:-1}),n}return GQ(t,e),WQ(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)>JR||Math.abs(a.height-this.lastBoundingBox.height)>JR)&&(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?Ts({},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,y;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();y={top:((h||0)-j.height)/2}}else y=c==="bottom"?{bottom:d&&d.bottom||0}:{top:d&&d.top||0};return Ts(Ts({},p),y)}},{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=Ts(Ts({position:"absolute",width:o||"auto",height:c||"auto"},this.getDefaultPosition(d)),d);return q.createElement("div",{className:"recharts-legend-wrapper",style:p,ref:function(g){r.wrapperNode=g}},ZQ(i,Ts(Ts({},this.props),{},{payload:c5(h,f,JQ)})))}}],[{key:"getWithHeight",value:function(r,a){var i=Ts(Ts({},this.defaultProps),r.props),o=i.layout;return o==="vertical"&&Le(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||a}:null}}])})(v.PureComponent);cv(zl,"displayName","Legend");cv(zl,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var L0,ZR;function eJ(){if(ZR)return L0;ZR=1;var e=lf(),t=pN(),n=$r(),r=e?e.isConcatSpreadable:void 0;function a(i){return n(i)||t(i)||!!(r&&i&&i[r])}return L0=a,L0}var F0,ek;function f5(){if(ek)return F0;ek=1;var e=e5(),t=eJ();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 F0=n,F0}var B0,tk;function tJ(){if(tk)return B0;tk=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 B0=e,B0}var z0,nk;function nJ(){if(nk)return z0;nk=1;var e=tJ(),t=e();return z0=t,z0}var U0,rk;function p5(){if(rk)return U0;rk=1;var e=nJ(),t=lv();function n(r,a){return r&&e(r,a,t)}return U0=n,U0}var q0,ak;function rJ(){if(ak)return q0;ak=1;var e=uf();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 q0=t,q0}var W0,sk;function gN(){if(sk)return W0;sk=1;var e=p5(),t=rJ(),n=t(e);return W0=n,W0}var V0,ik;function h5(){if(ik)return V0;ik=1;var e=gN(),t=uf();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 V0=n,V0}var H0,ok;function aJ(){if(ok)return H0;ok=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return H0=e,H0}var K0,lk;function sJ(){if(lk)return K0;lk=1;var e=$c();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 K0=t,K0}var G0,ck;function iJ(){if(ck)return G0;ck=1;var e=sJ();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 G0=t,G0}var Y0,uk;function oJ(){if(uk)return Y0;uk=1;var e=rN(),t=aN(),n=ws(),r=h5(),a=aJ(),i=n5(),o=iJ(),c=Fc(),d=$r();function f(h,p,y){p.length?p=e(p,function(b){return d(b)?function(x){return t(x,b.length===1?b[0]:b)}:b}):p=[c];var g=-1;p=e(p,i(n));var j=r(h,function(b,x,S){var N=e(p,function(_){return _(b)});return{criteria:N,index:++g,value:b}});return a(j,function(b,x){return o(b,x,y)})}return Y0=f,Y0}var X0,dk;function lJ(){if(dk)return X0;dk=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 X0=e,X0}var Q0,fk;function cJ(){if(fk)return Q0;fk=1;var e=lJ(),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 Q0=n,Q0}var J0,pk;function uJ(){if(pk)return J0;pk=1;function e(t){return function(){return t}}return J0=e,J0}var Z0,hk;function m5(){if(hk)return Z0;hk=1;var e=Lo(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return Z0=t,Z0}var ew,mk;function dJ(){if(mk)return ew;mk=1;var e=uJ(),t=m5(),n=Fc(),r=t?function(a,i){return t(a,"toString",{configurable:!0,enumerable:!1,value:e(i),writable:!0})}:n;return ew=r,ew}var tw,vk;function fJ(){if(vk)return tw;vk=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 tw=r,tw}var nw,gk;function pJ(){if(gk)return nw;gk=1;var e=dJ(),t=fJ(),n=t(e);return nw=n,nw}var rw,yk;function hJ(){if(yk)return rw;yk=1;var e=Fc(),t=cJ(),n=pJ();function r(a,i){return n(t(a,i,e),a+"")}return rw=r,rw}var aw,xk;function uv(){if(xk)return aw;xk=1;var e=eN(),t=uf(),n=hN(),r=zi();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 aw=a,aw}var sw,bk;function mJ(){if(bk)return sw;bk=1;var e=f5(),t=oJ(),n=hJ(),r=uv(),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 sw=a,sw}var vJ=mJ();const yN=Vt(vJ);function pd(e){"@babel/helpers - typeof";return pd=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},pd(e)}function J1(){return J1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},J1.apply(this,arguments)}function gJ(e,t){return wJ(e)||bJ(e,t)||xJ(e,t)||yJ()}function yJ(){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 xJ(e,t){if(e){if(typeof e=="string")return wk(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 wk(e,t)}}function wk(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 bJ(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 wJ(e){if(Array.isArray(e))return e}function jk(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 iw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jk(Object(n),!0).forEach(function(r){jJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jJ(e,t,n){return t=SJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SJ(e){var t=NJ(e,"string");return pd(t)=="symbol"?t:t+""}function NJ(e,t){if(pd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(pd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function CJ(e){return Array.isArray(e)&&Vn(e[0])&&Vn(e[1])?e.join(" ~ "):e}var _J=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,y=t.itemSorter,g=t.wrapperClassName,j=t.labelClassName,b=t.label,x=t.labelFormatter,S=t.accessibilityLayer,N=S===void 0?!1:S,_=function(){if(h&&h.length){var L={padding:0,margin:0},G=(y?yN(h,y):h).map(function(U,H){if(U.type==="none")return null;var Q=iw({display:"block",paddingTop:4,paddingBottom:4,color:U.color||"#000"},c),J=U.formatter||p||CJ,T=U.value,D=U.name,X=T,F=D;if(J&&X!=null&&F!=null){var $=J(T,D,U,H,h);if(Array.isArray($)){var ee=gJ($,2);X=ee[0],F=ee[1]}else X=$}return q.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(H),style:Q},Vn(F)?q.createElement("span",{className:"recharts-tooltip-item-name"},F):null,Vn(F)?q.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,q.createElement("span",{className:"recharts-tooltip-item-value"},X),q.createElement("span",{className:"recharts-tooltip-item-unit"},U.unit||""))});return q.createElement("ul",{className:"recharts-tooltip-item-list",style:L},G)}return null},P=iw({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),A=iw({margin:0},f),O=!wt(b),R=O?b:"",k=jt("recharts-default-tooltip",g),M=jt("recharts-tooltip-label",j);O&&x&&h!==void 0&&h!==null&&(R=x(b,h));var z=N?{role:"status","aria-live":"assertive"}:{};return q.createElement("div",J1({className:k,style:P},z),q.createElement("p",{className:M,style:A},q.isValidElement(R)?R:"".concat(R)),_())};function hd(e){"@babel/helpers - typeof";return hd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hd(e)}function Lp(e,t,n){return t=AJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AJ(e){var t=EJ(e,"string");return hd(t)=="symbol"?t:t+""}function EJ(e,t){if(hd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(hd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ou="recharts-tooltip-wrapper",PJ={visibility:"hidden"};function OJ(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return jt(Ou,Lp(Lp(Lp(Lp({},"".concat(Ou,"-right"),Le(n)&&t&&Le(t.x)&&n>=t.x),"".concat(Ou,"-left"),Le(n)&&t&&Le(t.x)&&n<t.x),"".concat(Ou,"-bottom"),Le(r)&&t&&Le(t.y)&&r>=t.y),"".concat(Ou,"-top"),Le(r)&&t&&Le(t.y)&&r<t.y))}function Sk(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&&Le(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 y=h,g=d[r];return y<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 RJ(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 kJ(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=Sk({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:a,reverseDirection:i,tooltipDimension:o.width,viewBox:d,viewBoxDimension:d.width}),p=Sk({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:a,reverseDirection:i,tooltipDimension:o.height,viewBox:d,viewBoxDimension:d.height}),f=RJ({translateX:h,translateY:p,useTranslate3d:c})):f=PJ,{cssProperties:f,cssClasses:OJ({translateX:h,translateY:p,coordinate:n})}}function tc(e){"@babel/helpers - typeof";return tc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tc(e)}function Nk(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 Ck(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Nk(Object(n),!0).forEach(function(r){ej(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function IJ(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,g5(r.key),r)}}function MJ(e,t,n){return t&&IJ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function $J(e,t,n){return t=Ch(t),DJ(e,v5()?Reflect.construct(t,n||[],Ch(e).constructor):t.apply(e,n))}function DJ(e,t){if(t&&(tc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return LJ(e)}function LJ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(v5=function(){return!!e})()}function Ch(e){return Ch=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ch(e)}function FJ(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&&Z1(e,t)}function Z1(e,t){return Z1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Z1(e,t)}function ej(e,t,n){return t=g5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g5(e){var t=BJ(e,"string");return tc(t)=="symbol"?t:t+""}function BJ(e,t){if(tc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(tc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var _k=1,zJ=(function(e){function t(){var n;TJ(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=$J(this,t,[].concat(a)),ej(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),ej(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 FJ(t,e),MJ(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>_k||Math.abs(r.height-this.state.lastBoundingBox.height)>_k)&&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,y=a.isAnimationActive,g=a.offset,j=a.position,b=a.reverseDirection,x=a.useTranslate3d,S=a.viewBox,N=a.wrapperStyle,_=kJ({allowEscapeViewBox:o,coordinate:h,offsetTopLeft:g,position:j,reverseDirection:b,tooltipBox:this.state.lastBoundingBox,useTranslate3d:x,viewBox:S}),P=_.cssClasses,A=_.cssProperties,O=Ck(Ck({transition:y&&i?"transform ".concat(c,"ms ").concat(d):void 0},A),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&p?"visible":"hidden",position:"absolute",top:0,left:0},N);return q.createElement("div",{tabIndex:-1,className:P,style:O,ref:function(k){r.wrapperNode=k}},f)}}])})(v.PureComponent),UJ=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Fo={isSsr:UJ()};function nc(e){"@babel/helpers - typeof";return nc=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},nc(e)}function Ak(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 Ek(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ak(Object(n),!0).forEach(function(r){xN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ak(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function WJ(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,x5(r.key),r)}}function VJ(e,t,n){return t&&WJ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function HJ(e,t,n){return t=_h(t),KJ(e,y5()?Reflect.construct(t,n||[],_h(e).constructor):t.apply(e,n))}function KJ(e,t){if(t&&(nc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return GJ(e)}function GJ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(y5=function(){return!!e})()}function _h(e){return _h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_h(e)}function YJ(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&&tj(e,t)}function tj(e,t){return tj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},tj(e,t)}function xN(e,t,n){return t=x5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x5(e){var t=XJ(e,"string");return nc(t)=="symbol"?t:t+""}function XJ(e,t){if(nc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(nc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function QJ(e){return e.dataKey}function JJ(e,t){return q.isValidElement(e)?q.cloneElement(e,t):typeof e=="function"?q.createElement(e,t):q.createElement(_J,t)}var Yr=(function(e){function t(){return qJ(this,t),HJ(this,t,arguments)}return YJ(t,e),VJ(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,y=a.isAnimationActive,g=a.offset,j=a.payload,b=a.payloadUniqBy,x=a.position,S=a.reverseDirection,N=a.useTranslate3d,_=a.viewBox,P=a.wrapperStyle,A=j??[];p&&A.length&&(A=c5(j.filter(function(R){return R.value!=null&&(R.hide!==!0||r.props.includeHidden)}),b,QJ));var O=A.length>0;return q.createElement(zJ,{allowEscapeViewBox:o,animationDuration:c,animationEasing:d,isAnimationActive:y,active:i,coordinate:h,hasPayload:O,offset:g,position:x,reverseDirection:S,useTranslate3d:N,viewBox:_,wrapperStyle:P},JJ(f,Ek(Ek({},this.props),{},{payload:A})))}}])})(v.PureComponent);xN(Yr,"displayName","Tooltip");xN(Yr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Fo.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 ow,Pk;function ZJ(){if(Pk)return ow;Pk=1;var e=bs(),t=function(){return e.Date.now()};return ow=t,ow}var lw,Ok;function eZ(){if(Ok)return lw;Ok=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return lw=t,lw}var cw,Rk;function tZ(){if(Rk)return cw;Rk=1;var e=eZ(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return cw=n,cw}var uw,kk;function b5(){if(kk)return uw;kk=1;var e=tZ(),t=zi(),n=$c(),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 uw=d,uw}var dw,Tk;function nZ(){if(Tk)return dw;Tk=1;var e=zi(),t=ZJ(),n=b5(),r="Expected a function",a=Math.max,i=Math.min;function o(c,d,f){var h,p,y,g,j,b,x=0,S=!1,N=!1,_=!0;if(typeof c!="function")throw new TypeError(r);d=n(d)||0,e(f)&&(S=!!f.leading,N="maxWait"in f,y=N?a(n(f.maxWait)||0,d):y,_="trailing"in f?!!f.trailing:_);function P(G){var U=h,H=p;return h=p=void 0,x=G,g=c.apply(H,U),g}function A(G){return x=G,j=setTimeout(k,d),S?P(G):g}function O(G){var U=G-b,H=G-x,Q=d-U;return N?i(Q,y-H):Q}function R(G){var U=G-b,H=G-x;return b===void 0||U>=d||U<0||N&&H>=y}function k(){var G=t();if(R(G))return M(G);j=setTimeout(k,O(G))}function M(G){return j=void 0,_&&h?P(G):(h=p=void 0,g)}function z(){j!==void 0&&clearTimeout(j),x=0,h=b=p=j=void 0}function B(){return j===void 0?g:M(t())}function L(){var G=t(),U=R(G);if(h=arguments,p=this,b=G,U){if(j===void 0)return A(b);if(N)return clearTimeout(j),j=setTimeout(k,d),P(b)}return j===void 0&&(j=setTimeout(k,d)),g}return L.cancel=z,L.flush=B,L}return dw=o,dw}var fw,Ik;function rZ(){if(Ik)return fw;Ik=1;var e=nZ(),t=zi(),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 fw=r,fw}var aZ=rZ();const w5=Vt(aZ);function md(e){"@babel/helpers - typeof";return md=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},md(e)}function Mk(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 Fp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Mk(Object(n),!0).forEach(function(r){sZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sZ(e,t,n){return t=iZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iZ(e){var t=oZ(e,"string");return md(t)=="symbol"?t:t+""}function oZ(e,t){if(md(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(md(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lZ(e,t){return fZ(e)||dZ(e,t)||uZ(e,t)||cZ()}function cZ(){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 uZ(e,t){if(e){if(typeof e=="string")return $k(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 $k(e,t)}}function $k(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 dZ(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 fZ(e){if(Array.isArray(e))return e}var nj=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,y=e.maxHeight,g=e.children,j=e.debounce,b=j===void 0?0:j,x=e.id,S=e.className,N=e.onResize,_=e.style,P=_===void 0?{}:_,A=v.useRef(null),O=v.useRef();O.current=N,v.useImperativeHandle(t,function(){return Object.defineProperty(A.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),A.current},configurable:!0})});var R=v.useState({containerWidth:a.width,containerHeight:a.height}),k=lZ(R,2),M=k[0],z=k[1],B=v.useCallback(function(G,U){z(function(H){var Q=Math.round(G),J=Math.round(U);return H.containerWidth===Q&&H.containerHeight===J?H:{containerWidth:Q,containerHeight:J}})},[]);v.useEffect(function(){var G=function(D){var X,F=D[0].contentRect,$=F.width,ee=F.height;B($,ee),(X=O.current)===null||X===void 0||X.call(O,$,ee)};b>0&&(G=w5(G,b,{trailing:!0,leading:!1}));var U=new ResizeObserver(G),H=A.current.getBoundingClientRect(),Q=H.width,J=H.height;return B(Q,J),U.observe(A.current),function(){U.disconnect()}},[B,b]);var L=v.useMemo(function(){var G=M.containerWidth,U=M.containerHeight;if(G<0||U<0)return null;Us(mo(o)||mo(d),`The width(%s) and height(%s) are both fixed numbers,
62
+ maybe you don't need to use a ResponsiveContainer.`,o,d),Us(!n||n>0,"The aspect(%s) must be greater than zero.",n);var H=mo(o)?G:o,Q=mo(d)?U:d;n&&n>0&&(H?Q=H/n:Q&&(H=Q*n),y&&Q>y&&(Q=y)),Us(H>0||Q>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,Q,o,d,h,p,n);var J=!Array.isArray(g)&&zs(g.type).endsWith("Chart");return q.Children.map(g,function(T){return q.isValidElement(T)?v.cloneElement(T,Fp({width:H,height:Q},J?{style:Fp({height:"100%",width:"100%",maxHeight:Q,maxWidth:H},T.props.style)}:{})):T})},[n,g,d,y,p,h,M,o]);return q.createElement("div",{id:x?"".concat(x):void 0,className:jt("recharts-responsive-container",S),style:Fp(Fp({},P),{},{width:o,height:d,minWidth:h,minHeight:p,maxHeight:y}),ref:A},L)}),dv=function(t){return null};dv.displayName="Cell";function vd(e){"@babel/helpers - typeof";return vd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vd(e)}function Dk(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 rj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Dk(Object(n),!0).forEach(function(r){pZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pZ(e,t,n){return t=hZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hZ(e){var t=mZ(e,"string");return vd(t)=="symbol"?t:t+""}function mZ(e,t){if(vd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(vd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var bl={widthCache:{},cacheCount:0},vZ=2e3,gZ={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},Lk="recharts_measurement_span";function yZ(e){var t=rj({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var Xu=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Fo.isSsr)return{width:0,height:0};var r=yZ(n),a=JSON.stringify({text:t,copyStyle:r});if(bl.widthCache[a])return bl.widthCache[a];try{var i=document.getElementById(Lk);i||(i=document.createElement("span"),i.setAttribute("id",Lk),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var o=rj(rj({},gZ),r);Object.assign(i.style,o),i.textContent="".concat(t);var c=i.getBoundingClientRect(),d={width:c.width,height:c.height};return bl.widthCache[a]=d,++bl.cacheCount>vZ&&(bl.cacheCount=0,bl.widthCache={}),d}catch{return{width:0,height:0}}},xZ=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};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 Ah(e,t){return SZ(e)||jZ(e,t)||wZ(e,t)||bZ()}function bZ(){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 wZ(e,t){if(e){if(typeof e=="string")return Fk(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 Fk(e,t)}}function Fk(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 jZ(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 SZ(e){if(Array.isArray(e))return e}function NZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bk(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,_Z(r.key),r)}}function CZ(e,t,n){return t&&Bk(e.prototype,t),n&&Bk(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _Z(e){var t=AZ(e,"string");return gd(t)=="symbol"?t:t+""}function AZ(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 String(e)}var zk=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Uk=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,EZ=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,PZ=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,j5={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},OZ=Object.keys(j5),Pl="NaN";function RZ(e,t){return e*j5[t]}var Bp=(function(){function e(t,n){NZ(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!EZ.test(n)&&(this.num=NaN,this.unit=""),OZ.includes(n)&&(this.num=RZ(t,n),this.unit="px")}return CZ(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=PZ.exec(n))!==null&&r!==void 0?r:[],i=Ah(a,3),o=i[1],c=i[2];return new e(parseFloat(o),c??"")}}])})();function S5(e){if(e.includes(Pl))return Pl;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=zk.exec(t))!==null&&n!==void 0?n:[],a=Ah(r,4),i=a[1],o=a[2],c=a[3],d=Bp.parse(i??""),f=Bp.parse(c??""),h=o==="*"?d.multiply(f):d.divide(f);if(h.isNaN())return Pl;t=t.replace(zk,h.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var p,y=(p=Uk.exec(t))!==null&&p!==void 0?p:[],g=Ah(y,4),j=g[1],b=g[2],x=g[3],S=Bp.parse(j??""),N=Bp.parse(x??""),_=b==="+"?S.add(N):S.subtract(N);if(_.isNaN())return Pl;t=t.replace(Uk,_.toString())}return t}var qk=/\(([^()]*)\)/;function kZ(e){for(var t=e;t.includes("(");){var n=qk.exec(t),r=Ah(n,2),a=r[1];t=t.replace(qk,S5(a))}return t}function TZ(e){var t=e.replace(/\s+/g,"");return t=kZ(t),t=S5(t),t}function IZ(e){try{return TZ(e)}catch{return Pl}}function pw(e){var t=IZ(e.slice(5,-1));return t===Pl?"":t}var MZ=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],$Z=["dx","dy","angle","className","breakAll"];function aj(){return aj=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},aj.apply(this,arguments)}function Wk(e,t){if(e==null)return{};var n=DZ(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 DZ(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 Vk(e,t){return zZ(e)||BZ(e,t)||FZ(e,t)||LZ()}function LZ(){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 FZ(e,t){if(e){if(typeof e=="string")return Hk(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 Hk(e,t)}}function Hk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function BZ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,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 zZ(e){if(Array.isArray(e))return e}var N5=/[ \f\n\r\t\v\u2028\u2029]+/,C5=function(t){var n=t.children,r=t.breakAll,a=t.style;try{var i=[];wt(n)||(r?i=n.toString().split(""):i=n.toString().split(N5));var o=i.map(function(d){return{word:d,width:Xu(d,a).width}}),c=r?0:Xu(" ",a).width;return{wordsWithComputedWidth:o,spaceWidth:c}}catch{return null}},UZ=function(t,n,r,a,i){var o=t.maxLines,c=t.children,d=t.style,f=t.breakAll,h=Le(o),p=c,y=function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return H.reduce(function(Q,J){var T=J.word,D=J.width,X=Q[Q.length-1];if(X&&(a==null||i||X.width+D+r<Number(a)))X.words.push(T),X.width+=D+r;else{var F={words:[T],width:D};Q.push(F)}return Q},[])},g=y(n),j=function(H){return H.reduce(function(Q,J){return Q.width>J.width?Q:J})};if(!h)return g;for(var b="…",x=function(H){var Q=p.slice(0,H),J=C5({breakAll:f,style:d,children:Q+b}).wordsWithComputedWidth,T=y(J),D=T.length>o||j(T).width>Number(a);return[D,T]},S=0,N=p.length-1,_=0,P;S<=N&&_<=p.length-1;){var A=Math.floor((S+N)/2),O=A-1,R=x(O),k=Vk(R,2),M=k[0],z=k[1],B=x(A),L=Vk(B,1),G=L[0];if(!M&&!G&&(S=A+1),M&&G&&(N=A-1),!M&&G){P=z;break}_++}return P||g},Kk=function(t){var n=wt(t)?[]:t.toString().split(N5);return[{words:n}]},qZ=function(t){var n=t.width,r=t.scaleToFit,a=t.children,i=t.style,o=t.breakAll,c=t.maxLines;if((n||r)&&!Fo.isSsr){var d,f,h=C5({breakAll:o,children:a,style:i});if(h){var p=h.wordsWithComputedWidth,y=h.spaceWidth;d=p,f=y}else return Kk(a);return UZ({breakAll:o,children:a,maxLines:c,style:i},d,f,n,r)}return Kk(a)},Gk="#808080",Ao=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,y=t.textAnchor,g=y===void 0?"start":y,j=t.verticalAnchor,b=j===void 0?"end":j,x=t.fill,S=x===void 0?Gk:x,N=Wk(t,MZ),_=v.useMemo(function(){return qZ({breakAll:N.breakAll,children:N.children,maxLines:N.maxLines,scaleToFit:p,style:N.style,width:N.width})},[N.breakAll,N.children,N.maxLines,p,N.style,N.width]),P=N.dx,A=N.dy,O=N.angle,R=N.className,k=N.breakAll,M=Wk(N,$Z);if(!Vn(r)||!Vn(i))return null;var z=r+(Le(P)?P:0),B=i+(Le(A)?A:0),L;switch(b){case"start":L=pw("calc(".concat(f,")"));break;case"middle":L=pw("calc(".concat((_.length-1)/2," * -").concat(c," + (").concat(f," / 2))"));break;default:L=pw("calc(".concat(_.length-1," * -").concat(c,")"));break}var G=[];if(p){var U=_[0].width,H=N.width;G.push("scale(".concat((Le(H)?H/U:1)/U,")"))}return O&&G.push("rotate(".concat(O,", ").concat(z,", ").concat(B,")")),G.length&&(M.transform=G.join(" ")),q.createElement("text",aj({},ht(M,!0),{x:z,y:B,className:jt("recharts-text",R),textAnchor:g,fill:S.includes("url")?Gk:S}),_.map(function(Q,J){var T=Q.words.join(k?"":" ");return q.createElement("tspan",{x:z,dy:J===0?L:c,key:"".concat(T,"-").concat(J)},T)}))};function ki(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function WZ(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function bN(e){let t,n,r;e.length!==2?(t=ki,n=(c,d)=>ki(e(c),d),r=(c,d)=>e(c)-d):(t=e===ki||e===WZ?e:VZ,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 VZ(){return 0}function _5(e){return e===null?NaN:+e}function*HZ(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const KZ=bN(ki),df=KZ.right;bN(_5).center;class Yk extends Map{constructor(t,n=XZ){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(Xk(this,t))}has(t){return super.has(Xk(this,t))}set(t,n){return super.set(GZ(this,t),n)}delete(t){return super.delete(YZ(this,t))}}function Xk({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function GZ({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function YZ({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function XZ(e){return e!==null&&typeof e=="object"?e.valueOf():e}function QZ(e=ki){if(e===ki)return A5;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 A5(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const JZ=Math.sqrt(50),ZZ=Math.sqrt(10),eee=Math.sqrt(2);function Eh(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>=JZ?10:i>=ZZ?5:i>=eee?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?Eh(e,t,n*2):[c,d,f]}function sj(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?Eh(t,e,n):Eh(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 ij(e,t,n){return t=+t,e=+e,n=+n,Eh(e,t,n)[2]}function oj(e,t,n){t=+t,e=+e,n=+n;const r=t<e,a=r?ij(t,e,n):ij(e,t,n);return(r?-1:1)*(a<0?1/-a:a)}function Qk(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function Jk(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function E5(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?A5:QZ(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),y=.5*Math.sqrt(h*p*(d-p)/d)*(f-d/2<0?-1:1),g=Math.max(n,Math.floor(t-f*p/d+y)),j=Math.min(r,Math.floor(t+(d-f)*p/d+y));E5(e,t,g,j,a)}const i=e[t];let o=n,c=r;for(Ru(e,n,t),a(e[r],i)>0&&Ru(e,n,r);o<c;){for(Ru(e,o,c),++o,--c;a(e[o],i)<0;)++o;for(;a(e[c],i)>0;)--c}a(e[n],i)===0?Ru(e,n,c):(++c,Ru(e,c,r)),c<=t&&(n=c+1),t<=c&&(r=c-1)}return e}function Ru(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function tee(e,t,n){if(e=Float64Array.from(HZ(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Jk(e);if(t>=1)return Qk(e);var r,a=(r-1)*t,i=Math.floor(a),o=Qk(E5(e,i).subarray(0,i+1)),c=Jk(e.subarray(i+1));return o+(c-o)*(a-i)}}function nee(e,t,n=_5){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 ree(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 Aa(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function ei(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 lj=Symbol("implicit");function wN(){var e=new Yk,t=[],n=[],r=lj;function a(i){let o=e.get(i);if(o===void 0){if(r!==lj)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 Yk;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 wN(t,n).unknown(r)},Aa.apply(a,arguments),a}function yd(){var e=wN().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 y=t().length,g=a<r,j=g?a:r,b=g?r:a;i=(b-j)/Math.max(1,y-d+f*2),c&&(i=Math.floor(i)),j+=(b-j-i*(y-d))*h,o=i*(1-d),c&&(j=Math.round(j),o=Math.round(o));var x=ree(y).map(function(S){return j+i*S});return n(g?x.reverse():x)}return e.domain=function(y){return arguments.length?(t(y),p()):t()},e.range=function(y){return arguments.length?([r,a]=y,r=+r,a=+a,p()):[r,a]},e.rangeRound=function(y){return[r,a]=y,r=+r,a=+a,c=!0,p()},e.bandwidth=function(){return o},e.step=function(){return i},e.round=function(y){return arguments.length?(c=!!y,p()):c},e.padding=function(y){return arguments.length?(d=Math.min(1,f=+y),p()):d},e.paddingInner=function(y){return arguments.length?(d=Math.min(1,y),p()):d},e.paddingOuter=function(y){return arguments.length?(f=+y,p()):f},e.align=function(y){return arguments.length?(h=Math.max(0,Math.min(1,y)),p()):h},e.copy=function(){return yd(t(),[r,a]).round(c).paddingInner(d).paddingOuter(f).align(h)},Aa.apply(p(),arguments)}function P5(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return P5(t())},e}function Qu(){return P5(yd.apply(null,arguments).paddingInner(1))}function jN(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function O5(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ff(){}var xd=.7,Ph=1/xd,Ul="\\s*([+-]?\\d+)\\s*",bd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ds="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",aee=/^#([0-9a-f]{3,8})$/,see=new RegExp(`^rgb\\(${Ul},${Ul},${Ul}\\)$`),iee=new RegExp(`^rgb\\(${ds},${ds},${ds}\\)$`),oee=new RegExp(`^rgba\\(${Ul},${Ul},${Ul},${bd}\\)$`),lee=new RegExp(`^rgba\\(${ds},${ds},${ds},${bd}\\)$`),cee=new RegExp(`^hsl\\(${bd},${ds},${ds}\\)$`),uee=new RegExp(`^hsla\\(${bd},${ds},${ds},${bd}\\)$`),Zk={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};jN(ff,wd,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:e2,formatHex:e2,formatHex8:dee,formatHsl:fee,formatRgb:t2,toString:t2});function e2(){return this.rgb().formatHex()}function dee(){return this.rgb().formatHex8()}function fee(){return R5(this).formatHsl()}function t2(){return this.rgb().formatRgb()}function wd(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=aee.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?n2(t):n===3?new Mr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?zp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?zp(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=see.exec(e))?new Mr(t[1],t[2],t[3],1):(t=iee.exec(e))?new Mr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=oee.exec(e))?zp(t[1],t[2],t[3],t[4]):(t=lee.exec(e))?zp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=cee.exec(e))?s2(t[1],t[2]/100,t[3]/100,1):(t=uee.exec(e))?s2(t[1],t[2]/100,t[3]/100,t[4]):Zk.hasOwnProperty(e)?n2(Zk[e]):e==="transparent"?new Mr(NaN,NaN,NaN,0):null}function n2(e){return new Mr(e>>16&255,e>>8&255,e&255,1)}function zp(e,t,n,r){return r<=0&&(e=t=n=NaN),new Mr(e,t,n,r)}function pee(e){return e instanceof ff||(e=wd(e)),e?(e=e.rgb(),new Mr(e.r,e.g,e.b,e.opacity)):new Mr}function cj(e,t,n,r){return arguments.length===1?pee(e):new Mr(e,t,n,r??1)}function Mr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}jN(Mr,cj,O5(ff,{brighter(e){return e=e==null?Ph:Math.pow(Ph,e),new Mr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?xd:Math.pow(xd,e),new Mr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Mr(bo(this.r),bo(this.g),bo(this.b),Oh(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:r2,formatHex:r2,formatHex8:hee,formatRgb:a2,toString:a2}));function r2(){return`#${vo(this.r)}${vo(this.g)}${vo(this.b)}`}function hee(){return`#${vo(this.r)}${vo(this.g)}${vo(this.b)}${vo((isNaN(this.opacity)?1:this.opacity)*255)}`}function a2(){const e=Oh(this.opacity);return`${e===1?"rgb(":"rgba("}${bo(this.r)}, ${bo(this.g)}, ${bo(this.b)}${e===1?")":`, ${e})`}`}function Oh(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function bo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function vo(e){return e=bo(e),(e<16?"0":"")+e.toString(16)}function s2(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new za(e,t,n,r)}function R5(e){if(e instanceof za)return new za(e.h,e.s,e.l,e.opacity);if(e instanceof ff||(e=wd(e)),!e)return new za;if(e instanceof za)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,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 za(o,c,d,e.opacity)}function mee(e,t,n,r){return arguments.length===1?R5(e):new za(e,t,n,r??1)}function za(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}jN(za,mee,O5(ff,{brighter(e){return e=e==null?Ph:Math.pow(Ph,e),new za(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?xd:Math.pow(xd,e),new za(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new Mr(hw(e>=240?e-240:e+120,a,r),hw(e,a,r),hw(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new za(i2(this.h),Up(this.s),Up(this.l),Oh(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=Oh(this.opacity);return`${e===1?"hsl(":"hsla("}${i2(this.h)}, ${Up(this.s)*100}%, ${Up(this.l)*100}%${e===1?")":`, ${e})`}`}}));function i2(e){return e=(e||0)%360,e<0?e+360:e}function Up(e){return Math.max(0,Math.min(1,e||0))}function hw(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 SN=e=>()=>e;function vee(e,t){return function(n){return e+n*t}}function gee(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 yee(e){return(e=+e)==1?k5:function(t,n){return n-t?gee(t,n,e):SN(isNaN(t)?n:t)}}function k5(e,t){var n=t-e;return n?vee(e,n):SN(isNaN(e)?t:e)}const o2=(function e(t){var n=yee(t);function r(a,i){var o=n((a=cj(a)).r,(i=cj(i)).r),c=n(a.g,i.g),d=n(a.b,i.b),f=k5(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 xee(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 bee(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function wee(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]=Bc(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 jee(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Rh(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function See(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]=Bc(e[a],t[a]):r[a]=t[a];return function(i){for(a in n)r[a]=n[a](i);return r}}var uj=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,mw=new RegExp(uj.source,"g");function Nee(e){return function(){return e}}function Cee(e){return function(t){return e(t)+""}}function _ee(e,t){var n=uj.lastIndex=mw.lastIndex=0,r,a,i,o=-1,c=[],d=[];for(e=e+"",t=t+"";(r=uj.exec(e))&&(a=mw.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:Rh(r,a)})),n=mw.lastIndex;return n<t.length&&(i=t.slice(n),c[o]?c[o]+=i:c[++o]=i),c.length<2?d[0]?Cee(d[0].x):Nee(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 Bc(e,t){var n=typeof t,r;return t==null||n==="boolean"?SN(t):(n==="number"?Rh:n==="string"?(r=wd(t))?(t=r,o2):_ee:t instanceof wd?o2:t instanceof Date?jee:bee(t)?xee:Array.isArray(t)?wee:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?See:Rh)(e,t)}function NN(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Aee(e,t){t===void 0&&(t=e,e=Bc);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 Eee(e){return function(){return e}}function kh(e){return+e}var l2=[0,1];function Sr(e){return e}function dj(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Eee(isNaN(t)?NaN:.5)}function Pee(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Oee(e,t,n){var r=e[0],a=e[1],i=t[0],o=t[1];return a<r?(r=dj(a,r),i=n(o,i)):(r=dj(r,a),i=n(i,o)),function(c){return i(r(c))}}function Ree(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]=dj(e[o],e[o+1]),i[o]=n(t[o],t[o+1]);return function(c){var d=df(e,c,1,r)-1;return i[d](a[d](c))}}function pf(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function fv(){var e=l2,t=l2,n=Bc,r,a,i,o=Sr,c,d,f;function h(){var y=Math.min(e.length,t.length);return o!==Sr&&(o=Pee(e[0],e[y-1])),c=y>2?Ree:Oee,d=f=null,p}function p(y){return y==null||isNaN(y=+y)?i:(d||(d=c(e.map(r),t,n)))(r(o(y)))}return p.invert=function(y){return o(a((f||(f=c(t,e.map(r),Rh)))(y)))},p.domain=function(y){return arguments.length?(e=Array.from(y,kh),h()):e.slice()},p.range=function(y){return arguments.length?(t=Array.from(y),h()):t.slice()},p.rangeRound=function(y){return t=Array.from(y),n=NN,h()},p.clamp=function(y){return arguments.length?(o=y?!0:Sr,h()):o!==Sr},p.interpolate=function(y){return arguments.length?(n=y,h()):n},p.unknown=function(y){return arguments.length?(i=y,p):i},function(y,g){return r=y,a=g,h()}}function CN(){return fv()(Sr,Sr)}function kee(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Th(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 rc(e){return e=Th(Math.abs(e)),e?e[1]:NaN}function Tee(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 Iee(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Mee=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function jd(e){if(!(t=Mee.exec(e)))throw new Error("invalid format: "+e);var t;return new _N({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]})}jd.prototype=_N.prototype;function _N(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+""}_N.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 $ee(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 Ih;function Dee(e,t){var n=Th(e,t);if(!n)return Ih=void 0,e.toPrecision(t);var r=n[0],a=n[1],i=a-(Ih=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")+Th(e,Math.max(0,t+i-1))[0]}function c2(e,t){var n=Th(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 u2={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:kee,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)=>c2(e*100,t),r:c2,s:Dee,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function d2(e){return e}var f2=Array.prototype.map,p2=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Lee(e){var t=e.grouping===void 0||e.thousands===void 0?d2:Tee(f2.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?d2:Iee(f2.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,y){p=jd(p);var g=p.fill,j=p.align,b=p.sign,x=p.symbol,S=p.zero,N=p.width,_=p.comma,P=p.precision,A=p.trim,O=p.type;O==="n"?(_=!0,O="g"):u2[O]||(P===void 0&&(P=12),A=!0,O="g"),(S||g==="0"&&j==="=")&&(S=!0,g="0",j="=");var R=(y&&y.prefix!==void 0?y.prefix:"")+(x==="$"?n:x==="#"&&/[boxX]/.test(O)?"0"+O.toLowerCase():""),k=(x==="$"?r:/[%p]/.test(O)?o:"")+(y&&y.suffix!==void 0?y.suffix:""),M=u2[O],z=/[defgprs%]/.test(O);P=P===void 0?6:/[gprs]/.test(O)?Math.max(1,Math.min(21,P)):Math.max(0,Math.min(20,P));function B(L){var G=R,U=k,H,Q,J;if(O==="c")U=M(L)+U,L="";else{L=+L;var T=L<0||1/L<0;if(L=isNaN(L)?d:M(Math.abs(L),P),A&&(L=$ee(L)),T&&+L==0&&b!=="+"&&(T=!1),G=(T?b==="("?b:c:b==="-"||b==="("?"":b)+G,U=(O==="s"&&!isNaN(L)&&Ih!==void 0?p2[8+Ih/3]:"")+U+(T&&b==="("?")":""),z){for(H=-1,Q=L.length;++H<Q;)if(J=L.charCodeAt(H),48>J||J>57){U=(J===46?a+L.slice(H+1):L.slice(H))+U,L=L.slice(0,H);break}}}_&&!S&&(L=t(L,1/0));var D=G.length+L.length+U.length,X=D<N?new Array(N-D+1).join(g):"";switch(_&&S&&(L=t(X+L,X.length?N-U.length:1/0),X=""),j){case"<":L=G+L+U+X;break;case"=":L=G+X+L+U;break;case"^":L=X.slice(0,D=X.length>>1)+G+L+U+X.slice(D);break;default:L=X+G+L+U;break}return i(L)}return B.toString=function(){return p+""},B}function h(p,y){var g=Math.max(-8,Math.min(8,Math.floor(rc(y)/3)))*3,j=Math.pow(10,-g),b=f((p=jd(p),p.type="f",p),{suffix:p2[8+g/3]});return function(x){return b(j*x)}}return{format:f,formatPrefix:h}}var qp,AN,T5;Fee({thousands:",",grouping:[3],currency:["$",""]});function Fee(e){return qp=Lee(e),AN=qp.format,T5=qp.formatPrefix,qp}function Bee(e){return Math.max(0,-rc(Math.abs(e)))}function zee(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(rc(t)/3)))*3-rc(Math.abs(e)))}function Uee(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,rc(t)-rc(e))+1}function I5(e,t,n,r){var a=oj(e,t,n),i;switch(r=jd(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(i=zee(a,o))&&(r.precision=i),T5(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=Uee(a,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=Bee(a))&&(r.precision=i-(r.type==="%")*2);break}}return AN(r)}function Ui(e){var t=e.domain;return e.ticks=function(n){var r=t();return sj(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var a=t();return I5(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=ij(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 Mh(){var e=CN();return e.copy=function(){return pf(e,Mh())},Aa.apply(e,arguments),Ui(e)}function M5(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,kh),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return M5(e).unknown(t)},e=arguments.length?Array.from(e,kh):[0,1],Ui(n)}function $5(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 h2(e){return Math.log(e)}function m2(e){return Math.exp(e)}function qee(e){return-Math.log(-e)}function Wee(e){return-Math.exp(-e)}function Vee(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Hee(e){return e===10?Vee:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Kee(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 v2(e){return(t,n)=>-e(-t,n)}function EN(e){const t=e(h2,m2),n=t.domain;let r=10,a,i;function o(){return a=Kee(r),i=Hee(r),n()[0]<0?(a=v2(a),i=v2(i),e(qee,Wee)):e(h2,m2),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 y=a(f),g=a(h),j,b;const x=c==null?10:+c;let S=[];if(!(r%1)&&g-y<x){if(y=Math.floor(y),g=Math.ceil(g),f>0){for(;y<=g;++y)for(j=1;j<r;++j)if(b=y<0?j/i(-y):j*i(y),!(b<f)){if(b>h)break;S.push(b)}}else for(;y<=g;++y)for(j=r-1;j>=1;--j)if(b=y>0?j/i(-y):j*i(y),!(b<f)){if(b>h)break;S.push(b)}S.length*2<x&&(S=sj(f,h,x))}else S=sj(y,g,Math.min(g-y,x)).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=jd(d)).precision==null&&(d.trim=!0),d=AN(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($5(n(),{floor:c=>i(Math.floor(a(c))),ceil:c=>i(Math.ceil(a(c)))})),t}function D5(){const e=EN(fv()).domain([1,10]);return e.copy=()=>pf(e,D5()).base(e.base()),Aa.apply(e,arguments),e}function g2(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function y2(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function PN(e){var t=1,n=e(g2(t),y2(t));return n.constant=function(r){return arguments.length?e(g2(t=+r),y2(t)):t},Ui(n)}function L5(){var e=PN(fv());return e.copy=function(){return pf(e,L5()).constant(e.constant())},Aa.apply(e,arguments)}function x2(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Gee(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Yee(e){return e<0?-e*e:e*e}function ON(e){var t=e(Sr,Sr),n=1;function r(){return n===1?e(Sr,Sr):n===.5?e(Gee,Yee):e(x2(n),x2(1/n))}return t.exponent=function(a){return arguments.length?(n=+a,r()):n},Ui(t)}function RN(){var e=ON(fv());return e.copy=function(){return pf(e,RN()).exponent(e.exponent())},Aa.apply(e,arguments),e}function Xee(){return RN.apply(null,arguments).exponent(.5)}function b2(e){return Math.sign(e)*e*e}function Qee(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function F5(){var e=CN(),t=[0,1],n=!1,r;function a(i){var o=Qee(e(i));return isNaN(o)?r:n?Math.round(o):o}return a.invert=function(i){return e.invert(b2(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,kh)).map(b2)),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 F5(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Aa.apply(a,arguments),Ui(a)}function B5(){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]=nee(e,o/c);return i}function i(o){return o==null||isNaN(o=+o)?r:t[df(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(ki),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 B5().domain(e).range(t).unknown(r)},Aa.apply(i,arguments)}function z5(){var e=0,t=1,n=1,r=[.5],a=[0,1],i;function o(d){return d!=null&&d<=d?a[df(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 z5().domain([e,t]).range(a).unknown(i)},Aa.apply(Ui(o),arguments)}function U5(){var e=[.5],t=[0,1],n,r=1;function a(i){return i!=null&&i<=i?t[df(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 U5().domain(e).range(t).unknown(n)},Aa.apply(a,arguments)}const vw=new Date,gw=new Date;function Yn(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=>Yn(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)=>(vw.setTime(+i),gw.setTime(+o),e(vw),e(gw),Math.floor(n(vw,gw))),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 $h=Yn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);$h.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Yn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):$h);$h.range;const Ls=1e3,xa=Ls*60,Fs=xa*60,Gs=Fs*24,kN=Gs*7,w2=Gs*30,yw=Gs*365,go=Yn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ls)},(e,t)=>(t-e)/Ls,e=>e.getUTCSeconds());go.range;const TN=Yn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ls)},(e,t)=>{e.setTime(+e+t*xa)},(e,t)=>(t-e)/xa,e=>e.getMinutes());TN.range;const IN=Yn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*xa)},(e,t)=>(t-e)/xa,e=>e.getUTCMinutes());IN.range;const MN=Yn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ls-e.getMinutes()*xa)},(e,t)=>{e.setTime(+e+t*Fs)},(e,t)=>(t-e)/Fs,e=>e.getHours());MN.range;const $N=Yn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Fs)},(e,t)=>(t-e)/Fs,e=>e.getUTCHours());$N.range;const hf=Yn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*xa)/Gs,e=>e.getDate()-1);hf.range;const pv=Yn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Gs,e=>e.getUTCDate()-1);pv.range;const q5=Yn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Gs,e=>Math.floor(e/Gs));q5.range;function Bo(e){return Yn(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())*xa)/kN)}const hv=Bo(0),Dh=Bo(1),Jee=Bo(2),Zee=Bo(3),ac=Bo(4),ete=Bo(5),tte=Bo(6);hv.range;Dh.range;Jee.range;Zee.range;ac.range;ete.range;tte.range;function zo(e){return Yn(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)/kN)}const mv=zo(0),Lh=zo(1),nte=zo(2),rte=zo(3),sc=zo(4),ate=zo(5),ste=zo(6);mv.range;Lh.range;nte.range;rte.range;sc.range;ate.range;ste.range;const DN=Yn(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());DN.range;const LN=Yn(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());LN.range;const Ys=Yn(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());Ys.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Yn(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)});Ys.range;const Xs=Yn(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());Xs.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Yn(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)});Xs.range;function W5(e,t,n,r,a,i){const o=[[go,1,Ls],[go,5,5*Ls],[go,15,15*Ls],[go,30,30*Ls],[i,1,xa],[i,5,5*xa],[i,15,15*xa],[i,30,30*xa],[a,1,Fs],[a,3,3*Fs],[a,6,6*Fs],[a,12,12*Fs],[r,1,Gs],[r,2,2*Gs],[n,1,kN],[t,1,w2],[t,3,3*w2],[e,1,yw]];function c(f,h,p){const y=h<f;y&&([f,h]=[h,f]);const g=p&&typeof p.range=="function"?p:d(f,h,p),j=g?g.range(f,+h+1):[];return y?j.reverse():j}function d(f,h,p){const y=Math.abs(h-f)/p,g=bN(([,,x])=>x).right(o,y);if(g===o.length)return e.every(oj(f/yw,h/yw,p));if(g===0)return $h.every(Math.max(oj(f,h,p),1));const[j,b]=o[y/o[g-1][2]<o[g][2]/y?g-1:g];return j.every(b)}return[c,d]}const[ite,ote]=W5(Xs,LN,mv,q5,$N,IN),[lte,cte]=W5(Ys,DN,hv,hf,MN,TN);function xw(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function bw(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 ku(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function ute(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=Tu(a),h=Iu(a),p=Tu(i),y=Iu(i),g=Tu(o),j=Iu(o),b=Tu(c),x=Iu(c),S=Tu(d),N=Iu(d),_={a:J,A:T,b:D,B:X,c:null,d:A2,e:A2,f:Tte,g:qte,G:Vte,H:Ote,I:Rte,j:kte,L:V5,m:Ite,M:Mte,p:F,q:$,Q:O2,s:R2,S:$te,u:Dte,U:Lte,V:Fte,w:Bte,W:zte,x:null,X:null,y:Ute,Y:Wte,Z:Hte,"%":P2},P={a:ee,A:ae,b:K,B:le,c:null,d:E2,e:E2,f:Xte,g:ine,G:lne,H:Kte,I:Gte,j:Yte,L:K5,m:Qte,M:Jte,p:te,q:de,Q:O2,s:R2,S:Zte,u:ene,U:tne,V:nne,w:rne,W:ane,x:null,X:null,y:sne,Y:one,Z:cne,"%":P2},A={a:z,A:B,b:L,B:G,c:U,d:C2,e:C2,f:_te,g:N2,G:S2,H:_2,I:_2,j:jte,L:Cte,m:wte,M:Ste,p:M,q:bte,Q:Ete,s:Pte,S:Nte,u:mte,U:vte,V:gte,w:hte,W:yte,x:H,X:Q,y:N2,Y:S2,Z:xte,"%":Ate};_.x=O(n,_),_.X=O(r,_),_.c=O(t,_),P.x=O(n,P),P.X=O(r,P),P.c=O(t,P);function O(oe,pe){return function(je){var se=[],$e=-1,Ae=0,Ye=oe.length,ye,Se,ze;for(je instanceof Date||(je=new Date(+je));++$e<Ye;)oe.charCodeAt($e)===37&&(se.push(oe.slice(Ae,$e)),(Se=j2[ye=oe.charAt(++$e)])!=null?ye=oe.charAt(++$e):Se=ye==="e"?" ":"0",(ze=pe[ye])&&(ye=ze(je,Se)),se.push(ye),Ae=$e+1);return se.push(oe.slice(Ae,$e)),se.join("")}}function R(oe,pe){return function(je){var se=ku(1900,void 0,1),$e=k(se,oe,je+="",0),Ae,Ye;if($e!=je.length)return null;if("Q"in se)return new Date(se.Q);if("s"in se)return new Date(se.s*1e3+("L"in se?se.L:0));if(pe&&!("Z"in se)&&(se.Z=0),"p"in se&&(se.H=se.H%12+se.p*12),se.m===void 0&&(se.m="q"in se?se.q:0),"V"in se){if(se.V<1||se.V>53)return null;"w"in se||(se.w=1),"Z"in se?(Ae=bw(ku(se.y,0,1)),Ye=Ae.getUTCDay(),Ae=Ye>4||Ye===0?Lh.ceil(Ae):Lh(Ae),Ae=pv.offset(Ae,(se.V-1)*7),se.y=Ae.getUTCFullYear(),se.m=Ae.getUTCMonth(),se.d=Ae.getUTCDate()+(se.w+6)%7):(Ae=xw(ku(se.y,0,1)),Ye=Ae.getDay(),Ae=Ye>4||Ye===0?Dh.ceil(Ae):Dh(Ae),Ae=hf.offset(Ae,(se.V-1)*7),se.y=Ae.getFullYear(),se.m=Ae.getMonth(),se.d=Ae.getDate()+(se.w+6)%7)}else("W"in se||"U"in se)&&("w"in se||(se.w="u"in se?se.u%7:"W"in se?1:0),Ye="Z"in se?bw(ku(se.y,0,1)).getUTCDay():xw(ku(se.y,0,1)).getDay(),se.m=0,se.d="W"in se?(se.w+6)%7+se.W*7-(Ye+5)%7:se.w+se.U*7-(Ye+6)%7);return"Z"in se?(se.H+=se.Z/100|0,se.M+=se.Z%100,bw(se)):xw(se)}}function k(oe,pe,je,se){for(var $e=0,Ae=pe.length,Ye=je.length,ye,Se;$e<Ae;){if(se>=Ye)return-1;if(ye=pe.charCodeAt($e++),ye===37){if(ye=pe.charAt($e++),Se=A[ye in j2?pe.charAt($e++):ye],!Se||(se=Se(oe,je,se))<0)return-1}else if(ye!=je.charCodeAt(se++))return-1}return se}function M(oe,pe,je){var se=f.exec(pe.slice(je));return se?(oe.p=h.get(se[0].toLowerCase()),je+se[0].length):-1}function z(oe,pe,je){var se=g.exec(pe.slice(je));return se?(oe.w=j.get(se[0].toLowerCase()),je+se[0].length):-1}function B(oe,pe,je){var se=p.exec(pe.slice(je));return se?(oe.w=y.get(se[0].toLowerCase()),je+se[0].length):-1}function L(oe,pe,je){var se=S.exec(pe.slice(je));return se?(oe.m=N.get(se[0].toLowerCase()),je+se[0].length):-1}function G(oe,pe,je){var se=b.exec(pe.slice(je));return se?(oe.m=x.get(se[0].toLowerCase()),je+se[0].length):-1}function U(oe,pe,je){return k(oe,t,pe,je)}function H(oe,pe,je){return k(oe,n,pe,je)}function Q(oe,pe,je){return k(oe,r,pe,je)}function J(oe){return o[oe.getDay()]}function T(oe){return i[oe.getDay()]}function D(oe){return d[oe.getMonth()]}function X(oe){return c[oe.getMonth()]}function F(oe){return a[+(oe.getHours()>=12)]}function $(oe){return 1+~~(oe.getMonth()/3)}function ee(oe){return o[oe.getUTCDay()]}function ae(oe){return i[oe.getUTCDay()]}function K(oe){return d[oe.getUTCMonth()]}function le(oe){return c[oe.getUTCMonth()]}function te(oe){return a[+(oe.getUTCHours()>=12)]}function de(oe){return 1+~~(oe.getUTCMonth()/3)}return{format:function(oe){var pe=O(oe+="",_);return pe.toString=function(){return oe},pe},parse:function(oe){var pe=R(oe+="",!1);return pe.toString=function(){return oe},pe},utcFormat:function(oe){var pe=O(oe+="",P);return pe.toString=function(){return oe},pe},utcParse:function(oe){var pe=R(oe+="",!0);return pe.toString=function(){return oe},pe}}}var j2={"-":"",_:" ",0:"0"},nr=/^\s*\d+/,dte=/^%/,fte=/[\\^$*+?|[\]().{}]/g;function Mt(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 pte(e){return e.replace(fte,"\\$&")}function Tu(e){return new RegExp("^(?:"+e.map(pte).join("|")+")","i")}function Iu(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function hte(e,t,n){var r=nr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function mte(e,t,n){var r=nr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function vte(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function gte(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function yte(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function S2(e,t,n){var r=nr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function N2(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 xte(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 bte(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 wte(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 C2(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function jte(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 _2(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Ste(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Nte(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Cte(e,t,n){var r=nr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function _te(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 Ate(e,t,n){var r=dte.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Ete(e,t,n){var r=nr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Pte(e,t,n){var r=nr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function A2(e,t){return Mt(e.getDate(),t,2)}function Ote(e,t){return Mt(e.getHours(),t,2)}function Rte(e,t){return Mt(e.getHours()%12||12,t,2)}function kte(e,t){return Mt(1+hf.count(Ys(e),e),t,3)}function V5(e,t){return Mt(e.getMilliseconds(),t,3)}function Tte(e,t){return V5(e,t)+"000"}function Ite(e,t){return Mt(e.getMonth()+1,t,2)}function Mte(e,t){return Mt(e.getMinutes(),t,2)}function $te(e,t){return Mt(e.getSeconds(),t,2)}function Dte(e){var t=e.getDay();return t===0?7:t}function Lte(e,t){return Mt(hv.count(Ys(e)-1,e),t,2)}function H5(e){var t=e.getDay();return t>=4||t===0?ac(e):ac.ceil(e)}function Fte(e,t){return e=H5(e),Mt(ac.count(Ys(e),e)+(Ys(e).getDay()===4),t,2)}function Bte(e){return e.getDay()}function zte(e,t){return Mt(Dh.count(Ys(e)-1,e),t,2)}function Ute(e,t){return Mt(e.getFullYear()%100,t,2)}function qte(e,t){return e=H5(e),Mt(e.getFullYear()%100,t,2)}function Wte(e,t){return Mt(e.getFullYear()%1e4,t,4)}function Vte(e,t){var n=e.getDay();return e=n>=4||n===0?ac(e):ac.ceil(e),Mt(e.getFullYear()%1e4,t,4)}function Hte(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Mt(t/60|0,"0",2)+Mt(t%60,"0",2)}function E2(e,t){return Mt(e.getUTCDate(),t,2)}function Kte(e,t){return Mt(e.getUTCHours(),t,2)}function Gte(e,t){return Mt(e.getUTCHours()%12||12,t,2)}function Yte(e,t){return Mt(1+pv.count(Xs(e),e),t,3)}function K5(e,t){return Mt(e.getUTCMilliseconds(),t,3)}function Xte(e,t){return K5(e,t)+"000"}function Qte(e,t){return Mt(e.getUTCMonth()+1,t,2)}function Jte(e,t){return Mt(e.getUTCMinutes(),t,2)}function Zte(e,t){return Mt(e.getUTCSeconds(),t,2)}function ene(e){var t=e.getUTCDay();return t===0?7:t}function tne(e,t){return Mt(mv.count(Xs(e)-1,e),t,2)}function G5(e){var t=e.getUTCDay();return t>=4||t===0?sc(e):sc.ceil(e)}function nne(e,t){return e=G5(e),Mt(sc.count(Xs(e),e)+(Xs(e).getUTCDay()===4),t,2)}function rne(e){return e.getUTCDay()}function ane(e,t){return Mt(Lh.count(Xs(e)-1,e),t,2)}function sne(e,t){return Mt(e.getUTCFullYear()%100,t,2)}function ine(e,t){return e=G5(e),Mt(e.getUTCFullYear()%100,t,2)}function one(e,t){return Mt(e.getUTCFullYear()%1e4,t,4)}function lne(e,t){var n=e.getUTCDay();return e=n>=4||n===0?sc(e):sc.ceil(e),Mt(e.getUTCFullYear()%1e4,t,4)}function cne(){return"+0000"}function P2(){return"%"}function O2(e){return+e}function R2(e){return Math.floor(+e/1e3)}var wl,Y5,X5;une({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 une(e){return wl=ute(e),Y5=wl.format,wl.parse,X5=wl.utcFormat,wl.utcParse,wl}function dne(e){return new Date(e)}function fne(e){return e instanceof Date?+e:+new Date(+e)}function FN(e,t,n,r,a,i,o,c,d,f){var h=CN(),p=h.invert,y=h.domain,g=f(".%L"),j=f(":%S"),b=f("%I:%M"),x=f("%I %p"),S=f("%a %d"),N=f("%b %d"),_=f("%B"),P=f("%Y");function A(O){return(d(O)<O?g:c(O)<O?j:o(O)<O?b:i(O)<O?x:r(O)<O?a(O)<O?S:N:n(O)<O?_:P)(O)}return h.invert=function(O){return new Date(p(O))},h.domain=function(O){return arguments.length?y(Array.from(O,fne)):y().map(dne)},h.ticks=function(O){var R=y();return e(R[0],R[R.length-1],O??10)},h.tickFormat=function(O,R){return R==null?A:f(R)},h.nice=function(O){var R=y();return(!O||typeof O.range!="function")&&(O=t(R[0],R[R.length-1],O??10)),O?y($5(R,O)):h},h.copy=function(){return pf(h,FN(e,t,n,r,a,i,o,c,d,f))},h}function pne(){return Aa.apply(FN(lte,cte,Ys,DN,hv,hf,MN,TN,go,Y5).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function hne(){return Aa.apply(FN(ite,ote,Xs,LN,mv,pv,$N,IN,go,X5).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function vv(){var e=0,t=1,n,r,a,i,o=Sr,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(y){var g,j;return arguments.length?([g,j]=y,o=p(g,j),f):[o(0),o(1)]}}return f.range=h(Bc),f.rangeRound=h(NN),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 qi(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Q5(){var e=Ui(vv()(Sr));return e.copy=function(){return qi(e,Q5())},ei.apply(e,arguments)}function J5(){var e=EN(vv()).domain([1,10]);return e.copy=function(){return qi(e,J5()).base(e.base())},ei.apply(e,arguments)}function Z5(){var e=PN(vv());return e.copy=function(){return qi(e,Z5()).constant(e.constant())},ei.apply(e,arguments)}function BN(){var e=ON(vv());return e.copy=function(){return qi(e,BN()).exponent(e.exponent())},ei.apply(e,arguments)}function mne(){return BN.apply(null,arguments).exponent(.5)}function eL(){var e=[],t=Sr;function n(r){if(r!=null&&!isNaN(r=+r))return t((df(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let a of r)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(ki),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)=>tee(e,i/r))},n.copy=function(){return eL(t).domain(e)},ei.apply(n,arguments)}function gv(){var e=0,t=.5,n=1,r=1,a,i,o,c,d,f=Sr,h,p=!1,y;function g(b){return isNaN(b=+b)?y:(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(x){var S,N,_;return arguments.length?([S,N,_]=x,f=Aee(b,[S,N,_]),g):[f(0),f(.5),f(1)]}}return g.range=j(Bc),g.rangeRound=j(NN),g.unknown=function(b){return arguments.length?(y=b,g):y},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 tL(){var e=Ui(gv()(Sr));return e.copy=function(){return qi(e,tL())},ei.apply(e,arguments)}function nL(){var e=EN(gv()).domain([.1,1,10]);return e.copy=function(){return qi(e,nL()).base(e.base())},ei.apply(e,arguments)}function rL(){var e=PN(gv());return e.copy=function(){return qi(e,rL()).constant(e.constant())},ei.apply(e,arguments)}function zN(){var e=ON(gv());return e.copy=function(){return qi(e,zN()).exponent(e.exponent())},ei.apply(e,arguments)}function vne(){return zN.apply(null,arguments).exponent(.5)}const k2=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:yd,scaleDiverging:tL,scaleDivergingLog:nL,scaleDivergingPow:zN,scaleDivergingSqrt:vne,scaleDivergingSymlog:rL,scaleIdentity:M5,scaleImplicit:lj,scaleLinear:Mh,scaleLog:D5,scaleOrdinal:wN,scalePoint:Qu,scalePow:RN,scaleQuantile:B5,scaleQuantize:z5,scaleRadial:F5,scaleSequential:Q5,scaleSequentialLog:J5,scaleSequentialPow:BN,scaleSequentialQuantile:eL,scaleSequentialSqrt:mne,scaleSequentialSymlog:Z5,scaleSqrt:Xee,scaleSymlog:L5,scaleThreshold:U5,scaleTime:pne,scaleUtc:hne,tickFormat:I5},Symbol.toStringTag,{value:"Module"}));var ww,T2;function yv(){if(T2)return ww;T2=1;var e=$c();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 ww=t,ww}var jw,I2;function aL(){if(I2)return jw;I2=1;function e(t,n){return t>n}return jw=e,jw}var Sw,M2;function gne(){if(M2)return Sw;M2=1;var e=yv(),t=aL(),n=Fc();function r(a){return a&&a.length?e(a,n,t):void 0}return Sw=r,Sw}var yne=gne();const xv=Vt(yne);var Nw,$2;function sL(){if($2)return Nw;$2=1;function e(t,n){return t<n}return Nw=e,Nw}var Cw,D2;function xne(){if(D2)return Cw;D2=1;var e=yv(),t=sL(),n=Fc();function r(a){return a&&a.length?e(a,n,t):void 0}return Cw=r,Cw}var bne=xne();const bv=Vt(bne);var _w,L2;function wne(){if(L2)return _w;L2=1;var e=rN(),t=ws(),n=h5(),r=$r();function a(i,o){var c=r(i)?e:n;return c(i,t(o,3))}return _w=a,_w}var Aw,F2;function jne(){if(F2)return Aw;F2=1;var e=f5(),t=wne();function n(r,a){return e(t(r,a),1)}return Aw=n,Aw}var Sne=jne();const Nne=Vt(Sne);var Ew,B2;function Cne(){if(B2)return Ew;B2=1;var e=vN();function t(n,r){return e(n,r)}return Ew=t,Ew}var _ne=Cne();const mf=Vt(_ne);var zc=1e9,Ane={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},qN,vn=!0,Ca="[DecimalError] ",wo=Ca+"Invalid argument: ",UN=Ca+"Exponent out of range: ",Uc=Math.floor,po=Math.pow,Ene=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Jr,er=1e7,pn=7,iL=9007199254740991,Fh=Uc(iL/pn),Qe={};Qe.absoluteValue=Qe.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Qe.comparedTo=Qe.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};Qe.decimalPlaces=Qe.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};Qe.dividedBy=Qe.div=function(e){return qs(this,new this.constructor(e))};Qe.dividedToIntegerBy=Qe.idiv=function(e){var t=this,n=t.constructor;return tn(qs(t,new n(e),0,1),n.precision)};Qe.equals=Qe.eq=function(e){return!this.cmp(e)};Qe.exponent=function(){return Dn(this)};Qe.greaterThan=Qe.gt=function(e){return this.cmp(e)>0};Qe.greaterThanOrEqualTo=Qe.gte=function(e){return this.cmp(e)>=0};Qe.isInteger=Qe.isint=function(){return this.e>this.d.length-2};Qe.isNegative=Qe.isneg=function(){return this.s<0};Qe.isPositive=Qe.ispos=function(){return this.s>0};Qe.isZero=function(){return this.s===0};Qe.lessThan=Qe.lt=function(e){return this.cmp(e)<0};Qe.lessThanOrEqualTo=Qe.lte=function(e){return this.cmp(e)<1};Qe.logarithm=Qe.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(Jr))throw Error(Ca+"NaN");if(n.s<1)throw Error(Ca+(n.s?"NaN":"-Infinity"));return n.eq(Jr)?new r(0):(vn=!1,t=qs(Sd(n,i),Sd(e,i),i),vn=!0,tn(t,a))};Qe.minus=Qe.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?cL(t,e):oL(t,(e.s=-e.s,e))};Qe.modulo=Qe.mod=function(e){var t,n=this,r=n.constructor,a=r.precision;if(e=new r(e),!e.s)throw Error(Ca+"NaN");return n.s?(vn=!1,t=qs(n,e,0,1).times(e),vn=!0,n.minus(t)):tn(new r(n),a)};Qe.naturalExponential=Qe.exp=function(){return lL(this)};Qe.naturalLogarithm=Qe.ln=function(){return Sd(this)};Qe.negated=Qe.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Qe.plus=Qe.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?oL(t,e):cL(t,(e.s=-e.s,e))};Qe.precision=Qe.sd=function(e){var t,n,r,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(wo+e);if(t=Dn(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};Qe.squareRoot=Qe.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(Ca+"NaN")}for(e=Dn(c),vn=!1,a=Math.sqrt(+c),a==0||a==1/0?(t=ls(c.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=Uc((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(qs(c,i,o+2)).times(.5),ls(i.d).slice(0,o)===(t=ls(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 vn=!0,tn(r,n)};Qe.times=Qe.mul=function(e){var t,n,r,a,i,o,c,d,f,h=this,p=h.constructor,y=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=y.length,f=g.length,d<f&&(i=y,y=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]*y[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,vn?tn(e,p.precision):e};Qe.toDecimalPlaces=Qe.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(ms(e,0,zc),t===void 0?t=r.rounding:ms(t,0,8),tn(n,e+Dn(n)+1,t))};Qe.toExponential=function(e,t){var n,r=this,a=r.constructor;return e===void 0?n=Eo(r,!0):(ms(e,0,zc),t===void 0?t=a.rounding:ms(t,0,8),r=tn(new a(r),e+1,t),n=Eo(r,!0,e+1)),n};Qe.toFixed=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?Eo(a):(ms(e,0,zc),t===void 0?t=i.rounding:ms(t,0,8),r=tn(new i(a),e+Dn(a)+1,t),n=Eo(r.abs(),!1,e+Dn(r)+1),a.isneg()&&!a.isZero()?"-"+n:n)};Qe.toInteger=Qe.toint=function(){var e=this,t=e.constructor;return tn(new t(e),Dn(e)+1,t.rounding)};Qe.toNumber=function(){return+this};Qe.toPower=Qe.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(Jr);if(c=new d(c),!c.s){if(e.s<1)throw Error(Ca+"Infinity");return c}if(c.eq(Jr))return c;if(r=d.precision,e.eq(Jr))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)<=iL){for(a=new d(Jr),t=Math.ceil(r/pn+4),vn=!1;n%2&&(a=a.times(c),U2(a.d,t)),n=Uc(n/2),n!==0;)c=c.times(c),U2(c.d,t);return vn=!0,e.s<0?new d(Jr).div(a):tn(a,r)}}else if(i<0)throw Error(Ca+"NaN");return i=i<0&&e.d[Math.max(t,n)]&1?-1:1,c.s=1,vn=!1,a=e.times(Sd(c,r+f)),vn=!0,a=lL(a),a.s=i,a};Qe.toPrecision=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?(n=Dn(a),r=Eo(a,n<=i.toExpNeg||n>=i.toExpPos)):(ms(e,1,zc),t===void 0?t=i.rounding:ms(t,0,8),a=tn(new i(a),e,t),n=Dn(a),r=Eo(a,e<=n||n<=i.toExpNeg,e)),r};Qe.toSignificantDigits=Qe.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(ms(e,1,zc),t===void 0?t=r.rounding:ms(t,0,8)),tn(new r(n),e,t)};Qe.toString=Qe.valueOf=Qe.val=Qe.toJSON=Qe[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Dn(e),n=e.constructor;return Eo(e,t<=n.toExpNeg||t>=n.toExpPos)};function oL(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)),vn?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,vn?tn(t,p):t}function ms(e,t,n){if(e!==~~e||e<t||e>n)throw Error(wo+e)}function ls(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+=_i(n)),i+=r;o=e[t],r=o+"",n=pn-r.length,n&&(i+=_i(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return i+o}var qs=(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,y,g,j,b,x,S,N,_,P,A,O,R,k,M=r.constructor,z=r.s==a.s?1:-1,B=r.d,L=a.d;if(!r.s)return new M(r);if(!a.s)throw Error(Ca+"Division by zero");for(d=r.e-a.e,R=L.length,A=B.length,g=new M(z),j=g.d=[],f=0;L[f]==(B[f]||0);)++f;if(L[f]>(B[f]||0)&&--d,i==null?N=i=M.precision:o?N=i+(Dn(r)-Dn(a))+1:N=i,N<0)return new M(0);if(N=N/pn+2|0,f=0,R==1)for(h=0,L=L[0],N++;(f<A||h)&&N--;f++)_=h*er+(B[f]||0),j[f]=_/L|0,h=_%L|0;else{for(h=er/(L[0]+1)|0,h>1&&(L=e(L,h),B=e(B,h),R=L.length,A=B.length),P=R,b=B.slice(0,R),x=b.length;x<R;)b[x++]=0;k=L.slice(),k.unshift(0),O=L[0],L[1]>=er/2&&++O;do h=0,c=t(L,b,R,x),c<0?(S=b[0],R!=x&&(S=S*er+(b[1]||0)),h=S/O|0,h>1?(h>=er&&(h=er-1),p=e(L,h),y=p.length,x=b.length,c=t(p,b,y,x),c==1&&(h--,n(p,R<y?k:L,y))):(h==0&&(c=h=1),p=L.slice()),y=p.length,y<x&&p.unshift(0),n(b,p,x),c==-1&&(x=b.length,c=t(L,b,R,x),c<1&&(h++,n(b,R<x?k:L,x))),x=b.length):c===0&&(h++,b=[0]),j[f++]=h,c&&b[0]?b[x++]=B[P]||0:(b=[B[P]],x=1);while((P++<A||b[0]!==void 0)&&N--)}return j[0]||j.shift(),g.e=d,tn(g,o?i+Dn(g)+1:i)}})();function lL(e,t){var n,r,a,i,o,c,d=0,f=0,h=e.constructor,p=h.precision;if(Dn(e)>16)throw Error(UN+Dn(e));if(!e.s)return new h(Jr);for(vn=!1,c=p,o=new h(.03125);e.abs().gte(.1);)e=e.times(o),f+=5;for(r=Math.log(po(2,f))/Math.LN10*2+5|0,c+=r,n=a=i=new h(Jr),h.precision=c;;){if(a=tn(a.times(e),c),n=n.times(++d),o=i.plus(qs(a,n,c)),ls(o.d).slice(0,c)===ls(i.d).slice(0,c)){for(;f--;)i=tn(i.times(i),c);return h.precision=p,t==null?(vn=!0,tn(i,p)):i}i=o}}function Dn(e){for(var t=e.e*pn,n=e.d[0];n>=10;n/=10)t++;return t}function Pw(e,t,n){if(t>e.LN10.sd())throw vn=!0,n&&(e.precision=n),Error(Ca+"LN10 precision limit exceeded");return tn(new e(e.LN10),t)}function _i(e){for(var t="";e--;)t+="0";return t}function Sd(e,t){var n,r,a,i,o,c,d,f,h,p=1,y=10,g=e,j=g.d,b=g.constructor,x=b.precision;if(g.s<1)throw Error(Ca+(g.s?"NaN":"-Infinity"));if(g.eq(Jr))return new b(0);if(t==null?(vn=!1,f=x):f=t,g.eq(10))return t==null&&(vn=!0),Pw(b,f);if(f+=y,b.precision=f,n=ls(j),r=n.charAt(0),i=Dn(g),Math.abs(i)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=ls(g.d),r=n.charAt(0),p++;i=Dn(g),r>1?(g=new b("0."+n),i++):g=new b(r+"."+n.slice(1))}else return d=Pw(b,f+2,x).times(i+""),g=Sd(new b(r+"."+n.slice(1)),f-y).plus(d),b.precision=x,t==null?(vn=!0,tn(g,x)):g;for(c=o=g=qs(g.minus(Jr),g.plus(Jr),f),h=tn(g.times(g),f),a=3;;){if(o=tn(o.times(h),f),d=c.plus(qs(o,new b(a),f)),ls(d.d).slice(0,f)===ls(c.d).slice(0,f))return c=c.times(2),i!==0&&(c=c.plus(Pw(b,f+2,x).times(i+""))),c=qs(c,new b(p),f),b.precision=x,t==null?(vn=!0,tn(c,x)):c;c=d,a+=2}}function z2(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=Uc(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),vn&&(e.e>Fh||e.e<-Fh))throw Error(UN+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=po(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/po(10,o-a):0:p[h-1])%10&1||n==(e.s<0?8:7))),t<1||!p[0])return d?(i=Dn(e),p.length=1,t=t-i-1,p[0]=po(10,(pn-t%pn)%pn),e.e=Uc(-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=po(10,pn-r),p[h]=a>0?(f/po(10,o-a)%po(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(vn&&(e.e>Fh||e.e<-Fh))throw Error(UN+Dn(e));return e}function cL(e,t){var n,r,a,i,o,c,d,f,h,p,y=e.constructor,g=y.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new y(e),vn?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,vn?tn(t,g):t):new y(0)}function Eo(e,t,n){var r,a=Dn(e),i=ls(e.d),o=i.length;return t?(n&&(r=n-o)>0?i=i.charAt(0)+"."+i.slice(1)+_i(r):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+_i(-a-1)+i,n&&(r=n-o)>0&&(i+=_i(r))):a>=o?(i+=_i(a+1-o),n&&(r=n-a-1)>0&&(i=i+"."+_i(r))):((r=a+1)<o&&(i=i.slice(0,r)+"."+i.slice(r)),n&&(r=n-o)>0&&(a+1===o&&(i+="."),i+=_i(r))),e.s<0?"-"+i:i}function U2(e,t){if(e.length>t)return e.length=t,!0}function uL(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(wo+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 z2(o,i.toString())}else if(typeof i!="string")throw Error(wo+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,Ene.test(i))z2(o,i);else throw Error(wo+i)}if(a.prototype=Qe,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=uL,a.config=a.set=Pne,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 Pne(e){if(!e||typeof e!="object")throw Error(Ca+"Object expected");var t,n,r,a=["precision",1,zc,"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(Uc(r)===r&&r>=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(wo+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(wo+n+": "+r);return this}var qN=uL(Ane);Jr=new qN(1);const Gt=qN;function One(e){return Ine(e)||Tne(e)||kne(e)||Rne()}function Rne(){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 kne(e,t){if(e){if(typeof e=="string")return fj(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 fj(e,t)}}function Tne(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Ine(e){if(Array.isArray(e))return fj(e)}function fj(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 Mne=function(t){return t},dL={},fL=function(t){return t===dL},q2=function(t){return function n(){return arguments.length===0||arguments.length===1&&fL(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},$ne=function e(t,n){return t===1?n:q2(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!==dL}).length;return o>=t?n.apply(void 0,a):e(t-o,q2(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 fL(p)?d.shift():p});return n.apply(void 0,One(h).concat(d))}))})},wv=function(t){return $ne(t.length,t)},pj=function(t,n){for(var r=[],a=t;a<n;++a)r[a-t]=a;return r},Dne=wv(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),Lne=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return Mne;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))}},hj=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},pL=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 Fne(e){var t;return e===0?t=1:t=Math.floor(new Gt(e).abs().log(10).toNumber())+1,t}function Bne(e,t,n){for(var r=new Gt(e),a=0,i=[];r.lt(t)&&a<1e5;)i.push(r.toNumber()),r=r.add(n),a++;return i}var zne=wv(function(e,t,n){var r=+e,a=+t;return r+n*(a-r)}),Une=wv(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),qne=wv(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const jv={rangeStep:Bne,getDigitCount:Fne,interpolateNumber:zne,uninterpolateNumber:Une,uninterpolateTruncation:qne};function mj(e){return Hne(e)||Vne(e)||hL(e)||Wne()}function Wne(){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 Vne(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Hne(e){if(Array.isArray(e))return vj(e)}function Nd(e,t){return Yne(e)||Gne(e,t)||hL(e,t)||Kne()}function Kne(){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 hL(e,t){if(e){if(typeof e=="string")return vj(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 vj(e,t)}}function vj(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 Gne(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 Yne(e){if(Array.isArray(e))return e}function mL(e){var t=Nd(e,2),n=t[0],r=t[1],a=n,i=r;return n>r&&(a=r,i=n),[a,i]}function vL(e,t,n){if(e.lte(0))return new Gt(0);var r=jv.getDigitCount(e.toNumber()),a=new Gt(10).pow(r),i=e.div(a),o=r!==1?.05:.1,c=new Gt(Math.ceil(i.div(o).toNumber())).add(n).mul(o),d=c.mul(a);return t?d:new Gt(Math.ceil(d))}function Xne(e,t,n){var r=1,a=new Gt(e);if(!a.isint()&&n){var i=Math.abs(e);i<1?(r=new Gt(10).pow(jv.getDigitCount(e)-1),a=new Gt(Math.floor(a.div(r).toNumber())).mul(r)):i>1&&(a=new Gt(Math.floor(e)))}else e===0?a=new Gt(Math.floor((t-1)/2)):n||(a=new Gt(Math.floor(e)));var o=Math.floor((t-1)/2),c=Lne(Dne(function(d){return a.add(new Gt(d-o).mul(r)).toNumber()}),pj);return c(0,t)}function gL(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 Gt(0),tickMin:new Gt(0),tickMax:new Gt(0)};var i=vL(new Gt(t).sub(e).div(n-1),r,a),o;e<=0&&t>=0?o=new Gt(0):(o=new Gt(e).add(t).div(2),o=o.sub(new Gt(o).mod(i)));var c=Math.ceil(o.sub(e).div(i).toNumber()),d=Math.ceil(new Gt(t).sub(o).div(i).toNumber()),f=c+d+1;return f>n?gL(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 Gt(c).mul(i)),tickMax:o.add(new Gt(d).mul(i))})}function Qne(e){var t=Nd(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=mL([n,r]),d=Nd(c,2),f=d[0],h=d[1];if(f===-1/0||h===1/0){var p=h===1/0?[f].concat(mj(pj(0,a-1).map(function(){return 1/0}))):[].concat(mj(pj(0,a-1).map(function(){return-1/0})),[h]);return n>r?hj(p):p}if(f===h)return Xne(f,a,i);var y=gL(f,h,o,i),g=y.step,j=y.tickMin,b=y.tickMax,x=jv.rangeStep(j,b.add(new Gt(.1).mul(g)),g);return n>r?hj(x):x}function Jne(e,t){var n=Nd(e,2),r=n[0],a=n[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=mL([r,a]),c=Nd(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=vL(new Gt(f).sub(d).div(h-1),i,0),y=[].concat(mj(jv.rangeStep(new Gt(d),new Gt(f).sub(new Gt(.99).mul(p)),p)),[f]);return r>a?hj(y):y}var Zne=pL(Qne),ere=pL(Jne),tre="Invariant failed";function Po(e,t){throw new Error(tre)}var nre=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];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 Bh(){return Bh=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},Bh.apply(this,arguments)}function rre(e,t){return ore(e)||ire(e,t)||sre(e,t)||are()}function are(){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 sre(e,t){if(e){if(typeof e=="string")return W2(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 W2(e,t)}}function W2(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 ire(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 ore(e){if(Array.isArray(e))return e}function lre(e,t){if(e==null)return{};var n=cre(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 cre(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 ure(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dre(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,bL(r.key),r)}}function fre(e,t,n){return t&&dre(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function pre(e,t,n){return t=zh(t),hre(e,yL()?Reflect.construct(t,n||[],zh(e).constructor):t.apply(e,n))}function hre(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 mre(e)}function mre(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(yL=function(){return!!e})()}function zh(e){return zh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},zh(e)}function vre(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&&gj(e,t)}function gj(e,t){return gj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},gj(e,t)}function xL(e,t,n){return t=bL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bL(e){var t=gre(e,"string");return ic(t)=="symbol"?t:t+""}function gre(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)}var vf=(function(e){function t(){return ure(this,t),pre(this,t,arguments)}return vre(t,e),fre(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,y=lre(r,nre),g=ht(y,!1);this.props.direction==="x"&&h.type!=="number"&&Po();var j=d.map(function(b){var x=f(b,c),S=x.x,N=x.y,_=x.value,P=x.errorVal;if(!P)return null;var A=[],O,R;if(Array.isArray(P)){var k=rre(P,2);O=k[0],R=k[1]}else O=R=P;if(i==="vertical"){var M=h.scale,z=N+a,B=z+o,L=z-o,G=M(_-O),U=M(_+R);A.push({x1:U,y1:B,x2:U,y2:L}),A.push({x1:G,y1:z,x2:U,y2:z}),A.push({x1:G,y1:B,x2:G,y2:L})}else if(i==="horizontal"){var H=p.scale,Q=S+a,J=Q-o,T=Q+o,D=H(_-O),X=H(_+R);A.push({x1:J,y1:X,x2:T,y2:X}),A.push({x1:Q,y1:D,x2:Q,y2:X}),A.push({x1:J,y1:D,x2:T,y2:D})}return q.createElement(It,Bh({className:"recharts-errorBar",key:"bar-".concat(A.map(function(F){return"".concat(F.x1,"-").concat(F.x2,"-").concat(F.y1,"-").concat(F.y2)}))},g),A.map(function(F){return q.createElement("line",Bh({},F,{key:"line-".concat(F.x1,"-").concat(F.x2,"-").concat(F.y1,"-").concat(F.y2)}))}))});return q.createElement(It,{className:"recharts-errorBars"},j)}}])})(q.Component);xL(vf,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});xL(vf,"displayName","ErrorBar");function Cd(e){"@babel/helpers - typeof";return Cd=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},Cd(e)}function V2(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 oo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?V2(Object(n),!0).forEach(function(r){yre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yre(e,t,n){return t=xre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xre(e){var t=bre(e,"string");return Cd(t)=="symbol"?t:t+""}function bre(e,t){if(Cd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Cd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var wL=function(t){var n=t.children,r=t.formattedGraphicalItems,a=t.legendWidth,i=t.legendContent,o=Gr(n,zl);if(!o)return null;var c=zl.defaultProps,d=c!==void 0?oo(oo({},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 y=p.item,g=p.props,j=g.sectors||g.data||[];return h.concat(j.map(function(b){return{type:o.props.iconType||y.props.legendType,value:b.name,color:b.fill,payload:b}}))},[]):f=(r||[]).map(function(h){var p=h.item,y=p.type.defaultProps,g=y!==void 0?oo(oo({},y),p.props):{},j=g.dataKey,b=g.name,x=g.legendType,S=g.hide;return{inactive:S,dataKey:j,type:d.iconType||x||"square",color:WN(p),value:b||j,payload:g}}),oo(oo(oo({},d),zl.getWithHeight(o,a)),{},{payload:f,item:o})};function _d(e){"@babel/helpers - typeof";return _d=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},_d(e)}function H2(e){return Nre(e)||Sre(e)||jre(e)||wre()}function wre(){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 jre(e,t){if(e){if(typeof e=="string")return yj(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 yj(e,t)}}function Sre(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Nre(e){if(Array.isArray(e))return yj(e)}function yj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function K2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Cn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?K2(Object(n),!0).forEach(function(r){ql(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ql(e,t,n){return t=Cre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cre(e){var t=_re(e,"string");return _d(t)=="symbol"?t:t+""}function _re(e,t){if(_d(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(_d(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Wn(e,t,n){return wt(e)||wt(t)?n:Vn(t)?ra(e,t,n):bt(t)?t(e):n}function Ju(e,t,n,r){var a=Nne(e,function(c){return Wn(c,t)});if(n==="number"){var i=a.filter(function(c){return Le(c)||parseFloat(c)});return i.length?[bv(i),xv(i)]:[1/0,-1/0]}var o=r?a.filter(function(c){return!wt(c)}):a;return o.map(function(c){return Vn(c)||c instanceof Date?c:""})}var Are=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,y=f>=c-1?a[0].coordinate:a[f+1].coordinate,g=void 0;if(wr(p-h)!==wr(y-p)){var j=[];if(wr(y-p)===wr(d[1]-d[0])){g=y;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 x=y+d[1]-d[0];j[0]=Math.min(p,(x+p)/2),j[1]=Math.max(p,(x+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 N=Math.min(h,y),_=Math.max(h,y);if(t>(N+p)/2&&t<=(_+p)/2){o=a[f].index;break}}}else for(var P=0;P<c;P++)if(P===0&&t<=(r[P].coordinate+r[P+1].coordinate)/2||P>0&&P<c-1&&t>(r[P].coordinate+r[P-1].coordinate)/2&&t<=(r[P].coordinate+r[P+1].coordinate)/2||P===c-1&&t>(r[P].coordinate+r[P-1].coordinate)/2){o=r[P].index;break}return o},WN=function(t){var n,r=t,a=r.type.displayName,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Cn(Cn({},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},Ere=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),y=0,g=p.length;y<g;y++){var j=h[p[y]],b=j.items,x=j.cateAxisId,S=b.filter(function(R){return zs(R.type).indexOf("Bar")>=0});if(S&&S.length){var N=S[0].type.defaultProps,_=N!==void 0?Cn(Cn({},N),S[0].props):S[0].props,P=_.barSize,A=_[x];o[A]||(o[A]=[]);var O=wt(P)?n:P;o[A].push({item:S[0],stackList:S.slice(1),barSize:wt(O)?void 0:jr(O,r,0)})}}return o},Pre=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=jr(n,a,0,!0),h,p=[];if(o[0].barSize===+o[0].barSize){var y=!1,g=a/d,j=o.reduce(function(P,A){return P+A.barSize||0},0);j+=(d-1)*f,j>=a&&(j-=(d-1)*f,f=0),j>=a&&g>0&&(y=!0,g*=.9,j=d*g);var b=(a-j)/2>>0,x={offset:b-f,size:0};h=o.reduce(function(P,A){var O={item:A.item,position:{offset:x.offset+x.size+f,size:y?g:A.barSize}},R=[].concat(H2(P),[O]);return x=R[R.length-1].position,A.stackList&&A.stackList.length&&A.stackList.forEach(function(k){R.push({item:k,position:x})}),R},p)}else{var S=jr(r,a,0,!0);a-2*S-(d-1)*f<=0&&(f=0);var N=(a-2*S-(d-1)*f)/d;N>1&&(N>>=0);var _=c===+c?Math.min(N,c):N;h=o.reduce(function(P,A,O){var R=[].concat(H2(P),[{item:A.item,position:{offset:S+(N+f)*O+(N-_)/2,size:_}}]);return A.stackList&&A.stackList.length&&A.stackList.forEach(function(k){R.push({item:k,position:R[R.length-1].position})}),R},p)}return h},Ore=function(t,n,r,a){var i=r.children,o=r.width,c=r.margin,d=o-(c.left||0)-(c.right||0),f=wL({children:i,legendWidth:d});if(f){var h=a||{},p=h.width,y=h.height,g=f.align,j=f.verticalAlign,b=f.layout;if((b==="vertical"||b==="horizontal"&&j==="middle")&&g!=="center"&&Le(t[g]))return Cn(Cn({},t),{},ql({},g,t[g]+(p||0)));if((b==="horizontal"||b==="vertical"&&g==="center")&&j!=="middle"&&Le(t[j]))return Cn(Cn({},t),{},ql({},j,t[j]+(y||0)))}return t},Rre=function(t,n,r){return wt(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},jL=function(t,n,r,a,i){var o=n.props.children,c=aa(o,vf).filter(function(f){return Rre(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=Wn(h,r);if(wt(p))return f;var y=Array.isArray(p)?[bv(p),xv(p)]:[p,p],g=d.reduce(function(j,b){var x=Wn(h,b,0),S=y[0]-Math.abs(Array.isArray(x)?x[0]:x),N=y[1]+Math.abs(Array.isArray(x)?x[1]:x);return[Math.min(S,j[0]),Math.max(N,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},kre=function(t,n,r,a,i){var o=n.map(function(c){return jL(t,c,r,i,a)}).filter(function(c){return!wt(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},SL=function(t,n,r,a,i){var o=n.map(function(d){var f=d.props.dataKey;return r==="number"&&f&&jL(t,d,f,a)||Ju(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},[])},NL=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},yo=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?wr(c[0]-c[1])*2*f:f,n&&(t.ticks||t.niceTicks)){var h=(t.ticks||t.niceTicks).map(function(p){var y=i?i.indexOf(p):p;return{coordinate:a(y)+f,value:p,offset:f}});return h.filter(function(p){return!cf(p.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(p,y){return{coordinate:a(p)+f,value:p,index:y,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,y){return{coordinate:a(p)+f,value:i?i[p]:p,index:y,offset:f}})},Ow=new WeakMap,Wp=function(t,n){if(typeof n!="function")return t;Ow.has(t)||Ow.set(t,new WeakMap);var r=Ow.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},CL=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:yd(),realScaleType:"band"}:o==="radial"&&c==="angleAxis"?{scale:Mh(),realScaleType:"linear"}:i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:Qu(),realScaleType:"point"}:i==="category"?{scale:yd(),realScaleType:"band"}:{scale:Mh(),realScaleType:"linear"};if(Co(a)){var d="scale".concat(av(a));return{scale:(k2[d]||Qu)(),realScaleType:k2[d]?d:"point"}}return bt(a)?{scale:a}:{scale:Qu(),realScaleType:"point"}},G2=1e-4,_L=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])-G2,o=Math.max(a[0],a[1])+G2,c=t(n[0]),d=t(n[r-1]);(c<i||c>o||d<i||d>o)&&t.domain([n[0],n[r-1]])}},Tre=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},Ire=function(t,n){if(!n||n.length!==2||!Le(n[0])||!Le(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(!Le(t[0])||t[0]<r)&&(i[0]=r),(!Le(t[1])||t[1]>a)&&(i[1]=a),i[0]>a&&(i[0]=a),i[1]<r&&(i[1]=r),i},Mre=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=cf(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])}},$re=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=cf(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)}},Dre={sign:Mre,expand:NX,none:Jl,silhouette:CX,wiggle:_X,positive:$re},Lre=function(t,n,r){var a=n.map(function(c){return c.props.dataKey}),i=Dre[r],o=SX().keys(a).value(function(c,d){return+Wn(c,d,0)}).order(K1).offset(i);return o(t)},Fre=function(t,n,r,a,i,o){if(!t)return null;var c=o?n.reverse():n,d={},f=c.reduce(function(p,y){var g,j=(g=y.type)!==null&&g!==void 0&&g.defaultProps?Cn(Cn({},y.type.defaultProps),y.props):y.props,b=j.stackId,x=j.hide;if(x)return p;var S=j[r],N=p[S]||{hasStack:!1,stackGroups:{}};if(Vn(b)){var _=N.stackGroups[b]||{numericAxisId:r,cateAxisId:a,items:[]};_.items.push(y),N.hasStack=!0,N.stackGroups[b]=_}else N.stackGroups[Lc("_stackId_")]={numericAxisId:r,cateAxisId:a,items:[y]};return Cn(Cn({},p),{},ql({},S,N))},d),h={};return Object.keys(f).reduce(function(p,y){var g=f[y];if(g.hasStack){var j={};g.stackGroups=Object.keys(g.stackGroups).reduce(function(b,x){var S=g.stackGroups[x];return Cn(Cn({},b),{},ql({},x,{numericAxisId:r,cateAxisId:a,items:S.items,stackedData:Lre(t,S.items,i)}))},j)}return Cn(Cn({},p),{},ql({},y,g))},h)},AL=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=Zne(f,i,c);return t.domain([bv(h),xv(h)]),{niceTicks:h}}if(i&&a==="number"){var p=t.domain(),y=ere(p,i,c);return{niceTicks:y}}return null};function Y2(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&&!wt(a[t.dataKey])){var c=vh(n,"value",a[t.dataKey]);if(c)return c.coordinate+r/2}return n[i]?n[i].coordinate+r/2:null}var d=Wn(a,wt(o)?t.dataKey:o);return wt(d)?null:t.scale(d)}var X2=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=Wn(o,n.dataKey,n.domain[c]);return wt(d)?null:n.scale(d)-i/2+a},Bre=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]},zre=function(t,n){var r,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Cn(Cn({},t.type.defaultProps),t.props):t.props,i=a.stackId;if(Vn(i)){var o=n[i];if(o){var c=o.items.indexOf(t);return c>=0?o.stackedData[c]:null}}return null},Ure=function(t){return t.reduce(function(n,r){return[bv(r.concat([n[0]]).filter(Le)),xv(r.concat([n[1]]).filter(Le))]},[1/0,-1/0])},EL=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=Ure(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})},Q2=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,J2=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,xj=function(t,n,r){if(bt(t))return t(n,r);if(!Array.isArray(t))return n;var a=[];if(Le(t[0]))a[0]=r?t[0]:Math.min(t[0],n[0]);else if(Q2.test(t[0])){var i=+Q2.exec(t[0])[1];a[0]=n[0]-i}else bt(t[0])?a[0]=t[0](n[0]):a[0]=n[0];if(Le(t[1]))a[1]=r?t[1]:Math.max(t[1],n[1]);else if(J2.test(t[1])){var o=+J2.exec(t[1])[1];a[1]=n[1]+o}else bt(t[1])?a[1]=t[1](n[1]):a[1]=n[1];return a},Uh=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=yN(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},Z2=function(t,n,r){return!t||!t.length||mf(t,ra(r,"type.defaultProps.domain"))?n:t},PL=function(t,n){var r=t.type.defaultProps?Cn(Cn({},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 Cn(Cn({},ht(t,!1)),{},{dataKey:a,unit:o,formatter:c,name:i||a,color:WN(t),value:Wn(n,a),type:d,payload:n,chartType:f,hide:h})};function Ad(e){"@babel/helpers - typeof";return Ad=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},Ad(e)}function eT(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 Is(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eT(Object(n),!0).forEach(function(r){OL(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function OL(e,t,n){return t=qre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qre(e){var t=Wre(e,"string");return Ad(t)=="symbol"?t:t+""}function Wre(e,t){if(Ad(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ad(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vre(e,t){return Yre(e)||Gre(e,t)||Kre(e,t)||Hre()}function Hre(){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 Kre(e,t){if(e){if(typeof e=="string")return tT(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 tT(e,t)}}function tT(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 Gre(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 Yre(e){if(Array.isArray(e))return e}var qh=Math.PI/180,Xre=function(t){return t*180/Math.PI},ln=function(t,n,r,a){return{x:t+Math.cos(-qh*a)*r,y:n+Math.sin(-qh*a)*r}},RL=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},Qre=function(t,n,r,a,i){var o=t.width,c=t.height,d=t.startAngle,f=t.endAngle,h=jr(t.cx,o,o/2),p=jr(t.cy,c,c/2),y=RL(o,c,r),g=jr(t.innerRadius,y,0),j=jr(t.outerRadius,y,y*.8),b=Object.keys(n);return b.reduce(function(x,S){var N=n[S],_=N.domain,P=N.reversed,A;if(wt(N.range))a==="angleAxis"?A=[d,f]:a==="radiusAxis"&&(A=[g,j]),P&&(A=[A[1],A[0]]);else{A=N.range;var O=A,R=Vre(O,2);d=R[0],f=R[1]}var k=CL(N,i),M=k.realScaleType,z=k.scale;z.domain(_).range(A),_L(z);var B=AL(z,Is(Is({},N),{},{realScaleType:M})),L=Is(Is(Is({},N),B),{},{range:A,radius:j,realScaleType:M,scale:z,cx:h,cy:p,innerRadius:g,outerRadius:j,startAngle:d,endAngle:f});return Is(Is({},x),{},OL({},S,L))},{})},Jre=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))},Zre=function(t,n){var r=t.x,a=t.y,i=n.cx,o=n.cy,c=Jre({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:Xre(f),angleInRadian:f}},eae=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}},tae=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},nT=function(t,n){var r=t.x,a=t.y,i=Zre({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=eae(n),p=h.startAngle,y=h.endAngle,g=c,j;if(p<=y){for(;g>y;)g-=360;for(;g<p;)g+=360;j=g>=p&&g<=y}else{for(;g>p;)g-=360;for(;g<y;)g+=360;j=g>=y&&g<=p}return j?Is(Is({},n),{},{radius:o,angle:tae(g,n)}):null},kL=function(t){return!v.isValidElement(t)&&!bt(t)&&typeof t!="boolean"?t.className:""};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 nae=["offset"];function rae(e){return oae(e)||iae(e)||sae(e)||aae()}function aae(){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 sae(e,t){if(e){if(typeof e=="string")return bj(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 bj(e,t)}}function iae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function oae(e){if(Array.isArray(e))return bj(e)}function bj(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){if(e==null)return{};var n=cae(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 cae(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 rT(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 qn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rT(Object(n),!0).forEach(function(r){uae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uae(e,t,n){return t=dae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dae(e){var t=fae(e,"string");return Ed(t)=="symbol"?t:t+""}function fae(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 Pd(){return Pd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pd.apply(this,arguments)}var pae=function(t){var n=t.value,r=t.formatter,a=wt(t.children)?n:t.children;return bt(r)?r(a):a},hae=function(t,n){var r=wr(n-t),a=Math.min(Math.abs(n-t),360);return r*a},mae=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,y=d.outerRadius,g=d.startAngle,j=d.endAngle,b=d.clockWise,x=(p+y)/2,S=hae(g,j),N=S>=0?1:-1,_,P;a==="insideStart"?(_=g+N*o,P=b):a==="insideEnd"?(_=j-N*o,P=!b):a==="end"&&(_=j+N*o,P=b),P=S<=0?P:!P;var A=ln(f,h,x,_),O=ln(f,h,x,_+(P?1:-1)*359),R="M".concat(A.x,",").concat(A.y,`
75
+ A`).concat(x,",").concat(x,",0,1,").concat(P?0:1,`,
76
+ `).concat(O.x,",").concat(O.y),k=wt(t.id)?Lc("recharts-radial-line-"):t.id;return q.createElement("text",Pd({},r,{dominantBaseline:"central",className:jt("recharts-radial-bar-label",c)}),q.createElement("defs",null,q.createElement("path",{id:k,d:R})),q.createElement("textPath",{xlinkHref:"#".concat(k)},n))},vae=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,y=(h+p)/2;if(a==="outside"){var g=ln(o,c,f+r,y),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 x=(d+f)/2,S=ln(o,c,x,y),N=S.x,_=S.y;return{x:N,y:_,textAnchor:"middle",verticalAnchor:"middle"}},gae=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,y=p*a,g=p>0?"end":"start",j=p>0?"start":"end",b=f>=0?1:-1,x=b*a,S=b>0?"end":"start",N=b>0?"start":"end";if(i==="top"){var _={x:c+f/2,y:d-p*a,textAnchor:"middle",verticalAnchor:g};return qn(qn({},_),r?{height:Math.max(d-r.y,0),width:f}:{})}if(i==="bottom"){var P={x:c+f/2,y:d+h+y,textAnchor:"middle",verticalAnchor:j};return qn(qn({},P),r?{height:Math.max(r.y+r.height-(d+h),0),width:f}:{})}if(i==="left"){var A={x:c-x,y:d+h/2,textAnchor:S,verticalAnchor:"middle"};return qn(qn({},A),r?{width:Math.max(A.x-r.x,0),height:h}:{})}if(i==="right"){var O={x:c+f+x,y:d+h/2,textAnchor:N,verticalAnchor:"middle"};return qn(qn({},O),r?{width:Math.max(r.x+r.width-O.x,0),height:h}:{})}var R=r?{width:f,height:h}:{};return i==="insideLeft"?qn({x:c+x,y:d+h/2,textAnchor:N,verticalAnchor:"middle"},R):i==="insideRight"?qn({x:c+f-x,y:d+h/2,textAnchor:S,verticalAnchor:"middle"},R):i==="insideTop"?qn({x:c+f/2,y:d+y,textAnchor:"middle",verticalAnchor:j},R):i==="insideBottom"?qn({x:c+f/2,y:d+h-y,textAnchor:"middle",verticalAnchor:g},R):i==="insideTopLeft"?qn({x:c+x,y:d+y,textAnchor:N,verticalAnchor:j},R):i==="insideTopRight"?qn({x:c+f-x,y:d+y,textAnchor:S,verticalAnchor:j},R):i==="insideBottomLeft"?qn({x:c+x,y:d+h-y,textAnchor:N,verticalAnchor:g},R):i==="insideBottomRight"?qn({x:c+f-x,y:d+h-y,textAnchor:S,verticalAnchor:g},R):Dc(i)&&(Le(i.x)||mo(i.x))&&(Le(i.y)||mo(i.y))?qn({x:c+jr(i.x,f),y:d+jr(i.y,h),textAnchor:"end",verticalAnchor:"end"},R):qn({x:c+f/2,y:d+h/2,textAnchor:"middle",verticalAnchor:"middle"},R)},yae=function(t){return"cx"in t&&Le(t.cx)};function tr(e){var t=e.offset,n=t===void 0?5:t,r=lae(e,nae),a=qn({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,y=a.textBreakAll;if(!i||wt(c)&&wt(d)&&!v.isValidElement(f)&&!bt(f))return null;if(v.isValidElement(f))return v.cloneElement(f,a);var g;if(bt(f)){if(g=v.createElement(f,a),v.isValidElement(g))return g}else g=pae(a);var j=yae(i),b=ht(a,!0);if(j&&(o==="insideStart"||o==="insideEnd"||o==="end"))return mae(a,g,b);var x=j?vae(a):gae(a);return q.createElement(Ao,Pd({className:jt("recharts-label",p)},b,x,{breakAll:y}),g)}tr.displayName="Label";var TL=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,y=t.y,g=t.top,j=t.left,b=t.width,x=t.height,S=t.clockWise,N=t.labelViewBox;if(N)return N;if(Le(b)&&Le(x)){if(Le(p)&&Le(y))return{x:p,y,width:b,height:x};if(Le(g)&&Le(j))return{x:g,y:j,width:b,height:x}}return Le(p)&&Le(y)?{x:p,y,width:0,height:0}:Le(n)&&Le(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:{}},xae=function(t,n){return t?t===!0?q.createElement(tr,{key:"label-implicit",viewBox:n}):Vn(t)?q.createElement(tr,{key:"label-implicit",viewBox:n,value:t}):v.isValidElement(t)?t.type===tr?v.cloneElement(t,{key:"label-implicit",viewBox:n}):q.createElement(tr,{key:"label-implicit",content:t,viewBox:n}):bt(t)?q.createElement(tr,{key:"label-implicit",content:t,viewBox:n}):Dc(t)?q.createElement(tr,Pd({viewBox:n},t,{key:"label-implicit"})):null:null},bae=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=TL(t),o=aa(a,tr).map(function(d,f){return v.cloneElement(d,{viewBox:n||i,key:"label-".concat(f)})});if(!r)return o;var c=xae(t.label,n||i);return[c].concat(rae(o))};tr.parseViewBox=TL;tr.renderCallByParent=bae;var Rw,aT;function wae(){if(aT)return Rw;aT=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return Rw=e,Rw}var jae=wae();const Sae=Vt(jae);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)}var Nae=["valueAccessor"],Cae=["data","dataKey","clockWise","id","textBreakAll"];function _ae(e){return Oae(e)||Pae(e)||Eae(e)||Aae()}function Aae(){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 Eae(e,t){if(e){if(typeof e=="string")return wj(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 wj(e,t)}}function Pae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Oae(e){if(Array.isArray(e))return wj(e)}function wj(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 Wh(){return Wh=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},Wh.apply(this,arguments)}function sT(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 iT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sT(Object(n),!0).forEach(function(r){Rae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rae(e,t,n){return t=kae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kae(e){var t=Tae(e,"string");return Od(t)=="symbol"?t:t+""}function Tae(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)}function oT(e,t){if(e==null)return{};var n=Iae(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 Iae(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 Mae=function(t){return Array.isArray(t.value)?Sae(t.value):t.value};function Ws(e){var t=e.valueAccessor,n=t===void 0?Mae:t,r=oT(e,Nae),a=r.data,i=r.dataKey,o=r.clockWise,c=r.id,d=r.textBreakAll,f=oT(r,Cae);return!a||!a.length?null:q.createElement(It,{className:"recharts-label-list"},a.map(function(h,p){var y=wt(i)?n(h,p):Wn(h&&h.payload,i),g=wt(c)?{}:{id:"".concat(c,"-").concat(p)};return q.createElement(tr,Wh({},ht(h,!0),f,g,{parentViewBox:h.parentViewBox,value:y,textBreakAll:d,viewBox:tr.parseViewBox(wt(o)?h:iT(iT({},h),{},{clockWise:o})),key:"label-".concat(p),index:p}))}))}Ws.displayName="LabelList";function $ae(e,t){return e?e===!0?q.createElement(Ws,{key:"labelList-implicit",data:t}):q.isValidElement(e)||bt(e)?q.createElement(Ws,{key:"labelList-implicit",data:t,content:e}):Dc(e)?q.createElement(Ws,Wh({data:t},e,{key:"labelList-implicit"})):null:null}function Dae(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=aa(r,Ws).map(function(o,c){return v.cloneElement(o,{data:t,key:"labelList-".concat(c)})});if(!n)return a;var i=$ae(e.label,t);return[i].concat(_ae(a))}Ws.renderCallByParent=Dae;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 jj(){return jj=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},jj.apply(this,arguments)}function lT(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 cT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lT(Object(n),!0).forEach(function(r){Lae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lae(e,t,n){return t=Fae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fae(e){var t=Bae(e,"string");return Rd(t)=="symbol"?t:t+""}function Bae(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 zae=function(t,n){var r=wr(n-t),a=Math.min(Math.abs(n-t),359.999);return r*a},Vp=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)/qh,y=f?i:i+o*p,g=ln(n,r,h,y),j=ln(n,r,a,y),b=f?i-o*p:i,x=ln(n,r,h*Math.cos(p*qh),b);return{center:g,circleTangency:j,lineTangency:x,theta:p}},IL=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.startAngle,c=t.endAngle,d=zae(o,c),f=o+d,h=ln(n,r,i,o),p=ln(n,r,i,f),y="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=ln(n,r,a,o),j=ln(n,r,a,f);y+="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 y+="L ".concat(n,",").concat(r," Z");return y},Uae=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=wr(h-f),y=Vp({cx:n,cy:r,radius:i,angle:f,sign:p,cornerRadius:o,cornerIsExternal:d}),g=y.circleTangency,j=y.lineTangency,b=y.theta,x=Vp({cx:n,cy:r,radius:i,angle:h,sign:-p,cornerRadius:o,cornerIsExternal:d}),S=x.circleTangency,N=x.lineTangency,_=x.theta,P=d?Math.abs(f-h):Math.abs(f-h)-b-_;if(P<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
+ `):IL({cx:n,cy:r,innerRadius:a,outerRadius:i,startAngle:f,endAngle:h});var A="M ".concat(j.x,",").concat(j.y,`
88
+ A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(g.x,",").concat(g.y,`
89
+ A`).concat(i,",").concat(i,",0,").concat(+(P>180),",").concat(+(p<0),",").concat(S.x,",").concat(S.y,`
90
+ A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(N.x,",").concat(N.y,`
91
+ `);if(a>0){var O=Vp({cx:n,cy:r,radius:a,angle:f,sign:p,isExternal:!0,cornerRadius:o,cornerIsExternal:d}),R=O.circleTangency,k=O.lineTangency,M=O.theta,z=Vp({cx:n,cy:r,radius:a,angle:h,sign:-p,isExternal:!0,cornerRadius:o,cornerIsExternal:d}),B=z.circleTangency,L=z.lineTangency,G=z.theta,U=d?Math.abs(f-h):Math.abs(f-h)-M-G;if(U<0&&o===0)return"".concat(A,"L").concat(n,",").concat(r,"Z");A+="L".concat(L.x,",").concat(L.y,`
92
+ A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(B.x,",").concat(B.y,`
93
+ A`).concat(a,",").concat(a,",0,").concat(+(U>180),",").concat(+(p>0),",").concat(R.x,",").concat(R.y,`
94
+ A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(k.x,",").concat(k.y,"Z")}else A+="L".concat(n,",").concat(r,"Z");return A},qae={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},ML=function(t){var n=cT(cT({},qae),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,y=n.className;if(o<i||h===p)return null;var g=jt("recharts-sector",y),j=o-i,b=jr(c,j,0,!0),x;return b>0&&Math.abs(h-p)<360?x=Uae({cx:r,cy:a,innerRadius:i,outerRadius:o,cornerRadius:Math.min(b,j/2),forceCornerRadius:d,cornerIsExternal:f,startAngle:h,endAngle:p}):x=IL({cx:r,cy:a,innerRadius:i,outerRadius:o,startAngle:h,endAngle:p}),q.createElement("path",jj({},ht(n,!0),{className:g,d:x,role:"img"}))};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 Sj(){return Sj=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},Sj.apply(this,arguments)}function uT(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 dT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uT(Object(n),!0).forEach(function(r){Wae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wae(e,t,n){return t=Vae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vae(e){var t=Hae(e,"string");return kd(t)=="symbol"?t:t+""}function Hae(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)}var fT={curveBasisClosed:fX,curveBasisOpen:pX,curveBasis:dX,curveBumpX:QY,curveBumpY:JY,curveLinearClosed:hX,curveLinear:iv,curveMonotoneX:mX,curveMonotoneY:vX,curveNatural:gX,curveStep:yX,curveStepAfter:bX,curveStepBefore:xX},Hp=function(t){return t.x===+t.x&&t.y===+t.y},Mu=function(t){return t.x},$u=function(t){return t.y},Kae=function(t,n){if(bt(t))return t;var r="curve".concat(av(t));return(r==="curveMonotone"||r==="curveBump")&&n?fT["".concat(r).concat(n==="vertical"?"Y":"X")]:fT[r]||iv},Gae=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=Kae(r,c),p=f?i.filter(function(b){return Hp(b)}):i,y;if(Array.isArray(o)){var g=f?o.filter(function(b){return Hp(b)}):o,j=p.map(function(b,x){return dT(dT({},b),{},{base:g[x]})});return c==="vertical"?y=Dp().y($u).x1(Mu).x0(function(b){return b.base.x}):y=Dp().x(Mu).y1($u).y0(function(b){return b.base.y}),y.defined(Hp).curve(h),y(j)}return c==="vertical"&&Le(o)?y=Dp().y($u).x1(Mu).x0(o):Le(o)?y=Dp().x(Mu).y1($u).y0(o):y=M3().x(Mu).y($u),y.defined(Hp).curve(h),y(p)},Vh=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?Gae(t):a;return v.createElement("path",Sj({},ht(t,!1),gh(t),{className:jt("recharts-curve",n),d:o,ref:i}))},kw={exports:{}},Tw,pT;function Yae(){if(pT)return Tw;pT=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Tw=e,Tw}var Iw,hT;function Xae(){if(hT)return Iw;hT=1;var e=Yae();function t(){}function n(){}return n.resetWarningCache=t,Iw=function(){function r(o,c,d,f,h,p){if(p!==e){var y=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 y.name="Invariant Violation",y}}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},Iw}var mT;function Qae(){return mT||(mT=1,kw.exports=Xae()()),kw.exports}var Jae=Qae();const Ft=Vt(Jae),{getOwnPropertyNames:Zae,getOwnPropertySymbols:ese}=Object,{hasOwnProperty:tse}=Object.prototype;function Mw(e,t){return function(r,a,i){return e(r,a,i)&&t(r,a,i)}}function Kp(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 nse(e){return e?.[Symbol.toStringTag]}function vT(e){return Zae(e).concat(ese(e))}const rse=Object.hasOwn||((e,t)=>tse.call(e,t));function Uo(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const ase="__v",sse="__o",ise="_owner",{getOwnPropertyDescriptor:gT,keys:yT}=Object;function ose(e,t){return e.byteLength===t.byteLength&&Hh(new Uint8Array(e),new Uint8Array(t))}function lse(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 cse(e,t){return e.byteLength===t.byteLength&&Hh(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function use(e,t){return Uo(e.getTime(),t.getTime())}function dse(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function fse(e,t){return e===t}function xT(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 y=o.value,g=c.value;if(n.equals(y[0],g[0],d,p,e,t,n)&&n.equals(y[1],g[1],y[0],g[0],e,t,n)){h=a[p]=!0;break}p++}if(!h)return!1;d++}return!0}const pse=Uo;function hse(e,t,n){const r=yT(e);let a=r.length;if(yT(t).length!==a)return!1;for(;a-- >0;)if(!$L(e,t,n,r[a]))return!1;return!0}function Du(e,t,n){const r=vT(e);let a=r.length;if(vT(t).length!==a)return!1;let i,o,c;for(;a-- >0;)if(i=r[a],!$L(e,t,n,i)||(o=gT(e,i),c=gT(t,i),(o||c)&&(!o||!c||o.configurable!==c.configurable||o.enumerable!==c.enumerable||o.writable!==c.writable)))return!1;return!0}function mse(e,t){return Uo(e.valueOf(),t.valueOf())}function vse(e,t){return e.source===t.source&&e.flags===t.flags}function bT(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 Hh(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 gse(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 $L(e,t,n,r){return(r===ise||r===sse||r===ase)&&(e.$$typeof||t.$$typeof)?!0:rse(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const yse="[object ArrayBuffer]",xse="[object Arguments]",bse="[object Boolean]",wse="[object DataView]",jse="[object Date]",Sse="[object Error]",Nse="[object Map]",Cse="[object Number]",_se="[object Object]",Ase="[object RegExp]",Ese="[object Set]",Pse="[object String]",Ose={"[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},Rse="[object URL]",kse=Object.prototype.toString;function Tse({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:y,areUrlsEqual:g,unknownTagComparators:j}){return function(x,S,N){if(x===S)return!0;if(x==null||S==null)return!1;const _=typeof x;if(_!==typeof S)return!1;if(_!=="object")return _==="number"?c(x,S,N):_==="function"?i(x,S,N):!1;const P=x.constructor;if(P!==S.constructor)return!1;if(P===Object)return d(x,S,N);if(Array.isArray(x))return t(x,S,N);if(P===Date)return r(x,S,N);if(P===RegExp)return h(x,S,N);if(P===Map)return o(x,S,N);if(P===Set)return p(x,S,N);const A=kse.call(x);if(A===jse)return r(x,S,N);if(A===Ase)return h(x,S,N);if(A===Nse)return o(x,S,N);if(A===Ese)return p(x,S,N);if(A===_se)return typeof x.then!="function"&&typeof S.then!="function"&&d(x,S,N);if(A===Rse)return g(x,S,N);if(A===Sse)return a(x,S,N);if(A===xse)return d(x,S,N);if(Ose[A])return y(x,S,N);if(A===yse)return e(x,S,N);if(A===wse)return n(x,S,N);if(A===bse||A===Cse||A===Pse)return f(x,S,N);if(j){let O=j[A];if(!O){const R=nse(x);R&&(O=j[R])}if(O)return O(x,S,N)}return!1}}function Ise({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:ose,areArraysEqual:n?Du:lse,areDataViewsEqual:cse,areDatesEqual:use,areErrorsEqual:dse,areFunctionsEqual:fse,areMapsEqual:n?Mw(xT,Du):xT,areNumbersEqual:pse,areObjectsEqual:n?Du:hse,arePrimitiveWrappersEqual:mse,areRegExpsEqual:vse,areSetsEqual:n?Mw(bT,Du):bT,areTypedArraysEqual:n?Mw(Hh,Du):Hh,areUrlsEqual:gse,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const a=Kp(r.areArraysEqual),i=Kp(r.areMapsEqual),o=Kp(r.areObjectsEqual),c=Kp(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:a,areMapsEqual:i,areObjectsEqual:o,areSetsEqual:c})}return r}function Mse(e){return function(t,n,r,a,i,o,c){return e(t,n,c)}}function $se({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 Dse=Wi();Wi({strict:!0});Wi({circular:!0});Wi({circular:!0,strict:!0});Wi({createInternalComparator:()=>Uo});Wi({strict:!0,createInternalComparator:()=>Uo});Wi({circular:!0,createInternalComparator:()=>Uo});Wi({circular:!0,createInternalComparator:()=>Uo,strict:!0});function Wi(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:a=!1}=e,i=Ise(e),o=Tse(i),c=n?n(o):Mse(o);return $se({circular:t,comparator:o,createState:r,equals:c,strict:a})}function Lse(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function wT(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):Lse(a)};requestAnimationFrame(r)}function Nj(e){"@babel/helpers - typeof";return Nj=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},Nj(e)}function Fse(e){return qse(e)||Use(e)||zse(e)||Bse()}function Bse(){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 zse(e,t){if(e){if(typeof e=="string")return jT(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 jT(e,t)}}function jT(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 Use(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function qse(e){if(Array.isArray(e))return e}function Wse(){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=Fse(o),d=c[0],f=c.slice(1);if(typeof d=="number"){wT(a.bind(null,f),d);return}a(d),wT(a.bind(null,f));return}Nj(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 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 ST(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 NT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ST(Object(n),!0).forEach(function(r){DL(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ST(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function DL(e,t,n){return t=Vse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vse(e){var t=Hse(e,"string");return Td(t)==="symbol"?t:String(t)}function Hse(e,t){if(Td(e)!=="object"||e===null)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)}var Kse=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,a){return r.filter(function(i){return a.includes(i)})})},Gse=function(t){return t},Yse=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},Zu=function(t,n){return Object.keys(n).reduce(function(r,a){return NT(NT({},r),{},DL({},a,t(a,n[a])))},{})},CT=function(t,n,r){return t.map(function(a){return"".concat(Yse(a)," ").concat(n,"ms ").concat(r)}).join(",")};function Xse(e,t){return Zse(e)||Jse(e,t)||LL(e,t)||Qse()}function Qse(){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 Jse(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 Zse(e){if(Array.isArray(e))return e}function eie(e){return rie(e)||nie(e)||LL(e)||tie()}function tie(){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 LL(e,t){if(e){if(typeof e=="string")return Cj(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 Cj(e,t)}}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 Cj(e)}function Cj(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 Kh=1e-4,FL=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},BL=function(t,n){return t.map(function(r,a){return r*Math.pow(n,a)}).reduce(function(r,a){return r+a})},_T=function(t,n){return function(r){var a=FL(t,n);return BL(a,r)}},aie=function(t,n){return function(r){var a=FL(t,n),i=[].concat(eie(a.map(function(o,c){return o*c}).slice(1)),[0]);return BL(i,r)}},AT=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(x){return parseFloat(x)}),h=Xse(f,4);a=h[0],i=h[1],o=h[2],c=h[3]}}}var p=_T(a,o),y=_T(i,c),g=aie(a,o),j=function(S){return S>1?1:S<0?0:S},b=function(S){for(var N=S>1?1:S,_=N,P=0;P<8;++P){var A=p(_)-N,O=g(_);if(Math.abs(A-N)<Kh||O<Kh)return y(_);_=j(_-A/O)}return y(_)};return b.isStepper=!1,b},sie=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,y){var g=-(h-p)*r,j=y*i,b=y+(g-j)*c/1e3,x=y*c/1e3+h;return Math.abs(x-p)<Kh&&Math.abs(b)<Kh?[p,0]:[x,b]};return d.isStepper=!0,d.dt=c,d},iie=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 AT(a);case"spring":return sie();default:if(a.split("(")[0]==="cubic-bezier")return AT(a)}return typeof a=="function"?a:null};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 ET(e){return cie(e)||lie(e)||zL(e)||oie()}function oie(){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 lie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function cie(e){if(Array.isArray(e))return Aj(e)}function PT(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 sr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PT(Object(n),!0).forEach(function(r){_j(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _j(e,t,n){return t=uie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uie(e){var t=die(e,"string");return Id(t)==="symbol"?t:String(t)}function die(e,t){if(Id(e)!=="object"||e===null)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(t==="string"?String:Number)(e)}function fie(e,t){return mie(e)||hie(e,t)||zL(e,t)||pie()}function pie(){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 zL(e,t){if(e){if(typeof e=="string")return Aj(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 Aj(e,t)}}function Aj(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 hie(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 mie(e){if(Array.isArray(e))return e}var Gh=function(t,n,r){return t+(n-t)*r},Ej=function(t){var n=t.from,r=t.to;return n!==r},vie=function e(t,n,r){var a=Zu(function(i,o){if(Ej(o)){var c=t(o.from,o.to,o.velocity),d=fie(c,2),f=d[0],h=d[1];return sr(sr({},o),{},{from:f,velocity:h})}return o},n);return r<1?Zu(function(i,o){return Ej(o)?sr(sr({},o),{},{velocity:Gh(o.velocity,a[i].velocity,r),from:Gh(o.from,a[i].from,r)}):o},n):e(t,a,r-1)};const gie=(function(e,t,n,r,a){var i=Kse(e,t),o=i.reduce(function(x,S){return sr(sr({},x),{},_j({},S,[e[S],t[S]]))},{}),c=i.reduce(function(x,S){return sr(sr({},x),{},_j({},S,{from:e[S],velocity:0,to:t[S]}))},{}),d=-1,f,h,p=function(){return null},y=function(){return Zu(function(S,N){return N.from},c)},g=function(){return!Object.values(c).filter(Ej).length},j=function(S){f||(f=S);var N=S-f,_=N/n.dt;c=vie(n,c,_),a(sr(sr(sr({},e),t),y())),f=S,g()||(d=requestAnimationFrame(p))},b=function(S){h||(h=S);var N=(S-h)/r,_=Zu(function(A,O){return Gh.apply(void 0,ET(O).concat([n(N)]))},o);if(a(sr(sr(sr({},e),t),_)),N<1)d=requestAnimationFrame(p);else{var P=Zu(function(A,O){return Gh.apply(void 0,ET(O).concat([n(1)]))},o);a(sr(sr(sr({},e),t),P))}};return p=n.isStepper?j:b,function(){return requestAnimationFrame(p),function(){cancelAnimationFrame(d)}}});function oc(e){"@babel/helpers - typeof";return oc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oc(e)}var yie=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function xie(e,t){if(e==null)return{};var n=bie(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 bie(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 $w(e){return Nie(e)||Sie(e)||jie(e)||wie()}function wie(){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 jie(e,t){if(e){if(typeof e=="string")return Pj(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 Pj(e,t)}}function Sie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Nie(e){if(Array.isArray(e))return Pj(e)}function Pj(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 OT(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 $a(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OT(Object(n),!0).forEach(function(r){Vu(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Vu(e,t,n){return t=UL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _ie(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,UL(r.key),r)}}function Aie(e,t,n){return t&&_ie(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function UL(e){var t=Eie(e,"string");return oc(t)==="symbol"?t:String(t)}function Eie(e,t){if(oc(e)!=="object"||e===null)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(t==="string"?String:Number)(e)}function Pie(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&&Oj(e,t)}function Oj(e,t){return Oj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Oj(e,t)}function Oie(e){var t=Rie();return function(){var r=Yh(e),a;if(t){var i=Yh(this).constructor;a=Reflect.construct(r,arguments,i)}else a=r.apply(this,arguments);return Rj(this,a)}}function Rj(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 kj(e)}function kj(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rie(){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 Yh(e){return Yh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Yh(e)}var vs=(function(e){Pie(n,e);var t=Oie(n);function n(r,a){var i;Cie(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,y=o.children,g=o.duration;if(i.handleStyleChange=i.handleStyleChange.bind(kj(i)),i.changeStyle=i.changeStyle.bind(kj(i)),!c||g<=0)return i.state={style:{}},typeof y=="function"&&(i.state={style:h}),Rj(i);if(p&&p.length)i.state={style:p[0].style};else if(f){if(typeof y=="function")return i.state={style:f},Rj(i);i.state={style:d?Vu({},d,f):f}}else i.state={style:{}};return i}return Aie(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,y=this.state.style;if(c){if(!o){var g={style:d?Vu({},d,h):h};this.state&&y&&(d&&y[d]!==h||!d&&y!==h)&&this.setState(g);return}if(!(Dse(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&&y){var x={style:d?Vu({},d,b):b};(d&&y[d]!==b||!d&&y!==b)&&this.setState(x)}this.runAnimation($a($a({},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,y=a.onAnimationStart,g=gie(o,c,iie(f),d,this.changeStyle),j=function(){i.stopJSAnimation=g()};this.manager.start([y,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,y=p===void 0?0:p,g=function(b,x,S){if(S===0)return b;var N=x.duration,_=x.easing,P=_===void 0?"ease":_,A=x.style,O=x.properties,R=x.onAnimationEnd,k=S>0?o[S-1]:x,M=O||Object.keys(A);if(typeof P=="function"||P==="spring")return[].concat($w(b),[i.runJSAnimation.bind(i,{from:k.style,to:A,duration:N,easing:P}),N]);var z=CT(M,N,P),B=$a($a($a({},k.style),A),{},{transition:z});return[].concat($w(b),[B,N,R]).filter(Gse)};return this.manager.start([d].concat($w(o.reduce(g,[h,Math.max(y,c)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=Wse());var i=a.begin,o=a.duration,c=a.attributeName,d=a.to,f=a.easing,h=a.onAnimationStart,p=a.onAnimationEnd,y=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(y.length>1){this.runStepAnimation(a);return}var b=c?Vu({},c,d):d,x=CT(Object.keys(b),o,f);j.start([h,i,$a($a({},b),{},{transition:x}),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=xie(a,yie),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,x=b===void 0?{}:b,S=j.className,N=v.cloneElement(g,$a($a({},d),{},{style:$a($a({},x),h),className:S}));return N};return f===1?p(v.Children.only(i)):q.createElement("div",null,v.Children.map(i,function(y){return p(y)}))}}]),n})(v.PureComponent);vs.displayName="Animate";vs.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};vs.propTypes={from:Ft.oneOfType([Ft.object,Ft.string]),to:Ft.oneOfType([Ft.object,Ft.string]),attributeName:Ft.string,duration:Ft.number,begin:Ft.number,easing:Ft.oneOfType([Ft.string,Ft.func]),steps:Ft.arrayOf(Ft.shape({duration:Ft.number.isRequired,style:Ft.object.isRequired,easing:Ft.oneOfType([Ft.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Ft.func]),properties:Ft.arrayOf("string"),onAnimationEnd:Ft.func})),children:Ft.oneOfType([Ft.node,Ft.func]),isActive:Ft.bool,canBegin:Ft.bool,onAnimationEnd:Ft.func,shouldReAnimate:Ft.bool,onAnimationStart:Ft.func,onAnimationReStart:Ft.func};function Md(e){"@babel/helpers - typeof";return Md=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},Md(e)}function Xh(){return Xh=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},Xh.apply(this,arguments)}function kie(e,t){return $ie(e)||Mie(e,t)||Iie(e,t)||Tie()}function Tie(){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 Iie(e,t){if(e){if(typeof e=="string")return RT(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 RT(e,t)}}function RT(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 Mie(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 $ie(e){if(Array.isArray(e))return e}function kT(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 TT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kT(Object(n),!0).forEach(function(r){Die(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Die(e,t,n){return t=Lie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lie(e){var t=Fie(e,"string");return Md(t)=="symbol"?t:t+""}function Fie(e,t){if(Md(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Md(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var IT=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],y=0,g=4;y<g;y++)p[y]=i[y]>o?o:i[y];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},Bie=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),y=Math.max(o,o+d);return r>=f&&r<=h&&a>=p&&a<=y}return!1},zie={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},VN=function(t){var n=TT(TT({},zie),t),r=v.useRef(),a=v.useState(-1),i=kie(a,2),o=i[0],c=i[1];v.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var P=r.current.getTotalLength();P&&c(P)}catch{}},[]);var d=n.x,f=n.y,h=n.width,p=n.height,y=n.radius,g=n.className,j=n.animationEasing,b=n.animationDuration,x=n.animationBegin,S=n.isAnimationActive,N=n.isUpdateAnimationActive;if(d!==+d||f!==+f||h!==+h||p!==+p||h===0||p===0)return null;var _=jt("recharts-rectangle",g);return N?q.createElement(vs,{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:N},function(P){var A=P.width,O=P.height,R=P.x,k=P.y;return q.createElement(vs,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:b,isActive:S,easing:j},q.createElement("path",Xh({},ht(n,!0),{className:_,d:IT(R,k,A,O,y),ref:r})))}):q.createElement("path",Xh({},ht(n,!0),{className:_,d:IT(d,f,h,p,y)}))},Uie=["points","className","baseLinePoints","connectNulls"];function Ol(){return Ol=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},Ol.apply(this,arguments)}function qie(e,t){if(e==null)return{};var n=Wie(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 Wie(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 MT(e){return Gie(e)||Kie(e)||Hie(e)||Vie()}function Vie(){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 Hie(e,t){if(e){if(typeof e=="string")return Tj(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 Tj(e,t)}}function Kie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Gie(e){if(Array.isArray(e))return Tj(e)}function Tj(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 $T=function(t){return t&&t.x===+t.x&&t.y===+t.y},Yie=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){$T(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),$T(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},ed=function(t,n){var r=Yie(t);n&&(r=[r.reduce(function(i,o){return[].concat(MT(i),MT(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},Xie=function(t,n,r){var a=ed(t,r);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(ed(n.reverse(),r).slice(1))},Qie=function(t){var n=t.points,r=t.className,a=t.baseLinePoints,i=t.connectNulls,o=qie(t,Uie);if(!n||!n.length)return null;var c=jt("recharts-polygon",r);if(a&&a.length){var d=o.stroke&&o.stroke!=="none",f=Xie(n,a,i);return q.createElement("g",{className:c},q.createElement("path",Ol({},ht(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:f})),d?q.createElement("path",Ol({},ht(o,!0),{fill:"none",d:ed(n,i)})):null,d?q.createElement("path",Ol({},ht(o,!0),{fill:"none",d:ed(a,i)})):null)}var h=ed(n,i);return q.createElement("path",Ol({},ht(o,!0),{fill:h.slice(-1)==="Z"?o.fill:"none",className:c,d:h}))};function Ij(){return Ij=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},Ij.apply(this,arguments)}var Sv=function(t){var n=t.cx,r=t.cy,a=t.r,i=t.className,o=jt("recharts-dot",i);return n===+n&&r===+r&&a===+a?v.createElement("circle",Ij({},ht(t,!1),gh(t),{className:o,cx:n,cy:r,r:a})):null};function $d(e){"@babel/helpers - typeof";return $d=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},$d(e)}var Jie=["x","y","top","left","width","height","className"];function Mj(){return Mj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mj.apply(this,arguments)}function DT(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 Zie(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DT(Object(n),!0).forEach(function(r){eoe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eoe(e,t,n){return t=toe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function toe(e){var t=noe(e,"string");return $d(t)=="symbol"?t:t+""}function noe(e,t){if($d(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if($d(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}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}var soe=function(t,n,r,a,i,o){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(o,",").concat(n,"h").concat(r)},ioe=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,y=t.height,g=y===void 0?0:y,j=t.className,b=roe(t,Jie),x=Zie({x:r,y:i,top:c,left:f,width:p,height:g},b);return!Le(r)||!Le(i)||!Le(p)||!Le(g)||!Le(c)||!Le(f)?null:q.createElement("path",Mj({},ht(x,!0),{className:jt("recharts-cross",j),d:soe(r,i,p,g,c,f)}))},Dw,LT;function ooe(){if(LT)return Dw;LT=1;var e=yv(),t=aL(),n=ws();function r(a,i){return a&&a.length?e(a,n(i,2),t):void 0}return Dw=r,Dw}var loe=ooe();const coe=Vt(loe);var Lw,FT;function uoe(){if(FT)return Lw;FT=1;var e=yv(),t=ws(),n=sL();function r(a,i){return a&&a.length?e(a,t(i,2),n):void 0}return Lw=r,Lw}var doe=uoe();const foe=Vt(doe);var poe=["cx","cy","angle","ticks","axisLine"],hoe=["ticks","tick","angle","tickFormatter","stroke"];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 td(){return td=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},td.apply(this,arguments)}function BT(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 lo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BT(Object(n),!0).forEach(function(r){Nv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zT(e,t){if(e==null)return{};var n=moe(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 moe(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 voe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function UT(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,WL(r.key),r)}}function goe(e,t,n){return t&&UT(e.prototype,t),n&&UT(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function yoe(e,t,n){return t=Qh(t),xoe(e,qL()?Reflect.construct(t,n||[],Qh(e).constructor):t.apply(e,n))}function xoe(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 boe(e)}function boe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(qL=function(){return!!e})()}function Qh(e){return Qh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Qh(e)}function woe(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&&$j(e,t)}function $j(e,t){return $j=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},$j(e,t)}function Nv(e,t,n){return t=WL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WL(e){var t=joe(e,"string");return lc(t)=="symbol"?t:t+""}function joe(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(t==="string"?String:Number)(e)}var Cv=(function(e){function t(){return voe(this,t),yoe(this,t,arguments)}return woe(t,e),goe(t,[{key:"getTickValueCoord",value:function(r){var a=r.coordinate,i=this.props,o=i.angle,c=i.cx,d=i.cy;return ln(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=coe(c,function(h){return h.coordinate||0}),f=foe(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=zT(r,poe),h=c.reduce(function(j,b){return[Math.min(j[0],b.coordinate),Math.max(j[1],b.coordinate)]},[1/0,-1/0]),p=ln(a,i,h[0],o),y=ln(a,i,h[1],o),g=lo(lo(lo({},ht(f,!1)),{},{fill:"none"},ht(d,!1)),{},{x1:p.x,y1:p.y,x2:y.x,y2:y.y});return q.createElement("line",td({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=zT(a,hoe),p=this.getTickTextAnchor(),y=ht(h,!1),g=ht(o,!1),j=i.map(function(b,x){var S=r.getTickValueCoord(b),N=lo(lo(lo(lo({textAnchor:p,transform:"rotate(".concat(90-c,", ").concat(S.x,", ").concat(S.y,")")},y),{},{stroke:"none",fill:f},g),{},{index:x},S),{},{payload:b});return q.createElement(It,td({className:jt("recharts-polar-radius-axis-tick",kL(o)),key:"tick-".concat(b.coordinate)},_o(r.props,b,x)),t.renderTickItem(o,N,d?d(b.value,x):b.value))});return q.createElement(It,{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:q.createElement(It,{className:jt("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 q.isValidElement(r)?o=q.cloneElement(r,a):bt(r)?o=r(a):o=q.createElement(Ao,td({},a,{className:"recharts-polar-radius-axis-tick-value"}),i),o}}])})(v.PureComponent);Nv(Cv,"displayName","PolarRadiusAxis");Nv(Cv,"axisType","radiusAxis");Nv(Cv,"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 cc(e){"@babel/helpers - typeof";return cc=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},cc(e)}function ho(){return ho=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},ho.apply(this,arguments)}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 co(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){_v(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 Soe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function WT(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,HL(r.key),r)}}function Noe(e,t,n){return t&&WT(e.prototype,t),n&&WT(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Coe(e,t,n){return t=Jh(t),_oe(e,VL()?Reflect.construct(t,n||[],Jh(e).constructor):t.apply(e,n))}function _oe(e,t){if(t&&(cc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Aoe(e)}function Aoe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function VL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(VL=function(){return!!e})()}function Jh(e){return Jh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Jh(e)}function Eoe(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&&Dj(e,t)}function Dj(e,t){return Dj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Dj(e,t)}function _v(e,t,n){return t=HL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HL(e){var t=Poe(e,"string");return cc(t)=="symbol"?t:t+""}function Poe(e,t){if(cc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(cc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ooe=Math.PI/180,VT=1e-5,Av=(function(e){function t(){return Soe(this,t),Coe(this,t,arguments)}return Eoe(t,e),Noe(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=ln(i,o,c,r.coordinate),y=ln(i,o,c+(d==="inner"?-1:1)*h,r.coordinate);return{x1:p.x,y1:p.y,x2:y.x,y2:y.y}}},{key:"getTickTextAnchor",value:function(r){var a=this.props.orientation,i=Math.cos(-r.coordinate*Ooe),o;return i>VT?o=a==="outer"?"start":"end":i<-VT?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=co(co({},ht(this.props,!1)),{},{fill:"none"},ht(c,!1));if(d==="circle")return q.createElement(Sv,ho({className:"recharts-polar-angle-axis-line"},f,{cx:a,cy:i,r:o}));var h=this.props.ticks,p=h.map(function(y){return ln(a,i,o,y.coordinate)});return q.createElement(Qie,ho({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=ht(this.props,!1),p=ht(o,!1),y=co(co({},h),{},{fill:"none"},ht(c,!1)),g=i.map(function(j,b){var x=r.getTickLineCoord(j),S=r.getTickTextAnchor(j),N=co(co(co({textAnchor:S},h),{},{stroke:"none",fill:f},p),{},{index:b,payload:j,x:x.x2,y:x.y2});return q.createElement(It,ho({className:jt("recharts-polar-angle-axis-tick",kL(o)),key:"tick-".concat(j.coordinate)},_o(r.props,j,b)),c&&q.createElement("line",ho({className:"recharts-polar-angle-axis-tick-line"},y,x)),o&&t.renderTickItem(o,N,d?d(j.value,b):j.value))});return q.createElement(It,{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:q.createElement(It,{className:jt("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,a,i){var o;return q.isValidElement(r)?o=q.cloneElement(r,a):bt(r)?o=r(a):o=q.createElement(Ao,ho({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),o}}])})(v.PureComponent);_v(Av,"displayName","PolarAngleAxis");_v(Av,"axisType","angleAxis");_v(Av,"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 Fw,HT;function Roe(){if(HT)return Fw;HT=1;var e=a5(),t=e(Object.getPrototypeOf,Object);return Fw=t,Fw}var Bw,KT;function koe(){if(KT)return Bw;KT=1;var e=Js(),t=Roe(),n=Zs(),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 y=c.call(p,"constructor")&&p.constructor;return typeof y=="function"&&y instanceof y&&o.call(y)==d}return Bw=f,Bw}var Toe=koe();const Ioe=Vt(Toe);var zw,GT;function Moe(){if(GT)return zw;GT=1;var e=Js(),t=Zs(),n="[object Boolean]";function r(a){return a===!0||a===!1||t(a)&&e(a)==n}return zw=r,zw}var $oe=Moe();const Doe=Vt($oe);function Dd(e){"@babel/helpers - typeof";return Dd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dd(e)}function Zh(){return Zh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zh.apply(this,arguments)}function Loe(e,t){return Uoe(e)||zoe(e,t)||Boe(e,t)||Foe()}function Foe(){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 Boe(e,t){if(e){if(typeof e=="string")return YT(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 YT(e,t)}}function YT(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 zoe(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 Uoe(e){if(Array.isArray(e))return e}function XT(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 QT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?XT(Object(n),!0).forEach(function(r){qoe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qoe(e,t,n){return t=Woe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Woe(e){var t=Voe(e,"string");return Dd(t)=="symbol"?t:t+""}function Voe(e,t){if(Dd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Dd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var JT=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},Hoe={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Koe=function(t){var n=QT(QT({},Hoe),t),r=v.useRef(),a=v.useState(-1),i=Loe(a,2),o=i[0],c=i[1];v.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var _=r.current.getTotalLength();_&&c(_)}catch{}},[]);var d=n.x,f=n.y,h=n.upperWidth,p=n.lowerWidth,y=n.height,g=n.className,j=n.animationEasing,b=n.animationDuration,x=n.animationBegin,S=n.isUpdateAnimationActive;if(d!==+d||f!==+f||h!==+h||p!==+p||y!==+y||h===0&&p===0||y===0)return null;var N=jt("recharts-trapezoid",g);return S?q.createElement(vs,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:y,x:d,y:f},to:{upperWidth:h,lowerWidth:p,height:y,x:d,y:f},duration:b,animationEasing:j,isActive:S},function(_){var P=_.upperWidth,A=_.lowerWidth,O=_.height,R=_.x,k=_.y;return q.createElement(vs,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:b,easing:j},q.createElement("path",Zh({},ht(n,!0),{className:N,d:JT(R,k,P,A,O),ref:r})))}):q.createElement("g",null,q.createElement("path",Zh({},ht(n,!0),{className:N,d:JT(d,f,h,p,y)})))},Goe=["option","shapeType","propTransformer","activeClassName","isActive"];function Ld(e){"@babel/helpers - typeof";return Ld=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},Ld(e)}function Yoe(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}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 em(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){Qoe(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 Qoe(e,t,n){return t=Joe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Joe(e){var t=Zoe(e,"string");return Ld(t)=="symbol"?t:t+""}function Zoe(e,t){if(Ld(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ld(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ele(e,t){return em(em({},t),e)}function tle(e,t){return e==="symbols"}function eI(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return q.createElement(VN,n);case"trapezoid":return q.createElement(Koe,n);case"sector":return q.createElement(ML,n);case"symbols":if(tle(t))return q.createElement(uN,n);break;default:return null}}function nle(e){return v.isValidElement(e)?e.props:e}function KL(e){var t=e.option,n=e.shapeType,r=e.propTransformer,a=r===void 0?ele:r,i=e.activeClassName,o=i===void 0?"recharts-active-shape":i,c=e.isActive,d=Yoe(e,Goe),f;if(v.isValidElement(t))f=v.cloneElement(t,em(em({},d),nle(t)));else if(bt(t))f=t(d);else if(Ioe(t)&&!Doe(t)){var h=a(t,d);f=q.createElement(eI,{shapeType:n,elementProps:h})}else{var p=d;f=q.createElement(eI,{shapeType:n,elementProps:p})}return c?q.createElement(It,{className:o},f):f}function Ev(e,t){return t!=null&&"trapezoids"in e.props}function Pv(e,t){return t!=null&&"sectors"in e.props}function Fd(e,t){return t!=null&&"points"in e.props}function rle(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 ale(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function sle(e,t){var n=e.x===t.x,r=e.y===t.y,a=e.z===t.z;return n&&r&&a}function ile(e,t){var n;return Ev(e,t)?n=rle:Pv(e,t)?n=ale:Fd(e,t)&&(n=sle),n}function ole(e,t){var n;return Ev(e,t)?n="trapezoids":Pv(e,t)?n="sectors":Fd(e,t)&&(n="points"),n}function lle(e,t){if(Ev(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(Pv(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 Fd(e,t)?t.payload:{}}function cle(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,a=ole(n,t),i=lle(n,t),o=r.filter(function(d,f){var h=mf(i,d),p=n.props[a].filter(function(j){var b=ile(n,t);return b(j,t)}),y=n.props[a].indexOf(p[p.length-1]),g=f===y;return h&&g}),c=r.indexOf(o[o.length-1]);return c}var sh;function uc(e){"@babel/helpers - typeof";return uc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uc(e)}function Rl(){return Rl=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},Rl.apply(this,arguments)}function tI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function rn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tI(Object(n),!0).forEach(function(r){ga(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ule(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nI(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,YL(r.key),r)}}function dle(e,t,n){return t&&nI(e.prototype,t),n&&nI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function fle(e,t,n){return t=tm(t),ple(e,GL()?Reflect.construct(t,n||[],tm(e).constructor):t.apply(e,n))}function ple(e,t){if(t&&(uc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return hle(e)}function hle(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function GL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(GL=function(){return!!e})()}function tm(e){return tm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},tm(e)}function mle(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&&Lj(e,t)}function Lj(e,t){return Lj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Lj(e,t)}function ga(e,t,n){return t=YL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YL(e){var t=vle(e,"string");return uc(t)=="symbol"?t:t+""}function vle(e,t){if(uc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(uc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var ti=(function(e){function t(n){var r;return ule(this,t),r=fle(this,t,[n]),ga(r,"pieRef",null),ga(r,"sectorRefs",[]),ga(r,"id",Lc("recharts-pie-")),ga(r,"handleAnimationEnd",function(){var a=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),bt(a)&&a()}),ga(r,"handleAnimationStart",function(){var a=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),bt(a)&&a()}),r.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},r}return mle(t,e),dle(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=ht(this.props,!1),p=ht(o,!1),y=ht(c,!1),g=o&&o.offsetRadius||20,j=r.map(function(b,x){var S=(b.startAngle+b.endAngle)/2,N=ln(b.cx,b.cy,b.outerRadius+g,S),_=rn(rn(rn(rn({},h),b),{},{stroke:"none"},p),{},{index:x,textAnchor:t.getTextAnchor(N.x,b.cx)},N),P=rn(rn(rn(rn({},h),b),{},{fill:"none",stroke:b.fill},y),{},{index:x,points:[ln(b.cx,b.cy,b.outerRadius,S),N]}),A=d;return wt(d)&&wt(f)?A="value":wt(d)&&(A=f),q.createElement(It,{key:"label-".concat(b.startAngle,"-").concat(b.endAngle,"-").concat(b.midAngle,"-").concat(x)},c&&t.renderLabelLineItem(c,P,"line"),t.renderLabelItem(o,_,Wn(b,A)))});return q.createElement(It,{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),y=d&&a.hasActiveIndex()?d:null,g=p?o:y,j=rn(rn({},f),{},{stroke:c?f.fill:f.stroke,tabIndex:-1});return q.createElement(It,Rl({ref:function(x){x&&!a.sectorRefs.includes(x)&&a.sectorRefs.push(x)},tabIndex:-1,className:"recharts-pie-sector"},_o(a.props,f,h),{key:"sector-".concat(f?.startAngle,"-").concat(f?.endAngle,"-").concat(f.midAngle,"-").concat(h)}),q.createElement(KL,Rl({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,y=p.prevSectors,g=p.prevIsAnimationActive;return q.createElement(vs,{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,x=[],S=i&&i[0],N=S.startAngle;return i.forEach(function(_,P){var A=y&&y[P],O=P>0?ra(_,"paddingAngle",0):0;if(A){var R=Qr(A.endAngle-A.startAngle,_.endAngle-_.startAngle),k=rn(rn({},_),{},{startAngle:N+O,endAngle:N+R(b)+O});x.push(k),N=k.endAngle}else{var M=_.endAngle,z=_.startAngle,B=Qr(0,M-z),L=B(b),G=rn(rn({},_),{},{startAngle:N+O,endAngle:N+L+O});x.push(G),N=G.endAngle}}),q.createElement(It,null,r.renderSectorsStatically(x))})}},{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||!mf(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,y=a.outerRadius,g=a.isAnimationActive,j=this.state.isAnimationFinished;if(i||!o||!o.length||!Le(f)||!Le(h)||!Le(p)||!Le(y))return null;var b=jt("recharts-pie",c);return q.createElement(It,{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)&&Ws.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(q.isValidElement(r))return q.cloneElement(r,a);if(bt(r))return r(a);var o=jt("recharts-pie-label-line",typeof r!="boolean"?r.className:"");return q.createElement(Vh,Rl({},a,{key:i,type:"linear",className:o}))}},{key:"renderLabelItem",value:function(r,a,i){if(q.isValidElement(r))return q.cloneElement(r,a);var o=i;if(bt(r)&&(o=r(a),q.isValidElement(o)))return o;var c=jt("recharts-pie-label-text",typeof r!="boolean"&&!bt(r)?r.className:"");return q.createElement(Ao,Rl({},a,{alignmentBaseline:"middle",className:c}),o)}}])})(v.PureComponent);sh=ti;ga(ti,"displayName","Pie");ga(ti,"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:!Fo.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});ga(ti,"parseDeltaAngle",function(e,t){var n=wr(t-e),r=Math.min(Math.abs(t-e),360);return n*r});ga(ti,"getRealPieData",function(e){var t=e.data,n=e.children,r=ht(e,!1),a=aa(n,dv);return t&&t.length?t.map(function(i,o){return rn(rn(rn({payload:i},r),i),a&&a[o]&&a[o].props)}):a&&a.length?a.map(function(i){return rn(rn({},r),i.props)}):[]});ga(ti,"parseCoordinateOfPie",function(e,t){var n=t.top,r=t.left,a=t.width,i=t.height,o=RL(a,i),c=r+jr(e.cx,a,a/2),d=n+jr(e.cy,i,i/2),f=jr(e.innerRadius,o,0),h=jr(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}});ga(ti,"getComposedData",function(e){var t=e.item,n=e.offset,r=t.type.defaultProps!==void 0?rn(rn({},t.type.defaultProps),t.props):t.props,a=sh.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,y=r.tooltipType,g=Math.abs(r.minAngle),j=sh.parseCoordinateOfPie(r,n),b=sh.parseDeltaAngle(o,c),x=Math.abs(b),S=f;wt(f)&&wt(p)?(Us(!1,`Use "dataKey" to specify the value of pie,
114
+ the props "valueKey" will be deprecated in 1.1.0`),S="value"):wt(f)&&(Us(!1,`Use "dataKey" to specify the value of pie,
115
+ the props "valueKey" will be deprecated in 1.1.0`),S=p);var N=a.filter(function(k){return Wn(k,S,0)!==0}).length,_=(x>=360?N:N-1)*d,P=x-N*g-_,A=a.reduce(function(k,M){var z=Wn(M,S,0);return k+(Le(z)?z:0)},0),O;if(A>0){var R;O=a.map(function(k,M){var z=Wn(k,S,0),B=Wn(k,h,M),L=(Le(z)?z:0)/A,G;M?G=R.endAngle+wr(b)*d*(z!==0?1:0):G=o;var U=G+wr(b)*((z!==0?g:0)+L*P),H=(G+U)/2,Q=(j.innerRadius+j.outerRadius)/2,J=[{name:B,value:z,payload:k,dataKey:S,type:y}],T=ln(j.cx,j.cy,Q,H);return R=rn(rn(rn({percent:L,cornerRadius:i,name:B,tooltipPayload:J,midAngle:H,middleRadius:Q,tooltipPosition:T},k),j),{},{value:Wn(k,S),startAngle:G,endAngle:U,payload:k,paddingAngle:wr(b)*d}),R})}return rn(rn({},j),{},{sectors:O,data:a})});var Uw,rI;function gle(){if(rI)return Uw;rI=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 Uw=n,Uw}var qw,aI;function XL(){if(aI)return qw;aI=1;var e=b5(),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 qw=r,qw}var Ww,sI;function yle(){if(sI)return Ww;sI=1;var e=gle(),t=uv(),n=XL();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 Ww=r,Ww}var Vw,iI;function xle(){if(iI)return Vw;iI=1;var e=yle(),t=e();return Vw=t,Vw}var ble=xle();const nm=Vt(ble);function Bd(e){"@babel/helpers - typeof";return Bd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bd(e)}function oI(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 lI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oI(Object(n),!0).forEach(function(r){QL(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function QL(e,t,n){return t=wle(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wle(e){var t=jle(e,"string");return Bd(t)=="symbol"?t:t+""}function jle(e,t){if(Bd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Bd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Sle=["Webkit","Moz","O","ms"],Nle=function(t,n){var r=t.replace(/(\w)/,function(i){return i.toUpperCase()}),a=Sle.reduce(function(i,o){return lI(lI({},i),{},QL({},o+r,n))},{});return a[t]=n,a};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 rm(){return rm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rm.apply(this,arguments)}function cI(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 Hw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cI(Object(n),!0).forEach(function(r){Kr(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cle(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,ZL(r.key),r)}}function _le(e,t,n){return t&&uI(e.prototype,t),n&&uI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ale(e,t,n){return t=am(t),Ele(e,JL()?Reflect.construct(t,n||[],am(e).constructor):t.apply(e,n))}function Ele(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 Ple(e)}function Ple(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function JL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(JL=function(){return!!e})()}function am(e){return am=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},am(e)}function Ole(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fj(e,t)}function Fj(e,t){return Fj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Fj(e,t)}function Kr(e,t,n){return t=ZL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZL(e){var t=Rle(e,"string");return dc(t)=="symbol"?t:t+""}function Rle(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 kle=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=Qu().domain(nm(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}},dI=function(t){return t.changedTouches&&!!t.changedTouches.length},fc=(function(e){function t(n){var r;return Cle(this,t),r=Ale(this,t,[n]),Kr(r,"handleDrag",function(a){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(a):r.state.isSlideMoving&&r.handleSlideDrag(a)}),Kr(r,"handleTouchMove",function(a){a.changedTouches!=null&&a.changedTouches.length>0&&r.handleDrag(a.changedTouches[0])}),Kr(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()}),Kr(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Kr(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Kr(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Kr(r,"handleSlideDragStart",function(a){var i=dI(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 Ole(t,e),_le(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),y=Math.max(a,i),g=t.getIndexInRange(o,p),j=t.getIndexInRange(o,y);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=Wn(i[r],c,r);return bt(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,y=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 x=this.getIndex({startX:o+b,endX:c+b});(x.startIndex!==y||x.endIndex!==g)&&j&&j(x),this.setState({startX:o+b,endX:c+b,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,a){var i=dI(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,y=h.width,g=h.travellerWidth,j=h.onChange,b=h.gap,x=h.data,S={startX:this.state.startX,endX:this.state.endX},N=r.pageX-i;N>0?N=Math.min(N,p+y-g-f):N<0&&(N=Math.max(N,p-f)),S[o]=f+N;var _=this.getIndex(S),P=_.startIndex,A=_.endIndex,O=function(){var k=x.length-1;return o==="startX"&&(c>d?P%b===0:A%b===0)||c<d&&A===k||o==="endX"&&(c>d?A%b===0:P%b===0)||c>d&&A===k};this.setState(Kr(Kr({},o,f+N),"brushMoveStartX",r.pageX),function(){j&&O()&&j(_)})}},{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 y=p+r;if(!(y===-1||y>=c.length)){var g=c[y];a==="startX"&&g>=f||a==="endX"&&g<=d||this.setState(Kr({},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 q.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?q.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,y=d.traveller,g=d.ariaLabel,j=d.data,b=d.startIndex,x=d.endIndex,S=Math.max(r,this.props.x),N=Hw(Hw({},ht(this.props,!1)),{},{x:S,y:f,width:h,height:p}),_=g||"Min value: ".concat((i=j[b])===null||i===void 0?void 0:i.name,", Max value: ").concat((o=j[x])===null||o===void 0?void 0:o.name);return q.createElement(It,{tabIndex:0,role:"slider","aria-label":_,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(A){["ArrowLeft","ArrowRight"].includes(A.key)&&(A.preventDefault(),A.stopPropagation(),c.handleTravellerMoveKeyboard(A.key==="ArrowRight"?1:-1,a))},onFocus:function(){c.setState({isTravellerFocused:!0})},onBlur:function(){c.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(y,N))}},{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 q.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,y=h.endX,g=5,j={pointerEvents:"none",fill:f};return q.createElement(It,{className:"recharts-brush-texts"},q.createElement(Ao,rm({textAnchor:"end",verticalAnchor:"middle",x:Math.min(p,y)-g,y:o+c/2},j),this.getTextOfTick(a)),q.createElement(Ao,rm({textAnchor:"start",verticalAnchor:"middle",x:Math.max(p,y)+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,y=this.state,g=y.startX,j=y.endX,b=y.isTextActive,x=y.isSlideMoving,S=y.isTravellerMoving,N=y.isTravellerFocused;if(!a||!a.length||!Le(c)||!Le(d)||!Le(f)||!Le(h)||f<=0||h<=0)return null;var _=jt("recharts-brush",i),P=q.Children.count(o)===1,A=Nle("userSelect","none");return q.createElement(It,{className:_,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:A},this.renderBackground(),P&&this.renderPanorama(),this.renderSlide(g,j),this.renderTravellerLayer(g,"startX"),this.renderTravellerLayer(j,"endX"),(b||x||S||N||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 q.createElement(q.Fragment,null,q.createElement("rect",{x:a,y:i,width:o,height:c,fill:d,stroke:"none"}),q.createElement("line",{x1:a+1,y1:f,x2:a+o-1,y2:f,fill:"none",stroke:"#fff"}),q.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 q.isValidElement(r)?i=q.cloneElement(r,a):bt(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 Hw({prevData:i,prevTravellerWidth:d,prevUpdateId:f,prevX:c,prevWidth:o},i&&i.length?kle({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 y=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:y}}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);Kr(fc,"displayName","Brush");Kr(fc,"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 Kw,fI;function Tle(){if(fI)return Kw;fI=1;var e=gN();function t(n,r){var a;return e(n,function(i,o,c){return a=r(i,o,c),!a}),!!a}return Kw=t,Kw}var Gw,pI;function Ile(){if(pI)return Gw;pI=1;var e=Q3(),t=ws(),n=Tle(),r=$r(),a=uv();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 Gw=i,Gw}var Mle=Ile();const $le=Vt(Mle);var fs=function(t,n){var r=t.alwaysShow,a=t.ifOverflow;return r&&(a="extendDomain"),a===n},Yw,hI;function Dle(){if(hI)return Yw;hI=1;var e=m5();function t(n,r,a){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):n[r]=a}return Yw=t,Yw}var Xw,mI;function Lle(){if(mI)return Xw;mI=1;var e=Dle(),t=p5(),n=ws();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 Xw=r,Xw}var Fle=Lle();const Ble=Vt(Fle);var Qw,vI;function zle(){if(vI)return Qw;vI=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 Qw=e,Qw}var Jw,gI;function Ule(){if(gI)return Jw;gI=1;var e=gN();function t(n,r){var a=!0;return e(n,function(i,o,c){return a=!!r(i,o,c),a}),a}return Jw=t,Jw}var Zw,yI;function qle(){if(yI)return Zw;yI=1;var e=zle(),t=Ule(),n=ws(),r=$r(),a=uv();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 Zw=i,Zw}var Wle=qle();const Vle=Vt(Wle);var Hle=["x","y"];function zd(e){"@babel/helpers - typeof";return zd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zd(e)}function Bj(){return Bj=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},Bj.apply(this,arguments)}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 Lu(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){Kle(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 Kle(e,t,n){return t=Gle(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gle(e){var t=Yle(e,"string");return zd(t)=="symbol"?t:t+""}function Yle(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 Xle(e,t){if(e==null)return{};var n=Qle(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 Qle(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 Jle(e,t){var n=e.x,r=e.y,a=Xle(e,Hle),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),y=parseInt(p,10);return Lu(Lu(Lu(Lu(Lu({},t),a),o?{x:o}:{}),d?{y:d}:{}),{},{height:h,width:y,name:t.name,radius:t.radius})}function bI(e){return q.createElement(KL,Bj({shapeType:"rectangle",propTransformer:Jle,activeClassName:"recharts-active-bar"},e))}var Zle=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=Le(r)||yY(r);return i?t(r,a):(i||Po(),n)}},ece=["value","background"],e4;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 tce(e,t){if(e==null)return{};var n=nce(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 nce(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 sm(){return sm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sm.apply(this,arguments)}function wI(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?wI(Object(n),!0).forEach(function(r){Oi(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,n4(r.key),r)}}function ace(e,t,n){return t&&jI(e.prototype,t),n&&jI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function sce(e,t,n){return t=im(t),ice(e,t4()?Reflect.construct(t,n||[],im(e).constructor):t.apply(e,n))}function ice(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 oce(e)}function oce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function t4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(t4=function(){return!!e})()}function im(e){return im=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},im(e)}function lce(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&&zj(e,t)}function zj(e,t){return zj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},zj(e,t)}function Oi(e,t,n){return t=n4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n4(e){var t=cce(e,"string");return pc(t)=="symbol"?t:t+""}function cce(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 String(e)}var qo=(function(e){function t(){var n;rce(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=sce(this,t,[].concat(a)),Oi(n,"state",{isAnimationFinished:!1}),Oi(n,"id",Lc("recharts-bar-")),Oi(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),o&&o()}),Oi(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),o&&o()}),n}return lce(t,e),ace(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=ht(this.props,!1);return r&&r.map(function(p,y){var g=y===d,j=g?f:o,b=$n($n($n({},h),p),{},{isActive:g,option:j,index:y,dataKey:c,onAnimationStart:a.handleAnimationStart,onAnimationEnd:a.handleAnimationEnd});return q.createElement(It,sm({className:"recharts-bar-rectangle"},_o(a.props,p,y),{key:"rectangle-".concat(p?.x,"-").concat(p?.y,"-").concat(p?.value,"-").concat(y)}),q.createElement(bI,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,y=this.state.prevData;return q.createElement(vs,{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(x,S){var N=y&&y[S];if(N){var _=Qr(N.x,x.x),P=Qr(N.y,x.y),A=Qr(N.width,x.width),O=Qr(N.height,x.height);return $n($n({},x),{},{x:_(j),y:P(j),width:A(j),height:O(j)})}if(o==="horizontal"){var R=Qr(0,x.height),k=R(j);return $n($n({},x),{},{y:x.y+x.height-k,height:k})}var M=Qr(0,x.width),z=M(j);return $n($n({},x),{},{width:z})});return q.createElement(It,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||!mf(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=ht(this.props.background,!1);return i.map(function(f,h){f.value;var p=f.background,y=tce(f,ece);if(!p)return null;var g=$n($n($n($n($n({},y),{},{fill:"#eee"},p),d),_o(r.props,f,h)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:o,index:h,className:"recharts-bar-background-rectangle"});return q.createElement(bI,sm({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=aa(h,vf);if(!p)return null;var y=f==="vertical"?o[0].height/2:o[0].width/2,g=function(x,S){var N=Array.isArray(x.value)?x.value[1]:x.value;return{x:x.x,y:x.y,value:N,errorVal:Wn(x,S)}},j={clipPath:r?"url(#clipPath-".concat(a,")"):null};return q.createElement(It,j,p.map(function(b){return q.cloneElement(b,{key:"error-bar-".concat(a,"-").concat(b.props.dataKey),data:o,xAxis:c,yAxis:d,layout:f,offset:y,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,y=r.height,g=r.isAnimationActive,j=r.background,b=r.id;if(a||!i||!i.length)return null;var x=this.state.isAnimationFinished,S=jt("recharts-bar",o),N=c&&c.allowDataOverflow,_=d&&d.allowDataOverflow,P=N||_,A=wt(b)?this.id:b;return q.createElement(It,{className:S},N||_?q.createElement("defs",null,q.createElement("clipPath",{id:"clipPath-".concat(A)},q.createElement("rect",{x:N?f:f-p/2,y:_?h:h-y/2,width:N?p:p*2,height:_?y:y*2}))):null,q.createElement(It,{className:"recharts-bar-rectangles",clipPath:P?"url(#clipPath-".concat(A,")"):null},j?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(P,A),(!g||x)&&Ws.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);e4=qo;Oi(qo,"displayName","Bar");Oi(qo,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!Fo.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Oi(qo,"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,y=e.offset,g=Tre(r,n);if(!g)return null;var j=t.layout,b=n.type.defaultProps,x=b!==void 0?$n($n({},b),n.props):n.props,S=x.dataKey,N=x.children,_=x.minPointSize,P=j==="horizontal"?o:i,A=f?P.scale.domain():null,O=Bre({numericAxis:P}),R=aa(N,dv),k=p.map(function(M,z){var B,L,G,U,H,Q;f?B=Ire(f[h+z],A):(B=Wn(M,S),Array.isArray(B)||(B=[O,B]));var J=Zle(_,e4.defaultProps.minPointSize)(B[1],z);if(j==="horizontal"){var T,D=[o.scale(B[0]),o.scale(B[1])],X=D[0],F=D[1];L=X2({axis:i,ticks:c,bandSize:a,offset:g.offset,entry:M,index:z}),G=(T=F??X)!==null&&T!==void 0?T:void 0,U=g.size;var $=X-F;if(H=Number.isNaN($)?0:$,Q={x:L,y:o.y,width:U,height:o.height},Math.abs(J)>0&&Math.abs(H)<Math.abs(J)){var ee=wr(H||J)*(Math.abs(J)-Math.abs(H));G-=ee,H+=ee}}else{var ae=[i.scale(B[0]),i.scale(B[1])],K=ae[0],le=ae[1];if(L=K,G=X2({axis:o,ticks:d,bandSize:a,offset:g.offset,entry:M,index:z}),U=le-K,H=g.size,Q={x:i.x,y:G,width:i.width,height:H},Math.abs(J)>0&&Math.abs(U)<Math.abs(J)){var te=wr(U||J)*(Math.abs(J)-Math.abs(U));U+=te}}return $n($n($n({},M),{},{x:L,y:G,width:U,height:H,value:f?B:B[1],payload:M,background:Q},R&&R[z]&&R[z].props),{},{tooltipPayload:[PL(n,M)],tooltipPosition:{x:L+U/2,y:G+H/2}})});return $n({data:k,layout:j},y)});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 uce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function SI(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,r4(r.key),r)}}function dce(e,t,n){return t&&SI(e.prototype,t),n&&SI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}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 Fa(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){Ov(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 Ov(e,t,n){return t=r4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r4(e){var t=fce(e,"string");return Ud(t)=="symbol"?t:t+""}function fce(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 a4=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},y=!!Gr(f,qo);return h.reduce(function(g,j){var b=n[j],x=b.orientation,S=b.domain,N=b.padding,_=N===void 0?{}:N,P=b.mirror,A=b.reversed,O="".concat(x).concat(P?"Mirror":""),R,k,M,z,B;if(b.type==="number"&&(b.padding==="gap"||b.padding==="no-gap")){var L=S[1]-S[0],G=1/0,U=b.categoricalDomain.sort(wY);if(U.forEach(function(ae,K){K>0&&(G=Math.min((ae||0)-(U[K-1]||0),G))}),Number.isFinite(G)){var H=G/L,Q=b.layout==="vertical"?r.height:r.width;if(b.padding==="gap"&&(R=H*Q/2),b.padding==="no-gap"){var J=jr(t.barCategoryGap,H*Q),T=H*Q/2;R=T-J-(T-J)/Q*J}}}a==="xAxis"?k=[r.left+(_.left||0)+(R||0),r.left+r.width-(_.right||0)-(R||0)]:a==="yAxis"?k=d==="horizontal"?[r.top+r.height-(_.bottom||0),r.top+(_.top||0)]:[r.top+(_.top||0)+(R||0),r.top+r.height-(_.bottom||0)-(R||0)]:k=b.range,A&&(k=[k[1],k[0]]);var D=CL(b,i,y),X=D.scale,F=D.realScaleType;X.domain(S).range(k),_L(X);var $=AL(X,Fa(Fa({},b),{},{realScaleType:F}));a==="xAxis"?(B=x==="top"&&!P||x==="bottom"&&P,M=r.left,z=p[O]-B*b.height):a==="yAxis"&&(B=x==="left"&&!P||x==="right"&&P,M=p[O]-B*b.width,z=r.top);var ee=Fa(Fa(Fa({},b),$),{},{realScaleType:F,x:M,y:z,scale:X,width:a==="xAxis"?r.width:b.width,height:a==="yAxis"?r.height:b.height});return ee.bandSize=Uh(ee,$),!b.hide&&a==="xAxis"?p[O]+=(B?-1:1)*ee.height:b.hide||(p[O]+=(B?-1:1)*ee.width),Fa(Fa({},g),{},Ov({},j,ee))},{})},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)}},pce=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})},i4=(function(){function e(t){uce(this,e),this.scale=t}return dce(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)}}])})();Ov(i4,"EPS",1e-4);var HN=function(t){var n=Object.keys(t).reduce(function(r,a){return Fa(Fa({},r),{},Ov({},a,i4.create(t[a])))},{});return Fa(Fa({},n),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.bandAware,c=i.position;return Ble(a,function(d,f){return n[f].apply(d,{bandAware:o,position:c})})},isInRange:function(a){return Vle(a,function(i,o){return n[o].isInRange(i)})}})};function hce(e){return(e%180+180)%180}var mce=function(t){var n=t.width,r=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=hce(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)},e1,CI;function vce(){if(CI)return e1;CI=1;var e=ws(),t=uf(),n=lv();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 e1=r,e1}var t1,_I;function gce(){if(_I)return t1;_I=1;var e=XL();function t(n){var r=e(n),a=r%1;return r===r?a?r-a:r:0}return t1=t,t1}var n1,AI;function yce(){if(AI)return n1;AI=1;var e=l5(),t=ws(),n=gce(),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 n1=a,n1}var r1,EI;function xce(){if(EI)return r1;EI=1;var e=vce(),t=yce(),n=e(t);return r1=n,r1}xce();var bce=N3();const wce=Vt(bce);var jce=wce(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("")}),o4=v.createContext(void 0),l4=v.createContext(void 0),c4=v.createContext(void 0),Sce=v.createContext({}),u4=v.createContext(void 0),d4=v.createContext(0),f4=v.createContext(0),PI=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=jce(i);return q.createElement(o4.Provider,{value:r},q.createElement(l4.Provider,{value:a},q.createElement(Sce.Provider,{value:i},q.createElement(c4.Provider,{value:h},q.createElement(u4.Provider,{value:o},q.createElement(d4.Provider,{value:f},q.createElement(f4.Provider,{value:d},c)))))))},Nce=function(){return v.useContext(u4)},p4=function(t){var n=v.useContext(o4);n==null&&Po();var r=n[t];return r==null&&Po(),r},h4=function(t){var n=v.useContext(l4);n==null&&Po();var r=n[t];return r==null&&Po(),r},Cce=function(){var t=v.useContext(c4);return t},m4=function(){return v.useContext(f4)},v4=function(){return v.useContext(d4)};function hc(e){"@babel/helpers - typeof";return hc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hc(e)}function _ce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ace(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,y4(r.key),r)}}function Ece(e,t,n){return t&&Ace(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pce(e,t,n){return t=om(t),Oce(e,g4()?Reflect.construct(t,n||[],om(e).constructor):t.apply(e,n))}function Oce(e,t){if(t&&(hc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Rce(e)}function Rce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(g4=function(){return!!e})()}function om(e){return om=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},om(e)}function kce(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&&Uj(e,t)}function Uj(e,t){return Uj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Uj(e,t)}function OI(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 RI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OI(Object(n),!0).forEach(function(r){KN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function KN(e,t,n){return t=y4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y4(e){var t=Tce(e,"string");return hc(t)=="symbol"?t:t+""}function Tce(e,t){if(hc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(hc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Ice(e,t){return Lce(e)||Dce(e,t)||$ce(e,t)||Mce()}function Mce(){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 $ce(e,t){if(e){if(typeof e=="string")return kI(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 kI(e,t)}}function kI(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 Dce(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 Lce(e){if(Array.isArray(e))return e}function qj(){return qj=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},qj.apply(this,arguments)}var Fce=function(t,n){var r;return q.isValidElement(t)?r=q.cloneElement(t,n):bt(t)?r=t(n):r=q.createElement("line",qj({},n,{className:"recharts-reference-line-line"})),r},Bce=function(t,n,r,a,i,o,c,d,f){var h=i.x,p=i.y,y=i.width,g=i.height;if(r){var j=f.y,b=t.y.apply(j,{position:o});if(fs(f,"discard")&&!t.y.isInRange(b))return null;var x=[{x:h+y,y:b},{x:h,y:b}];return d==="left"?x.reverse():x}if(n){var S=f.x,N=t.x.apply(S,{position:o});if(fs(f,"discard")&&!t.x.isInRange(N))return null;var _=[{x:N,y:p+g},{x:N,y:p}];return c==="top"?_.reverse():_}if(a){var P=f.segment,A=P.map(function(O){return t.apply(O,{position:o})});return fs(f,"discard")&&$le(A,function(O){return!t.isInRange(O)})?null:A}return null};function zce(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=Nce(),h=p4(a),p=h4(i),y=Cce();if(!f||!y)return null;Us(d===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var g=HN({x:h.scale,y:p.scale}),j=Vn(t),b=Vn(n),x=r&&r.length===2,S=Bce(g,j,b,x,y,e.position,h.orientation,p.orientation,e);if(!S)return null;var N=Ice(S,2),_=N[0],P=_.x,A=_.y,O=N[1],R=O.x,k=O.y,M=fs(e,"hidden")?"url(#".concat(f,")"):void 0,z=RI(RI({clipPath:M},ht(e,!0)),{},{x1:P,y1:A,x2:R,y2:k});return q.createElement(It,{className:jt("recharts-reference-line",c)},Fce(o,z),tr.renderCallByParent(e,pce({x1:P,y1:A,x2:R,y2:k})))}var GN=(function(e){function t(){return _ce(this,t),Pce(this,t,arguments)}return kce(t,e),Ece(t,[{key:"render",value:function(){return q.createElement(zce,this.props)}}])})(q.Component);KN(GN,"displayName","ReferenceLine");KN(GN,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function Wj(){return Wj=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},Wj.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 TI(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 II(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TI(Object(n),!0).forEach(function(r){Rv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Uce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qce(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 Wce(e,t,n){return t&&qce(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Vce(e,t,n){return t=lm(t),Hce(e,x4()?Reflect.construct(t,n||[],lm(e).constructor):t.apply(e,n))}function Hce(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 Kce(e)}function Kce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function x4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(x4=function(){return!!e})()}function lm(e){return lm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},lm(e)}function Gce(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&&Vj(e,t)}function Vj(e,t){return Vj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Vj(e,t)}function Rv(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=Yce(e,"string");return mc(t)=="symbol"?t:t+""}function Yce(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 Xce=function(t){var n=t.x,r=t.y,a=t.xAxis,i=t.yAxis,o=HN({x:a.scale,y:i.scale}),c=o.apply({x:n,y:r},{bandAware:!0});return fs(t,"discard")&&!o.isInRange(c)?null:c},kv=(function(e){function t(){return Uce(this,t),Vce(this,t,arguments)}return Gce(t,e),Wce(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=Vn(a),h=Vn(i);if(Us(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!f||!h)return null;var p=Xce(this.props);if(!p)return null;var y=p.x,g=p.y,j=this.props,b=j.shape,x=j.className,S=fs(this.props,"hidden")?"url(#".concat(d,")"):void 0,N=II(II({clipPath:S},ht(this.props,!0)),{},{cx:y,cy:g});return q.createElement(It,{className:jt("recharts-reference-dot",x)},t.renderDot(b,N),tr.renderCallByParent(this.props,{x:y-o,y:g-o,width:2*o,height:2*o}))}}])})(q.Component);Rv(kv,"displayName","ReferenceDot");Rv(kv,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});Rv(kv,"renderDot",function(e,t){var n;return q.isValidElement(e)?n=q.cloneElement(e,t):bt(e)?n=e(t):n=q.createElement(Sv,Wj({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function Hj(){return Hj=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},Hj.apply(this,arguments)}function vc(e){"@babel/helpers - typeof";return vc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vc(e)}function 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 $I(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){Tv(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 Qce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Jce(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 Zce(e,t,n){return t&&Jce(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function eue(e,t,n){return t=cm(t),tue(e,w4()?Reflect.construct(t,n||[],cm(e).constructor):t.apply(e,n))}function tue(e,t){if(t&&(vc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return nue(e)}function nue(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 cm(e){return cm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},cm(e)}function rue(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&&Kj(e,t)}function Kj(e,t){return Kj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Kj(e,t)}function Tv(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=aue(e,"string");return vc(t)=="symbol"?t:t+""}function aue(e,t){if(vc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(vc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var sue=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 y=HN({x:h.scale,y:p.scale}),g={x:t?y.x.apply(o,{position:"start"}):y.x.rangeMin,y:r?y.y.apply(d,{position:"start"}):y.y.rangeMin},j={x:n?y.x.apply(c,{position:"end"}):y.x.rangeMax,y:a?y.y.apply(f,{position:"end"}):y.y.rangeMax};return fs(i,"discard")&&(!y.isInRange(g)||!y.isInRange(j))?null:s4(g,j)},Iv=(function(e){function t(){return Qce(this,t),eue(this,t,arguments)}return rue(t,e),Zce(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;Us(f===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=Vn(a),y=Vn(i),g=Vn(o),j=Vn(c),b=this.props.shape;if(!p&&!y&&!g&&!j&&!b)return null;var x=sue(p,y,g,j,this.props);if(!x&&!b)return null;var S=fs(this.props,"hidden")?"url(#".concat(h,")"):void 0;return q.createElement(It,{className:jt("recharts-reference-area",d)},t.renderRect(b,$I($I({clipPath:S},ht(this.props,!0)),x)),tr.renderCallByParent(this.props,x))}}])})(q.Component);Tv(Iv,"displayName","ReferenceArea");Tv(Iv,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});Tv(Iv,"renderRect",function(e,t){var n;return q.isValidElement(e)?n=q.cloneElement(e,t):bt(e)?n=e(t):n=q.createElement(VN,Hj({},t,{className:"recharts-reference-area-rect"})),n});function S4(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 iue(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return mce(r,n)}function oue(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 um(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 lue(e,t){return S4(e,t+1)}function cue(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:S4(r,f)};var b=d,x,S=function(){return x===void 0&&(x=n(j,b)),x},N=j.coordinate,_=d===0||um(e,N,S,h,c);_||(d=0,h=o,f+=1),_&&(h=N+e*(S()/2+a),d+=f)},y;f<=i.length;)if(y=p(),y)return y.v;return[]}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 DI(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 vr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DI(Object(n),!0).forEach(function(r){uue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uue(e,t,n){return t=due(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function due(e){var t=fue(e,"string");return qd(t)=="symbol"?t:t+""}function fue(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 pue(e,t,n,r,a){for(var i=(r||[]).slice(),o=i.length,c=t.start,d=t.end,f=function(y){var g=i[y],j,b=function(){return j===void 0&&(j=n(g,y)),j};if(y===o-1){var x=e*(g.coordinate+e*b()/2-d);i[y]=g=vr(vr({},g),{},{tickCoord:x>0?g.coordinate-x*e:g.coordinate})}else i[y]=g=vr(vr({},g),{},{tickCoord:g.coordinate});var S=um(e,g.tickCoord,b,c,d);S&&(d=g.tickCoord-e*(b()/2+a),i[y]=vr(vr({},g),{},{isShow:!0}))},h=o-1;h>=0;h--)f(h);return i}function hue(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),y=e*(h.coordinate+e*p/2-f);o[c-1]=h=vr(vr({},h),{},{tickCoord:y>0?h.coordinate-y*e:h.coordinate});var g=um(e,h.tickCoord,function(){return p},d,f);g&&(f=h.tickCoord-e*(p/2+a),o[c-1]=vr(vr({},h),{},{isShow:!0}))}for(var j=i?c-1:c,b=function(N){var _=o[N],P,A=function(){return P===void 0&&(P=n(_,N)),P};if(N===0){var O=e*(_.coordinate-e*A()/2-d);o[N]=_=vr(vr({},_),{},{tickCoord:O<0?_.coordinate-O*e:_.coordinate})}else o[N]=_=vr(vr({},_),{},{tickCoord:_.coordinate});var R=um(e,_.tickCoord,A,d,f);R&&(d=_.tickCoord+e*(A()/2+a),o[N]=vr(vr({},_),{},{isShow:!0}))},x=0;x<j;x++)b(x);return o}function mue(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(Le(d)||Fo.isSsr)return lue(a,typeof d=="number"&&Le(d)?d:0);var y=[],g=c==="top"||c==="bottom"?"width":"height",j=h&&g==="width"?Xu(h,{fontSize:t,letterSpacing:n}):{width:0,height:0},b=function(_,P){var A=bt(f)?f(_.value,P):_.value;return g==="width"?iue(Xu(A,{fontSize:t,letterSpacing:n}),j,p):Xu(A,{fontSize:t,letterSpacing:n})[g]},x=a.length>=2?wr(a[1].coordinate-a[0].coordinate):1,S=oue(i,x,g);return d==="equidistantPreserveStart"?cue(x,S,b,a,o):(d==="preserveStart"||d==="preserveStartEnd"?y=hue(x,S,b,a,o,d==="preserveStartEnd"):y=pue(x,S,b,a,o),y.filter(function(N){return N.isShow}))}var vue=["viewBox"],gue=["viewBox"],yue=["ticks"];function gc(e){"@babel/helpers - typeof";return gc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gc(e)}function kl(){return kl=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},kl.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 Un(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){YN(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 a1(e,t){if(e==null)return{};var n=xue(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 xue(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function bue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,C4(r.key),r)}}function wue(e,t,n){return t&&FI(e.prototype,t),n&&FI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function jue(e,t,n){return t=dm(t),Sue(e,N4()?Reflect.construct(t,n||[],dm(e).constructor):t.apply(e,n))}function Sue(e,t){if(t&&(gc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Nue(e)}function Nue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function N4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(N4=function(){return!!e})()}function dm(e){return dm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},dm(e)}function Cue(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&&Gj(e,t)}function Gj(e,t){return Gj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Gj(e,t)}function YN(e,t,n){return t=C4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function C4(e){var t=_ue(e,"string");return gc(t)=="symbol"?t:t+""}function _ue(e,t){if(gc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(gc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Mv=(function(e){function t(n){var r;return bue(this,t),r=jue(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return Cue(t,e),wue(t,[{key:"shouldComponentUpdate",value:function(r,a){var i=r.viewBox,o=a1(r,vue),c=this.props,d=c.viewBox,f=a1(c,gue);return!Bl(i,d)||!Bl(o,f)||!Bl(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,y=a.tickMargin,g,j,b,x,S,N,_=p?-1:1,P=r.tickSize||h,A=Le(r.tickCoord)?r.tickCoord:r.coordinate;switch(f){case"top":g=j=r.coordinate,x=o+ +!p*d,b=x-_*P,N=b-_*y,S=A;break;case"left":b=x=r.coordinate,j=i+ +!p*c,g=j-_*P,S=g-_*y,N=A;break;case"right":b=x=r.coordinate,j=i+ +p*c,g=j+_*P,S=g+_*y,N=A;break;default:g=j=r.coordinate,x=o+ +p*d,b=x+_*P,N=b+_*y,S=A;break}return{line:{x1:g,y1:b,x2:j,y2:x},tick:{x:S,y:N}}}},{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=Un(Un(Un({},ht(this.props,!1)),ht(h,!1)),{},{fill:"none"});if(d==="top"||d==="bottom"){var y=+(d==="top"&&!f||d==="bottom"&&f);p=Un(Un({},p),{},{x1:a,y1:i+y*c,x2:a+o,y2:i+y*c})}else{var g=+(d==="left"&&!f||d==="right"&&f);p=Un(Un({},p),{},{x1:a+g*o,y1:i,x2:a+g*o,y2:i+c})}return q.createElement("line",kl({},p,{className:jt("recharts-cartesian-axis-line",ra(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,y=c.unit,g=mue(Un(Un({},this.props),{},{ticks:r}),a,i),j=this.getTickTextAnchor(),b=this.getTickVerticalAnchor(),x=ht(this.props,!1),S=ht(h,!1),N=Un(Un({},x),{},{fill:"none"},ht(d,!1)),_=g.map(function(P,A){var O=o.getTickLineCoord(P),R=O.line,k=O.tick,M=Un(Un(Un(Un({textAnchor:j,verticalAnchor:b},x),{},{stroke:"none",fill:f},S),k),{},{index:A,payload:P,visibleTicksCount:g.length,tickFormatter:p});return q.createElement(It,kl({className:"recharts-cartesian-axis-tick",key:"tick-".concat(P.value,"-").concat(P.coordinate,"-").concat(P.tickCoord)},_o(o.props,P,A)),d&&q.createElement("line",kl({},N,R,{className:jt("recharts-cartesian-axis-tick-line",ra(d,"className"))})),h&&t.renderTickItem(h,M,"".concat(bt(p)?p(P.value,A):P.value).concat(y||"")))});return q.createElement("g",{className:"recharts-cartesian-axis-ticks"},_)}},{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,y=p.ticks,g=a1(p,yue),j=y;return bt(d)&&(j=y&&y.length>0?d(this.props):d(g)),o<=0||c<=0||!j||!j.length?null:q.createElement(It,{className:jt("recharts-cartesian-axis",f),ref:function(x){r.layerReference=x}},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=jt(a.className,"recharts-cartesian-axis-tick-value");return q.isValidElement(r)?o=q.cloneElement(r,Un(Un({},a),{},{className:c})):bt(r)?o=r(Un(Un({},a),{},{className:c})):o=q.createElement(Ao,kl({},a,{className:"recharts-cartesian-axis-tick-value"}),i),o}}])})(v.Component);YN(Mv,"displayName","CartesianAxis");YN(Mv,"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 Aue=["type","layout","connectNulls","ref"],Eue=["key"];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 BI(e,t){if(e==null)return{};var n=Pue(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 Pue(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 nd(){return nd=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},nd.apply(this,arguments)}function zI(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 Hr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zI(Object(n),!0).forEach(function(r){Ba(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jl(e){return Tue(e)||kue(e)||Rue(e)||Oue()}function Oue(){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 Rue(e,t){if(e){if(typeof e=="string")return Yj(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 Yj(e,t)}}function kue(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Tue(e){if(Array.isArray(e))return Yj(e)}function Yj(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 Iue(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,A4(r.key),r)}}function Mue(e,t,n){return t&&UI(e.prototype,t),n&&UI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function $ue(e,t,n){return t=fm(t),Due(e,_4()?Reflect.construct(t,n||[],fm(e).constructor):t.apply(e,n))}function Due(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 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 _4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_4=function(){return!!e})()}function fm(e){return fm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},fm(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&&Xj(e,t)}function Xj(e,t){return Xj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Xj(e,t)}function Ba(e,t,n){return t=A4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A4(e){var t=Bue(e,"string");return yc(t)=="symbol"?t:t+""}function Bue(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 xc=(function(e){function t(){var n;Iue(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=$ue(this,t,[].concat(a)),Ba(n,"state",{isAnimationFinished:!0,totalLength:0}),Ba(n,"generateSimpleStrokeDasharray",function(o,c){return"".concat(c,"px ").concat(o-c,"px")}),Ba(n,"getStrokeDasharray",function(o,c,d){var f=d.reduce(function(S,N){return S+N});if(!f)return n.generateSimpleStrokeDasharray(c,o);for(var h=Math.floor(o/f),p=o%f,y=c-o,g=[],j=0,b=0;j<d.length;b+=d[j],++j)if(b+d[j]>p){g=[].concat(jl(d.slice(0,j)),[p-b]);break}var x=g.length%2===0?[0,y]:[y];return[].concat(jl(t.repeat(d,h)),jl(g),x).map(function(S){return"".concat(S,"px")}).join(", ")}),Ba(n,"id",Lc("recharts-line-")),Ba(n,"pathRef",function(o){n.mainCurve=o}),Ba(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Ba(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return Fue(t,e),Mue(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=aa(h,vf);if(!p)return null;var y=function(b,x){return{x:b.x,y:b.y,value:b.value,errorVal:Wn(b.payload,x)}},g={clipPath:r?"url(#clipPath-".concat(a,")"):null};return q.createElement(It,g,p.map(function(j){return q.cloneElement(j,{key:"bar-".concat(j.props.dataKey),data:o,xAxis:c,yAxis:d,layout:f,dataPointFormatter:y})}))}},{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=ht(this.props,!1),y=ht(d,!0),g=f.map(function(b,x){var S=Hr(Hr(Hr({key:"dot-".concat(x),r:3},p),y),{},{index:x,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 q.createElement(It,nd({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=BI(c,Aue),y=Hr(Hr(Hr({},ht(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 q.createElement(Vh,nd({},y,{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,y=o.animationEasing,g=o.animationId,j=o.animateNewValues,b=o.width,x=o.height,S=this.state,N=S.prevPoints,_=S.totalLength;return q.createElement(vs,{begin:h,duration:p,isActive:f,easing:y,from:{t:0},to:{t:1},key:"line-".concat(g),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(P){var A=P.t;if(N){var O=N.length/c.length,R=c.map(function(L,G){var U=Math.floor(G*O);if(N[U]){var H=N[U],Q=Qr(H.x,L.x),J=Qr(H.y,L.y);return Hr(Hr({},L),{},{x:Q(A),y:J(A)})}if(j){var T=Qr(b*2,L.x),D=Qr(x/2,L.y);return Hr(Hr({},L),{},{x:T(A),y:D(A)})}return Hr(Hr({},L),{},{x:L.x,y:L.y})});return i.renderCurveStatically(R,r,a)}var k=Qr(0,_),M=k(A),z;if(d){var B="".concat(d).split(/[,\s]+/gim).map(function(L){return parseFloat(L)});z=i.getStrokeDasharray(M,_,B)}else z=i.generateSimpleStrokeDasharray(_,M);return i.renderCurveStatically(c,r,a,{strokeDasharray:z})})}},{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||!mf(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,y=a.left,g=a.width,j=a.height,b=a.isAnimationActive,x=a.id;if(i||!c||!c.length)return null;var S=this.state.isAnimationFinished,N=c.length===1,_=jt("recharts-line",d),P=f&&f.allowDataOverflow,A=h&&h.allowDataOverflow,O=P||A,R=wt(x)?this.id:x,k=(r=ht(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},M=k.r,z=M===void 0?3:M,B=k.strokeWidth,L=B===void 0?2:B,G=OY(o)?o:{},U=G.clipDot,H=U===void 0?!0:U,Q=z*2+L;return q.createElement(It,{className:_},P||A?q.createElement("defs",null,q.createElement("clipPath",{id:"clipPath-".concat(R)},q.createElement("rect",{x:P?y:y-g/2,y:A?p:p-j/2,width:P?g:g*2,height:A?j:j*2})),!H&&q.createElement("clipPath",{id:"clipPath-dots-".concat(R)},q.createElement("rect",{x:y-Q/2,y:p-Q/2,width:g+Q,height:j+Q}))):null,!N&&this.renderCurve(O,R),this.renderErrorBar(O,R),(N||o)&&this.renderDots(O,H,R),(!b||S)&&Ws.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(jl(r),[0]):r,o=[],c=0;c<a;++c)o=[].concat(jl(o),jl(i));return o}},{key:"renderDotItem",value:function(r,a){var i;if(q.isValidElement(r))i=q.cloneElement(r,a);else if(bt(r))i=r(a);else{var o=a.key,c=BI(a,Eue),d=jt("recharts-line-dot",typeof r!="boolean"?r.className:"");i=q.createElement(Sv,nd({key:o},c,{className:d}))}return i}}])})(v.PureComponent);Ba(xc,"displayName","Line");Ba(xc,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!Fo.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Ba(xc,"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(y,g){var j=Wn(y,o);return h==="horizontal"?{x:Y2({axis:n,ticks:a,bandSize:c,entry:y,index:g}),y:wt(j)?null:r.scale(j),value:j,payload:y}:{x:wt(j)?null:n.scale(j),y:Y2({axis:r,ticks:i,bandSize:c,entry:y,index:g}),value:j,payload:y}});return Hr({points:p,layout:h},f)});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 zue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Uue(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,O4(r.key),r)}}function que(e,t,n){return t&&Uue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Wue(e,t,n){return t=pm(t),Vue(e,E4()?Reflect.construct(t,n||[],pm(e).constructor):t.apply(e,n))}function Vue(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 Hue(e)}function Hue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(E4=function(){return!!e})()}function pm(e){return pm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},pm(e)}function Kue(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Qj(e,t)}function Qj(e,t){return Qj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Qj(e,t)}function P4(e,t,n){return t=O4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O4(e){var t=Gue(e,"string");return bc(t)=="symbol"?t:t+""}function Gue(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 Jj(){return Jj=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},Jj.apply(this,arguments)}function Yue(e){var t=e.xAxisId,n=m4(),r=v4(),a=p4(t);return a==null?null:v.createElement(Mv,Jj({},a,{className:jt("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(o){return yo(o,!0)}}))}var Oo=(function(e){function t(){return zue(this,t),Wue(this,t,arguments)}return Kue(t,e),que(t,[{key:"render",value:function(){return v.createElement(Yue,this.props)}}])})(v.Component);P4(Oo,"displayName","XAxis");P4(Oo,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function 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 Xue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Que(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,T4(r.key),r)}}function Jue(e,t,n){return t&&Que(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Zue(e,t,n){return t=hm(t),ede(e,R4()?Reflect.construct(t,n||[],hm(e).constructor):t.apply(e,n))}function ede(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 tde(e)}function tde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function R4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(R4=function(){return!!e})()}function hm(e){return hm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},hm(e)}function nde(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zj(e,t)}function Zj(e,t){return Zj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Zj(e,t)}function k4(e,t,n){return t=T4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T4(e){var t=rde(e,"string");return wc(t)=="symbol"?t:t+""}function rde(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)}function eS(){return eS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},eS.apply(this,arguments)}var ade=function(t){var n=t.yAxisId,r=m4(),a=v4(),i=h4(n);return i==null?null:v.createElement(Mv,eS({},i,{className:jt("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:r,height:a},ticksGenerator:function(c){return yo(c,!0)}}))},Ro=(function(e){function t(){return Xue(this,t),Zue(this,t,arguments)}return nde(t,e),Jue(t,[{key:"render",value:function(){return v.createElement(ade,this.props)}}])})(v.Component);k4(Ro,"displayName","YAxis");k4(Ro,"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 qI(e){return lde(e)||ode(e)||ide(e)||sde()}function sde(){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 ide(e,t){if(e){if(typeof e=="string")return tS(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 tS(e,t)}}function ode(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function lde(e){if(Array.isArray(e))return tS(e)}function tS(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 nS=function(t,n,r,a,i){var o=aa(t,GN),c=aa(t,kv),d=[].concat(qI(o),qI(c)),f=aa(t,Iv),h="".concat(a,"Id"),p=a[0],y=n;if(d.length&&(y=d.reduce(function(b,x){if(x.props[h]===r&&fs(x.props,"extendDomain")&&Le(x.props[p])){var S=x.props[p];return[Math.min(b[0],S),Math.max(b[1],S)]}return b},y)),f.length){var g="".concat(p,"1"),j="".concat(p,"2");y=f.reduce(function(b,x){if(x.props[h]===r&&fs(x.props,"extendDomain")&&Le(x.props[g])&&Le(x.props[j])){var S=x.props[g],N=x.props[j];return[Math.min(b[0],S,N),Math.max(b[1],S,N)]}return b},y)}return i&&i.length&&(y=i.reduce(function(b,x){return Le(x)?[Math.min(b[0],x),Math.max(b[1],x)]:b},y)),y},s1={exports:{}},WI;function cde(){return WI||(WI=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,y){if(typeof h!="function")throw new TypeError("The listener must be a function");var g=new a(h,p||d,y),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 y=0,g=p.length,j=new Array(g);y<g;y++)j[y]=p[y].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,y,g,j){var b=n?n+f:f;if(!this._events[b])return!1;var x=this._events[b],S=arguments.length,N,_;if(x.fn){switch(x.once&&this.removeListener(f,x.fn,void 0,!0),S){case 1:return x.fn.call(x.context),!0;case 2:return x.fn.call(x.context,h),!0;case 3:return x.fn.call(x.context,h,p),!0;case 4:return x.fn.call(x.context,h,p,y),!0;case 5:return x.fn.call(x.context,h,p,y,g),!0;case 6:return x.fn.call(x.context,h,p,y,g,j),!0}for(_=1,N=new Array(S-1);_<S;_++)N[_-1]=arguments[_];x.fn.apply(x.context,N)}else{var P=x.length,A;for(_=0;_<P;_++)switch(x[_].once&&this.removeListener(f,x[_].fn,void 0,!0),S){case 1:x[_].fn.call(x[_].context);break;case 2:x[_].fn.call(x[_].context,h);break;case 3:x[_].fn.call(x[_].context,h,p);break;case 4:x[_].fn.call(x[_].context,h,p,y);break;default:if(!N)for(A=1,N=new Array(S-1);A<S;A++)N[A-1]=arguments[A];x[_].fn.apply(x[_].context,N)}}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,y){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&&(!y||j.once)&&(!p||j.context===p)&&o(this,g);else{for(var b=0,x=[],S=j.length;b<S;b++)(j[b].fn!==h||y&&!j[b].once||p&&j[b].context!==p)&&x.push(j[b]);x.length?this._events[g]=x.length===1?x[0]:x: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})(s1)),s1.exports}var ude=cde();const dde=Vt(ude);var i1=new dde,o1="recharts.syncMouseEvents";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 fde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pde(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 hde(e,t,n){return t&&pde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function l1(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 I4(e){var t=mde(e,"string");return Wd(t)=="symbol"?t:t+""}function mde(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 String(e)}var vde=(function(){function e(){fde(this,e),l1(this,"activeIndex",0),l1(this,"coordinateList",[]),l1(this,"layout","horizontal")}return hde(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,y=n.mouseHandlerCallback,g=y===void 0?null:y;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,y=o+this.offset.top+c/2+h;this.mouseHandlerCallback({pageX:p,pageY:y})}}}])})();function gde(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e?.[0],a=e?.[1];if(r&&a&&Le(r)&&Le(a))return!0}return!1}function yde(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 M4(e){var t=e.cx,n=e.cy,r=e.radius,a=e.startAngle,i=e.endAngle,o=ln(t,n,r,a),c=ln(t,n,r,i);return{points:[o,c],cx:t,cy:n,radius:r,startAngle:a,endAngle:i}}function xde(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,y=ln(c,d,f,p),g=ln(c,d,h,p);r=y.x,a=y.y,i=g.x,o=g.y}else return M4(t);return[{x:r,y:a},{x:i,y:o}]}function Vd(e){"@babel/helpers - typeof";return Vd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vd(e)}function VI(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 Gp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VI(Object(n),!0).forEach(function(r){bde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bde(e,t,n){return t=wde(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wde(e){var t=jde(e,"string");return Vd(t)=="symbol"?t:t+""}function jde(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 Sde(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,y=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||y!=="ScatterChart"&&a!=="axis")return null;var j,b=Vh;if(y==="ScatterChart")j=o,b=ioe;else if(y==="BarChart")j=yde(p,o,d,h),b=VN;else if(p==="radial"){var x=M4(o),S=x.cx,N=x.cy,_=x.radius,P=x.startAngle,A=x.endAngle;j={cx:S,cy:N,startAngle:P,endAngle:A,innerRadius:_,outerRadius:_},b=ML}else j={points:xde(p,o,d)},b=Vh;var O=Gp(Gp(Gp(Gp({stroke:"#ccc",pointerEvents:"none"},d),j),ht(g,!1)),{},{payload:c,payloadIndex:f,className:jt("recharts-tooltip-cursor",g.className)});return v.isValidElement(g)?v.cloneElement(g,O):v.createElement(b,O)}var Nde=["item"],Cde=["children","className","width","height","style","compact","title","desc"];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 Tl(){return Tl=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},Tl.apply(this,arguments)}function HI(e,t){return Ede(e)||Ade(e,t)||D4(e,t)||_de()}function _de(){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 Ade(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 Ede(e){if(Array.isArray(e))return e}function KI(e,t){if(e==null)return{};var n=Pde(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 Pde(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 Ode(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rde(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,L4(r.key),r)}}function kde(e,t,n){return t&&Rde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Tde(e,t,n){return t=mm(t),Ide(e,$4()?Reflect.construct(t,n||[],mm(e).constructor):t.apply(e,n))}function Ide(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 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 $4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($4=function(){return!!e})()}function mm(e){return mm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},mm(e)}function $de(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 Sc(e){return Fde(e)||Lde(e)||D4(e)||Dde()}function Dde(){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 D4(e,t){if(e){if(typeof e=="string")return aS(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 aS(e,t)}}function Lde(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Fde(e){if(Array.isArray(e))return aS(e)}function aS(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 GI(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 xe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GI(Object(n),!0).forEach(function(r){mt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mt(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=Bde(e,"string");return jc(t)=="symbol"?t:t+""}function Bde(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(t==="string"?String:Number)(e)}var zde={xAxis:["bottom","top"],yAxis:["left","right"]},Ude={width:"100%",height:"100%"},F4={x:0,y:0};function Yp(e){return e}var qde=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},Wde=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 xe(xe(xe({},a),ln(a.cx,a.cy,c,o)),{},{angle:o,radius:c})}var d=i.coordinate,f=a.angle;return xe(xe(xe({},a),ln(a.cx,a.cy,d,f)),{},{angle:f,radius:d})}return F4},$v=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(Sc(c),Sc(f)):c},[]);return o.length>0?o:t&&t.length&&Le(a)&&Le(i)?t.slice(a,i+1):[]};function B4(e){return e==="number"?[0,"auto"]:void 0}var sS=function(t,n,r,a){var i=t.graphicalItems,o=t.tooltipAxis,c=$v(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 y;if(o.dataKey&&!o.allowDuplicatedCategory){var g=p===void 0?c:p;y=vh(g,o.dataKey,a)}else y=p&&p[r]||c[r];return y?[].concat(Sc(d),[PL(f,y)]):d},[])},YI=function(t,n,r,a){var i=a||{x:t.chartX,y:t.chartY},o=qde(i,r),c=t.orderedTooltipTicks,d=t.tooltipAxis,f=t.tooltipTicks,h=Are(o,c,f,d);if(h>=0&&f){var p=f[h]&&f[h].value,y=sS(t,n,h,p),g=Wde(r,c,h,i);return{activeTooltipIndex:h,activeLabel:p,activePayload:y,activeCoordinate:g}}return null},Vde=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,y=t.stackOffset,g=NL(h,i);return r.reduce(function(j,b){var x,S=b.type.defaultProps!==void 0?xe(xe({},b.type.defaultProps),b.props):b.props,N=S.type,_=S.dataKey,P=S.allowDataOverflow,A=S.allowDuplicatedCategory,O=S.scale,R=S.ticks,k=S.includeHidden,M=S[o];if(j[M])return j;var z=$v(t.data,{graphicalItems:a.filter(function($){var ee,ae=o in $.props?$.props[o]:(ee=$.type.defaultProps)===null||ee===void 0?void 0:ee[o];return ae===M}),dataStartIndex:d,dataEndIndex:f}),B=z.length,L,G,U;gde(S.domain,P,N)&&(L=xj(S.domain,null,P),g&&(N==="number"||O!=="auto")&&(U=Ju(z,_,"category")));var H=B4(N);if(!L||L.length===0){var Q,J=(Q=S.domain)!==null&&Q!==void 0?Q:H;if(_){if(L=Ju(z,_,N),N==="category"&&g){var T=bY(L);A&&T?(G=L,L=nm(0,B)):A||(L=Z2(J,L,b).reduce(function($,ee){return $.indexOf(ee)>=0?$:[].concat(Sc($),[ee])},[]))}else if(N==="category")A?L=L.filter(function($){return $!==""&&!wt($)}):L=Z2(J,L,b).reduce(function($,ee){return $.indexOf(ee)>=0||ee===""||wt(ee)?$:[].concat(Sc($),[ee])},[]);else if(N==="number"){var D=kre(z,a.filter(function($){var ee,ae,K=o in $.props?$.props[o]:(ee=$.type.defaultProps)===null||ee===void 0?void 0:ee[o],le="hide"in $.props?$.props.hide:(ae=$.type.defaultProps)===null||ae===void 0?void 0:ae.hide;return K===M&&(k||!le)}),_,i,h);D&&(L=D)}g&&(N==="number"||O!=="auto")&&(U=Ju(z,_,"category"))}else g?L=nm(0,B):c&&c[M]&&c[M].hasStack&&N==="number"?L=y==="expand"?[0,1]:EL(c[M].stackGroups,d,f):L=SL(z,a.filter(function($){var ee=o in $.props?$.props[o]:$.type.defaultProps[o],ae="hide"in $.props?$.props.hide:$.type.defaultProps.hide;return ee===M&&(k||!ae)}),N,h,!0);if(N==="number")L=nS(p,L,M,i,R),J&&(L=xj(J,L,P));else if(N==="category"&&J){var X=J,F=L.every(function($){return X.indexOf($)>=0});F&&(L=X)}}return xe(xe({},j),{},mt({},M,xe(xe({},S),{},{axisType:i,domain:L,categoricalDomain:U,duplicateDomain:G,originalDomain:(x=S.domain)!==null&&x!==void 0?x:H,isCategorical:g,layout:h})))},{})},Hde=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,y=$v(t.data,{graphicalItems:r,dataStartIndex:d,dataEndIndex:f}),g=y.length,j=NL(h,i),b=-1;return r.reduce(function(x,S){var N=S.type.defaultProps!==void 0?xe(xe({},S.type.defaultProps),S.props):S.props,_=N[o],P=B4("number");if(!x[_]){b++;var A;return j?A=nm(0,g):c&&c[_]&&c[_].hasStack?(A=EL(c[_].stackGroups,d,f),A=nS(p,A,_,i)):(A=xj(P,SL(y,r.filter(function(O){var R,k,M=o in O.props?O.props[o]:(R=O.type.defaultProps)===null||R===void 0?void 0:R[o],z="hide"in O.props?O.props.hide:(k=O.type.defaultProps)===null||k===void 0?void 0:k.hide;return M===_&&!z}),"number",h),a.defaultProps.allowDataOverflow),A=nS(p,A,_,i)),xe(xe({},x),{},mt({},_,xe(xe({axisType:i},a.defaultProps),{},{hide:!0,orientation:ra(zde,"".concat(i,".").concat(b%2),null),domain:A,originalDomain:P,isCategorical:j,layout:h})))}return x},{})},Kde=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"),y=aa(h,i),g={};return y&&y.length?g=Vde(t,{axes:y,graphicalItems:o,axisType:a,axisIdKey:p,stackGroups:c,dataStartIndex:d,dataEndIndex:f}):o&&o.length&&(g=Hde(t,{Axis:i,graphicalItems:o,axisType:a,axisIdKey:p,stackGroups:c,dataStartIndex:d,dataEndIndex:f})),g},Gde=function(t){var n=Cl(t),r=yo(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:yN(r,function(a){return a.coordinate}),tooltipAxis:n,tooltipAxisBandSize:Uh(n,r)}},XI=function(t){var n=t.children,r=t.defaultShowTooltip,a=Gr(n,fc),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}},Yde=function(t){return!t||!t.length?!1:t.some(function(n){var r=zs(n&&n.type);return r&&r.indexOf("Bar")>=0})},QI=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"}},Xde=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,y=r.margin||{},g=Gr(p,fc),j=Gr(p,zl),b=Object.keys(d).reduce(function(A,O){var R=d[O],k=R.orientation;return!R.mirror&&!R.hide?xe(xe({},A),{},mt({},k,A[k]+R.width)):A},{left:y.left||0,right:y.right||0}),x=Object.keys(o).reduce(function(A,O){var R=o[O],k=R.orientation;return!R.mirror&&!R.hide?xe(xe({},A),{},mt({},k,ra(A,"".concat(k))+R.height)):A},{top:y.top||0,bottom:y.bottom||0}),S=xe(xe({},x),b),N=S.bottom;g&&(S.bottom+=g.props.height||fc.defaultProps.height),j&&n&&(S=Ore(S,a,r,n));var _=f-S.left-S.right,P=h-S.top-S.bottom;return xe(xe({brushBottom:N},S),{},{width:Math.max(_,0),height:Math.max(P,0)})},Qde=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},XN=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,y=function(S,N){var _=N.graphicalItems,P=N.stackGroups,A=N.offset,O=N.updateId,R=N.dataStartIndex,k=N.dataEndIndex,M=S.barSize,z=S.layout,B=S.barGap,L=S.barCategoryGap,G=S.maxBarSize,U=QI(z),H=U.numericAxisName,Q=U.cateAxisName,J=Yde(_),T=[];return _.forEach(function(D,X){var F=$v(S.data,{graphicalItems:[D],dataStartIndex:R,dataEndIndex:k}),$=D.type.defaultProps!==void 0?xe(xe({},D.type.defaultProps),D.props):D.props,ee=$.dataKey,ae=$.maxBarSize,K=$["".concat(H,"Id")],le=$["".concat(Q,"Id")],te={},de=d.reduce(function(Ne,Ie){var Re=N["".concat(Ie.axisType,"Map")],De=$["".concat(Ie.axisType,"Id")];Re&&Re[De]||Ie.axisType==="zAxis"||Po();var he=Re[De];return xe(xe({},Ne),{},mt(mt({},Ie.axisType,he),"".concat(Ie.axisType,"Ticks"),yo(he)))},te),oe=de[Q],pe=de["".concat(Q,"Ticks")],je=P&&P[K]&&P[K].hasStack&&zre(D,P[K].stackGroups),se=zs(D.type).indexOf("Bar")>=0,$e=Uh(oe,pe),Ae=[],Ye=J&&Ere({barSize:M,stackGroups:P,totalSize:Qde(de,Q)});if(se){var ye,Se,ze=wt(ae)?G:ae,ct=(ye=(Se=Uh(oe,pe,!0))!==null&&Se!==void 0?Se:ze)!==null&&ye!==void 0?ye:0;Ae=Pre({barGap:B,barCategoryGap:L,bandSize:ct!==$e?ct:$e,sizeList:Ye[le],maxBarSize:ze}),ct!==$e&&(Ae=Ae.map(function(Ne){return xe(xe({},Ne),{},{position:xe(xe({},Ne.position),{},{offset:Ne.position.offset-ct/2})})}))}var Z=D&&D.type&&D.type.getComposedData;Z&&T.push({props:xe(xe({},Z(xe(xe({},de),{},{displayedData:F,props:S,dataKey:ee,item:D,bandSize:$e,barPosition:Ae,offset:A,stackedData:je,layout:z,dataStartIndex:R,dataEndIndex:k}))),{},mt(mt(mt({key:D.key||"item-".concat(X)},H,de[H]),Q,de[Q]),"animationId",O)),childIndex:TY(D,S.children),item:D})}),T},g=function(S,N){var _=S.props,P=S.dataStartIndex,A=S.dataEndIndex,O=S.updateId;if(!pO({props:_}))return null;var R=_.children,k=_.layout,M=_.stackOffset,z=_.data,B=_.reverseStackOrder,L=QI(k),G=L.numericAxisName,U=L.cateAxisName,H=aa(R,r),Q=Fre(z,H,"".concat(G,"Id"),"".concat(U,"Id"),M,B),J=d.reduce(function($,ee){var ae="".concat(ee.axisType,"Map");return xe(xe({},$),{},mt({},ae,Kde(_,xe(xe({},ee),{},{graphicalItems:H,stackGroups:ee.axisType===G&&Q,dataStartIndex:P,dataEndIndex:A}))))},{}),T=Xde(xe(xe({},J),{},{props:_,graphicalItems:H}),N?.legendBBox);Object.keys(J).forEach(function($){J[$]=h(_,J[$],T,$.replace("Map",""),n)});var D=J["".concat(U,"Map")],X=Gde(D),F=y(_,xe(xe({},J),{},{dataStartIndex:P,dataEndIndex:A,updateId:O,graphicalItems:H,stackGroups:Q,offset:T}));return xe(xe({formattedGraphicalItems:F,graphicalItems:H,offset:T,stackGroups:Q},X),J)},j=(function(x){function S(N){var _,P,A;return Ode(this,S),A=Tde(this,S,[N]),mt(A,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),mt(A,"accessibilityManager",new vde),mt(A,"handleLegendBBoxUpdate",function(O){if(O){var R=A.state,k=R.dataStartIndex,M=R.dataEndIndex,z=R.updateId;A.setState(xe({legendBBox:O},g({props:A.props,dataStartIndex:k,dataEndIndex:M,updateId:z},xe(xe({},A.state),{},{legendBBox:O}))))}}),mt(A,"handleReceiveSyncEvent",function(O,R,k){if(A.props.syncId===O){if(k===A.eventEmitterSymbol&&typeof A.props.syncMethod!="function")return;A.applySyncEvent(R)}}),mt(A,"handleBrushChange",function(O){var R=O.startIndex,k=O.endIndex;if(R!==A.state.dataStartIndex||k!==A.state.dataEndIndex){var M=A.state.updateId;A.setState(function(){return xe({dataStartIndex:R,dataEndIndex:k},g({props:A.props,dataStartIndex:R,dataEndIndex:k,updateId:M},A.state))}),A.triggerSyncEvent({dataStartIndex:R,dataEndIndex:k})}}),mt(A,"handleMouseEnter",function(O){var R=A.getMouseInfo(O);if(R){var k=xe(xe({},R),{},{isTooltipActive:!0});A.setState(k),A.triggerSyncEvent(k);var M=A.props.onMouseEnter;bt(M)&&M(k,O)}}),mt(A,"triggeredAfterMouseMove",function(O){var R=A.getMouseInfo(O),k=R?xe(xe({},R),{},{isTooltipActive:!0}):{isTooltipActive:!1};A.setState(k),A.triggerSyncEvent(k);var M=A.props.onMouseMove;bt(M)&&M(k,O)}),mt(A,"handleItemMouseEnter",function(O){A.setState(function(){return{isTooltipActive:!0,activeItem:O,activePayload:O.tooltipPayload,activeCoordinate:O.tooltipPosition||{x:O.cx,y:O.cy}}})}),mt(A,"handleItemMouseLeave",function(){A.setState(function(){return{isTooltipActive:!1}})}),mt(A,"handleMouseMove",function(O){O.persist(),A.throttleTriggeredAfterMouseMove(O)}),mt(A,"handleMouseLeave",function(O){A.throttleTriggeredAfterMouseMove.cancel();var R={isTooltipActive:!1};A.setState(R),A.triggerSyncEvent(R);var k=A.props.onMouseLeave;bt(k)&&k(R,O)}),mt(A,"handleOuterEvent",function(O){var R=kY(O),k=ra(A.props,"".concat(R));if(R&&bt(k)){var M,z;/.*touch.*/i.test(R)?z=A.getMouseInfo(O.changedTouches[0]):z=A.getMouseInfo(O),k((M=z)!==null&&M!==void 0?M:{},O)}}),mt(A,"handleClick",function(O){var R=A.getMouseInfo(O);if(R){var k=xe(xe({},R),{},{isTooltipActive:!0});A.setState(k),A.triggerSyncEvent(k);var M=A.props.onClick;bt(M)&&M(k,O)}}),mt(A,"handleMouseDown",function(O){var R=A.props.onMouseDown;if(bt(R)){var k=A.getMouseInfo(O);R(k,O)}}),mt(A,"handleMouseUp",function(O){var R=A.props.onMouseUp;if(bt(R)){var k=A.getMouseInfo(O);R(k,O)}}),mt(A,"handleTouchMove",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&A.throttleTriggeredAfterMouseMove(O.changedTouches[0])}),mt(A,"handleTouchStart",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&A.handleMouseDown(O.changedTouches[0])}),mt(A,"handleTouchEnd",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&A.handleMouseUp(O.changedTouches[0])}),mt(A,"handleDoubleClick",function(O){var R=A.props.onDoubleClick;if(bt(R)){var k=A.getMouseInfo(O);R(k,O)}}),mt(A,"handleContextMenu",function(O){var R=A.props.onContextMenu;if(bt(R)){var k=A.getMouseInfo(O);R(k,O)}}),mt(A,"triggerSyncEvent",function(O){A.props.syncId!==void 0&&i1.emit(o1,A.props.syncId,O,A.eventEmitterSymbol)}),mt(A,"applySyncEvent",function(O){var R=A.props,k=R.layout,M=R.syncMethod,z=A.state.updateId,B=O.dataStartIndex,L=O.dataEndIndex;if(O.dataStartIndex!==void 0||O.dataEndIndex!==void 0)A.setState(xe({dataStartIndex:B,dataEndIndex:L},g({props:A.props,dataStartIndex:B,dataEndIndex:L,updateId:z},A.state)));else if(O.activeTooltipIndex!==void 0){var G=O.chartX,U=O.chartY,H=O.activeTooltipIndex,Q=A.state,J=Q.offset,T=Q.tooltipTicks;if(!J)return;if(typeof M=="function")H=M(T,O);else if(M==="value"){H=-1;for(var D=0;D<T.length;D++)if(T[D].value===O.activeLabel){H=D;break}}var X=xe(xe({},J),{},{x:J.left,y:J.top}),F=Math.min(G,X.x+X.width),$=Math.min(U,X.y+X.height),ee=T[H]&&T[H].value,ae=sS(A.state,A.props.data,H),K=T[H]?{x:k==="horizontal"?T[H].coordinate:F,y:k==="horizontal"?$:T[H].coordinate}:F4;A.setState(xe(xe({},O),{},{activeLabel:ee,activeCoordinate:K,activePayload:ae,activeTooltipIndex:H}))}else A.setState(O)}),mt(A,"renderCursor",function(O){var R,k=A.state,M=k.isTooltipActive,z=k.activeCoordinate,B=k.activePayload,L=k.offset,G=k.activeTooltipIndex,U=k.tooltipAxisBandSize,H=A.getTooltipEventType(),Q=(R=O.props.active)!==null&&R!==void 0?R:M,J=A.props.layout,T=O.key||"_recharts-cursor";return q.createElement(Sde,{key:T,activeCoordinate:z,activePayload:B,activeTooltipIndex:G,chartName:n,element:O,isActive:Q,layout:J,offset:L,tooltipAxisBandSize:U,tooltipEventType:H})}),mt(A,"renderPolarAxis",function(O,R,k){var M=ra(O,"type.axisType"),z=ra(A.state,"".concat(M,"Map")),B=O.type.defaultProps,L=B!==void 0?xe(xe({},B),O.props):O.props,G=z&&z[L["".concat(M,"Id")]];return v.cloneElement(O,xe(xe({},G),{},{className:jt(M,G.className),key:O.key||"".concat(R,"-").concat(k),ticks:yo(G,!0)}))}),mt(A,"renderPolarGrid",function(O){var R=O.props,k=R.radialLines,M=R.polarAngles,z=R.polarRadius,B=A.state,L=B.radiusAxisMap,G=B.angleAxisMap,U=Cl(L),H=Cl(G),Q=H.cx,J=H.cy,T=H.innerRadius,D=H.outerRadius;return v.cloneElement(O,{polarAngles:Array.isArray(M)?M:yo(H,!0).map(function(X){return X.coordinate}),polarRadius:Array.isArray(z)?z:yo(U,!0).map(function(X){return X.coordinate}),cx:Q,cy:J,innerRadius:T,outerRadius:D,key:O.key||"polar-grid",radialLines:k})}),mt(A,"renderLegend",function(){var O=A.state.formattedGraphicalItems,R=A.props,k=R.children,M=R.width,z=R.height,B=A.props.margin||{},L=M-(B.left||0)-(B.right||0),G=wL({children:k,formattedGraphicalItems:O,legendWidth:L,legendContent:f});if(!G)return null;var U=G.item,H=KI(G,Nde);return v.cloneElement(U,xe(xe({},H),{},{chartWidth:M,chartHeight:z,margin:B,onBBoxUpdate:A.handleLegendBBoxUpdate}))}),mt(A,"renderTooltip",function(){var O,R=A.props,k=R.children,M=R.accessibilityLayer,z=Gr(k,Yr);if(!z)return null;var B=A.state,L=B.isTooltipActive,G=B.activeCoordinate,U=B.activePayload,H=B.activeLabel,Q=B.offset,J=(O=z.props.active)!==null&&O!==void 0?O:L;return v.cloneElement(z,{viewBox:xe(xe({},Q),{},{x:Q.left,y:Q.top}),active:J,label:H,payload:J?U:[],coordinate:G,accessibilityLayer:M})}),mt(A,"renderBrush",function(O){var R=A.props,k=R.margin,M=R.data,z=A.state,B=z.offset,L=z.dataStartIndex,G=z.dataEndIndex,U=z.updateId;return v.cloneElement(O,{key:O.key||"_recharts-brush",onChange:Wp(A.handleBrushChange,O.props.onChange),data:M,x:Le(O.props.x)?O.props.x:B.left,y:Le(O.props.y)?O.props.y:B.top+B.height+B.brushBottom-(k.bottom||0),width:Le(O.props.width)?O.props.width:B.width,startIndex:L,endIndex:G,updateId:"brush-".concat(U)})}),mt(A,"renderReferenceElement",function(O,R,k){if(!O)return null;var M=A,z=M.clipPathId,B=A.state,L=B.xAxisMap,G=B.yAxisMap,U=B.offset,H=O.type.defaultProps||{},Q=O.props,J=Q.xAxisId,T=J===void 0?H.xAxisId:J,D=Q.yAxisId,X=D===void 0?H.yAxisId:D;return v.cloneElement(O,{key:O.key||"".concat(R,"-").concat(k),xAxis:L[T],yAxis:G[X],viewBox:{x:U.left,y:U.top,width:U.width,height:U.height},clipPathId:z})}),mt(A,"renderActivePoints",function(O){var R=O.item,k=O.activePoint,M=O.basePoint,z=O.childIndex,B=O.isRange,L=[],G=R.props.key,U=R.item.type.defaultProps!==void 0?xe(xe({},R.item.type.defaultProps),R.item.props):R.item.props,H=U.activeDot,Q=U.dataKey,J=xe(xe({index:z,dataKey:Q,cx:k.x,cy:k.y,r:4,fill:WN(R.item),strokeWidth:2,stroke:"#fff",payload:k.payload,value:k.value},ht(H,!1)),gh(H));return L.push(S.renderActiveDot(H,J,"".concat(G,"-activePoint-").concat(z))),M?L.push(S.renderActiveDot(H,xe(xe({},J),{},{cx:M.x,cy:M.y}),"".concat(G,"-basePoint-").concat(z))):B&&L.push(null),L}),mt(A,"renderGraphicChild",function(O,R,k){var M=A.filterFormatItem(O,R,k);if(!M)return null;var z=A.getTooltipEventType(),B=A.state,L=B.isTooltipActive,G=B.tooltipAxis,U=B.activeTooltipIndex,H=B.activeLabel,Q=A.props.children,J=Gr(Q,Yr),T=M.props,D=T.points,X=T.isRange,F=T.baseLine,$=M.item.type.defaultProps!==void 0?xe(xe({},M.item.type.defaultProps),M.item.props):M.item.props,ee=$.activeDot,ae=$.hide,K=$.activeBar,le=$.activeShape,te=!!(!ae&&L&&J&&(ee||K||le)),de={};z!=="axis"&&J&&J.props.trigger==="click"?de={onClick:Wp(A.handleItemMouseEnter,O.props.onClick)}:z!=="axis"&&(de={onMouseLeave:Wp(A.handleItemMouseLeave,O.props.onMouseLeave),onMouseEnter:Wp(A.handleItemMouseEnter,O.props.onMouseEnter)});var oe=v.cloneElement(O,xe(xe({},M.props),de));function pe(Ie){return typeof G.dataKey=="function"?G.dataKey(Ie.payload):null}if(te)if(U>=0){var je,se;if(G.dataKey&&!G.allowDuplicatedCategory){var $e=typeof G.dataKey=="function"?pe:"payload.".concat(G.dataKey.toString());je=vh(D,$e,H),se=X&&F&&vh(F,$e,H)}else je=D?.[U],se=X&&F&&F[U];if(le||K){var Ae=O.props.activeIndex!==void 0?O.props.activeIndex:U;return[v.cloneElement(O,xe(xe(xe({},M.props),de),{},{activeIndex:Ae})),null,null]}if(!wt(je))return[oe].concat(Sc(A.renderActivePoints({item:M,activePoint:je,basePoint:se,childIndex:U,isRange:X})))}else{var Ye,ye=(Ye=A.getItemByXY(A.state.activeCoordinate))!==null&&Ye!==void 0?Ye:{graphicalItem:oe},Se=ye.graphicalItem,ze=Se.item,ct=ze===void 0?O:ze,Z=Se.childIndex,Ne=xe(xe(xe({},M.props),de),{},{activeIndex:Z});return[v.cloneElement(ct,Ne),null,null]}return X?[oe,null,null]:[oe,null]}),mt(A,"renderCustomized",function(O,R,k){return v.cloneElement(O,xe(xe({key:"recharts-customized-".concat(k)},A.props),A.state))}),mt(A,"renderMap",{CartesianGrid:{handler:Yp,once:!0},ReferenceArea:{handler:A.renderReferenceElement},ReferenceLine:{handler:Yp},ReferenceDot:{handler:A.renderReferenceElement},XAxis:{handler:Yp},YAxis:{handler:Yp},Brush:{handler:A.renderBrush,once:!0},Bar:{handler:A.renderGraphicChild},Line:{handler:A.renderGraphicChild},Area:{handler:A.renderGraphicChild},Radar:{handler:A.renderGraphicChild},RadialBar:{handler:A.renderGraphicChild},Scatter:{handler:A.renderGraphicChild},Pie:{handler:A.renderGraphicChild},Funnel:{handler:A.renderGraphicChild},Tooltip:{handler:A.renderCursor,once:!0},PolarGrid:{handler:A.renderPolarGrid,once:!0},PolarAngleAxis:{handler:A.renderPolarAxis},PolarRadiusAxis:{handler:A.renderPolarAxis},Customized:{handler:A.renderCustomized}}),A.clipPathId="".concat((_=N.id)!==null&&_!==void 0?_:Lc("recharts"),"-clip"),A.throttleTriggeredAfterMouseMove=w5(A.triggeredAfterMouseMove,(P=N.throttleDelay)!==null&&P!==void 0?P:1e3/60),A.state={},A}return $de(S,x),kde(S,[{key:"componentDidMount",value:function(){var _,P;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(_=this.props.margin.left)!==null&&_!==void 0?_:0,top:(P=this.props.margin.top)!==null&&P!==void 0?P:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var _=this.props,P=_.children,A=_.data,O=_.height,R=_.layout,k=Gr(P,Yr);if(k){var M=k.props.defaultIndex;if(!(typeof M!="number"||M<0||M>this.state.tooltipTicks.length-1)){var z=this.state.tooltipTicks[M]&&this.state.tooltipTicks[M].value,B=sS(this.state,A,M,z),L=this.state.tooltipTicks[M].coordinate,G=(this.state.offset.top+O)/2,U=R==="horizontal",H=U?{x:L,y:G}:{y:L,x:G},Q=this.state.formattedGraphicalItems.find(function(T){var D=T.item;return D.type.name==="Scatter"});Q&&(H=xe(xe({},H),Q.props.points[M].tooltipPosition),B=Q.props.points[M].tooltipPayload);var J={activeTooltipIndex:M,isTooltipActive:!0,activeLabel:z,activePayload:B,activeCoordinate:H};this.setState(J),this.renderCursor(k),this.accessibilityManager.setIndex(M)}}}},{key:"getSnapshotBeforeUpdate",value:function(_,P){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==P.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==_.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==_.margin){var A,O;this.accessibilityManager.setDetails({offset:{left:(A=this.props.margin.left)!==null&&A!==void 0?A:0,top:(O=this.props.margin.top)!==null&&O!==void 0?O:0}})}return null}},{key:"componentDidUpdate",value:function(_){B1([Gr(_.children,Yr)],[Gr(this.props.children,Yr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var _=Gr(this.props.children,Yr);if(_&&typeof _.props.shared=="boolean"){var P=_.props.shared?"axis":"item";return c.indexOf(P)>=0?P:i}return i}},{key:"getMouseInfo",value:function(_){if(!this.container)return null;var P=this.container,A=P.getBoundingClientRect(),O=xZ(A),R={chartX:Math.round(_.pageX-O.left),chartY:Math.round(_.pageY-O.top)},k=A.width/P.offsetWidth||1,M=this.inRange(R.chartX,R.chartY,k);if(!M)return null;var z=this.state,B=z.xAxisMap,L=z.yAxisMap,G=this.getTooltipEventType(),U=YI(this.state,this.props.data,this.props.layout,M);if(G!=="axis"&&B&&L){var H=Cl(B).scale,Q=Cl(L).scale,J=H&&H.invert?H.invert(R.chartX):null,T=Q&&Q.invert?Q.invert(R.chartY):null;return xe(xe({},R),{},{xValue:J,yValue:T},U)}return U?xe(xe({},R),U):null}},{key:"inRange",value:function(_,P){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,O=this.props.layout,R=_/A,k=P/A;if(O==="horizontal"||O==="vertical"){var M=this.state.offset,z=R>=M.left&&R<=M.left+M.width&&k>=M.top&&k<=M.top+M.height;return z?{x:R,y:k}:null}var B=this.state,L=B.angleAxisMap,G=B.radiusAxisMap;if(L&&G){var U=Cl(L);return nT({x:R,y:k},U)}return null}},{key:"parseEventsOfWrapper",value:function(){var _=this.props.children,P=this.getTooltipEventType(),A=Gr(_,Yr),O={};A&&P==="axis"&&(A.props.trigger==="click"?O={onClick:this.handleClick}:O={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 R=gh(this.props,this.handleOuterEvent);return xe(xe({},R),O)}},{key:"addListener",value:function(){i1.on(o1,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){i1.removeListener(o1,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(_,P,A){for(var O=this.state.formattedGraphicalItems,R=0,k=O.length;R<k;R++){var M=O[R];if(M.item===_||M.props.key===_.key||P===zs(M.item.type)&&A===M.childIndex)return M}return null}},{key:"renderClipPath",value:function(){var _=this.clipPathId,P=this.state.offset,A=P.left,O=P.top,R=P.height,k=P.width;return q.createElement("defs",null,q.createElement("clipPath",{id:_},q.createElement("rect",{x:A,y:O,height:R,width:k})))}},{key:"getXScales",value:function(){var _=this.state.xAxisMap;return _?Object.entries(_).reduce(function(P,A){var O=HI(A,2),R=O[0],k=O[1];return xe(xe({},P),{},mt({},R,k.scale))},{}):null}},{key:"getYScales",value:function(){var _=this.state.yAxisMap;return _?Object.entries(_).reduce(function(P,A){var O=HI(A,2),R=O[0],k=O[1];return xe(xe({},P),{},mt({},R,k.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(_){var P;return(P=this.state.xAxisMap)===null||P===void 0||(P=P[_])===null||P===void 0?void 0:P.scale}},{key:"getYScaleByAxisId",value:function(_){var P;return(P=this.state.yAxisMap)===null||P===void 0||(P=P[_])===null||P===void 0?void 0:P.scale}},{key:"getItemByXY",value:function(_){var P=this.state,A=P.formattedGraphicalItems,O=P.activeItem;if(A&&A.length)for(var R=0,k=A.length;R<k;R++){var M=A[R],z=M.props,B=M.item,L=B.type.defaultProps!==void 0?xe(xe({},B.type.defaultProps),B.props):B.props,G=zs(B.type);if(G==="Bar"){var U=(z.data||[]).find(function(T){return Bie(_,T)});if(U)return{graphicalItem:M,payload:U}}else if(G==="RadialBar"){var H=(z.data||[]).find(function(T){return nT(_,T)});if(H)return{graphicalItem:M,payload:H}}else if(Ev(M,O)||Pv(M,O)||Fd(M,O)){var Q=cle({graphicalItem:M,activeTooltipItem:O,itemData:L.data}),J=L.activeIndex===void 0?Q:L.activeIndex;return{graphicalItem:xe(xe({},M),{},{childIndex:J}),payload:Fd(M,O)?L.data[Q]:M.props.data[Q]}}}return null}},{key:"render",value:function(){var _=this;if(!pO(this))return null;var P=this.props,A=P.children,O=P.className,R=P.width,k=P.height,M=P.style,z=P.compact,B=P.title,L=P.desc,G=KI(P,Cde),U=ht(G,!1);if(z)return q.createElement(PI,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},q.createElement(U1,Tl({},U,{width:R,height:k,title:B,desc:L}),this.renderClipPath(),mO(A,this.renderMap)));if(this.props.accessibilityLayer){var H,Q;U.tabIndex=(H=this.props.tabIndex)!==null&&H!==void 0?H:0,U.role=(Q=this.props.role)!==null&&Q!==void 0?Q:"application",U.onKeyDown=function(T){_.accessibilityManager.keyboardEvent(T)},U.onFocus=function(){_.accessibilityManager.focus()}}var J=this.parseEventsOfWrapper();return q.createElement(PI,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},q.createElement("div",Tl({className:jt("recharts-wrapper",O),style:xe({position:"relative",cursor:"default",width:R,height:k},M)},J,{ref:function(D){_.container=D}}),q.createElement(U1,Tl({},U,{width:R,height:k,title:B,desc:L,style:Ude}),this.renderClipPath(),mO(A,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(v.Component);mt(j,"displayName",n),mt(j,"defaultProps",xe({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},p)),mt(j,"getDerivedStateFromProps",function(x,S){var N=x.dataKey,_=x.data,P=x.children,A=x.width,O=x.height,R=x.layout,k=x.stackOffset,M=x.margin,z=S.dataStartIndex,B=S.dataEndIndex;if(S.updateId===void 0){var L=XI(x);return xe(xe(xe({},L),{},{updateId:0},g(xe(xe({props:x},L),{},{updateId:0}),S)),{},{prevDataKey:N,prevData:_,prevWidth:A,prevHeight:O,prevLayout:R,prevStackOffset:k,prevMargin:M,prevChildren:P})}if(N!==S.prevDataKey||_!==S.prevData||A!==S.prevWidth||O!==S.prevHeight||R!==S.prevLayout||k!==S.prevStackOffset||!Bl(M,S.prevMargin)){var G=XI(x),U={chartX:S.chartX,chartY:S.chartY,isTooltipActive:S.isTooltipActive},H=xe(xe({},YI(S,_,R)),{},{updateId:S.updateId+1}),Q=xe(xe(xe({},G),U),H);return xe(xe(xe({},Q),g(xe({props:x},Q),S)),{},{prevDataKey:N,prevData:_,prevWidth:A,prevHeight:O,prevLayout:R,prevStackOffset:k,prevMargin:M,prevChildren:P})}if(!B1(P,S.prevChildren)){var J,T,D,X,F=Gr(P,fc),$=F&&(J=(T=F.props)===null||T===void 0?void 0:T.startIndex)!==null&&J!==void 0?J:z,ee=F&&(D=(X=F.props)===null||X===void 0?void 0:X.endIndex)!==null&&D!==void 0?D:B,ae=$!==z||ee!==B,K=!wt(_),le=K&&!ae?S.updateId:S.updateId+1;return xe(xe({updateId:le},g(xe(xe({props:x},S),{},{updateId:le,dataStartIndex:$,dataEndIndex:ee}),S)),{},{prevChildren:P,dataStartIndex:$,dataEndIndex:ee})}return null}),mt(j,"renderActiveDot",function(x,S,N){var _;return v.isValidElement(x)?_=v.cloneElement(x,S):bt(x)?_=x(S):_=q.createElement(Sv,S),q.createElement(It,{className:"recharts-active-dot",key:N},_)});var b=v.forwardRef(function(S,N){return q.createElement(j,Tl({},S,{ref:N}))});return b.displayName=j.displayName,b},JI=XN({chartName:"LineChart",GraphicalChild:xc,axisComponents:[{axisType:"xAxis",AxisComp:Oo},{axisType:"yAxis",AxisComp:Ro}],formatAxisMap:a4}),Jde=XN({chartName:"BarChart",GraphicalChild:qo,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Oo},{axisType:"yAxis",AxisComp:Ro}],formatAxisMap:a4}),Zde=XN({chartName:"PieChart",GraphicalChild:ti,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:Av},{axisType:"radiusAxis",AxisComp:Cv}],formatAxisMap:Qre,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const efe=()=>{const{configs:e}=of(),{source:t}=On(),[n,r]=v.useState([]),[a,i]=v.useState("timestamp"),[o,c]=v.useState("desc"),d=x=>{if(a===x){c(S=>S==="asc"?"desc":"asc");return}i(x),c("desc")};v.useEffect(()=>{let x=!0;return t.listResults().then(S=>{x&&r(S)}),()=>{x=!1}},[t]);const f=e.length,h=n.length,p=h===0?0:n.reduce((x,S)=>x+S.overallPassRate,0)/h,y=h===0?0:Math.round(n.reduce((x,S)=>x+S.avgLatency,0)/h),g=v.useMemo(()=>[...n].sort((S,N)=>{let _=0;return a==="timestamp"&&(_=new Date(S.timestamp).getTime()-new Date(N.timestamp).getTime()),a==="passRate"&&(_=S.overallPassRate-N.overallPassRate),a==="latency"&&(_=S.avgLatency-N.avgLatency),a==="scenarios"&&(_=S.totalScenarios-N.totalScenarios),o==="asc"?_:-_}),[n,a,o]),j=[...g].reverse().map(x=>({date:new Date(x.timestamp).toLocaleDateString("en-US",{month:"short",day:"numeric"}),passRate:Math.round(x.overallPassRate*100),latency:x.avgLatency})),b=x=>{const S=Array.from(new Set(x.scenarios.map(A=>A.scenarioId).filter(Boolean))),N=Array.from(new Set(x.scenarios.map(A=>A.agentName).filter(Boolean))),_=S.slice(0,2).join(", "),P=S.length>2?` +${S.length-2}`:"";return{scenarioCount:S.length,agentCount:N.length,scenarioPreview:_?`${_}${P}`:"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(o$,{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(ie,{asChild:!0,children:s.jsxs(xt,{to:"/mcp-evaluations/new",children:[s.jsx(PS,{className:"mr-2 h-4 w-4"}),"New MCP Evaluation"]})}),s.jsx(ie,{variant:"outline",asChild:!0,children:s.jsxs(xt,{to:"/run",children:[s.jsx($l,{className:"mr-2 h-4 w-4"}),"Run Evaluation"]})}),s.jsx(ie,{variant:"outline",asChild:!0,children:s.jsxs(xt,{to:"/results",children:[s.jsx(ad,{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($s,{title:"MCP Evaluations",value:f,icon:b1,subtitle:`${f} active`}),s.jsx($s,{title:"Total Runs",value:h,icon:n$,subtitle:"Last 30 days"}),s.jsx($s,{title:"Pass Rate",value:`${Math.round(p*100)}%`,icon:ad,subtitle:"+5% from last week",trend:"up"}),s.jsx($s,{title:"Avg Latency",value:`${y}ms`,icon:f$,subtitle:"-120ms from last week",trend:"up"})]}),s.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[s.jsxs(We,{children:[s.jsx(Nt,{className:"pb-3",children:s.jsx(Ct,{className:"text-base",children:"Pass Rate Trend"})}),s.jsx(Ve,{children:s.jsx(nj,{width:"100%",height:200,children:s.jsxs(JI,{data:j,children:[s.jsx(Oo,{dataKey:"date",tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(Ro,{domain:[0,100],tick:{fontSize:11},tickLine:!1,axisLine:!1,tickFormatter:x=>`${x}%`}),s.jsx(Yr,{formatter:x=>[`${x}%`,"Pass Rate"]}),s.jsx(xc,{type:"monotone",dataKey:"passRate",stroke:"hsl(38, 92%, 50%)",strokeWidth:2,dot:{r:3,fill:"hsl(38, 92%, 50%)"}})]})})})]}),s.jsxs(We,{children:[s.jsx(Nt,{className:"pb-3",children:s.jsx(Ct,{className:"text-base",children:"Recent Tool Latency (ms)"})}),s.jsx(Ve,{children:s.jsx(nj,{width:"100%",height:200,children:s.jsxs(JI,{data:j,children:[s.jsx(Oo,{dataKey:"date",tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(Ro,{tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(Yr,{formatter:x=>[`${x}ms`,"Latency"]}),s.jsx(xc,{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(We,{children:[s.jsx(Nt,{className:"pb-3",children:s.jsx(Ct,{className:"text-base",children:"Recent Runs"})}),s.jsx(Ve,{className:"p-0",children:s.jsxs(Zr,{children:[s.jsx(ea,{children:s.jsxs(Bt,{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(cs,{className:"h-3.5 w-3.5"}):s.jsx(Wt,{className:"h-3.5 w-3.5"}):s.jsx(Il,{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(cs,{className:"h-3.5 w-3.5"}):s.jsx(Wt,{className:"h-3.5 w-3.5"}):s.jsx(Il,{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(cs,{className:"h-3.5 w-3.5"}):s.jsx(Wt,{className:"h-3.5 w-3.5"}):s.jsx(Il,{className:"h-3.5 w-3.5 text-muted-foreground"})]})})]})}),s.jsx(ta,{children:g.map(x=>s.jsxs(Bt,{className:"cursor-pointer",children:[s.jsx(Ke,{children:s.jsx(xt,{to:`/results/${x.id}`,className:"font-mono text-xs text-primary hover:underline",children:x.id})}),s.jsx(Ke,{className:"text-[11px] text-muted-foreground",children:(()=>{const S=b(x);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(Ke,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Jd,{className:"h-3 w-3"}),new Date(x.timestamp).toLocaleString()]})}),s.jsx(Ke,{children:s.jsx(xo,{rate:x.overallPassRate})}),s.jsx(Ke,{className:"text-right font-mono text-sm",children:x.totalScenarios})]},x.id))})]})})]})})]})};var tfe=v.createContext(void 0);function qc(e){const t=v.useContext(tfe);return e||t||"ltr"}var c1="rovingFocusGroup.onEntryFocus",nfe={bubbles:!1,cancelable:!0},gf="RovingFocusGroup",[iS,z4,rfe]=Xd(gf),[afe,Dv]=or(gf,[rfe]),[sfe,ife]=afe(gf),U4=v.forwardRef((e,t)=>s.jsx(iS.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(iS.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(ofe,{...e,ref:t})})}));U4.displayName=gf;var ofe=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,y=v.useRef(null),g=pt(t,y),j=qc(i),[b,x]=sa({prop:o,defaultProp:c??null,onChange:d,caller:gf}),[S,N]=v.useState(!1),_=Pn(f),P=z4(n),A=v.useRef(!1),[O,R]=v.useState(0);return v.useEffect(()=>{const k=y.current;if(k)return k.addEventListener(c1,_),()=>k.removeEventListener(c1,_)},[_]),s.jsx(sfe,{scope:n,orientation:r,dir:j,loop:a,currentTabStopId:b,onItemFocus:v.useCallback(k=>x(k),[x]),onItemShiftTab:v.useCallback(()=>N(!0),[]),onFocusableItemAdd:v.useCallback(()=>R(k=>k+1),[]),onFocusableItemRemove:v.useCallback(()=>R(k=>k-1),[]),children:s.jsx(qe.div,{tabIndex:S||O===0?-1:0,"data-orientation":r,...p,ref:g,style:{outline:"none",...e.style},onMouseDown:Ee(e.onMouseDown,()=>{A.current=!0}),onFocus:Ee(e.onFocus,k=>{const M=!A.current;if(k.target===k.currentTarget&&M&&!S){const z=new CustomEvent(c1,nfe);if(k.currentTarget.dispatchEvent(z),!z.defaultPrevented){const B=P().filter(Q=>Q.focusable),L=B.find(Q=>Q.active),G=B.find(Q=>Q.id===b),H=[L,G,...B].filter(Boolean).map(Q=>Q.ref.current);V4(H,h)}}A.current=!1}),onBlur:Ee(e.onBlur,()=>N(!1))})})}),q4="RovingFocusGroupItem",W4=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:i,children:o,...c}=e,d=Hn(),f=i||d,h=ife(q4,n),p=h.currentTabStopId===f,y=z4(n),{onFocusableItemAdd:g,onFocusableItemRemove:j,currentTabStopId:b}=h;return v.useEffect(()=>{if(r)return g(),()=>j()},[r,g,j]),s.jsx(iS.ItemSlot,{scope:n,id:f,focusable:r,active:a,children:s.jsx(qe.span,{tabIndex:p?0:-1,"data-orientation":h.orientation,...c,ref:t,onMouseDown:Ee(e.onMouseDown,x=>{r?h.onItemFocus(f):x.preventDefault()}),onFocus:Ee(e.onFocus,()=>h.onItemFocus(f)),onKeyDown:Ee(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){h.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const S=ufe(x,h.orientation,h.dir);if(S!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let _=y().filter(P=>P.focusable).map(P=>P.ref.current);if(S==="last")_.reverse();else if(S==="prev"||S==="next"){S==="prev"&&_.reverse();const P=_.indexOf(x.currentTarget);_=h.loop?dfe(_,P+1):_.slice(P+1)}setTimeout(()=>V4(_))}}),children:typeof o=="function"?o({isCurrentTabStop:p,hasTabStop:b!=null}):o})})});W4.displayName=q4;var lfe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function cfe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function ufe(e,t,n){const r=cfe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return lfe[r]}function V4(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function dfe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var H4=U4,K4=W4;function ffe(e){const t=pfe(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(mfe);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 pfe(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=gfe(a),c=vfe(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Nr(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 hfe=Symbol("radix.slottable");function mfe(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hfe}function vfe(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 gfe(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 oS=["Enter"," "],yfe=["ArrowDown","PageUp","Home"],G4=["ArrowUp","PageDown","End"],xfe=[...yfe,...G4],bfe={ltr:[...oS,"ArrowRight"],rtl:[...oS,"ArrowLeft"]},wfe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},yf="Menu",[Hd,jfe,Sfe]=Xd(yf),[Wo,Y4]=or(yf,[Sfe,Fi,Dv]),Lv=Fi(),X4=Dv(),[Nfe,Vo]=Wo(yf),[Cfe,xf]=Wo(yf),Q4=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:i,modal:o=!0}=e,c=Lv(t),[d,f]=v.useState(null),h=v.useRef(!1),p=Pn(i),y=qc(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(Im,{...c,children:s.jsx(Nfe,{scope:t,open:n,onOpenChange:p,content:d,onContentChange:f,children:s.jsx(Cfe,{scope:t,onClose:v.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:h,dir:y,modal:o,children:r})})})};Q4.displayName=yf;var _fe="MenuAnchor",QN=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=Lv(n);return s.jsx(ef,{...a,...r,ref:t})});QN.displayName=_fe;var JN="MenuPortal",[Afe,J4]=Wo(JN,{forceMount:void 0}),Z4=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:a}=e,i=Vo(JN,t);return s.jsx(Afe,{scope:t,forceMount:n,children:s.jsx(Gn,{present:n||i.open,children:s.jsx(Ac,{asChild:!0,container:a,children:r})})})};Z4.displayName=JN;var ja="MenuContent",[Efe,ZN]=Wo(ja),eF=v.forwardRef((e,t)=>{const n=J4(ja,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=Vo(ja,e.__scopeMenu),o=xf(ja,e.__scopeMenu);return s.jsx(Hd.Provider,{scope:e.__scopeMenu,children:s.jsx(Gn,{present:r||i.open,children:s.jsx(Hd.Slot,{scope:e.__scopeMenu,children:o.modal?s.jsx(Pfe,{...a,ref:t}):s.jsx(Ofe,{...a,ref:t})})})})}),Pfe=v.forwardRef((e,t)=>{const n=Vo(ja,e.__scopeMenu),r=v.useRef(null),a=pt(t,r);return v.useEffect(()=>{const i=r.current;if(i)return Gm(i)},[]),s.jsx(eC,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ee(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Ofe=v.forwardRef((e,t)=>{const n=Vo(ja,e.__scopeMenu);return s.jsx(eC,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Rfe=ffe("MenuContent.ScrollLock"),eC=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:y,onDismiss:g,disableOutsideScroll:j,...b}=e,x=Vo(ja,n),S=xf(ja,n),N=Lv(n),_=X4(n),P=jfe(n),[A,O]=v.useState(null),R=v.useRef(null),k=pt(t,R,x.onContentChange),M=v.useRef(0),z=v.useRef(""),B=v.useRef(0),L=v.useRef(null),G=v.useRef("right"),U=v.useRef(0),H=j?nf:v.Fragment,Q=j?{as:Rfe,allowPinchZoom:!0}:void 0,J=D=>{const X=z.current+D,F=P().filter(te=>!te.disabled),$=document.activeElement,ee=F.find(te=>te.ref.current===$)?.textValue,ae=F.map(te=>te.textValue),K=qfe(ae,X,ee),le=F.find(te=>te.textValue===K)?.ref.current;(function te(de){z.current=de,window.clearTimeout(M.current),de!==""&&(M.current=window.setTimeout(()=>te(""),1e3))})(X),le&&setTimeout(()=>le.focus())};v.useEffect(()=>()=>window.clearTimeout(M.current),[]),Hm();const T=v.useCallback(D=>G.current===L.current?.side&&Vfe(D,L.current?.area),[]);return s.jsx(Efe,{scope:n,searchRef:z,onItemEnter:v.useCallback(D=>{T(D)&&D.preventDefault()},[T]),onItemLeave:v.useCallback(D=>{T(D)||(R.current?.focus(),O(null))},[T]),onTriggerLeave:v.useCallback(D=>{T(D)&&D.preventDefault()},[T]),pointerGraceTimerRef:B,onPointerGraceIntentChange:v.useCallback(D=>{L.current=D},[]),children:s.jsx(H,{...Q,children:s.jsx(tf,{asChild:!0,trapped:a,onMountAutoFocus:Ee(i,D=>{D.preventDefault(),R.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:s.jsx(Mo,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:y,onDismiss:g,children:s.jsx(H4,{asChild:!0,..._,dir:S.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:O,onEntryFocus:Ee(d,D=>{S.isUsingKeyboardRef.current||D.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(Mm,{role:"menu","aria-orientation":"vertical","data-state":vF(x.open),"data-radix-menu-content":"",dir:S.dir,...N,...b,ref:k,style:{outline:"none",...b.style},onKeyDown:Ee(b.onKeyDown,D=>{const F=D.target.closest("[data-radix-menu-content]")===D.currentTarget,$=D.ctrlKey||D.altKey||D.metaKey,ee=D.key.length===1;F&&(D.key==="Tab"&&D.preventDefault(),!$&&ee&&J(D.key));const ae=R.current;if(D.target!==ae||!xfe.includes(D.key))return;D.preventDefault();const le=P().filter(te=>!te.disabled).map(te=>te.ref.current);G4.includes(D.key)&&le.reverse(),zfe(le)}),onBlur:Ee(e.onBlur,D=>{D.currentTarget.contains(D.target)||(window.clearTimeout(M.current),z.current="")}),onPointerMove:Ee(e.onPointerMove,Kd(D=>{const X=D.target,F=U.current!==D.clientX;if(D.currentTarget.contains(X)&&F){const $=D.clientX>U.current?"right":"left";G.current=$,U.current=D.clientX}}))})})})})})})});eF.displayName=ja;var kfe="MenuGroup",tC=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(qe.div,{role:"group",...r,ref:t})});tC.displayName=kfe;var Tfe="MenuLabel",tF=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(qe.div,{...r,ref:t})});tF.displayName=Tfe;var vm="MenuItem",ZI="menu.itemSelect",Fv=v.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...a}=e,i=v.useRef(null),o=xf(vm,e.__scopeMenu),c=ZN(vm,e.__scopeMenu),d=pt(t,i),f=v.useRef(!1),h=()=>{const p=i.current;if(!n&&p){const y=new CustomEvent(ZI,{bubbles:!0,cancelable:!0});p.addEventListener(ZI,g=>r?.(g),{once:!0}),SS(p,y),y.defaultPrevented?f.current=!1:o.onClose()}};return s.jsx(nF,{...a,ref:d,disabled:n,onClick:Ee(e.onClick,h),onPointerDown:p=>{e.onPointerDown?.(p),f.current=!0},onPointerUp:Ee(e.onPointerUp,p=>{f.current||p.currentTarget?.click()}),onKeyDown:Ee(e.onKeyDown,p=>{const y=c.searchRef.current!=="";n||y&&p.key===" "||oS.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});Fv.displayName=vm;var nF=v.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:a,...i}=e,o=ZN(vm,n),c=X4(n),d=v.useRef(null),f=pt(t,d),[h,p]=v.useState(!1),[y,g]=v.useState("");return v.useEffect(()=>{const j=d.current;j&&g((j.textContent??"").trim())},[i.children]),s.jsx(Hd.ItemSlot,{scope:n,disabled:r,textValue:a??y,children:s.jsx(K4,{asChild:!0,...c,focusable:!r,children:s.jsx(qe.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:f,onPointerMove:Ee(e.onPointerMove,Kd(j=>{r?o.onItemLeave(j):(o.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ee(e.onPointerLeave,Kd(j=>o.onItemLeave(j))),onFocus:Ee(e.onFocus,()=>p(!0)),onBlur:Ee(e.onBlur,()=>p(!1))})})})}),Ife="MenuCheckboxItem",rF=v.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...a}=e;return s.jsx(lF,{scope:e.__scopeMenu,checked:n,children:s.jsx(Fv,{role:"menuitemcheckbox","aria-checked":gm(n)?"mixed":n,...a,ref:t,"data-state":rC(n),onSelect:Ee(a.onSelect,()=>r?.(gm(n)?!0:!n),{checkForDefaultPrevented:!1})})})});rF.displayName=Ife;var aF="MenuRadioGroup",[Mfe,$fe]=Wo(aF,{value:void 0,onValueChange:()=>{}}),sF=v.forwardRef((e,t)=>{const{value:n,onValueChange:r,...a}=e,i=Pn(r);return s.jsx(Mfe,{scope:e.__scopeMenu,value:n,onValueChange:i,children:s.jsx(tC,{...a,ref:t})})});sF.displayName=aF;var iF="MenuRadioItem",oF=v.forwardRef((e,t)=>{const{value:n,...r}=e,a=$fe(iF,e.__scopeMenu),i=n===a.value;return s.jsx(lF,{scope:e.__scopeMenu,checked:i,children:s.jsx(Fv,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":rC(i),onSelect:Ee(r.onSelect,()=>a.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});oF.displayName=iF;var nC="MenuItemIndicator",[lF,Dfe]=Wo(nC,{checked:!1}),cF=v.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...a}=e,i=Dfe(nC,n);return s.jsx(Gn,{present:r||gm(i.checked)||i.checked===!0,children:s.jsx(qe.span,{...a,ref:t,"data-state":rC(i.checked)})})});cF.displayName=nC;var Lfe="MenuSeparator",uF=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(qe.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});uF.displayName=Lfe;var Ffe="MenuArrow",dF=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=Lv(n);return s.jsx($m,{...a,...r,ref:t})});dF.displayName=Ffe;var Bfe="MenuSub",[Ege,fF]=Wo(Bfe),Hu="MenuSubTrigger",pF=v.forwardRef((e,t)=>{const n=Vo(Hu,e.__scopeMenu),r=xf(Hu,e.__scopeMenu),a=fF(Hu,e.__scopeMenu),i=ZN(Hu,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(QN,{asChild:!0,...f,children:s.jsx(nF,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":vF(n.open),...e,ref:Nr(t,a.onTriggerChange),onClick:p=>{e.onClick?.(p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ee(e.onPointerMove,Kd(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:Ee(e.onPointerLeave,Kd(p=>{h();const y=n.content?.getBoundingClientRect();if(y){const g=n.content?.dataset.side,j=g==="right",b=j?-5:5,x=y[j?"left":"right"],S=y[j?"right":"left"];i.onPointerGraceIntentChange({area:[{x:p.clientX+b,y:p.clientY},{x,y:y.top},{x:S,y:y.top},{x:S,y:y.bottom},{x,y:y.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:Ee(e.onKeyDown,p=>{const y=i.searchRef.current!=="";e.disabled||y&&p.key===" "||bfe[r.dir].includes(p.key)&&(n.onOpenChange(!0),n.content?.focus(),p.preventDefault())})})})});pF.displayName=Hu;var hF="MenuSubContent",mF=v.forwardRef((e,t)=>{const n=J4(ja,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=Vo(ja,e.__scopeMenu),o=xf(ja,e.__scopeMenu),c=fF(hF,e.__scopeMenu),d=v.useRef(null),f=pt(t,d);return s.jsx(Hd.Provider,{scope:e.__scopeMenu,children:s.jsx(Gn,{present:r||i.open,children:s.jsx(Hd.Slot,{scope:e.__scopeMenu,children:s.jsx(eC,{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:Ee(e.onFocusOutside,h=>{h.target!==c.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Ee(e.onEscapeKeyDown,h=>{o.onClose(),h.preventDefault()}),onKeyDown:Ee(e.onKeyDown,h=>{const p=h.currentTarget.contains(h.target),y=wfe[o.dir].includes(h.key);p&&y&&(i.onOpenChange(!1),c.trigger?.focus(),h.preventDefault())})})})})})});mF.displayName=hF;function vF(e){return e?"open":"closed"}function gm(e){return e==="indeterminate"}function rC(e){return gm(e)?"indeterminate":e?"checked":"unchecked"}function zfe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Ufe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function qfe(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=Ufe(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 Wfe(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,y=d.y;h>r!=y>r&&n<(p-f)*(r-h)/(y-h)+f&&(a=!a)}return a}function Vfe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Wfe(n,t)}function Kd(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Hfe=Q4,Kfe=QN,Gfe=Z4,Yfe=eF,Xfe=tC,Qfe=tF,Jfe=Fv,Zfe=rF,epe=sF,tpe=oF,npe=cF,rpe=uF,ape=dF,spe=pF,ipe=mF,Bv="DropdownMenu",[ope]=or(Bv,[Y4]),Cr=Y4(),[lpe,gF]=ope(Bv),yF=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:a,defaultOpen:i,onOpenChange:o,modal:c=!0}=e,d=Cr(t),f=v.useRef(null),[h,p]=sa({prop:a,defaultProp:i??!1,onChange:o,caller:Bv});return s.jsx(lpe,{scope:t,triggerId:Hn(),triggerRef:f,contentId:Hn(),open:h,onOpenChange:p,onOpenToggle:v.useCallback(()=>p(y=>!y),[p]),modal:c,children:s.jsx(Hfe,{...d,open:h,onOpenChange:p,dir:r,modal:c,children:n})})};yF.displayName=Bv;var xF="DropdownMenuTrigger",bF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...a}=e,i=gF(xF,n),o=Cr(n);return s.jsx(Kfe,{asChild:!0,...o,children:s.jsx(qe.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:Nr(t,i.triggerRef),onPointerDown:Ee(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(i.onOpenToggle(),i.open||c.preventDefault())}),onKeyDown:Ee(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&i.onOpenToggle(),c.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});bF.displayName=xF;var cpe="DropdownMenuPortal",wF=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Cr(t);return s.jsx(Gfe,{...r,...n})};wF.displayName=cpe;var jF="DropdownMenuContent",SF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=gF(jF,n),i=Cr(n),o=v.useRef(!1);return s.jsx(Yfe,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...r,ref:t,onCloseAutoFocus:Ee(e.onCloseAutoFocus,c=>{o.current||a.triggerRef.current?.focus(),o.current=!1,c.preventDefault()}),onInteractOutside:Ee(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)"}})});SF.displayName=jF;var upe="DropdownMenuGroup",dpe=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Cr(n);return s.jsx(Xfe,{...a,...r,ref:t})});dpe.displayName=upe;var fpe="DropdownMenuLabel",NF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Cr(n);return s.jsx(Qfe,{...a,...r,ref:t})});NF.displayName=fpe;var ppe="DropdownMenuItem",CF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Cr(n);return s.jsx(Jfe,{...a,...r,ref:t})});CF.displayName=ppe;var hpe="DropdownMenuCheckboxItem",_F=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Cr(n);return s.jsx(Zfe,{...a,...r,ref:t})});_F.displayName=hpe;var mpe="DropdownMenuRadioGroup",vpe=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Cr(n);return s.jsx(epe,{...a,...r,ref:t})});vpe.displayName=mpe;var gpe="DropdownMenuRadioItem",AF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Cr(n);return s.jsx(tpe,{...a,...r,ref:t})});AF.displayName=gpe;var ype="DropdownMenuItemIndicator",EF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Cr(n);return s.jsx(npe,{...a,...r,ref:t})});EF.displayName=ype;var xpe="DropdownMenuSeparator",PF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Cr(n);return s.jsx(rpe,{...a,...r,ref:t})});PF.displayName=xpe;var bpe="DropdownMenuArrow",wpe=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Cr(n);return s.jsx(ape,{...a,...r,ref:t})});wpe.displayName=bpe;var jpe="DropdownMenuSubTrigger",OF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Cr(n);return s.jsx(spe,{...a,...r,ref:t})});OF.displayName=jpe;var Spe="DropdownMenuSubContent",RF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Cr(n);return s.jsx(ipe,{...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)"}})});RF.displayName=Spe;var Npe=yF,Cpe=bF,_pe=wF,kF=SF,TF=NF,IF=CF,MF=_F,$F=AF,DF=EF,LF=PF,FF=OF,BF=RF;const Wc=Npe,Vc=Cpe,Ape=v.forwardRef(({className:e,inset:t,children:n,...r},a)=>s.jsxs(FF,{ref:a,className:be("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(r$,{className:"ml-auto h-4 w-4"})]}));Ape.displayName=FF.displayName;const Epe=v.forwardRef(({className:e,...t},n)=>s.jsx(BF,{ref:n,className:be("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}));Epe.displayName=BF.displayName;const Ho=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(_pe,{children:s.jsx(kF,{ref:r,sideOffset:t,className:be("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})}));Ho.displayName=kF.displayName;const gr=v.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(IF,{ref:r,className:be("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}));gr.displayName=IF.displayName;const Ppe=v.forwardRef(({className:e,children:t,checked:n,...r},a)=>s.jsxs(MF,{ref:a,className:be("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(DF,{children:s.jsx(Gl,{className:"h-4 w-4"})})}),t]}));Ppe.displayName=MF.displayName;const Ope=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs($F,{ref:r,className:be("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(DF,{children:s.jsx(PU,{className:"h-2 w-2 fill-current"})})}),t]}));Ope.displayName=$F.displayName;const aC=v.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(TF,{ref:r,className:be("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));aC.displayName=TF.displayName;const sC=v.forwardRef(({className:e,...t},n)=>s.jsx(LF,{ref:n,className:be("-mx-1 my-1 h-px bg-muted",e),...t}));sC.displayName=LF.displayName;const Fu=e=>e.configName?.trim()||e.name,Rpe=()=>{const{configs:e,deleteConfig:t,cloneConfig:n,loading:r,reload:a}=of(),i=_a(),[o,c]=v.useState("name"),[d,f]=v.useState("asc"),h=S=>{if(o===S){f(N=>N==="asc"?"desc":"asc");return}c(S),f(S==="updatedAt"?"desc":"asc")};v.useEffect(()=>{a();const S=()=>{a()};return window.addEventListener("focus",S),()=>{window.removeEventListener("focus",S)}},[a]);const p=async(S,N)=>{await t(S),_e({title:"Deleted",description:`"${N}" has been removed.`})},y=async S=>{const N=await n(S);_e({title:"Cloned",description:`Created "${Fu(N)}".`}),i(`/mcp-evaluations/${N.id}`)},g=S=>S.agentEntries?.length??S.agents?.length??0,j=S=>S.scenarioEntries?.length??S.scenarios?.length??0,b=v.useMemo(()=>[...e].sort((N,_)=>{let P=0;return o==="name"&&(P=Fu(N).localeCompare(Fu(_))),o==="scenarios"&&(P=j(N)-j(_)),o==="agents"&&(P=g(N)-g(_)),o==="updatedAt"&&(P=new Date(N.updatedAt).getTime()-new Date(_.updatedAt).getTime()),d==="asc"?P:-P}),[e,o,d]),x=S=>o!==S?s.jsx(Il,{className:"h-3.5 w-3.5 text-muted-foreground"}):d==="asc"?s.jsx(cs,{className:"h-3.5 w-3.5"}):s.jsx(Wt,{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(i$,{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.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>{a()},children:[s.jsx(Sa,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(ie,{variant:"outline",size:"sm",children:[s.jsx($U,{className:"mr-2 h-4 w-4"}),"Import YAML"]}),s.jsx(ie,{size:"sm",asChild:!0,children:s.jsxs(xt,{to:"/mcp-evaluations/new",children:[s.jsx(ps,{className:"mr-2 h-4 w-4"}),"Create New"]})})]})]}),s.jsx(We,{children:s.jsx(Ve,{className:"p-0",children:s.jsxs(Zr,{children:[s.jsx(ea,{children:s.jsxs(Bt,{children:[s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>h("name"),children:["Name",x("name")]})}),s.jsx(tt,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>h("scenarios"),children:["Scenarios",x("scenarios")]})}),s.jsx(tt,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>h("agents"),children:["Agents",x("agents")]})}),s.jsx(tt,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>h("updatedAt"),children:["Last Updated",x("updatedAt")]})}),s.jsx(tt,{className:"w-10"})]})}),s.jsxs(ta,{children:[b.map(S=>s.jsxs(Bt,{children:[s.jsx(Ke,{children:s.jsxs("div",{children:[s.jsx(xt,{to:`/mcp-evaluations/${S.id}`,className:"font-medium text-sm hover:text-primary",children:Fu(S)}),S.loadError&&s.jsxs(Je,{variant:"destructive",className:"ml-2 align-middle text-[10px]",children:[s.jsx(th,{className:"mr-1 h-3 w-3"}),"Broken"]}),S.description&&s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:S.description}),S.loadError&&s.jsx("p",{className:"text-xs text-destructive mt-0.5 break-all",children:S.loadError})]})}),s.jsx(Ke,{className:"text-right font-mono text-sm",children:j(S)}),s.jsx(Ke,{className:"text-right font-mono text-sm",children:g(S)}),s.jsx(Ke,{className:"text-right text-xs text-muted-foreground",children:new Date(S.updatedAt).toLocaleDateString()}),s.jsx(Ke,{children:s.jsxs(Wc,{children:[s.jsx(Vc,{asChild:!0,children:s.jsx(ie,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Am,{className:"h-4 w-4"})})}),s.jsxs(Ho,{align:"end",children:[s.jsxs(gr,{onClick:()=>i(`/mcp-evaluations/${S.id}`),children:[s.jsx(Em,{className:"mr-2 h-3.5 w-3.5"}),"Edit"]}),s.jsxs(gr,{onClick:()=>{y(S.id)},children:[s.jsx(Mi,{className:"mr-2 h-3.5 w-3.5"}),"Clone"]}),s.jsxs(gr,{children:[s.jsx(wa,{className:"mr-2 h-3.5 w-3.5"}),"Download YAML"]}),s.jsxs(gr,{className:"text-destructive",onClick:()=>{p(S.id,Fu(S))},children:[s.jsx(Na,{className:"mr-2 h-3.5 w-3.5"}),"Delete"]})]})]})})]},S.id)),!r&&e.length===0&&s.jsx(Bt,{children:s.jsx(Ke,{colSpan:5,className:"text-center py-12 text-muted-foreground",children:"No MCP evaluations yet. Create your first one to get started."})}),r&&s.jsx(Bt,{children:s.jsx(Ke,{colSpan:5,className:"text-center py-12 text-muted-foreground",children:"Loading MCP evaluations..."})})]})]})})})]})};var kpe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Tpe=kpe.reduce((e,t)=>{const n=Vm(`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}},{}),Ipe="Label",zF=v.forwardRef((e,t)=>s.jsx(Tpe.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));zF.displayName=Ipe;var UF=zF;const Mpe=$o("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Me=v.forwardRef(({className:e,...t},n)=>s.jsx(UF,{ref:n,className:be(Mpe(),e),...t}));Me.displayName=UF.displayName;const Ua=v.forwardRef(({className:e,...t},n)=>s.jsx("textarea",{className:be("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}));Ua.displayName="Textarea";function zv(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 Uv="Switch",[$pe]=or(Uv),[Dpe,Lpe]=$pe(Uv),qF=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,[y,g]=v.useState(null),j=pt(t,_=>g(_)),b=v.useRef(!1),x=y?h||!!y.closest("form"):!0,[S,N]=sa({prop:a,defaultProp:i??!1,onChange:f,caller:Uv});return s.jsxs(Dpe,{scope:n,checked:S,disabled:c,children:[s.jsx(qe.button,{type:"button",role:"switch","aria-checked":S,"aria-required":o,"data-state":KF(S),"data-disabled":c?"":void 0,disabled:c,value:d,...p,ref:j,onClick:Ee(e.onClick,_=>{N(P=>!P),x&&(b.current=_.isPropagationStopped(),b.current||_.stopPropagation())})}),x&&s.jsx(HF,{control:y,bubbles:!b.current,name:r,value:d,checked:S,required:o,disabled:c,form:h,style:{transform:"translateX(-100%)"}})]})});qF.displayName=Uv;var WF="SwitchThumb",VF=v.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,a=Lpe(WF,n);return s.jsx(qe.span,{"data-state":KF(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});VF.displayName=WF;var Fpe="SwitchBubbleInput",HF=v.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...a},i)=>{const o=v.useRef(null),c=pt(o,i),d=zv(n),f=Tm(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}})});HF.displayName=Fpe;function KF(e){return e?"checked":"unchecked"}var GF=qF,Bpe=VF;const ym=v.forwardRef(({className:e,...t},n)=>s.jsx(GF,{className:be("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(Bpe,{className:be("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")})}));ym.displayName=GF.displayName;var qv="Tabs",[zpe]=or(qv,[Dv]),YF=Dv(),[Upe,iC]=zpe(qv),XF=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:i,orientation:o="horizontal",dir:c,activationMode:d="automatic",...f}=e,h=qc(c),[p,y]=sa({prop:r,onChange:a,defaultProp:i??"",caller:qv});return s.jsx(Upe,{scope:n,baseId:Hn(),value:p,onValueChange:y,orientation:o,dir:h,activationMode:d,children:s.jsx(qe.div,{dir:h,"data-orientation":o,...f,ref:t})})});XF.displayName=qv;var QF="TabsList",JF=v.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,i=iC(QF,n),o=YF(n);return s.jsx(H4,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:r,children:s.jsx(qe.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});JF.displayName=QF;var ZF="TabsTrigger",eB=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...i}=e,o=iC(ZF,n),c=YF(n),d=rB(o.baseId,r),f=aB(o.baseId,r),h=r===o.value;return s.jsx(K4,{asChild:!0,...c,focusable:!a,active:h,children:s.jsx(qe.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:Ee(e.onMouseDown,p=>{!a&&p.button===0&&p.ctrlKey===!1?o.onValueChange(r):p.preventDefault()}),onKeyDown:Ee(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&o.onValueChange(r)}),onFocus:Ee(e.onFocus,()=>{const p=o.activationMode!=="manual";!h&&!a&&p&&o.onValueChange(r)})})})});eB.displayName=ZF;var tB="TabsContent",nB=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:i,...o}=e,c=iC(tB,n),d=rB(c.baseId,r),f=aB(c.baseId,r),h=r===c.value,p=v.useRef(h);return v.useEffect(()=>{const y=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(y)},[]),s.jsx(Gn,{present:a||h,children:({present:y})=>s.jsx(qe.div,{"data-state":h?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!y,id:f,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:y&&i})})});nB.displayName=tB;function rB(e,t){return`${e}-trigger-${t}`}function aB(e,t){return`${e}-content-${t}`}var qpe=XF,sB=JF,iB=eB,oB=nB;const oC=qpe,Wv=v.forwardRef(({className:e,...t},n)=>s.jsx(sB,{ref:n,className:be("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Wv.displayName=sB.displayName;const Ti=v.forwardRef(({className:e,...t},n)=>s.jsx(iB,{ref:n,className:be("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}));Ti.displayName=iB.displayName;const Gd=v.forwardRef(({className:e,...t},n)=>s.jsx(oB,{ref:n,className:be("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Gd.displayName=oB.displayName;const eM={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 lB({provider:e}){return s.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${eM[e]??eM.custom}`,children:e})}function Yd(e,[t,n]){return Math.min(n,Math.max(t,e))}function Wpe(e){const t=Vpe(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(Kpe);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 Vpe(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=Ype(a),c=Gpe(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Nr(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 Hpe=Symbol("radix.slottable");function Kpe(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Hpe}function Gpe(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 Ype(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 Xpe=[" ","Enter","ArrowUp","ArrowDown"],Qpe=[" ","Enter"],ko="Select",[Vv,Hv,Jpe]=Xd(ko),[Hc]=or(ko,[Jpe,Fi]),Kv=Fi(),[Zpe,Vi]=Hc(ko),[ehe,the]=Hc(ko),cB=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:y,required:g,form:j}=e,b=Kv(t),[x,S]=v.useState(null),[N,_]=v.useState(null),[P,A]=v.useState(!1),O=qc(f),[R,k]=sa({prop:r,defaultProp:a??!1,onChange:i,caller:ko}),[M,z]=sa({prop:o,defaultProp:c,onChange:d,caller:ko}),B=v.useRef(null),L=x?j||!!x.closest("form"):!0,[G,U]=v.useState(new Set),H=Array.from(G).map(Q=>Q.props.value).join(";");return s.jsx(Im,{...b,children:s.jsxs(Zpe,{required:g,scope:t,trigger:x,onTriggerChange:S,valueNode:N,onValueNodeChange:_,valueNodeHasChildren:P,onValueNodeHasChildrenChange:A,contentId:Hn(),value:M,onValueChange:z,open:R,onOpenChange:k,dir:O,triggerPointerDownPosRef:B,disabled:y,children:[s.jsx(Vv.Provider,{scope:t,children:s.jsx(ehe,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(Q=>{U(J=>new Set(J).add(Q))},[]),onNativeOptionRemove:v.useCallback(Q=>{U(J=>{const T=new Set(J);return T.delete(Q),T})},[]),children:n})}),L?s.jsxs(TB,{"aria-hidden":!0,required:g,tabIndex:-1,name:h,autoComplete:p,value:M,onChange:Q=>z(Q.target.value),disabled:y,form:j,children:[M===void 0?s.jsx("option",{value:""}):null,Array.from(G)]},H):null]})})};cB.displayName=ko;var uB="SelectTrigger",dB=v.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,i=Kv(n),o=Vi(uB,n),c=o.disabled||r,d=pt(t,o.onTriggerChange),f=Hv(n),h=v.useRef("touch"),[p,y,g]=MB(b=>{const x=f().filter(_=>!_.disabled),S=x.find(_=>_.value===o.value),N=$B(x,b,S);N!==void 0&&o.onValueChange(N.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(ef,{asChild:!0,...i,children:s.jsx(qe.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":IB(o.value)?"":void 0,...a,ref:d,onClick:Ee(a.onClick,b=>{b.currentTarget.focus(),h.current!=="mouse"&&j(b)}),onPointerDown:Ee(a.onPointerDown,b=>{h.current=b.pointerType;const x=b.target;x.hasPointerCapture(b.pointerId)&&x.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(j(b),b.preventDefault())}),onKeyDown:Ee(a.onKeyDown,b=>{const x=p.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&y(b.key),!(x&&b.key===" ")&&Xpe.includes(b.key)&&(j(),b.preventDefault())})})})});dB.displayName=uB;var fB="SelectValue",pB=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:i,placeholder:o="",...c}=e,d=Vi(fB,n),{onValueNodeHasChildrenChange:f}=d,h=i!==void 0,p=pt(t,d.onValueNodeChange);return Kn(()=>{f(h)},[f,h]),s.jsx(qe.span,{...c,ref:p,style:{pointerEvents:"none"},children:IB(d.value)?s.jsx(s.Fragment,{children:o}):i})});pB.displayName=fB;var nhe="SelectIcon",hB=v.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return s.jsx(qe.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});hB.displayName=nhe;var rhe="SelectPortal",mB=e=>s.jsx(Ac,{asChild:!0,...e});mB.displayName=rhe;var To="SelectContent",vB=v.forwardRef((e,t)=>{const n=Vi(To,e.__scopeSelect),[r,a]=v.useState();if(Kn(()=>{a(new DocumentFragment)},[]),!n.open){const i=r;return i?_c.createPortal(s.jsx(gB,{scope:e.__scopeSelect,children:s.jsx(Vv.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),i):null}return s.jsx(yB,{...e,ref:t})});vB.displayName=To;var Da=10,[gB,Hi]=Hc(To),ahe="SelectContentImpl",she=Wpe("SelectContent.RemoveScroll"),yB=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:y,collisionPadding:g,sticky:j,hideWhenDetached:b,avoidCollisions:x,...S}=e,N=Vi(To,n),[_,P]=v.useState(null),[A,O]=v.useState(null),R=pt(t,te=>P(te)),[k,M]=v.useState(null),[z,B]=v.useState(null),L=Hv(n),[G,U]=v.useState(!1),H=v.useRef(!1);v.useEffect(()=>{if(_)return Gm(_)},[_]),Hm();const Q=v.useCallback(te=>{const[de,...oe]=L().map(se=>se.ref.current),[pe]=oe.slice(-1),je=document.activeElement;for(const se of te)if(se===je||(se?.scrollIntoView({block:"nearest"}),se===de&&A&&(A.scrollTop=0),se===pe&&A&&(A.scrollTop=A.scrollHeight),se?.focus(),document.activeElement!==je))return},[L,A]),J=v.useCallback(()=>Q([k,_]),[Q,k,_]);v.useEffect(()=>{G&&J()},[G,J]);const{onOpenChange:T,triggerPointerDownPosRef:D}=N;v.useEffect(()=>{if(_){let te={x:0,y:0};const de=pe=>{te={x:Math.abs(Math.round(pe.pageX)-(D.current?.x??0)),y:Math.abs(Math.round(pe.pageY)-(D.current?.y??0))}},oe=pe=>{te.x<=10&&te.y<=10?pe.preventDefault():_.contains(pe.target)||T(!1),document.removeEventListener("pointermove",de),D.current=null};return D.current!==null&&(document.addEventListener("pointermove",de),document.addEventListener("pointerup",oe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",de),document.removeEventListener("pointerup",oe,{capture:!0})}}},[_,T,D]),v.useEffect(()=>{const te=()=>T(!1);return window.addEventListener("blur",te),window.addEventListener("resize",te),()=>{window.removeEventListener("blur",te),window.removeEventListener("resize",te)}},[T]);const[X,F]=MB(te=>{const de=L().filter(je=>!je.disabled),oe=de.find(je=>je.ref.current===document.activeElement),pe=$B(de,te,oe);pe&&setTimeout(()=>pe.ref.current.focus())}),$=v.useCallback((te,de,oe)=>{const pe=!H.current&&!oe;(N.value!==void 0&&N.value===de||pe)&&(M(te),pe&&(H.current=!0))},[N.value]),ee=v.useCallback(()=>_?.focus(),[_]),ae=v.useCallback((te,de,oe)=>{const pe=!H.current&&!oe;(N.value!==void 0&&N.value===de||pe)&&B(te)},[N.value]),K=r==="popper"?lS:xB,le=K===lS?{side:c,sideOffset:d,align:f,alignOffset:h,arrowPadding:p,collisionBoundary:y,collisionPadding:g,sticky:j,hideWhenDetached:b,avoidCollisions:x}:{};return s.jsx(gB,{scope:n,content:_,viewport:A,onViewportChange:O,itemRefCallback:$,selectedItem:k,onItemLeave:ee,itemTextRefCallback:ae,focusSelectedItem:J,selectedItemText:z,position:r,isPositioned:G,searchRef:X,children:s.jsx(nf,{as:she,allowPinchZoom:!0,children:s.jsx(tf,{asChild:!0,trapped:N.open,onMountAutoFocus:te=>{te.preventDefault()},onUnmountAutoFocus:Ee(a,te=>{N.trigger?.focus({preventScroll:!0}),te.preventDefault()}),children:s.jsx(Mo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:te=>te.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:s.jsx(K,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:te=>te.preventDefault(),...S,...le,onPlaced:()=>U(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:Ee(S.onKeyDown,te=>{const de=te.ctrlKey||te.altKey||te.metaKey;if(te.key==="Tab"&&te.preventDefault(),!de&&te.key.length===1&&F(te.key),["ArrowUp","ArrowDown","Home","End"].includes(te.key)){let pe=L().filter(je=>!je.disabled).map(je=>je.ref.current);if(["ArrowUp","End"].includes(te.key)&&(pe=pe.slice().reverse()),["ArrowUp","ArrowDown"].includes(te.key)){const je=te.target,se=pe.indexOf(je);pe=pe.slice(se+1)}setTimeout(()=>Q(pe)),te.preventDefault()}})})})})})})});yB.displayName=ahe;var ihe="SelectItemAlignedPosition",xB=v.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,i=Vi(To,n),o=Hi(To,n),[c,d]=v.useState(null),[f,h]=v.useState(null),p=pt(t,R=>h(R)),y=Hv(n),g=v.useRef(!1),j=v.useRef(!0),{viewport:b,selectedItem:x,selectedItemText:S,focusSelectedItem:N}=o,_=v.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&f&&b&&x&&S){const R=i.trigger.getBoundingClientRect(),k=f.getBoundingClientRect(),M=i.valueNode.getBoundingClientRect(),z=S.getBoundingClientRect();if(i.dir!=="rtl"){const je=z.left-k.left,se=M.left-je,$e=R.left-se,Ae=R.width+$e,Ye=Math.max(Ae,k.width),ye=window.innerWidth-Da,Se=Yd(se,[Da,Math.max(Da,ye-Ye)]);c.style.minWidth=Ae+"px",c.style.left=Se+"px"}else{const je=k.right-z.right,se=window.innerWidth-M.right-je,$e=window.innerWidth-R.right-se,Ae=R.width+$e,Ye=Math.max(Ae,k.width),ye=window.innerWidth-Da,Se=Yd(se,[Da,Math.max(Da,ye-Ye)]);c.style.minWidth=Ae+"px",c.style.right=Se+"px"}const B=y(),L=window.innerHeight-Da*2,G=b.scrollHeight,U=window.getComputedStyle(f),H=parseInt(U.borderTopWidth,10),Q=parseInt(U.paddingTop,10),J=parseInt(U.borderBottomWidth,10),T=parseInt(U.paddingBottom,10),D=H+Q+G+T+J,X=Math.min(x.offsetHeight*5,D),F=window.getComputedStyle(b),$=parseInt(F.paddingTop,10),ee=parseInt(F.paddingBottom,10),ae=R.top+R.height/2-Da,K=L-ae,le=x.offsetHeight/2,te=x.offsetTop+le,de=H+Q+te,oe=D-de;if(de<=ae){const je=B.length>0&&x===B[B.length-1].ref.current;c.style.bottom="0px";const se=f.clientHeight-b.offsetTop-b.offsetHeight,$e=Math.max(K,le+(je?ee:0)+se+J),Ae=de+$e;c.style.height=Ae+"px"}else{const je=B.length>0&&x===B[0].ref.current;c.style.top="0px";const $e=Math.max(ae,H+b.offsetTop+(je?$:0)+le)+oe;c.style.height=$e+"px",b.scrollTop=de-ae+b.offsetTop}c.style.margin=`${Da}px 0`,c.style.minHeight=X+"px",c.style.maxHeight=L+"px",r?.(),requestAnimationFrame(()=>g.current=!0)}},[y,i.trigger,i.valueNode,c,f,b,x,S,i.dir,r]);Kn(()=>_(),[_]);const[P,A]=v.useState();Kn(()=>{f&&A(window.getComputedStyle(f).zIndex)},[f]);const O=v.useCallback(R=>{R&&j.current===!0&&(_(),N?.(),j.current=!1)},[_,N]);return s.jsx(lhe,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:g,onScrollButtonChange:O,children:s.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P},children:s.jsx(qe.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});xB.displayName=ihe;var ohe="SelectPopperPosition",lS=v.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=Da,...i}=e,o=Kv(n);return s.jsx(Mm,{...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)"}})});lS.displayName=ohe;var[lhe,lC]=Hc(To,{}),cS="SelectViewport",bB=v.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,i=Hi(cS,n),o=lC(cS,n),c=pt(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(Vv.Slot,{scope:n,children:s.jsx(qe.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Ee(a.onScroll,f=>{const h=f.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:y}=o;if(y?.current&&p){const g=Math.abs(d.current-h.scrollTop);if(g>0){const j=window.innerHeight-Da*2,b=parseFloat(p.style.minHeight),x=parseFloat(p.style.height),S=Math.max(b,x);if(S<j){const N=S+g,_=Math.min(j,N),P=N-_;p.style.height=_+"px",p.style.bottom==="0px"&&(h.scrollTop=P>0?P:0,p.style.justifyContent="flex-end")}}}d.current=h.scrollTop})})})]})});bB.displayName=cS;var wB="SelectGroup",[che,uhe]=Hc(wB),dhe=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Hn();return s.jsx(che,{scope:n,id:a,children:s.jsx(qe.div,{role:"group","aria-labelledby":a,...r,ref:t})})});dhe.displayName=wB;var jB="SelectLabel",SB=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=uhe(jB,n);return s.jsx(qe.div,{id:a.id,...r,ref:t})});SB.displayName=jB;var xm="SelectItem",[fhe,NB]=Hc(xm),CB=v.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:i,...o}=e,c=Vi(xm,n),d=Hi(xm,n),f=c.value===r,[h,p]=v.useState(i??""),[y,g]=v.useState(!1),j=pt(t,N=>d.itemRefCallback?.(N,r,a)),b=Hn(),x=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(fhe,{scope:n,value:r,disabled:a,textId:b,isSelected:f,onItemTextChange:v.useCallback(N=>{p(_=>_||(N?.textContent??"").trim())},[]),children:s.jsx(Vv.ItemSlot,{scope:n,value:r,disabled:a,textValue:h,children:s.jsx(qe.div,{role:"option","aria-labelledby":b,"data-highlighted":y?"":void 0,"aria-selected":f&&y,"data-state":f?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...o,ref:j,onFocus:Ee(o.onFocus,()=>g(!0)),onBlur:Ee(o.onBlur,()=>g(!1)),onClick:Ee(o.onClick,()=>{x.current!=="mouse"&&S()}),onPointerUp:Ee(o.onPointerUp,()=>{x.current==="mouse"&&S()}),onPointerDown:Ee(o.onPointerDown,N=>{x.current=N.pointerType}),onPointerMove:Ee(o.onPointerMove,N=>{x.current=N.pointerType,a?d.onItemLeave?.():x.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ee(o.onPointerLeave,N=>{N.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Ee(o.onKeyDown,N=>{d.searchRef?.current!==""&&N.key===" "||(Qpe.includes(N.key)&&S(),N.key===" "&&N.preventDefault())})})})})});CB.displayName=xm;var Ku="SelectItemText",_B=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...i}=e,o=Vi(Ku,n),c=Hi(Ku,n),d=NB(Ku,n),f=the(Ku,n),[h,p]=v.useState(null),y=pt(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:x}=f;return Kn(()=>(b(j),()=>x(j)),[b,x,j]),s.jsxs(s.Fragment,{children:[s.jsx(qe.span,{id:d.textId,...i,ref:y}),d.isSelected&&o.valueNode&&!o.valueNodeHasChildren?_c.createPortal(i.children,o.valueNode):null]})});_B.displayName=Ku;var AB="SelectItemIndicator",EB=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return NB(AB,n).isSelected?s.jsx(qe.span,{"aria-hidden":!0,...r,ref:t}):null});EB.displayName=AB;var uS="SelectScrollUpButton",PB=v.forwardRef((e,t)=>{const n=Hi(uS,e.__scopeSelect),r=lC(uS,e.__scopeSelect),[a,i]=v.useState(!1),o=pt(t,r.onScrollButtonChange);return Kn(()=>{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(RB,{...e,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop-d.offsetHeight)}}):null});PB.displayName=uS;var dS="SelectScrollDownButton",OB=v.forwardRef((e,t)=>{const n=Hi(dS,e.__scopeSelect),r=lC(dS,e.__scopeSelect),[a,i]=v.useState(!1),o=pt(t,r.onScrollButtonChange);return Kn(()=>{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(RB,{...e,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop+d.offsetHeight)}}):null});OB.displayName=dS;var RB=v.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,i=Hi("SelectScrollButton",n),o=v.useRef(null),c=Hv(n),d=v.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return v.useEffect(()=>()=>d(),[d]),Kn(()=>{c().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),s.jsx(qe.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:Ee(a.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Ee(a.onPointerMove,()=>{i.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Ee(a.onPointerLeave,()=>{d()})})}),phe="SelectSeparator",kB=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx(qe.div,{"aria-hidden":!0,...r,ref:t})});kB.displayName=phe;var fS="SelectArrow",hhe=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Kv(n),i=Vi(fS,n),o=Hi(fS,n);return i.open&&o.position==="popper"?s.jsx($m,{...a,...r,ref:t}):null});hhe.displayName=fS;var mhe="SelectBubbleInput",TB=v.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=v.useRef(null),i=pt(r,a),o=zv(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(qe.select,{...n,style:{...IM,...n.style},ref:i,defaultValue:t})});TB.displayName=mhe;function IB(e){return e===""||e===void 0}function MB(e){const t=Pn(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 $B(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=vhe(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 vhe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ghe=cB,DB=dB,yhe=pB,xhe=hB,bhe=mB,LB=vB,whe=bB,FB=SB,BB=CB,jhe=_B,She=EB,zB=PB,UB=OB,qB=kB;const sn=ghe,on=yhe,Zt=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(DB,{ref:r,className:be("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(xhe,{asChild:!0,children:s.jsx(Wt,{className:"h-4 w-4 opacity-50"})})]}));Zt.displayName=DB.displayName;const WB=v.forwardRef(({className:e,...t},n)=>s.jsx(zB,{ref:n,className:be("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(cs,{className:"h-4 w-4"})}));WB.displayName=zB.displayName;const VB=v.forwardRef(({className:e,...t},n)=>s.jsx(UB,{ref:n,className:be("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(Wt,{className:"h-4 w-4"})}));VB.displayName=UB.displayName;const en=v.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>s.jsx(bhe,{children:s.jsxs(LB,{ref:a,className:be("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(WB,{}),s.jsx(whe,{className:be("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(VB,{})]})}));en.displayName=LB.displayName;const Nhe=v.forwardRef(({className:e,...t},n)=>s.jsx(FB,{ref:n,className:be("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Nhe.displayName=FB.displayName;const it=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(BB,{ref:r,className:be("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(She,{children:s.jsx(Gl,{className:"h-4 w-4"})})}),s.jsx(jhe,{children:t})]}));it.displayName=BB.displayName;const Che=v.forwardRef(({className:e,...t},n)=>s.jsx(qB,{ref:n,className:be("-mx-1 my-1 h-px bg-muted",e),...t}));Che.displayName=qB.displayName;var Gv="Collapsible",[_he]=or(Gv),[Ahe,cC]=_he(Gv),HB=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:i,onOpenChange:o,...c}=e,[d,f]=sa({prop:r,defaultProp:a??!1,onChange:o,caller:Gv});return s.jsx(Ahe,{scope:n,disabled:i,contentId:Hn(),open:d,onOpenToggle:v.useCallback(()=>f(h=>!h),[f]),children:s.jsx(qe.div,{"data-state":dC(d),"data-disabled":i?"":void 0,...c,ref:t})})});HB.displayName=Gv;var KB="CollapsibleTrigger",GB=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,a=cC(KB,n);return s.jsx(qe.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":dC(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...r,ref:t,onClick:Ee(e.onClick,a.onOpenToggle)})});GB.displayName=KB;var uC="CollapsibleContent",YB=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=cC(uC,e.__scopeCollapsible);return s.jsx(Gn,{present:n||a.open,children:({present:i})=>s.jsx(Ehe,{...r,ref:t,present:i})})});YB.displayName=uC;var Ehe=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:a,...i}=e,o=cC(uC,n),[c,d]=v.useState(r),f=v.useRef(null),h=pt(t,f),p=v.useRef(0),y=p.current,g=v.useRef(0),j=g.current,b=o.open||c,x=v.useRef(b),S=v.useRef(void 0);return v.useEffect(()=>{const N=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(N)},[]),Kn(()=>{const N=f.current;if(N){S.current=S.current||{transitionDuration:N.style.transitionDuration,animationName:N.style.animationName},N.style.transitionDuration="0s",N.style.animationName="none";const _=N.getBoundingClientRect();p.current=_.height,g.current=_.width,x.current||(N.style.transitionDuration=S.current.transitionDuration,N.style.animationName=S.current.animationName),d(r)}},[o.open,r]),s.jsx(qe.div,{"data-state":dC(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!b,...i,ref:h,style:{"--radix-collapsible-content-height":y?`${y}px`:void 0,"--radix-collapsible-content-width":j?`${j}px`:void 0,...e.style},children:b&&a})});function dC(e){return e?"open":"closed"}var Phe=HB;const Ai=Phe,Ms=GB,Ei=YB,Ohe=Xm,Rhe=Qm,XB=v.forwardRef(({className:e,...t},n)=>s.jsx(Ic,{ref:n,className:be("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}));XB.displayName=Ic.displayName;const QB=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(Rhe,{children:[s.jsx(XB,{}),s.jsxs(Mc,{ref:r,className:be("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(Jm,{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(Vs,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));QB.displayName=Mc.displayName;const JB=({className:e,...t})=>s.jsx("div",{className:be("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});JB.displayName="DialogHeader";const ZB=v.forwardRef(({className:e,...t},n)=>s.jsx(rf,{ref:n,className:be("text-lg font-semibold leading-none tracking-tight",e),...t}));ZB.displayName=rf.displayName;const e8=v.forwardRef(({className:e,...t},n)=>s.jsx(af,{ref:n,className:be("text-sm text-muted-foreground",e),...t}));e8.displayName=af.displayName;function khe(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var fC="ScrollArea",[t8]=or(fC),[The,Ea]=t8(fC),n8=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,y]=v.useState(null),[g,j]=v.useState(null),[b,x]=v.useState(null),[S,N]=v.useState(0),[_,P]=v.useState(0),[A,O]=v.useState(!1),[R,k]=v.useState(!1),M=pt(t,B=>d(B)),z=qc(a);return s.jsx(The,{scope:n,type:r,dir:z,scrollHideDelay:i,scrollArea:c,viewport:f,onViewportChange:h,content:p,onContentChange:y,scrollbarX:g,onScrollbarXChange:j,scrollbarXEnabled:A,onScrollbarXEnabledChange:O,scrollbarY:b,onScrollbarYChange:x,scrollbarYEnabled:R,onScrollbarYEnabledChange:k,onCornerWidthChange:N,onCornerHeightChange:P,children:s.jsx(qe.div,{dir:z,...o,ref:M,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})})});n8.displayName=fC;var r8="ScrollAreaViewport",a8=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:a,...i}=e,o=Ea(r8,n),c=v.useRef(null),d=pt(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(qe.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})})]})});a8.displayName=r8;var js="ScrollAreaScrollbar",pC=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Ea(js,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(Ihe,{...r,ref:t,forceMount:n}):a.type==="scroll"?s.jsx(Mhe,{...r,ref:t,forceMount:n}):a.type==="auto"?s.jsx(s8,{...r,ref:t,forceMount:n}):a.type==="always"?s.jsx(hC,{...r,ref:t}):null});pC.displayName=js;var Ihe=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Ea(js,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(Gn,{present:n||i,children:s.jsx(s8,{"data-state":i?"visible":"hidden",...r,ref:t})})}),Mhe=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Ea(js,e.__scopeScrollArea),i=e.orientation==="horizontal",o=Xv(()=>d("SCROLL_END"),100),[c,d]=khe("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 y=()=>{const g=f[h];p!==g&&(d("SCROLL"),o()),p=g};return f.addEventListener("scroll",y),()=>f.removeEventListener("scroll",y)}},[a.viewport,i,d,o]),s.jsx(Gn,{present:n||c!=="hidden",children:s.jsx(hC,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ee(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Ee(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),s8=v.forwardRef((e,t)=>{const n=Ea(js,e.__scopeScrollArea),{forceMount:r,...a}=e,[i,o]=v.useState(!1),c=e.orientation==="horizontal",d=Xv(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;o(c?f:h)}},10);return Nc(n.viewport,d),Nc(n.content,d),s.jsx(Gn,{present:r||i,children:s.jsx(hC,{"data-state":i?"visible":"hidden",...a,ref:t})})}),hC=v.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,a=Ea(js,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=u8(c.viewport,c.content),h={...r,sizes:c,onSizesChange:d,hasThumb:f>0&&f<1,onThumbChange:y=>i.current=y,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:y=>o.current=y};function p(y,g){return zhe(y,o.current,c,g)}return n==="horizontal"?s.jsx($he,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const y=a.viewport.scrollLeft,g=tM(y,c,a.dir);i.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:y=>{a.viewport&&(a.viewport.scrollLeft=y)},onDragScroll:y=>{a.viewport&&(a.viewport.scrollLeft=p(y,a.dir))}}):n==="vertical"?s.jsx(Dhe,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const y=a.viewport.scrollTop,g=tM(y,c);i.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:y=>{a.viewport&&(a.viewport.scrollTop=y)},onDragScroll:y=>{a.viewport&&(a.viewport.scrollTop=p(y))}}):null}),$he=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,i=Ea(js,e.__scopeScrollArea),[o,c]=v.useState(),d=v.useRef(null),f=pt(t,d,i.onScrollbarXChange);return v.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),s.jsx(o8,{"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":Yv(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,p)=>{if(i.viewport){const y=i.viewport.scrollLeft+h.deltaX;e.onWheelScroll(y),f8(y,p)&&h.preventDefault()}},onResize:()=>{d.current&&i.viewport&&o&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:wm(o.paddingLeft),paddingEnd:wm(o.paddingRight)}})}})}),Dhe=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,i=Ea(js,e.__scopeScrollArea),[o,c]=v.useState(),d=v.useRef(null),f=pt(t,d,i.onScrollbarYChange);return v.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),s.jsx(o8,{"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":Yv(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,p)=>{if(i.viewport){const y=i.viewport.scrollTop+h.deltaY;e.onWheelScroll(y),f8(y,p)&&h.preventDefault()}},onResize:()=>{d.current&&i.viewport&&o&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:wm(o.paddingTop),paddingEnd:wm(o.paddingBottom)}})}})}),[Lhe,i8]=t8(js),o8=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,...y}=e,g=Ea(js,n),[j,b]=v.useState(null),x=pt(t,M=>b(M)),S=v.useRef(null),N=v.useRef(""),_=g.viewport,P=r.content-r.viewport,A=Pn(h),O=Pn(d),R=Xv(p,10);function k(M){if(S.current){const z=M.clientX-S.current.left,B=M.clientY-S.current.top;f({x:z,y:B})}}return v.useEffect(()=>{const M=z=>{const B=z.target;j?.contains(B)&&A(z,P)};return document.addEventListener("wheel",M,{passive:!1}),()=>document.removeEventListener("wheel",M,{passive:!1})},[_,j,P,A]),v.useEffect(O,[r,O]),Nc(j,R),Nc(g.content,R),s.jsx(Lhe,{scope:n,scrollbar:j,hasThumb:a,onThumbChange:Pn(i),onThumbPointerUp:Pn(o),onThumbPositionChange:O,onThumbPointerDown:Pn(c),children:s.jsx(qe.div,{...y,ref:x,style:{position:"absolute",...y.style},onPointerDown:Ee(e.onPointerDown,M=>{M.button===0&&(M.target.setPointerCapture(M.pointerId),S.current=j.getBoundingClientRect(),N.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),k(M))}),onPointerMove:Ee(e.onPointerMove,k),onPointerUp:Ee(e.onPointerUp,M=>{const z=M.target;z.hasPointerCapture(M.pointerId)&&z.releasePointerCapture(M.pointerId),document.body.style.webkitUserSelect=N.current,g.viewport&&(g.viewport.style.scrollBehavior=""),S.current=null})})})}),bm="ScrollAreaThumb",l8=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=i8(bm,e.__scopeScrollArea);return s.jsx(Gn,{present:n||a.hasThumb,children:s.jsx(Fhe,{ref:t,...r})})}),Fhe=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...a}=e,i=Ea(bm,n),o=i8(bm,n),{onThumbPositionChange:c}=o,d=pt(t,p=>o.onThumbChange(p)),f=v.useRef(void 0),h=Xv(()=>{f.current&&(f.current(),f.current=void 0)},100);return v.useEffect(()=>{const p=i.viewport;if(p){const y=()=>{if(h(),!f.current){const g=Uhe(p,c);f.current=g,c()}};return c(),p.addEventListener("scroll",y),()=>p.removeEventListener("scroll",y)}},[i.viewport,h,c]),s.jsx(qe.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:Ee(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:Ee(e.onPointerUp,o.onThumbPointerUp)})});l8.displayName=bm;var mC="ScrollAreaCorner",c8=v.forwardRef((e,t)=>{const n=Ea(mC,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?s.jsx(Bhe,{...e,ref:t}):null});c8.displayName=mC;var Bhe=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,a=Ea(mC,n),[i,o]=v.useState(0),[c,d]=v.useState(0),f=!!(i&&c);return Nc(a.scrollbarX,()=>{const h=a.scrollbarX?.offsetHeight||0;a.onCornerHeightChange(h),d(h)}),Nc(a.scrollbarY,()=>{const h=a.scrollbarY?.offsetWidth||0;a.onCornerWidthChange(h),o(h)}),f?s.jsx(qe.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 wm(e){return e?parseInt(e,10):0}function u8(e,t){const n=e/t;return isNaN(n)?0:n}function Yv(e){const t=u8(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function zhe(e,t,n,r="ltr"){const a=Yv(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 d8([d,f],p)(e)}function tM(e,t,n="ltr"){const r=Yv(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=Yd(e,d);return d8([0,o],[0,c])(f)}function d8(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 f8(e,t){return e>0&&e<t}var Uhe=(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 Xv(e,t){const n=Pn(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 Nc(e,t){const n=Pn(t);Kn(()=>{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 p8=n8,qhe=a8,Whe=c8;const jm=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(p8,{ref:r,className:be("relative overflow-hidden",e),...n,children:[s.jsx(qhe,{className:"h-full w-full rounded-[inherit]",children:t}),s.jsx(h8,{}),s.jsx(Whe,{})]}));jm.displayName=p8.displayName;const h8=v.forwardRef(({className:e,orientation:t="vertical",...n},r)=>s.jsx(pC,{ref:r,orientation:t,className:be("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(l8,{className:"relative flex-1 rounded-full bg-border"})}));h8.displayName=pC.displayName;const Vhe=[{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 Hhe({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}=On(),[y,g]=v.useState(null),[j,b]=v.useState(null),[x,S]=v.useState(""),[N,_]=v.useState(!1),[P,A]=v.useState(new Set),O=v.useRef(null),R=v.useRef(null),k=v.useRef(null),[M,z]=v.useState(!1),B=v.useRef(!1),L=d||i[0]?.id||"";v.useEffect(()=>{if(!e||!L||y)return;let K=!1;return _(!0),p.createScenarioAssistantSession({configId:n,configPath:r,scenarioId:a.id,selectedAssistantAgentName:L,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(le=>({name:le.name||le.id,url:le.url})),availableAgents:i.map(le=>({name:le.name||le.id,provider:le.provider,model:le.model}))}}).then(le=>{K||(g(le.sessionId),b(le.session))}).catch(le=>{K||_e({title:"Could not start Scenario Assistant",description:le instanceof Error?le.message:String(le),variant:"destructive"})}).finally(()=>{K||_(!1)}),()=>{K=!0}},[e,p,y,n,r,a,c,i,o,L]);const G=()=>{g(null),b(null),S(""),A(new Set),k.current=null},U=K=>{G(),p.closeScenarioAssistantSession(K).catch(()=>{})};v.useEffect(()=>{e||y&&(B.current||M||U(y))},[e,y,p,M]),v.useEffect(()=>()=>{y&&p.closeScenarioAssistantSession(y).catch(()=>{})},[y,p]),v.useEffect(()=>{if(!e)return;M&&z(!1),B.current&&(B.current=!1);const K=window.setTimeout(()=>{O.current?.scrollIntoView({behavior:"smooth",block:"end"})},0);return()=>window.clearTimeout(K)},[e,N,j?.messages.length,j?.pendingToolCalls.length,j?.warnings.length]),v.useEffect(()=>{const K=R.current;if(!K)return;K.style.height="0px";const le=Math.min(K.scrollHeight,160);K.style.height=`${Math.max(40,le)}px`},[x,e]);const H=i.length>0&&a.serverIds.length>0&&!!L,Q=async K=>{if(!y)return;const le=K.trim();if(!le)return;const te=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,de={id:te,role:"user",text:le,createdAt:new Date().toISOString()};b(oe=>oe&&{...oe,messages:[...oe.messages,de]}),S(""),_(!0);try{const oe=await p.sendScenarioAssistantMessage(y,le);b(oe.session)}catch(oe){b(pe=>pe&&{...pe,messages:pe.messages.filter(je=>je.id!==te)}),S(pe=>pe.trim()?pe:le),_e({title:"Scenario Assistant error",description:oe instanceof Error?oe.message:String(oe),variant:"destructive"})}finally{_(!1)}},J=K=>{S(K),requestAnimationFrame(()=>R.current?.focus())};v.useEffect(()=>{if(!e||!y||!j||!H||N)return;const K=String(f??"").trim();K&&k.current!==K&&(k.current=K,Q(K))},[e,y,j,H,N,f]);const T=async K=>{if(y){_(!0);try{const le=await p.approveScenarioAssistantToolCall(y,K);b(le.session)}catch(le){_e({title:"Tool call failed",description:le instanceof Error?le.message:String(le),variant:"destructive"})}finally{_(!1)}}},D=async K=>{if(y){_(!0);try{const le=await p.denyScenarioAssistantToolCall(y,K);b(le.session)}catch(le){_e({title:"Could not deny tool call",description:le instanceof Error?le.message:String(le),variant:"destructive"})}finally{_(!1)}}},X=async()=>{if(y){_(!0);try{const K=await p.approveAllScenarioAssistantToolCalls(y);b(K.session)}catch(K){_e({title:"Could not approve all tool calls",description:K instanceof Error?K.message:String(K),variant:"destructive"})}finally{_(!1)}}},F=(K,le,te)=>{if(!le)return;if(te==="prompt"&&le.prompt&&h({prompt:le.prompt.replacement}),te==="evalRules"&&le.evalRules&&h({evalRules:le.evalRules.replacement}),te==="extractRules"&&le.extractRules&&h({extractRules:le.extractRules.replacement}),te==="snapshotEval"&&le.snapshotEval&&h({snapshotEval:{enabled:le.snapshotEval.patch.enabled,baselineSnapshotId:le.snapshotEval.patch.baselineSnapshotId}}),K){const oe=`${K}:${te}`;A(pe=>new Set([...pe,oe]))}_e({title:"Applied suggestion",description:`Updated ${{prompt:"Prompt",evalRules:"Checks",extractRules:"Value Capture Rules",snapshotEval:"Snapshot Settings"}[te]}`})},$=K=>{K||(z(!1),B.current=!1),t(K)},ee=()=>{B.current=!0,z(!0),t(!1)},ae=()=>{B.current=!1,z(!1),y&&U(y)};return s.jsxs(s.Fragment,{children:[!e&&y&&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(ie,{type:"button",size:"sm",variant:"outline",onClick:()=>t(!0),children:[s.jsx(va,{className:"mr-1.5 h-3.5 w-3.5"}),"Resume"]}),s.jsx(ie,{type:"button",size:"sm",variant:"ghost",className:"h-8 px-2 text-muted-foreground",onClick:ae,"aria-label":"Discard assistant session",title:"Discard assistant session",children:s.jsx(Vs,{className:"h-4 w-4"})})]})]}),s.jsx(Ohe,{open:e,onOpenChange:$,children:s.jsxs(QB,{className:"max-w-6xl h-[85vh] flex flex-col",children:[y&&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:ee,"aria-label":"Minimize assistant",title:"Minimize assistant",children:[s.jsx(TU,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Minimize"})]}),s.jsx(JB,{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(ZB,{className:"flex items-center gap-2",children:[s.jsx(va,{className:"h-4 w-4"}),"Scenario Assistant"]}),s.jsx(e8,{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(Me,{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(Ds,{className:"h-3.5 w-3.5"}),j?`Loaded ${j.toolsLoaded} tools`:"Preparing..."]})]})}),s.jsx(jm,{className:"min-h-0 flex-1 rounded-md border p-3",children:s.jsxs("div",{className:"space-y-3",children:[j?.warnings?.map((K,le)=>s.jsx("div",{className:"rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-900",children:K},`${K}-${le}`)),j?.messages.map(K=>s.jsxs(v.Fragment,{children:[(()=>{const le=K.pendingToolCallIds??(K.pendingToolCallId?[K.pendingToolCallId]:[]),te=le.map(se=>(j?.pendingToolCalls??[]).find($e=>$e.id===se)).filter(se=>!!se),de=le.map(se=>j.pendingToolCalls.find($e=>$e.id===se)??j.pendingToolCalls.find($e=>$e.id===se)).filter(Boolean);if(!(K.role==="assistant"&&le.length>0))return s.jsx("div",{className:"space-y-2",children:s.jsx(Khe,{message:K})});const pe=te.length,je=de.length-pe;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(ya,{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(pS,{text:K.text,variant:"assistant"})}),de.length>1&&pe>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:[je," of ",de.length," tool calls resolved"]}),s.jsxs(ie,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:N,onClick:()=>{X()},children:["Approve All (",pe,")"]})]}),de.map(se=>{const $e=se.status==="pending",Ae=se.tool??se.publicToolName??"unknown_tool";return s.jsxs("details",{open:$e,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(Ds,{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 ${$e?"bg-amber-100 text-amber-900":se.status==="error"?"bg-red-100 text-red-900":se.status==="denied"?"bg-gray-100 text-gray-700":"bg-muted text-muted-foreground"}`,children:$e?"Needs approval":se.status==="error"?"Error":se.status==="denied"?"Denied":"Approved"})]})}),s.jsx(Wt,{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(se.arguments??{},null,2)})}),$e&&s.jsxs("div",{className:"mt-2 flex justify-end gap-2",children:[s.jsx(ie,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:N,onClick:()=>{D(se.id)},children:"Deny"}),s.jsx(ie,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:N,onClick:()=>{T(se.id)},children:"Approve"})]})]})]},se.id)})]})]})})(),K.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(va,{className:"h-3.5 w-3.5"}),"Structured Suggestions"]}),K.suggestions.prompt&&s.jsx(Xp,{title:"Prompt",rationale:K.suggestions.prompt.rationale,preview:K.suggestions.prompt.replacement,applied:P.has(`${K.id}:prompt`),onApply:()=>F(K.id,K.suggestions,"prompt")}),K.suggestions.evalRules&&s.jsx(Xp,{title:"Checks",rationale:K.suggestions.evalRules.rationale,preview:JSON.stringify(K.suggestions.evalRules.replacement,null,2),applied:P.has(`${K.id}:evalRules`),onApply:()=>F(K.id,K.suggestions,"evalRules")}),K.suggestions.extractRules&&s.jsx(Xp,{title:"Value Capture Rules",rationale:K.suggestions.extractRules.rationale,preview:JSON.stringify(K.suggestions.extractRules.replacement,null,2),applied:P.has(`${K.id}:extractRules`),onApply:()=>F(K.id,K.suggestions,"extractRules")}),K.suggestions.snapshotEval&&s.jsx(Xp,{title:"Snapshot Settings",rationale:K.suggestions.snapshotEval.rationale,preview:JSON.stringify(K.suggestions.snapshotEval.patch,null,2),applied:P.has(`${K.id}:snapshotEval`),onApply:()=>F(K.id,K.suggestions,"snapshotEval")}),(()=>{const le=K.suggestions?.notes,te=Array.isArray(le)?le:typeof le=="string"?[le]:[];return te.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:te.map((de,oe)=>s.jsx("li",{children:de},`${K.id}-note-${oe}`))})]})})()]})]},K.id)),(j?.pendingToolCalls??[]).filter(K=>!(j?.messages??[]).some(le=>le.pendingToolCallId===K.id||le.pendingToolCallIds?.includes(K.id))).map(K=>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(Ds,{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:K.publicToolName||K.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(Wt,{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(K.arguments??{},null,2)})}),s.jsxs("div",{className:"mt-2 flex justify-end gap-2",children:[s.jsx(ie,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:N,onClick:()=>{D(K.id)},children:"Deny"}),s.jsx(ie,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:N,onClick:()=>{T(K.id)},children:"Approve"})]})]})]},K.id)),!j&&N&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(ir,{className:"h-4 w-4 animate-spin"}),"Starting assistant session..."]}),j&&N&&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(ya,{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(ir,{className:"h-4 w-4 animate-spin"}),"Thinking..."]})]}),s.jsx("div",{ref:O})]})}),s.jsxs("div",{className:"rounded-xl border bg-background p-2 shadow-sm",children:[s.jsx(Ua,{ref:R,value:x,onChange:K=>S(K.target.value),placeholder:"Get assistance with creating or refining this scenario ...",disabled:!y||N,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:K=>{K.key==="Enter"&&!K.shiftKey&&(K.preventDefault(),Q(x))}}),s.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 px-1 pt-1",children:[s.jsxs(Wc,{children:[s.jsx(Vc,{asChild:!0,children:s.jsxs(ie,{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:!y||N,children:[s.jsx(ps,{className:"h-3 w-3"}),"Snippets",s.jsx(Wt,{className:"h-3 w-3"})]})}),s.jsxs(Ho,{align:"start",className:"w-[320px]",children:[s.jsx(aC,{children:"Scenario Assistant Snippets"}),s.jsx(sC,{}),Vhe.map(K=>s.jsx(gr,{className:"items-start whitespace-normal px-2 py-2",onSelect:()=>J(K.prompt),children:s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("div",{className:"text-xs font-medium leading-tight",children:K.label}),s.jsx("div",{className:"text-[11px] leading-snug text-muted-foreground",children:K.description})]})},K.label))]})]}),s.jsx(ie,{type:"button",size:"icon",className:"h-8 w-8 rounded-full",onClick:()=>{Q(x)},disabled:!y||N||!x.trim(),"aria-label":"Send message",title:"Send message",children:N?s.jsx(ir,{className:"h-4 w-4 animate-spin"}):s.jsxs(s.Fragment,{children:[s.jsx(d$,{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 Xp({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(ie,{type:"button",size:"sm",variant:r?"secondary":"outline",onClick:a,disabled:r,children:r?s.jsxs(s.Fragment,{children:[s.jsx(Ml,{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 Khe({message:e}){const t=async o=>{try{await navigator.clipboard.writeText(o),_e({title:"Copied"})}catch(c){_e({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(Ds,{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(u$,{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(pS,{text:e.text,variant:"assistant"})})]});const r=n==="user",a=r?OS:ya,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(pS,{text:e.text,variant:"assistant"})]}),i&&s.jsx(ie,{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(Mi,{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 pS({text:e,variant:t="assistant"}){const n=Ghe(e);return s.jsx("div",{className:be("space-y-2",t==="system"&&"text-xs"),children:n.map((r,a)=>s.jsx(v.Fragment,{children:Yhe(r,a,t)},`md-${a}`))})}function Ghe(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 y=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:y,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(nM(t,r)){const y=rM(t[r]);r+=2;const g=[];for(;r<t.length&&t[r].includes("|")&&!a(t[r]);)g.push(rM(t[r])),r+=1;n.push({type:"table",headers:y,rows:g});continue}const f=c.match(/^\d+\.\s+/),h=c.match(/^[-*+]\s+/);if(f||h){const y=!!f,g=[];for(;r<t.length;){const j=t[r].trim();if(y?/^\d+\.\s+/.test(j):/^[-*+]\s+/.test(j)){g.push(j.replace(y?/^\d+\.\s+/:/^[-*+]\s+/,"")),r+=1;continue}a(t[r])&&(r+=1);break}n.push({type:"list",ordered:y,items:g});continue}const p=[o];for(r+=1;r<t.length;){const y=t[r],g=y.trim();if(a(y)||i(y)||/^---+$/.test(g)||/^#{1,4}\s+/.test(g)||nM(t,r)||/^\d+\.\s+/.test(g)||/^[-*+]\s+/.test(g))break;p.push(y),r+=1}n.push({type:"paragraph",text:p.join(`
124
+ `)})}return n}function nM(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 rM(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(t=>t.trim())}function Yhe(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:Bu(e.text,`${t}-h`)})}if(e.type==="paragraph")return s.jsx("p",{className:be("whitespace-pre-wrap leading-relaxed",n==="system"&&"leading-normal"),children:Bu(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:be("space-y-1 pl-5",e.ordered?"list-decimal":"list-disc"),children:e.items.map((a,i)=>s.jsx("li",{className:"leading-relaxed",children:Bu(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:Bu(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:Bu(i,`${t}-tdc-${a}-${o}`)},`${t}-td-${a}-${o}`))},`${t}-row-${a}`))})]})}):null}function Bu(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 Xhe="mcplab.feature.";function bf(e,t=!1){if(typeof window>"u")return t;try{const n=window.localStorage.getItem(`${Xhe}${e}`);return n==null?t:n==="1"||n==="true"}catch{return t}}const Qhe=()=>({id:`scn-${Date.now()}`,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]});function hS({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:y=!p,allowStructureEdits:g=!p}){const j=(N,_)=>{const P=e.map((A,O)=>O===N?{...A,..._}:A);h(P)},b=N=>h(e.filter((_,P)=>P!==N)),x=()=>h([...e,Qhe()]),S=(N,_)=>{const P=N+_;if(P<0||P>=e.length)return;const A=[...e],[O]=A.splice(N,1);A.splice(P,0,O),h(A)};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"}),y&&g&&s.jsxs(ie,{type:"button",variant:"outline",size:"sm",onClick:x,children:[s.jsx(ps,{className:"mr-1.5 h-3.5 w-3.5"}),"Add Scenario"]})]}),e.map((N,_)=>s.jsx(Jhe,{scenario:N,scenarioOrigin:t?.[_],index:_,total:e.length,agents:n,servers:r,configId:a,configPath:i,defaultAssistantAgentName:o,assistantInitialPrompt:c?.[N.id],assistantAutoOpenNonce:d?.[N.id],snapshotEval:f,onUpdate:P=>j(_,P),onMoveUp:()=>S(_,-1),onMoveDown:()=>S(_,1),onRemove:()=>b(_),readOnly:p,allowStructureEdits:g},N.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 Jhe({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:y,onMoveUp:g,onMoveDown:j,onRemove:b,readOnly:x,allowStructureEdits:S}){const{source:N}=On(),_=bf("snapshots",!1),[P,A]=v.useState("required_tool"),[O,R]=v.useState(""),[k,M]=v.useState(""),[z,B]=v.useState(null),[L,G]=v.useState(!1),[U,H]=v.useState(null),[Q,J]=v.useState(""),[T,D]=v.useState(""),[X,F]=v.useState(!1),[$,ee]=v.useState(!x),ae=()=>{O.trim()&&(y({evalRules:[...e.evalRules,{type:P,value:O.trim()}]}),R(""),M(""))},K=Z=>{y({evalRules:e.evalRules.filter((Ne,Ie)=>Ie!==Z)})},le=()=>{!Q.trim()||!T.trim()||(y({extractRules:[...e.extractRules,{name:Q.trim(),pattern:T.trim()}]}),J(""),D(""))},te=Z=>{y({extractRules:e.extractRules.filter((Ne,Ie)=>Ie!==Z)})},de=Z=>{const Ne=e.serverIds.includes(Z)?e.serverIds.filter(Ie=>Ie!==Z):[...e.serverIds,Z];y({serverIds:Ne})},oe={required_tool:"Required",forbidden_tool:"Forbidden",response_contains:"Contains",response_not_contains:"Not Contains"},pe={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"},je=P==="required_tool"||P==="forbidden_tool",se=e.serverIds.filter(Z=>i.some(Ne=>Ne.id===Z)),$e=se.length>0,Ae=e.snapshotEval?.baselineSnapshotId!==void 0,[Ye,ye]=v.useState(""),[Se,ze]=v.useState(0);v.useEffect(()=>{const Z=(f??"").trim();Z&&Ye!==Z&&(F(!0),ye(Z))},[f,Ye]),v.useEffect(()=>{h&&h!==Se&&(F(!0),ze(h))},[h,Se]),v.useEffect(()=>{B(null),H(null),M("")},[e.serverIds.join("|")]),v.useEffect(()=>{M("")},[P]);const ct=async()=>{if(!(!$e||x)){G(!0),H(null);try{const Z=new Set;for(const Ne of se){const Ie=await N.discoverToolsForAnalysis({serverNames:[Ne]});for(const Re of Ie.servers)for(const De of Re.tools)Z.add(De.name)}B(Array.from(Z).sort((Ne,Ie)=>Ne.localeCompare(Ie)))}catch(Z){H(Z instanceof Error?Z.message:"Failed to load tools")}finally{G(!1)}}};return s.jsx(Ai,{open:$,onOpenChange:ee,children:s.jsxs(We,{className:x?"rounded-md border shadow-none":"border-dashed",children:[s.jsxs(Nt,{className:x?"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:[!x&&s.jsx(Ms,{asChild:!0,children:s.jsx(ie,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",children:s.jsx(Wt,{className:`h-3.5 w-3.5 transition-transform ${$?"rotate-0":"-rotate-90"}`})})}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[n+1,"."]}),s.jsx(Ct,{className:"truncate text-sm font-medium",children:e.name||`Scenario ${n+1}`})]}),x?s.jsxs("div",{className:"flex items-center gap-2",children:[t&&s.jsx(Je,{variant:t==="inline"?"secondary":"outline",children:t==="referenced"?"Referenced":"Inline"}),s.jsx(Ms,{asChild:!0,children:s.jsx(ie,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8","aria-label":$?"Collapse scenario details":"Expand scenario details",children:s.jsx(Wt,{className:`h-4 w-4 transition-transform ${$?"rotate-180":""}`})})})]}):S&&s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsxs(ie,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>F(!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(va,{className:"h-3.5 w-3.5"}),"Ask Assistant"]}),s.jsx(ie,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:g,disabled:n===0,"aria-label":"Move scenario up",children:s.jsx(cs,{className:"h-3.5 w-3.5"})}),s.jsx(ie,{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(Wt,{className:"h-3.5 w-3.5"})}),s.jsx(ie,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:b,children:s.jsx(Na,{className:"h-3.5 w-3.5 text-destructive"})})]})]}),s.jsx(Ei,{children:s.jsxs(Ve,{className:"space-y-3",children:[s.jsx(Hhe,{open:X,onOpenChange:F,configId:o,configPath:c,scenario:e,agents:a,servers:i,snapshotEval:p,defaultAssistantAgentName:d,initialUserMessage:f,onApplyPatch:Z=>y({...Z.prompt!==void 0?{prompt:Z.prompt}:{},...Z.evalRules!==void 0?{evalRules:Z.evalRules}:{},...Z.extractRules!==void 0?{extractRules:Z.extractRules}:{},...Z.snapshotEval!==void 0?{snapshotEval:{...e.snapshotEval??{},...Z.snapshotEval}}:{}})}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{className:"text-xs",children:"Name"}),s.jsx(vt,{value:e.name,onChange:Z=>y({name:Z.target.value}),disabled:x,placeholder:"e.g. List directory"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{className:"text-xs",children:"Servers"}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[i.map(Z=>s.jsx(Je,{variant:e.serverIds.includes(Z.id)?"default":"outline",className:`cursor-pointer text-xs ${e.serverIds.includes(Z.id)?"":"opacity-50"}`,onClick:()=>!x&&de(Z.id),children:Z.name||Z.id},Z.id)),i.length===0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:"Add servers above first"})]})]}),s.jsxs(We,{className:"border bg-card",children:[s.jsxs(Nt,{className:"pb-2",children:[s.jsx(Ct,{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(Ve,{className:"pt-0",children:s.jsx(Ua,{value:e.prompt,onChange:Z=>y({prompt:Z.target.value}),disabled:x,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(We,{className:"border bg-muted/20",children:[s.jsx(Nt,{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(Ct,{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."})]}),!x&&s.jsxs(ie,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>F(!0),title:"Ask for help improving checks",children:[s.jsx(va,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})]})}),s.jsx(Ve,{className:"space-y-2",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx(Me,{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((Z,Ne)=>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 ${pe[Z.type]}`,children:oe[Z.type]}),s.jsx("span",{className:"font-mono break-all",children:Z.value})]})}),!x&&s.jsx(ie,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>K(Ne),"aria-label":`Remove check ${Ne+1}`,children:s.jsx(Vs,{className:"h-3.5 w-3.5"})})]},Ne))}),!x&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex gap-2 items-end",children:[s.jsxs(sn,{value:P,onValueChange:Z=>A(Z),children:[s.jsx(Zt,{className:"h-8 w-[14.5rem] shrink-0 text-xs",children:s.jsx(on,{})}),s.jsxs(en,{children:[s.jsx(it,{value:"required_tool",children:"Required Tool"}),s.jsx(it,{value:"forbidden_tool",children:"Forbidden Tool"}),s.jsx(it,{value:"response_contains",children:"Text matches pattern"}),s.jsx(it,{value:"response_not_contains",children:"Text must not match"})]})]}),s.jsx(vt,{value:O,onChange:Z=>R(Z.target.value),placeholder:"Value",className:"h-8 text-xs font-mono",onKeyDown:Z=>Z.key==="Enter"&&(Z.preventDefault(),ae())}),s.jsx(ie,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:ae,children:"Add"})]}),je&&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(Me,{className:"mb-1 block text-[11px] text-muted-foreground",children:"Pick from selected server tools (optional)"}),s.jsxs(sn,{value:k,onValueChange:Z=>{M(Z),R(Z)},disabled:L||!z||z.length===0,children:[s.jsx(Zt,{className:"h-8 text-xs",children:s.jsx(on,{placeholder:L?"Loading tools...":z&&z.length>0?"Select tool to insert in value field":"Load tools first"})}),s.jsx(en,{children:(z??[]).map(Z=>s.jsx(it,{value:Z,children:Z},Z))})]})]}),s.jsx(ie,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:ct,disabled:!$e||L,children:L?"Loading...":z?"Refresh tools":"Load tools"})]}),!$e&&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(We,{className:"border bg-muted/10",children:[s.jsx(Nt,{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(Ct,{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."})]}),!x&&s.jsxs(ie,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>F(!0),title:"Ask for help improving value capture rules",children:[s.jsx(va,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})]})}),s.jsx(Ve,{className:"space-y-2",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx(Me,{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((Z,Ne)=>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:Z.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:Z.pattern})]})}),!x&&s.jsx(ie,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>te(Ne),"aria-label":`Remove value capture rule ${Ne+1}`,children:s.jsx(Vs,{className:"h-3.5 w-3.5"})})]},Ne))}),!x&&s.jsxs("div",{className:"flex gap-2 items-end",children:[s.jsx(vt,{value:Q,onChange:Z=>J(Z.target.value),placeholder:"Field name",className:"h-8 text-xs w-36"}),s.jsx(vt,{value:T,onChange:Z=>D(Z.target.value),placeholder:"Regex pattern",className:"h-8 text-xs font-mono",onKeyDown:Z=>Z.key==="Enter"&&(Z.preventDefault(),le())}),s.jsx(ie,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:le,children:"Add"})]})]})})]})]}),_&&s.jsxs(We,{className:"border bg-amber-50/40",children:[s.jsxs(Nt,{className:"pb-2",children:[s.jsx(Ct,{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(Ve,{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(ym,{checked:e.snapshotEval?.enabled!==!1,disabled:x,onCheckedChange:Z=>y({snapshotEval:{...e.snapshotEval??{},enabled:Z}})})]}),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(ym,{checked:!Ae,disabled:x,onCheckedChange:Z=>{if(Z){y({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:void 0}});return}y({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:e.snapshotEval?.baselineSnapshotId??""}})}})]}),Ae&&s.jsx(vt,{value:e.snapshotEval?.baselineSnapshotId??"",onChange:Z=>y({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:Z.target.value}}),disabled:x,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"})]})]})]})]})})]})})}const Zhe=()=>({id:`cfg-${Date.now()}`,name:"",configName:"",description:"",servers:[],serverEntries:[],agents:[],agentEntries:[],scenarios:[],scenarioEntries:[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),aM=()=>{const{id:e,tab:t}=Do(),n=_a(),[r,a]=Tc(),{getConfig:i,addConfig:o,updateConfig:c,loading:d}=of(),{source:f}=On(),h=bf("snapshots",!1),{servers:p,agents:y,scenarios:g}=Ha(),j=e==="new",b=!j&&!!e,x=b?i(e):void 0,[S,N]=v.useState(j),[_,P]=v.useState(()=>x?structuredClone(x):Zhe()),[A,O]=v.useState([]),[R,k]=v.useState(""),[M,z]=v.useState(""),[B,L]=v.useState(""),[G,U]=v.useState(null),[H,Q]=v.useState(!1),[J,T]=v.useState(!1),[D,X]=v.useState(""),[F,$]=v.useState(""),[ee,ae]=v.useState({}),[K,le]=v.useState({}),[te,de]=v.useState({}),oe=v.useMemo(()=>{const W=t||r.get("tab");return W==="agents"||W==="scenarios"?W:"scenarios"},[t,r]);v.useEffect(()=>{x&&!S&&P(structuredClone(x))},[x,S]),v.useEffect(()=>{let W=!0;return f.listSnapshots().then(ve=>{W&&O(ve)}).catch(()=>{W&&O([])}),()=>{W=!1}},[f]),v.useEffect(()=>{if(!R.trim()){U(null);return}let W=!0;return f.getResult(R.trim()).then(ve=>{if(!W)return;if(!ve){U(!1);return}const Be=ve.overallPassRate===1&&ve.scenarios.every(ut=>ut.runs.every(_t=>_t.passed));U(Be)}).catch(()=>{W&&U(!1)}),()=>{W=!1}},[R,f]);const pe=W=>P(ve=>({...ve,...W})),je=v.useMemo(()=>_.serverEntries&&_.serverEntries.length>0?_.serverEntries:(_.servers??[]).map(W=>({kind:"inline",server:W})),[_.serverEntries,_.servers]),se=v.useMemo(()=>_.scenarioEntries&&_.scenarioEntries.length>0?_.scenarioEntries:_.scenarios.map(W=>({kind:"inline",scenario:W})),[_.scenarioEntries,_.scenarios]),$e=W=>{pe({scenarioEntries:W,scenarios:W.filter(ve=>ve.kind==="inline").map(ve=>ve.scenario)})},Ae=v.useMemo(()=>_.agentEntries&&_.agentEntries.length>0?_.agentEntries:_.agents.map(W=>({kind:"inline",agent:W})),[_.agentEntries,_.agents]),Ye=W=>{pe({agentEntries:W,agents:W.filter(ve=>ve.kind==="inline").map(ve=>ve.agent)})},ye=!S,Se=_.runDefaults?.selectedAgentNames??[],ze=async W=>{if(!_.id||ye===!1){pe({snapshotEval:{enabled:W.enabled,mode:W.mode,baselineSnapshotId:W.baselineSnapshotId,baselineSourceRunId:W.baselineSourceRunId,lastUpdatedAt:new Date().toISOString()}});return}Q(!0);try{const ve=await f.updateSnapshotPolicy(_.id,W);P(ve),_e({title:"Snapshot policy updated"})}catch(ve){_e({title:"Could not update snapshot policy",description:ve instanceof Error?ve.message:String(ve),variant:"destructive"})}finally{Q(!1)}},ct=async()=>{if(!(!_.id||!R.trim())){T(!0);try{const W=await f.generateSnapshotEvalBaseline(R.trim(),_.id,M.trim()||void 0);P(W.config),L(W.snapshot.id),O(ve=>[W.snapshot,...ve.filter(Be=>Be.id!==W.snapshot.id)]),_e({title:"Snapshot baseline generated",description:`${W.snapshot.name} (${W.snapshot.id})`})}catch(W){_e({title:"Could not generate baseline",description:W instanceof Error?W.message:String(W),variant:"destructive"})}finally{T(!1)}}},Z=async()=>{if(!_.name.trim()){_e({title:"Validation Error",description:"Config ID is required.",variant:"destructive"});return}const W=je.map(Ge=>Ge.kind==="referenced"?{kind:"referenced",ref:p.find(Tn=>Tn.id===Ge.ref)?.id||Ge.ref}:Ge),ve=Ae.map(Ge=>Ge.kind==="referenced"?{kind:"referenced",ref:y.find(Tn=>Tn.id===Ge.ref)?.id||Ge.ref}:Ge),Be=se.map(Ge=>Ge.kind==="referenced"?{kind:"referenced",ref:g.find(Tn=>Tn.id===Ge.ref)?.id||Ge.ref}:Ge);if(Be.filter(Ge=>Ge.kind==="inline").some(Ge=>!Ge.scenario.name?.trim())){_e({title:"Validation Error",description:"Inline scenarios must have a name before saving.",variant:"destructive"});return}const _t=new Set(ve.map(Ge=>Ge.kind==="inline"?Ge.agent.id:Ge.ref)),At=(_.runDefaults?.selectedAgentNames??[]).filter(Ge=>_t.has(Ge)),yn={..._,serverEntries:W,servers:W.filter(Ge=>Ge.kind==="inline").map(Ge=>Ge.server),agentEntries:ve,agents:ve.filter(Ge=>Ge.kind==="inline").map(Ge=>Ge.agent),scenarioEntries:Be,scenarios:Be.filter(Ge=>Ge.kind==="inline").map(Ge=>Ge.scenario),runDefaults:At.length>0?{..._.runDefaults??{},selectedAgentNames:At}:void 0,updatedAt:new Date().toISOString()};if(j){const Ge=await o(yn);P(Ge);const hn=Ge.configName?.trim()||Ge.name;_e({title:"MCP Evaluation Created",description:`"${hn}" has been saved.`}),n(`/mcp-evaluations/${Ge.id}`)}else{const Ge=await c(_.id,yn);P(Ge);const hn=Ge.configName?.trim()||Ge.name;_e({title:"MCP Evaluation Updated",description:`"${hn}" has been updated.`}),N(!1),Ge.id!==e&&n(`/mcp-evaluations/${Ge.id}`,{replace:!0})}},Ne=_.configName?.trim()||_.name,Ie=j?"New MCP Evaluation":S?`Editing: ${Ne}`:Ne,Re=j?"/mcp-evaluations/new":`/mcp-evaluations/${encodeURIComponent(_.id||e||"")}`,De=!!x?.loadError,he=v.useMemo(()=>y.map(W=>({id:W.id,ref:W.id,label:W.name||W.id,model:W.model})).sort((W,ve)=>W.label.localeCompare(ve.label)),[y]),Fe=(W,ve)=>{const Be=ve?Array.from(new Set([...Se,W])):Se.filter(ut=>ut!==W);pe({runDefaults:{..._.runDefaults??{},selectedAgentNames:Be}})},Ue=W=>{const ve=new Set([...Ae.filter(At=>At.kind==="inline").map(At=>At.agent.name||At.agent.id),...y.map(At=>At.name||At.id)]),Be=`${W}-custom`;let ut=Be,_t=2;for(;ve.has(ut);)ut=`${Be}-${_t}`,_t+=1;return ut},Rt=()=>{const ve={id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096};Ye([{kind:"inline",agent:ve},...Ae]),ae(Be=>({...Be,[ve.id]:!0}))},Ht=()=>{const W=y.find(ut=>ut.id===F);if(!W)return;const ve=W.id;new Set(Ae.filter(ut=>ut.kind==="referenced").map(ut=>ut.ref)).has(ve)||Ye([...Ae,{kind:"referenced",ref:ve}]),$("")},zt=()=>{const W=new Set(Ae.filter(Be=>Be.kind==="referenced").map(Be=>Be.ref)),ve=y.filter(Be=>!W.has(Be.id)).map(Be=>({kind:"referenced",ref:Be.id}));ve.length>0&&Ye([...Ae,...ve])},$t=()=>{const W=y.find(_t=>_t.id===F);if(!W)return;const ve=W.name||W.id,Be=Ue(ve),ut={...structuredClone(W),id:`agt-${Date.now()}`,name:Be};Ye([...Ae,{kind:"inline",agent:ut}]),ae(_t=>({..._t,[ut.id]:!0})),$(""),_e({title:"Imported agent as inline",description:Be})},Rn=W=>{const ve=Ae[W];if(!ve)return;const Be=ve.kind==="inline"?ve.agent.id:ve.ref,ut=Se.filter(_t=>_t!==Be);pe({runDefaults:{..._.runDefaults??{},selectedAgentNames:ut}}),ve.kind==="inline"&&ae(_t=>{const At={..._t};return delete At[ve.agent.id],At}),Ye(Ae.filter((_t,At)=>At!==W))},kn=(W,ve)=>{const Be=W+ve;if(Be<0||Be>=Ae.length)return;const ut=[...Ae],[_t]=ut.splice(W,1);ut.splice(Be,0,_t),Ye(ut)},lr=W=>{const ve=Ae[W];if(!ve||ve.kind!=="referenced")return;const Be=Kt(ve.ref);if(!Be){_e({title:"Referenced agent not found",variant:"destructive"});return}const ut=Be.name||Be.id,_t=Ue(ut),At={...structuredClone(Be),id:`agt-${Date.now()}`,name:_t},yn=[...Ae];if(yn[W]={kind:"inline",agent:At},Ye(yn),Se.includes(ve.ref)){const Ge=Se.map(hn=>hn===ve.ref?At.id:hn);pe({runDefaults:{..._.runDefaults??{},selectedAgentNames:Array.from(new Set(Ge))}})}ae(Ge=>({...Ge,[At.id]:!0})),_e({title:"Referenced agent converted to inline",description:_t})},cr=()=>{const W=g.find(Be=>Be.id===D);if(!W)return;const ve={...structuredClone(W),id:`scn-${Date.now()}`,serverIds:[...W.serverIds]};$e([...se,{kind:"inline",scenario:ve}]),de(Be=>({...Be,[ve.id]:!0})),X("")},Ln=()=>{const ve={id:`scn-${Date.now()}`,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};$e([{kind:"inline",scenario:ve},...se]),de(Be=>({...Be,[ve.id]:!0}))},ur=()=>{const W=g.find(ut=>ut.id===D);if(!W)return;const ve=W.id;new Set(se.filter(ut=>ut.kind==="referenced").map(ut=>ut.ref)).has(ve)||$e([...se,{kind:"referenced",ref:ve}]),X("")},_r=W=>{const ve=se[W];ve?.kind==="inline"&&de(Be=>{const ut={...Be};return delete ut[ve.scenario.id],ut}),$e(se.filter((Be,ut)=>ut!==W))},Lr=(W,ve)=>{const Be=W+ve;if(Be<0||Be>=se.length)return;const ut=[...se],[_t]=ut.splice(W,1);ut.splice(Be,0,_t),$e(ut)},Fr=W=>{const ve=se[W];if(!ve||ve.kind!=="referenced")return;const Be=_n(ve.ref);if(!Be){_e({title:"Referenced scenario not found",variant:"destructive"});return}const ut=new Set(se.filter(Ut=>Ut.kind==="inline").map(Ut=>Ut.scenario.name?.trim().toLowerCase()).filter(Boolean)),_t=`${(Be.name||Be.id).trim()}-custom`;let At=_t,yn=2;for(;ut.has(At.toLowerCase());)At=`${_t}-${yn}`,yn+=1;const Ge=Date.now(),hn={...structuredClone(Be),id:`scn-${Ge}`,name:At,serverIds:[...Be.serverIds]},Tn=[...se];Tn[W]={kind:"inline",scenario:hn},$e(Tn),de(Ut=>({...Ut,[hn.id]:!0})),_e({title:"Referenced scenario converted to inline",description:At})},Xn=W=>p.find(ve=>ve.id===W),Kt=W=>y.find(ve=>ve.id===W),_n=W=>g.find(ve=>ve.id===W),ce=je.filter(W=>W.kind==="referenced").map(W=>W.ref),ke=ce.map(Xn).filter(W=>!!W),nt=Ae.filter(W=>W.kind==="referenced").map(W=>W.ref),yt=nt.map(Kt).filter(W=>!!W);Ae.filter(W=>W.kind==="inline");const Dt=Ae.flatMap(W=>{if(W.kind==="referenced"){const ve=Kt(W.ref);return ve?[{agent:ve,origin:"referenced",ref:W.ref}]:[]}return[{agent:W.agent,origin:"inline",ref:void 0}]}),Yt=se.filter(W=>W.kind==="referenced").map(W=>W.ref),cn=se.flatMap(W=>{if(W.kind==="referenced"){const ve=_n(W.ref);return ve?[{scenario:ve,origin:"referenced"}]:[]}return[{scenario:W.scenario,origin:"inline"}]}),dr=Array.from(new Map([...y,..._.agents,...yt].map(W=>[W.id,W])).values()),Sn=Array.from(new Map([...p,..._.servers??[],...ke].map(W=>[W.id,W])).values()),Fn=ce.filter(W=>!Xn(W)),Br=nt.filter(W=>!Kt(W)),zr=Yt.filter(W=>!_n(W));new Set(Fn);const gn=new Set(zr),ri=Ae.length,ts=se.length;return v.useEffect(()=>{if(!F)return;y.some(ve=>ve.id===F)||$("")},[y,F]),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(ie,{variant:"ghost",size:"icon",asChild:!0,className:"h-8 w-8",children:s.jsx(xt,{to:"/mcp-evaluations",children:s.jsx(jo,{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:Ie}),s.jsx("p",{className:"text-sm text-muted-foreground",children:j?"Create a new MCP evaluation":d?"Loading configuration...":x?x.loadError?"MCP evaluation could not be fully loaded":`Last updated ${new Date(_.updatedAt).toLocaleDateString()}`:"MCP evaluation not found"})]}),s.jsxs("div",{className:"flex gap-2 shrink-0",children:[b&&!S&&s.jsx(ie,{size:"sm",onClick:()=>N(!0),children:"Edit"}),b&&!S&&x&&!De&&s.jsx(ie,{size:"sm",variant:"outline",asChild:!0,children:s.jsxs(xt,{to:`/run?configId=${encodeURIComponent(x.id)}`,children:[s.jsx($l,{className:"mr-1.5 h-3.5 w-3.5"}),"Run MCP Evaluation"]})}),b&&!S&&De&&s.jsxs(Je,{variant:"destructive",className:"py-1 px-3 text-xs",children:[s.jsx(th,{className:"mr-1 h-3 w-3"}),"Broken config"]}),S&&s.jsxs(s.Fragment,{children:[!j&&s.jsx(ie,{variant:"outline",size:"sm",onClick:()=>{P(structuredClone(x)),N(!1)},children:"Cancel"}),s.jsxs(ie,{size:"sm",onClick:()=>{Z()},children:[s.jsx(MU,{className:"mr-1.5 h-3.5 w-3.5"}),"Save"]})]})]})]}),De&&!S&&s.jsx(We,{className:"border-destructive/40",children:s.jsxs(Ve,{className:"pt-6 space-y-3",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(th,{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:x?.sourcePath||x?.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:x?.loadError})]}),(Fn.length>0||Br.length>0||zr.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"}),Fn.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Servers: ",s.jsx("span",{className:"text-destructive",children:Fn.join(", ")})]}),Br.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Agents: ",s.jsx("span",{className:"text-destructive",children:Br.join(", ")})]}),zr.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Scenarios: ",s.jsx("span",{className:"text-destructive",children:zr.join(", ")})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Valid items still render below. Only the missing references are marked as broken."})]})}),!De&&(_.loadWarnings?.length??0)>0&&s.jsx(We,{className:"border-amber-500/30",children:s.jsxs(Ve,{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(th,{className:"h-4 w-4"}),"Migration warnings"]}),_.loadWarnings?.map((W,ve)=>s.jsx("p",{className:"text-xs text-muted-foreground",children:W},`${W}-${ve}`))]})}),s.jsxs("div",{className:"flex gap-4",children:[s.jsx(Je,{variant:oe==="scenarios"?"default":"outline",className:"py-1 px-3 text-xs",children:s.jsxs(xt,{to:`${Re}/scenarios`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[s.jsx(uE,{className:"h-3 w-3"}),ts," scenario",ts!==1?"s":""]})}),s.jsx(Je,{variant:oe==="agents"?"default":"outline",className:"py-1 px-3 text-xs",children:s.jsxs(xt,{to:`${Re}/agents`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[s.jsx(ya,{className:"h-3 w-3"}),ri," agent",ri!==1?"s":""]})})]}),s.jsx(We,{children:s.jsx(Ve,{className:"pt-6 space-y-3",children:s.jsxs("div",{className:`grid gap-4 ${ye||!j?"sm:grid-cols-2":"sm:grid-cols-3"}`,children:[!ye&&j&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{className:"text-xs",children:"Config ID"}),s.jsx(vt,{value:_.name,onChange:W=>pe({name:W.target.value}),disabled:ye,placeholder:"e.g. check-weather"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{className:"text-xs",children:"Name (optional)"}),s.jsx(vt,{value:_.configName||"",onChange:W=>pe({configName:W.target.value}),disabled:ye,placeholder:"e.g. Weather checks baseline"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{className:"text-xs",children:"Description"}),s.jsx(vt,{value:_.description||"",onChange:W=>pe({description:W.target.value}),disabled:ye,placeholder:"Brief description..."})]})]})})}),h&&s.jsx(We,{children:s.jsxs(Ve,{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(Me,{className:"text-xs",children:"Enable snapshot baseline"}),s.jsx(ym,{checked:_.snapshotEval?.enabled??!1,disabled:H,onCheckedChange:W=>{const ve=_.snapshotEval;ze({enabled:W,mode:ve?.mode??"warn",baselineSnapshotId:ve?.baselineSnapshotId,baselineSourceRunId:ve?.baselineSourceRunId})}})]})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{className:"text-xs",children:"Drift mode"}),s.jsxs(sn,{value:_.snapshotEval?.mode??"warn",onValueChange:W=>{const ve=_.snapshotEval;ze({enabled:ve?.enabled??!1,mode:W,baselineSnapshotId:ve?.baselineSnapshotId,baselineSourceRunId:ve?.baselineSourceRunId})},children:[s.jsx(Zt,{className:"h-8",children:s.jsx(on,{})}),s.jsxs(en,{children:[s.jsx(it,{value:"warn",children:"Warn"}),s.jsx(it,{value:"fail_on_drift",children:"Fail on drift"})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{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:_.snapshotEval?.baselineSnapshotId??"No baseline linked"})]})]}),_.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(Me,{className:"text-xs",children:"Generate baseline from passing run"}),s.jsx(vt,{value:R,onChange:W=>k(W.target.value),placeholder:"Run id (e.g. 20260208-140213)",className:"h-8 font-mono text-xs"}),G===!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(Me,{className:"text-xs",children:"Snapshot name (optional)"}),s.jsx(vt,{value:M,onChange:W=>z(W.target.value),placeholder:"e.g. config-baseline-v1",className:"h-8 text-xs"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Me,{className:"text-xs",children:"Switch baseline"}),s.jsxs(sn,{value:B||_.snapshotEval?.baselineSnapshotId||"",onValueChange:W=>{L(W),ze({enabled:_.snapshotEval?.enabled??!0,mode:_.snapshotEval?.mode??"warn",baselineSnapshotId:W||void 0,baselineSourceRunId:_.snapshotEval?.baselineSourceRunId})},children:[s.jsx(Zt,{className:"h-8",children:s.jsx(on,{placeholder:"Select snapshot"})}),s.jsx(en,{children:A.map(W=>s.jsx(it,{value:W.id,children:W.name},W.id))})]})]}),s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsx(ie,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:()=>{ct()},disabled:J||!R.trim()||G!==!0,children:J?"Generating...":"Generate Baseline"}),s.jsx(ie,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:()=>{ze({enabled:_.snapshotEval?.enabled??!1,mode:_.snapshotEval?.mode??"warn",baselineSnapshotId:void 0,baselineSourceRunId:void 0})},disabled:H,children:"Clear Baseline"})]})]})]})}),s.jsxs(oC,{value:oe,onValueChange:W=>{if(W!=="servers"&&W!=="agents"&&W!=="scenarios")return;const ve=new URLSearchParams(r);if(ve.delete("tab"),a(ve,{replace:!0}),e&&e!=="new"){n(`/mcp-evaluations/${encodeURIComponent(e)}/${W}`,{replace:!0});return}n(`/mcp-evaluations/${e??"new"}/${W}`,{replace:!0})},className:"space-y-4",children:[s.jsxs(Wv,{children:[s.jsxs(Ti,{value:"scenarios",className:"gap-1.5",children:[s.jsx(uE,{className:"h-3.5 w-3.5"}),"Scenarios"]}),s.jsxs(Ti,{value:"agents",className:"gap-1.5",children:[s.jsx(ya,{className:"h-3.5 w-3.5"}),"Agents"]})]}),s.jsxs(Gd,{value:"agents",children:[!ye&&s.jsx(We,{className:"mb-4",children:s.jsxs(Ve,{className:"pt-4 space-y-3",children:[s.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",children:[s.jsxs(sn,{value:F,onValueChange:$,children:[s.jsx(Zt,{className:"h-8",children:s.jsx(on,{placeholder:"Select agent from library"})}),s.jsx(en,{children:he.map(W=>s.jsx(it,{value:W.id,children:W.label},W.id))})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ie,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!F,onClick:Ht,children:"Add Ref"}),s.jsx(ie,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!F,onClick:$t,children:"Import Inline"}),s.jsx(ie,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:y.length===0||y.every(W=>Ae.some(ve=>ve.kind==="referenced"&&ve.ref===W.id)),onClick:zt,children:"Add All Refs"}),s.jsx(ie,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:Rt,children:"Add agent"})]})]}),s.jsxs("div",{className:"space-y-2",children:[Ae.map((W,ve)=>{const Be=W.kind==="referenced"?Kt(W.ref):null,ut=W.kind==="inline"?W.agent.name?.trim()||W.agent.id:Be?.name||W.ref,_t=W.kind==="inline"?W.agent.model:Be?.model||"unknown",At=W.kind==="inline"?W.agent.id:W.ref,yn=W.kind==="referenced"&&!Be,Ge=W.kind==="inline"?W.agent.id:W.ref,hn=Se.includes(Ge),Tn=W.kind==="inline"&&!!ee[W.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(ie,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>kn(ve,-1),disabled:ve===0,"aria-label":"Move agent up",children:s.jsx(cs,{className:"h-3 w-3"})}),s.jsx(ie,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>kn(ve,1),disabled:ve===Ae.length-1,"aria-label":"Move agent down",children:s.jsx(Wt,{className:"h-3 w-3"})})]}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[ve+1,"."]}),s.jsx("span",{className:"truncate font-medium",children:ut}),s.jsx(Je,{variant:W.kind==="inline"?"secondary":"outline",children:W.kind==="inline"?"Inline":"Referenced"}),s.jsx(Je,{variant:"outline",className:"font-mono text-[10px]",children:_t}),hn&&s.jsx(Je,{variant:"outline",className:"text-xs border-emerald-300 text-emerald-700 bg-emerald-50",children:"Default"}),yn&&s.jsx(Je,{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:hn,onChange:Ut=>Fe(Ge,Ut.target.checked)}),s.jsx("span",{children:"Default"})]}),W.kind==="inline"&&s.jsx(ie,{type:"button",size:"sm",variant:"outline",onClick:()=>ae(Ut=>({...Ut,[W.agent.id]:!Ut[W.agent.id]})),children:Tn?"Collapse":"Expand"}),W.kind==="referenced"&&s.jsx(s.Fragment,{children:s.jsx(ie,{type:"button",size:"sm",variant:"outline",onClick:()=>lr(ve),disabled:yn,children:"Convert to inline"})}),s.jsx(ie,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>Rn(ve),"aria-label":"Remove agent entry",children:s.jsx(Na,{className:"h-3.5 w-3.5"})})]})]}),W.kind==="inline"&&Tn&&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(Me,{className:"text-xs",children:"Name"}),s.jsx(vt,{value:W.agent.name,onChange:Ut=>{const An=[...Ae];An[ve]={kind:"inline",agent:{...W.agent,name:Ut.target.value}},Ye(An)},placeholder:"e.g. GPT-5 Mini custom"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{className:"text-xs",children:"Provider"}),s.jsxs(sn,{value:W.agent.provider,onValueChange:Ut=>{const An=[...Ae];An[ve]={kind:"inline",agent:{...W.agent,provider:Ut}},Ye(An)},children:[s.jsx(Zt,{children:s.jsx(on,{})}),s.jsxs(en,{children:[s.jsx(it,{value:"openai",children:"OpenAI"}),s.jsx(it,{value:"anthropic",children:"Anthropic"}),s.jsx(it,{value:"azure",children:"Azure OpenAI"}),s.jsx(it,{value:"google",children:"Google"}),s.jsx(it,{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(Me,{className:"text-xs",children:"Model"}),s.jsx(vt,{value:W.agent.model,onChange:Ut=>{const An=[...Ae];An[ve]={kind:"inline",agent:{...W.agent,model:Ut.target.value}},Ye(An)},className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{className:"text-xs",children:"Max Tokens"}),s.jsx(vt,{type:"number",min:1,max:128e3,value:W.agent.maxTokens,onChange:Ut=>{const An=[...Ae];An[ve]={kind:"inline",agent:{...W.agent,maxTokens:parseInt(Ut.target.value)||0}},Ye(An)},className:"font-mono text-xs"})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{className:"text-xs",children:"Temperature"}),s.jsx(vt,{type:"number",min:0,max:2,step:.01,value:W.agent.temperature,onChange:Ut=>{const An=[...Ae];An[ve]={kind:"inline",agent:{...W.agent,temperature:Number(Ut.target.value)||0}},Ye(An)},className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{className:"text-xs",children:"System Prompt"}),s.jsx(Ua,{value:W.agent.systemPrompt||"",onChange:Ut=>{const An=[...Ae];An[ve]={kind:"inline",agent:{...W.agent,systemPrompt:Ut.target.value}},Ye(An)},rows:3,className:"text-xs"})]})]})]},`agent-entry-${ve}-${At}`)}),Ae.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents configured yet. Add inline agents or references."})]}),Br.length>0&&s.jsxs("p",{className:"text-xs text-destructive",children:["Missing agent refs: ",Br.join(", ")]})]})}),ye?s.jsx(We,{children:s.jsx(Ve,{className:"pt-4",children:s.jsxs("div",{className:"space-y-2",children:[Dt.map((W,ve)=>{const Be=W.agent.name||W.agent.id,ut=Se.includes(W.origin==="inline"?W.agent.id:W.ref||W.agent.id),_t=W.ref??W.agent.id,At=!!K[_t];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:[ve+1,"."]}),s.jsx("div",{className:"truncate font-medium text-sm",children:Be})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[ut&&s.jsx(Je,{variant:"outline",className:"text-xs border-emerald-300 text-emerald-700 bg-emerald-50",children:"Default"}),s.jsx(Je,{variant:W.origin==="inline"?"secondary":"outline",children:W.origin==="inline"?"Inline":"Referenced"}),s.jsx(ie,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8",onClick:()=>le(yn=>({...yn,[_t]:!yn[_t]})),"aria-label":At?"Collapse agent details":"Expand agent details",children:s.jsx(Wt,{className:`h-4 w-4 transition-transform ${At?"rotate-180":""}`})})]})]}),At&&s.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 border-t pt-2",children:[s.jsx(lB,{provider:W.agent.provider}),s.jsx(Je,{variant:"outline",className:"text-xs font-mono",children:W.agent.model}),s.jsxs(Je,{variant:"outline",className:"text-xs font-mono",children:["max_tokens: ",W.agent.maxTokens]}),s.jsxs(Je,{variant:"outline",className:"text-xs font-mono",children:["temperature: ",W.agent.temperature]})]})]},`agent-view-${ve}-${W.ref??W.agent.id}`)}),Dt.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No agents configured."})]})})}):null]}),s.jsxs(Gd,{value:"scenarios",children:[!ye&&s.jsx(We,{className:"mb-4",children:s.jsxs(Ve,{className:"pt-4 space-y-3",children:[s.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",children:[s.jsxs(sn,{value:D,onValueChange:X,children:[s.jsx(Zt,{className:"h-8",children:s.jsx(on,{placeholder:"Select scenario from library"})}),s.jsx(en,{children:[...g].sort((W,ve)=>(W.name||W.id).localeCompare(ve.name||ve.id)).map(W=>s.jsx(it,{value:W.id,children:W.name||W.id},W.id))})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ie,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!D,onClick:ur,children:"Add Ref"}),s.jsx(ie,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!D,onClick:cr,children:"Import Inline"}),s.jsx(ie,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:Ln,children:"Add scenario"})]})]}),s.jsxs("div",{className:"space-y-2",children:[se.map((W,ve)=>{const Be=W.kind==="referenced"?_n(W.ref):null,ut=W.kind==="inline"?W.scenario.name?.trim()||W.scenario.id:Be?.name||W.ref,_t=W.kind==="inline"&&!W.scenario.name?.trim(),At=W.kind==="referenced"&&gn.has(W.ref),yn=W.kind==="inline"&&!!te[W.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(ie,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>Lr(ve,-1),disabled:ve===0,"aria-label":"Move scenario up",children:s.jsx(cs,{className:"h-3 w-3"})}),s.jsx(ie,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>Lr(ve,1),disabled:ve===se.length-1,"aria-label":"Move scenario down",children:s.jsx(Wt,{className:"h-3 w-3"})})]}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[ve+1,"."]}),s.jsx("span",{className:"truncate font-medium",children:ut}),s.jsx(Je,{variant:W.kind==="inline"?"secondary":"outline",children:W.kind==="inline"?"Inline":"Referenced"}),_t&&s.jsx(Je,{variant:"destructive",children:"Name required"}),At&&s.jsx(Je,{variant:"destructive",children:"Missing"})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[W.kind==="inline"&&s.jsx(ie,{type:"button",size:"icon",variant:"outline",className:"h-7 w-7",onClick:()=>de(Ge=>({...Ge,[W.scenario.id]:!Ge[W.scenario.id]})),"aria-label":yn?"Collapse scenario details":"Expand scenario details",children:s.jsx(Wt,{className:`h-3.5 w-3.5 transition-transform ${yn?"rotate-180":""}`})}),W.kind==="referenced"&&s.jsx(s.Fragment,{children:s.jsx(ie,{type:"button",size:"sm",variant:"outline",onClick:()=>Fr(ve),disabled:At,children:"Convert to inline"})}),s.jsx(ie,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>_r(ve),"aria-label":"Remove scenario entry",children:s.jsx(Na,{className:"h-3.5 w-3.5"})})]})]}),W.kind==="inline"&&yn&&s.jsx("div",{className:"border-t px-3 py-3",children:s.jsx(hS,{scenarios:[W.scenario],scenarioOrigins:["inline"],agents:[..._.agents,...yt],servers:[..._.servers??[],...ke],configId:_.id,configPath:_.sourcePath,defaultAssistantAgentName:_.runDefaults?.selectedAgentNames?.[0],snapshotEval:_.snapshotEval,onChange:Ge=>{const hn=Ge[0];if(!hn)return;const Tn=[...se];Tn[ve]={kind:"inline",scenario:hn},$e(Tn)},readOnly:!1,allowAdd:!1,allowStructureEdits:!1})})]},`scenario-entry-${ve}-${W.kind==="inline"?W.scenario.id:W.ref}`)}),se.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No scenarios configured yet. Add inline scenarios or references."})]}),zr.length>0&&s.jsxs("p",{className:"text-xs text-destructive",children:["Missing scenario refs: ",zr.join(", ")]})]})}),ye?s.jsx(We,{children:s.jsx(Ve,{className:"pt-4",children:s.jsx(hS,{scenarios:cn.map(W=>W.scenario),scenarioOrigins:cn.map(W=>W.origin),agents:dr,servers:Sn,configId:_.id,configPath:_.sourcePath,defaultAssistantAgentName:_.runDefaults?.selectedAgentNames?.[0],snapshotEval:_.snapshotEval,onChange:()=>{},readOnly:!0})})}):null]})]})]})};var eme=Symbol("radix.slottable");function tme(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=eme,t}var m8="AlertDialog",[nme]=or(m8,[TD]),ni=TD(),v8=e=>{const{__scopeAlertDialog:t,...n}=e,r=ni(t);return s.jsx(Xm,{...r,...n,modal:!0})};v8.displayName=m8;var rme="AlertDialogTrigger",ame=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ni(n);return s.jsx(UK,{...a,...r,ref:t})});ame.displayName=rme;var sme="AlertDialogPortal",g8=e=>{const{__scopeAlertDialog:t,...n}=e,r=ni(t);return s.jsx(Qm,{...r,...n})};g8.displayName=sme;var ime="AlertDialogOverlay",y8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ni(n);return s.jsx(Ic,{...a,...r,ref:t})});y8.displayName=ime;var Wl="AlertDialogContent",[ome,lme]=nme(Wl),cme=tme("AlertDialogContent"),x8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...a}=e,i=ni(n),o=v.useRef(null),c=pt(t,o),d=v.useRef(null);return s.jsx(LK,{contentName:Wl,titleName:b8,docsSlug:"alert-dialog",children:s.jsx(ome,{scope:n,cancelRef:d,children:s.jsxs(Mc,{role:"alertdialog",...i,...a,ref:c,onOpenAutoFocus:Ee(a.onOpenAutoFocus,f=>{f.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[s.jsx(cme,{children:r}),s.jsx(dme,{contentRef:o})]})})})});x8.displayName=Wl;var b8="AlertDialogTitle",w8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ni(n);return s.jsx(rf,{...a,...r,ref:t})});w8.displayName=b8;var j8="AlertDialogDescription",S8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ni(n);return s.jsx(af,{...a,...r,ref:t})});S8.displayName=j8;var ume="AlertDialogAction",N8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ni(n);return s.jsx(Jm,{...a,...r,ref:t})});N8.displayName=ume;var C8="AlertDialogCancel",_8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=lme(C8,n),i=ni(n),o=pt(t,a);return s.jsx(Jm,{...i,...r,ref:o})});_8.displayName=C8;var dme=({contentRef:e})=>{const t=`\`${Wl}\` requires a description for the component to be accessible for screen reader users.
125
+
126
+ You can add a description to the \`${Wl}\` by passing a \`${j8}\` 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 \`${Wl}\`. 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},fme=v8,pme=g8,A8=y8,E8=x8,P8=N8,O8=_8,R8=w8,k8=S8;const Ss=fme,hme=pme,T8=v.forwardRef(({className:e,...t},n)=>s.jsx(A8,{className:be("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}));T8.displayName=A8.displayName;const Ga=v.forwardRef(({className:e,...t},n)=>s.jsxs(hme,{children:[s.jsx(T8,{}),s.jsx(E8,{ref:n,className:be("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})]}));Ga.displayName=E8.displayName;const Ya=({className:e,...t})=>s.jsx("div",{className:be("flex flex-col space-y-2 text-center sm:text-left",e),...t});Ya.displayName="AlertDialogHeader";const Xa=({className:e,...t})=>s.jsx("div",{className:be("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Xa.displayName="AlertDialogFooter";const Qa=v.forwardRef(({className:e,...t},n)=>s.jsx(R8,{ref:n,className:be("text-lg font-semibold",e),...t}));Qa.displayName=R8.displayName;const Ja=v.forwardRef(({className:e,...t},n)=>s.jsx(k8,{ref:n,className:be("text-sm text-muted-foreground",e),...t}));Ja.displayName=k8.displayName;const Za=v.forwardRef(({className:e,...t},n)=>s.jsx(P8,{ref:n,className:be(KS(),e),...t}));Za.displayName=P8.displayName;const es=v.forwardRef(({className:e,...t},n)=>s.jsx(O8,{ref:n,className:be(KS({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));es.displayName=O8.displayName;const mme=()=>{const{servers:e,setServers:t,reload:n,loading:r}=Ha(),a=_a(),[i,o]=v.useState(null),c=p=>p.name?.trim()||p.id,d=async p=>{const y=`${c(p)}-copy`;let g=y,j=1;for(;e.some(x=>(x.name?.trim()||x.id)===g);)g=`${y}-${j}`,j+=1;const b={...structuredClone(p),id:`srv-${Date.now()}`,name:g};await t([...e,b]),_e({title:"Server duplicated",description:`Created ${g}.`})},f=async p=>{await t(e.filter(y=>y.id!==p.id)),_e({title:"Server deleted",description:`${c(p)} was removed.`}),o(null)},h=p=>p.transport==="stdio"?[p.command,...p.args||[]].filter(Boolean).join(" "):p.url||"";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"}),"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.jsxs(ie,{type:"button",size:"sm",variant:"outline",onClick:()=>{n()},disabled:r,children:[s.jsx(Sa,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(ie,{type:"button",size:"sm",onClick:()=>a("/libraries/servers/new"),children:[s.jsx(ps,{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(ie,{type:"button",size:"sm",className:"mt-4",onClick:()=>a("/libraries/servers/new"),children:[s.jsx(ps,{className:"mr-2 h-4 w-4"}),"Add Server"]})]}):s.jsx(We,{children:s.jsx(Ve,{className:"p-0",children:s.jsxs(Zr,{children:[s.jsx(ea,{children:s.jsxs(Bt,{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(ta,{children:e.map(p=>s.jsxs(Bt,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>a(`/libraries/servers/${encodeURIComponent(p.id)}`),children:[s.jsx(Ke,{className:"font-medium",children:c(p)}),s.jsx(Ke,{children:s.jsx(Je,{variant:"secondary",className:"font-mono text-xs",children:p.transport})}),s.jsx(Ke,{children:s.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:h(p)})}),s.jsx(Ke,{children:!p.authType||p.authType==="none"?s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"}):s.jsx(Je,{variant:"outline",className:"text-xs",children:p.authType})}),s.jsx(Ke,{className:"text-right",onClick:y=>y.stopPropagation(),children:s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsxs(ie,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>o(p),children:[s.jsx(Na,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(ie,{type:"button",size:"sm",variant:"outline",onClick:()=>{d(p)},children:[s.jsx(Mi,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsxs(ie,{type:"button",size:"sm",variant:"outline",onClick:()=>a(`/libraries/servers/${encodeURIComponent(p.id)}`),children:[s.jsx(Em,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})]})})]},p.id))})]})})}),s.jsx(Ss,{open:!!i,onOpenChange:p=>!p&&o(null),children:s.jsxs(Ga,{children:[s.jsxs(Ya,{children:[s.jsx(Qa,{children:"Delete server?"}),s.jsxs(Ja,{children:["This will permanently remove"," ",s.jsx("span",{className:"font-mono",children:i?c(i):""})," from the library. This action cannot be undone."]})]}),s.jsxs(Xa,{children:[s.jsx(es,{children:"Cancel"}),s.jsx(Za,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{i&&f(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"},vme=()=>({id:`srv-${Date.now()}`,name:"",transport:"stdio",authType:"none",oauthRedirectUrl:"http://localhost:6274/oauth/"}),gme=()=>{const{serverId:e}=Do(),t=_a(),{servers:n,setServers:r}=Ha(),{source:a}=On(),i=e==="new",o=e?decodeURIComponent(e):"",c=i?null:n.find(k=>k.id===o||k.name===o),d=k=>k.name?.trim()||k.id,[f,h]=v.useState(()=>c??vme()),[p,y]=v.useState(!1),[g,j]=v.useState(!1),[b,x]=v.useState({status:"idle"}),[S,N]=v.useState(!1);v.useEffect(()=>{c&&h(c)},[c]);const _=k=>{h(M=>({...M,authType:k,...k!=="oauth2"?{oauthClientId:void 0,oauthClientSecret:void 0,oauthRedirectUrl:void 0,oauthScope:void 0}:{oauthRedirectUrl:M.oauthRedirectUrl||"http://localhost:6274/oauth/"}}))},P=async()=>{N(!0),x({status:"loading"});try{const M=(await a.discoverToolsForAnalysis({serverNames:[f.id]})).servers[0];M&&M.warnings.length===0?x({status:"success",toolNames:M.tools.map(z=>z.name),toolCount:M.tools.length,testedAt:new Date().toISOString()}):x({status:"error",message:M?.warnings[0]??"Connection failed",testedAt:new Date().toISOString()})}catch(k){x({status:"error",message:k instanceof Error?k.message:String(k),testedAt:new Date().toISOString()})}},A=async()=>{if(!f.name.trim()){_e({title:"Name is required",variant:"destructive"});return}j(!0);try{if(i)await r([...n,f]),_e({title:"Server created"}),t(`/libraries/servers/${encodeURIComponent(f.id)}`);else{const k=n.map(M=>M.id===c?.id?f:M);await r(k),_e({title:"Server saved"}),f.id!==o&&t(`/libraries/servers/${encodeURIComponent(f.id)}`,{replace:!0})}}finally{j(!1)}},O=async()=>{const k=n.filter(M=>M.id!==c?.id);await r(k),_e({title:"Server deleted"}),t("/libraries/servers")},R=()=>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(xt,{to:"/libraries/servers",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(jo,{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(xt,{to:"/libraries/servers",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(jo,{className:"h-4 w-4"})," Servers"]}),s.jsx("h1",{className:"text-2xl font-bold",children:i?"New Server":d(f)})]}),!i&&s.jsxs(ie,{type:"button",onClick:()=>{P()},children:[s.jsx(p$,{className:"mr-2 h-4 w-4"}),"Test Connection"]})]}),S&&s.jsxs(We,{children:[s.jsxs(Nt,{className:"flex-row items-center justify-between space-y-0",children:[s.jsx(Ct,{className:"text-base",children:"Connection Test"}),s.jsx("button",{type:"button",onClick:()=>N(!1),className:"rounded-sm opacity-70 hover:opacity-100",children:s.jsx(Vs,{className:"h-4 w-4"})})]}),s.jsxs(Ve,{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}),R()&&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:R()})]})]}),b.status==="loading"&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(ir,{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(Gl,{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(k=>s.jsx("li",{className:"font-mono text-xs",children:k},k))})]}),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(We,{children:[s.jsx(Nt,{children:s.jsx(Ct,{className:"text-base",children:"Configuration"})}),s.jsxs(Ve,{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(Me,{children:"Name"}),s.jsx(vt,{value:f.name,onChange:k=>h(M=>({...M,name:k.target.value})),placeholder:"e.g. Filesystem MCP"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{children:"Transport"}),s.jsxs(sn,{value:f.transport,onValueChange:k=>h(M=>({...M,transport:k})),children:[s.jsx(Zt,{children:s.jsx(on,{})}),s.jsxs(en,{children:[s.jsx(it,{value:"stdio",children:"stdio"}),s.jsx(it,{value:"sse",children:"SSE"}),s.jsx(it,{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(Me,{children:"Command"}),s.jsx(vt,{value:f.command||"",onChange:k=>h(M=>({...M,command:k.target.value})),placeholder:"npx",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{children:"Args (comma-separated)"}),s.jsx(vt,{value:(f.args||[]).join(", "),onChange:k=>h(M=>({...M,args:k.target.value.split(",").map(z=>z.trim()).filter(Boolean)})),placeholder:"-y, @mcp/server",className:"font-mono text-xs"})]})]}):s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{children:"URL"}),s.jsx(vt,{value:f.url||"",onChange:k=>h(M=>({...M,url:k.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(Me,{children:"Auth Type"}),s.jsxs(sn,{value:f.authType||"none",onValueChange:k=>_(k),children:[s.jsx(Zt,{children:s.jsx(on,{})}),s.jsxs(en,{children:[s.jsx(it,{value:"none",children:"None"}),s.jsx(it,{value:"bearer",children:"Bearer Token"}),s.jsx(it,{value:"api-key",children:"API Key"}),s.jsx(it,{value:"oauth2",children:"OAuth 2.0"})]})]})]}),f.authType&&f.authType!=="none"&&f.authType!=="oauth2"&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{children:f.authType==="bearer"?"Token":"API Key"}),s.jsx(vt,{type:"password",value:f.authValue||"",onChange:k=>h(M=>({...M,authValue:k.target.value})),placeholder:"••••••••",className:"font-mono text-xs"})]})]}),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(Me,{className:"text-xs",children:"Client ID"}),s.jsx(vt,{value:f.oauthClientId||"",onChange:k=>h(M=>({...M,oauthClientId:k.target.value})),placeholder:"your-client-id",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{className:"text-xs",children:"Client Secret (optional)"}),s.jsx(vt,{type:"password",value:f.oauthClientSecret||"",onChange:k=>h(M=>({...M,oauthClientSecret:k.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(Me,{className:"text-xs",children:"Redirect URL"}),s.jsx(vt,{value:f.oauthRedirectUrl||"http://localhost:6274/oauth/",onChange:k=>h(M=>({...M,oauthRedirectUrl:k.target.value})),placeholder:"http://localhost:6274/oauth/",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{className:"text-xs",children:"Scope (space-separated)"}),s.jsx(vt,{value:f.oauthScope||"",onChange:k=>h(M=>({...M,oauthScope:k.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(ie,{type:"button",variant:"destructive",size:"sm",onClick:()=>y(!0),children:"Delete"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ie,{type:"button",variant:"outline",size:"sm",onClick:()=>t("/libraries/servers"),children:"Cancel"}),s.jsxs(ie,{type:"button",size:"sm",onClick:()=>{A()},disabled:g,children:[g&&s.jsx(ir,{className:"mr-2 h-4 w-4 animate-spin"}),i?"Create Server":"Save"]})]})]})]})]}),s.jsx(Ss,{open:p,onOpenChange:y,children:s.jsxs(Ga,{children:[s.jsxs(Ya,{children:[s.jsx(Qa,{children:"Delete server?"}),s.jsxs(Ja,{children:["This will permanently remove the server"," ",s.jsx("span",{className:"font-mono",children:f.name}),". This action cannot be undone."]})]}),s.jsxs(Xa,{children:[s.jsx(es,{children:"Cancel"}),s.jsx(Za,{onClick:()=>{O()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},yme=()=>{const{agents:e,setAgents:t,reload:n,loading:r}=Ha(),a=_a(),[i,o]=v.useState(null),c=async f=>{const h=`${f.name}-copy`;let p=h,y=1;for(;e.some(j=>j.name===p);)p=`${h}-${y}`,y+=1;const g={...structuredClone(f),id:`agt-${Date.now()}`,name:p};await t([...e,g]),_e({title:"Agent duplicated",description:`Created ${p}.`})},d=async f=>{await t(e.filter(h=>h.id!==f.id)),_e({title:"Agent deleted",description:`${f.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(ya,{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.jsxs(ie,{type:"button",size:"sm",variant:"outline",onClick:()=>{n()},disabled:r,children:[s.jsx(Sa,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(ie,{type:"button",size:"sm",onClick:()=>a("/libraries/agents/new"),children:[s.jsx(ps,{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(ie,{type:"button",size:"sm",className:"mt-4",onClick:()=>a("/libraries/agents/new"),children:[s.jsx(ps,{className:"mr-2 h-4 w-4"}),"Add Agent"]})]}):s.jsx(We,{children:s.jsx(Ve,{className:"p-0",children:s.jsxs(Zr,{children:[s.jsx(ea,{children:s.jsxs(Bt,{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(ta,{children:e.map(f=>s.jsxs(Bt,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>a(`/libraries/agents/${encodeURIComponent(f.id)}`),children:[s.jsx(Ke,{className:"font-medium",children:f.name}),s.jsx(Ke,{children:s.jsx(lB,{provider:f.provider})}),s.jsx(Ke,{children:s.jsx("span",{className:"font-mono text-xs",children:f.model})}),s.jsx(Ke,{className:"font-mono text-xs",children:f.maxTokens}),s.jsx(Ke,{className:"font-mono text-xs",children:f.temperature.toFixed(2)}),s.jsx(Ke,{className:"text-right",onClick:h=>h.stopPropagation(),children:s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsxs(ie,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>o(f),children:[s.jsx(Na,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(ie,{type:"button",size:"sm",variant:"outline",onClick:()=>{c(f)},children:[s.jsx(Mi,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsxs(ie,{type:"button",size:"sm",variant:"outline",onClick:()=>a(`/libraries/agents/${encodeURIComponent(f.id)}`),children:[s.jsx(Em,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})]})})]},f.id))})]})})}),s.jsx(Ss,{open:!!i,onOpenChange:f=>!f&&o(null),children:s.jsxs(Ga,{children:[s.jsxs(Ya,{children:[s.jsx(Qa,{children:"Delete agent?"}),s.jsxs(Ja,{children:["This will permanently remove"," ",s.jsx("span",{className:"font-mono",children:i?.name})," from the library. This action cannot be undone."]})]}),s.jsxs(Xa,{children:[s.jsx(es,{children:"Cancel"}),s.jsx(Za,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{i&&d(i)},children:"Delete Agent"})]})]})})]})};var I8=["PageUp","PageDown"],M8=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],$8={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Kc="Slider",[mS,xme,bme]=Xd(Kc),[D8]=or(Kc,[bme]),[wme,Qv]=D8(Kc),L8=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:y=()=>{},inverted:g=!1,form:j,...b}=e,x=v.useRef(new Set),S=v.useRef(0),_=o==="horizontal"?jme:Sme,[P=[],A]=sa({prop:h,defaultProp:f,onChange:B=>{[...x.current][S.current]?.focus(),p(B)}}),O=v.useRef(P);function R(B){const L=Eme(P,B);z(B,L)}function k(B){z(B,S.current)}function M(){const B=O.current[S.current];P[S.current]!==B&&y(P)}function z(B,L,{commit:G}={commit:!1}){const U=kme(i),H=Tme(Math.round((B-r)/i)*i+r,U),Q=Yd(H,[r,a]);A((J=[])=>{const T=_me(J,Q,L);if(Rme(T,d*i)){S.current=T.indexOf(Q);const D=String(T)!==String(J);return D&&G&&y(T),D?T:J}else return J})}return s.jsx(wme,{scope:e.__scopeSlider,name:n,disabled:c,min:r,max:a,valueIndexToChangeRef:S,thumbs:x.current,values:P,orientation:o,form:j,children:s.jsx(mS.Provider,{scope:e.__scopeSlider,children:s.jsx(mS.Slot,{scope:e.__scopeSlider,children:s.jsx(_,{"aria-disabled":c,"data-disabled":c?"":void 0,...b,ref:t,onPointerDown:Ee(b.onPointerDown,()=>{c||(O.current=P)}),min:r,max:a,inverted:g,onSlideStart:c?void 0:R,onSlideMove:c?void 0:k,onSlideEnd:c?void 0:M,onHomeKeyDown:()=>!c&&z(r,0,{commit:!0}),onEndKeyDown:()=>!c&&z(a,P.length-1,{commit:!0}),onStepKeyDown:({event:B,direction:L})=>{if(!c){const H=I8.includes(B.key)||B.shiftKey&&M8.includes(B.key)?10:1,Q=S.current,J=P[Q],T=i*H*L;z(J+T,Q,{commit:!0})}}})})})})});L8.displayName=Kc;var[F8,B8]=D8(Kc,{startEdge:"left",endEdge:"right",size:"width",direction:1}),jme=v.forwardRef((e,t)=>{const{min:n,max:r,dir:a,inverted:i,onSlideStart:o,onSlideMove:c,onSlideEnd:d,onStepKeyDown:f,...h}=e,[p,y]=v.useState(null),g=pt(t,_=>y(_)),j=v.useRef(void 0),b=qc(a),x=b==="ltr",S=x&&!i||!x&&i;function N(_){const P=j.current||p.getBoundingClientRect(),A=[0,P.width],R=vC(A,S?[n,r]:[r,n]);return j.current=P,R(_-P.left)}return s.jsx(F8,{scope:e.__scopeSlider,startEdge:S?"left":"right",endEdge:S?"right":"left",direction:S?1:-1,size:"width",children:s.jsx(z8,{dir:b,"data-orientation":"horizontal",...h,ref:g,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:_=>{const P=N(_.clientX);o?.(P)},onSlideMove:_=>{const P=N(_.clientX);c?.(P)},onSlideEnd:()=>{j.current=void 0,d?.()},onStepKeyDown:_=>{const A=$8[S?"from-left":"from-right"].includes(_.key);f?.({event:_,direction:A?-1:1})}})})}),Sme=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=pt(t,h),y=v.useRef(void 0),g=!a;function j(b){const x=y.current||h.current.getBoundingClientRect(),S=[0,x.height],_=vC(S,g?[r,n]:[n,r]);return y.current=x,_(b-x.top)}return s.jsx(F8,{scope:e.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:s.jsx(z8,{"data-orientation":"vertical",...f,ref:p,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:b=>{const x=j(b.clientY);i?.(x)},onSlideMove:b=>{const x=j(b.clientY);o?.(x)},onSlideEnd:()=>{y.current=void 0,c?.()},onStepKeyDown:b=>{const S=$8[g?"from-bottom":"from-top"].includes(b.key);d?.({event:b,direction:S?-1:1})}})})}),z8=v.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:a,onSlideEnd:i,onHomeKeyDown:o,onEndKeyDown:c,onStepKeyDown:d,...f}=e,h=Qv(Kc,n);return s.jsx(qe.span,{...f,ref:t,onKeyDown:Ee(e.onKeyDown,p=>{p.key==="Home"?(o(p),p.preventDefault()):p.key==="End"?(c(p),p.preventDefault()):I8.concat(M8).includes(p.key)&&(d(p),p.preventDefault())}),onPointerDown:Ee(e.onPointerDown,p=>{const y=p.target;y.setPointerCapture(p.pointerId),p.preventDefault(),h.thumbs.has(y)?y.focus():r(p)}),onPointerMove:Ee(e.onPointerMove,p=>{p.target.hasPointerCapture(p.pointerId)&&a(p)}),onPointerUp:Ee(e.onPointerUp,p=>{const y=p.target;y.hasPointerCapture(p.pointerId)&&(y.releasePointerCapture(p.pointerId),i(p))})})}),U8="SliderTrack",q8=v.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=Qv(U8,n);return s.jsx(qe.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...r,ref:t})});q8.displayName=U8;var vS="SliderRange",W8=v.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=Qv(vS,n),i=B8(vS,n),o=v.useRef(null),c=pt(t,o),d=a.values.length,f=a.values.map(y=>K8(y,a.min,a.max)),h=d>1?Math.min(...f):0,p=100-Math.max(...f);return s.jsx(qe.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,...r,ref:c,style:{...e.style,[i.startEdge]:h+"%",[i.endEdge]:p+"%"}})});W8.displayName=vS;var gS="SliderThumb",V8=v.forwardRef((e,t)=>{const n=xme(e.__scopeSlider),[r,a]=v.useState(null),i=pt(t,c=>a(c)),o=v.useMemo(()=>r?n().findIndex(c=>c.ref.current===r):-1,[n,r]);return s.jsx(Nme,{...e,ref:i,index:o})}),Nme=v.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:a,...i}=e,o=Qv(gS,n),c=B8(gS,n),[d,f]=v.useState(null),h=pt(t,N=>f(N)),p=d?o.form||!!d.closest("form"):!0,y=Tm(d),g=o.values[r],j=g===void 0?0:K8(g,o.min,o.max),b=Ame(r,o.values.length),x=y?.[c.size],S=x?Pme(x,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(mS.ItemSlot,{scope:e.__scopeSlider,children:s.jsx(qe.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:Ee(e.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),p&&s.jsx(H8,{name:a??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:g},r)]})});V8.displayName=gS;var Cme="RadioBubbleInput",H8=v.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const a=v.useRef(null),i=pt(a,r),o=zv(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(qe.input,{style:{display:"none"},...n,ref:i,defaultValue:t})});H8.displayName=Cme;function _me(e=[],t,n){const r=[...e];return r[n]=t,r.sort((a,i)=>a-i)}function K8(e,t,n){const i=100/(n-t)*(e-t);return Yd(i,[0,100])}function Ame(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Eme(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 Pme(e,t,n){const r=e/2,i=vC([0,50],[0,r]);return(r-i(t)*n)*n}function Ome(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Rme(e,t){if(t>0){const n=Ome(e);return Math.min(...n)>=t}return!0}function vC(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 kme(e){return(String(e).split(".")[1]||"").length}function Tme(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var G8=L8,Ime=q8,Mme=W8,$me=V8;const Y8=v.forwardRef(({className:e,...t},n)=>s.jsxs(G8,{ref:n,className:be("relative flex w-full touch-none select-none items-center",e),...t,children:[s.jsx(Ime,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:s.jsx(Mme,{className:"absolute h-full bg-primary"})}),s.jsx($me,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));Y8.displayName=G8.displayName;function Dme(e){const t=Lme(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(Bme);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 Lme(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=Ume(a),c=zme(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Nr(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 Fme=Symbol("radix.slottable");function Bme(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Fme}function zme(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 Ume(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 Jv="Popover",[X8]=or(Jv,[Fi]),wf=Fi(),[qme,Ki]=X8(Jv),Q8=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:o=!1}=e,c=wf(t),d=v.useRef(null),[f,h]=v.useState(!1),[p,y]=sa({prop:r,defaultProp:a??!1,onChange:i,caller:Jv});return s.jsx(Im,{...c,children:s.jsx(qme,{scope:t,contentId:Hn(),triggerRef:d,open:p,onOpenChange:y,onOpenToggle:v.useCallback(()=>y(g=>!g),[y]),hasCustomAnchor:f,onCustomAnchorAdd:v.useCallback(()=>h(!0),[]),onCustomAnchorRemove:v.useCallback(()=>h(!1),[]),modal:o,children:n})})};Q8.displayName=Jv;var J8="PopoverAnchor",Wme=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Ki(J8,n),i=wf(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:c}=a;return v.useEffect(()=>(o(),()=>c()),[o,c]),s.jsx(ef,{...i,...r,ref:t})});Wme.displayName=J8;var Z8="PopoverTrigger",ez=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Ki(Z8,n),i=wf(n),o=pt(t,a.triggerRef),c=s.jsx(qe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":sz(a.open),...r,ref:o,onClick:Ee(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:s.jsx(ef,{asChild:!0,...i,children:c})});ez.displayName=Z8;var gC="PopoverPortal",[Vme,Hme]=X8(gC,{forceMount:void 0}),tz=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=Ki(gC,t);return s.jsx(Vme,{scope:t,forceMount:n,children:s.jsx(Gn,{present:n||i.open,children:s.jsx(Ac,{asChild:!0,container:a,children:r})})})};tz.displayName=gC;var Cc="PopoverContent",nz=v.forwardRef((e,t)=>{const n=Hme(Cc,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,i=Ki(Cc,e.__scopePopover);return s.jsx(Gn,{present:r||i.open,children:i.modal?s.jsx(Gme,{...a,ref:t}):s.jsx(Yme,{...a,ref:t})})});nz.displayName=Cc;var Kme=Dme("PopoverContent.RemoveScroll"),Gme=v.forwardRef((e,t)=>{const n=Ki(Cc,e.__scopePopover),r=v.useRef(null),a=pt(t,r),i=v.useRef(!1);return v.useEffect(()=>{const o=r.current;if(o)return Gm(o)},[]),s.jsx(nf,{as:Kme,allowPinchZoom:!0,children:s.jsx(rz,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ee(e.onCloseAutoFocus,o=>{o.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Ee(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:Ee(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),Yme=v.forwardRef((e,t)=>{const n=Ki(Cc,e.__scopePopover),r=v.useRef(!1),a=v.useRef(!1);return s.jsx(rz,{...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()}})}),rz=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,y=Ki(Cc,n),g=wf(n);return Hm(),s.jsx(tf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(Mo,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:h,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>y.onOpenChange(!1),children:s.jsx(Mm,{"data-state":sz(y.open),role:"dialog",id:y.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)"}})})})}),az="PopoverClose",Xme=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Ki(az,n);return s.jsx(qe.button,{type:"button",...r,ref:t,onClick:Ee(e.onClick,()=>a.onOpenChange(!1))})});Xme.displayName=az;var Qme="PopoverArrow",Jme=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=wf(n);return s.jsx($m,{...a,...r,ref:t})});Jme.displayName=Qme;function sz(e){return e?"open":"closed"}var Zme=Q8,eve=ez,tve=tz,iz=nz;const nve=Zme,rve=eve,oz=v.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>s.jsx(tve,{children:s.jsx(iz,{ref:a,align:t,sideOffset:n,className:be("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})}));oz.displayName=iz.displayName;var iM=1,ave=.9,sve=.8,ive=.17,u1=.1,d1=.999,ove=.9999,lve=.99,cve=/[\\\/_+.#"@\[\(\{&]/,uve=/[\\\/_+.#"@\[\(\{&]/g,dve=/[\s-]/,lz=/[\s-]/g;function yS(e,t,n,r,a,i,o){if(i===t.length)return a===e.length?iM:lve;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,y,g,j;f>=0;)p=yS(e,t,n,r,f+1,i+1,o),p>h&&(f===a?p*=iM:cve.test(e.charAt(f-1))?(p*=sve,g=e.slice(a,f-1).match(uve),g&&a>0&&(p*=Math.pow(d1,g.length))):dve.test(e.charAt(f-1))?(p*=ave,j=e.slice(a,f-1).match(lz),j&&a>0&&(p*=Math.pow(d1,j.length))):(p*=ive,a>0&&(p*=Math.pow(d1,f-a))),e.charAt(f)!==t.charAt(i)&&(p*=ove)),(p<u1&&n.charAt(f-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(f-1)!==r.charAt(i))&&(y=yS(e,t,n,r,f+1,i+2,o),y*u1>p&&(p=y*u1)),p>h&&(h=p),f=n.indexOf(d,f+1);return o[c]=h,h}function oM(e){return e.toLowerCase().replace(lz," ")}function fve(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,yS(e,t,oM(e),oM(t),0,0,{})}var zu='[cmdk-group=""]',f1='[cmdk-group-items=""]',pve='[cmdk-group-heading=""]',cz='[cmdk-item=""]',lM=`${cz}:not([aria-disabled="true"])`,xS="cmdk-item-select",_l="data-value",hve=(e,t,n)=>fve(e,t,n),uz=v.createContext(void 0),jf=()=>v.useContext(uz),dz=v.createContext(void 0),yC=()=>v.useContext(dz),fz=v.createContext(void 0),pz=v.forwardRef((e,t)=>{let n=Al(()=>{var $,ee;return{search:"",value:(ee=($=e.value)!=null?$:e.defaultValue)!=null?ee:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Al(()=>new Set),a=Al(()=>new Map),i=Al(()=>new Map),o=Al(()=>new Set),c=hz(e),{label:d,children:f,value:h,onValueChange:p,filter:y,shouldFilter:g,loop:j,disablePointerSelection:b=!1,vimBindings:x=!0,...S}=e,N=Hn(),_=Hn(),P=Hn(),A=v.useRef(null),O=Cve();Io(()=>{if(h!==void 0){let $=h.trim();n.current.value=$,R.emit()}},[h]),Io(()=>{O(6,G)},[]);let R=v.useMemo(()=>({subscribe:$=>(o.current.add($),()=>o.current.delete($)),snapshot:()=>n.current,setState:($,ee,ae)=>{var K,le,te,de;if(!Object.is(n.current[$],ee)){if(n.current[$]=ee,$==="search")L(),z(),O(1,B);else if($==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let oe=document.getElementById(P);oe?oe.focus():(K=document.getElementById(N))==null||K.focus()}if(O(7,()=>{var oe;n.current.selectedItemId=(oe=U())==null?void 0:oe.id,R.emit()}),ae||O(5,G),((le=c.current)==null?void 0:le.value)!==void 0){let oe=ee??"";(de=(te=c.current).onValueChange)==null||de.call(te,oe);return}}R.emit()}},emit:()=>{o.current.forEach($=>$())}}),[]),k=v.useMemo(()=>({value:($,ee,ae)=>{var K;ee!==((K=i.current.get($))==null?void 0:K.value)&&(i.current.set($,{value:ee,keywords:ae}),n.current.filtered.items.set($,M(ee,ae)),O(2,()=>{z(),R.emit()}))},item:($,ee)=>(r.current.add($),ee&&(a.current.has(ee)?a.current.get(ee).add($):a.current.set(ee,new Set([$]))),O(3,()=>{L(),z(),n.current.value||B(),R.emit()}),()=>{i.current.delete($),r.current.delete($),n.current.filtered.items.delete($);let ae=U();O(4,()=>{L(),ae?.getAttribute("id")===$&&B(),R.emit()})}),group:$=>(a.current.has($)||a.current.set($,new Set),()=>{i.current.delete($),a.current.delete($)}),filter:()=>c.current.shouldFilter,label:d||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:N,inputId:P,labelId:_,listInnerRef:A}),[]);function M($,ee){var ae,K;let le=(K=(ae=c.current)==null?void 0:ae.filter)!=null?K:hve;return $?le($,n.current.search,ee):0}function z(){if(!n.current.search||c.current.shouldFilter===!1)return;let $=n.current.filtered.items,ee=[];n.current.filtered.groups.forEach(K=>{let le=a.current.get(K),te=0;le.forEach(de=>{let oe=$.get(de);te=Math.max(oe,te)}),ee.push([K,te])});let ae=A.current;H().sort((K,le)=>{var te,de;let oe=K.getAttribute("id"),pe=le.getAttribute("id");return((te=$.get(pe))!=null?te:0)-((de=$.get(oe))!=null?de:0)}).forEach(K=>{let le=K.closest(f1);le?le.appendChild(K.parentElement===le?K:K.closest(`${f1} > *`)):ae.appendChild(K.parentElement===ae?K:K.closest(`${f1} > *`))}),ee.sort((K,le)=>le[1]-K[1]).forEach(K=>{var le;let te=(le=A.current)==null?void 0:le.querySelector(`${zu}[${_l}="${encodeURIComponent(K[0])}"]`);te?.parentElement.appendChild(te)})}function B(){let $=H().find(ae=>ae.getAttribute("aria-disabled")!=="true"),ee=$?.getAttribute(_l);R.setState("value",ee||void 0)}function L(){var $,ee,ae,K;if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let le=0;for(let te of r.current){let de=(ee=($=i.current.get(te))==null?void 0:$.value)!=null?ee:"",oe=(K=(ae=i.current.get(te))==null?void 0:ae.keywords)!=null?K:[],pe=M(de,oe);n.current.filtered.items.set(te,pe),pe>0&&le++}for(let[te,de]of a.current)for(let oe of de)if(n.current.filtered.items.get(oe)>0){n.current.filtered.groups.add(te);break}n.current.filtered.count=le}function G(){var $,ee,ae;let K=U();K&&((($=K.parentElement)==null?void 0:$.firstChild)===K&&((ae=(ee=K.closest(zu))==null?void 0:ee.querySelector(pve))==null||ae.scrollIntoView({block:"nearest"})),K.scrollIntoView({block:"nearest"}))}function U(){var $;return($=A.current)==null?void 0:$.querySelector(`${cz}[aria-selected="true"]`)}function H(){var $;return Array.from((($=A.current)==null?void 0:$.querySelectorAll(lM))||[])}function Q($){let ee=H()[$];ee&&R.setState("value",ee.getAttribute(_l))}function J($){var ee;let ae=U(),K=H(),le=K.findIndex(de=>de===ae),te=K[le+$];(ee=c.current)!=null&&ee.loop&&(te=le+$<0?K[K.length-1]:le+$===K.length?K[0]:K[le+$]),te&&R.setState("value",te.getAttribute(_l))}function T($){let ee=U(),ae=ee?.closest(zu),K;for(;ae&&!K;)ae=$>0?Sve(ae,zu):Nve(ae,zu),K=ae?.querySelector(lM);K?R.setState("value",K.getAttribute(_l)):J($)}let D=()=>Q(H().length-1),X=$=>{$.preventDefault(),$.metaKey?D():$.altKey?T(1):J(1)},F=$=>{$.preventDefault(),$.metaKey?Q(0):$.altKey?T(-1):J(-1)};return v.createElement(qe.div,{ref:t,tabIndex:-1,...S,"cmdk-root":"",onKeyDown:$=>{var ee;(ee=S.onKeyDown)==null||ee.call(S,$);let ae=$.nativeEvent.isComposing||$.keyCode===229;if(!($.defaultPrevented||ae))switch($.key){case"n":case"j":{x&&$.ctrlKey&&X($);break}case"ArrowDown":{X($);break}case"p":case"k":{x&&$.ctrlKey&&F($);break}case"ArrowUp":{F($);break}case"Home":{$.preventDefault(),Q(0);break}case"End":{$.preventDefault(),D();break}case"Enter":{$.preventDefault();let K=U();if(K){let le=new Event(xS);K.dispatchEvent(le)}}}}},v.createElement("label",{"cmdk-label":"",htmlFor:k.inputId,id:k.labelId,style:Ave},d),Zv(e,$=>v.createElement(dz.Provider,{value:R},v.createElement(uz.Provider,{value:k},$))))}),mve=v.forwardRef((e,t)=>{var n,r;let a=Hn(),i=v.useRef(null),o=v.useContext(fz),c=jf(),d=hz(e),f=(r=(n=d.current)==null?void 0:n.forceMount)!=null?r:o?.forceMount;Io(()=>{if(!f)return c.item(a,o?.id)},[f]);let h=mz(a,i,[e.value,e.children,i],e.keywords),p=yC(),y=Li(O=>O.value&&O.value===h.current),g=Li(O=>f||c.filter()===!1?!0:O.search?O.filtered.items.get(a)>0:!0);v.useEffect(()=>{let O=i.current;if(!(!O||e.disabled))return O.addEventListener(xS,j),()=>O.removeEventListener(xS,j)},[g,e.onSelect,e.disabled]);function j(){var O,R;b(),(R=(O=d.current).onSelect)==null||R.call(O,h.current)}function b(){p.setState("value",h.current,!0)}if(!g)return null;let{disabled:x,value:S,onSelect:N,forceMount:_,keywords:P,...A}=e;return v.createElement(qe.div,{ref:Nr(i,t),...A,id:a,"cmdk-item":"",role:"option","aria-disabled":!!x,"aria-selected":!!y,"data-disabled":!!x,"data-selected":!!y,onPointerMove:x||c.getDisablePointerSelection()?void 0:b,onClick:x?void 0:j},e.children)}),vve=v.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...i}=e,o=Hn(),c=v.useRef(null),d=v.useRef(null),f=Hn(),h=jf(),p=Li(g=>a||h.filter()===!1?!0:g.search?g.filtered.groups.has(o):!0);Io(()=>h.group(o),[]),mz(o,c,[e.value,e.heading,d]);let y=v.useMemo(()=>({id:o,forceMount:a}),[a]);return v.createElement(qe.div,{ref:Nr(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),Zv(e,g=>v.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},v.createElement(fz.Provider,{value:y},g))))}),gve=v.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=v.useRef(null),i=Li(o=>!o.search);return!n&&!i?null:v.createElement(qe.div,{ref:Nr(a,t),...r,"cmdk-separator":"",role:"separator"})}),yve=v.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,i=yC(),o=Li(f=>f.search),c=Li(f=>f.selectedItemId),d=jf();return v.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),v.createElement(qe.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)}})}),xve=v.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,i=v.useRef(null),o=v.useRef(null),c=Li(f=>f.selectedItemId),d=jf();return v.useEffect(()=>{if(o.current&&i.current){let f=o.current,h=i.current,p,y=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let g=f.offsetHeight;h.style.setProperty("--cmdk-list-height",g.toFixed(1)+"px")})});return y.observe(f),()=>{cancelAnimationFrame(p),y.unobserve(f)}}},[]),v.createElement(qe.div,{ref:Nr(i,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:d.listId},Zv(e,f=>v.createElement("div",{ref:Nr(o,d.listInnerRef),"cmdk-list-sizer":""},f)))}),bve=v.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:i,container:o,...c}=e;return v.createElement(Xm,{open:n,onOpenChange:r},v.createElement(Qm,{container:o},v.createElement(Ic,{"cmdk-overlay":"",className:a}),v.createElement(Mc,{"aria-label":e.label,"cmdk-dialog":"",className:i},v.createElement(pz,{ref:t,...c}))))}),wve=v.forwardRef((e,t)=>Li(n=>n.filtered.count===0)?v.createElement(qe.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),jve=v.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...i}=e;return v.createElement(qe.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Zv(e,o=>v.createElement("div",{"aria-hidden":!0},o)))}),Dr=Object.assign(pz,{List:xve,Item:mve,Input:yve,Group:vve,Separator:gve,Dialog:bve,Empty:wve,Loading:jve});function Sve(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Nve(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function hz(e){let t=v.useRef(e);return Io(()=>{t.current=e}),t}var Io=typeof window>"u"?v.useEffect:v.useLayoutEffect;function Al(e){let t=v.useRef();return t.current===void 0&&(t.current=e()),t}function Li(e){let t=yC(),n=()=>e(t.snapshot());return v.useSyncExternalStore(t.subscribe,n,n)}function mz(e,t,n,r=[]){let a=v.useRef(),i=jf();return Io(()=>{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(_l,c),a.current=c}),a}var Cve=()=>{let[e,t]=v.useState(),n=Al(()=>new Map);return Io(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function _ve(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Zv({asChild:e,children:t},n){return e&&v.isValidElement(t)?v.cloneElement(_ve(t),{ref:t.ref},n(t.props.children)):n(t)}var Ave={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const vz=v.forwardRef(({className:e,...t},n)=>s.jsx(Dr,{ref:n,className:be("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));vz.displayName=Dr.displayName;const gz=v.forwardRef(({className:e,...t},n)=>s.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[s.jsx(ES,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),s.jsx(Dr.Input,{ref:n,className:be("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})]}));gz.displayName=Dr.Input.displayName;const yz=v.forwardRef(({className:e,...t},n)=>s.jsx(Dr.List,{ref:n,className:be("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));yz.displayName=Dr.List.displayName;const xz=v.forwardRef((e,t)=>s.jsx(Dr.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));xz.displayName=Dr.Empty.displayName;const bz=v.forwardRef(({className:e,...t},n)=>s.jsx(Dr.Group,{ref:n,className:be("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}));bz.displayName=Dr.Group.displayName;const Eve=v.forwardRef(({className:e,...t},n)=>s.jsx(Dr.Separator,{ref:n,className:be("-mx-1 h-px bg-border",e),...t}));Eve.displayName=Dr.Separator.displayName;const bS=v.forwardRef(({className:e,...t},n)=>s.jsx(Dr.Item,{ref:n,className:be("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}));bS.displayName=Dr.Item.displayName;const cM={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:[]},uM={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"},Pve=()=>({id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096}),Ove=()=>{const{agentName:e}=Do(),t=_a(),{agents:n,setAgents:r}=Ha(),{source:a}=On(),i=e==="new",o=e?decodeURIComponent(e):"",c=i?null:n.find(T=>T.id===o)??n.find(T=>T.name===o),[d,f]=v.useState(()=>c??Pve()),[h,p]=v.useState(!1),[y,g]=v.useState(!1),[j,b]=v.useState({status:"idle"}),[x,S]=v.useState(!1),[N,_]=v.useState([]),[P,A]=v.useState(!1),[O,R]=v.useState(!1),[k,M]=v.useState(!1);v.useEffect(()=>{c&&f(c)},[c]);const z=d.provider==="anthropic"||d.provider==="openai"||d.provider==="azure",B=Array.from(new Set([...cM[d.provider]||[],...N])),L=B.includes(d.model),G=k||!!d.model&&!L,U=async()=>{if(S(!0),d.provider==="google"||d.provider==="custom"){b({status:"unsupported"});return}b({status:"loading"});try{const T=await a.listProviderModels(d.provider);b({status:"success",items:T.items,source:T.source,kind:T.kind,testedAt:new Date().toISOString()})}catch(T){b({status:"error",message:T instanceof Error?T.message:String(T),testedAt:new Date().toISOString()})}},H=async()=>{if(!z){_e({title:"Provider discovery not supported",description:"Model discovery is available for Anthropic, OpenAI, and Azure OpenAI."});return}A(!0);try{const T=await a.listProviderModels(d.provider);_(T.items),_e({title:T.kind==="deployments"?"Deployments loaded":"Models loaded",description:`${T.items.length} ${T.kind} from ${T.source}`})}catch(T){_e({title:"Could not load provider models",description:String(T instanceof Error?T.message:T),variant:"destructive"})}finally{A(!1)}},Q=async()=>{if(!d.name.trim()){_e({title:"Name is required",variant:"destructive"});return}g(!0);try{if(i)await r([...n,d]),_e({title:"Agent created"}),t(`/libraries/agents/${encodeURIComponent(d.id)}`);else{const T=n.map(D=>D.id===c?.id?d:D);await r(T),_e({title:"Agent saved"}),d.id!==o&&t(`/libraries/agents/${encodeURIComponent(d.id)}`,{replace:!0})}}finally{g(!1)}},J=async()=>{const T=n.filter(D=>D.id!==c?.id);await r(T),_e({title:"Agent deleted"}),t("/libraries/agents")};return!i&&!c?s.jsxs("div",{className:"space-y-4",children:[s.jsxs(xt,{to:"/libraries/agents",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(jo,{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(xt,{to:"/libraries/agents",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(jo,{className:"h-4 w-4"})," Agents"]}),s.jsx("h1",{className:"text-2xl font-bold",children:i?"New Agent":d.name})]}),!i&&s.jsxs(ie,{type:"button",onClick:()=>{U()},children:[s.jsx(p$,{className:"mr-2 h-4 w-4"}),"Test Connection"]})]}),x&&s.jsxs(We,{children:[s.jsxs(Nt,{className:"flex-row items-center justify-between space-y-0",children:[s.jsx(Ct,{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(Vs,{className:"h-4 w-4"})})]}),s.jsxs(Ve,{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(ir,{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(Gl,{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(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(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]}),uM[d.provider]&&s.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:["Hint: ",uM[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(We,{children:[s.jsx(Nt,{children:s.jsx(Ct,{className:"text-base",children:"Configuration"})}),s.jsxs(Ve,{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(Me,{children:"Name"}),s.jsx(vt,{value:d.name,onChange:T=>f(D=>({...D,name:T.target.value})),placeholder:"e.g. GPT-4o"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{children:"Provider"}),s.jsxs(sn,{value:d.provider,onValueChange:T=>f(D=>({...D,provider:T,model:cM[T]?.[0]||""})),children:[s.jsx(Zt,{children:s.jsx(on,{})}),s.jsxs(en,{children:[s.jsx(it,{value:"openai",children:"OpenAI"}),s.jsx(it,{value:"anthropic",children:"Anthropic"}),s.jsx(it,{value:"azure",children:"Azure OpenAI"}),s.jsx(it,{value:"google",children:"Google"}),s.jsx(it,{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(Me,{children:d.provider==="azure"?"Deployment":"Model"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(nve,{open:O,onOpenChange:R,children:[s.jsx(rve,{asChild:!0,children:s.jsxs(ie,{type:"button",variant:"outline",role:"combobox","aria-expanded":O,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(Wt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(oz,{className:"w-[420px] p-0",align:"start",children:s.jsxs(vz,{children:[s.jsx(gz,{placeholder:`Search ${d.provider==="azure"?"deployments":"models"}...`}),s.jsxs(yz,{children:[s.jsxs(xz,{children:["No ",d.provider==="azure"?"deployments":"models"," found."]}),s.jsxs(bz,{heading:d.provider==="azure"?"Deployments":"Models",children:[B.map(T=>s.jsxs(bS,{value:T,onSelect:D=>{f(X=>({...X,model:D})),M(!1),R(!1)},children:[s.jsx(Gl,{className:be("mr-2 h-4 w-4",d.model===T?"opacity-100":"opacity-0")}),s.jsx("span",{className:"font-mono text-xs",children:T})]},T)),s.jsx(bS,{value:"__custom_model_id__",onSelect:()=>{M(!0),R(!1)},children:s.jsx("span",{className:"font-medium",children:d.provider==="azure"?"Custom deployment ID...":"Custom model ID..."})})]})]})]})})]}),z&&s.jsxs(ie,{type:"button",variant:"outline",size:"sm",className:"h-9 shrink-0 text-xs",onClick:()=>{H()},disabled:P,title:d.provider==="azure"?"Fetch Azure OpenAI deployments":`Fetch ${d.provider} models`,children:[P?s.jsx(ir,{className:"mr-1 h-3 w-3 animate-spin"}):s.jsx(Sa,{className:"mr-1 h-3 w-3"}),d.provider==="azure"?"Fetch Deployments":"Fetch Models"]})]}),G&&s.jsx(vt,{value:d.model,onChange:T=>f(D=>({...D,model:T.target.value})),placeholder:d.provider==="azure"?"Type deployment name manually":"Type model name manually",className:"font-mono text-xs"}),N.length>0&&s.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Loaded ",N.length," ",d.provider==="azure"?"deployment names":"models"," from provider discovery."]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{children:"Max Tokens"}),s.jsx(vt,{type:"number",min:1,max:128e3,value:d.maxTokens,onChange:T=>f(D=>({...D,maxTokens:parseInt(T.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(Me,{children:"Max Turns"}),s.jsx(vt,{type:"number",min:1,max:50,value:d.maxTurns??"",onChange:T=>{const D=T.target.value.trim();f(X=>({...X,maxTurns:D&&parseInt(D)||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(Me,{children:"Temperature"}),s.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:d.temperature.toFixed(2)})]}),s.jsx(Y8,{value:[d.temperature],onValueChange:([T])=>f(D=>({...D,temperature:T})),min:0,max:2,step:.01})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{children:"System Prompt"}),s.jsx(Ua,{value:d.systemPrompt||"",onChange:T=>f(D=>({...D,systemPrompt:T.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(ie,{type:"button",variant:"destructive",size:"sm",onClick:()=>p(!0),children:"Delete"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ie,{type:"button",variant:"outline",size:"sm",onClick:()=>t("/libraries/agents"),children:"Cancel"}),s.jsxs(ie,{type:"button",size:"sm",onClick:()=>{Q()},disabled:y,children:[y&&s.jsx(ir,{className:"mr-2 h-4 w-4 animate-spin"}),i?"Create Agent":"Save"]})]})]})]})]}),s.jsx(Ss,{open:h,onOpenChange:p,children:s.jsxs(Ga,{children:[s.jsxs(Ya,{children:[s.jsx(Qa,{children:"Delete agent?"}),s.jsxs(Ja,{children:["This will permanently remove the agent"," ",s.jsx("span",{className:"font-mono",children:d.name}),". This action cannot be undone."]})]}),s.jsxs(Xa,{children:[s.jsx(es,{children:"Cancel"}),s.jsx(Za,{onClick:()=>{J()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},dM="mcplab.resultAssistantScenarioHandoff",fM=()=>{const{testCaseId:e}=Do(),[t,n]=Tc(),r=_a(),{source:a}=On(),{scenarios:i,setScenarios:o,agents:c,servers:d,reload:f,loading:h}=Ha(),[p,y]=v.useState(""),[g,j]=v.useState("all"),[b,x]=v.useState("name"),[S,N]=v.useState("asc"),[_,P]=v.useState(""),[A,O]=v.useState(null),[R,k]=v.useState("idle"),[M,z]=v.useState(""),[B,L]=v.useState(""),[G,U]=v.useState(0),[H,Q]=v.useState(null),J=v.useRef(null),T=v.useRef(!1),D=v.useRef(!1),X=v.useRef(null),F=v.useRef(0),$=e?decodeURIComponent(e):void 0,ee=$?i.findIndex(ye=>ye.id===$):-1,ae=ee>=0?i[ee]:void 0,K=async ye=>{if(!ae||ee<0||!ye)return;const Se=[...i];Se[ee]=ye,await o(Se)},le=async()=>{const ye=X.current;if(!ye||!ae)return;if(T.current){D.current=!0;return}T.current=!0,D.current=!1;const Se=++F.current;k("saving"),z("");try{await K(ye),Se===F.current&&k("saved")}catch(ze){const ct=ze instanceof Error?ze.message:String(ze);Se===F.current&&(k("error"),z(ct)),_e({title:"Could not save scenario",description:ct,variant:"destructive"})}finally{T.current=!1,D.current&&(D.current=!1,le())}},te=ye=>{X.current=ye,k("dirty"),z(""),J.current&&window.clearTimeout(J.current),J.current=window.setTimeout(()=>{J.current=null,le()},700)},de=async()=>{const ye=`scn-${Date.now()}`;let Se=ye,ze=1;for(;i.some(Z=>Z.id===Se);)Se=`${ye}-${ze}`,ze+=1;const ct={id:Se,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};await o([...i,ct]),r(`/libraries/test-cases/${encodeURIComponent(Se)}`),_e({title:"Test case created",description:`Opened ${Se} for editing.`})},oe=ye=>{const Se=(ye||`scn-${Date.now()}`).trim().replace(/\s+/g,"-").replace(/[^a-zA-Z0-9_-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")||`scn-${Date.now()}`;let ze=Se,ct=1;for(;i.some(Z=>Z.id===ze);)ze=`${Se}-${ct}`,ct+=1;return ze},pe=async(ye,Se=!1)=>{const ze=oe(`${ye.id}-copy`),ct={...structuredClone(ye),id:ze,name:ye.name?`${ye.name} (Copy)`:""};await o([...i,ct]),_e({title:"Test case duplicated",description:`Created ${ct.id}.`}),Se&&r(`/libraries/test-cases/${encodeURIComponent(ct.id)}`)},je=async ye=>{J.current&&(window.clearTimeout(J.current),J.current=null);const Se=i.filter(ze=>ze.id!==ye.id);await o(Se),_e({title:"Test case deleted",description:`${ye.id} was removed.`}),ae?.id===ye.id&&(O(null),X.current=null,k("idle"),z(""),r("/libraries/test-cases"))},se=ye=>ye.map(Se=>d.find(ze=>ze.id===Se)).filter(Boolean).map(Se=>Se?.name||Se?.id).filter(Boolean),$e=v.useMemo(()=>{const ye=new Set;for(const Se of i)for(const ze of se(Se.serverIds))ye.add(ze);return Array.from(ye).sort((Se,ze)=>Se.localeCompare(ze))},[i,d]),Ae=v.useMemo(()=>{const ye=p.trim().toLowerCase(),Se=i.filter(ze=>{const ct=(ze.name||"").toLowerCase(),Z=ze.id.toLowerCase(),Ne=(ze.prompt||"").toLowerCase(),Ie=se(ze.serverIds);return g!=="all"&&!Ie.includes(g)?!1:ye?ct.includes(ye)||Z.includes(ye)||Ne.includes(ye)||Ie.some(Re=>Re.toLowerCase().includes(ye)):!0});return Se.sort((ze,ct)=>{const Z=se(ze.serverIds),Ne=se(ct.serverIds);let Ie=0;switch(b){case"id":Ie=ze.id.localeCompare(ct.id);break;case"servers":Ie=Z.length-Ne.length;break;case"evalRules":Ie=ze.evalRules.length-ct.evalRules.length;break;case"extractRules":Ie=ze.extractRules.length-ct.extractRules.length;break;default:Ie=(ze.name||ze.id).localeCompare(ct.name||ct.id);break}return Ie===0&&(Ie=ze.id.localeCompare(ct.id)),S==="asc"?Ie:-Ie}),Se},[i,p,g,b,S,d]);v.useEffect(()=>{let ye=!0;return a.getWorkspaceSettings().then(Se=>{!ye||!Se||P(Se.scenarioAssistantAgentName??"")}).catch(()=>{ye&&P("")}),()=>{ye=!1}},[a]),v.useEffect(()=>{if($&&t.get("assistantHandoff")==="1")try{const ye=window.sessionStorage.getItem(dM);if(!ye)return;const Se=JSON.parse(ye);if(!Se||Se.scenarioId!==$||!Se.prompt)return;L(String(Se.prompt)),U(Date.now()),window.sessionStorage.removeItem(dM);const ze=new URLSearchParams(t);ze.delete("assistantHandoff"),n(ze,{replace:!0}),_e({title:"Suggestion sent to Scenario Assistant",description:"Review the suggestion and apply changes in the scenario editor."})}catch{}},[$,t,n]),v.useEffect(()=>{ae?(O(structuredClone(ae)),X.current=structuredClone(ae),k("idle"),z("")):(O(null),X.current=null,k("idle"),z("")),J.current&&(window.clearTimeout(J.current),J.current=null),T.current=!1,D.current=!1},[ae]),v.useEffect(()=>()=>{J.current&&window.clearTimeout(J.current)},[]);const Ye=_||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:[ae&&s.jsxs(ie,{type:"button",size:"sm",variant:"outline",onClick:()=>r("/libraries/test-cases"),children:[s.jsx(jo,{className:"mr-2 h-4 w-4"}),"Back to Overview"]}),s.jsxs(ie,{type:"button",size:"sm",variant:"outline",onClick:()=>{f()},disabled:h,children:[s.jsx(Sa,{className:"mr-2 h-4 w-4"}),"Refresh"]}),!ae&&s.jsxs(ie,{type:"button",size:"sm",onClick:()=>{de()},children:[s.jsx(ps,{className:"mr-1.5 h-3.5 w-3.5"}),"Add Test Case"]})]})]}),!ae&&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(Me,{className:"text-xs",children:"Search"}),s.jsxs("div",{className:"relative",children:[s.jsx(ES,{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(vt,{value:p,onChange:ye=>y(ye.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(Me,{className:"text-xs",children:"Server Filter"}),s.jsxs(sn,{value:g,onValueChange:j,children:[s.jsx(Zt,{className:"h-8 text-xs",children:s.jsx(on,{})}),s.jsxs(en,{children:[s.jsx(it,{value:"all",children:"All servers"}),$e.map(ye=>s.jsx(it,{value:ye,children:ye},ye))]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{className:"text-xs",children:"Sort By"}),s.jsxs(sn,{value:b,onValueChange:ye=>x(ye),children:[s.jsx(Zt,{className:"h-8 text-xs",children:s.jsx(on,{})}),s.jsxs(en,{children:[s.jsx(it,{value:"name",children:"Name"}),s.jsx(it,{value:"id",children:"ID"}),s.jsx(it,{value:"servers",children:"# Servers"}),s.jsx(it,{value:"evalRules",children:"# Eval Rules"}),s.jsx(it,{value:"extractRules",children:"# Extract Rules"})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{className:"text-xs",children:"Direction"}),s.jsxs(sn,{value:S,onValueChange:ye=>N(ye),children:[s.jsx(Zt,{className:"h-8 w-28 text-xs",children:s.jsx(on,{})}),s.jsxs(en,{children:[s.jsx(it,{value:"asc",children:"Ascending"}),s.jsx(it,{value:"desc",children:"Descending"})]})]})]})]}),s.jsx(We,{children:s.jsxs(Ve,{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":"","."]}),$&&!ae&&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:$})," 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(ye=>{const Se=$===ye.id,ze=`/libraries/test-cases/${encodeURIComponent(ye.id)}`,ct=se(ye.serverIds);return s.jsx("div",{className:`rounded-lg border p-3 ${Se?"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(xt,{to:ze,className:"font-medium truncate hover:underline",children:ye.name||ye.id}),s.jsx(Je,{variant:"outline",className:"font-mono text-[10px]",children:ye.id}),Se&&s.jsx(Je,{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:[ct.length," server",ct.length!==1?"s":""]}),s.jsxs("span",{children:[ye.evalRules.length," eval rule",ye.evalRules.length!==1?"s":""]}),s.jsxs("span",{children:[ye.extractRules.length," extract rule",ye.extractRules.length!==1?"s":""]})]}),ct.length>0&&s.jsx("div",{className:"flex flex-wrap gap-1",children:ct.map(Z=>s.jsx(Je,{variant:"secondary",className:"text-[10px]",children:Z},`${ye.id}-${Z}`))})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(ie,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>Q(ye),children:[s.jsx(Na,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(ie,{type:"button",size:"sm",variant:"outline",onClick:()=>{pe(ye)},children:[s.jsx(Mi,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsx(ie,{type:"button",size:"sm",variant:Se?"default":"outline",asChild:!0,children:s.jsxs(xt,{to:ze,children:[s.jsx(Em,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})})]})]})},ye.id)})})]})})]}),ae&&A?s.jsxs(We,{children:[s.jsxs(Nt,{className:"pb-3",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsx("div",{children:s.jsx(Ct,{className:"text-base",children:"Edit Test Case"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(ie,{type:"button",size:"sm",variant:"outline",onClick:()=>{pe(A,!0)},children:[s.jsx(Mi,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsxs(ie,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>Q(A),children:[s.jsx(Na,{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:ae.id}),"."]}),s.jsx(Je,{variant:"outline",className:`text-[10px] ${R==="saving"?"border-amber-300 text-amber-700":R==="saved"?"border-emerald-300 text-emerald-700":R==="error"?"border-destructive/40 text-destructive":R==="dirty"?"border-sky-300 text-sky-700":""}`,children:R==="saving"?"Saving...":R==="saved"?"Saved":R==="error"?"Save failed":R==="dirty"?"Unsaved changes":"Ready"}),R==="error"&&M&&s.jsx("span",{className:"text-[11px] text-destructive",children:M})]})})]}),s.jsx(Ve,{className:"pt-3",children:s.jsx(hS,{scenarios:[A],agents:c,servers:d,defaultAssistantAgentName:Ye,assistantInitialPromptByScenarioId:B&&A?.id?{[A.id]:B}:void 0,assistantAutoOpenNonceByScenarioId:A?.id&&G?{[A.id]:G}:void 0,onChange:ye=>{const Se=ye[0];Se&&(O(Se),te(Se))},allowAdd:!1})})]}):null,s.jsx(Ss,{open:!!H,onOpenChange:ye=>!ye&&Q(null),children:s.jsxs(Ga,{children:[s.jsxs(Ya,{children:[s.jsx(Qa,{children:"Delete test case?"}),s.jsxs(Ja,{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(Xa,{children:[s.jsx(es,{children:"Cancel"}),s.jsx(Za,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{H&&(je(H),Q(null))},children:"Delete Test Case"})]})]})})]})},Rve=()=>{const{source:e}=On(),{agents:t,reload:n,loading:r}=Ha(),[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(""),_e({title:"Could not load settings",description:j instanceof Error?j.message:String(j),variant:"destructive"})}finally{i(!1)}};v.useEffect(()=>{p()},[e]);const y=async j=>{f(j),c(!0);try{await e.updateWorkspaceSettings({scenarioAssistantAgentName:j||void 0}),_e({title:"Settings updated",description:j?`Scenario Assistant Agent set to ${j}.`:"Scenario Assistant Agent cleared (will use first available agent by default)."})}catch(b){_e({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(PS,{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(ie,{type:"button",size:"sm",variant:"outline",onClick:()=>{g()},disabled:r||a,children:[s.jsx(Sa,{className:"mr-2 h-4 w-4"}),"Refresh"]})]}),s.jsxs(We,{children:[s.jsxs(Nt,{className:"pb-3",children:[s.jsx(Ct,{className:"text-base",children:"Scenario Assistant"}),s.jsx(Bs,{children:"Default assistant model used on library test case pages. If unset, MCP Lab uses the first available agent automatically."})]}),s.jsxs(Ve,{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(Me,{className:"text-xs",children:"Assistant Agent"}),s.jsxs(sn,{value:h||"__none__",onValueChange:j=>{y(j==="__none__"?"":j)},disabled:o,children:[s.jsx(Zt,{className:"h-9 text-sm",children:s.jsx(on,{placeholder:"Select assistant agent"})}),s.jsxs(en,{children:[s.jsx(it,{value:"__none__",children:"None (use first agent)"}),t.map(j=>s.jsxs(it,{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 eg="Checkbox",[kve]=or(eg),[Tve,xC]=kve(eg);function Ive(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,[y,g]=sa({prop:n,defaultProp:a??!1,onChange:d,caller:eg}),[j,b]=v.useState(null),[x,S]=v.useState(null),N=v.useRef(!1),_=j?!!o||!!j.closest("form"):!0,P={checked:y,disabled:i,setChecked:g,control:j,setControl:b,name:c,form:o,value:h,hasConsumerStoppedPropagationRef:N,required:f,defaultChecked:Ii(a)?!1:a,isFormControl:_,bubbleInput:x,setBubbleInput:S};return s.jsx(Tve,{scope:t,...P,children:Mve(p)?p(P):r})}var wz="CheckboxTrigger",jz=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:y,isFormControl:g,bubbleInput:j}=xC(wz,e),b=pt(a,h),x=v.useRef(d);return v.useEffect(()=>{const S=i?.form;if(S){const N=()=>p(x.current);return S.addEventListener("reset",N),()=>S.removeEventListener("reset",N)}},[i,p]),s.jsx(qe.button,{type:"button",role:"checkbox","aria-checked":Ii(d)?"mixed":d,"aria-required":f,"data-state":Az(d),"data-disabled":c?"":void 0,disabled:c,value:o,...r,ref:b,onKeyDown:Ee(t,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:Ee(n,S=>{p(N=>Ii(N)?!0:!N),j&&g&&(y.current=S.isPropagationStopped(),y.current||S.stopPropagation())})})});jz.displayName=wz;var bC=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(Ive,{__scopeCheckbox:n,checked:a,defaultChecked:i,disabled:c,required:o,onCheckedChange:f,name:r,form:h,value:d,internal_do_not_use_render:({isFormControl:y})=>s.jsxs(s.Fragment,{children:[s.jsx(jz,{...p,ref:t,__scopeCheckbox:n}),y&&s.jsx(_z,{__scopeCheckbox:n})]})})});bC.displayName=eg;var Sz="CheckboxIndicator",Nz=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,i=xC(Sz,n);return s.jsx(Gn,{present:r||Ii(i.checked)||i.checked===!0,children:s.jsx(qe.span,{"data-state":Az(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});Nz.displayName=Sz;var Cz="CheckboxBubbleInput",_z=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:y,setBubbleInput:g}=xC(Cz,e),j=pt(n,g),b=zv(i),x=Tm(r);v.useEffect(()=>{const N=y;if(!N)return;const _=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(_,"checked").set,O=!a.current;if(b!==i&&A){const R=new Event("click",{bubbles:O});N.indeterminate=Ii(i),A.call(N,Ii(i)?!1:i),N.dispatchEvent(R)}},[y,b,i,a]);const S=v.useRef(Ii(i)?!1:i);return s.jsx(qe.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,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});_z.displayName=Cz;function Mve(e){return typeof e=="function"}function Ii(e){return e==="indeterminate"}function Az(e){return Ii(e)?"indeterminate":e?"checked":"unchecked"}const ba=v.forwardRef(({className:e,...t},n)=>s.jsx(bC,{ref:n,className:be("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(Nz,{className:be("flex items-center justify-center text-current"),children:s.jsx(Gl,{className:"h-4 w-4"})})}));ba.displayName=bC.displayName;const $ve=$o("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"}}),Vl=v.forwardRef(({className:e,variant:t,...n},r)=>s.jsx("div",{ref:r,role:"alert",className:be($ve({variant:t}),e),...n}));Vl.displayName="Alert";const Hl=v.forwardRef(({className:e,...t},n)=>s.jsx("h5",{ref:n,className:be("mb-1 font-medium leading-none tracking-tight",e),...t}));Hl.displayName="AlertTitle";const Kl=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:be("text-sm [&_p]:leading-relaxed",e),...t}));Kl.displayName="AlertDescription";function Dve(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:y,children:g,...j}=p,b=y?.[e]?.[d]||c,x=v.useMemo(()=>j,Object.values(j));return s.jsx(b.Provider,{value:x,children:g})};f.displayName=i+"Provider";function h(p,y){const g=y?.[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,Lve(a,...t)]}function Lve(...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 Fve=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ez=Fve.reduce((e,t)=>{const n=Vm(`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}},{}),wC="Progress",jC=100,[Bve]=Dve(wC),[zve,Uve]=Bve(wC),Pz=v.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:a,getValueLabel:i=qve,...o}=e;(a||a===0)&&!pM(a)&&console.error(Wve(`${a}`,"Progress"));const c=pM(a)?a:jC;r!==null&&!hM(r,c)&&console.error(Vve(`${r}`,"Progress"));const d=hM(r,c)?r:null,f=Sm(d)?i(d,c):void 0;return s.jsx(zve,{scope:n,value:d,max:c,children:s.jsx(Ez.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":Sm(d)?d:void 0,"aria-valuetext":f,role:"progressbar","data-state":kz(d,c),"data-value":d??void 0,"data-max":c,...o,ref:t})})});Pz.displayName=wC;var Oz="ProgressIndicator",Rz=v.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,a=Uve(Oz,n);return s.jsx(Ez.div,{"data-state":kz(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...r,ref:t})});Rz.displayName=Oz;function qve(e,t){return`${Math.round(e/t*100)}%`}function kz(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Sm(e){return typeof e=="number"}function pM(e){return Sm(e)&&!isNaN(e)&&e>0}function hM(e,t){return Sm(e)&&!isNaN(e)&&e<=t&&e>=0}function Wve(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${jC}\`.`}function Vve(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 ${jC} if no \`max\` prop is set)
133
+ - \`null\` or \`undefined\` if the progress is indeterminate.
134
+
135
+ Defaulting to \`null\`.`}var Tz=Pz,Hve=Rz;const tg=v.forwardRef(({className:e,value:t,...n},r)=>s.jsx(Tz,{ref:r,className:be("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:s.jsx(Hve,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));tg.displayName=Tz.displayName;const Uu=["critical","high","medium","low","info"];function p1(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 Kve(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 mM({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(kU,{className:"h-3.5 w-3.5"}),"Suggested improvement"]}),s.jsx("p",{children:e})]})}function SC(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 Iz({report:e}){const[t,n]=v.useState([...Uu]),r=v.useMemo(()=>new Set(t),[t]),a=i=>{n(o=>{const c=o.includes(i)?o.filter(d=>d!==i):[...o,i];return c.length===0?[...Uu]:c})};return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[s.jsx(We,{children:s.jsxs(Ve,{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(We,{children:s.jsxs(Ve,{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(We,{children:s.jsxs(Ve,{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(We,{children:[s.jsxs(Nt,{className:"pb-3",children:[s.jsx(Ct,{className:"text-base",children:"Analysis Overview"}),s.jsx(Bs,{children:"Visual breakdown of findings by severity. Click badges to filter the report."})]}),s.jsx(Ve,{children:s.jsxs("div",{className:"flex flex-wrap gap-2",children:[Uu.filter(i=>e.summary.issueCounts[i]>0).map(i=>{const o=r.has(i);return s.jsx("button",{type:"button",onClick:()=>a(i),className:"rounded-full","aria-pressed":o,children:s.jsxs(Je,{variant:"outline",className:`capitalize font-normal ${o?p1(i):Kve(i)} ${o?"ring-1 ring-current":"opacity-70"}`,children:[i,": ",e.summary.issueCounts[i]]})},i)}),s.jsx(ie,{type:"button",size:"sm",variant:"ghost",onClick:()=>n([...Uu]),className:"h-7 px-2 text-xs",children:"Reset"})]})})]}),s.jsx("div",{className:"space-y-4",children:e.servers.map(i=>{const o=i.tools.filter(c=>{const d=[...c.metadataReview?.issues??[],...c.deeperAnalysis?.sampleCalls.flatMap(f=>f.issues)??[]];return d.length===0?t.length===Uu.length:d.some(f=>r.has(f.severity))});return o.length===0?null:s.jsxs(We,{children:[s.jsxs(Nt,{className:"pb-3",children:[s.jsx(Ct,{className:"text-base",children:i.serverName}),s.jsxs(Bs,{children:["Discovered ",i.toolCountDiscovered," · Showing ",o.length," of ",i.toolCountAnalyzed," analyzed · Skipped ",i.toolCountSkipped]})]}),s.jsxs(Ve,{className:"space-y-3",children:[i.warnings.length>0&&s.jsxs(Vl,{children:[s.jsx(Hl,{children:"Warnings"}),s.jsx(Kl,{children:s.jsx("ul",{className:"ml-4 list-disc space-y-1",children:i.warnings.map(c=>s.jsx("li",{children:c},`${i.serverName}-${c}`))})})]}),o.map(c=>s.jsxs("details",{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",children:c.publicToolName}),c.description&&s.jsx("p",{className:"text-xs text-muted-foreground",children:c.description})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Je,{variant:c.safetyClassification==="read_like"?"secondary":"outline",children:c.safetyClassification}),s.jsx(Wt,{className:"h-4 w-4 text-muted-foreground transition-transform group-open:rotate-180"})]})]})}),s.jsxs("div",{className:"mt-3 space-y-2",children:[c.metadataReview&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-xs font-medium",children:"Metadata review"}),c.metadataReview.issues.filter(d=>r.has(d.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:c.metadataReview.issues.filter(d=>r.has(d.severity)).map((d,f)=>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:f+1}),s.jsx("span",{className:"min-w-0 font-bold leading-tight",children:d.title})]}),s.jsx(Je,{variant:"outline",className:`shrink-0 text-[10px] ${p1(d.severity)}`,children:d.severity})]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",d.detail]}),d.suggestion&&s.jsx(mM,{text:d.suggestion})]},d.id))})]}),c.deeperAnalysis&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-xs font-medium",children:"Deeper analysis"}),c.deeperAnalysis.attempted?s.jsx("div",{className:"space-y-2",children:c.deeperAnalysis.sampleCalls.map(d=>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(Je,{variant:d.ok?"secondary":"destructive",className:"text-[10px]",children:d.ok?"ok":"error"}),s.jsxs("span",{children:["Call ",d.callIndex]}),d.durationMs!==void 0&&s.jsxs("span",{className:"text-muted-foreground",children:[d.durationMs,"ms"]})]}),d.error&&s.jsx("p",{className:"text-destructive",children:d.error}),d.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:d.observations.map((f,h)=>s.jsx("li",{children:f},`${c.publicToolName}-obs-${d.callIndex}-${h}`))})]}),d.issues.filter(f=>r.has(f.severity)).length>0&&s.jsx("div",{className:"mt-2 space-y-1",children:d.issues.filter(f=>r.has(f.severity)).map((f,h)=>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:h+1}),s.jsx("span",{className:"min-w-0 font-bold leading-tight",children:f.title})]}),s.jsx(Je,{variant:"outline",className:`shrink-0 text-[10px] ${p1(f.severity)}`,children:f.severity})]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",f.detail]}),f.suggestion&&s.jsx(mM,{text:f.suggestion})]},`${d.callIndex}-${f.id}`))})]},`${c.publicToolName}-call-${d.callIndex}`))}):s.jsx("p",{className:"text-xs text-muted-foreground",children:c.deeperAnalysis.skippedReason??"Skipped"})]})]})]},c.publicToolName))]})]},i.serverName)})})]})}const h1="mcplab.toolAnalysis.activeJobId";function vM(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 gM({text:e}){return s.jsxs(eD,{children:[s.jsx(tD,{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(EU,{className:"h-3.5 w-3.5"})})}),s.jsx(zS,{className:"max-w-xs text-xs",children:s.jsx("p",{children:e})})]})}function Gve(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 Yve=()=>{const{source:e}=On(),{servers:t,agents:n,loading:r,reload:a}=Ha(),[i,o]=v.useState(""),[c,d]=v.useState([]),[f,h]=v.useState(!1),[p,y]=v.useState([]),[g,j]=v.useState({}),[b,x]=v.useState(""),[S,N]=v.useState(!0),[_,P]=v.useState(!1),[A,O]=v.useState(2),[R,k]=v.useState(1),[M,z]=v.useState(1e4),[B,L]=v.useState(null),[G,U]=v.useState([]),[H,Q]=v.useState(null),[J,T]=v.useState(null),[D,X]=v.useState(!1),[F,$]=v.useState("configure"),[ee,ae]=v.useState("idle"),K=v.useRef(null),le=i||n[0]?.name||"",te=v.useMemo(()=>{let he=0;const Fe=new Set,Ue=new Set;for(const Ht of G){const zt=typeof Ht.payload?.message=="string"?Ht.payload.message:"";if(!zt)continue;const $t=zt.match(/\((\d+)\s+tools?\)/i);$t&&(he=Math.max(he,Number($t[1])||0));const Rn=zt.match(/^Started\s+(.+)$/);Rn&&Fe.add(Rn[1]);const kn=zt.match(/^Finished\s+(.+)$/);kn&&Ue.add(kn[1])}const Rt=he>0?Math.max(0,Math.min(100,Math.round(Ue.size/he*100))):0;return{totalTools:he,startedTools:Fe.size,finishedTools:Ue.size,percent:Rt}},[G]);v.useEffect(()=>{let he=!0;return e.getWorkspaceSettings().then(Fe=>{!he||!Fe||o(Fe.scenarioAssistantAgentName??"")}).catch(()=>{he&&o("")}),()=>{he=!1}},[e]),v.useEffect(()=>()=>{K.current?.()},[]);const de=()=>{try{sessionStorage.removeItem(h1)}catch{}},oe=he=>{try{sessionStorage.setItem(h1,he)}catch{}},pe=he=>{K.current?.(),K.current=e.subscribeToolAnalysisJob(he,Fe=>{if(U(Ue=>[...Ue,Fe]),Fe.type==="completed")e.getToolAnalysisResult(he).then(Ue=>{Q(Ue.report),T(Ue.savedReportId??null)}).catch(Ue=>_e({title:"Could not load analysis report",description:Ue instanceof Error?Ue.message:String(Ue),variant:"destructive"})).finally(()=>{de(),L(null),X(!1),ae("idle"),$("run")});else if(Fe.type==="error"){const Ue=String(Fe.payload?.message??"");de(),ae(Ue.toLowerCase().includes("abort")?"stopped":"error"),L(null),X(!1)}})};v.useEffect(()=>{if(B||H)return;let he="";try{he=sessionStorage.getItem(h1)??""}catch{he=""}if(he)return $("run"),ae("running"),X(!0),L(he),U([]),pe(he),()=>{}},[e,B,H]);const je=async()=>{if(c.length===0){y([]),j({});return}h(!0);try{const he=await e.discoverToolsForAnalysis({serverNames:c});y(he.servers),j(Fe=>{const Ue={};for(const Rt of he.servers){const Ht=Fe[Rt.serverName]??[],zt=Rt.tools.map(Rn=>Rn.name),$t=Ht.filter(Rn=>zt.includes(Rn));Ue[Rt.serverName]=$t.length>0?$t:zt}return Ue})}catch(he){_e({title:"Could not discover MCP tools",description:he instanceof Error?he.message:String(he),variant:"destructive"})}finally{h(!1)}};v.useEffect(()=>{je()},[c.join("|")]);const se=v.useMemo(()=>{const he=b.trim().toLowerCase();return he?p.map(Fe=>({...Fe,tools:Fe.tools.filter(Ue=>Ue.name.toLowerCase().includes(he)||(Ue.description||"").toLowerCase().includes(he))})).filter(Fe=>Fe.tools.length>0):p},[p,b]),$e=v.useMemo(()=>Object.values(g).reduce((he,Fe)=>he+Fe.length,0),[g]),Ae=c[0]??"",Ye=async()=>{if(!S&&!_){_e({title:"Select at least one mode",variant:"destructive"});return}if(c.length!==1){_e({title:"Select exactly one server",variant:"destructive"});return}if($e===0){_e({title:"Select at least one tool",variant:"destructive"});return}X(!0),U([]),Q(null),T(null),$("run"),ae("running");try{const{jobId:he}=await e.startToolAnalysis({serverNames:c,selectedToolsByServer:g,maxParallelTools:A,modes:{metadataReview:S,deeperAnalysis:_},deeperAnalysisOptions:{autoRunPolicy:"read_only_allowlist",sampleCallsPerTool:R,toolCallTimeoutMs:M}});L(he),oe(he),pe(he)}catch(he){X(!1),ae("error"),$("run"),_e({title:"Could not start tool analysis",description:he instanceof Error?he.message:String(he),variant:"destructive"})}},ye=async()=>{if(!B)return;const he=B;try{const Fe=await e.stopToolAnalysis(he);if(Fe.status==="completed"){K.current?.(),K.current=null;const Ue=await e.getToolAnalysisResult(he);Q(Ue.report),T(Ue.savedReportId??null),de(),L(null),X(!1),ae("idle"),$("run"),_e({title:"Analysis already finished",description:"Showing the result overview."});return}if(Fe.status==="stopped"){K.current?.(),K.current=null,de(),L(null),X(!1),ae("stopped"),_e({title:"Analysis stopped"});return}if(Fe.status==="error"){K.current?.(),K.current=null,de(),L(null),X(!1),ae("error"),_e({title:"Analysis already ended with an error",description:"Review the progress log and return to Configure Analysis."});return}_e({title:"Stopping analysis..."})}catch(Fe){_e({title:"Could not stop analysis",description:Fe instanceof Error?Fe.message:String(Fe),variant:"destructive"})}},Se=()=>{$("configure"),ae("idle"),L(null)},ze=(he,Fe)=>{d(Ue=>Fe?[he]:Ue.filter(Rt=>Rt!==he))},ct=(he,Fe,Ue)=>{j(Rt=>{const Ht=new Set(Rt[he]??[]);return Ue?Ht.add(Fe):Ht.delete(Fe),{...Rt,[he]:Array.from(Ht)}})},Z=(he,Fe)=>{j(Ue=>({...Ue,[he]:Fe}))},Ne=!0,Ie=B!==null||G.length>0||ee==="stopped"||ee==="error",Re=!!H,De=he=>{if(he==="configure"&&Ne){$("configure");return}if(he==="run"&&Ie){$("run");return}he==="report"&&Re&&$("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(l$,{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:()=>De("configure"),className:"rounded-full","aria-label":"Open Configure Analysis",children:s.jsx(Je,{variant:F==="configure"?"default":"outline",className:"cursor-pointer",children:"Configure Analysis"})}),s.jsx("button",{type:"button",onClick:()=>De("run"),disabled:!Ie,className:"rounded-full disabled:cursor-not-allowed disabled:opacity-60","aria-label":"Open Run Analysis",children:s.jsx(Je,{variant:F==="run"?"default":"outline",className:Ie?"cursor-pointer":"cursor-not-allowed",children:"Run Analysis"})}),s.jsx("button",{type:"button",onClick:()=>De("report"),disabled:!Re,className:"rounded-full disabled:cursor-not-allowed disabled:opacity-60","aria-label":"Open Report",children:s.jsx(Je,{variant:F==="report"?"default":"outline",className:Re?"cursor-pointer":"cursor-not-allowed",children:"Report"})})]})]}),F==="configure"&&s.jsxs(We,{children:[s.jsxs(Nt,{children:[s.jsx(Ct,{className:"text-base",children:"Run MCP analysis"}),s.jsx(Bs,{children:"Select servers and tools, choose metadata review and/or deeper sample-call analysis, then run the report."})]}),s.jsxs(Ve,{className:"space-y-5",children:[!le&&s.jsxs(Vl,{children:[s.jsx(Hl,{children:"No assistant agent available"}),s.jsxs(Kl,{children:["Add a library agent in"," ",s.jsx(xt,{to:"/libraries/agents",className:"underline",children:"Agents"})," ","and optionally set the default Scenario Assistant Agent in"," ",s.jsx(xt,{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(Me,{className:"text-xs",children:"Servers"}),s.jsxs(ie,{type:"button",size:"sm",variant:"outline",onClick:()=>{a()},disabled:r,children:[s.jsx(Sa,{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(he=>{const Fe=c.includes(he.id);return s.jsxs("label",{className:"flex items-start gap-2 rounded-md border p-2 text-sm",children:[s.jsx(ba,{checked:Fe,onCheckedChange:Ue=>ze(he.id,!!Ue)}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"font-medium",children:he.name||he.id}),he.url&&s.jsx("div",{className:"truncate text-xs text-muted-foreground",children:he.url})]})]},he.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(Me,{className:"text-xs",children:"Filter visible tools"}),s.jsxs("div",{className:"relative",children:[s.jsx(ES,{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(vt,{className:"h-9 pl-8",placeholder:"Filter tools by name or description...",value:b,onChange:he=>x(he.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(Me,{className:"text-xs",children:Ae?`Tools for ${Ae}`:"Tools"}),s.jsxs(ie,{type:"button",size:"sm",variant:"outline",onClick:()=>{je()},disabled:f||c.length===0,children:[f&&s.jsx(ir,{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..."}):se.length===0&&!f?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No discovered tools match the current filters."}):se.map(he=>{const Fe=new Set(g[he.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:he.serverName}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ie,{type:"button",size:"sm",variant:"ghost",onClick:()=>Z(he.serverName,he.tools.map(Ue=>Ue.name)),children:"Select all"}),s.jsx(ie,{type:"button",size:"sm",variant:"ghost",onClick:()=>Z(he.serverName,[]),children:"Clear"})]})]}),he.warnings.length>0&&s.jsx("div",{className:"mb-2 space-y-1",children:he.warnings.map(Ue=>s.jsx("div",{className:"text-xs text-amber-700",children:Gve(he.serverName,Ue)},`${he.serverName}-${Ue}`))}),s.jsx("div",{className:"grid gap-2",children:he.tools.map(Ue=>s.jsxs("label",{className:"flex items-start gap-2 rounded border p-2",children:[s.jsx(ba,{checked:Fe.has(Ue.name),onCheckedChange:Rt=>ct(he.serverName,Ue.name,!!Rt)}),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:Ue.name}),s.jsx(Je,{variant:Ue.safetyClassification==="read_like"?"secondary":"outline",className:"text-[10px]",children:Ue.safetyClassification==="read_like"?"read-like":"unsafe/unknown"})]}),Ue.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:Ue.description}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:Ue.classificationReason})]})]},`${he.serverName}-${Ue.name}`))})]},he.serverName)})}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Selected tools: ",$e]})]}),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(ba,{checked:S,onCheckedChange:he=>N(!!he)}),s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Metadata / schema review",s.jsx(gM,{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(ba,{checked:_,onCheckedChange:he=>P(!!he)}),s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Deeper analysis",s.jsx(gM,{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(Me,{className:"text-xs",children:"Max parallel tools"}),s.jsx(vt,{type:"number",min:1,max:8,value:A,onChange:he=>O(Math.max(1,Math.min(8,Number(he.target.value)||2))),className:"h-8"})]}),_?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Me,{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(Me,{className:"text-xs",children:"Sample calls per tool"}),s.jsx(vt,{type:"number",min:1,max:5,value:R,onChange:he=>k(Math.max(1,Math.min(5,Number(he.target.value)||1))),className:"h-8"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Me,{className:"text-xs",children:"Tool call timeout (ms)"}),s.jsx(vt,{type:"number",min:1e3,max:6e4,step:500,value:M,onChange:he=>z(Math.max(1e3,Math.min(6e4,Number(he.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(ie,{type:"button",onClick:()=>{Ye()},disabled:D||!!B,children:[(D||!!B)&&s.jsx(ir,{className:"mr-2 h-4 w-4 animate-spin"}),"Analyze Tools"]})})]})]}),F==="run"&&s.jsxs(We,{children:[s.jsx(Nt,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(Ct,{className:"flex items-center gap-2 text-base",children:s.jsx("span",{children:"Progress"})}),s.jsx(Bs,{children:B?"Live tool-analysis job events:":H?"Analysis finished. Review the summary below or open the saved report details.":ee==="stopped"?"Analysis was stopped. You can return to Configure Analysis.":ee==="error"?"Analysis ended with an error. Review the log and go back to Configure Analysis.":"Analysis finished."})]}),B?s.jsx(ie,{type:"button",size:"sm",variant:"outline",onClick:()=>{ye()},children:"Stop Analysis"}):s.jsx(ie,{type:"button",size:"sm",variant:"outline",onClick:Se,children:"Back to Configure Analysis"})]})}),s.jsxs(Ve,{className:"space-y-2",children:[B&&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(ir,{className:"h-3.5 w-3.5 animate-spin"}),"Analysis is still running..."]}),(te.totalTools>0||B)&&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:te.totalTools>0?`${te.finishedTools}/${te.totalTools} tools finished`:"Preparing analysis..."}),s.jsx("span",{children:te.totalTools>0?`${te.percent}%`:"0%"})]}),s.jsx(tg,{value:te.totalTools>0?te.percent:0,className:"h-2"})]}),G.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:B?"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:G.map((he,Fe)=>s.jsxs("div",{className:"text-xs",children:[s.jsx("span",{className:"mr-2 font-mono text-muted-foreground",children:new Date(he.ts).toLocaleTimeString()}),s.jsx(Je,{variant:"outline",className:"mr-2 text-[10px]",children:he.type}),s.jsx("span",{className:"break-all",children:typeof he.payload.message=="string"?he.payload.message:JSON.stringify(he.payload)})]},`${he.ts}-${Fe}`))}),!B&&H&&s.jsx(We,{className:"mt-2 border-green-200 bg-green-50/40 dark:border-green-900/40 dark:bg-green-950/10",children:s.jsxs(Ve,{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:[J&&s.jsx(ie,{asChild:!0,size:"sm",children:s.jsx(xt,{to:`/tool-analysis-results/${J}`,children:"Open result details"})}),s.jsx(ie,{asChild:!0,size:"sm",variant:"outline",children:s.jsx(xt,{to:"/tool-analysis-results",children:"View all results"})}),s.jsx(ie,{type:"button",size:"sm",variant:"outline",onClick:()=>De("report"),children:"View inline report"})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[H.summary.issueCounts.critical>0&&s.jsxs(Je,{className:"bg-red-600 text-white hover:bg-red-600",children:["Critical: ",H.summary.issueCounts.critical]}),H.summary.issueCounts.high>0&&s.jsxs(Je,{className:"bg-orange-500 text-white hover:bg-orange-500",children:["High: ",H.summary.issueCounts.high]}),H.summary.issueCounts.medium>0&&s.jsxs(Je,{className:"bg-amber-500 text-white hover:bg-amber-500",children:["Medium: ",H.summary.issueCounts.medium]}),H.summary.issueCounts.low>0&&s.jsxs(Je,{className:"bg-blue-500 text-white hover:bg-blue-500",children:["Low: ",H.summary.issueCounts.low]}),H.summary.issueCounts.info>0&&s.jsxs(Je,{variant:"outline",children:["Info: ",H.summary.issueCounts.info]}),Object.values(H.summary.issueCounts).every(he=>he===0)&&s.jsx(Je,{className:"bg-green-600 text-white hover:bg-green-600",children:"No findings"})]})]})})]})]}),F==="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(ie,{type:"button",size:"sm",variant:"outline",onClick:Se,children:"Back to Configure Analysis"}),J&&s.jsxs(s.Fragment,{children:[s.jsx(ie,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx(xt,{to:`/tool-analysis-results/${J}`,children:"Open saved report"})}),s.jsx(ie,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx(xt,{to:"/tool-analysis-results",children:"View all reports"})})]}),s.jsxs(ie,{type:"button",size:"sm",variant:"outline",onClick:()=>vM(`tool-analysis-${Date.now()}.json`,`${JSON.stringify(H,null,2)}
138
+ `,"application/json"),children:[s.jsx(wa,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(ie,{type:"button",size:"sm",variant:"outline",onClick:()=>vM(`tool-analysis-${Date.now()}.md`,SC(H),"text/markdown"),children:[s.jsx(wa,{className:"mr-2 h-4 w-4"}),"Export Markdown"]})]})]}),s.jsx(Iz,{report:H})]})]})};function yM(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 Xve(){const{source:e}=On(),[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.listToolAnalysisResults())}catch(g){_e({title:"Could not load tool analysis results",description:g instanceof Error?g.message:String(g),variant:"destructive"})}finally{a(!1)}};v.useEffect(()=>{f()},[]);const h=v.useMemo(()=>t.find(g=>g.reportId===i)??null,[t,i]),p=async()=>{if(i){d(!0);try{await e.deleteToolAnalysisSavedResult(i),n(g=>g.filter(j=>j.reportId!==i)),_e({title:"Tool analysis report deleted"}),o(null)}catch(g){_e({title:"Could not delete report",description:g instanceof Error?g.message:String(g),variant:"destructive"})}finally{d(!1)}}},y=async(g,j)=>{try{const b=await e.getToolAnalysisSavedResult(g);j==="json"?yM(`${g}.json`,`${JSON.stringify(b,null,2)}
139
+ `,"application/json"):yM(`${g}.md`,SC(b.report),"text/markdown")}catch(b){_e({title:"Could not export saved report",description:b instanceof Error?b.message:String(b),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(c$,{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.jsx(ie,{variant:"outline",onClick:()=>{f()},disabled:r,children:r?"Refreshing...":"Refresh"}),s.jsx(ie,{asChild:!0,variant:"outline",children:s.jsx(xt,{to:"/tool-analysis",children:"Analyze MCP Tools"})})]})]}),s.jsx(We,{children:s.jsx(Ve,{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(Zr,{children:[s.jsx(ea,{children:s.jsxs(Bt,{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(ta,{children:t.map(g=>s.jsxs(Bt,{children:[s.jsx(Ke,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(xt,{to:`/tool-analysis-results/${g.reportId}`,className:"font-mono text-xs text-primary hover:underline",children:g.reportId}),s.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[g.assistantAgentName," · ",g.assistantAgentModel]})]})}),s.jsx(Ke,{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:g.serverNames.length})," · Tools:"," ",s.jsx("span",{className:"font-medium text-foreground",children:g.summary.toolsAnalyzed})," · ","Skipped: ",s.jsx("span",{className:"font-medium text-foreground",children:g.summary.toolsSkipped})]}),s.jsxs("div",{className:"font-mono text-xs text-foreground/80",children:[g.serverNames.slice(0,2).join(", "),g.serverNames.length>2?` +${g.serverNames.length-2}`:""]})]})}),s.jsx(Ke,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Jd,{className:"h-3 w-3"}),new Date(g.createdAt).toLocaleString()]})}),s.jsx(Ke,{children:s.jsxs("div",{className:"flex flex-wrap gap-1",children:[["critical","high","medium","low","info"].map(j=>g.summary.issueCounts[j]>0?s.jsxs(Je,{variant:"outline",className:"capitalize",children:[j,": ",g.summary.issueCounts[j]]},`${g.reportId}-${j}`):null),Object.values(g.summary.issueCounts).every(j=>j===0)&&s.jsx(Je,{variant:"outline",children:"No issues"})]})}),s.jsx(Ke,{children:s.jsxs("div",{className:"flex flex-wrap gap-1",children:[g.modes.metadataReview&&s.jsx(Je,{variant:"outline",children:"metadata"}),g.modes.deeperAnalysis&&s.jsx(Je,{variant:"outline",children:"deeper"})]})}),s.jsx(Ke,{children:s.jsxs(Wc,{children:[s.jsx(Vc,{asChild:!0,children:s.jsx(ie,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Am,{className:"h-4 w-4"})})}),s.jsxs(Ho,{align:"end",children:[s.jsx(gr,{asChild:!0,children:s.jsx(xt,{to:`/tool-analysis-results/${g.reportId}`,children:"View"})}),s.jsxs(gr,{onSelect:()=>{y(g.reportId,"json")},children:[s.jsx(wa,{className:"mr-2 h-3.5 w-3.5"})," Export JSON"]}),s.jsxs(gr,{onSelect:()=>{y(g.reportId,"markdown")},children:[s.jsx(wa,{className:"mr-2 h-3.5 w-3.5"})," Export Markdown"]}),s.jsxs(gr,{className:"text-destructive",onSelect:j=>{j.preventDefault(),o(g.reportId)},children:[s.jsx(Na,{className:"mr-2 h-3.5 w-3.5"})," Delete"]})]})]})})]},g.reportId))})]})})}),s.jsx(Ss,{open:!!i,onOpenChange:g=>!g&&o(null),children:s.jsxs(Ga,{children:[s.jsxs(Ya,{children:[s.jsx(Qa,{children:"Delete tool analysis report?"}),s.jsx(Ja,{children:h?`Delete saved report '${h.reportId}' from disk? This cannot be undone.`:"Delete this saved report from disk? This cannot be undone."})]}),s.jsxs(Xa,{children:[s.jsx(es,{disabled:c,children:"Cancel"}),s.jsx(Za,{onClick:g=>{g.preventDefault(),p()},disabled:c,children:c?"Deleting...":"Delete"})]})]})})]})}function xM(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 Qve(){const{id:e=""}=Do(),t=_a(),{source:n}=On(),[r,a]=v.useState(null),[i,o]=v.useState(!0),[c,d]=v.useState(!1),[f,h]=v.useState(!1),[p,y]=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 x=b instanceof Error?b.message:String(b);if(x.includes("(404)")){d(!0),a(null);return}_e({title:"Could not load saved tool analysis report",description:x,variant:"destructive"})}).finally(()=>{j&&o(!1)}),()=>{j=!1}},[e,n]);const g=async()=>{y(!0);try{await n.deleteToolAnalysisSavedResult(e),_e({title:"Tool analysis report deleted"}),t("/tool-analysis-results")}catch(j){_e({title:"Could not delete report",description:j instanceof Error?j.message:String(j),variant:"destructive"})}finally{y(!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(ie,{asChild:!0,variant:"outline",children:s.jsx(xt,{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(ie,{asChild:!0,size:"sm",variant:"outline",children:s.jsx(xt,{to:"/tool-analysis-results",children:"Back to results"})}),s.jsxs(ie,{type:"button",size:"sm",variant:"outline",onClick:()=>xM(`${r.reportId}.json`,`${JSON.stringify(r,null,2)}
140
+ `,"application/json"),children:[s.jsx(wa,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(ie,{type:"button",size:"sm",variant:"outline",onClick:()=>xM(`${r.reportId}.md`,SC(r.report),"text/markdown"),children:[s.jsx(wa,{className:"mr-2 h-4 w-4"}),"Export Markdown"]}),s.jsxs(ie,{type:"button",size:"sm",variant:"outline",onClick:()=>h(!0),children:[s.jsx(Na,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]}),s.jsx(Iz,{report:r.report}),s.jsx(Ss,{open:f,onOpenChange:h,children:s.jsxs(Ga,{children:[s.jsxs(Ya,{children:[s.jsx(Qa,{children:"Delete tool analysis report?"}),s.jsxs(Ja,{children:["Delete saved report '",r.reportId,"' from disk? This cannot be undone."]})]}),s.jsxs(Xa,{children:[s.jsx(es,{disabled:p,children:"Cancel"}),s.jsx(Za,{onClick:j=>{j.preventDefault(),g()},disabled:p,children:p?"Deleting...":"Delete"})]})]})})]})}const Jve=[{id:"configure",label:"Configure Debug Session"},{id:"run",label:"Run / Inspect Flow"},{id:"report",label:"Report / Export"}];function Zve(e){return navigator.clipboard.writeText(e)}function ege(){return typeof window>"u"?"":window.location.port==="8685"?"http://127.0.0.1:8787":""}function tge(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 nge(){const{source:e}=On(),{servers:t,reload:n,loading:r}=Ha(),[a,i]=v.useState("configure"),[o,c]=v.useState(""),[d,f]=v.useState("pre_registered"),[h,p]=v.useState("local_callback"),[y,g]=v.useState(!0),[j,b]=v.useState(!0),[x,S]=v.useState(""),[N,_]=v.useState(""),[P,A]=v.useState(""),[O,R]=v.useState(""),[k,M]=v.useState("client_secret_basic"),[z,B]=v.useState("{}"),[L,G]=v.useState(""),[U,H]=v.useState(""),[Q,J]=v.useState(""),[T,D]=v.useState(""),[X,F]=v.useState(""),[$,ee]=v.useState(""),[ae,K]=v.useState(""),[le,te]=v.useState(""),[de,oe]=v.useState(null),[pe,je]=v.useState(null),[se,$e]=v.useState([]),[Ae,Ye]=v.useState(!1),[ye,Se]=v.useState(!1),[ze,ct]=v.useState(!1),[Z,Ne]=v.useState("all"),[Ie,Re]=v.useState("all"),[De,he]=v.useState("inspector"),Fe=v.useRef(null),Ue=v.useRef(null);v.useEffect(()=>()=>{Fe.current?.(),Fe.current=null},[]),v.useEffect(()=>{Ue.current?.scrollIntoView({behavior:"smooth",block:"end"})},[se.length]);const Rt=v.useMemo(()=>t.filter(ce=>ce.authType==="oauth2"),[t]),Ht=Rt.find(ce=>ce.id===o);v.useEffect(()=>{o&&(Rt.some(ce=>ce.id===o)||c(""))},[Rt,o]);const zt=v.useMemo(()=>{const ce=de?.stepStates.length??0,ke=de?.stepStates.filter(Dt=>Dt.status==="completed"||Dt.status==="skipped").length??0,nt=de?.stepStates.filter(Dt=>Dt.status==="failed").length??0,yt=ce>0?Math.round((ke+nt)/ce*100):0;return{total:ce,completed:ke,failed:nt,percent:yt}},[de]),$t=v.useMemo(()=>(de?.network??[]).filter(ke=>!(Z!=="all"&&ke.stepId!==Z||Ie==="error"&&!(ke.phase==="response"&&(ke.status??0)>=400)||Ie==="ok"&&!(ke.phase==="response"&&(ke.status??0)<400))),[de?.network,Z,Ie]),Rn=!!pe,kn=!!(de&&(de.status==="completed"||de.status==="error"||de.status==="stopped")),lr=ce=>{if(ce==="configure"||ce==="run"&&Rn||ce==="report"&&kn)return i(ce)},cr=()=>{let ce;if(d==="dcr"&&z.trim())try{ce=JSON.parse(z)}catch{throw new Error("DCR metadata JSON is invalid")}if(!Ht)throw new Error("Select an MCP server");return{profile:"latest",target:{serverName:Ht.id,overrides:{authorizationServerMetadataUrl:Q||void 0,authorizationEndpoint:T||void 0,tokenEndpoint:X||void 0,registrationEndpoint:$||void 0,cimdUrl:L||void 0,resourceBaseUrl:ae||void 0}},registrationMethod:d,clientConfig:{preRegistered:d==="pre_registered"?{clientId:P.trim(),clientSecret:O.trim()||void 0,tokenEndpointAuthMethod:k||void 0}:void 0,dcr:d==="dcr"?{metadata:ce,tokenEndpointAuthMethod:k||void 0}:void 0,cimd:d==="cimd"?{cimdUrl:L||void 0,expectedClientId:U||void 0}:void 0},runtime:{redirectMode:h,scopes:x.split(/[,\s]+/).map(ke=>ke.trim()).filter(Boolean),resource:N.trim()||void 0,usePkce:j,codeChallengeMethod:"S256"},display:{showSensitiveValues:y}}},Ln=ce=>{Fe.current?.(),Fe.current=e.subscribeOAuthDebuggerSession(ce,ke=>{$e(yt=>[...yt,ke]),(ke.type==="completed"||ke.type==="error"||ke.type==="stopped")&&Ye(!1),e.getOAuthDebuggerSession(ce).then(yt=>{oe(yt.session),yt.session.status==="completed"&&i("report")}).catch(()=>{})})},ur=async()=>{Se(!0);try{const ce=cr(),ke=await e.createOAuthDebuggerSession(ce);je(ke.sessionId),oe(ke.session),$e([]),i("run"),Ln(ke.sessionId);const nt=await e.startOAuthDebuggerSession(ke.sessionId);oe(nt.session),Ye(!0),(nt.session.status==="waiting_for_user"||nt.session.status==="waiting_for_browser_callback")&&Ye(!1)}catch(ce){_e({title:"Could not start OAuth Debugger session",description:ce instanceof Error?ce.message:String(ce),variant:"destructive"})}finally{Se(!1)}},_r=async()=>{if(pe)try{Se(!0);const ce=await e.submitOAuthDebuggerManualCallback(pe,{redirectUrl:le.trim()||void 0});oe(ce.session),te(""),Ye(!0)}catch(ce){_e({title:"Could not submit callback",description:ce instanceof Error?ce.message:String(ce),variant:"destructive"})}finally{Se(!1)}},Lr=async()=>{if(pe){ct(!0);try{const ce=await e.stopOAuthDebuggerSession(pe);if(Ye(!1),ce.status!=="running"){const ke=await e.getOAuthDebuggerSession(pe);oe(ke.session),ke.session.status==="completed"?i("report"):i("run")}}catch(ce){_e({title:"Could not stop session",description:ce instanceof Error?ce.message:String(ce),variant:"destructive"})}finally{ct(!1)}}},Fr=async()=>{Fe.current?.(),Fe.current=null,oe(null),je(null),$e([]),Ye(!1),ct(!1),Se(!1),te(""),Ne("all"),Re("all"),he("inspector"),i("run"),await ur()},Xn=async ce=>{if(!(!pe||!de))try{const ke=await e.exportOAuthDebuggerSession(pe,ce);let nt="";const yt=ce==="json"?"json":ce==="raw"?"txt":"md";typeof ke=="string"?nt=ke:nt=`${JSON.stringify(ke,null,2)}
143
+ `;const Dt=new Blob([nt],{type:"text/plain;charset=utf-8"}),Yt=URL.createObjectURL(Dt),cn=document.createElement("a");cn.href=Yt,cn.download=`oauth-debugger-${pe}.${yt}`,cn.click(),URL.revokeObjectURL(Yt)}catch(ke){if(ce==="markdown"){const nt=tge(de,se),yt=new Blob([nt],{type:"text/markdown;charset=utf-8"}),Dt=URL.createObjectURL(yt),Yt=document.createElement("a");Yt.href=Dt,Yt.download=`oauth-debugger-${de.id}.md`,Yt.click(),URL.revokeObjectURL(Dt);return}_e({title:"Export failed",description:ke instanceof Error?ke.message:String(ke),variant:"destructive"})}},Kt=pe?`${ege()}/api/oauth-debugger/sessions/${pe}/authorize`:void 0,_n=ce=>ce==="error"?"destructive":ce==="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:Jve.map(ce=>{const ke=a===ce.id,nt=ce.id==="configure"||ce.id==="run"&&Rn||ce.id==="report"&&kn;return s.jsx("button",{type:"button",onClick:()=>nt&&lr(ce.id),disabled:!nt,className:"rounded-full",children:s.jsx(Je,{variant:ke?"default":"outline",className:nt?"":"opacity-50",children:ce.label})},ce.id)})})]}),a==="configure"&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs(We,{children:[s.jsx(Nt,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(Ct,{className:"text-base",children:"Target MCP Server"}),s.jsx(Bs,{children:"Select one MCP server from Libraries and optionally override endpoints."})]}),s.jsxs(ie,{type:"button",variant:"outline",size:"sm",onClick:()=>{n()},disabled:r,children:[s.jsx(Sa,{className:`mr-2 h-4 w-4 ${r?"animate-spin":""}`}),"Refresh Servers"]})]})}),s.jsx(Ve,{className:"space-y-3",children:s.jsxs("div",{className:"max-w-xl space-y-2",children:[s.jsx(Me,{children:"MCP Server"}),s.jsxs(sn,{value:o,onValueChange:c,children:[s.jsx(Zt,{children:s.jsx(on,{placeholder:"Select an MCP server"})}),s.jsx(en,{children:Rt.map(ce=>s.jsx(it,{value:ce.id,children:ce.name||ce.id},ce.id))})]}),Rt.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"}),"."]}),Ht&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:[Ht.transport," · ",Ht.url||Ht.command||"No URL/command"]})]})})]}),s.jsxs(We,{children:[s.jsx(Nt,{className:"pb-3",children:s.jsx(Ct,{className:"text-base",children:"Client Registration Method"})}),s.jsxs(Ve,{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(ce=>s.jsx("button",{type:"button",onClick:()=>f(ce.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===ce.id?"bg-primary":"bg-muted-foreground/30"}`}),s.jsx("span",{className:"text-sm font-medium",children:ce.label})]})},ce.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(Me,{className:"text-xs",children:"Redirect mode"}),s.jsxs(sn,{value:h,onValueChange:ce=>p(ce),children:[s.jsx(Zt,{children:s.jsx(on,{})}),s.jsxs(en,{children:[s.jsx(it,{value:"local_callback",children:"Local callback (recommended)"}),s.jsx(it,{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(Me,{className:"text-xs",children:"client_id"}),s.jsx(vt,{value:P,onChange:ce=>A(ce.target.value)})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Me,{className:"text-xs",children:"client_secret (optional)"}),s.jsx(vt,{value:O,onChange:ce=>R(ce.target.value),type:"password"})]})]}),d==="cimd"&&s.jsxs("div",{className:"space-y-1",children:[s.jsx(Me,{className:"text-xs",children:"CIMD URL"}),s.jsx(vt,{value:L,onChange:ce=>G(ce.target.value),placeholder:"https://.../client-metadata.json"})]})]})]}),s.jsxs(We,{children:[s.jsx(Nt,{className:"pb-3",children:s.jsx(Ct,{className:"text-base",children:"Runtime OAuth Inputs"})}),s.jsxs(Ve,{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Me,{className:"text-xs",children:"Scopes (space or comma separated)"}),s.jsx(vt,{value:x,onChange:ce=>S(ce.target.value),placeholder:"openid profile mcp"})]}),s.jsxs("div",{className:"flex items-center gap-2 md:col-span-2",children:[s.jsx(ba,{checked:j,onCheckedChange:ce=>b(!!ce)}),s.jsx(Me,{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(Me,{className:"text-xs",children:"Token endpoint auth method"}),s.jsx(vt,{value:k,onChange:ce=>M(ce.target.value),placeholder:"client_secret_basic / none / client_secret_post"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Me,{className:"text-xs",children:"Resource / audience (optional)"}),s.jsx(vt,{value:N,onChange:ce=>_(ce.target.value),placeholder:"https://resource.example.com"})]})]}),d==="dcr"&&s.jsxs("div",{className:"space-y-1",children:[s.jsx(Me,{className:"text-xs",children:"DCR metadata JSON (optional overrides)"}),s.jsx(Ua,{value:z,onChange:ce=>B(ce.target.value),className:"min-h-32 font-mono text-xs"})]}),d==="cimd"&&s.jsxs("div",{className:"space-y-1",children:[s.jsx(Me,{className:"text-xs",children:"Expected client_id (optional)"}),s.jsx(vt,{value:U,onChange:ce=>H(ce.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(Me,{className:"text-xs",children:"Authorization server metadata URL"}),s.jsx(vt,{value:Q,onChange:ce=>J(ce.target.value),placeholder:"https://.../.well-known/oauth-authorization-server"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Me,{className:"text-xs",children:"Resource server base URL"}),s.jsx(vt,{value:ae,onChange:ce=>K(ce.target.value),placeholder:"https://resource.example.com"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Me,{className:"text-xs",children:"Authorization endpoint"}),s.jsx(vt,{value:T,onChange:ce=>D(ce.target.value),placeholder:"https://.../authorize"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Me,{className:"text-xs",children:"Token endpoint"}),s.jsx(vt,{value:X,onChange:ce=>F(ce.target.value),placeholder:"https://.../token"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Me,{className:"text-xs",children:"Registration endpoint (DCR)"}),s.jsx(vt,{value:$,onChange:ce=>ee(ce.target.value),placeholder:"https://.../register"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Me,{className:"text-xs",children:"CIMD URL override"}),s.jsx(vt,{value:L,onChange:ce=>G(ce.target.value),placeholder:"https://.../client-metadata.json"})]})]})]}),s.jsxs(Vl,{children:[s.jsx(Hy,{className:"h-4 w-4"}),s.jsx(Hl,{children:"Secrets display"}),s.jsxs(Kl,{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(ba,{checked:!y,onCheckedChange:ce=>g(ce===!1)}),s.jsx(Me,{children:"Hide sensitive values in inspector"})]})]})]})]})]}),s.jsx("div",{className:"flex justify-end",children:s.jsxs(ie,{type:"button",onClick:()=>{ur()},disabled:ye,children:[ye&&s.jsx(ir,{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(We,{className:"xl:col-span-1",children:[s.jsx(Nt,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(Ct,{className:"text-base",children:"Progress"}),s.jsx(Bs,{children:"Visual OAuth flow guide with live session events and next-step actions."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[de?.uiHints.authorizationUrl&&Kt&&s.jsx(ie,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsxs("a",{href:Kt,target:"_blank",rel:"noopener noreferrer",children:[s.jsx(ih,{className:"mr-2 h-4 w-4"}),"Open Authorization URL"]})}),s.jsxs(ie,{type:"button",size:"sm",variant:"outline",onClick:()=>{Fr()},disabled:ye,children:[s.jsx(Sa,{className:"mr-2 h-4 w-4"}),"Restart"]}),pe&&s.jsxs(ie,{type:"button",size:"sm",variant:"outline",onClick:()=>{Lr()},disabled:ze||!pe,children:[(ze||Ae)&&ze&&s.jsx(ir,{className:"mr-2 h-4 w-4 animate-spin"}),s.jsx(eh,{className:"mr-2 h-4 w-4"}),"Stop Debug Session"]})]})]})}),s.jsxs(Ve,{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:[zt.completed+zt.failed,"/",zt.total," steps"]}),s.jsxs("span",{children:[zt.percent,"%"]})]}),s.jsx(tg,{value:zt.percent,className:"h-2"})]}),de?.status==="waiting_for_user"&&s.jsx(We,{children:s.jsxs(Ve,{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(Ua,{value:le,onChange:ce=>te(ce.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(ie,{type:"button",size:"sm",onClick:()=>{_r()},disabled:ye||!le.trim(),children:[ye&&s.jsx(ir,{className:"mr-2 h-4 w-4 animate-spin"}),"Continue"]}),de.uiHints.authorizationUrl&&Kt&&s.jsx(ie,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx("a",{href:Kt,target:"_blank",rel:"noopener noreferrer",children:"Open Authorization URL"})})]})]})}),de?.status==="waiting_for_browser_callback"&&s.jsxs(Vl,{children:[s.jsx(Hy,{className:"h-4 w-4"}),s.jsx(Hl,{children:"Waiting for browser callback"}),s.jsxs(Kl,{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:de.uiHints.callbackUrl}),de.uiHints.authorizationUrl&&Kt&&s.jsx("div",{className:"pt-2",children:s.jsx(ie,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsxs("a",{href:Kt,target:"_blank",rel:"noopener noreferrer",children:[s.jsx(ih,{className:"mr-2 h-4 w-4"}),"Open Authorization URL"]})})})]})]}),s.jsx("div",{className:"space-y-2",children:de?.stepStates.map(ce=>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:ce.title}),s.jsx("div",{className:"text-xs text-muted-foreground",children:ce.description})]}),s.jsx(Je,{variant:ce.status==="failed"?"destructive":ce.status==="completed"?"outline":ce.status==="active"?"secondary":"outline",className:ce.status==="completed"?"border-emerald-300 bg-emerald-50 text-emerald-700":void 0,children:ce.status})]}),ce.outcomeSummary&&s.jsx("p",{className:"mt-2 text-xs text-muted-foreground break-all",children:ce.outcomeSummary})]},ce.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(We,{children:[s.jsxs(Nt,{className:"pb-3",children:[s.jsx(Ct,{className:"text-base",children:"Inspect"}),s.jsx(Bs,{children:"Live events and network requests/responses for the OAuth flow."})]}),s.jsx(Ve,{className:"space-y-3",children:s.jsxs(oC,{value:De,onValueChange:ce=>he(ce),children:[s.jsxs(Wv,{className:"grid grid-cols-2",children:[s.jsx(Ti,{value:"inspector",children:"Network Inspector"}),s.jsx(Ti,{value:"events",children:"Live Debug"})]}),s.jsx(Gd,{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:[se.length===0?s.jsx("p",{className:"text-muted-foreground",children:"No events yet."}):se.map((ce,ke)=>s.jsxs("div",{className:"break-all",children:[s.jsx("span",{className:"mr-2 font-mono text-muted-foreground",children:new Date(ce.ts).toLocaleTimeString()}),s.jsx(Je,{variant:"outline",className:"mr-2 text-[10px]",children:ce.type}),typeof ce.payload.message=="string"?ce.payload.message:JSON.stringify(ce.payload)]},`${ce.ts}-${ke}`)),s.jsx("div",{ref:Ue})]})}),s.jsxs(Gd,{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(Me,{className:"text-xs",children:"Filter by step"}),s.jsxs(sn,{value:Z,onValueChange:Ne,children:[s.jsx(Zt,{className:"h-8",children:s.jsx(on,{})}),s.jsxs(en,{children:[s.jsx(it,{value:"all",children:"All steps"}),(de?.stepStates??[]).map(ce=>s.jsx(it,{value:ce.id,children:ce.title},ce.id))]})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Me,{className:"text-xs",children:"Filter by status"}),s.jsxs(sn,{value:Ie,onValueChange:Re,children:[s.jsx(Zt,{className:"h-8",children:s.jsx(on,{})}),s.jsxs(en,{children:[s.jsx(it,{value:"all",children:"All"}),s.jsx(it,{value:"ok",children:"Successful responses"}),s.jsx(it,{value:"error",children:"Error responses"})]})]})]})]}),s.jsx("div",{className:"max-h-[34rem] space-y-2 overflow-auto",children:$t.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No network exchanges captured yet."}):$t.map(ce=>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:ce.label}),s.jsxs("div",{className:"text-xs text-muted-foreground break-all",children:[ce.method?`${ce.method} `:"",ce.url]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Je,{variant:"outline",children:ce.phase}),typeof ce.status=="number"&&s.jsx(Je,{variant:ce.status>=400?"destructive":"secondary",children:ce.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(ce.headers,null,2)})]}),ce.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:ce.bodyText})]}),s.jsx("div",{className:"flex gap-2",children:s.jsxs(ie,{type:"button",size:"sm",variant:"outline",onClick:()=>{Zve(JSON.stringify(ce,null,2))},children:[s.jsx(Mi,{className:"mr-2 h-4 w-4"}),"Copy JSON"]})})]})]},ce.id))})]})]})})]})})]})}),a==="report"&&de&&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(ie,{type:"button",size:"sm",variant:"outline",onClick:()=>i("configure"),children:"Back to Configure"}),s.jsxs(ie,{type:"button",size:"sm",variant:"outline",onClick:()=>{Xn("json")},children:[s.jsx(wa,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(ie,{type:"button",size:"sm",variant:"outline",onClick:()=>{Xn("markdown")},children:[s.jsx(wa,{className:"mr-2 h-4 w-4"}),"Export Markdown"]}),s.jsxs(ie,{type:"button",size:"sm",variant:"outline",onClick:()=>{Xn("raw")},children:[s.jsx(wa,{className:"mr-2 h-4 w-4"}),"Copy/Export Raw Trace"]})]})]}),s.jsxs(Vl,{children:[s.jsx(Hy,{className:"h-4 w-4"}),s.jsx(Hl,{children:"Secrets display mode"}),s.jsx(Kl,{children:y?"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(We,{children:s.jsxs(Ve,{className:"pt-4",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Status"}),s.jsx("div",{className:"text-lg font-semibold",children:de.status})]})}),s.jsx(We,{children:s.jsxs(Ve,{className:"pt-4",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Requests"}),s.jsx("div",{className:"text-lg font-semibold",children:de.networkSummary.requestCount})]})}),s.jsx(We,{children:s.jsxs(Ve,{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:de.networkSummary.errorCount})]})}),s.jsx(We,{children:s.jsxs(Ve,{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:de.validations.length})]})})]}),s.jsxs(We,{children:[s.jsx(Nt,{className:"pb-3",children:s.jsx(Ct,{className:"text-base",children:"Key values"})}),s.jsxs(Ve,{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx(Me,{className:"text-xs",children:"Issuer"}),s.jsx("p",{className:"text-sm break-all",children:de.summary?.issuer||"-"})]}),s.jsxs("div",{children:[s.jsx(Me,{className:"text-xs",children:"Client ID"}),s.jsx("p",{className:"text-sm break-all",children:de.summary?.clientId||"-"})]}),s.jsxs("div",{children:[s.jsx(Me,{className:"text-xs",children:"Redirect URI"}),s.jsx("p",{className:"text-sm break-all",children:de.summary?.redirectUri||"-"})]}),s.jsxs("div",{children:[s.jsx(Me,{className:"text-xs",children:"Token endpoint status"}),s.jsx("p",{className:"text-sm",children:de.summary?.tokenEndpointStatus??"-"})]}),s.jsxs("div",{children:[s.jsx(Me,{className:"text-xs",children:"Token type"}),s.jsx("p",{className:"text-sm",children:de.summary?.tokenType||"-"})]}),s.jsxs("div",{children:[s.jsx(Me,{className:"text-xs",children:"Scopes granted"}),s.jsx("p",{className:"text-sm break-all",children:(de.summary?.grantedScopes??[]).join(", ")||"-"})]})]})]}),s.jsxs(We,{children:[s.jsx(Nt,{className:"pb-3",children:s.jsx(Ct,{className:"text-base",children:"Validation findings"})}),s.jsx(Ve,{className:"space-y-2",children:de.validations.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No validation findings recorded."}):de.validations.map((ce,ke)=>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:ke+1}),s.jsx("span",{className:"font-bold",children:ce.title})]}),s.jsx(Je,{variant:_n(ce.severity),children:ce.severity})]}),s.jsxs("p",{className:"text-sm",children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",ce.detail]}),ce.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:ce.recommendation})]}),s.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Step: ",ce.stepId,ce.specReference&&s.jsxs(s.Fragment,{children:[" · ",s.jsx("a",{href:ce.specReference,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"Spec reference"})]})]})]},ce.id))})]})]})]})}const m1="mcplab.runEvaluation.activeJobId",rge=()=>{const[e]=Tc(),[t,n]=v.useState(""),[r,a]=v.useState("1"),[i,o]=v.useState(!1),[c,d]=v.useState(0),[f,h]=v.useState([]),[p,y]=v.useState(!1),[g,j]=v.useState(!1),[b,x]=v.useState(""),[S,N]=v.useState(null),[_,P]=v.useState([]),[A,O]=v.useState([]),[R,k]=v.useState(!0),[M,z]=v.useState(""),[B,L]=v.useState(""),[G,U]=v.useState(!1),[H,Q]=v.useState([]),[J,T]=v.useState(null),D=v.useRef(null),X=v.useRef(null),{configs:F,reload:$}=of(),{source:ee}=On(),ae=bf("snapshots",!1),{agents:K,scenarios:le}=Ha(),te=F.find(Z=>Z.id===t),de=e.get("configId"),oe=v.useMemo(()=>{if(!te)return[];const Z=new Map,Ne=te.agentEntries&&te.agentEntries.length>0?te.agentEntries:te.agents.map(Ie=>({kind:"inline",agent:Ie}));for(const Ie of Ne){if(Ie.kind==="inline"){const De=Ie.agent.id;Z.has(De)||Z.set(De,Ie.agent);continue}const Re=K.find(De=>De.id===Ie.ref);Re&&!Z.has(Re.id)&&Z.set(Re.id,Re)}return Array.from(Z.values())},[te,K]),pe=v.useMemo(()=>{if(!te)return[];const Z=new Map,Ne=te.scenarioEntries&&te.scenarioEntries.length>0?te.scenarioEntries:te.scenarios.map(Ie=>({kind:"inline",scenario:Ie}));for(const Ie of Ne){if(Ie.kind==="inline"){Z.has(Ie.scenario.id)||Z.set(Ie.scenario.id,Ie.scenario);continue}const Re=le.find(De=>De.id===Ie.ref);Re&&!Z.has(Re.id)&&Z.set(Re.id,Re)}return Array.from(Z.values())},[te,le]);v.useEffect(()=>{de&&F.some(Z=>Z.id===de)&&n(de)},[de,F]),v.useEffect(()=>{if(!te){P([]),O([]);return}const Z=oe.filter(Ne=>(te.runDefaults?.selectedAgentNames??[]).includes(Ne.id)).map(Ne=>Ne.id);P(Z.length>0?Z:oe.map(Ne=>Ne.id)),O(pe.map(Ne=>Ne.id)),k(!0)},[te?.id,te?.sourcePath,oe,pe]);const je=async()=>{if(!te?.sourcePath){h(Re=>[...Re,`[${new Date().toLocaleTimeString()}] Missing source path for selected config.`]);return}const Z=oe.filter(Re=>_.includes(Re.id));if(Z.length===0){h(Re=>[...Re,`[${new Date().toLocaleTimeString()}] Select at least one agent.`]);return}const Ne=pe.filter(Re=>A.includes(Re.id));if(Ne.length===0){h(Re=>[...Re,`[${new Date().toLocaleTimeString()}] Select at least one test.`]);return}o(!0),y(!1),j(!1),x("");const Ie=(te.serverEntries??[]).some(Re=>Re.kind==="referenced")||(te.agentEntries??[]).some(Re=>Re.kind==="referenced")||(te.scenarioEntries??[]).some(Re=>Re.kind==="referenced")?"refs-composed":"single-file/inline";h([`[${new Date().toLocaleTimeString()}] Starting evaluation run...`,`[${new Date().toLocaleTimeString()}] Config=${te.name} mode=${Ie} agents=${Z.map(Re=>Re.name||Re.id).join(", ")} tests=${Ne.map(Re=>Re.id).join(", ")} runs=${Number(r)} snapshotEval=${ae&&R?"on":"off"}${M.trim()?` note=${M.trim()}`:""}`]),d(10);try{const{jobId:Re}=await ee.startRun({configPath:te.sourcePath,runsPerScenario:Number(r),agents:Z.map(De=>De.id),scenarioIds:Ne.map(De=>De.id),applySnapshotEval:ae?R:!1,runNote:M.trim()?M.trim():void 0});N(Re),ye(Re),ct(Re),Se()}catch(Re){const De=Re instanceof Error?Re.message:String(Re),he=De.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(Fe=>[...Fe,`[${new Date().toLocaleTimeString()}] Error: ${De}${he}`]),o(!1),d(0),N(null)}},se=()=>{je()},$e=()=>{S&&ee.stopRun(S),X.current?.(),X.current=null,Ye(),N(null),o(!1),y(!1),j(!0),h(Z=>[...Z,`[${new Date().toLocaleTimeString()}] Run aborted by user.`]),Se()},Ae=async()=>{if(b){U(!0);try{const Z=await ee.createSnapshotFromRun(b,B.trim()||void 0);_e({title:"Snapshot saved",description:`Created ${Z.name} (${Z.id})`}),B.trim()||L(Z.name)}catch(Z){_e({title:"Could not save snapshot",description:Z instanceof Error?Z.message:String(Z),variant:"destructive"})}finally{U(!1)}}};v.useEffect(()=>{D.current&&(D.current.scrollTop=D.current.scrollHeight)},[f]),v.useEffect(()=>()=>{X.current?.()},[]),v.useEffect(()=>{if(S||p)return;let Z="";try{Z=sessionStorage.getItem(m1)??""}catch{Z=""}if(Z)return N(Z),o(!0),y(!1),j(!1),h(Ne=>Ne.length>0?Ne:[`[${new Date().toLocaleTimeString()}] Reattached to in-progress evaluation run...`]),ct(Z),()=>{}},[S,p]),v.useEffect(()=>{$(),Se();const Z=()=>{$(),Se()};return window.addEventListener("focus",Z),()=>{window.removeEventListener("focus",Z)}},[$]);const Ye=()=>{try{sessionStorage.removeItem(m1)}catch{}},ye=Z=>{try{sessionStorage.setItem(m1,Z)}catch{}},Se=async()=>{try{const Z=await ee.getRunQueue();Q(Z.queued),T(Z.active)}catch{}},ze=async Z=>{try{await ee.removeQueuedRun(Z),Q(Ne=>Ne.filter(Ie=>Ie.jobId!==Z))}catch(Ne){const Ie=Ne instanceof Error?Ne.message:String(Ne);if(Ie.includes("Use the /stop endpoint"))try{await ee.stopRun(Z)}catch{}else _e({title:"Could not remove queued run",description:Ie,variant:"destructive"})}Se()},ct=Z=>{X.current?.(),X.current=ee.subscribeRunJob(Z,Ne=>{const Ie=new Date(Ne.ts).toLocaleTimeString();if(Ne.type==="queued"){h(Re=>{const De=Ne.payload.position?` (position ${Ne.payload.position})`:"",he=`[${Ie}] Run queued${De}. Waiting for active run to finish...`;return Re.includes(he)?Re:[...Re,he]}),d(5);return}if(Ne.type==="started"&&(h(Re=>{const De=`[${Ie}] Run started.`;return Re.includes(De)?Re:[...Re,De]}),d(Re=>Math.max(Re,30)),j(!1)),Ne.type==="log"){const Re=String(Ne.payload.message??"").trim();Re&&(h(De=>{const he=`[${Ie}] ${Re}`;return De.includes(he)?De:[...De,he]}),d(De=>{const he=Re.toLowerCase();if(he.startsWith("loading mcp evaluation config"))return Math.max(De,15);if(he.startsWith("loaded config"))return Math.max(De,20);if(he.startsWith("selected "))return Math.max(De,30);if(he.startsWith("using requested agents")||he.startsWith("using resolved default agents"))return Math.max(De,35);if(he.startsWith("expanded to "))return Math.max(De,45);if(he.startsWith("running evaluation"))return Math.max(De,50);const Fe=he.match(/^scenario (\d+)\/(\d+) finished:/);if(Fe){const Ue=Number(Fe[1]),Rt=Number(Fe[2]);return Math.max(De,50+Math.round(Ue/Rt*25))}return he.startsWith("evaluation execution finished")?Math.max(De,78):he.startsWith("applying snapshot evaluation policy")?Math.max(De,82):he.includes("snapshot evaluation applied")||he.includes("snapshot evaluation enabled")?Math.max(De,88):he.startsWith("writing results to ")?Math.max(De,94):he.startsWith("run finished:")?Math.max(De,98):De}))}if(Ne.type==="completed"){const Re=String(Ne.payload.runId??"");if(h(De=>{const he=`[${Ie}] Run completed.`;return De.includes(he)?De:[...De,he]}),Ne.payload.snapshotEval&&typeof Ne.payload.snapshotEval=="object"){const De=Ne.payload.snapshotEval;h(he=>{const Fe=`[${Ie}] Snapshot eval (${De.mode??"warn"}) baseline=${De.baseline_snapshot_id??"-"} score=${De.overall_score??"-"} status=${De.status??"-"}`;return he.includes(Fe)?he:[...he,Fe]})}d(100),o(!1),y(!0),j(!1),x(Re),Ye(),N(null),X.current?.(),X.current=null,Se()}if(Ne.type==="error"){const Re=String(Ne.payload.message??"Unknown error"),De=Re.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(he=>[...he,`[${Ie}] Error: ${Re}${De}`]),o(!1),y(!1),j(!1),d(0),Ye(),N(null),X.current?.(),X.current=null,Se()}})};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($l,{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(We,{children:s.jsxs(Ve,{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(Me,{children:"MCP Evaluation"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(sn,{value:t,onValueChange:n,children:[s.jsx(Zt,{children:s.jsx(on,{placeholder:"Select a config"})}),s.jsx(en,{children:F.map(Z=>s.jsx(it,{value:Z.id,children:Z.name},Z.id))})]}),s.jsx(ie,{type:"button",variant:"outline",size:"icon",className:"h-10 w-10 shrink-0",onClick:()=>{$()},"aria-label":"Refresh configs",title:"Refresh configs",children:s.jsx(Sa,{className:"h-4 w-4"})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Me,{children:"Variance Runs"}),s.jsx(vt,{type:"number",min:"1",max:"10",value:r,onChange:Z=>a(Z.target.value)})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Me,{htmlFor:"run-note",children:"Run Note"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[M.length,"/500"]})]}),s.jsx(Ua,{id:"run-note",value:M,onChange:Z=>z(Z.target.value.slice(0,500)),placeholder:"Optional context for this run (for example: mcp-server v1.8.2 #staging)",rows:2})]}),te&&s.jsxs("div",{className:"space-y-2",children:[ae&&te.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 (",te.snapshotEval.mode,") · baseline:"," ",s.jsx("span",{className:"font-mono",children:te.snapshotEval.baselineSnapshotId??"none"})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Me,{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:()=>P(oe.map(Z=>Z.id)),children:"Select all"}),s.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>P([]),children:"Clear"})]})]}),s.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:oe.map(Z=>{const Ne=_.includes(Z.id);return s.jsxs("label",{className:"flex items-center gap-2 text-sm rounded-md border p-2",children:[s.jsx(ba,{checked:Ne,onCheckedChange:Ie=>{const Re=Ie===!0;P(De=>Re?[...De,Z.id]:De.filter(he=>he!==Z.id))}}),s.jsx("span",{children:Z.name||Z.id})]},Z.id)})}),oe.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents available in this config. Add inline agents or agent references."})]}),te&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Me,{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:()=>O(pe.map(Z=>Z.id)),children:"Select all"}),s.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>O([]),children:"Clear"})]})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[A.length," of ",pe.length," selected"]}),s.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:pe.map(Z=>{const Ne=A.includes(Z.id);return s.jsxs("label",{className:"flex items-start gap-2 text-sm rounded-md border p-2",children:[s.jsx(ba,{checked:Ne,onCheckedChange:Ie=>{const Re=Ie===!0;O(De=>Re?[...De,Z.id]:De.filter(he=>he!==Z.id))}}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:"block font-medium",children:Z.name||Z.id}),s.jsx("span",{className:"block font-mono text-xs text-muted-foreground truncate",children:Z.id})]})]},Z.id)})})]}),ae&&s.jsxs("label",{className:"flex items-center gap-2 text-sm rounded-md border p-2",children:[s.jsx(ba,{checked:R,onCheckedChange:Z=>k(Z===!0)}),s.jsx("span",{children:"Apply snapshot evaluation policy (if configured)"})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(ie,{onClick:se,disabled:!t||oe.length>0&&_.length===0||pe.length>0&&A.length===0,children:[s.jsx($l,{className:"mr-2 h-4 w-4"}),J?"Queue Run":"Run"]}),i&&s.jsxs(ie,{variant:"destructive",onClick:$e,children:[s.jsx(eh,{className:"mr-2 h-4 w-4"}),"Stop"]})]})]})}),(i||f.length>0)&&s.jsxs(We,{children:[s.jsx(Nt,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Ct,{className:"text-base",children:"Progress"}),s.jsxs("span",{className:"text-xs text-muted-foreground font-mono",children:[Math.round(c),"%"]})]})}),s.jsxs(Ve,{className:"space-y-4",children:[s.jsx(tg,{value:c,className:"h-2"}),s.jsx("div",{ref:D,className:"h-64 overflow-auto rounded-md border bg-muted/30 p-3 font-mono text-xs space-y-0.5",children:f.map((Z,Ne)=>s.jsx("div",{className:Z.includes("✓")?"text-success":Z.includes("aborted")?"text-destructive":"text-foreground",children:Z},Ne))})]})]}),s.jsxs(We,{children:[s.jsx(Nt,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(Ct,{className:"inline-flex items-center gap-2 text-base",children:[s.jsx(Jd,{className:"h-4 w-4"}),"Run Queue"]}),s.jsx(ie,{variant:"ghost",size:"sm",onClick:()=>{Se()},children:s.jsx(Sa,{className:"h-3 w-3"})})]})}),s.jsx(Ve,{children:!J&&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:[J&&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===J.jobId?"ring-2 ring-primary/40":""}`,onClick:()=>{S!==J.jobId&&(N(J.jobId),ye(J.jobId),o(!0),y(!1),j(!1),h([`[${new Date().toLocaleTimeString()}] Attached to running job ${J.jobId}...`]),d(10),ct(J.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:J.runParams.configPath.split("/").pop()??J.runParams.configPath}),J.runParams.agents&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:["agents: ",J.runParams.agents.join(", ")]}),J.runParams.runNote&&s.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["note: ",J.runParams.runNote]})]}),s.jsxs(ie,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-destructive hover:text-destructive hover:bg-destructive/10",onClick:Z=>{Z.stopPropagation(),J&&(ee.stopRun(J.jobId),Se())},title:"Stop running job",children:[s.jsx(eh,{className:"mr-1 h-3 w-3"}),"Stop"]})]}),H.map((Z,Ne)=>{const Ie=Z.runParams.configPath.split("/").pop()??Z.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:["#",Ne+1," Queued"]}),s.jsx("span",{className:"font-mono text-xs",children:Ie}),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.jsx(ie,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:()=>{ze(Z.jobId)},title:"Remove from queue",children:s.jsx(Vs,{className:"h-4 w-4"})})]},Z.jobId)})]})})]}),g&&!i&&!p&&s.jsx(We,{className:"border-amber-300/60 bg-amber-50/40",children:s.jsx(Ve,{className:"pt-6",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[s.jsx(eh,{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(ie,{type:"button",variant:"outline",onClick:()=>{h([]),d(0),j(!1)},children:"Clear Progress"}),s.jsxs(ie,{type:"button",onClick:se,disabled:!t,children:[s.jsx($l,{className:"mr-2 h-4 w-4"}),"Run Again"]})]})]})})}),p&&s.jsx(We,{className:"border-success/50",children:s.jsxs(Ve,{className:"pt-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Ml,{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(ie,{asChild:!0,className:"ml-auto",children:s.jsx(xt,{to:`/results/${b}${t?`?configId=${encodeURIComponent(t)}`:""}`,children:"View Results"})})]}),ae&&b&&s.jsxs("div",{className:"mt-4 flex flex-wrap items-end gap-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Me,{className:"text-xs",children:"Snapshot name (optional)"}),s.jsx(vt,{value:B,onChange:Z=>L(Z.target.value),placeholder:"e.g. baseline-v1",className:"h-8 w-64"})]}),s.jsx(ie,{type:"button",variant:"outline",size:"sm",onClick:()=>{Ae()},disabled:G,children:G?"Saving...":"Save Snapshot"})]})]})})]})},age=()=>{const{source:e}=On(),[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,y]=v.useState("desc"),[g,j]=v.useState("all"),b=R=>{if(f===R){y(k=>k==="asc"?"desc":"asc");return}h(R),y(R==="timestamp"?"desc":"asc")},x=async()=>{a(!0);try{n(await e.listResults())}catch(R){_e({title:"Could not load results",description:R instanceof Error?R.message:String(R),variant:"destructive"})}finally{a(!1)}};v.useEffect(()=>{let R=!0;return a(!0),e.listResults().then(k=>{R&&n(k)}).catch(k=>{R&&_e({title:"Could not load results",description:k instanceof Error?k.message:String(k),variant:"destructive"})}).finally(()=>{R&&a(!1)}),()=>{R=!1}},[e]);const S=v.useMemo(()=>{const R=new Set;return t.forEach(k=>{k.scenarios.forEach(M=>{const z=String(M.scenarioName??"").trim(),B=String(M.scenarioId??"").trim(),L=z||B;L&&R.add(L)})}),Array.from(R).sort((k,M)=>k.localeCompare(M))},[t]),N=v.useMemo(()=>g==="all"?t:t.filter(R=>R.scenarios.some(k=>{const M=String(k.scenarioName??"").trim(),z=String(k.scenarioId??"").trim();return(M||z)===g})),[t,g]),_=v.useMemo(()=>[...N].sort((k,M)=>{let z=0;return f==="id"&&(z=k.id.localeCompare(M.id)),f==="timestamp"&&(z=new Date(k.timestamp).getTime()-new Date(M.timestamp).getTime()),f==="passRate"&&(z=k.overallPassRate-M.overallPassRate),f==="scenarios"&&(z=k.totalScenarios-M.totalScenarios),f==="avgToolCalls"&&(z=k.avgToolCalls-M.avgToolCalls),p==="asc"?z:-z}),[N,f,p]),P=R=>f!==R?s.jsx(Il,{className:"h-3.5 w-3.5 text-muted-foreground"}):p==="asc"?s.jsx(cs,{className:"h-3.5 w-3.5"}):s.jsx(Wt,{className:"h-3.5 w-3.5"}),A=R=>{const k=Array.from(new Map(R.scenarios.map(L=>{const G=String(L.scenarioId??"").trim(),U=String(L.scenarioName??"").trim();return!G&&!U?null:[G||U,U||G]}).filter(L=>!!L)).values()),M=Array.from(new Set(R.scenarios.map(L=>L.agentName).filter(Boolean))),z=k.slice(0,2).join(", "),B=k.length>2?` +${k.length-2}`:"";return{scenarioCount:k.length,agentCount:M.length,scenarioPreview:z?`${z}${B}`:"n/a"}},O=async R=>{d(!0);try{await e.deleteResult(R),n(k=>k.filter(M=>M.id!==R)),_e({title:"Run deleted",description:R}),o(null)}catch(k){_e({title:"Could not delete run",description:k instanceof Error?k.message:String(k),variant:"destructive"})}finally{d(!1)}};return s.jsxs("div",{className:"space-y-6",children:[s.jsx(Ss,{open:i!==null,onOpenChange:R=>{!R&&!c&&o(null)},children:s.jsxs(Ga,{children:[s.jsxs(Ya,{children:[s.jsx(Qa,{children:"Delete run?"}),s.jsxs(Ja,{children:["This will permanently remove the run artifacts from disk for"," ",s.jsx("span",{className:"font-mono",children:i??""}),"."]})]}),s.jsxs(Xa,{children:[s.jsx(es,{disabled:c,children:"Cancel"}),s.jsx(Za,{disabled:c||!i,onClick:R=>{R.preventDefault(),i&&O(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(ad,{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(sn,{value:g,onValueChange:j,children:[s.jsx(Zt,{className:"w-[260px]",children:s.jsx(on,{placeholder:"Filter by scenario"})}),s.jsxs(en,{children:[s.jsx(it,{value:"all",children:"All scenarios"}),S.map(R=>s.jsx(it,{value:R,children:R},R))]})]}),s.jsx(ie,{variant:"outline",onClick:()=>{x()},disabled:r,children:r?"Refreshing...":"Refresh"})]})]}),s.jsx(We,{children:s.jsx(Ve,{className:"p-0",children:s.jsxs(Zr,{children:[s.jsx(ea,{children:s.jsxs(Bt,{children:[s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>b("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:()=>b("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:()=>b("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:()=>b("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:()=>b("avgToolCalls"),children:["Avg Tool Calls",P("avgToolCalls")]})}),s.jsx(tt,{className:"w-10"})]})}),s.jsx(ta,{children:_.map(R=>s.jsxs(Bt,{children:[s.jsx(Ke,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(xt,{to:`/results/${R.id}`,className:"font-mono text-xs text-primary hover:underline",children:R.id}),R.configId?s.jsx("div",{className:"text-[11px] text-muted-foreground",children:R.configId}):null,R.runNote?s.jsxs("div",{className:"text-[11px] text-muted-foreground break-words",children:["Note: ",R.runNote]}):null]})}),s.jsx(Ke,{className:"text-[11px] text-muted-foreground",children:(()=>{const k=A(R);return s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:["Evaluated: ",k.scenarioCount," scenario",k.scenarioCount===1?"":"s"," · ",k.agentCount," agent",k.agentCount===1?"":"s"]}),s.jsx("div",{className:"font-mono text-xs text-foreground/80",children:k.scenarioPreview})]})})()}),s.jsx(Ke,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Jd,{className:"h-3 w-3"}),new Date(R.timestamp).toLocaleString()]})}),s.jsx(Ke,{children:s.jsx(xo,{rate:R.overallPassRate})}),s.jsx(Ke,{className:"font-mono text-sm",children:R.totalScenarios}),s.jsx(Ke,{className:"font-mono text-sm",children:R.avgToolCalls.toFixed(0)}),s.jsx(Ke,{children:s.jsxs(Wc,{children:[s.jsx(Vc,{asChild:!0,children:s.jsx(ie,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Am,{className:"h-4 w-4"})})}),s.jsxs(Ho,{align:"end",children:[s.jsx(gr,{asChild:!0,children:s.jsxs(xt,{to:`/results/${R.id}`,children:[s.jsx(OU,{className:"mr-2 h-3.5 w-3.5"}),"View"]})}),s.jsxs(gr,{children:[s.jsx(wa,{className:"mr-2 h-3.5 w-3.5"}),"Export JSON"]}),s.jsxs(gr,{className:"text-destructive",onSelect:k=>{k.preventDefault(),o(R.id)},children:[s.jsx(Na,{className:"mr-2 h-3.5 w-3.5"}),"Delete"]})]})]})})]},R.id))})]})})})]})};function rd({text:e,variant:t="assistant",className:n}){const r=sge(e);return s.jsx("div",{className:be("space-y-2",t==="system"&&"text-xs",n),children:r.map((a,i)=>s.jsx(v.Fragment,{children:ige(a,i,t)},`md-${i}`))})}function sge(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 y=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:y,code:g.join(`
146
+ `)});continue}if(/^---+$/.test(c)||/^\*\*\*+$/.test(c)){n.push({type:"hr"}),r+=1;continue}if(c.startsWith(">")){const y=[];for(;r<t.length&&t[r].trim().startsWith(">");)y.push(t[r].trim().replace(/^>\s?/,"")),r+=1;n.push({type:"blockquote",text:y.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(bM(t,r)){const y=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:y,rows:g});continue}const f=c.match(/^\d+\.\s+/),h=c.match(/^[-*+]\s+/);if(f||h){const y=!!f,g=[];for(;r<t.length;){const j=t[r].trim();if(y?/^\d+\.\s+/.test(j):/^[-*+]\s+/.test(j)){g.push(j.replace(y?/^\d+\.\s+/:/^[-*+]\s+/,"")),r+=1;continue}a(t[r])&&(r+=1);break}n.push({type:"list",ordered:y,items:g});continue}const p=[o];for(r+=1;r<t.length;){const y=t[r],g=y.trim();if(a(y)||i(y)||/^---+$/.test(g)||/^#{1,4}\s+/.test(g)||g.startsWith(">")||bM(t,r)||/^\d+\.\s+/.test(g)||/^[-*+]\s+/.test(g))break;p.push(y),r+=1}n.push({type:"paragraph",text:p.join(`
148
+ `)})}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 ige(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:Sl(e.text,`${t}-h`)})}if(e.type==="paragraph")return s.jsx("p",{className:be("whitespace-pre-wrap leading-relaxed",n==="system"&&"leading-normal"),children:Sl(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:Sl(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:be("space-y-1 pl-5",e.ordered?"list-decimal":"list-disc"),children:e.items.map((a,i)=>s.jsx("li",{className:"leading-relaxed",children:Sl(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:Sl(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:Sl(i,`${t}-tdc-${a}-${o}`)},`${t}-td-${a}-${o}`))},`${t}-row-${a}`))})]})}):null}function Sl(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 oge(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">${uo(c.scenarioName)}</span>
153
+ <span class="scenario-agent">${uo(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">${uo(f.name)} <small>${f.duration}ms</small></span>`).join("")}
166
+ </div>
167
+ ${d.failureReasons.length?`<div class="failure-reasons">${d.failureReasons.map(f=>uo(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 — ${uo(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">${uo(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">${uo(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 uo(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}const lge="mcplab.resultAssistantScenarioHandoff",cge=[{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 jM(e){const t=new Date().toISOString().replace(/[:]/g,"-").replace(/\..+/,"");return`mcplab/reports/result-assistant/${e}-${t}.md`}function SM(e){const t=e.toFixed(1);return t.endsWith(".0")?t.slice(0,-2):t}const uge=()=>{const{id:e}=Do(),t=_a(),[n]=Tc(),{source:r}=On(),a=bf("snapshots",!1),{configs:i}=of(),{scenarios:o}=Ha(),[c,d]=v.useState(void 0),[f,h]=v.useState(!0),[p,y]=v.useState(!1),[g,j]=v.useState(""),[b,x]=v.useState(!1),[S,N]=v.useState(new Set),[_,P]=v.useState(new Set),[A,O]=v.useState([]),[R,k]=v.useState(""),[M,z]=v.useState(null),[B,L]=v.useState(!1),[G,U]=v.useState(""),[H,Q]=v.useState(""),[J,T]=v.useState(!1),[D,X]=v.useState(!1),[F,$]=v.useState(null),[ee,ae]=v.useState([]),[K,le]=v.useState([]),[te,de]=v.useState(""),[oe,pe]=v.useState(!1),[je,se]=v.useState(!1),[$e,Ae]=v.useState("assistant"),[Ye,ye]=v.useState(null),[Se,ze]=v.useState(null),[ct,Z]=v.useState(!1),[Ne,Ie]=v.useState(""),[Re,De]=v.useState(""),[he,Fe]=v.useState(!1),[Ue,Rt]=v.useState(!1),[Ht,zt]=v.useState(!1),[$t,Rn]=v.useState([]),[kn,lr]=v.useState(!1),[cr,Ln]=v.useState(""),[ur,_r]=v.useState(null),[Lr,Fr]=v.useState(!1),[Xn,Kt]=v.useState(null),_n=v.useRef(null),ce=v.useRef(null),ke=v.useCallback(async(V,ge)=>{lr(!0);try{const Pe=(await r.listMarkdownReports()).filter(kt=>{const Pt=String(kt.relativePath??""),In=String(kt.name??"");return Pt.includes(V)||In.includes(V)});if(Rn(Pe),ge&&Pe.length>0){const kt=Pe.find(Pt=>Pt.relativePath===ge||Pt.path===ge||Pt.relativePath.endsWith(ge)||Pt.path.endsWith(ge));kt&&Ln(kt.relativePath)}return Pe}catch{return Rn([]),[]}finally{lr(!1)}},[r]);v.useEffect(()=>{if(!e)return;let V=!0;const ge=F;return ge&&(r.closeResultAssistantSession(ge).catch(()=>{}),$(null),ae([]),le([]),ze(null)),h(!0),r.getResult(e).then(st=>{V&&(d(st),j(st?.runNote??""),y(!1),h(!1))}),()=>{V=!1}},[e,r]),v.useEffect(()=>{let V=!0;return r.listSnapshots().then(ge=>{V&&O(ge)}).catch(()=>{V&&O([])}),()=>{V=!1}},[r]),v.useEffect(()=>{if(!c?.id){Rn([]);return}let V=!0;return(async()=>{const ge=await ke(c.id)})(),()=>{V=!1}},[c?.id,ke]),v.useEffect(()=>{if($t.length===0){Ln(""),_r(null),Kt(null);return}(!cr||!$t.some(V=>V.relativePath===cr))&&Ln($t[0].relativePath)},[$t,cr]),v.useEffect(()=>{if(!D||$e!=="reports")return;if(!cr){_r(null),Kt(null);return}let V=!0;return Fr(!0),Kt(null),r.getMarkdownReport(cr).then(ge=>{V&&_r(ge)}).catch(ge=>{V&&(_r(null),Kt(ge instanceof Error?ge.message:String(ge)))}).finally(()=>{V&&Fr(!1)}),()=>{V=!1}},[D,$e,cr,r]);const nt=n.get("configId")??"",yt=v.useMemo(()=>{const V=nt?i.find(ge=>ge.id===nt):void 0;return V||(c?i.find(ge=>ge.id===c.configId):void 0)},[i,nt,c]),Dt=v.useMemo(()=>{const V=new Map;if(yt){for(const ge of yt.scenarios)V.set(ge.id,ge),ge.name&&!V.has(ge.name)&&V.set(ge.name,ge);for(const ge of yt.scenarioEntries??[]){if(ge.kind!=="referenced")continue;const st=o.find(Pe=>Pe.id===ge.ref);st&&(V.set(st.id,st),st.name&&V.set(st.name,st),V.has(ge.ref)||V.set(ge.ref,st))}}for(const ge of o)V.has(ge.id)||V.set(ge.id,ge),ge.name&&!V.has(ge.name)&&V.set(ge.name,ge);return V},[yt,o]),Yt=v.useMemo(()=>{if(!c?.snapshotEval?.baselineSnapshotId)return"";const V=i.filter(ge=>ge.snapshotEval?.baselineSnapshotId===c.snapshotEval?.baselineSnapshotId);return V.length===1?V[0].id:""},[i,c?.snapshotEval?.baselineSnapshotId]);if(v.useEffect(()=>{c?.snapshotEval?.baselineSnapshotId&&k(V=>V||c.snapshotEval.baselineSnapshotId)},[c?.snapshotEval?.baselineSnapshotId]),v.useEffect(()=>{if(nt&&i.some(V=>V.id===nt)){U(nt);return}Yt&&U(V=>V||Yt)},[nt,i,Yt]),v.useEffect(()=>{if(!D)return;const V=window.setTimeout(()=>{_n.current?.scrollIntoView({behavior:"smooth",block:"end"})},0);return()=>window.clearTimeout(V)},[D,ee.length,oe]),v.useEffect(()=>()=>{F&&r.closeResultAssistantSession(F).catch(()=>{})},[F,r]),v.useEffect(()=>{const V=ce.current;if(!V)return;V.style.height="0px";const ge=Math.min(V.scrollHeight,160);V.style.height=`${Math.max(40,ge)}px`},[te,D]),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 cn=c.scenarios.reduce((V,ge)=>V+ge.runs.filter(st=>st.passed).length,0),dr=c.totalRuns-cn,Sn=[{name:"Pass",value:cn,color:"hsl(152, 69%, 40%)"},{name:"Fail",value:dr,color:"hsl(0, 72%, 51%)"}],Fn={};c.scenarios.forEach(V=>V.runs.forEach(ge=>ge.toolCalls.forEach(st=>{Fn[st.name]=(Fn[st.name]||0)+1})));const Br=Object.entries(Fn).map(([V,ge])=>({name:V,count:ge})).sort((V,ge)=>ge.count-V.count),zr=V=>{N(ge=>{const st=new Set(ge);return st.has(V)?st.delete(V):st.add(V),st})},gn=(V,ge,st,Pe)=>`${V}:${ge}:${st}:${Pe}`,ri=(V,ge)=>`${V}::${ge}`,ts=V=>{P(ge=>{const st=new Set(ge);return st.has(V)?st.delete(V):st.add(V),st})},W=V=>{const ge=!V.endsWith(":conversation");return _.has(V)?!ge:ge},ve=new Map((M?.scenario_results??[]).map(V=>[V.scenario_id,V])),Be=async()=>{if(!(!c||!R)){L(!0);try{const V=await r.compareSnapshot(R,c.id);z(V)}finally{L(!1)}}},ut=async V=>{const ge=V||c.snapshotEval?.baselineSnapshotId;if(ge){k(ge),L(!0);try{const st=await r.compareSnapshot(ge,c.id);z(st)}catch(st){_e({title:"Could not review drift",description:st instanceof Error?st.message:String(st),variant:"destructive"})}finally{L(!1)}}},_t=async()=>{if(!G){_e({title:"Select a configuration",description:"Choose which config should receive the new baseline.",variant:"destructive"});return}T(!0);try{const V=await r.generateSnapshotEvalBaseline(c.id,G,H.trim()||void 0);O(ge=>[V.snapshot,...ge.filter(st=>st.id!==V.snapshot.id)]),k(V.snapshot.id),_e({title:"Baseline updated",description:`${V.snapshot.name} is now linked to the selected config.`}),H.trim()||Q(V.snapshot.name),c.snapshotEval?.applied&&ut(V.snapshot.id)}catch(V){_e({title:"Could not accept new baseline",description:V instanceof Error?V.message:String(V),variant:"destructive"})}finally{T(!1)}},At=async()=>{const V=te.trim();if(!V||!c)return;const ge=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,st={id:ge,role:"user",text:V,createdAt:new Date().toISOString()};de(""),ae(Pe=>[...Pe,st]),pe(!0);try{let Pe=F;if(!Pe){const Pt=await r.createResultAssistantSession(c.id);Pe=Pt.sessionId,$(Pt.session.id),le(Pt.session.pendingToolCalls),ze({assistantAgentName:Pt.session.selectedAssistantAgentName,provider:Pt.session.provider,model:Pt.session.model}),ae(In=>{const ia=In.some(Ar=>Ar.id===ge),Xt=Pt.session.messages;return ia?[...Xt,st]:Xt})}const kt=await r.sendResultAssistantMessage(Pe,V);Ge(kt.session)}catch(Pe){ae(kt=>kt.filter(Pt=>Pt.id!==ge)),_e({title:"MCP Labs Assistant error",description:Pe instanceof Error?Pe.message:String(Pe),variant:"destructive"})}finally{pe(!1)}},yn=V=>{de(V),requestAnimationFrame(()=>ce.current?.focus())},Ge=V=>{$(V.id),ae(V.messages),le(V.pendingToolCalls),ze({assistantAgentName:V.selectedAssistantAgentName,provider:V.provider,model:V.model})},hn=async V=>{if(F){pe(!0);try{const ge=await r.approveResultAssistantToolCall(F,V);Ge(ge.session)}catch(ge){_e({title:"Could not approve assistant action",description:ge instanceof Error?ge.message:String(ge),variant:"destructive"})}finally{pe(!1)}}},Tn=async V=>{if(F){pe(!0);try{const ge=await r.denyResultAssistantToolCall(F,V);Ge(ge.session)}catch(ge){_e({title:"Could not deny assistant action",description:ge instanceof Error?ge.message:String(ge),variant:"destructive"})}finally{pe(!1)}}},Ut=(V,ge)=>{Ae("assistant"),X(!0),ye(ge?.scenarioId??null),ee.length===0&&ae([{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&&de(V)},An=V=>{Ae("reports"),X(!0)},xn=()=>{Ae("note"),X(!0)},ng=V=>{if(!c)return;if(!Ye){_e({title:"No scenario context",description:"Ask about a specific scenario or run first, then send the suggestion.",variant:"destructive"});return}const ge=o.find(Pe=>Pe.id===Ye)??o.find(Pe=>Pe.name===Ye);if(!ge){_e({title:"Scenario not found in library",description:`Could not find library scenario '${Ye}' to open in Scenario Assistant.`,variant:"destructive"});return}const st=[`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(lge,JSON.stringify({type:"result-assistant-handoff-v1",runId:c.id,configId:nt||c.configId||"",scenarioId:ge.id,prompt:st,sourceReply:V})),t(`/libraries/test-cases/${encodeURIComponent(ge.id)}?assistantHandoff=1`)}catch(Pe){_e({title:"Could not create handoff",description:Pe instanceof Error?Pe.message:String(Pe),variant:"destructive"})}},Ko=V=>{c&&(zt(!1),Ie(V),De(jM(c.id)),Fe(!1),Z(!0))},Sf=()=>{c&&(zt(!0),Ie(""),De(jM(c.id)),Fe(!1),Z(!0))},Go=async()=>{if(!c)return;if(!Ne.trim()){_e({title:"No markdown to write",description:"The selected assistant response is empty.",variant:"destructive"});return}Rt(!0);try{const ge=await r.applyResultAssistantReport({runId:c.id,markdown:Ne,outputPath:Re.trim()||void 0,overwrite:he});_e({title:"Markdown report written",description:typeof ge.path=="string"&&ge.path?ge.path:ge.outputPath}),await ke(c.id,typeof ge.path=="string"&&ge.path||ge.outputPath||void 0),D&&Ae("reports"),Z(!1)}catch(ge){_e({title:"Could not write markdown report",description:ge instanceof Error?ge.message:String(ge),variant:"destructive"})}finally{Rt(!1)}},rg=async V=>{try{await navigator.clipboard.writeText(V),_e({title:"Copied"})}catch(ge){_e({title:"Could not copy",description:ge instanceof Error?ge.message:String(ge),variant:"destructive"})}},Nf=async()=>{if(c){x(!0);try{const V=g.trim();await r.updateRunNote(c.id,V||void 0),d(ge=>ge&&{...ge,runNote:V||void 0}),j(V),y(!1),_e({title:"Run note saved"})}catch(V){_e({title:"Could not save run note",description:V instanceof Error?V.message:String(V),variant:"destructive"})}finally{x(!1)}}};return s.jsxs("div",{className:`${D?"xl:flex xl:h-[calc(100vh-2rem-48px)] xl:min-h-0 xl:flex-col xl:overflow-hidden":""}`,children:[s.jsx("div",{className:`${D?"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(ie,{variant:"ghost",size:"icon",asChild:!0,children:s.jsx(xt,{to:"/results",children:s.jsx(jo,{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(xo,{rate:c.overallPassRate}),a&&c.snapshotEval?.applied&&s.jsxs(Je,{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()," · 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:[a&&c.snapshotEval?.applied&&s.jsxs(ie,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>{ut()},disabled:B,children:[s.jsx(AS,{className:"h-3.5 w-3.5"}),B?"Reviewing drift...":"Review Drift"]}),s.jsxs(ie,{variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>{const V=oge(c),ge=new Blob([V],{type:"text/html"}),st=URL.createObjectURL(ge),Pe=document.createElement("a");Pe.href=st,Pe.download=`mcplab-report-${c.id}.html`,Pe.click(),URL.revokeObjectURL(st)},children:[s.jsx(wa,{className:"h-3.5 w-3.5"}),"Download Report"]}),s.jsxs(ie,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>An(),disabled:kn,children:[s.jsx(El,{className:"h-3.5 w-3.5"}),kn?"Reference Reports...":`Reference Reports${$t.length?` (${$t.length})`:""}`]}),s.jsxs(ie,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>xn(),children:[s.jsx(El,{className:"h-3.5 w-3.5"}),"Run Note"]}),s.jsxs(ie,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>Ut(),children:[s.jsx(va,{className:"h-3.5 w-3.5"}),"MCP Labs Assistant"]})]})]})}),s.jsxs("div",{className:`grid gap-6 items-start ${D?je?"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 ${D?"xl:h-full xl:min-h-0 xl:overflow-y-auto xl:pr-2":""}`,children:[a&&c.snapshotEval?.applied&&s.jsxs(We,{className:"border-amber-500/30",children:[s.jsx(Nt,{className:"pb-3",children:s.jsx(Ct,{className:"text-base",children:"Snapshot Drift Review"})}),s.jsxs(Ve,{className:"space-y-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[s.jsxs(Je,{variant:"outline",children:["Mode: ",c.snapshotEval.mode]}),s.jsxs(Je,{variant:"outline",children:["Status: ",c.snapshotEval.status]}),s.jsxs(Je,{variant:"outline",children:["Overall score: ",c.snapshotEval.overallScore]}),s.jsxs(Je,{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(sn,{value:G,onValueChange:U,children:[s.jsx(Zt,{className:"h-8",children:s.jsx(on,{placeholder:"Select config to update"})}),s.jsx(en,{children:i.map(V=>s.jsx(it,{value:V.id,children:V.name},V.id))})]}),!G&&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=>Q(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(ie,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5",onClick:()=>{ut()},disabled:B,children:[s.jsx(Sa,{className:`h-3.5 w-3.5 ${B?"animate-spin":""}`}),"Review Drift"]}),s.jsx(ie,{type:"button",size:"sm",className:"h-8",onClick:()=>{_t()},disabled:J||c.overallPassRate!==1,children:J?"Accepting...":"Accept as New Baseline"})]})]}),c.overallPassRate!==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-5",children:[s.jsx($s,{title:"Scenarios",value:c.totalScenarios,icon:b1}),s.jsx($s,{title:"Total Runs",value:c.totalRuns,icon:n$}),s.jsx($s,{title:"Pass Rate",value:`${Math.round(c.overallPassRate*100)}%`,icon:ad}),s.jsx($s,{title:"Avg Tool Calls",value:SM(c.avgToolCalls),icon:Ml}),s.jsx($s,{title:"Avg Latency",value:`${c.avgLatency}ms`,icon:f$})]}),s.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[s.jsxs(We,{children:[s.jsx(Nt,{className:"pb-2",children:s.jsx(Ct,{className:"text-base",children:"Pass / Fail"})}),s.jsxs(Ve,{className:"flex items-center justify-center",children:[s.jsxs(Zde,{width:180,height:180,children:[s.jsx(ti,{data:Sn,dataKey:"value",innerRadius:50,outerRadius:75,paddingAngle:3,children:Sn.map((V,ge)=>s.jsx(dv,{fill:V.color},ge))}),s.jsx(Yr,{})]}),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"}),cn," 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"}),dr," failed"]})]})]})]}),s.jsxs(We,{children:[s.jsx(Nt,{className:"pb-2",children:s.jsx(Ct,{className:"text-base",children:"Tool Usage"})}),s.jsx(Ve,{children:s.jsx(nj,{width:"100%",height:180,children:s.jsxs(Jde,{data:Br,layout:"vertical",children:[s.jsx(Oo,{type:"number",tick:{fontSize:11}}),s.jsx(Ro,{type:"category",dataKey:"name",tick:{fontSize:11},width:120}),s.jsx(Yr,{}),s.jsx(qo,{dataKey:"count",fill:"hsl(38, 92%, 50%)",radius:[0,4,4,0]})]})})})]})]}),s.jsxs(We,{children:[s.jsx(Nt,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx(Ct,{className:"text-base",children:"Scenarios"}),s.jsxs(ie,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5 px-2 text-xs",onClick:()=>Ut("Summarize the scenario results in this run. Highlight failed scenarios/checks first, then mention notable tool usage and extracted values."),children:[s.jsx(va,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})]})}),s.jsxs(Ve,{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(sn,{value:R,onValueChange:k,children:[s.jsx(Zt,{className:"h-8",children:s.jsx(on,{placeholder:"Select snapshot"})}),s.jsx(en,{children:A.map(V=>s.jsx(it,{value:V.id,children:V.name},V.id))})]})]}),s.jsx(ie,{type:"button",variant:"outline",size:"sm",disabled:!R||B,onClick:()=>{Be()},children:B?"Comparing...":"Compare Snapshot"}),M&&s.jsxs(Je,{variant:"outline",className:"h-8 px-2 py-0 text-xs",children:["Overall snapshot score: ",M.overall_score]})]}),s.jsxs(Zr,{children:[s.jsx(ea,{children:s.jsxs(Bt,{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:"Snapshot"})]})}),s.jsx(ta,{children:c.scenarios.map(V=>{const ge=ri(V.scenarioId,V.agentName),st=V.scenarioName||V.scenarioId;return s.jsx(Ai,{open:S.has(ge),onOpenChange:()=>zr(ge),asChild:!0,children:s.jsxs(s.Fragment,{children:[s.jsx(Ms,{asChild:!0,children:s.jsxs(Bt,{className:"cursor-pointer hover:bg-muted/50",children:[s.jsx(Ke,{children:s.jsx(Wt,{className:`h-4 w-4 transition-transform ${S.has(ge)?"rotate-180":""}`})}),s.jsx(Ke,{className:"font-medium text-sm",children:V.scenarioName}),s.jsx(Ke,{className:"text-sm",children:V.agentName}),s.jsx(Ke,{className:"font-mono text-sm",children:V.runs.length}),s.jsx(Ke,{children:s.jsx(xo,{rate:V.passRate})}),s.jsx(Ke,{className:"font-mono text-sm",children:SM(V.avgToolCalls)}),s.jsx(Ke,{children:(()=>{const Pe=ve.get(V.scenarioId);if(!Pe)return s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"});const kt=Pe.status==="Match"?"bg-success/15 text-success":Pe.status==="Warn"?"bg-amber-500/15 text-amber-600":"bg-destructive/15 text-destructive";return s.jsxs(Je,{variant:"outline",className:`text-xs ${kt}`,children:[Pe.status," · ",Pe.score]})})()})]})}),s.jsx(Ei,{asChild:!0,children:s.jsx("tr",{children:s.jsx("td",{colSpan:7,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:[st," · ",V.agentName," · ",Math.round(V.passRate*100),"% pass rate"]})]}),s.jsxs(ie,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>Ut(`Explain why scenario '${st}' failed (agent: ${V.agentName}). Summarize the likely cause from the result details and suggest what to inspect next.`,{scenarioId:V.scenarioId}),children:[s.jsx(va,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})]}),(()=>{const Pe=ve.get(V.scenarioId);return!Pe||Pe.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: ",Pe.baseline_agents.join(", ")||"—"," · observed agents: ",Pe.observed_agents.join(", ")||"—"]}),s.jsx("ul",{className:"space-y-1 text-xs text-muted-foreground",children:Pe.reasons.map((kt,Pt)=>s.jsxs("li",{children:["• ",kt]},Pt))})]})})(),V.runs.map(Pe=>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:Pe.passed?s.jsx(Ml,{className:"h-4 w-4 text-success"}):s.jsx(Zp,{className:"h-4 w-4 text-destructive"})}),s.jsxs("div",{className:"flex-1 space-y-1",children:[(()=>{const kt=Dt.get(V.scenarioId),Pt=kt?pge(kt.evalRules,Pe.failureReasons):[],In=Pt.filter(Xt=>Xt.status==="failed"),ia=Pt.filter(Xt=>Xt.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 #",Pe.runIndex+1]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[Pe.duration,"ms"]}),!Pe.passed&&s.jsx(Je,{variant:"outline",className:"h-5 border-destructive/30 bg-destructive/10 text-destructive text-[10px]",children:"Failed"})]}),Pe.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(Zp,{className:"h-3.5 w-3.5"}),"Failure reasons"]}),s.jsx("ul",{className:"space-y-1 text-xs text-destructive",children:Pe.failureReasons.map((Xt,Ar)=>s.jsxs("li",{children:["• ",_M(Xt)]},Ar))})]}),Pt.length>0&&s.jsx(Ai,{open:W(gn(V.scenarioId,V.agentName,Pe.runIndex,"checks")),onOpenChange:()=>ts(gn(V.scenarioId,V.agentName,Pe.runIndex,"checks")),children:s.jsxs("div",{className:"rounded-md border bg-muted/20 p-2",children:[s.jsx(Ms,{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(Wt,{className:`h-3.5 w-3.5 transition-transform ${W(gn(V.scenarioId,V.agentName,Pe.runIndex,"checks"))?"rotate-180":""}`}),s.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Checks"}),s.jsxs(Je,{variant:"outline",className:"h-5 border-success/30 bg-success/10 text-success text-[10px]",children:[ia.length," passed"]}),s.jsxs(Je,{variant:"outline",className:`h-5 text-[10px] ${In.length>0?"border-destructive/30 bg-destructive/10 text-destructive":""}`,children:[In.length," failed"]})]})}),s.jsx(Ei,{children:s.jsx("div",{className:"space-y-1",children:Pt.map((Xt,Ar)=>s.jsxs("div",{className:`flex items-start justify-between gap-2 rounded-md border px-2 py-1.5 text-xs ${Xt.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:[Xt.status==="failed"?s.jsx(Zp,{className:"h-3.5 w-3.5 shrink-0 text-destructive"}):s.jsx(Ml,{className:"h-3.5 w-3.5 shrink-0 text-success"}),s.jsx("span",{className:"font-medium",children:mge(Xt.rule)})]}),Xt.failureReason&&s.jsx("p",{className:"mt-1 pl-5 text-[11px] text-destructive",children:_M(Xt.failureReason)})]}),s.jsx(Je,{variant:"outline",className:`shrink-0 text-[10px] ${Xt.status==="failed"?"border-destructive/30 text-destructive":"border-success/30 text-success"}`,children:Xt.status})]},`${Xt.rule.type}-${Xt.rule.value}-${Ar}`))})})]})})]})})(),s.jsx(Ai,{open:W(gn(V.scenarioId,V.agentName,Pe.runIndex,"extracts")),onOpenChange:()=>ts(gn(V.scenarioId,V.agentName,Pe.runIndex,"extracts")),children:s.jsxs("div",{className:"rounded-md border border-violet-500/20 bg-violet-500/5 p-2",children:[s.jsx(Ms,{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(Wt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${W(gn(V.scenarioId,V.agentName,Pe.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(b1,{className:"h-3.5 w-3.5 text-violet-600"}),"Extracted values"]})]}),s.jsxs(Je,{variant:"outline",className:"h-5 text-[10px]",children:[Object.keys(Pe.extractedValues??{}).length," total"]})]})}),s.jsx(Ei,{children:Object.keys(Pe.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(Pe.extractedValues??{}).map(([kt,Pt])=>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:Pt===null?"null":String(Pt)})]},kt))})})]})}),s.jsx(Ai,{open:W(gn(V.scenarioId,V.agentName,Pe.runIndex,"tools")),onOpenChange:()=>ts(gn(V.scenarioId,V.agentName,Pe.runIndex,"tools")),children:s.jsxs("div",{className:"rounded-md border border-sky-500/20 bg-sky-500/5 p-2",children:[s.jsx(Ms,{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(Wt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${W(gn(V.scenarioId,V.agentName,Pe.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(Ds,{className:"h-3.5 w-3.5 text-sky-600"}),"Tool call sequence"]})]}),s.jsxs(Je,{variant:"outline",className:"h-5 text-[10px]",children:[Pe.toolCalls.length," total"]})]})}),s.jsx(Ei,{children:Pe.toolCalls.length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No tool calls captured for this run."}):s.jsx("div",{className:"flex flex-wrap gap-1",children:Pe.toolCalls.map((kt,Pt)=>s.jsxs(Je,{variant:"outline",className:"font-mono text-xs bg-background",children:[s.jsxs("span",{className:"mr-1 text-muted-foreground",children:["#",Pt+1]}),kt.name,s.jsxs("span",{className:"ml-1 text-muted-foreground",children:[kt.duration,"ms"]})]},Pt))})})]})}),s.jsx(Ai,{open:W(gn(V.scenarioId,V.agentName,Pe.runIndex,"final")),onOpenChange:()=>ts(gn(V.scenarioId,V.agentName,Pe.runIndex,"final")),children:s.jsxs("div",{className:"rounded-md border border-muted-foreground/20 bg-card p-2",children:[s.jsx(Ms,{asChild:!0,children:s.jsxs("button",{type:"button",className:"mb-2 flex w-full items-center gap-2 text-left",children:[s.jsx(Wt,{className:`h-3.5 w-3.5 transition-transform ${W(gn(V.scenarioId,V.agentName,Pe.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(ya,{className:"h-3.5 w-3.5"}),"Final answer"]})]})}),s.jsx(Ei,{children:s.jsx(wS,{text:Pe.finalAnswer||"No final answer captured.",maxLength:1200,className:"text-xs text-foreground"})})]})}),s.jsx(Ai,{open:W(gn(V.scenarioId,V.agentName,Pe.runIndex,"conversation")),onOpenChange:()=>ts(gn(V.scenarioId,V.agentName,Pe.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(Ms,{asChild:!0,children:s.jsxs("button",{type:"button",className:"flex min-w-0 items-center gap-2 text-left",children:[s.jsx(Wt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${W(gn(V.scenarioId,V.agentName,Pe.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(ie,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>Ut(`Explain Run #${Pe.runIndex+1} for scenario '${st}'. It ${Pe.passed?"passed":"failed"} in ${Pe.duration}ms. Focus on the tool sequence and ${Pe.passed?"why it passed":"what caused the failure"}.`,{scenarioId:V.scenarioId}),children:[s.jsx(va,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})})]}),s.jsx(Ei,{children:s.jsx("div",{className:"space-y-2 rounded-md border bg-muted/20 p-2",children:Pe.conversation.length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No conversation trace captured."}):Pe.conversation.map(kt=>s.jsx(dge,{item:kt,fallbackUserPrompt:Dt.get(V.scenarioId)?.prompt},kt.id))})}),!W(gn(V.scenarioId,V.agentName,Pe.runIndex,"conversation"))&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"Expand to inspect user/assistant/tool messages for this run."})]})})]})]},Pe.runIndex))]})})})})]})},ge)})})]})]})]})]}),D&&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(oC,{value:$e,onValueChange:V=>Ae(V),className:"min-w-0 -mb-px px-3 pt-1",children:s.jsxs(Wv,{className:"h-auto w-full justify-start rounded-none border-b bg-transparent p-0",children:[s.jsx(Ti,{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(Ti,{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(Ti,{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"})]})}),$e==="assistant"?s.jsxs(We,{className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[s.jsx(Nt,{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(Ct,{className:"flex items-center gap-2 text-base",children:[s.jsx(va,{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(ie,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>se(V=>!V),children:[je?s.jsx(Ky,{className:"h-3.5 w-3.5"}):s.jsx(Gy,{className:"h-3.5 w-3.5"}),je?"Compact":"Expand"]}),s.jsx(ie,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>X(!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(Ve,{className:"flex h-[70vh] min-h-[520px] flex-col p-0 xl:h-auto xl:min-h-0 xl:flex-1",children:[s.jsx(jm,{className:"min-h-0 flex-1 bg-muted/15 px-4 py-4",children:s.jsxs("div",{className:"space-y-3 pr-2",children:[ee.map((V,ge)=>{const st=V.role==="user",Pe=V.role==="assistant",kt=V.role==="system",Pt=V.role==="tool",In=V.pendingToolCallId?K.find(Gc=>Gc.id===V.pendingToolCallId):void 0,ia=Pe&&!!V.pendingToolCallId;if(Pt&&/^(Approved|Denied) tool call\b/i.test(String(V.text??"").trim()))return null;In?.server??V.toolRequestServer;const Xt=In?.tool??V.toolRequestName,Ar=In?.publicToolName??V.toolRequestPublicName,Gi=Pe&&!ia&&fge(V.text,!!Ye);if(ia){const Gc=Xt??Ar??"unknown_tool";return Xt&&Xt.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(ya,{className:"h-3 w-3"})}),s.jsxs("details",{open:!!In,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(Ds,{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 ${Gc}`}),s.jsx("span",{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${In?"bg-amber-100 text-amber-900":"bg-muted text-muted-foreground"}`,children:In?"Needs approval":"Completed"})]})}),s.jsx(Wt,{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(rd,{text:V.text,className:"text-sm"}),In&&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(In.arguments??{},null,2)})}),s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx(ie,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:oe,onClick:()=>{Tn(In.id)},children:"Deny"}),s.jsx(ie,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:oe,onClick:()=>{hn(In.id)},children:"Approve"})]})]})]})]})]},`${V.id??`${V.role}-${ge}`}:${In?"pending":"completed"}`)}const ag=st||Pe&&!Pt&&!kt;return s.jsxs("div",{className:`flex items-start gap-2 ${st?"justify-end":"justify-start"}`,children:[!st&&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(u$,{className:"h-3 w-3"}):s.jsx(ya,{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 ${st?"border-primary/20 bg-primary/10":kt?"border-amber-400/30 bg-amber-50/70":Pt?"border-blue-300/30 bg-blue-50/50":"border-border/80 bg-background shadow-sm"}`,children:[!(st||kt)&&s.jsx("p",{className:`mb-2 text-[11px] font-semibold text-muted-foreground ${st?"text-right":""}`,children:Pt?"Tool":"Assistant"}),s.jsx(rd,{text:V.text,className:"text-sm"}),Gi&&s.jsxs("div",{className:"mt-3 flex max-w-full flex-wrap justify-end gap-2 overflow-x-auto pb-1",children:[s.jsxs(ie,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>ng(V.text),children:[s.jsx(va,{className:"h-3.5 w-3.5"}),"Send to Scenario Assistant"]}),s.jsxs(ie,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>Ko(V.text),children:[s.jsx(Ds,{className:"h-3.5 w-3.5"}),"Apply: Write Markdown Report"]})]}),!Gi&&Pe&&!ia&&s.jsx("div",{className:"mt-3 flex max-w-full justify-end overflow-x-auto pb-1",children:s.jsxs(ie,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>Ko(V.text),children:[s.jsx(Ds,{className:"h-3.5 w-3.5"}),"Apply: Write Markdown Report"]})})]}),ag&&s.jsx(ie,{type:"button",variant:"ghost",size:"icon",className:"absolute -right-8 bottom-1 h-6 w-6 text-muted-foreground",onClick:()=>{rg(V.text)},"aria-label":"Copy message",title:"Copy message",children:s.jsx(Mi,{className:"h-3.5 w-3.5"})})]}),st&&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(OS,{className:"h-3 w-3"})})]},V.id??`${V.role}-${ge}`)}),K.filter(V=>!ee.some(ge=>ge.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)"}),K.filter(V=>!ee.some(ge=>ge.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(Wt,{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(ie,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:oe,onClick:()=>{Tn(V.id)},children:"Deny"}),s.jsx(ie,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:oe,onClick:()=>{hn(V.id)},children:"Approve"})]})]})]},V.id))]}),oe&&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(ya,{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(ir,{className:"h-4 w-4 animate-spin"}),"Thinking..."]})]}),s.jsx("div",{ref:_n})]})}),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(Ua,{ref:ce,value:te,onChange:V=>de(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(),oe||At())}}),s.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 px-1 pt-1",children:[s.jsxs(Wc,{children:[s.jsx(Vc,{asChild:!0,children:s.jsxs(ie,{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:oe,children:[s.jsx(ps,{className:"h-3 w-3"}),"Snippets",s.jsx(Wt,{className:"h-3 w-3"})]})}),s.jsxs(Ho,{align:"start",className:"w-[360px]",children:[s.jsx(aC,{children:"Result Assistant Snippets"}),s.jsx(sC,{}),cge.map(V=>s.jsx(gr,{className:"items-start whitespace-normal px-2 py-2",onSelect:()=>yn(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(ie,{type:"button",size:"icon",className:"h-8 w-8 shrink-0 rounded-full",onClick:()=>{At()},disabled:oe||!te.trim(),"aria-label":"Send assistant message",title:"Send assistant message",children:oe?s.jsx(ir,{className:"h-4 w-4 animate-spin"}):s.jsxs(s.Fragment,{children:[s.jsx(d$,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Ask"})]})})]})]})})]})]}):$e==="reports"?s.jsxs(We,{className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[s.jsx(Nt,{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(Ct,{className:"flex items-center gap-2 text-base",children:[s.jsx(El,{className:"h-4 w-4 text-muted-foreground"}),"Reference Reports"]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(ie,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>se(V=>!V),children:[je?s.jsx(Ky,{className:"h-3.5 w-3.5"}):s.jsx(Gy,{className:"h-3.5 w-3.5"}),je?"Compact":"Expand"]}),s.jsx(ie,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>X(!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(Ve,{className:"flex h-[70vh] min-h-[520px] flex-col p-0 xl:h-auto xl:min-h-0 xl:flex-1",children:[(kn||$t.length===0||$t.length>1)&&s.jsx("div",{className:"border-b px-4 py-3",children:kn?s.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading reference reports..."}):$t.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(ie,{type:"button",size:"sm",variant:"outline",className:"shrink-0 gap-1.5",onClick:()=>Sf(),children:[s.jsx(ps,{className:"h-3.5 w-3.5"}),"New Report"]})]}):s.jsx("div",{className:"space-y-2",children:$t.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(sn,{value:cr,onValueChange:Ln,children:[s.jsx(Zt,{className:"h-8",children:s.jsx(on,{placeholder:"Select a report"})}),s.jsx(en,{children:$t.map(V=>s.jsx(it,{value:V.relativePath,children:V.name},V.path))})]})]}):null})}),s.jsx(jm,{className:"min-h-0 flex-1 bg-muted/15 px-4 py-4",children:$t.length===0?s.jsx("div",{className:"text-sm text-muted-foreground",children:"No report selected."}):Lr?s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(ir,{className:"h-4 w-4 animate-spin"}),"Loading report..."]}):Xn?s.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive",children:["Could not load report: ",Xn]}):ur?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:ur.name}),s.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:ur.relativePath}),s.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:new Date(ur.mtime).toLocaleString()})]}),s.jsx("div",{className:"rounded-md border bg-background p-3",children:s.jsx(rd,{text:ur.content,className:"text-sm"})})]}):s.jsx("div",{className:"text-sm text-muted-foreground",children:"Select a report to preview."})})]})]}):s.jsxs(We,{className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[s.jsx(Nt,{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(Ct,{className:"flex items-center gap-2 text-base",children:[s.jsx(El,{className:"h-4 w-4 text-muted-foreground"}),"Run Note"]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(ie,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>se(V=>!V),children:[je?s.jsx(Ky,{className:"h-3.5 w-3.5"}):s.jsx(Gy,{className:"h-3.5 w-3.5"}),je?"Compact":"Expand"]}),s.jsx(ie,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>X(!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(Ve,{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(Ua,{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(ie,{size:"sm",onClick:()=>{Nf()},disabled:b,children:b?"Saving...":"Save note"}),s.jsx(ie,{size:"sm",variant:"outline",onClick:()=>{j(c.runNote??""),y(!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(ie,{size:"sm",variant:"ghost",className:"ml-auto h-6 px-2 text-xs",onClick:()=>y(!0),children:c.runNote?"Edit":"Add note"})]})})]})]}),s.jsx(Ss,{open:ct,onOpenChange:V=>!Ue&&Z(V),children:s.jsxs(Ga,{className:"max-w-2xl",children:[s.jsxs(Ya,{children:[s.jsx(Qa,{children:Ht?"Create markdown report":"Approve MCP action: write markdown report"}),s.jsx(Ja,{children:Ht?"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:[!Ht&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Output path"}),s.jsx(vt,{value:Re,onChange:V=>De(V.target.value),placeholder:"mcplab/reports/result-assistant/my-report.md",disabled:Ue})]}),s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx(ba,{checked:he,onCheckedChange:V=>Fe(V===!0),disabled:Ue}),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:Ht?"Markdown content":"Markdown preview (to be written)"}),s.jsx(Ua,{value:Ne,onChange:V=>Ie(V.target.value),rows:10,className:"font-mono text-xs",disabled:Ue})]})]}),s.jsxs(Xa,{children:[s.jsx(es,{disabled:Ue,children:"Cancel"}),s.jsx(Za,{onClick:V=>{V.preventDefault(),Go()},disabled:Ue,children:Ue?"Writing...":Ht?"Save Report":"Approve & Write"})]})]})})]})]})};function dge({item:e,fallbackUserPrompt:t}){if(e.kind==="tool_call")return s.jsx(CM,{variant:"call",title:`Tool call · ${e.toolName||"unknown"}`,text:e.text});if(e.kind==="tool_result"){const d=e.ok?s.jsx(Ml,{className:"h-3.5 w-3.5 text-emerald-700 dark:text-emerald-300"}):s.jsx(Zp,{className:"h-3.5 w-3.5 text-rose-700 dark:text-rose-300"});return s.jsx(CM,{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=NM(e.text,e.kind),a=t?NM(t,"user_prompt"):"",i=n&&!r&&a?a:r,o=n?"User prompt":e.kind==="assistant_final"?"Agent final":"Agent",c=n?OS:ya;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(wS,{text:i,maxLength:280,className:"text-xs"}):s.jsx(wS,{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 NM(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 fge(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 CM({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(Ai,{open:a,onOpenChange:i,children:s.jsxs("div",{className:`rounded-md border p-2 text-xs ${o[e]}`,children:[s.jsx(Ms,{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(Ds,{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(Ei,{children:s.jsx("p",{className:"mt-2 font-mono whitespace-pre-wrap text-foreground",children:n})})]})})}function wS({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(rd,{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 pge(e,t){return e.map(n=>{const r=hge(n,t);return{rule:n,status:r?"failed":"passed",failureReason:r}})}function hge(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 mge(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 _M(e){const t=String(e??"").trim(),n=t.match(/^Regex assertion failed:\s*(.+)$/i);return n?`Text match failed: ${n[1]}`:t}const AM=["hsl(38, 92%, 50%)","hsl(200, 80%, 50%)","hsl(152, 69%, 40%)","hsl(280, 60%, 50%)","hsl(0, 72%, 51%)"],vge=()=>{const{source:e}=On(),t=bf("snapshots",!1),[n,r]=v.useState([]),[a,i]=v.useState(!1),[o,c]=v.useState(new Set),[d,f]=v.useState("timestamp"),[h,p]=v.useState("desc"),[y,g]=v.useState("all"),[j,b]=v.useState("runs"),[x,S]=v.useState([]),[N,_]=v.useState(""),[P,A]=v.useState(""),[O,R]=v.useState(null),k=async()=>{i(!0);try{r(await e.listResults())}catch(T){_e({title:"Could not load results",description:T instanceof Error?T.message:String(T),variant:"destructive"})}finally{i(!1)}};v.useEffect(()=>{let T=!0;return i(!0),e.listResults().then(D=>{T&&r(D)}).catch(D=>{T&&_e({title:"Could not load results",description:D instanceof Error?D.message:String(D),variant:"destructive"})}).finally(()=>{T&&i(!1)}),()=>{T=!1}},[e]),v.useEffect(()=>{let T=!0;return e.listSnapshots().then(D=>{T&&S(D)}).catch(()=>{T&&S([])}),()=>{T=!1}},[e]);const M=T=>{if(d===T){p(D=>D==="asc"?"desc":"asc");return}f(T),p(T==="timestamp"?"desc":"asc")},z=T=>{c(D=>{const X=new Set(D);return X.has(T)?X.delete(T):X.add(T),X})},B=v.useMemo(()=>{const T=new Set;return n.forEach(D=>{D.scenarios.forEach(X=>{const F=String(X.scenarioName??"").trim(),$=String(X.scenarioId??"").trim(),ee=F||$;ee&&T.add(ee)})}),Array.from(T).sort((D,X)=>D.localeCompare(X))},[n]),L=v.useMemo(()=>y==="all"?n:n.filter(T=>T.scenarios.some(D=>{const X=String(D.scenarioName??"").trim(),F=String(D.scenarioId??"").trim();return(X||F)===y})),[n,y]),G=v.useMemo(()=>[...L].sort((D,X)=>{let F=0;return d==="id"&&(F=D.id.localeCompare(X.id)),d==="timestamp"&&(F=new Date(D.timestamp).getTime()-new Date(X.timestamp).getTime()),d==="passRate"&&(F=D.overallPassRate-X.overallPassRate),d==="scenarios"&&(F=D.totalScenarios-X.totalScenarios),h==="asc"?F:-F}),[L,d,h]),U=G.filter(T=>o.has(T.id)),H=T=>d!==T?s.jsx(Il,{className:"h-3.5 w-3.5 text-muted-foreground"}):h==="asc"?s.jsx(cs,{className:"h-3.5 w-3.5"}):s.jsx(Wt,{className:"h-3.5 w-3.5"}),Q=T=>{const D=Array.from(new Set(T.scenarios.map(ee=>ee.scenarioId).filter(Boolean))),X=Array.from(new Set(T.scenarios.map(ee=>ee.agentName).filter(Boolean))),F=D.slice(0,2).join(", "),$=D.length>2?` +${D.length-2}`:"";return{scenarioCount:D.length,agentCount:X.length,scenarioPreview:F?`${F}${$}`:"n/a"}},J=[...new Set(U.flatMap(T=>T.scenarios.map(D=>D.scenarioId)))];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(AS,{className:"h-6 w-6"}),"Compare Runs"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Select 2–5 runs to compare"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[j==="runs"&&s.jsxs(sn,{value:y,onValueChange:g,children:[s.jsx(Zt,{className:"w-[260px]",children:s.jsx(on,{placeholder:"Filter by scenario"})}),s.jsxs(en,{children:[s.jsx(it,{value:"all",children:"All scenarios"}),B.map(T=>s.jsx(it,{value:T,children:T},T))]})]}),s.jsx(ie,{variant:"outline",onClick:()=>{k()},disabled:a,children:a?"Refreshing...":"Refresh"})]})]}),j==="runs"&&s.jsx(We,{children:s.jsx(Ve,{className:"p-0",children:s.jsxs(Zr,{children:[s.jsx(ea,{children:s.jsxs(Bt,{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:()=>M("id"),children:["Run ID",H("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:()=>M("timestamp"),children:["Timestamp",H("timestamp")]})}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>M("passRate"),children:["Pass Rate",H("passRate")]})}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>M("scenarios"),children:["Scenarios",H("scenarios")]})})]})}),s.jsx(ta,{children:G.map(T=>s.jsxs(Bt,{children:[s.jsx(Ke,{children:s.jsx(ba,{checked:o.has(T.id),onCheckedChange:()=>z(T.id),disabled:!o.has(T.id)&&o.size>=5})}),s.jsx(Ke,{className:"font-mono text-xs",children:T.id}),s.jsx(Ke,{className:"text-[11px] text-muted-foreground",children:(()=>{const D=Q(T);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(Ke,{className:"text-xs text-muted-foreground",children:new Date(T.timestamp).toLocaleString()}),s.jsx(Ke,{children:s.jsx(xo,{rate:T.overallPassRate})}),s.jsx(Ke,{className:"font-mono text-sm",children:T.totalScenarios})]},T.id))})]})})}),j==="runs"&&U.length>=2&&s.jsxs(s.Fragment,{children:[U.length===2&&s.jsx(We,{children:s.jsx(Ve,{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(ie,{asChild:!0,size:"sm",children:s.jsx(xt,{to:`/compare/results?left=${encodeURIComponent(U[0].id)}&right=${encodeURIComponent(U[1].id)}&leftConfig=${encodeURIComponent(U[0].configId)}&rightConfig=${encodeURIComponent(U[1].configId)}`,children:"Compare full results"})})]})})}),s.jsxs(We,{children:[s.jsx(Nt,{className:"pb-3",children:s.jsx(Ct,{className:"text-base",children:"Summary Comparison"})}),s.jsx(Ve,{className:"p-0",children:s.jsxs(Zr,{children:[s.jsx(ea,{children:s.jsxs(Bt,{children:[s.jsx(tt,{children:"Metric"}),U.map((T,D)=>s.jsx(tt,{style:{color:AM[D]},className:"font-mono text-xs",children:T.id},T.id))]})}),s.jsxs(ta,{children:[s.jsxs(Bt,{children:[s.jsx(Ke,{className:"font-medium",children:"Pass Rate"}),U.map(T=>s.jsx(Ke,{children:s.jsx(xo,{rate:T.overallPassRate})},T.id))]}),s.jsxs(Bt,{children:[s.jsx(Ke,{className:"font-medium",children:"Total Runs"}),U.map(T=>s.jsx(Ke,{className:"font-mono",children:T.totalRuns},T.id))]}),s.jsxs(Bt,{children:[s.jsx(Ke,{className:"font-medium",children:"Tool Calls"}),U.map(T=>s.jsx(Ke,{className:"font-mono",children:T.avgToolCalls.toFixed(1)},T.id))]}),s.jsxs(Bt,{children:[s.jsx(Ke,{className:"font-medium",children:"Avg Latency"}),U.map(T=>s.jsxs(Ke,{className:"font-mono",children:[T.avgLatency,"ms"]},T.id))]})]})]})})]}),s.jsxs(We,{children:[s.jsx(Nt,{className:"pb-3",children:s.jsx(Ct,{className:"text-base",children:"Scenario Breakdown"})}),s.jsx(Ve,{className:"p-0",children:s.jsxs(Zr,{children:[s.jsx(ea,{children:s.jsxs(Bt,{children:[s.jsx(tt,{children:"Scenario"}),U.map((T,D)=>s.jsx(tt,{style:{color:AM[D]},className:"font-mono text-xs",children:T.id},T.id))]})}),s.jsx(ta,{children:J.map(T=>s.jsxs(Bt,{children:[s.jsx(Ke,{className:"font-medium text-sm",children:T}),U.map(D=>{const X=D.scenarios.find(F=>F.scenarioId===T);return s.jsx(Ke,{children:X?s.jsx(xo,{rate:X.passRate}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})},D.id)})]},T))})]})})]})]}),t&&j==="snapshot"&&s.jsxs(We,{children:[s.jsx(Nt,{className:"pb-3",children:s.jsx(Ct,{className:"text-base",children:"Run vs Snapshot"})}),s.jsxs(Ve,{className:"space-y-3",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(sn,{value:P,onValueChange:A,children:[s.jsx(Zt,{children:s.jsx(on,{placeholder:"Select run"})}),s.jsx(en,{children:n.map(T=>s.jsx(it,{value:T.id,children:T.id},T.id))})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Snapshot"}),s.jsxs(sn,{value:N,onValueChange:_,children:[s.jsx(Zt,{children:s.jsx(on,{placeholder:"Select snapshot"})}),s.jsx(en,{children:x.map(T=>s.jsx(it,{value:T.id,children:T.name},T.id))})]})]})]}),s.jsx(ie,{type:"button",variant:"outline",size:"sm",disabled:!P||!N,onClick:()=>{e.compareSnapshot(N,P).then(R)},children:"Compare"}),O&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("p",{className:"text-sm font-medium",children:["Overall score: ",O.overall_score]}),s.jsxs(Zr,{children:[s.jsx(ea,{children:s.jsxs(Bt,{children:[s.jsx(tt,{children:"Scenario"}),s.jsx(tt,{children:"Agents"}),s.jsx(tt,{children:"Score"}),s.jsx(tt,{children:"Status"}),s.jsx(tt,{children:"Reasons"})]})}),s.jsx(ta,{children:O.scenario_results.map(T=>s.jsxs(Bt,{children:[s.jsx(Ke,{children:T.scenario_id}),s.jsxs(Ke,{className:"text-xs text-muted-foreground",children:["baseline: ",T.baseline_agents.join(", ")||"—"," · observed: ",T.observed_agents.join(", ")||"—"]}),s.jsx(Ke,{className:"font-mono text-xs",children:T.score}),s.jsx(Ke,{children:T.status}),s.jsx(Ke,{className:"text-xs text-muted-foreground",children:T.reasons.slice(0,2).join("; ")||"—"})]},T.scenario_id))})]})]})]})]})]})},EM=(e,t)=>{const n=new URLSearchParams;return t&&n.set("configId",t),n.set("embed","1"),`/results/${encodeURIComponent(e)}?${n.toString()}`},gge=()=>{const[e]=Tc(),t=e.get("left")??"",n=e.get("right")??"",r=e.get("leftConfig"),a=e.get("rightConfig");return!t||!n?s.jsxs(We,{children:[s.jsx(Nt,{children:s.jsx(Ct,{className:"text-base",children:"Full Result Compare"})}),s.jsxs(Ve,{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(ie,{asChild:!0,variant:"outline",children:s.jsx(xt,{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:"Side-by-side Result Detail views for deep inspection."})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(ie,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs(xt,{to:"/compare",children:[s.jsx(AU,{className:"mr-1.5 h-4 w-4"}),"Back to Compare"]})}),s.jsx(ie,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs("a",{href:`/results/${encodeURIComponent(t)}${r?`?configId=${encodeURIComponent(r)}`:""}`,target:"_blank",rel:"noreferrer",children:["Open Left",s.jsx(ih,{className:"ml-1.5 h-3.5 w-3.5"})]})}),s.jsx(ie,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs("a",{href:`/results/${encodeURIComponent(n)}${a?`?configId=${encodeURIComponent(a)}`:""}`,target:"_blank",rel:"noreferrer",children:["Open Right",s.jsx(ih,{className:"ml-1.5 h-3.5 w-3.5"})]})})]})]}),s.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[s.jsxs(We,{className:"overflow-hidden",children:[s.jsx(Nt,{className:"py-3",children:s.jsx(Ct,{className:"text-sm font-mono",children:t})}),s.jsx(Ve,{className:"p-0",children:s.jsx("iframe",{title:`Result ${t}`,src:EM(t,r),className:"h-[calc(100vh-15rem)] w-full border-0"})})]}),s.jsxs(We,{className:"overflow-hidden",children:[s.jsx(Nt,{className:"py-3",children:s.jsx(Ct,{className:"text-sm font-mono",children:n})}),s.jsx(Ve,{className:"p-0",children:s.jsx("iframe",{title:`Result ${n}`,src:EM(n,a),className:"h-[calc(100vh-15rem)] w-full border-0"})})]})]})]})};function yge(e){return e.match(/(?:^|\/)(?:result-assistant|results?)\/([0-9]{8}-[0-9]{6})(?:-|\/)/i)?.[1]??null}function xge(){const{source:e}=On(),[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){_e({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]),y=async()=>{if(i){d(!0);try{await e.deleteMarkdownReport(i),n(g=>g.filter(j=>j.relativePath!==i)),_e({title:"Markdown report deleted"}),o(null)}catch(g){_e({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(El,{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(ie,{variant:"outline",onClick:()=>{f()},children:"Refresh"}),h?s.jsx(ie,{asChild:!0,variant:"outline",children:s.jsx(xt,{to:`/markdown-reports/view?path=${encodeURIComponent(h.relativePath)}`,children:"Open latest"})}):null]})]}),s.jsx(We,{children:s.jsx(Ve,{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(Zr,{children:[s.jsx(ea,{children:s.jsxs(Bt,{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(ta,{children:t.map(g=>s.jsxs(Bt,{children:[s.jsx(Ke,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(xt,{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(Ke,{className:"text-xs text-muted-foreground font-mono",children:(()=>{const j=yge(g.relativePath);return j?s.jsx(xt,{to:`/results/${encodeURIComponent(j)}`,className:"text-primary hover:underline",children:j}):s.jsx("span",{className:"text-muted-foreground",children:"—"})})()}),s.jsx(Ke,{className:"text-xs text-muted-foreground font-mono",children:g.relativePath.includes("/")?g.relativePath.slice(0,g.relativePath.lastIndexOf("/")):"."}),s.jsx(Ke,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Jd,{className:"h-3 w-3"}),new Date(g.mtime).toLocaleString()]})}),s.jsx(Ke,{children:s.jsxs(Wc,{children:[s.jsx(Vc,{asChild:!0,children:s.jsx(ie,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Am,{className:"h-4 w-4"})})}),s.jsxs(Ho,{align:"end",children:[s.jsx(gr,{asChild:!0,children:s.jsx(xt,{to:`/markdown-reports/view?path=${encodeURIComponent(g.relativePath)}`,children:"View"})}),s.jsxs(gr,{className:"text-destructive",onSelect:j=>{j.preventDefault(),o(g.relativePath)},children:[s.jsx(Na,{className:"mr-2 h-3.5 w-3.5"})," Delete"]})]})]})})]},g.path))})]})})}),s.jsx(Ss,{open:!!i,onOpenChange:g=>!g&&o(null),children:s.jsxs(Ga,{children:[s.jsxs(Ya,{children:[s.jsx(Qa,{children:"Delete markdown report?"}),s.jsx(Ja,{children:p?`Delete '${p.name}' from disk? This cannot be undone.`:"Delete this report from disk? This cannot be undone."})]}),s.jsxs(Xa,{children:[s.jsx(es,{disabled:c,children:"Cancel"}),s.jsx(Za,{onClick:g=>{g.preventDefault(),y()},disabled:c,children:c?"Deleting...":"Delete"})]})]})})]})}function bge(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function wge(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 jge(){const{source:e}=On(),[t]=Tc(),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 y=!0;if(a(null),d(!1),!n){o(!1);return}return o(!0),e.getMarkdownReport(n).then(g=>{y&&a(g)}).catch(g=>{if(!y)return;const j=g instanceof Error?g.message:String(g);if(j.includes("(404)")){d(!0);return}_e({title:"Could not load markdown report",description:j,variant:"destructive"})}).finally(()=>{y&&o(!1)}),()=>{y=!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(ie,{asChild:!0,variant:"outline",children:s.jsx(xt,{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(ie,{asChild:!0,variant:"outline",children:s.jsx(xt,{to:"/markdown-reports",children:"Back to Markdown Reports"})})]});const p=wge(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()," "," · "," ",bge(r.sizeBytes)]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[p?s.jsxs(s.Fragment,{children:[s.jsx(ie,{variant:"outline",size:"sm",onClick:()=>h(!0),children:"Open Result Panel"}),s.jsx(ie,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(xt,{to:`/results/${encodeURIComponent(p)}`,children:"Open Result"})})]}):null,s.jsx(ie,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(xt,{to:"/markdown-reports",children:"Back to reports"})})]})]}),s.jsx(We,{children:s.jsx(Ve,{className:"pt-6",children:s.jsx(rd,{text:r.content,variant:"assistant"})})}),p?s.jsx(YD,{open:f,onOpenChange:h,children:s.jsxs(QS,{side:"right",className:"w-[96vw] max-w-none p-0 sm:max-w-5xl",children:[s.jsx(QD,{className:"border-b px-4 py-3 pr-12",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs(JD,{className:"text-base",children:["Result ",p]}),s.jsx(ie,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(xt,{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 Sge=()=>{const e=xs();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"})]})})},Nge=new dV;function Cge(){const{scenarioId:e}=Do();return s.jsx(gD,{to:e?`/libraries/test-cases/${encodeURIComponent(e)}`:"/libraries/test-cases",replace:!0})}const _ge=()=>s.jsx(pV,{client:Nge,children:s.jsx(Z$,{children:s.jsx(SG,{children:s.jsx(AG,{children:s.jsxs(_G,{children:[s.jsx(yq,{}),s.jsx(Xq,{}),s.jsx(hH,{children:s.jsxs(sH,{children:[s.jsxs(Qt,{element:s.jsx(CG,{}),children:[s.jsx(Qt,{path:"/",element:s.jsx(efe,{})}),s.jsx(Qt,{path:"/mcp-evaluations",element:s.jsx(Rpe,{})}),s.jsx(Qt,{path:"/mcp-evaluations/:id",element:s.jsx(aM,{})}),s.jsx(Qt,{path:"/mcp-evaluations/:id/:tab",element:s.jsx(aM,{})}),s.jsx(Qt,{path:"/tool-analysis",element:s.jsx(Yve,{})}),s.jsx(Qt,{path:"/tool-analysis-results",element:s.jsx(Xve,{})}),s.jsx(Qt,{path:"/tool-analysis-results/:id",element:s.jsx(Qve,{})}),s.jsx(Qt,{path:"/oauth-debugger",element:s.jsx(nge,{})}),s.jsx(Qt,{path:"/libraries/servers",element:s.jsx(mme,{})}),s.jsx(Qt,{path:"/libraries/servers/:serverId",element:s.jsx(gme,{})}),s.jsx(Qt,{path:"/libraries/agents",element:s.jsx(yme,{})}),s.jsx(Qt,{path:"/libraries/agents/:agentName",element:s.jsx(Ove,{})}),s.jsx(Qt,{path:"/libraries/test-cases",element:s.jsx(fM,{})}),s.jsx(Qt,{path:"/libraries/test-cases/:testCaseId",element:s.jsx(fM,{})}),s.jsx(Qt,{path:"/libraries/scenarios",element:s.jsx(gD,{to:"/libraries/test-cases",replace:!0})}),s.jsx(Qt,{path:"/libraries/scenarios/:scenarioId",element:s.jsx(Cge,{})}),s.jsx(Qt,{path:"/settings",element:s.jsx(Rve,{})}),s.jsx(Qt,{path:"/run",element:s.jsx(rge,{})}),s.jsx(Qt,{path:"/results",element:s.jsx(age,{})}),s.jsx(Qt,{path:"/results/:id",element:s.jsx(uge,{})}),s.jsx(Qt,{path:"/markdown-reports",element:s.jsx(xge,{})}),s.jsx(Qt,{path:"/markdown-reports/view",element:s.jsx(jge,{})}),s.jsx(Qt,{path:"/compare",element:s.jsx(vge,{})}),s.jsx(Qt,{path:"/compare/results",element:s.jsx(gge,{})})]}),s.jsx(Qt,{path:"*",element:s.jsx(Sge,{})})]})})]})})})})});j7.createRoot(document.getElementById("root")).render(s.jsx(_ge,{}));