@inspectr/mcplab 1.24.0 → 1.24.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/assets/index-CNhsXf99.js +256 -0
- package/dist/app/assets/index-DFztMNSc.css +1 -0
- package/dist/app/index.html +2 -2
- package/dist/app-server/runs-routes.d.ts.map +1 -1
- package/dist/app-server/runs-routes.js +32 -3
- package/dist/app-server/runs-routes.js.map +1 -1
- package/dist/app-server/scenario-assistant-domain.d.ts +153 -127
- package/dist/app-server/scenario-assistant-domain.d.ts.map +1 -1
- package/dist/app-server/scenario-assistant-domain.js +2 -1
- package/dist/app-server/scenario-assistant-domain.js.map +1 -1
- package/package.json +1 -1
- package/dist/app/assets/index-DBjVHflA.css +0 -1
- package/dist/app/assets/index-Dpk3M-Rp.js +0 -256
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
function d7(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 hh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _y={exports:{}},vd={},Ay={exports:{}},rn={};var oE;function f7(){if(oE)return rn;oE=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 v(q){return q===null||typeof q!="object"?null:(q=p&&q[p]||q["@@iterator"],typeof q=="function"?q:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,b={};function y(q,z,K){this.props=q,this.context=z,this.refs=b,this.updater=K||x}y.prototype.isReactComponent={},y.prototype.setState=function(q,z){if(typeof q!="object"&&typeof q!="function"&&q!=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,q,z,"setState")},y.prototype.forceUpdate=function(q){this.updater.enqueueForceUpdate(this,q,"forceUpdate")};function S(){}S.prototype=y.prototype;function N(q,z,K){this.props=q,this.context=z,this.refs=b,this.updater=K||x}var _=N.prototype=new S;_.constructor=N,j(_,y.prototype),_.isPureReactComponent=!0;var A=Array.isArray,k=Object.prototype.hasOwnProperty,E={current:null},P={key:!0,ref:!0,__self:!0,__source:!0};function R(q,z,K){var J,ne={},he=null,ie=null;if(z!=null)for(J in z.ref!==void 0&&(ie=z.ref),z.key!==void 0&&(he=""+z.key),z)k.call(z,J)&&!P.hasOwnProperty(J)&&(ne[J]=z[J]);var me=arguments.length-2;if(me===1)ne.children=K;else if(1<me){for(var se=Array(me),ge=0;ge<me;ge++)se[ge]=arguments[ge+2];ne.children=se}if(q&&q.defaultProps)for(J in me=q.defaultProps,me)ne[J]===void 0&&(ne[J]=me[J]);return{$$typeof:e,type:q,key:he,ref:ie,props:ne,_owner:E.current}}function M(q,z){return{$$typeof:e,type:q.type,key:z,ref:q.ref,props:q.props,_owner:q._owner}}function D(q){return typeof q=="object"&&q!==null&&q.$$typeof===e}function U(q){var z={"=":"=0",":":"=2"};return"$"+q.replace(/[=:]/g,function(K){return z[K]})}var F=/\/+/g;function G(q,z){return typeof q=="object"&&q!==null&&q.key!=null?U(""+q.key):z.toString(36)}function H(q,z,K,J,ne){var he=typeof q;(he==="undefined"||he==="boolean")&&(q=null);var ie=!1;if(q===null)ie=!0;else switch(he){case"string":case"number":ie=!0;break;case"object":switch(q.$$typeof){case e:case t:ie=!0}}if(ie)return ie=q,ne=ne(ie),q=J===""?"."+G(ie,0):J,A(ne)?(K="",q!=null&&(K=q.replace(F,"$&/")+"/"),H(ne,z,K,"",function(ge){return ge})):ne!=null&&(D(ne)&&(ne=M(ne,K+(!ne.key||ie&&ie.key===ne.key?"":(""+ne.key).replace(F,"$&/")+"/")+q)),z.push(ne)),1;if(ie=0,J=J===""?".":J+":",A(q))for(var me=0;me<q.length;me++){he=q[me];var se=J+G(he,me);ie+=H(he,z,K,se,ne)}else if(se=v(q),typeof se=="function")for(q=se.call(q),me=0;!(he=q.next()).done;)he=he.value,se=J+G(he,me++),ie+=H(he,z,K,se,ne);else if(he==="object")throw z=String(q),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(q).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.");return ie}function L(q,z,K){if(q==null)return q;var J=[],ne=0;return H(q,J,"","",function(he){return z.call(K,he,ne++)}),J}function I(q){if(q._status===-1){var z=q._result;z=z(),z.then(function(K){(q._status===0||q._status===-1)&&(q._status=1,q._result=K)},function(K){(q._status===0||q._status===-1)&&(q._status=2,q._result=K)}),q._status===-1&&(q._status=0,q._result=z)}if(q._status===1)return q._result.default;throw q._result}var Y={current:null},W={transition:null},O={ReactCurrentDispatcher:Y,ReactCurrentBatchConfig:W,ReactCurrentOwner:E};function Q(){throw Error("act(...) is not supported in production builds of React.")}return rn.Children={map:L,forEach:function(q,z,K){L(q,function(){z.apply(this,arguments)},K)},count:function(q){var z=0;return L(q,function(){z++}),z},toArray:function(q){return L(q,function(z){return z})||[]},only:function(q){if(!D(q))throw Error("React.Children.only expected to receive a single React element child.");return q}},rn.Component=y,rn.Fragment=n,rn.Profiler=a,rn.PureComponent=N,rn.StrictMode=r,rn.Suspense=d,rn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=O,rn.act=Q,rn.cloneElement=function(q,z,K){if(q==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+q+".");var J=j({},q.props),ne=q.key,he=q.ref,ie=q._owner;if(z!=null){if(z.ref!==void 0&&(he=z.ref,ie=E.current),z.key!==void 0&&(ne=""+z.key),q.type&&q.type.defaultProps)var me=q.type.defaultProps;for(se in z)k.call(z,se)&&!P.hasOwnProperty(se)&&(J[se]=z[se]===void 0&&me!==void 0?me[se]:z[se])}var se=arguments.length-2;if(se===1)J.children=K;else if(1<se){me=Array(se);for(var ge=0;ge<se;ge++)me[ge]=arguments[ge+2];J.children=me}return{$$typeof:e,type:q.type,key:ne,ref:he,props:J,_owner:ie}},rn.createContext=function(q){return q={$$typeof:o,_currentValue:q,_currentValue2:q,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},q.Provider={$$typeof:i,_context:q},q.Consumer=q},rn.createElement=R,rn.createFactory=function(q){var z=R.bind(null,q);return z.type=q,z},rn.createRef=function(){return{current:null}},rn.forwardRef=function(q){return{$$typeof:c,render:q}},rn.isValidElement=D,rn.lazy=function(q){return{$$typeof:h,_payload:{_status:-1,_result:q},_init:I}},rn.memo=function(q,z){return{$$typeof:f,type:q,compare:z===void 0?null:z}},rn.startTransition=function(q){var z=W.transition;W.transition={};try{q()}finally{W.transition=z}},rn.unstable_act=Q,rn.useCallback=function(q,z){return Y.current.useCallback(q,z)},rn.useContext=function(q){return Y.current.useContext(q)},rn.useDebugValue=function(){},rn.useDeferredValue=function(q){return Y.current.useDeferredValue(q)},rn.useEffect=function(q,z){return Y.current.useEffect(q,z)},rn.useId=function(){return Y.current.useId()},rn.useImperativeHandle=function(q,z,K){return Y.current.useImperativeHandle(q,z,K)},rn.useInsertionEffect=function(q,z){return Y.current.useInsertionEffect(q,z)},rn.useLayoutEffect=function(q,z){return Y.current.useLayoutEffect(q,z)},rn.useMemo=function(q,z){return Y.current.useMemo(q,z)},rn.useReducer=function(q,z,K){return Y.current.useReducer(q,z,K)},rn.useRef=function(q){return Y.current.useRef(q)},rn.useState=function(q){return Y.current.useState(q)},rn.useSyncExternalStore=function(q,z,K){return Y.current.useSyncExternalStore(q,z,K)},rn.useTransition=function(){return Y.current.useTransition()},rn.version="18.3.1",rn}var lE;function IN(){return lE||(lE=1,Ay.exports=f7()),Ay.exports}var cE;function p7(){if(cE)return vd;cE=1;var e=IN(),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={},v=null,x=null;f!==void 0&&(v=""+f),d.key!==void 0&&(v=""+d.key),d.ref!==void 0&&(x=d.ref);for(h in d)r.call(d,h)&&!i.hasOwnProperty(h)&&(p[h]=d[h]);if(c&&c.defaultProps)for(h in d=c.defaultProps,d)p[h]===void 0&&(p[h]=d[h]);return{$$typeof:t,type:c,key:v,ref:x,props:p,_owner:a.current}}return vd.Fragment=n,vd.jsx=o,vd.jsxs=o,vd}var uE;function h7(){return uE||(uE=1,_y.exports=p7()),_y.exports}var s=h7(),mh={},ky={exports:{}},Gr={},Ey={exports:{}},Py={};var dE;function m7(){return dE||(dE=1,(function(e){function t(W,O){var Q=W.length;W.push(O);e:for(;0<Q;){var q=Q-1>>>1,z=W[q];if(0<a(z,O))W[q]=O,W[Q]=z,Q=q;else break e}}function n(W){return W.length===0?null:W[0]}function r(W){if(W.length===0)return null;var O=W[0],Q=W.pop();if(Q!==O){W[0]=Q;e:for(var q=0,z=W.length,K=z>>>1;q<K;){var J=2*(q+1)-1,ne=W[J],he=J+1,ie=W[he];if(0>a(ne,Q))he<z&&0>a(ie,ne)?(W[q]=ie,W[he]=Q,q=he):(W[q]=ne,W[J]=Q,q=J);else if(he<z&&0>a(ie,Q))W[q]=ie,W[he]=Q,q=he;else break e}}return O}function a(W,O){var Q=W.sortIndex-O.sortIndex;return Q!==0?Q:W.id-O.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,v=3,x=!1,j=!1,b=!1,y=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 _(W){for(var O=n(f);O!==null;){if(O.callback===null)r(f);else if(O.startTime<=W)r(f),O.sortIndex=O.expirationTime,t(d,O);else break;O=n(f)}}function A(W){if(b=!1,_(W),!j)if(n(d)!==null)j=!0,I(k);else{var O=n(f);O!==null&&Y(A,O.startTime-W)}}function k(W,O){j=!1,b&&(b=!1,S(R),R=-1),x=!0;var Q=v;try{for(_(O),p=n(d);p!==null&&(!(p.expirationTime>O)||W&&!U());){var q=p.callback;if(typeof q=="function"){p.callback=null,v=p.priorityLevel;var z=q(p.expirationTime<=O);O=e.unstable_now(),typeof z=="function"?p.callback=z:p===n(d)&&r(d),_(O)}else r(d);p=n(d)}if(p!==null)var K=!0;else{var J=n(f);J!==null&&Y(A,J.startTime-O),K=!1}return K}finally{p=null,v=Q,x=!1}}var E=!1,P=null,R=-1,M=5,D=-1;function U(){return!(e.unstable_now()-D<M)}function F(){if(P!==null){var W=e.unstable_now();D=W;var O=!0;try{O=P(!0,W)}finally{O?G():(E=!1,P=null)}}else E=!1}var G;if(typeof N=="function")G=function(){N(F)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,L=H.port2;H.port1.onmessage=F,G=function(){L.postMessage(null)}}else G=function(){y(F,0)};function I(W){P=W,E||(E=!0,G())}function Y(W,O){R=y(function(){W(e.unstable_now())},O)}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(W){W.callback=null},e.unstable_continueExecution=function(){j||x||(j=!0,I(k))},e.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<W?Math.floor(1e3/W):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(W){switch(v){case 1:case 2:case 3:var O=3;break;default:O=v}var Q=v;v=O;try{return W()}finally{v=Q}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(W,O){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var Q=v;v=W;try{return O()}finally{v=Q}},e.unstable_scheduleCallback=function(W,O,Q){var q=e.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?q+Q:q):Q=q,W){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=Q+z,W={id:h++,callback:O,priorityLevel:W,startTime:Q,expirationTime:z,sortIndex:-1},Q>q?(W.sortIndex=Q,t(f,W),n(d)===null&&W===n(f)&&(b?(S(R),R=-1):b=!0,Y(A,Q-q))):(W.sortIndex=z,t(d,W),j||x||(j=!0,I(k))),W},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(W){var O=v;return function(){var Q=v;v=O;try{return W.apply(this,arguments)}finally{v=Q}}}})(Py)),Py}var fE;function g7(){return fE||(fE=1,Ey.exports=m7()),Ey.exports}var pE;function v7(){if(pE)return Gr;pE=1;var e=IN(),t=g7();function n(l){for(var u="https://reactjs.org/docs/error-decoder.html?invariant="+l,g=1;g<arguments.length;g++)u+="&args[]="+encodeURIComponent(arguments[g]);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 v(l){return d.call(p,l)?!0:d.call(h,l)?!1:f.test(l)?p[l]=!0:(h[l]=!0,!1)}function x(l,u,g,w){if(g!==null&&g.type===0)return!1;switch(typeof u){case"function":case"symbol":return!0;case"boolean":return w?!1:g!==null?!g.acceptsBooleans:(l=l.toLowerCase().slice(0,5),l!=="data-"&&l!=="aria-");default:return!1}}function j(l,u,g,w){if(u===null||typeof u>"u"||x(l,u,g,w))return!0;if(w)return!1;if(g!==null)switch(g.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,g,w,C,T,$){this.acceptsBooleans=u===2||u===3||u===4,this.attributeName=w,this.attributeNamespace=C,this.mustUseProperty=g,this.propertyName=l,this.type=u,this.sanitizeURL=T,this.removeEmptyString=$}var y={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(l){y[l]=new b(l,0,!1,l,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(l){var u=l[0];y[u]=new b(u,1,!1,l[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(l){y[l]=new b(l,2,!1,l.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(l){y[l]=new b(l,2,!1,l,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(l){y[l]=new b(l,3,!1,l.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(l){y[l]=new b(l,3,!0,l,null,!1,!1)}),["capture","download"].forEach(function(l){y[l]=new b(l,4,!1,l,null,!1,!1)}),["cols","rows","size","span"].forEach(function(l){y[l]=new b(l,6,!1,l,null,!1,!1)}),["rowSpan","start"].forEach(function(l){y[l]=new b(l,5,!1,l.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function 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);y[u]=new b(u,1,!1,l,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(l){var u=l.replace(S,N);y[u]=new b(u,1,!1,l,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(l){var u=l.replace(S,N);y[u]=new b(u,1,!1,l,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(l){y[l]=new b(l,1,!1,l.toLowerCase(),null,!1,!1)}),y.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(l){y[l]=new b(l,1,!1,l.toLowerCase(),null,!0,!0)});function _(l,u,g,w){var C=y.hasOwnProperty(u)?y[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,g,C,w)&&(g=null),w||C===null?v(u)&&(g===null?l.removeAttribute(u):l.setAttribute(u,""+g)):C.mustUseProperty?l[C.propertyName]=g===null?C.type===3?!1:"":g:(u=C.attributeName,w=C.attributeNamespace,g===null?l.removeAttribute(u):(C=C.type,g=C===3||C===4&&g===!0?"":""+g,w?l.setAttributeNS(w,u,g):l.setAttribute(u,g))))}var A=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,k=Symbol.for("react.element"),E=Symbol.for("react.portal"),P=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),D=Symbol.for("react.provider"),U=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),Y=Symbol.for("react.offscreen"),W=Symbol.iterator;function O(l){return l===null||typeof l!="object"?null:(l=W&&l[W]||l["@@iterator"],typeof l=="function"?l:null)}var Q=Object.assign,q;function z(l){if(q===void 0)try{throw Error()}catch(g){var u=g.stack.trim().match(/\n( *(at )?)/);q=u&&u[1]||""}return`
|
|
2
|
+
`+q+l}var K=!1;function J(l,u){if(!l||K)return"";K=!0;var g=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(je){var w=je}Reflect.construct(l,[],u)}else{try{u.call()}catch(je){w=je}l.call(u.prototype)}else{try{throw Error()}catch(je){w=je}l()}}catch(je){if(je&&w&&typeof je.stack=="string"){for(var C=je.stack.split(`
|
|
3
|
+
`),T=w.stack.split(`
|
|
4
|
+
`),$=C.length-1,ee=T.length-1;1<=$&&0<=ee&&C[$]!==T[ee];)ee--;for(;1<=$&&0<=ee;$--,ee--)if(C[$]!==T[ee]){if($!==1||ee!==1)do if($--,ee--,0>ee||C[$]!==T[ee]){var ce=`
|
|
5
|
+
`+C[$].replace(" at new "," at ");return l.displayName&&ce.includes("<anonymous>")&&(ce=ce.replace("<anonymous>",l.displayName)),ce}while(1<=$&&0<=ee);break}}}finally{K=!1,Error.prepareStackTrace=g}return(l=l?l.displayName||l.name:"")?z(l):""}function ne(l){switch(l.tag){case 5:return z(l.type);case 16:return z("Lazy");case 13:return z("Suspense");case 19:return z("SuspenseList");case 0:case 2:case 15:return l=J(l.type,!1),l;case 11:return l=J(l.type.render,!1),l;case 1:return l=J(l.type,!0),l;default:return""}}function he(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case P:return"Fragment";case E:return"Portal";case M:return"Profiler";case R:return"StrictMode";case G:return"Suspense";case H:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case U:return(l.displayName||"Context")+".Consumer";case D:return(l._context.displayName||"Context")+".Provider";case F:var u=l.render;return l=l.displayName,l||(l=u.displayName||u.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case L:return u=l.displayName||null,u!==null?u:he(l.type)||"Memo";case I:u=l._payload,l=l._init;try{return he(l(u))}catch{}}return null}function ie(l){var u=l.type;switch(l.tag){case 24:return"Cache";case 9:return(u.displayName||"Context")+".Consumer";case 10:return(u._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=u.render,l=l.displayName||l.name||"",u.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return u;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return he(u);case 8:return u===R?"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 me(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function se(l){var u=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function ge(l){var u=se(l)?"checked":"value",g=Object.getOwnPropertyDescriptor(l.constructor.prototype,u),w=""+l[u];if(!l.hasOwnProperty(u)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var C=g.get,T=g.set;return Object.defineProperty(l,u,{configurable:!0,get:function(){return C.call(this)},set:function($){w=""+$,T.call(this,$)}}),Object.defineProperty(l,u,{enumerable:g.enumerable}),{getValue:function(){return w},setValue:function($){w=""+$},stopTracking:function(){l._valueTracker=null,delete l[u]}}}}function Oe(l){l._valueTracker||(l._valueTracker=ge(l))}function fe(l){if(!l)return!1;var u=l._valueTracker;if(!u)return!0;var g=u.getValue(),w="";return l&&(w=se(l)?l.checked?"true":"false":l.value),l=w,l!==g?(u.setValue(l),!0):!1}function xe(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}function we(l,u){var g=u.checked;return Q({},u,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:g??l._wrapperState.initialChecked})}function ot(l,u){var g=u.defaultValue==null?"":u.defaultValue,w=u.checked!=null?u.checked:u.defaultChecked;g=me(u.value!=null?u.value:g),l._wrapperState={initialChecked:w,initialValue:g,controlled:u.type==="checkbox"||u.type==="radio"?u.checked!=null:u.value!=null}}function lt(l,u){u=u.checked,u!=null&&_(l,"checked",u,!1)}function ut(l,u){lt(l,u);var g=me(u.value),w=u.type;if(g!=null)w==="number"?(g===0&&l.value===""||l.value!=g)&&(l.value=""+g):l.value!==""+g&&(l.value=""+g);else if(w==="submit"||w==="reset"){l.removeAttribute("value");return}u.hasOwnProperty("value")?Xe(l,u.type,g):u.hasOwnProperty("defaultValue")&&Xe(l,u.type,me(u.defaultValue)),u.checked==null&&u.defaultChecked!=null&&(l.defaultChecked=!!u.defaultChecked)}function At(l,u,g){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,g||u===l.value||(l.value=u),l.defaultValue=u}g=l.name,g!==""&&(l.name=""),l.defaultChecked=!!l._wrapperState.initialChecked,g!==""&&(l.name=g)}function Xe(l,u,g){(u!=="number"||xe(l.ownerDocument)!==l)&&(g==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+g&&(l.defaultValue=""+g))}var Se=Array.isArray;function Ae(l,u,g,w){if(l=l.options,u){u={};for(var C=0;C<g.length;C++)u["$"+g[C]]=!0;for(g=0;g<l.length;g++)C=u.hasOwnProperty("$"+l[g].value),l[g].selected!==C&&(l[g].selected=C),C&&w&&(l[g].defaultSelected=!0)}else{for(g=""+me(g),u=null,C=0;C<l.length;C++){if(l[C].value===g){l[C].selected=!0,w&&(l[C].defaultSelected=!0);return}u!==null||l[C].disabled||(u=l[C])}u!==null&&(u.selected=!0)}}function Je(l,u){if(u.dangerouslySetInnerHTML!=null)throw Error(n(91));return Q({},u,{value:void 0,defaultValue:void 0,children:""+l._wrapperState.initialValue})}function dt(l,u){var g=u.value;if(g==null){if(g=u.children,u=u.defaultValue,g!=null){if(u!=null)throw Error(n(92));if(Se(g)){if(1<g.length)throw Error(n(93));g=g[0]}u=g}u==null&&(u=""),g=u}l._wrapperState={initialValue:me(g)}}function Pt(l,u){var g=me(u.value),w=me(u.defaultValue);g!=null&&(g=""+g,g!==l.value&&(l.value=g),u.defaultValue==null&&l.defaultValue!==g&&(l.defaultValue=g)),w!=null&&(l.defaultValue=""+w)}function Xt(l){var u=l.textContent;u===l._wrapperState.initialValue&&u!==""&&u!==null&&(l.value=u)}function kt(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 nn(l,u){return l==null||l==="http://www.w3.org/1999/xhtml"?kt(u):l==="http://www.w3.org/2000/svg"&&u==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var Jt,zt=(function(l){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(u,g,w,C){MSApp.execUnsafeLocalFunction(function(){return l(u,g,w,C)})}:l})(function(l,u){if(l.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in l)l.innerHTML=u;else{for(Jt=Jt||document.createElement("div"),Jt.innerHTML="<svg>"+u.valueOf().toString()+"</svg>",u=Jt.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;u.firstChild;)l.appendChild(u.firstChild)}});function _e(l,u){if(u){var g=l.firstChild;if(g&&g===l.lastChild&&g.nodeType===3){g.nodeValue=u;return}}l.textContent=u}var Qe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ze=["Webkit","ms","Moz","O"];Object.keys(Qe).forEach(function(l){Ze.forEach(function(u){u=u+l.charAt(0).toUpperCase()+l.substring(1),Qe[u]=Qe[l]})});function _t(l,u,g){return u==null||typeof u=="boolean"||u===""?"":g||typeof u!="number"||u===0||Qe.hasOwnProperty(l)&&Qe[l]?(""+u).trim():u+"px"}function Bt(l,u){l=l.style;for(var g in u)if(u.hasOwnProperty(g)){var w=g.indexOf("--")===0,C=_t(g,u[g],w);g==="float"&&(g="cssFloat"),w?l.setProperty(g,C):l[g]=C}}var ue=Q({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 Ke(l,u){if(u){if(ue[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 De(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 re=null;function Ne(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var Ue=null,B=null,oe=null;function de(l){if(l=nd(l)){if(typeof Ue!="function")throw Error(n(280));var u=l.stateNode;u&&(u=Ep(u),Ue(l.stateNode,l.type,u))}}function Le(l){B?oe?oe.push(l):oe=[l]:B=l}function $e(){if(B){var l=B,u=oe;if(oe=B=null,de(l),u)for(l=0;l<u.length;l++)de(u[l])}}function Ge(l,u){return l(u)}function Ie(){}var V=!1;function ve(l,u,g){if(V)return l(u,g);V=!0;try{return Ge(l,u,g)}finally{V=!1,(B!==null||oe!==null)&&(Ie(),$e())}}function Ee(l,u){var g=l.stateNode;if(g===null)return null;var w=Ep(g);if(w===null)return null;g=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(g&&typeof g!="function")throw Error(n(231,u,typeof g));return g}var tt=!1;if(c)try{var te={};Object.defineProperty(te,"passive",{get:function(){tt=!0}}),window.addEventListener("test",te,te),window.removeEventListener("test",te,te)}catch{tt=!1}function Fe(l,u,g,w,C,T,$,ee,ce){var je=Array.prototype.slice.call(arguments,3);try{u.apply(g,je)}catch(Be){this.onError(Be)}}var mt=!1,Qt=null,ke=!1,en=null,Ct={onError:function(l){mt=!0,Qt=l}};function Kt(l,u,g,w,C,T,$,ee,ce){mt=!1,Qt=null,Fe.apply(Ct,arguments)}function Hn(l,u,g,w,C,T,$,ee,ce){if(Kt.apply(this,arguments),mt){if(mt){var je=Qt;mt=!1,Qt=null}else throw Error(n(198));ke||(ke=!0,en=je)}}function _n(l){var u=l,g=l;if(l.alternate)for(;u.return;)u=u.return;else{l=u;do u=l,(u.flags&4098)!==0&&(g=u.return),l=u.return;while(l)}return u.tag===3?g:null}function Xa(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 Qa(l){if(_n(l)!==l)throw Error(n(188))}function $i(l){var u=l.alternate;if(!u){if(u=_n(l),u===null)throw Error(n(188));return u!==l?null:l}for(var g=l,w=u;;){var C=g.return;if(C===null)break;var T=C.alternate;if(T===null){if(w=C.return,w!==null){g=w;continue}break}if(C.child===T.child){for(T=C.child;T;){if(T===g)return Qa(C),l;if(T===w)return Qa(C),u;T=T.sibling}throw Error(n(188))}if(g.return!==w.return)g=C,w=T;else{for(var $=!1,ee=C.child;ee;){if(ee===g){$=!0,g=C,w=T;break}if(ee===w){$=!0,w=C,g=T;break}ee=ee.sibling}if(!$){for(ee=T.child;ee;){if(ee===g){$=!0,g=T,w=C;break}if(ee===w){$=!0,w=T,g=C;break}ee=ee.sibling}if(!$)throw Error(n(189))}}if(g.alternate!==w)throw Error(n(190))}if(g.tag!==3)throw Error(n(188));return g.stateNode.current===g?l:u}function To(l){return l=$i(l),l!==null?Di(l):null}function Di(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var u=Di(l);if(u!==null)return u;l=l.sibling}return null}var Ul=t.unstable_scheduleCallback,qn=t.unstable_cancelCallback,Fu=t.unstable_shouldYield,Aa=t.unstable_requestPaint,le=t.unstable_now,it=t.unstable_getCurrentPriorityLevel,Wt=t.unstable_ImmediatePriority,Dt=t.unstable_UserBlockingPriority,qt=t.unstable_NormalPriority,dn=t.unstable_LowPriority,lr=t.unstable_IdlePriority,os=null,gr=null;function Ro(l){if(gr&&typeof gr.onCommitFiberRoot=="function")try{gr.onCommitFiberRoot(os,l,void 0,(l.current.flags&128)===128)}catch{}}var vr=Math.clz32?Math.clz32:ae,Wl=Math.log,pp=Math.LN2;function ae(l){return l>>>=0,l===0?32:31-(Wl(l)/pp|0)|0}var Pe=64,jt=4194304;function et(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 sn(l,u){var g=l.pendingLanes;if(g===0)return 0;var w=0,C=l.suspendedLanes,T=l.pingedLanes,$=g&268435455;if($!==0){var ee=$&~C;ee!==0?w=et(ee):(T&=$,T!==0&&(w=et(T)))}else $=g&~C,$!==0?w=et($):T!==0&&(w=et(T));if(w===0)return 0;if(u!==0&&u!==w&&(u&C)===0&&(C=w&-w,T=u&-u,C>=T||C===16&&(T&4194240)!==0))return u;if((w&4)!==0&&(w|=g&16),u=l.entangledLanes,u!==0)for(l=l.entanglements,u&=w;0<u;)g=31-vr(u),C=1<<g,w|=l[g],u&=~C;return w}function on(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 xn(l,u){for(var g=l.suspendedLanes,w=l.pingedLanes,C=l.expirationTimes,T=l.pendingLanes;0<T;){var $=31-vr(T),ee=1<<$,ce=C[$];ce===-1?((ee&g)===0||(ee&w)!==0)&&(C[$]=on(ee,u)):ce<=u&&(l.expiredLanes|=ee),T&=~ee}}function cr(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function qr(){var l=Pe;return Pe<<=1,(Pe&4194240)===0&&(Pe=64),l}function mn(l){for(var u=[],g=0;31>g;g++)u.push(l);return u}function Ss(l,u,g){l.pendingLanes|=u,u!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,u=31-vr(u),l[u]=g}function Yv(l,u){var g=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<g;){var C=31-vr(g),T=1<<C;u[C]=0,w[C]=-1,l[C]=-1,g&=~T}}function Oo(l,u){var g=l.entangledLanes|=u;for(l=l.entanglements;g;){var w=31-vr(g),C=1<<w;C&u|l[w]&u&&(l[w]|=u),g&=~C}}var fn=0;function F_(l){return l&=-l,1<l?4<l?(l&268435455)!==0?16:536870912:4:1}var z_,Xv,B_,q_,U_,Qv=!1,hp=[],Li=null,Fi=null,zi=null,zu=new Map,Bu=new Map,Bi=[],Oq="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 W_(l,u){switch(l){case"focusin":case"focusout":Li=null;break;case"dragenter":case"dragleave":Fi=null;break;case"mouseover":case"mouseout":zi=null;break;case"pointerover":case"pointerout":zu.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":Bu.delete(u.pointerId)}}function qu(l,u,g,w,C,T){return l===null||l.nativeEvent!==T?(l={blockedOn:u,domEventName:g,eventSystemFlags:w,nativeEvent:T,targetContainers:[C]},u!==null&&(u=nd(u),u!==null&&Xv(u)),l):(l.eventSystemFlags|=w,u=l.targetContainers,C!==null&&u.indexOf(C)===-1&&u.push(C),l)}function Mq(l,u,g,w,C){switch(u){case"focusin":return Li=qu(Li,l,u,g,w,C),!0;case"dragenter":return Fi=qu(Fi,l,u,g,w,C),!0;case"mouseover":return zi=qu(zi,l,u,g,w,C),!0;case"pointerover":var T=C.pointerId;return zu.set(T,qu(zu.get(T)||null,l,u,g,w,C)),!0;case"gotpointercapture":return T=C.pointerId,Bu.set(T,qu(Bu.get(T)||null,l,u,g,w,C)),!0}return!1}function V_(l){var u=Mo(l.target);if(u!==null){var g=_n(u);if(g!==null){if(u=g.tag,u===13){if(u=Xa(g),u!==null){l.blockedOn=u,U_(l.priority,function(){B_(g)});return}}else if(u===3&&g.stateNode.current.memoizedState.isDehydrated){l.blockedOn=g.tag===3?g.stateNode.containerInfo:null;return}}}l.blockedOn=null}function mp(l){if(l.blockedOn!==null)return!1;for(var u=l.targetContainers;0<u.length;){var g=Jv(l.domEventName,l.eventSystemFlags,u[0],l.nativeEvent);if(g===null){g=l.nativeEvent;var w=new g.constructor(g.type,g);re=w,g.target.dispatchEvent(w),re=null}else return u=nd(g),u!==null&&Xv(u),l.blockedOn=g,!1;u.shift()}return!0}function H_(l,u,g){mp(l)&&g.delete(u)}function Iq(){Qv=!1,Li!==null&&mp(Li)&&(Li=null),Fi!==null&&mp(Fi)&&(Fi=null),zi!==null&&mp(zi)&&(zi=null),zu.forEach(H_),Bu.forEach(H_)}function Uu(l,u){l.blockedOn===u&&(l.blockedOn=null,Qv||(Qv=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Iq)))}function Wu(l){function u(C){return Uu(C,l)}if(0<hp.length){Uu(hp[0],l);for(var g=1;g<hp.length;g++){var w=hp[g];w.blockedOn===l&&(w.blockedOn=null)}}for(Li!==null&&Uu(Li,l),Fi!==null&&Uu(Fi,l),zi!==null&&Uu(zi,l),zu.forEach(u),Bu.forEach(u),g=0;g<Bi.length;g++)w=Bi[g],w.blockedOn===l&&(w.blockedOn=null);for(;0<Bi.length&&(g=Bi[0],g.blockedOn===null);)V_(g),g.blockedOn===null&&Bi.shift()}var Vl=A.ReactCurrentBatchConfig,gp=!0;function $q(l,u,g,w){var C=fn,T=Vl.transition;Vl.transition=null;try{fn=1,Zv(l,u,g,w)}finally{fn=C,Vl.transition=T}}function Dq(l,u,g,w){var C=fn,T=Vl.transition;Vl.transition=null;try{fn=4,Zv(l,u,g,w)}finally{fn=C,Vl.transition=T}}function Zv(l,u,g,w){if(gp){var C=Jv(l,u,g,w);if(C===null)gx(l,u,w,vp,g),W_(l,w);else if(Mq(C,l,u,g,w))w.stopPropagation();else if(W_(l,w),u&4&&-1<Oq.indexOf(l)){for(;C!==null;){var T=nd(C);if(T!==null&&z_(T),T=Jv(l,u,g,w),T===null&&gx(l,u,w,vp,g),T===C)break;C=T}C!==null&&w.stopPropagation()}else gx(l,u,w,null,g)}}var vp=null;function Jv(l,u,g,w){if(vp=null,l=Ne(w),l=Mo(l),l!==null)if(u=_n(l),u===null)l=null;else if(g=u.tag,g===13){if(l=Xa(u),l!==null)return l;l=null}else if(g===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;l=null}else u!==l&&(l=null);return vp=l,null}function K_(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(it()){case Wt:return 1;case Dt:return 4;case qt:case dn:return 16;case lr:return 536870912;default:return 16}default:return 16}}var qi=null,ex=null,xp=null;function G_(){if(xp)return xp;var l,u=ex,g=u.length,w,C="value"in qi?qi.value:qi.textContent,T=C.length;for(l=0;l<g&&u[l]===C[l];l++);var $=g-l;for(w=1;w<=$&&u[g-w]===C[T-w];w++);return xp=C.slice(l,1<w?1-w:void 0)}function yp(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 bp(){return!0}function Y_(){return!1}function ls(l){function u(g,w,C,T,$){this._reactName=g,this._targetInst=C,this.type=w,this.nativeEvent=T,this.target=$,this.currentTarget=null;for(var ee in l)l.hasOwnProperty(ee)&&(g=l[ee],this[ee]=g?g(T):T[ee]);return this.isDefaultPrevented=(T.defaultPrevented!=null?T.defaultPrevented:T.returnValue===!1)?bp:Y_,this.isPropagationStopped=Y_,this}return Q(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var g=this.nativeEvent;g&&(g.preventDefault?g.preventDefault():typeof g.returnValue!="unknown"&&(g.returnValue=!1),this.isDefaultPrevented=bp)},stopPropagation:function(){var g=this.nativeEvent;g&&(g.stopPropagation?g.stopPropagation():typeof g.cancelBubble!="unknown"&&(g.cancelBubble=!0),this.isPropagationStopped=bp)},persist:function(){},isPersistent:bp}),u}var Hl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},tx=ls(Hl),Vu=Q({},Hl,{view:0,detail:0}),Lq=ls(Vu),nx,rx,Hu,wp=Q({},Vu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ax,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!==Hu&&(Hu&&l.type==="mousemove"?(nx=l.screenX-Hu.screenX,rx=l.screenY-Hu.screenY):rx=nx=0,Hu=l),nx)},movementY:function(l){return"movementY"in l?l.movementY:rx}}),X_=ls(wp),Fq=Q({},wp,{dataTransfer:0}),zq=ls(Fq),Bq=Q({},Vu,{relatedTarget:0}),sx=ls(Bq),qq=Q({},Hl,{animationName:0,elapsedTime:0,pseudoElement:0}),Uq=ls(qq),Wq=Q({},Hl,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),Vq=ls(Wq),Hq=Q({},Hl,{data:0}),Q_=ls(Hq),Kq={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Gq={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"},Yq={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Xq(l){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(l):(l=Yq[l])?!!u[l]:!1}function ax(){return Xq}var Qq=Q({},Vu,{key:function(l){if(l.key){var u=Kq[l.key]||l.key;if(u!=="Unidentified")return u}return l.type==="keypress"?(l=yp(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?Gq[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ax,charCode:function(l){return l.type==="keypress"?yp(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?yp(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),Zq=ls(Qq),Jq=Q({},wp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Z_=ls(Jq),eU=Q({},Vu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ax}),tU=ls(eU),nU=Q({},Hl,{propertyName:0,elapsedTime:0,pseudoElement:0}),rU=ls(nU),sU=Q({},wp,{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}),aU=ls(sU),iU=[9,13,27,32],ix=c&&"CompositionEvent"in window,Ku=null;c&&"documentMode"in document&&(Ku=document.documentMode);var oU=c&&"TextEvent"in window&&!Ku,J_=c&&(!ix||Ku&&8<Ku&&11>=Ku),eA=" ",tA=!1;function nA(l,u){switch(l){case"keyup":return iU.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rA(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var Kl=!1;function lU(l,u){switch(l){case"compositionend":return rA(u);case"keypress":return u.which!==32?null:(tA=!0,eA);case"textInput":return l=u.data,l===eA&&tA?null:l;default:return null}}function cU(l,u){if(Kl)return l==="compositionend"||!ix&&nA(l,u)?(l=G_(),xp=ex=qi=null,Kl=!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 J_&&u.locale!=="ko"?null:u.data;default:return null}}var uU={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 sA(l){var u=l&&l.nodeName&&l.nodeName.toLowerCase();return u==="input"?!!uU[l.type]:u==="textarea"}function aA(l,u,g,w){Le(w),u=_p(u,"onChange"),0<u.length&&(g=new tx("onChange","change",null,g,w),l.push({event:g,listeners:u}))}var Gu=null,Yu=null;function dU(l){SA(l,0)}function jp(l){var u=Zl(l);if(fe(u))return l}function fU(l,u){if(l==="change")return u}var iA=!1;if(c){var ox;if(c){var lx="oninput"in document;if(!lx){var oA=document.createElement("div");oA.setAttribute("oninput","return;"),lx=typeof oA.oninput=="function"}ox=lx}else ox=!1;iA=ox&&(!document.documentMode||9<document.documentMode)}function lA(){Gu&&(Gu.detachEvent("onpropertychange",cA),Yu=Gu=null)}function cA(l){if(l.propertyName==="value"&&jp(Yu)){var u=[];aA(u,Yu,l,Ne(l)),ve(dU,u)}}function pU(l,u,g){l==="focusin"?(lA(),Gu=u,Yu=g,Gu.attachEvent("onpropertychange",cA)):l==="focusout"&&lA()}function hU(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return jp(Yu)}function mU(l,u){if(l==="click")return jp(u)}function gU(l,u){if(l==="input"||l==="change")return jp(u)}function vU(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var Js=typeof Object.is=="function"?Object.is:vU;function Xu(l,u){if(Js(l,u))return!0;if(typeof l!="object"||l===null||typeof u!="object"||u===null)return!1;var g=Object.keys(l),w=Object.keys(u);if(g.length!==w.length)return!1;for(w=0;w<g.length;w++){var C=g[w];if(!d.call(u,C)||!Js(l[C],u[C]))return!1}return!0}function uA(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function dA(l,u){var g=uA(l);l=0;for(var w;g;){if(g.nodeType===3){if(w=l+g.textContent.length,l<=u&&w>=u)return{node:g,offset:u-l};l=w}e:{for(;g;){if(g.nextSibling){g=g.nextSibling;break e}g=g.parentNode}g=void 0}g=uA(g)}}function fA(l,u){return l&&u?l===u?!0:l&&l.nodeType===3?!1:u&&u.nodeType===3?fA(l,u.parentNode):"contains"in l?l.contains(u):l.compareDocumentPosition?!!(l.compareDocumentPosition(u)&16):!1:!1}function pA(){for(var l=window,u=xe();u instanceof l.HTMLIFrameElement;){try{var g=typeof u.contentWindow.location.href=="string"}catch{g=!1}if(g)l=u.contentWindow;else break;u=xe(l.document)}return u}function cx(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 xU(l){var u=pA(),g=l.focusedElem,w=l.selectionRange;if(u!==g&&g&&g.ownerDocument&&fA(g.ownerDocument.documentElement,g)){if(w!==null&&cx(g)){if(u=w.start,l=w.end,l===void 0&&(l=u),"selectionStart"in g)g.selectionStart=u,g.selectionEnd=Math.min(l,g.value.length);else if(l=(u=g.ownerDocument||document)&&u.defaultView||window,l.getSelection){l=l.getSelection();var C=g.textContent.length,T=Math.min(w.start,C);w=w.end===void 0?T:Math.min(w.end,C),!l.extend&&T>w&&(C=w,w=T,T=C),C=dA(g,T);var $=dA(g,w);C&&$&&(l.rangeCount!==1||l.anchorNode!==C.node||l.anchorOffset!==C.offset||l.focusNode!==$.node||l.focusOffset!==$.offset)&&(u=u.createRange(),u.setStart(C.node,C.offset),l.removeAllRanges(),T>w?(l.addRange(u),l.extend($.node,$.offset)):(u.setEnd($.node,$.offset),l.addRange(u)))}}for(u=[],l=g;l=l.parentNode;)l.nodeType===1&&u.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<u.length;g++)l=u[g],l.element.scrollLeft=l.left,l.element.scrollTop=l.top}}var yU=c&&"documentMode"in document&&11>=document.documentMode,Gl=null,ux=null,Qu=null,dx=!1;function hA(l,u,g){var w=g.window===g?g.document:g.nodeType===9?g:g.ownerDocument;dx||Gl==null||Gl!==xe(w)||(w=Gl,"selectionStart"in w&&cx(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}),Qu&&Xu(Qu,w)||(Qu=w,w=_p(ux,"onSelect"),0<w.length&&(u=new tx("onSelect","select",null,u,g),l.push({event:u,listeners:w}),u.target=Gl)))}function Sp(l,u){var g={};return g[l.toLowerCase()]=u.toLowerCase(),g["Webkit"+l]="webkit"+u,g["Moz"+l]="moz"+u,g}var Yl={animationend:Sp("Animation","AnimationEnd"),animationiteration:Sp("Animation","AnimationIteration"),animationstart:Sp("Animation","AnimationStart"),transitionend:Sp("Transition","TransitionEnd")},fx={},mA={};c&&(mA=document.createElement("div").style,"AnimationEvent"in window||(delete Yl.animationend.animation,delete Yl.animationiteration.animation,delete Yl.animationstart.animation),"TransitionEvent"in window||delete Yl.transitionend.transition);function Np(l){if(fx[l])return fx[l];if(!Yl[l])return l;var u=Yl[l],g;for(g in u)if(u.hasOwnProperty(g)&&g in mA)return fx[l]=u[g];return l}var gA=Np("animationend"),vA=Np("animationiteration"),xA=Np("animationstart"),yA=Np("transitionend"),bA=new Map,wA="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 Ui(l,u){bA.set(l,u),i(u,[l])}for(var px=0;px<wA.length;px++){var hx=wA[px],bU=hx.toLowerCase(),wU=hx[0].toUpperCase()+hx.slice(1);Ui(bU,"on"+wU)}Ui(gA,"onAnimationEnd"),Ui(vA,"onAnimationIteration"),Ui(xA,"onAnimationStart"),Ui("dblclick","onDoubleClick"),Ui("focusin","onFocus"),Ui("focusout","onBlur"),Ui(yA,"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 Zu="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(" "),jU=new Set("cancel close invalid load scroll toggle".split(" ").concat(Zu));function jA(l,u,g){var w=l.type||"unknown-event";l.currentTarget=g,Hn(w,u,void 0,l),l.currentTarget=null}function SA(l,u){u=(u&4)!==0;for(var g=0;g<l.length;g++){var w=l[g],C=w.event;w=w.listeners;e:{var T=void 0;if(u)for(var $=w.length-1;0<=$;$--){var ee=w[$],ce=ee.instance,je=ee.currentTarget;if(ee=ee.listener,ce!==T&&C.isPropagationStopped())break e;jA(C,ee,je),T=ce}else for($=0;$<w.length;$++){if(ee=w[$],ce=ee.instance,je=ee.currentTarget,ee=ee.listener,ce!==T&&C.isPropagationStopped())break e;jA(C,ee,je),T=ce}}}if(ke)throw l=en,ke=!1,en=null,l}function An(l,u){var g=u[jx];g===void 0&&(g=u[jx]=new Set);var w=l+"__bubble";g.has(w)||(NA(u,l,2,!1),g.add(w))}function mx(l,u,g){var w=0;u&&(w|=4),NA(g,l,w,u)}var Cp="_reactListening"+Math.random().toString(36).slice(2);function Ju(l){if(!l[Cp]){l[Cp]=!0,r.forEach(function(g){g!=="selectionchange"&&(jU.has(g)||mx(g,!1,l),mx(g,!0,l))});var u=l.nodeType===9?l:l.ownerDocument;u===null||u[Cp]||(u[Cp]=!0,mx("selectionchange",!1,u))}}function NA(l,u,g,w){switch(K_(u)){case 1:var C=$q;break;case 4:C=Dq;break;default:C=Zv}g=C.bind(null,u,g,l),C=void 0,!tt||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(C=!0),w?C!==void 0?l.addEventListener(u,g,{capture:!0,passive:C}):l.addEventListener(u,g,!0):C!==void 0?l.addEventListener(u,g,{passive:C}):l.addEventListener(u,g,!1)}function gx(l,u,g,w,C){var T=w;if((u&1)===0&&(u&2)===0&&w!==null)e:for(;;){if(w===null)return;var $=w.tag;if($===3||$===4){var ee=w.stateNode.containerInfo;if(ee===C||ee.nodeType===8&&ee.parentNode===C)break;if($===4)for($=w.return;$!==null;){var ce=$.tag;if((ce===3||ce===4)&&(ce=$.stateNode.containerInfo,ce===C||ce.nodeType===8&&ce.parentNode===C))return;$=$.return}for(;ee!==null;){if($=Mo(ee),$===null)return;if(ce=$.tag,ce===5||ce===6){w=T=$;continue e}ee=ee.parentNode}}w=w.return}ve(function(){var je=T,Be=Ne(g),We=[];e:{var ze=bA.get(l);if(ze!==void 0){var pt=tx,bt=l;switch(l){case"keypress":if(yp(g)===0)break e;case"keydown":case"keyup":pt=Zq;break;case"focusin":bt="focus",pt=sx;break;case"focusout":bt="blur",pt=sx;break;case"beforeblur":case"afterblur":pt=sx;break;case"click":if(g.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":pt=X_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pt=zq;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pt=tU;break;case gA:case vA:case xA:pt=Uq;break;case yA:pt=rU;break;case"scroll":pt=Lq;break;case"wheel":pt=aU;break;case"copy":case"cut":case"paste":pt=Vq;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pt=Z_}var wt=(u&4)!==0,Kn=!wt&&l==="scroll",ye=wt?ze!==null?ze+"Capture":null:ze;wt=[];for(var pe=je,be;pe!==null;){be=pe;var Ye=be.stateNode;if(be.tag===5&&Ye!==null&&(be=Ye,ye!==null&&(Ye=Ee(pe,ye),Ye!=null&&wt.push(ed(pe,Ye,be)))),Kn)break;pe=pe.return}0<wt.length&&(ze=new pt(ze,bt,null,g,Be),We.push({event:ze,listeners:wt}))}}if((u&7)===0){e:{if(ze=l==="mouseover"||l==="pointerover",pt=l==="mouseout"||l==="pointerout",ze&&g!==re&&(bt=g.relatedTarget||g.fromElement)&&(Mo(bt)||bt[Za]))break e;if((pt||ze)&&(ze=Be.window===Be?Be:(ze=Be.ownerDocument)?ze.defaultView||ze.parentWindow:window,pt?(bt=g.relatedTarget||g.toElement,pt=je,bt=bt?Mo(bt):null,bt!==null&&(Kn=_n(bt),bt!==Kn||bt.tag!==5&&bt.tag!==6)&&(bt=null)):(pt=null,bt=je),pt!==bt)){if(wt=X_,Ye="onMouseLeave",ye="onMouseEnter",pe="mouse",(l==="pointerout"||l==="pointerover")&&(wt=Z_,Ye="onPointerLeave",ye="onPointerEnter",pe="pointer"),Kn=pt==null?ze:Zl(pt),be=bt==null?ze:Zl(bt),ze=new wt(Ye,pe+"leave",pt,g,Be),ze.target=Kn,ze.relatedTarget=be,Ye=null,Mo(Be)===je&&(wt=new wt(ye,pe+"enter",bt,g,Be),wt.target=be,wt.relatedTarget=Kn,Ye=wt),Kn=Ye,pt&&bt)t:{for(wt=pt,ye=bt,pe=0,be=wt;be;be=Xl(be))pe++;for(be=0,Ye=ye;Ye;Ye=Xl(Ye))be++;for(;0<pe-be;)wt=Xl(wt),pe--;for(;0<be-pe;)ye=Xl(ye),be--;for(;pe--;){if(wt===ye||ye!==null&&wt===ye.alternate)break t;wt=Xl(wt),ye=Xl(ye)}wt=null}else wt=null;pt!==null&&CA(We,ze,pt,wt,!1),bt!==null&&Kn!==null&&CA(We,Kn,bt,wt,!0)}}e:{if(ze=je?Zl(je):window,pt=ze.nodeName&&ze.nodeName.toLowerCase(),pt==="select"||pt==="input"&&ze.type==="file")var St=fU;else if(sA(ze))if(iA)St=gU;else{St=hU;var Rt=pU}else(pt=ze.nodeName)&&pt.toLowerCase()==="input"&&(ze.type==="checkbox"||ze.type==="radio")&&(St=mU);if(St&&(St=St(l,je))){aA(We,St,g,Be);break e}Rt&&Rt(l,ze,je),l==="focusout"&&(Rt=ze._wrapperState)&&Rt.controlled&&ze.type==="number"&&Xe(ze,"number",ze.value)}switch(Rt=je?Zl(je):window,l){case"focusin":(sA(Rt)||Rt.contentEditable==="true")&&(Gl=Rt,ux=je,Qu=null);break;case"focusout":Qu=ux=Gl=null;break;case"mousedown":dx=!0;break;case"contextmenu":case"mouseup":case"dragend":dx=!1,hA(We,g,Be);break;case"selectionchange":if(yU)break;case"keydown":case"keyup":hA(We,g,Be)}var Ot;if(ix)e:{switch(l){case"compositionstart":var Ut="onCompositionStart";break e;case"compositionend":Ut="onCompositionEnd";break e;case"compositionupdate":Ut="onCompositionUpdate";break e}Ut=void 0}else Kl?nA(l,g)&&(Ut="onCompositionEnd"):l==="keydown"&&g.keyCode===229&&(Ut="onCompositionStart");Ut&&(J_&&g.locale!=="ko"&&(Kl||Ut!=="onCompositionStart"?Ut==="onCompositionEnd"&&Kl&&(Ot=G_()):(qi=Be,ex="value"in qi?qi.value:qi.textContent,Kl=!0)),Rt=_p(je,Ut),0<Rt.length&&(Ut=new Q_(Ut,l,null,g,Be),We.push({event:Ut,listeners:Rt}),Ot?Ut.data=Ot:(Ot=rA(g),Ot!==null&&(Ut.data=Ot)))),(Ot=oU?lU(l,g):cU(l,g))&&(je=_p(je,"onBeforeInput"),0<je.length&&(Be=new Q_("onBeforeInput","beforeinput",null,g,Be),We.push({event:Be,listeners:je}),Be.data=Ot))}SA(We,u)})}function ed(l,u,g){return{instance:l,listener:u,currentTarget:g}}function _p(l,u){for(var g=u+"Capture",w=[];l!==null;){var C=l,T=C.stateNode;C.tag===5&&T!==null&&(C=T,T=Ee(l,g),T!=null&&w.unshift(ed(l,T,C)),T=Ee(l,u),T!=null&&w.push(ed(l,T,C))),l=l.return}return w}function Xl(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5);return l||null}function CA(l,u,g,w,C){for(var T=u._reactName,$=[];g!==null&&g!==w;){var ee=g,ce=ee.alternate,je=ee.stateNode;if(ce!==null&&ce===w)break;ee.tag===5&&je!==null&&(ee=je,C?(ce=Ee(g,T),ce!=null&&$.unshift(ed(g,ce,ee))):C||(ce=Ee(g,T),ce!=null&&$.push(ed(g,ce,ee)))),g=g.return}$.length!==0&&l.push({event:u,listeners:$})}var SU=/\r\n?/g,NU=/\u0000|\uFFFD/g;function _A(l){return(typeof l=="string"?l:""+l).replace(SU,`
|
|
6
|
+
`).replace(NU,"")}function Ap(l,u,g){if(u=_A(u),_A(l)!==u&&g)throw Error(n(425))}function kp(){}var vx=null,xx=null;function yx(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 bx=typeof setTimeout=="function"?setTimeout:void 0,CU=typeof clearTimeout=="function"?clearTimeout:void 0,AA=typeof Promise=="function"?Promise:void 0,_U=typeof queueMicrotask=="function"?queueMicrotask:typeof AA<"u"?function(l){return AA.resolve(null).then(l).catch(AU)}:bx;function AU(l){setTimeout(function(){throw l})}function wx(l,u){var g=u,w=0;do{var C=g.nextSibling;if(l.removeChild(g),C&&C.nodeType===8)if(g=C.data,g==="/$"){if(w===0){l.removeChild(C),Wu(u);return}w--}else g!=="$"&&g!=="$?"&&g!=="$!"||w++;g=C}while(g);Wu(u)}function Wi(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 kA(l){l=l.previousSibling;for(var u=0;l;){if(l.nodeType===8){var g=l.data;if(g==="$"||g==="$!"||g==="$?"){if(u===0)return l;u--}else g==="/$"&&u++}l=l.previousSibling}return null}var Ql=Math.random().toString(36).slice(2),ka="__reactFiber$"+Ql,td="__reactProps$"+Ql,Za="__reactContainer$"+Ql,jx="__reactEvents$"+Ql,kU="__reactListeners$"+Ql,EU="__reactHandles$"+Ql;function Mo(l){var u=l[ka];if(u)return u;for(var g=l.parentNode;g;){if(u=g[Za]||g[ka]){if(g=u.alternate,u.child!==null||g!==null&&g.child!==null)for(l=kA(l);l!==null;){if(g=l[ka])return g;l=kA(l)}return u}l=g,g=l.parentNode}return null}function nd(l){return l=l[ka]||l[Za],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function Zl(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(n(33))}function Ep(l){return l[td]||null}var Sx=[],Jl=-1;function Vi(l){return{current:l}}function kn(l){0>Jl||(l.current=Sx[Jl],Sx[Jl]=null,Jl--)}function jn(l,u){Jl++,Sx[Jl]=l.current,l.current=u}var Hi={},Nr=Vi(Hi),Ur=Vi(!1),Io=Hi;function ec(l,u){var g=l.type.contextTypes;if(!g)return Hi;var w=l.stateNode;if(w&&w.__reactInternalMemoizedUnmaskedChildContext===u)return w.__reactInternalMemoizedMaskedChildContext;var C={},T;for(T in g)C[T]=u[T];return w&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=u,l.__reactInternalMemoizedMaskedChildContext=C),C}function Wr(l){return l=l.childContextTypes,l!=null}function Pp(){kn(Ur),kn(Nr)}function EA(l,u,g){if(Nr.current!==Hi)throw Error(n(168));jn(Nr,u),jn(Ur,g)}function PA(l,u,g){var w=l.stateNode;if(u=u.childContextTypes,typeof w.getChildContext!="function")return g;w=w.getChildContext();for(var C in w)if(!(C in u))throw Error(n(108,ie(l)||"Unknown",C));return Q({},g,w)}function Tp(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||Hi,Io=Nr.current,jn(Nr,l),jn(Ur,Ur.current),!0}function TA(l,u,g){var w=l.stateNode;if(!w)throw Error(n(169));g?(l=PA(l,u,Io),w.__reactInternalMemoizedMergedChildContext=l,kn(Ur),kn(Nr),jn(Nr,l)):kn(Ur),jn(Ur,g)}var Ja=null,Rp=!1,Nx=!1;function RA(l){Ja===null?Ja=[l]:Ja.push(l)}function PU(l){Rp=!0,RA(l)}function Ki(){if(!Nx&&Ja!==null){Nx=!0;var l=0,u=fn;try{var g=Ja;for(fn=1;l<g.length;l++){var w=g[l];do w=w(!0);while(w!==null)}Ja=null,Rp=!1}catch(C){throw Ja!==null&&(Ja=Ja.slice(l+1)),Ul(Wt,Ki),C}finally{fn=u,Nx=!1}}return null}var tc=[],nc=0,Op=null,Mp=0,Ns=[],Cs=0,$o=null,ei=1,ti="";function Do(l,u){tc[nc++]=Mp,tc[nc++]=Op,Op=l,Mp=u}function OA(l,u,g){Ns[Cs++]=ei,Ns[Cs++]=ti,Ns[Cs++]=$o,$o=l;var w=ei;l=ti;var C=32-vr(w)-1;w&=~(1<<C),g+=1;var T=32-vr(u)+C;if(30<T){var $=C-C%5;T=(w&(1<<$)-1).toString(32),w>>=$,C-=$,ei=1<<32-vr(u)+C|g<<C|w,ti=T+l}else ei=1<<T|g<<C|w,ti=l}function Cx(l){l.return!==null&&(Do(l,1),OA(l,1,0))}function _x(l){for(;l===Op;)Op=tc[--nc],tc[nc]=null,Mp=tc[--nc],tc[nc]=null;for(;l===$o;)$o=Ns[--Cs],Ns[Cs]=null,ti=Ns[--Cs],Ns[Cs]=null,ei=Ns[--Cs],Ns[Cs]=null}var cs=null,us=null,Mn=!1,ea=null;function MA(l,u){var g=Es(5,null,null,0);g.elementType="DELETED",g.stateNode=u,g.return=l,u=l.deletions,u===null?(l.deletions=[g],l.flags|=16):u.push(g)}function IA(l,u){switch(l.tag){case 5:var g=l.type;return u=u.nodeType!==1||g.toLowerCase()!==u.nodeName.toLowerCase()?null:u,u!==null?(l.stateNode=u,cs=l,us=Wi(u.firstChild),!0):!1;case 6:return u=l.pendingProps===""||u.nodeType!==3?null:u,u!==null?(l.stateNode=u,cs=l,us=null,!0):!1;case 13:return u=u.nodeType!==8?null:u,u!==null?(g=$o!==null?{id:ei,overflow:ti}:null,l.memoizedState={dehydrated:u,treeContext:g,retryLane:1073741824},g=Es(18,null,null,0),g.stateNode=u,g.return=l,l.child=g,cs=l,us=null,!0):!1;default:return!1}}function Ax(l){return(l.mode&1)!==0&&(l.flags&128)===0}function kx(l){if(Mn){var u=us;if(u){var g=u;if(!IA(l,u)){if(Ax(l))throw Error(n(418));u=Wi(g.nextSibling);var w=cs;u&&IA(l,u)?MA(w,g):(l.flags=l.flags&-4097|2,Mn=!1,cs=l)}}else{if(Ax(l))throw Error(n(418));l.flags=l.flags&-4097|2,Mn=!1,cs=l}}}function $A(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;cs=l}function Ip(l){if(l!==cs)return!1;if(!Mn)return $A(l),Mn=!0,!1;var u;if((u=l.tag!==3)&&!(u=l.tag!==5)&&(u=l.type,u=u!=="head"&&u!=="body"&&!yx(l.type,l.memoizedProps)),u&&(u=us)){if(Ax(l))throw DA(),Error(n(418));for(;u;)MA(l,u),u=Wi(u.nextSibling)}if($A(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 g=l.data;if(g==="/$"){if(u===0){us=Wi(l.nextSibling);break e}u--}else g!=="$"&&g!=="$!"&&g!=="$?"||u++}l=l.nextSibling}us=null}}else us=cs?Wi(l.stateNode.nextSibling):null;return!0}function DA(){for(var l=us;l;)l=Wi(l.nextSibling)}function rc(){us=cs=null,Mn=!1}function Ex(l){ea===null?ea=[l]:ea.push(l)}var TU=A.ReactCurrentBatchConfig;function rd(l,u,g){if(l=g.ref,l!==null&&typeof l!="function"&&typeof l!="object"){if(g._owner){if(g=g._owner,g){if(g.tag!==1)throw Error(n(309));var w=g.stateNode}if(!w)throw Error(n(147,l));var C=w,T=""+l;return u!==null&&u.ref!==null&&typeof u.ref=="function"&&u.ref._stringRef===T?u.ref:(u=function($){var ee=C.refs;$===null?delete ee[T]:ee[T]=$},u._stringRef=T,u)}if(typeof l!="string")throw Error(n(284));if(!g._owner)throw Error(n(290,l))}return l}function $p(l,u){throw l=Object.prototype.toString.call(u),Error(n(31,l==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":l))}function LA(l){var u=l._init;return u(l._payload)}function FA(l){function u(ye,pe){if(l){var be=ye.deletions;be===null?(ye.deletions=[pe],ye.flags|=16):be.push(pe)}}function g(ye,pe){if(!l)return null;for(;pe!==null;)u(ye,pe),pe=pe.sibling;return null}function w(ye,pe){for(ye=new Map;pe!==null;)pe.key!==null?ye.set(pe.key,pe):ye.set(pe.index,pe),pe=pe.sibling;return ye}function C(ye,pe){return ye=to(ye,pe),ye.index=0,ye.sibling=null,ye}function T(ye,pe,be){return ye.index=be,l?(be=ye.alternate,be!==null?(be=be.index,be<pe?(ye.flags|=2,pe):be):(ye.flags|=2,pe)):(ye.flags|=1048576,pe)}function $(ye){return l&&ye.alternate===null&&(ye.flags|=2),ye}function ee(ye,pe,be,Ye){return pe===null||pe.tag!==6?(pe=by(be,ye.mode,Ye),pe.return=ye,pe):(pe=C(pe,be),pe.return=ye,pe)}function ce(ye,pe,be,Ye){var St=be.type;return St===P?Be(ye,pe,be.props.children,Ye,be.key):pe!==null&&(pe.elementType===St||typeof St=="object"&&St!==null&&St.$$typeof===I&&LA(St)===pe.type)?(Ye=C(pe,be.props),Ye.ref=rd(ye,pe,be),Ye.return=ye,Ye):(Ye=ih(be.type,be.key,be.props,null,ye.mode,Ye),Ye.ref=rd(ye,pe,be),Ye.return=ye,Ye)}function je(ye,pe,be,Ye){return pe===null||pe.tag!==4||pe.stateNode.containerInfo!==be.containerInfo||pe.stateNode.implementation!==be.implementation?(pe=wy(be,ye.mode,Ye),pe.return=ye,pe):(pe=C(pe,be.children||[]),pe.return=ye,pe)}function Be(ye,pe,be,Ye,St){return pe===null||pe.tag!==7?(pe=Vo(be,ye.mode,Ye,St),pe.return=ye,pe):(pe=C(pe,be),pe.return=ye,pe)}function We(ye,pe,be){if(typeof pe=="string"&&pe!==""||typeof pe=="number")return pe=by(""+pe,ye.mode,be),pe.return=ye,pe;if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case k:return be=ih(pe.type,pe.key,pe.props,null,ye.mode,be),be.ref=rd(ye,null,pe),be.return=ye,be;case E:return pe=wy(pe,ye.mode,be),pe.return=ye,pe;case I:var Ye=pe._init;return We(ye,Ye(pe._payload),be)}if(Se(pe)||O(pe))return pe=Vo(pe,ye.mode,be,null),pe.return=ye,pe;$p(ye,pe)}return null}function ze(ye,pe,be,Ye){var St=pe!==null?pe.key:null;if(typeof be=="string"&&be!==""||typeof be=="number")return St!==null?null:ee(ye,pe,""+be,Ye);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case k:return be.key===St?ce(ye,pe,be,Ye):null;case E:return be.key===St?je(ye,pe,be,Ye):null;case I:return St=be._init,ze(ye,pe,St(be._payload),Ye)}if(Se(be)||O(be))return St!==null?null:Be(ye,pe,be,Ye,null);$p(ye,be)}return null}function pt(ye,pe,be,Ye,St){if(typeof Ye=="string"&&Ye!==""||typeof Ye=="number")return ye=ye.get(be)||null,ee(pe,ye,""+Ye,St);if(typeof Ye=="object"&&Ye!==null){switch(Ye.$$typeof){case k:return ye=ye.get(Ye.key===null?be:Ye.key)||null,ce(pe,ye,Ye,St);case E:return ye=ye.get(Ye.key===null?be:Ye.key)||null,je(pe,ye,Ye,St);case I:var Rt=Ye._init;return pt(ye,pe,be,Rt(Ye._payload),St)}if(Se(Ye)||O(Ye))return ye=ye.get(be)||null,Be(pe,ye,Ye,St,null);$p(pe,Ye)}return null}function bt(ye,pe,be,Ye){for(var St=null,Rt=null,Ot=pe,Ut=pe=0,fr=null;Ot!==null&&Ut<be.length;Ut++){Ot.index>Ut?(fr=Ot,Ot=null):fr=Ot.sibling;var ln=ze(ye,Ot,be[Ut],Ye);if(ln===null){Ot===null&&(Ot=fr);break}l&&Ot&&ln.alternate===null&&u(ye,Ot),pe=T(ln,pe,Ut),Rt===null?St=ln:Rt.sibling=ln,Rt=ln,Ot=fr}if(Ut===be.length)return g(ye,Ot),Mn&&Do(ye,Ut),St;if(Ot===null){for(;Ut<be.length;Ut++)Ot=We(ye,be[Ut],Ye),Ot!==null&&(pe=T(Ot,pe,Ut),Rt===null?St=Ot:Rt.sibling=Ot,Rt=Ot);return Mn&&Do(ye,Ut),St}for(Ot=w(ye,Ot);Ut<be.length;Ut++)fr=pt(Ot,ye,Ut,be[Ut],Ye),fr!==null&&(l&&fr.alternate!==null&&Ot.delete(fr.key===null?Ut:fr.key),pe=T(fr,pe,Ut),Rt===null?St=fr:Rt.sibling=fr,Rt=fr);return l&&Ot.forEach(function(no){return u(ye,no)}),Mn&&Do(ye,Ut),St}function wt(ye,pe,be,Ye){var St=O(be);if(typeof St!="function")throw Error(n(150));if(be=St.call(be),be==null)throw Error(n(151));for(var Rt=St=null,Ot=pe,Ut=pe=0,fr=null,ln=be.next();Ot!==null&&!ln.done;Ut++,ln=be.next()){Ot.index>Ut?(fr=Ot,Ot=null):fr=Ot.sibling;var no=ze(ye,Ot,ln.value,Ye);if(no===null){Ot===null&&(Ot=fr);break}l&&Ot&&no.alternate===null&&u(ye,Ot),pe=T(no,pe,Ut),Rt===null?St=no:Rt.sibling=no,Rt=no,Ot=fr}if(ln.done)return g(ye,Ot),Mn&&Do(ye,Ut),St;if(Ot===null){for(;!ln.done;Ut++,ln=be.next())ln=We(ye,ln.value,Ye),ln!==null&&(pe=T(ln,pe,Ut),Rt===null?St=ln:Rt.sibling=ln,Rt=ln);return Mn&&Do(ye,Ut),St}for(Ot=w(ye,Ot);!ln.done;Ut++,ln=be.next())ln=pt(Ot,ye,Ut,ln.value,Ye),ln!==null&&(l&&ln.alternate!==null&&Ot.delete(ln.key===null?Ut:ln.key),pe=T(ln,pe,Ut),Rt===null?St=ln:Rt.sibling=ln,Rt=ln);return l&&Ot.forEach(function(u7){return u(ye,u7)}),Mn&&Do(ye,Ut),St}function Kn(ye,pe,be,Ye){if(typeof be=="object"&&be!==null&&be.type===P&&be.key===null&&(be=be.props.children),typeof be=="object"&&be!==null){switch(be.$$typeof){case k:e:{for(var St=be.key,Rt=pe;Rt!==null;){if(Rt.key===St){if(St=be.type,St===P){if(Rt.tag===7){g(ye,Rt.sibling),pe=C(Rt,be.props.children),pe.return=ye,ye=pe;break e}}else if(Rt.elementType===St||typeof St=="object"&&St!==null&&St.$$typeof===I&&LA(St)===Rt.type){g(ye,Rt.sibling),pe=C(Rt,be.props),pe.ref=rd(ye,Rt,be),pe.return=ye,ye=pe;break e}g(ye,Rt);break}else u(ye,Rt);Rt=Rt.sibling}be.type===P?(pe=Vo(be.props.children,ye.mode,Ye,be.key),pe.return=ye,ye=pe):(Ye=ih(be.type,be.key,be.props,null,ye.mode,Ye),Ye.ref=rd(ye,pe,be),Ye.return=ye,ye=Ye)}return $(ye);case E:e:{for(Rt=be.key;pe!==null;){if(pe.key===Rt)if(pe.tag===4&&pe.stateNode.containerInfo===be.containerInfo&&pe.stateNode.implementation===be.implementation){g(ye,pe.sibling),pe=C(pe,be.children||[]),pe.return=ye,ye=pe;break e}else{g(ye,pe);break}else u(ye,pe);pe=pe.sibling}pe=wy(be,ye.mode,Ye),pe.return=ye,ye=pe}return $(ye);case I:return Rt=be._init,Kn(ye,pe,Rt(be._payload),Ye)}if(Se(be))return bt(ye,pe,be,Ye);if(O(be))return wt(ye,pe,be,Ye);$p(ye,be)}return typeof be=="string"&&be!==""||typeof be=="number"?(be=""+be,pe!==null&&pe.tag===6?(g(ye,pe.sibling),pe=C(pe,be),pe.return=ye,ye=pe):(g(ye,pe),pe=by(be,ye.mode,Ye),pe.return=ye,ye=pe),$(ye)):g(ye,pe)}return Kn}var sc=FA(!0),zA=FA(!1),Dp=Vi(null),Lp=null,ac=null,Px=null;function Tx(){Px=ac=Lp=null}function Rx(l){var u=Dp.current;kn(Dp),l._currentValue=u}function Ox(l,u,g){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===g)break;l=l.return}}function ic(l,u){Lp=l,Px=ac=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&u)!==0&&(Vr=!0),l.firstContext=null)}function _s(l){var u=l._currentValue;if(Px!==l)if(l={context:l,memoizedValue:u,next:null},ac===null){if(Lp===null)throw Error(n(308));ac=l,Lp.dependencies={lanes:0,firstContext:l}}else ac=ac.next=l;return u}var Lo=null;function Mx(l){Lo===null?Lo=[l]:Lo.push(l)}function BA(l,u,g,w){var C=u.interleaved;return C===null?(g.next=g,Mx(u)):(g.next=C.next,C.next=g),u.interleaved=g,ni(l,w)}function ni(l,u){l.lanes|=u;var g=l.alternate;for(g!==null&&(g.lanes|=u),g=l,l=l.return;l!==null;)l.childLanes|=u,g=l.alternate,g!==null&&(g.childLanes|=u),g=l,l=l.return;return g.tag===3?g.stateNode:null}var Gi=!1;function Ix(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function qA(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 ri(l,u){return{eventTime:l,lane:u,tag:0,payload:null,callback:null,next:null}}function Yi(l,u,g){var w=l.updateQueue;if(w===null)return null;if(w=w.shared,(an&2)!==0){var C=w.pending;return C===null?u.next=u:(u.next=C.next,C.next=u),w.pending=u,ni(l,g)}return C=w.interleaved,C===null?(u.next=u,Mx(w)):(u.next=C.next,C.next=u),w.interleaved=u,ni(l,g)}function Fp(l,u,g){if(u=u.updateQueue,u!==null&&(u=u.shared,(g&4194240)!==0)){var w=u.lanes;w&=l.pendingLanes,g|=w,u.lanes=g,Oo(l,g)}}function UA(l,u){var g=l.updateQueue,w=l.alternate;if(w!==null&&(w=w.updateQueue,g===w)){var C=null,T=null;if(g=g.firstBaseUpdate,g!==null){do{var $={eventTime:g.eventTime,lane:g.lane,tag:g.tag,payload:g.payload,callback:g.callback,next:null};T===null?C=T=$:T=T.next=$,g=g.next}while(g!==null);T===null?C=T=u:T=T.next=u}else C=T=u;g={baseState:w.baseState,firstBaseUpdate:C,lastBaseUpdate:T,shared:w.shared,effects:w.effects},l.updateQueue=g;return}l=g.lastBaseUpdate,l===null?g.firstBaseUpdate=u:l.next=u,g.lastBaseUpdate=u}function zp(l,u,g,w){var C=l.updateQueue;Gi=!1;var T=C.firstBaseUpdate,$=C.lastBaseUpdate,ee=C.shared.pending;if(ee!==null){C.shared.pending=null;var ce=ee,je=ce.next;ce.next=null,$===null?T=je:$.next=je,$=ce;var Be=l.alternate;Be!==null&&(Be=Be.updateQueue,ee=Be.lastBaseUpdate,ee!==$&&(ee===null?Be.firstBaseUpdate=je:ee.next=je,Be.lastBaseUpdate=ce))}if(T!==null){var We=C.baseState;$=0,Be=je=ce=null,ee=T;do{var ze=ee.lane,pt=ee.eventTime;if((w&ze)===ze){Be!==null&&(Be=Be.next={eventTime:pt,lane:0,tag:ee.tag,payload:ee.payload,callback:ee.callback,next:null});e:{var bt=l,wt=ee;switch(ze=u,pt=g,wt.tag){case 1:if(bt=wt.payload,typeof bt=="function"){We=bt.call(pt,We,ze);break e}We=bt;break e;case 3:bt.flags=bt.flags&-65537|128;case 0:if(bt=wt.payload,ze=typeof bt=="function"?bt.call(pt,We,ze):bt,ze==null)break e;We=Q({},We,ze);break e;case 2:Gi=!0}}ee.callback!==null&&ee.lane!==0&&(l.flags|=64,ze=C.effects,ze===null?C.effects=[ee]:ze.push(ee))}else pt={eventTime:pt,lane:ze,tag:ee.tag,payload:ee.payload,callback:ee.callback,next:null},Be===null?(je=Be=pt,ce=We):Be=Be.next=pt,$|=ze;if(ee=ee.next,ee===null){if(ee=C.shared.pending,ee===null)break;ze=ee,ee=ze.next,ze.next=null,C.lastBaseUpdate=ze,C.shared.pending=null}}while(!0);if(Be===null&&(ce=We),C.baseState=ce,C.firstBaseUpdate=je,C.lastBaseUpdate=Be,u=C.shared.interleaved,u!==null){C=u;do $|=C.lane,C=C.next;while(C!==u)}else T===null&&(C.shared.lanes=0);Bo|=$,l.lanes=$,l.memoizedState=We}}function WA(l,u,g){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=g,typeof C!="function")throw Error(n(191,C));C.call(w)}}}var sd={},Ea=Vi(sd),ad=Vi(sd),id=Vi(sd);function Fo(l){if(l===sd)throw Error(n(174));return l}function $x(l,u){switch(jn(id,u),jn(ad,l),jn(Ea,sd),l=u.nodeType,l){case 9:case 11:u=(u=u.documentElement)?u.namespaceURI:nn(null,"");break;default:l=l===8?u.parentNode:u,u=l.namespaceURI||null,l=l.tagName,u=nn(u,l)}kn(Ea),jn(Ea,u)}function oc(){kn(Ea),kn(ad),kn(id)}function VA(l){Fo(id.current);var u=Fo(Ea.current),g=nn(u,l.type);u!==g&&(jn(ad,l),jn(Ea,g))}function Dx(l){ad.current===l&&(kn(Ea),kn(ad))}var Ln=Vi(0);function Bp(l){for(var u=l;u!==null;){if(u.tag===13){var g=u.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||g.data==="$?"||g.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 Lx=[];function Fx(){for(var l=0;l<Lx.length;l++)Lx[l]._workInProgressVersionPrimary=null;Lx.length=0}var qp=A.ReactCurrentDispatcher,zx=A.ReactCurrentBatchConfig,zo=0,Fn=null,Jn=null,ur=null,Up=!1,od=!1,ld=0,RU=0;function Cr(){throw Error(n(321))}function Bx(l,u){if(u===null)return!1;for(var g=0;g<u.length&&g<l.length;g++)if(!Js(l[g],u[g]))return!1;return!0}function qx(l,u,g,w,C,T){if(zo=T,Fn=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,qp.current=l===null||l.memoizedState===null?$U:DU,l=g(w,C),od){T=0;do{if(od=!1,ld=0,25<=T)throw Error(n(301));T+=1,ur=Jn=null,u.updateQueue=null,qp.current=LU,l=g(w,C)}while(od)}if(qp.current=Hp,u=Jn!==null&&Jn.next!==null,zo=0,ur=Jn=Fn=null,Up=!1,u)throw Error(n(300));return l}function Ux(){var l=ld!==0;return ld=0,l}function Pa(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ur===null?Fn.memoizedState=ur=l:ur=ur.next=l,ur}function As(){if(Jn===null){var l=Fn.alternate;l=l!==null?l.memoizedState:null}else l=Jn.next;var u=ur===null?Fn.memoizedState:ur.next;if(u!==null)ur=u,Jn=l;else{if(l===null)throw Error(n(310));Jn=l,l={memoizedState:Jn.memoizedState,baseState:Jn.baseState,baseQueue:Jn.baseQueue,queue:Jn.queue,next:null},ur===null?Fn.memoizedState=ur=l:ur=ur.next=l}return ur}function cd(l,u){return typeof u=="function"?u(l):u}function Wx(l){var u=As(),g=u.queue;if(g===null)throw Error(n(311));g.lastRenderedReducer=l;var w=Jn,C=w.baseQueue,T=g.pending;if(T!==null){if(C!==null){var $=C.next;C.next=T.next,T.next=$}w.baseQueue=C=T,g.pending=null}if(C!==null){T=C.next,w=w.baseState;var ee=$=null,ce=null,je=T;do{var Be=je.lane;if((zo&Be)===Be)ce!==null&&(ce=ce.next={lane:0,action:je.action,hasEagerState:je.hasEagerState,eagerState:je.eagerState,next:null}),w=je.hasEagerState?je.eagerState:l(w,je.action);else{var We={lane:Be,action:je.action,hasEagerState:je.hasEagerState,eagerState:je.eagerState,next:null};ce===null?(ee=ce=We,$=w):ce=ce.next=We,Fn.lanes|=Be,Bo|=Be}je=je.next}while(je!==null&&je!==T);ce===null?$=w:ce.next=ee,Js(w,u.memoizedState)||(Vr=!0),u.memoizedState=w,u.baseState=$,u.baseQueue=ce,g.lastRenderedState=w}if(l=g.interleaved,l!==null){C=l;do T=C.lane,Fn.lanes|=T,Bo|=T,C=C.next;while(C!==l)}else C===null&&(g.lanes=0);return[u.memoizedState,g.dispatch]}function Vx(l){var u=As(),g=u.queue;if(g===null)throw Error(n(311));g.lastRenderedReducer=l;var w=g.dispatch,C=g.pending,T=u.memoizedState;if(C!==null){g.pending=null;var $=C=C.next;do T=l(T,$.action),$=$.next;while($!==C);Js(T,u.memoizedState)||(Vr=!0),u.memoizedState=T,u.baseQueue===null&&(u.baseState=T),g.lastRenderedState=T}return[T,w]}function HA(){}function KA(l,u){var g=Fn,w=As(),C=u(),T=!Js(w.memoizedState,C);if(T&&(w.memoizedState=C,Vr=!0),w=w.queue,Hx(XA.bind(null,g,w,l),[l]),w.getSnapshot!==u||T||ur!==null&&ur.memoizedState.tag&1){if(g.flags|=2048,ud(9,YA.bind(null,g,w,C,u),void 0,null),dr===null)throw Error(n(349));(zo&30)!==0||GA(g,u,C)}return C}function GA(l,u,g){l.flags|=16384,l={getSnapshot:u,value:g},u=Fn.updateQueue,u===null?(u={lastEffect:null,stores:null},Fn.updateQueue=u,u.stores=[l]):(g=u.stores,g===null?u.stores=[l]:g.push(l))}function YA(l,u,g,w){u.value=g,u.getSnapshot=w,QA(u)&&ZA(l)}function XA(l,u,g){return g(function(){QA(u)&&ZA(l)})}function QA(l){var u=l.getSnapshot;l=l.value;try{var g=u();return!Js(l,g)}catch{return!0}}function ZA(l){var u=ni(l,1);u!==null&&sa(u,l,1,-1)}function JA(l){var u=Pa();return typeof l=="function"&&(l=l()),u.memoizedState=u.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:cd,lastRenderedState:l},u.queue=l,l=l.dispatch=IU.bind(null,Fn,l),[u.memoizedState,l]}function ud(l,u,g,w){return l={tag:l,create:u,destroy:g,deps:w,next:null},u=Fn.updateQueue,u===null?(u={lastEffect:null,stores:null},Fn.updateQueue=u,u.lastEffect=l.next=l):(g=u.lastEffect,g===null?u.lastEffect=l.next=l:(w=g.next,g.next=l,l.next=w,u.lastEffect=l)),l}function ek(){return As().memoizedState}function Wp(l,u,g,w){var C=Pa();Fn.flags|=l,C.memoizedState=ud(1|u,g,void 0,w===void 0?null:w)}function Vp(l,u,g,w){var C=As();w=w===void 0?null:w;var T=void 0;if(Jn!==null){var $=Jn.memoizedState;if(T=$.destroy,w!==null&&Bx(w,$.deps)){C.memoizedState=ud(u,g,T,w);return}}Fn.flags|=l,C.memoizedState=ud(1|u,g,T,w)}function tk(l,u){return Wp(8390656,8,l,u)}function Hx(l,u){return Vp(2048,8,l,u)}function nk(l,u){return Vp(4,2,l,u)}function rk(l,u){return Vp(4,4,l,u)}function sk(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 ak(l,u,g){return g=g!=null?g.concat([l]):null,Vp(4,4,sk.bind(null,u,l),g)}function Kx(){}function ik(l,u){var g=As();u=u===void 0?null:u;var w=g.memoizedState;return w!==null&&u!==null&&Bx(u,w[1])?w[0]:(g.memoizedState=[l,u],l)}function ok(l,u){var g=As();u=u===void 0?null:u;var w=g.memoizedState;return w!==null&&u!==null&&Bx(u,w[1])?w[0]:(l=l(),g.memoizedState=[l,u],l)}function lk(l,u,g){return(zo&21)===0?(l.baseState&&(l.baseState=!1,Vr=!0),l.memoizedState=g):(Js(g,u)||(g=qr(),Fn.lanes|=g,Bo|=g,l.baseState=!0),u)}function OU(l,u){var g=fn;fn=g!==0&&4>g?g:4,l(!0);var w=zx.transition;zx.transition={};try{l(!1),u()}finally{fn=g,zx.transition=w}}function ck(){return As().memoizedState}function MU(l,u,g){var w=Ji(l);if(g={lane:w,action:g,hasEagerState:!1,eagerState:null,next:null},uk(l))dk(u,g);else if(g=BA(l,u,g,w),g!==null){var C=Tr();sa(g,l,w,C),fk(g,u,w)}}function IU(l,u,g){var w=Ji(l),C={lane:w,action:g,hasEagerState:!1,eagerState:null,next:null};if(uk(l))dk(u,C);else{var T=l.alternate;if(l.lanes===0&&(T===null||T.lanes===0)&&(T=u.lastRenderedReducer,T!==null))try{var $=u.lastRenderedState,ee=T($,g);if(C.hasEagerState=!0,C.eagerState=ee,Js(ee,$)){var ce=u.interleaved;ce===null?(C.next=C,Mx(u)):(C.next=ce.next,ce.next=C),u.interleaved=C;return}}catch{}g=BA(l,u,C,w),g!==null&&(C=Tr(),sa(g,l,w,C),fk(g,u,w))}}function uk(l){var u=l.alternate;return l===Fn||u!==null&&u===Fn}function dk(l,u){od=Up=!0;var g=l.pending;g===null?u.next=u:(u.next=g.next,g.next=u),l.pending=u}function fk(l,u,g){if((g&4194240)!==0){var w=u.lanes;w&=l.pendingLanes,g|=w,u.lanes=g,Oo(l,g)}}var Hp={readContext:_s,useCallback:Cr,useContext:Cr,useEffect:Cr,useImperativeHandle:Cr,useInsertionEffect:Cr,useLayoutEffect:Cr,useMemo:Cr,useReducer:Cr,useRef:Cr,useState:Cr,useDebugValue:Cr,useDeferredValue:Cr,useTransition:Cr,useMutableSource:Cr,useSyncExternalStore:Cr,useId:Cr,unstable_isNewReconciler:!1},$U={readContext:_s,useCallback:function(l,u){return Pa().memoizedState=[l,u===void 0?null:u],l},useContext:_s,useEffect:tk,useImperativeHandle:function(l,u,g){return g=g!=null?g.concat([l]):null,Wp(4194308,4,sk.bind(null,u,l),g)},useLayoutEffect:function(l,u){return Wp(4194308,4,l,u)},useInsertionEffect:function(l,u){return Wp(4,2,l,u)},useMemo:function(l,u){var g=Pa();return u=u===void 0?null:u,l=l(),g.memoizedState=[l,u],l},useReducer:function(l,u,g){var w=Pa();return u=g!==void 0?g(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=MU.bind(null,Fn,l),[w.memoizedState,l]},useRef:function(l){var u=Pa();return l={current:l},u.memoizedState=l},useState:JA,useDebugValue:Kx,useDeferredValue:function(l){return Pa().memoizedState=l},useTransition:function(){var l=JA(!1),u=l[0];return l=OU.bind(null,l[1]),Pa().memoizedState=l,[u,l]},useMutableSource:function(){},useSyncExternalStore:function(l,u,g){var w=Fn,C=Pa();if(Mn){if(g===void 0)throw Error(n(407));g=g()}else{if(g=u(),dr===null)throw Error(n(349));(zo&30)!==0||GA(w,u,g)}C.memoizedState=g;var T={value:g,getSnapshot:u};return C.queue=T,tk(XA.bind(null,w,T,l),[l]),w.flags|=2048,ud(9,YA.bind(null,w,T,g,u),void 0,null),g},useId:function(){var l=Pa(),u=dr.identifierPrefix;if(Mn){var g=ti,w=ei;g=(w&~(1<<32-vr(w)-1)).toString(32)+g,u=":"+u+"R"+g,g=ld++,0<g&&(u+="H"+g.toString(32)),u+=":"}else g=RU++,u=":"+u+"r"+g.toString(32)+":";return l.memoizedState=u},unstable_isNewReconciler:!1},DU={readContext:_s,useCallback:ik,useContext:_s,useEffect:Hx,useImperativeHandle:ak,useInsertionEffect:nk,useLayoutEffect:rk,useMemo:ok,useReducer:Wx,useRef:ek,useState:function(){return Wx(cd)},useDebugValue:Kx,useDeferredValue:function(l){var u=As();return lk(u,Jn.memoizedState,l)},useTransition:function(){var l=Wx(cd)[0],u=As().memoizedState;return[l,u]},useMutableSource:HA,useSyncExternalStore:KA,useId:ck,unstable_isNewReconciler:!1},LU={readContext:_s,useCallback:ik,useContext:_s,useEffect:Hx,useImperativeHandle:ak,useInsertionEffect:nk,useLayoutEffect:rk,useMemo:ok,useReducer:Vx,useRef:ek,useState:function(){return Vx(cd)},useDebugValue:Kx,useDeferredValue:function(l){var u=As();return Jn===null?u.memoizedState=l:lk(u,Jn.memoizedState,l)},useTransition:function(){var l=Vx(cd)[0],u=As().memoizedState;return[l,u]},useMutableSource:HA,useSyncExternalStore:KA,useId:ck,unstable_isNewReconciler:!1};function ta(l,u){if(l&&l.defaultProps){u=Q({},u),l=l.defaultProps;for(var g in l)u[g]===void 0&&(u[g]=l[g]);return u}return u}function Gx(l,u,g,w){u=l.memoizedState,g=g(w,u),g=g==null?u:Q({},u,g),l.memoizedState=g,l.lanes===0&&(l.updateQueue.baseState=g)}var Kp={isMounted:function(l){return(l=l._reactInternals)?_n(l)===l:!1},enqueueSetState:function(l,u,g){l=l._reactInternals;var w=Tr(),C=Ji(l),T=ri(w,C);T.payload=u,g!=null&&(T.callback=g),u=Yi(l,T,C),u!==null&&(sa(u,l,C,w),Fp(u,l,C))},enqueueReplaceState:function(l,u,g){l=l._reactInternals;var w=Tr(),C=Ji(l),T=ri(w,C);T.tag=1,T.payload=u,g!=null&&(T.callback=g),u=Yi(l,T,C),u!==null&&(sa(u,l,C,w),Fp(u,l,C))},enqueueForceUpdate:function(l,u){l=l._reactInternals;var g=Tr(),w=Ji(l),C=ri(g,w);C.tag=2,u!=null&&(C.callback=u),u=Yi(l,C,w),u!==null&&(sa(u,l,w,g),Fp(u,l,w))}};function pk(l,u,g,w,C,T,$){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(w,T,$):u.prototype&&u.prototype.isPureReactComponent?!Xu(g,w)||!Xu(C,T):!0}function hk(l,u,g){var w=!1,C=Hi,T=u.contextType;return typeof T=="object"&&T!==null?T=_s(T):(C=Wr(u)?Io:Nr.current,w=u.contextTypes,T=(w=w!=null)?ec(l,C):Hi),u=new u(g,T),l.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Kp,l.stateNode=u,u._reactInternals=l,w&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=C,l.__reactInternalMemoizedMaskedChildContext=T),u}function mk(l,u,g,w){l=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(g,w),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(g,w),u.state!==l&&Kp.enqueueReplaceState(u,u.state,null)}function Yx(l,u,g,w){var C=l.stateNode;C.props=g,C.state=l.memoizedState,C.refs={},Ix(l);var T=u.contextType;typeof T=="object"&&T!==null?C.context=_s(T):(T=Wr(u)?Io:Nr.current,C.context=ec(l,T)),C.state=l.memoizedState,T=u.getDerivedStateFromProps,typeof T=="function"&&(Gx(l,u,T,g),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&&Kp.enqueueReplaceState(C,C.state,null),zp(l,g,C,w),C.state=l.memoizedState),typeof C.componentDidMount=="function"&&(l.flags|=4194308)}function lc(l,u){try{var g="",w=u;do g+=ne(w),w=w.return;while(w);var C=g}catch(T){C=`
|
|
7
|
+
Error generating stack: `+T.message+`
|
|
8
|
+
`+T.stack}return{value:l,source:u,stack:C,digest:null}}function Xx(l,u,g){return{value:l,source:null,stack:g??null,digest:u??null}}function Qx(l,u){try{console.error(u.value)}catch(g){setTimeout(function(){throw g})}}var FU=typeof WeakMap=="function"?WeakMap:Map;function gk(l,u,g){g=ri(-1,g),g.tag=3,g.payload={element:null};var w=u.value;return g.callback=function(){eh||(eh=!0,fy=w),Qx(l,u)},g}function vk(l,u,g){g=ri(-1,g),g.tag=3;var w=l.type.getDerivedStateFromError;if(typeof w=="function"){var C=u.value;g.payload=function(){return w(C)},g.callback=function(){Qx(l,u)}}var T=l.stateNode;return T!==null&&typeof T.componentDidCatch=="function"&&(g.callback=function(){Qx(l,u),typeof w!="function"&&(Qi===null?Qi=new Set([this]):Qi.add(this));var $=u.stack;this.componentDidCatch(u.value,{componentStack:$!==null?$:""})}),g}function xk(l,u,g){var w=l.pingCache;if(w===null){w=l.pingCache=new FU;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(g)||(C.add(g),l=JU.bind(null,l,u,g),u.then(l,l))}function yk(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 bk(l,u,g,w,C){return(l.mode&1)===0?(l===u?l.flags|=65536:(l.flags|=128,g.flags|=131072,g.flags&=-52805,g.tag===1&&(g.alternate===null?g.tag=17:(u=ri(-1,1),u.tag=2,Yi(g,u,1))),g.lanes|=1),l):(l.flags|=65536,l.lanes=C,l)}var zU=A.ReactCurrentOwner,Vr=!1;function Pr(l,u,g,w){u.child=l===null?zA(u,null,g,w):sc(u,l.child,g,w)}function wk(l,u,g,w,C){g=g.render;var T=u.ref;return ic(u,C),w=qx(l,u,g,w,T,C),g=Ux(),l!==null&&!Vr?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~C,si(l,u,C)):(Mn&&g&&Cx(u),u.flags|=1,Pr(l,u,w,C),u.child)}function jk(l,u,g,w,C){if(l===null){var T=g.type;return typeof T=="function"&&!yy(T)&&T.defaultProps===void 0&&g.compare===null&&g.defaultProps===void 0?(u.tag=15,u.type=T,Sk(l,u,T,w,C)):(l=ih(g.type,null,w,u,u.mode,C),l.ref=u.ref,l.return=u,u.child=l)}if(T=l.child,(l.lanes&C)===0){var $=T.memoizedProps;if(g=g.compare,g=g!==null?g:Xu,g($,w)&&l.ref===u.ref)return si(l,u,C)}return u.flags|=1,l=to(T,w),l.ref=u.ref,l.return=u,u.child=l}function Sk(l,u,g,w,C){if(l!==null){var T=l.memoizedProps;if(Xu(T,w)&&l.ref===u.ref)if(Vr=!1,u.pendingProps=w=T,(l.lanes&C)!==0)(l.flags&131072)!==0&&(Vr=!0);else return u.lanes=l.lanes,si(l,u,C)}return Zx(l,u,g,w,C)}function Nk(l,u,g){var w=u.pendingProps,C=w.children,T=l!==null?l.memoizedState:null;if(w.mode==="hidden")if((u.mode&1)===0)u.memoizedState={baseLanes:0,cachePool:null,transitions:null},jn(uc,ds),ds|=g;else{if((g&1073741824)===0)return l=T!==null?T.baseLanes|g:g,u.lanes=u.childLanes=1073741824,u.memoizedState={baseLanes:l,cachePool:null,transitions:null},u.updateQueue=null,jn(uc,ds),ds|=l,null;u.memoizedState={baseLanes:0,cachePool:null,transitions:null},w=T!==null?T.baseLanes:g,jn(uc,ds),ds|=w}else T!==null?(w=T.baseLanes|g,u.memoizedState=null):w=g,jn(uc,ds),ds|=w;return Pr(l,u,C,g),u.child}function Ck(l,u){var g=u.ref;(l===null&&g!==null||l!==null&&l.ref!==g)&&(u.flags|=512,u.flags|=2097152)}function Zx(l,u,g,w,C){var T=Wr(g)?Io:Nr.current;return T=ec(u,T),ic(u,C),g=qx(l,u,g,w,T,C),w=Ux(),l!==null&&!Vr?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~C,si(l,u,C)):(Mn&&w&&Cx(u),u.flags|=1,Pr(l,u,g,C),u.child)}function _k(l,u,g,w,C){if(Wr(g)){var T=!0;Tp(u)}else T=!1;if(ic(u,C),u.stateNode===null)Yp(l,u),hk(u,g,w),Yx(u,g,w,C),w=!0;else if(l===null){var $=u.stateNode,ee=u.memoizedProps;$.props=ee;var ce=$.context,je=g.contextType;typeof je=="object"&&je!==null?je=_s(je):(je=Wr(g)?Io:Nr.current,je=ec(u,je));var Be=g.getDerivedStateFromProps,We=typeof Be=="function"||typeof $.getSnapshotBeforeUpdate=="function";We||typeof $.UNSAFE_componentWillReceiveProps!="function"&&typeof $.componentWillReceiveProps!="function"||(ee!==w||ce!==je)&&mk(u,$,w,je),Gi=!1;var ze=u.memoizedState;$.state=ze,zp(u,w,$,C),ce=u.memoizedState,ee!==w||ze!==ce||Ur.current||Gi?(typeof Be=="function"&&(Gx(u,g,Be,w),ce=u.memoizedState),(ee=Gi||pk(u,g,ee,w,ze,ce,je))?(We||typeof $.UNSAFE_componentWillMount!="function"&&typeof $.componentWillMount!="function"||(typeof $.componentWillMount=="function"&&$.componentWillMount(),typeof $.UNSAFE_componentWillMount=="function"&&$.UNSAFE_componentWillMount()),typeof $.componentDidMount=="function"&&(u.flags|=4194308)):(typeof $.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=w,u.memoizedState=ce),$.props=w,$.state=ce,$.context=je,w=ee):(typeof $.componentDidMount=="function"&&(u.flags|=4194308),w=!1)}else{$=u.stateNode,qA(l,u),ee=u.memoizedProps,je=u.type===u.elementType?ee:ta(u.type,ee),$.props=je,We=u.pendingProps,ze=$.context,ce=g.contextType,typeof ce=="object"&&ce!==null?ce=_s(ce):(ce=Wr(g)?Io:Nr.current,ce=ec(u,ce));var pt=g.getDerivedStateFromProps;(Be=typeof pt=="function"||typeof $.getSnapshotBeforeUpdate=="function")||typeof $.UNSAFE_componentWillReceiveProps!="function"&&typeof $.componentWillReceiveProps!="function"||(ee!==We||ze!==ce)&&mk(u,$,w,ce),Gi=!1,ze=u.memoizedState,$.state=ze,zp(u,w,$,C);var bt=u.memoizedState;ee!==We||ze!==bt||Ur.current||Gi?(typeof pt=="function"&&(Gx(u,g,pt,w),bt=u.memoizedState),(je=Gi||pk(u,g,je,w,ze,bt,ce)||!1)?(Be||typeof $.UNSAFE_componentWillUpdate!="function"&&typeof $.componentWillUpdate!="function"||(typeof $.componentWillUpdate=="function"&&$.componentWillUpdate(w,bt,ce),typeof $.UNSAFE_componentWillUpdate=="function"&&$.UNSAFE_componentWillUpdate(w,bt,ce)),typeof $.componentDidUpdate=="function"&&(u.flags|=4),typeof $.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof $.componentDidUpdate!="function"||ee===l.memoizedProps&&ze===l.memoizedState||(u.flags|=4),typeof $.getSnapshotBeforeUpdate!="function"||ee===l.memoizedProps&&ze===l.memoizedState||(u.flags|=1024),u.memoizedProps=w,u.memoizedState=bt),$.props=w,$.state=bt,$.context=ce,w=je):(typeof $.componentDidUpdate!="function"||ee===l.memoizedProps&&ze===l.memoizedState||(u.flags|=4),typeof $.getSnapshotBeforeUpdate!="function"||ee===l.memoizedProps&&ze===l.memoizedState||(u.flags|=1024),w=!1)}return Jx(l,u,g,w,T,C)}function Jx(l,u,g,w,C,T){Ck(l,u);var $=(u.flags&128)!==0;if(!w&&!$)return C&&TA(u,g,!1),si(l,u,T);w=u.stateNode,zU.current=u;var ee=$&&typeof g.getDerivedStateFromError!="function"?null:w.render();return u.flags|=1,l!==null&&$?(u.child=sc(u,l.child,null,T),u.child=sc(u,null,ee,T)):Pr(l,u,ee,T),u.memoizedState=w.state,C&&TA(u,g,!0),u.child}function Ak(l){var u=l.stateNode;u.pendingContext?EA(l,u.pendingContext,u.pendingContext!==u.context):u.context&&EA(l,u.context,!1),$x(l,u.containerInfo)}function kk(l,u,g,w,C){return rc(),Ex(C),u.flags|=256,Pr(l,u,g,w),u.child}var ey={dehydrated:null,treeContext:null,retryLane:0};function ty(l){return{baseLanes:l,cachePool:null,transitions:null}}function Ek(l,u,g){var w=u.pendingProps,C=Ln.current,T=!1,$=(u.flags&128)!==0,ee;if((ee=$)||(ee=l!==null&&l.memoizedState===null?!1:(C&2)!==0),ee?(T=!0,u.flags&=-129):(l===null||l.memoizedState!==null)&&(C|=1),jn(Ln,C&1),l===null)return kx(u),l=u.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?((u.mode&1)===0?u.lanes=1:l.data==="$!"?u.lanes=8:u.lanes=1073741824,null):($=w.children,l=w.fallback,T?(w=u.mode,T=u.child,$={mode:"hidden",children:$},(w&1)===0&&T!==null?(T.childLanes=0,T.pendingProps=$):T=oh($,w,0,null),l=Vo(l,w,g,null),T.return=u,l.return=u,T.sibling=l,u.child=T,u.child.memoizedState=ty(g),u.memoizedState=ey,l):ny(u,$));if(C=l.memoizedState,C!==null&&(ee=C.dehydrated,ee!==null))return BU(l,u,$,w,ee,C,g);if(T){T=w.fallback,$=u.mode,C=l.child,ee=C.sibling;var ce={mode:"hidden",children:w.children};return($&1)===0&&u.child!==C?(w=u.child,w.childLanes=0,w.pendingProps=ce,u.deletions=null):(w=to(C,ce),w.subtreeFlags=C.subtreeFlags&14680064),ee!==null?T=to(ee,T):(T=Vo(T,$,g,null),T.flags|=2),T.return=u,w.return=u,w.sibling=T,u.child=w,w=T,T=u.child,$=l.child.memoizedState,$=$===null?ty(g):{baseLanes:$.baseLanes|g,cachePool:null,transitions:$.transitions},T.memoizedState=$,T.childLanes=l.childLanes&~g,u.memoizedState=ey,w}return T=l.child,l=T.sibling,w=to(T,{mode:"visible",children:w.children}),(u.mode&1)===0&&(w.lanes=g),w.return=u,w.sibling=null,l!==null&&(g=u.deletions,g===null?(u.deletions=[l],u.flags|=16):g.push(l)),u.child=w,u.memoizedState=null,w}function ny(l,u){return u=oh({mode:"visible",children:u},l.mode,0,null),u.return=l,l.child=u}function Gp(l,u,g,w){return w!==null&&Ex(w),sc(u,l.child,null,g),l=ny(u,u.pendingProps.children),l.flags|=2,u.memoizedState=null,l}function BU(l,u,g,w,C,T,$){if(g)return u.flags&256?(u.flags&=-257,w=Xx(Error(n(422))),Gp(l,u,$,w)):u.memoizedState!==null?(u.child=l.child,u.flags|=128,null):(T=w.fallback,C=u.mode,w=oh({mode:"visible",children:w.children},C,0,null),T=Vo(T,C,$,null),T.flags|=2,w.return=u,T.return=u,w.sibling=T,u.child=w,(u.mode&1)!==0&&sc(u,l.child,null,$),u.child.memoizedState=ty($),u.memoizedState=ey,T);if((u.mode&1)===0)return Gp(l,u,$,null);if(C.data==="$!"){if(w=C.nextSibling&&C.nextSibling.dataset,w)var ee=w.dgst;return w=ee,T=Error(n(419)),w=Xx(T,w,void 0),Gp(l,u,$,w)}if(ee=($&l.childLanes)!==0,Vr||ee){if(w=dr,w!==null){switch($&-$){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|$))!==0?0:C,C!==0&&C!==T.retryLane&&(T.retryLane=C,ni(l,C),sa(w,l,C,-1))}return xy(),w=Xx(Error(n(421))),Gp(l,u,$,w)}return C.data==="$?"?(u.flags|=128,u.child=l.child,u=e7.bind(null,l),C._reactRetry=u,null):(l=T.treeContext,us=Wi(C.nextSibling),cs=u,Mn=!0,ea=null,l!==null&&(Ns[Cs++]=ei,Ns[Cs++]=ti,Ns[Cs++]=$o,ei=l.id,ti=l.overflow,$o=u),u=ny(u,w.children),u.flags|=4096,u)}function Pk(l,u,g){l.lanes|=u;var w=l.alternate;w!==null&&(w.lanes|=u),Ox(l.return,u,g)}function ry(l,u,g,w,C){var T=l.memoizedState;T===null?l.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:w,tail:g,tailMode:C}:(T.isBackwards=u,T.rendering=null,T.renderingStartTime=0,T.last=w,T.tail=g,T.tailMode=C)}function Tk(l,u,g){var w=u.pendingProps,C=w.revealOrder,T=w.tail;if(Pr(l,u,w.children,g),w=Ln.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&&Pk(l,g,u);else if(l.tag===19)Pk(l,g,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(jn(Ln,w),(u.mode&1)===0)u.memoizedState=null;else switch(C){case"forwards":for(g=u.child,C=null;g!==null;)l=g.alternate,l!==null&&Bp(l)===null&&(C=g),g=g.sibling;g=C,g===null?(C=u.child,u.child=null):(C=g.sibling,g.sibling=null),ry(u,!1,C,g,T);break;case"backwards":for(g=null,C=u.child,u.child=null;C!==null;){if(l=C.alternate,l!==null&&Bp(l)===null){u.child=C;break}l=C.sibling,C.sibling=g,g=C,C=l}ry(u,!0,g,null,T);break;case"together":ry(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function Yp(l,u){(u.mode&1)===0&&l!==null&&(l.alternate=null,u.alternate=null,u.flags|=2)}function si(l,u,g){if(l!==null&&(u.dependencies=l.dependencies),Bo|=u.lanes,(g&u.childLanes)===0)return null;if(l!==null&&u.child!==l.child)throw Error(n(153));if(u.child!==null){for(l=u.child,g=to(l,l.pendingProps),u.child=g,g.return=u;l.sibling!==null;)l=l.sibling,g=g.sibling=to(l,l.pendingProps),g.return=u;g.sibling=null}return u.child}function qU(l,u,g){switch(u.tag){case 3:Ak(u),rc();break;case 5:VA(u);break;case 1:Wr(u.type)&&Tp(u);break;case 4:$x(u,u.stateNode.containerInfo);break;case 10:var w=u.type._context,C=u.memoizedProps.value;jn(Dp,w._currentValue),w._currentValue=C;break;case 13:if(w=u.memoizedState,w!==null)return w.dehydrated!==null?(jn(Ln,Ln.current&1),u.flags|=128,null):(g&u.child.childLanes)!==0?Ek(l,u,g):(jn(Ln,Ln.current&1),l=si(l,u,g),l!==null?l.sibling:null);jn(Ln,Ln.current&1);break;case 19:if(w=(g&u.childLanes)!==0,(l.flags&128)!==0){if(w)return Tk(l,u,g);u.flags|=128}if(C=u.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),jn(Ln,Ln.current),w)break;return null;case 22:case 23:return u.lanes=0,Nk(l,u,g)}return si(l,u,g)}var Rk,sy,Ok,Mk;Rk=function(l,u){for(var g=u.child;g!==null;){if(g.tag===5||g.tag===6)l.appendChild(g.stateNode);else if(g.tag!==4&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===u)break;for(;g.sibling===null;){if(g.return===null||g.return===u)return;g=g.return}g.sibling.return=g.return,g=g.sibling}},sy=function(){},Ok=function(l,u,g,w){var C=l.memoizedProps;if(C!==w){l=u.stateNode,Fo(Ea.current);var T=null;switch(g){case"input":C=we(l,C),w=we(l,w),T=[];break;case"select":C=Q({},C,{value:void 0}),w=Q({},w,{value:void 0}),T=[];break;case"textarea":C=Je(l,C),w=Je(l,w),T=[];break;default:typeof C.onClick!="function"&&typeof w.onClick=="function"&&(l.onclick=kp)}Ke(g,w);var $;g=null;for(je in C)if(!w.hasOwnProperty(je)&&C.hasOwnProperty(je)&&C[je]!=null)if(je==="style"){var ee=C[je];for($ in ee)ee.hasOwnProperty($)&&(g||(g={}),g[$]="")}else je!=="dangerouslySetInnerHTML"&&je!=="children"&&je!=="suppressContentEditableWarning"&&je!=="suppressHydrationWarning"&&je!=="autoFocus"&&(a.hasOwnProperty(je)?T||(T=[]):(T=T||[]).push(je,null));for(je in w){var ce=w[je];if(ee=C?.[je],w.hasOwnProperty(je)&&ce!==ee&&(ce!=null||ee!=null))if(je==="style")if(ee){for($ in ee)!ee.hasOwnProperty($)||ce&&ce.hasOwnProperty($)||(g||(g={}),g[$]="");for($ in ce)ce.hasOwnProperty($)&&ee[$]!==ce[$]&&(g||(g={}),g[$]=ce[$])}else g||(T||(T=[]),T.push(je,g)),g=ce;else je==="dangerouslySetInnerHTML"?(ce=ce?ce.__html:void 0,ee=ee?ee.__html:void 0,ce!=null&&ee!==ce&&(T=T||[]).push(je,ce)):je==="children"?typeof ce!="string"&&typeof ce!="number"||(T=T||[]).push(je,""+ce):je!=="suppressContentEditableWarning"&&je!=="suppressHydrationWarning"&&(a.hasOwnProperty(je)?(ce!=null&&je==="onScroll"&&An("scroll",l),T||ee===ce||(T=[])):(T=T||[]).push(je,ce))}g&&(T=T||[]).push("style",g);var je=T;(u.updateQueue=je)&&(u.flags|=4)}},Mk=function(l,u,g,w){g!==w&&(u.flags|=4)};function dd(l,u){if(!Mn)switch(l.tailMode){case"hidden":u=l.tail;for(var g=null;u!==null;)u.alternate!==null&&(g=u),u=u.sibling;g===null?l.tail=null:g.sibling=null;break;case"collapsed":g=l.tail;for(var w=null;g!==null;)g.alternate!==null&&(w=g),g=g.sibling;w===null?u||l.tail===null?l.tail=null:l.tail.sibling=null:w.sibling=null}}function _r(l){var u=l.alternate!==null&&l.alternate.child===l.child,g=0,w=0;if(u)for(var C=l.child;C!==null;)g|=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;)g|=C.lanes|C.childLanes,w|=C.subtreeFlags,w|=C.flags,C.return=l,C=C.sibling;return l.subtreeFlags|=w,l.childLanes=g,u}function UU(l,u,g){var w=u.pendingProps;switch(_x(u),u.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _r(u),null;case 1:return Wr(u.type)&&Pp(),_r(u),null;case 3:return w=u.stateNode,oc(),kn(Ur),kn(Nr),Fx(),w.pendingContext&&(w.context=w.pendingContext,w.pendingContext=null),(l===null||l.child===null)&&(Ip(u)?u.flags|=4:l===null||l.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,ea!==null&&(my(ea),ea=null))),sy(l,u),_r(u),null;case 5:Dx(u);var C=Fo(id.current);if(g=u.type,l!==null&&u.stateNode!=null)Ok(l,u,g,w,C),l.ref!==u.ref&&(u.flags|=512,u.flags|=2097152);else{if(!w){if(u.stateNode===null)throw Error(n(166));return _r(u),null}if(l=Fo(Ea.current),Ip(u)){w=u.stateNode,g=u.type;var T=u.memoizedProps;switch(w[ka]=u,w[td]=T,l=(u.mode&1)!==0,g){case"dialog":An("cancel",w),An("close",w);break;case"iframe":case"object":case"embed":An("load",w);break;case"video":case"audio":for(C=0;C<Zu.length;C++)An(Zu[C],w);break;case"source":An("error",w);break;case"img":case"image":case"link":An("error",w),An("load",w);break;case"details":An("toggle",w);break;case"input":ot(w,T),An("invalid",w);break;case"select":w._wrapperState={wasMultiple:!!T.multiple},An("invalid",w);break;case"textarea":dt(w,T),An("invalid",w)}Ke(g,T),C=null;for(var $ in T)if(T.hasOwnProperty($)){var ee=T[$];$==="children"?typeof ee=="string"?w.textContent!==ee&&(T.suppressHydrationWarning!==!0&&Ap(w.textContent,ee,l),C=["children",ee]):typeof ee=="number"&&w.textContent!==""+ee&&(T.suppressHydrationWarning!==!0&&Ap(w.textContent,ee,l),C=["children",""+ee]):a.hasOwnProperty($)&&ee!=null&&$==="onScroll"&&An("scroll",w)}switch(g){case"input":Oe(w),At(w,T,!0);break;case"textarea":Oe(w),Xt(w);break;case"select":case"option":break;default:typeof T.onClick=="function"&&(w.onclick=kp)}w=C,u.updateQueue=w,w!==null&&(u.flags|=4)}else{$=C.nodeType===9?C:C.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=kt(g)),l==="http://www.w3.org/1999/xhtml"?g==="script"?(l=$.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild)):typeof w.is=="string"?l=$.createElement(g,{is:w.is}):(l=$.createElement(g),g==="select"&&($=l,w.multiple?$.multiple=!0:w.size&&($.size=w.size))):l=$.createElementNS(l,g),l[ka]=u,l[td]=w,Rk(l,u,!1,!1),u.stateNode=l;e:{switch($=De(g,w),g){case"dialog":An("cancel",l),An("close",l),C=w;break;case"iframe":case"object":case"embed":An("load",l),C=w;break;case"video":case"audio":for(C=0;C<Zu.length;C++)An(Zu[C],l);C=w;break;case"source":An("error",l),C=w;break;case"img":case"image":case"link":An("error",l),An("load",l),C=w;break;case"details":An("toggle",l),C=w;break;case"input":ot(l,w),C=we(l,w),An("invalid",l);break;case"option":C=w;break;case"select":l._wrapperState={wasMultiple:!!w.multiple},C=Q({},w,{value:void 0}),An("invalid",l);break;case"textarea":dt(l,w),C=Je(l,w),An("invalid",l);break;default:C=w}Ke(g,C),ee=C;for(T in ee)if(ee.hasOwnProperty(T)){var ce=ee[T];T==="style"?Bt(l,ce):T==="dangerouslySetInnerHTML"?(ce=ce?ce.__html:void 0,ce!=null&&zt(l,ce)):T==="children"?typeof ce=="string"?(g!=="textarea"||ce!=="")&&_e(l,ce):typeof ce=="number"&&_e(l,""+ce):T!=="suppressContentEditableWarning"&&T!=="suppressHydrationWarning"&&T!=="autoFocus"&&(a.hasOwnProperty(T)?ce!=null&&T==="onScroll"&&An("scroll",l):ce!=null&&_(l,T,ce,$))}switch(g){case"input":Oe(l),At(l,w,!1);break;case"textarea":Oe(l),Xt(l);break;case"option":w.value!=null&&l.setAttribute("value",""+me(w.value));break;case"select":l.multiple=!!w.multiple,T=w.value,T!=null?Ae(l,!!w.multiple,T,!1):w.defaultValue!=null&&Ae(l,!!w.multiple,w.defaultValue,!0);break;default:typeof C.onClick=="function"&&(l.onclick=kp)}switch(g){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 _r(u),null;case 6:if(l&&u.stateNode!=null)Mk(l,u,l.memoizedProps,w);else{if(typeof w!="string"&&u.stateNode===null)throw Error(n(166));if(g=Fo(id.current),Fo(Ea.current),Ip(u)){if(w=u.stateNode,g=u.memoizedProps,w[ka]=u,(T=w.nodeValue!==g)&&(l=cs,l!==null))switch(l.tag){case 3:Ap(w.nodeValue,g,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&Ap(w.nodeValue,g,(l.mode&1)!==0)}T&&(u.flags|=4)}else w=(g.nodeType===9?g:g.ownerDocument).createTextNode(w),w[ka]=u,u.stateNode=w}return _r(u),null;case 13:if(kn(Ln),w=u.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(Mn&&us!==null&&(u.mode&1)!==0&&(u.flags&128)===0)DA(),rc(),u.flags|=98560,T=!1;else if(T=Ip(u),w!==null&&w.dehydrated!==null){if(l===null){if(!T)throw Error(n(318));if(T=u.memoizedState,T=T!==null?T.dehydrated:null,!T)throw Error(n(317));T[ka]=u}else rc(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;_r(u),T=!1}else ea!==null&&(my(ea),ea=null),T=!0;if(!T)return u.flags&65536?u:null}return(u.flags&128)!==0?(u.lanes=g,u):(w=w!==null,w!==(l!==null&&l.memoizedState!==null)&&w&&(u.child.flags|=8192,(u.mode&1)!==0&&(l===null||(Ln.current&1)!==0?er===0&&(er=3):xy())),u.updateQueue!==null&&(u.flags|=4),_r(u),null);case 4:return oc(),sy(l,u),l===null&&Ju(u.stateNode.containerInfo),_r(u),null;case 10:return Rx(u.type._context),_r(u),null;case 17:return Wr(u.type)&&Pp(),_r(u),null;case 19:if(kn(Ln),T=u.memoizedState,T===null)return _r(u),null;if(w=(u.flags&128)!==0,$=T.rendering,$===null)if(w)dd(T,!1);else{if(er!==0||l!==null&&(l.flags&128)!==0)for(l=u.child;l!==null;){if($=Bp(l),$!==null){for(u.flags|=128,dd(T,!1),w=$.updateQueue,w!==null&&(u.updateQueue=w,u.flags|=4),u.subtreeFlags=0,w=g,g=u.child;g!==null;)T=g,l=w,T.flags&=14680066,$=T.alternate,$===null?(T.childLanes=0,T.lanes=l,T.child=null,T.subtreeFlags=0,T.memoizedProps=null,T.memoizedState=null,T.updateQueue=null,T.dependencies=null,T.stateNode=null):(T.childLanes=$.childLanes,T.lanes=$.lanes,T.child=$.child,T.subtreeFlags=0,T.deletions=null,T.memoizedProps=$.memoizedProps,T.memoizedState=$.memoizedState,T.updateQueue=$.updateQueue,T.type=$.type,l=$.dependencies,T.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),g=g.sibling;return jn(Ln,Ln.current&1|2),u.child}l=l.sibling}T.tail!==null&&le()>dc&&(u.flags|=128,w=!0,dd(T,!1),u.lanes=4194304)}else{if(!w)if(l=Bp($),l!==null){if(u.flags|=128,w=!0,g=l.updateQueue,g!==null&&(u.updateQueue=g,u.flags|=4),dd(T,!0),T.tail===null&&T.tailMode==="hidden"&&!$.alternate&&!Mn)return _r(u),null}else 2*le()-T.renderingStartTime>dc&&g!==1073741824&&(u.flags|=128,w=!0,dd(T,!1),u.lanes=4194304);T.isBackwards?($.sibling=u.child,u.child=$):(g=T.last,g!==null?g.sibling=$:u.child=$,T.last=$)}return T.tail!==null?(u=T.tail,T.rendering=u,T.tail=u.sibling,T.renderingStartTime=le(),u.sibling=null,g=Ln.current,jn(Ln,w?g&1|2:g&1),u):(_r(u),null);case 22:case 23:return vy(),w=u.memoizedState!==null,l!==null&&l.memoizedState!==null!==w&&(u.flags|=8192),w&&(u.mode&1)!==0?(ds&1073741824)!==0&&(_r(u),u.subtreeFlags&6&&(u.flags|=8192)):_r(u),null;case 24:return null;case 25:return null}throw Error(n(156,u.tag))}function WU(l,u){switch(_x(u),u.tag){case 1:return Wr(u.type)&&Pp(),l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 3:return oc(),kn(Ur),kn(Nr),Fx(),l=u.flags,(l&65536)!==0&&(l&128)===0?(u.flags=l&-65537|128,u):null;case 5:return Dx(u),null;case 13:if(kn(Ln),l=u.memoizedState,l!==null&&l.dehydrated!==null){if(u.alternate===null)throw Error(n(340));rc()}return l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 19:return kn(Ln),null;case 4:return oc(),null;case 10:return Rx(u.type._context),null;case 22:case 23:return vy(),null;case 24:return null;default:return null}}var Xp=!1,Ar=!1,VU=typeof WeakSet=="function"?WeakSet:Set,xt=null;function cc(l,u){var g=l.ref;if(g!==null)if(typeof g=="function")try{g(null)}catch(w){Un(l,u,w)}else g.current=null}function ay(l,u,g){try{g()}catch(w){Un(l,u,w)}}var Ik=!1;function HU(l,u){if(vx=gp,l=pA(),cx(l)){if("selectionStart"in l)var g={start:l.selectionStart,end:l.selectionEnd};else e:{g=(g=l.ownerDocument)&&g.defaultView||window;var w=g.getSelection&&g.getSelection();if(w&&w.rangeCount!==0){g=w.anchorNode;var C=w.anchorOffset,T=w.focusNode;w=w.focusOffset;try{g.nodeType,T.nodeType}catch{g=null;break e}var $=0,ee=-1,ce=-1,je=0,Be=0,We=l,ze=null;t:for(;;){for(var pt;We!==g||C!==0&&We.nodeType!==3||(ee=$+C),We!==T||w!==0&&We.nodeType!==3||(ce=$+w),We.nodeType===3&&($+=We.nodeValue.length),(pt=We.firstChild)!==null;)ze=We,We=pt;for(;;){if(We===l)break t;if(ze===g&&++je===C&&(ee=$),ze===T&&++Be===w&&(ce=$),(pt=We.nextSibling)!==null)break;We=ze,ze=We.parentNode}We=pt}g=ee===-1||ce===-1?null:{start:ee,end:ce}}else g=null}g=g||{start:0,end:0}}else g=null;for(xx={focusedElem:l,selectionRange:g},gp=!1,xt=u;xt!==null;)if(u=xt,l=u.child,(u.subtreeFlags&1028)!==0&&l!==null)l.return=u,xt=l;else for(;xt!==null;){u=xt;try{var bt=u.alternate;if((u.flags&1024)!==0)switch(u.tag){case 0:case 11:case 15:break;case 1:if(bt!==null){var wt=bt.memoizedProps,Kn=bt.memoizedState,ye=u.stateNode,pe=ye.getSnapshotBeforeUpdate(u.elementType===u.type?wt:ta(u.type,wt),Kn);ye.__reactInternalSnapshotBeforeUpdate=pe}break;case 3:var be=u.stateNode.containerInfo;be.nodeType===1?be.textContent="":be.nodeType===9&&be.documentElement&&be.removeChild(be.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Ye){Un(u,u.return,Ye)}if(l=u.sibling,l!==null){l.return=u.return,xt=l;break}xt=u.return}return bt=Ik,Ik=!1,bt}function fd(l,u,g){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 T=C.destroy;C.destroy=void 0,T!==void 0&&ay(u,g,T)}C=C.next}while(C!==w)}}function Qp(l,u){if(u=u.updateQueue,u=u!==null?u.lastEffect:null,u!==null){var g=u=u.next;do{if((g.tag&l)===l){var w=g.create;g.destroy=w()}g=g.next}while(g!==u)}}function iy(l){var u=l.ref;if(u!==null){var g=l.stateNode;l.tag,l=g,typeof u=="function"?u(l):u.current=l}}function $k(l){var u=l.alternate;u!==null&&(l.alternate=null,$k(u)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(u=l.stateNode,u!==null&&(delete u[ka],delete u[td],delete u[jx],delete u[kU],delete u[EU])),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 Dk(l){return l.tag===5||l.tag===3||l.tag===4}function Lk(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||Dk(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 oy(l,u,g){var w=l.tag;if(w===5||w===6)l=l.stateNode,u?g.nodeType===8?g.parentNode.insertBefore(l,u):g.insertBefore(l,u):(g.nodeType===8?(u=g.parentNode,u.insertBefore(l,g)):(u=g,u.appendChild(l)),g=g._reactRootContainer,g!=null||u.onclick!==null||(u.onclick=kp));else if(w!==4&&(l=l.child,l!==null))for(oy(l,u,g),l=l.sibling;l!==null;)oy(l,u,g),l=l.sibling}function ly(l,u,g){var w=l.tag;if(w===5||w===6)l=l.stateNode,u?g.insertBefore(l,u):g.appendChild(l);else if(w!==4&&(l=l.child,l!==null))for(ly(l,u,g),l=l.sibling;l!==null;)ly(l,u,g),l=l.sibling}var xr=null,na=!1;function Xi(l,u,g){for(g=g.child;g!==null;)Fk(l,u,g),g=g.sibling}function Fk(l,u,g){if(gr&&typeof gr.onCommitFiberUnmount=="function")try{gr.onCommitFiberUnmount(os,g)}catch{}switch(g.tag){case 5:Ar||cc(g,u);case 6:var w=xr,C=na;xr=null,Xi(l,u,g),xr=w,na=C,xr!==null&&(na?(l=xr,g=g.stateNode,l.nodeType===8?l.parentNode.removeChild(g):l.removeChild(g)):xr.removeChild(g.stateNode));break;case 18:xr!==null&&(na?(l=xr,g=g.stateNode,l.nodeType===8?wx(l.parentNode,g):l.nodeType===1&&wx(l,g),Wu(l)):wx(xr,g.stateNode));break;case 4:w=xr,C=na,xr=g.stateNode.containerInfo,na=!0,Xi(l,u,g),xr=w,na=C;break;case 0:case 11:case 14:case 15:if(!Ar&&(w=g.updateQueue,w!==null&&(w=w.lastEffect,w!==null))){C=w=w.next;do{var T=C,$=T.destroy;T=T.tag,$!==void 0&&((T&2)!==0||(T&4)!==0)&&ay(g,u,$),C=C.next}while(C!==w)}Xi(l,u,g);break;case 1:if(!Ar&&(cc(g,u),w=g.stateNode,typeof w.componentWillUnmount=="function"))try{w.props=g.memoizedProps,w.state=g.memoizedState,w.componentWillUnmount()}catch(ee){Un(g,u,ee)}Xi(l,u,g);break;case 21:Xi(l,u,g);break;case 22:g.mode&1?(Ar=(w=Ar)||g.memoizedState!==null,Xi(l,u,g),Ar=w):Xi(l,u,g);break;default:Xi(l,u,g)}}function zk(l){var u=l.updateQueue;if(u!==null){l.updateQueue=null;var g=l.stateNode;g===null&&(g=l.stateNode=new VU),u.forEach(function(w){var C=t7.bind(null,l,w);g.has(w)||(g.add(w),w.then(C,C))})}}function ra(l,u){var g=u.deletions;if(g!==null)for(var w=0;w<g.length;w++){var C=g[w];try{var T=l,$=u,ee=$;e:for(;ee!==null;){switch(ee.tag){case 5:xr=ee.stateNode,na=!1;break e;case 3:xr=ee.stateNode.containerInfo,na=!0;break e;case 4:xr=ee.stateNode.containerInfo,na=!0;break e}ee=ee.return}if(xr===null)throw Error(n(160));Fk(T,$,C),xr=null,na=!1;var ce=C.alternate;ce!==null&&(ce.return=null),C.return=null}catch(je){Un(C,u,je)}}if(u.subtreeFlags&12854)for(u=u.child;u!==null;)Bk(u,l),u=u.sibling}function Bk(l,u){var g=l.alternate,w=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(ra(u,l),Ta(l),w&4){try{fd(3,l,l.return),Qp(3,l)}catch(wt){Un(l,l.return,wt)}try{fd(5,l,l.return)}catch(wt){Un(l,l.return,wt)}}break;case 1:ra(u,l),Ta(l),w&512&&g!==null&&cc(g,g.return);break;case 5:if(ra(u,l),Ta(l),w&512&&g!==null&&cc(g,g.return),l.flags&32){var C=l.stateNode;try{_e(C,"")}catch(wt){Un(l,l.return,wt)}}if(w&4&&(C=l.stateNode,C!=null)){var T=l.memoizedProps,$=g!==null?g.memoizedProps:T,ee=l.type,ce=l.updateQueue;if(l.updateQueue=null,ce!==null)try{ee==="input"&&T.type==="radio"&&T.name!=null&<(C,T),De(ee,$);var je=De(ee,T);for($=0;$<ce.length;$+=2){var Be=ce[$],We=ce[$+1];Be==="style"?Bt(C,We):Be==="dangerouslySetInnerHTML"?zt(C,We):Be==="children"?_e(C,We):_(C,Be,We,je)}switch(ee){case"input":ut(C,T);break;case"textarea":Pt(C,T);break;case"select":var ze=C._wrapperState.wasMultiple;C._wrapperState.wasMultiple=!!T.multiple;var pt=T.value;pt!=null?Ae(C,!!T.multiple,pt,!1):ze!==!!T.multiple&&(T.defaultValue!=null?Ae(C,!!T.multiple,T.defaultValue,!0):Ae(C,!!T.multiple,T.multiple?[]:"",!1))}C[td]=T}catch(wt){Un(l,l.return,wt)}}break;case 6:if(ra(u,l),Ta(l),w&4){if(l.stateNode===null)throw Error(n(162));C=l.stateNode,T=l.memoizedProps;try{C.nodeValue=T}catch(wt){Un(l,l.return,wt)}}break;case 3:if(ra(u,l),Ta(l),w&4&&g!==null&&g.memoizedState.isDehydrated)try{Wu(u.containerInfo)}catch(wt){Un(l,l.return,wt)}break;case 4:ra(u,l),Ta(l);break;case 13:ra(u,l),Ta(l),C=l.child,C.flags&8192&&(T=C.memoizedState!==null,C.stateNode.isHidden=T,!T||C.alternate!==null&&C.alternate.memoizedState!==null||(dy=le())),w&4&&zk(l);break;case 22:if(Be=g!==null&&g.memoizedState!==null,l.mode&1?(Ar=(je=Ar)||Be,ra(u,l),Ar=je):ra(u,l),Ta(l),w&8192){if(je=l.memoizedState!==null,(l.stateNode.isHidden=je)&&!Be&&(l.mode&1)!==0)for(xt=l,Be=l.child;Be!==null;){for(We=xt=Be;xt!==null;){switch(ze=xt,pt=ze.child,ze.tag){case 0:case 11:case 14:case 15:fd(4,ze,ze.return);break;case 1:cc(ze,ze.return);var bt=ze.stateNode;if(typeof bt.componentWillUnmount=="function"){w=ze,g=ze.return;try{u=w,bt.props=u.memoizedProps,bt.state=u.memoizedState,bt.componentWillUnmount()}catch(wt){Un(w,g,wt)}}break;case 5:cc(ze,ze.return);break;case 22:if(ze.memoizedState!==null){Wk(We);continue}}pt!==null?(pt.return=ze,xt=pt):Wk(We)}Be=Be.sibling}e:for(Be=null,We=l;;){if(We.tag===5){if(Be===null){Be=We;try{C=We.stateNode,je?(T=C.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none"):(ee=We.stateNode,ce=We.memoizedProps.style,$=ce!=null&&ce.hasOwnProperty("display")?ce.display:null,ee.style.display=_t("display",$))}catch(wt){Un(l,l.return,wt)}}}else if(We.tag===6){if(Be===null)try{We.stateNode.nodeValue=je?"":We.memoizedProps}catch(wt){Un(l,l.return,wt)}}else if((We.tag!==22&&We.tag!==23||We.memoizedState===null||We===l)&&We.child!==null){We.child.return=We,We=We.child;continue}if(We===l)break e;for(;We.sibling===null;){if(We.return===null||We.return===l)break e;Be===We&&(Be=null),We=We.return}Be===We&&(Be=null),We.sibling.return=We.return,We=We.sibling}}break;case 19:ra(u,l),Ta(l),w&4&&zk(l);break;case 21:break;default:ra(u,l),Ta(l)}}function Ta(l){var u=l.flags;if(u&2){try{e:{for(var g=l.return;g!==null;){if(Dk(g)){var w=g;break e}g=g.return}throw Error(n(160))}switch(w.tag){case 5:var C=w.stateNode;w.flags&32&&(_e(C,""),w.flags&=-33);var T=Lk(l);ly(l,T,C);break;case 3:case 4:var $=w.stateNode.containerInfo,ee=Lk(l);oy(l,ee,$);break;default:throw Error(n(161))}}catch(ce){Un(l,l.return,ce)}l.flags&=-3}u&4096&&(l.flags&=-4097)}function KU(l,u,g){xt=l,qk(l)}function qk(l,u,g){for(var w=(l.mode&1)!==0;xt!==null;){var C=xt,T=C.child;if(C.tag===22&&w){var $=C.memoizedState!==null||Xp;if(!$){var ee=C.alternate,ce=ee!==null&&ee.memoizedState!==null||Ar;ee=Xp;var je=Ar;if(Xp=$,(Ar=ce)&&!je)for(xt=C;xt!==null;)$=xt,ce=$.child,$.tag===22&&$.memoizedState!==null?Vk(C):ce!==null?(ce.return=$,xt=ce):Vk(C);for(;T!==null;)xt=T,qk(T),T=T.sibling;xt=C,Xp=ee,Ar=je}Uk(l)}else(C.subtreeFlags&8772)!==0&&T!==null?(T.return=C,xt=T):Uk(l)}}function Uk(l){for(;xt!==null;){var u=xt;if((u.flags&8772)!==0){var g=u.alternate;try{if((u.flags&8772)!==0)switch(u.tag){case 0:case 11:case 15:Ar||Qp(5,u);break;case 1:var w=u.stateNode;if(u.flags&4&&!Ar)if(g===null)w.componentDidMount();else{var C=u.elementType===u.type?g.memoizedProps:ta(u.type,g.memoizedProps);w.componentDidUpdate(C,g.memoizedState,w.__reactInternalSnapshotBeforeUpdate)}var T=u.updateQueue;T!==null&&WA(u,T,w);break;case 3:var $=u.updateQueue;if($!==null){if(g=null,u.child!==null)switch(u.child.tag){case 5:g=u.child.stateNode;break;case 1:g=u.child.stateNode}WA(u,$,g)}break;case 5:var ee=u.stateNode;if(g===null&&u.flags&4){g=ee;var ce=u.memoizedProps;switch(u.type){case"button":case"input":case"select":case"textarea":ce.autoFocus&&g.focus();break;case"img":ce.src&&(g.src=ce.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(u.memoizedState===null){var je=u.alternate;if(je!==null){var Be=je.memoizedState;if(Be!==null){var We=Be.dehydrated;We!==null&&Wu(We)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Ar||u.flags&512&&iy(u)}catch(ze){Un(u,u.return,ze)}}if(u===l){xt=null;break}if(g=u.sibling,g!==null){g.return=u.return,xt=g;break}xt=u.return}}function Wk(l){for(;xt!==null;){var u=xt;if(u===l){xt=null;break}var g=u.sibling;if(g!==null){g.return=u.return,xt=g;break}xt=u.return}}function Vk(l){for(;xt!==null;){var u=xt;try{switch(u.tag){case 0:case 11:case 15:var g=u.return;try{Qp(4,u)}catch(ce){Un(u,g,ce)}break;case 1:var w=u.stateNode;if(typeof w.componentDidMount=="function"){var C=u.return;try{w.componentDidMount()}catch(ce){Un(u,C,ce)}}var T=u.return;try{iy(u)}catch(ce){Un(u,T,ce)}break;case 5:var $=u.return;try{iy(u)}catch(ce){Un(u,$,ce)}}}catch(ce){Un(u,u.return,ce)}if(u===l){xt=null;break}var ee=u.sibling;if(ee!==null){ee.return=u.return,xt=ee;break}xt=u.return}}var GU=Math.ceil,Zp=A.ReactCurrentDispatcher,cy=A.ReactCurrentOwner,ks=A.ReactCurrentBatchConfig,an=0,dr=null,Yn=null,yr=0,ds=0,uc=Vi(0),er=0,pd=null,Bo=0,Jp=0,uy=0,hd=null,Hr=null,dy=0,dc=1/0,ai=null,eh=!1,fy=null,Qi=null,th=!1,Zi=null,nh=0,md=0,py=null,rh=-1,sh=0;function Tr(){return(an&6)!==0?le():rh!==-1?rh:rh=le()}function Ji(l){return(l.mode&1)===0?1:(an&2)!==0&&yr!==0?yr&-yr:TU.transition!==null?(sh===0&&(sh=qr()),sh):(l=fn,l!==0||(l=window.event,l=l===void 0?16:K_(l.type)),l)}function sa(l,u,g,w){if(50<md)throw md=0,py=null,Error(n(185));Ss(l,g,w),((an&2)===0||l!==dr)&&(l===dr&&((an&2)===0&&(Jp|=g),er===4&&eo(l,yr)),Kr(l,w),g===1&&an===0&&(u.mode&1)===0&&(dc=le()+500,Rp&&Ki()))}function Kr(l,u){var g=l.callbackNode;xn(l,u);var w=sn(l,l===dr?yr:0);if(w===0)g!==null&&qn(g),l.callbackNode=null,l.callbackPriority=0;else if(u=w&-w,l.callbackPriority!==u){if(g!=null&&qn(g),u===1)l.tag===0?PU(Kk.bind(null,l)):RA(Kk.bind(null,l)),_U(function(){(an&6)===0&&Ki()}),g=null;else{switch(F_(w)){case 1:g=Wt;break;case 4:g=Dt;break;case 16:g=qt;break;case 536870912:g=lr;break;default:g=qt}g=tE(g,Hk.bind(null,l))}l.callbackPriority=u,l.callbackNode=g}}function Hk(l,u){if(rh=-1,sh=0,(an&6)!==0)throw Error(n(327));var g=l.callbackNode;if(fc()&&l.callbackNode!==g)return null;var w=sn(l,l===dr?yr:0);if(w===0)return null;if((w&30)!==0||(w&l.expiredLanes)!==0||u)u=ah(l,w);else{u=w;var C=an;an|=2;var T=Yk();(dr!==l||yr!==u)&&(ai=null,dc=le()+500,Uo(l,u));do try{QU();break}catch(ee){Gk(l,ee)}while(!0);Tx(),Zp.current=T,an=C,Yn!==null?u=0:(dr=null,yr=0,u=er)}if(u!==0){if(u===2&&(C=cr(l),C!==0&&(w=C,u=hy(l,C))),u===1)throw g=pd,Uo(l,0),eo(l,w),Kr(l,le()),g;if(u===6)eo(l,w);else{if(C=l.current.alternate,(w&30)===0&&!YU(C)&&(u=ah(l,w),u===2&&(T=cr(l),T!==0&&(w=T,u=hy(l,T))),u===1))throw g=pd,Uo(l,0),eo(l,w),Kr(l,le()),g;switch(l.finishedWork=C,l.finishedLanes=w,u){case 0:case 1:throw Error(n(345));case 2:Wo(l,Hr,ai);break;case 3:if(eo(l,w),(w&130023424)===w&&(u=dy+500-le(),10<u)){if(sn(l,0)!==0)break;if(C=l.suspendedLanes,(C&w)!==w){Tr(),l.pingedLanes|=l.suspendedLanes&C;break}l.timeoutHandle=bx(Wo.bind(null,l,Hr,ai),u);break}Wo(l,Hr,ai);break;case 4:if(eo(l,w),(w&4194240)===w)break;for(u=l.eventTimes,C=-1;0<w;){var $=31-vr(w);T=1<<$,$=u[$],$>C&&(C=$),w&=~T}if(w=C,w=le()-w,w=(120>w?120:480>w?480:1080>w?1080:1920>w?1920:3e3>w?3e3:4320>w?4320:1960*GU(w/1960))-w,10<w){l.timeoutHandle=bx(Wo.bind(null,l,Hr,ai),w);break}Wo(l,Hr,ai);break;case 5:Wo(l,Hr,ai);break;default:throw Error(n(329))}}}return Kr(l,le()),l.callbackNode===g?Hk.bind(null,l):null}function hy(l,u){var g=hd;return l.current.memoizedState.isDehydrated&&(Uo(l,u).flags|=256),l=ah(l,u),l!==2&&(u=Hr,Hr=g,u!==null&&my(u)),l}function my(l){Hr===null?Hr=l:Hr.push.apply(Hr,l)}function YU(l){for(var u=l;;){if(u.flags&16384){var g=u.updateQueue;if(g!==null&&(g=g.stores,g!==null))for(var w=0;w<g.length;w++){var C=g[w],T=C.getSnapshot;C=C.value;try{if(!Js(T(),C))return!1}catch{return!1}}}if(g=u.child,u.subtreeFlags&16384&&g!==null)g.return=u,u=g;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 eo(l,u){for(u&=~uy,u&=~Jp,l.suspendedLanes|=u,l.pingedLanes&=~u,l=l.expirationTimes;0<u;){var g=31-vr(u),w=1<<g;l[g]=-1,u&=~w}}function Kk(l){if((an&6)!==0)throw Error(n(327));fc();var u=sn(l,0);if((u&1)===0)return Kr(l,le()),null;var g=ah(l,u);if(l.tag!==0&&g===2){var w=cr(l);w!==0&&(u=w,g=hy(l,w))}if(g===1)throw g=pd,Uo(l,0),eo(l,u),Kr(l,le()),g;if(g===6)throw Error(n(345));return l.finishedWork=l.current.alternate,l.finishedLanes=u,Wo(l,Hr,ai),Kr(l,le()),null}function gy(l,u){var g=an;an|=1;try{return l(u)}finally{an=g,an===0&&(dc=le()+500,Rp&&Ki())}}function qo(l){Zi!==null&&Zi.tag===0&&(an&6)===0&&fc();var u=an;an|=1;var g=ks.transition,w=fn;try{if(ks.transition=null,fn=1,l)return l()}finally{fn=w,ks.transition=g,an=u,(an&6)===0&&Ki()}}function vy(){ds=uc.current,kn(uc)}function Uo(l,u){l.finishedWork=null,l.finishedLanes=0;var g=l.timeoutHandle;if(g!==-1&&(l.timeoutHandle=-1,CU(g)),Yn!==null)for(g=Yn.return;g!==null;){var w=g;switch(_x(w),w.tag){case 1:w=w.type.childContextTypes,w!=null&&Pp();break;case 3:oc(),kn(Ur),kn(Nr),Fx();break;case 5:Dx(w);break;case 4:oc();break;case 13:kn(Ln);break;case 19:kn(Ln);break;case 10:Rx(w.type._context);break;case 22:case 23:vy()}g=g.return}if(dr=l,Yn=l=to(l.current,null),yr=ds=u,er=0,pd=null,uy=Jp=Bo=0,Hr=hd=null,Lo!==null){for(u=0;u<Lo.length;u++)if(g=Lo[u],w=g.interleaved,w!==null){g.interleaved=null;var C=w.next,T=g.pending;if(T!==null){var $=T.next;T.next=C,w.next=$}g.pending=w}Lo=null}return l}function Gk(l,u){do{var g=Yn;try{if(Tx(),qp.current=Hp,Up){for(var w=Fn.memoizedState;w!==null;){var C=w.queue;C!==null&&(C.pending=null),w=w.next}Up=!1}if(zo=0,ur=Jn=Fn=null,od=!1,ld=0,cy.current=null,g===null||g.return===null){er=1,pd=u,Yn=null;break}e:{var T=l,$=g.return,ee=g,ce=u;if(u=yr,ee.flags|=32768,ce!==null&&typeof ce=="object"&&typeof ce.then=="function"){var je=ce,Be=ee,We=Be.tag;if((Be.mode&1)===0&&(We===0||We===11||We===15)){var ze=Be.alternate;ze?(Be.updateQueue=ze.updateQueue,Be.memoizedState=ze.memoizedState,Be.lanes=ze.lanes):(Be.updateQueue=null,Be.memoizedState=null)}var pt=yk($);if(pt!==null){pt.flags&=-257,bk(pt,$,ee,T,u),pt.mode&1&&xk(T,je,u),u=pt,ce=je;var bt=u.updateQueue;if(bt===null){var wt=new Set;wt.add(ce),u.updateQueue=wt}else bt.add(ce);break e}else{if((u&1)===0){xk(T,je,u),xy();break e}ce=Error(n(426))}}else if(Mn&&ee.mode&1){var Kn=yk($);if(Kn!==null){(Kn.flags&65536)===0&&(Kn.flags|=256),bk(Kn,$,ee,T,u),Ex(lc(ce,ee));break e}}T=ce=lc(ce,ee),er!==4&&(er=2),hd===null?hd=[T]:hd.push(T),T=$;do{switch(T.tag){case 3:T.flags|=65536,u&=-u,T.lanes|=u;var ye=gk(T,ce,u);UA(T,ye);break e;case 1:ee=ce;var pe=T.type,be=T.stateNode;if((T.flags&128)===0&&(typeof pe.getDerivedStateFromError=="function"||be!==null&&typeof be.componentDidCatch=="function"&&(Qi===null||!Qi.has(be)))){T.flags|=65536,u&=-u,T.lanes|=u;var Ye=vk(T,ee,u);UA(T,Ye);break e}}T=T.return}while(T!==null)}Qk(g)}catch(St){u=St,Yn===g&&g!==null&&(Yn=g=g.return);continue}break}while(!0)}function Yk(){var l=Zp.current;return Zp.current=Hp,l===null?Hp:l}function xy(){(er===0||er===3||er===2)&&(er=4),dr===null||(Bo&268435455)===0&&(Jp&268435455)===0||eo(dr,yr)}function ah(l,u){var g=an;an|=2;var w=Yk();(dr!==l||yr!==u)&&(ai=null,Uo(l,u));do try{XU();break}catch(C){Gk(l,C)}while(!0);if(Tx(),an=g,Zp.current=w,Yn!==null)throw Error(n(261));return dr=null,yr=0,er}function XU(){for(;Yn!==null;)Xk(Yn)}function QU(){for(;Yn!==null&&!Fu();)Xk(Yn)}function Xk(l){var u=eE(l.alternate,l,ds);l.memoizedProps=l.pendingProps,u===null?Qk(l):Yn=u,cy.current=null}function Qk(l){var u=l;do{var g=u.alternate;if(l=u.return,(u.flags&32768)===0){if(g=UU(g,u,ds),g!==null){Yn=g;return}}else{if(g=WU(g,u),g!==null){g.flags&=32767,Yn=g;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{er=6,Yn=null;return}}if(u=u.sibling,u!==null){Yn=u;return}Yn=u=l}while(u!==null);er===0&&(er=5)}function Wo(l,u,g){var w=fn,C=ks.transition;try{ks.transition=null,fn=1,ZU(l,u,g,w)}finally{ks.transition=C,fn=w}return null}function ZU(l,u,g,w){do fc();while(Zi!==null);if((an&6)!==0)throw Error(n(327));g=l.finishedWork;var C=l.finishedLanes;if(g===null)return null;if(l.finishedWork=null,l.finishedLanes=0,g===l.current)throw Error(n(177));l.callbackNode=null,l.callbackPriority=0;var T=g.lanes|g.childLanes;if(Yv(l,T),l===dr&&(Yn=dr=null,yr=0),(g.subtreeFlags&2064)===0&&(g.flags&2064)===0||th||(th=!0,tE(qt,function(){return fc(),null})),T=(g.flags&15990)!==0,(g.subtreeFlags&15990)!==0||T){T=ks.transition,ks.transition=null;var $=fn;fn=1;var ee=an;an|=4,cy.current=null,HU(l,g),Bk(g,l),xU(xx),gp=!!vx,xx=vx=null,l.current=g,KU(g),Aa(),an=ee,fn=$,ks.transition=T}else l.current=g;if(th&&(th=!1,Zi=l,nh=C),T=l.pendingLanes,T===0&&(Qi=null),Ro(g.stateNode),Kr(l,le()),u!==null)for(w=l.onRecoverableError,g=0;g<u.length;g++)C=u[g],w(C.value,{componentStack:C.stack,digest:C.digest});if(eh)throw eh=!1,l=fy,fy=null,l;return(nh&1)!==0&&l.tag!==0&&fc(),T=l.pendingLanes,(T&1)!==0?l===py?md++:(md=0,py=l):md=0,Ki(),null}function fc(){if(Zi!==null){var l=F_(nh),u=ks.transition,g=fn;try{if(ks.transition=null,fn=16>l?16:l,Zi===null)var w=!1;else{if(l=Zi,Zi=null,nh=0,(an&6)!==0)throw Error(n(331));var C=an;for(an|=4,xt=l.current;xt!==null;){var T=xt,$=T.child;if((xt.flags&16)!==0){var ee=T.deletions;if(ee!==null){for(var ce=0;ce<ee.length;ce++){var je=ee[ce];for(xt=je;xt!==null;){var Be=xt;switch(Be.tag){case 0:case 11:case 15:fd(8,Be,T)}var We=Be.child;if(We!==null)We.return=Be,xt=We;else for(;xt!==null;){Be=xt;var ze=Be.sibling,pt=Be.return;if($k(Be),Be===je){xt=null;break}if(ze!==null){ze.return=pt,xt=ze;break}xt=pt}}}var bt=T.alternate;if(bt!==null){var wt=bt.child;if(wt!==null){bt.child=null;do{var Kn=wt.sibling;wt.sibling=null,wt=Kn}while(wt!==null)}}xt=T}}if((T.subtreeFlags&2064)!==0&&$!==null)$.return=T,xt=$;else e:for(;xt!==null;){if(T=xt,(T.flags&2048)!==0)switch(T.tag){case 0:case 11:case 15:fd(9,T,T.return)}var ye=T.sibling;if(ye!==null){ye.return=T.return,xt=ye;break e}xt=T.return}}var pe=l.current;for(xt=pe;xt!==null;){$=xt;var be=$.child;if(($.subtreeFlags&2064)!==0&&be!==null)be.return=$,xt=be;else e:for($=pe;xt!==null;){if(ee=xt,(ee.flags&2048)!==0)try{switch(ee.tag){case 0:case 11:case 15:Qp(9,ee)}}catch(St){Un(ee,ee.return,St)}if(ee===$){xt=null;break e}var Ye=ee.sibling;if(Ye!==null){Ye.return=ee.return,xt=Ye;break e}xt=ee.return}}if(an=C,Ki(),gr&&typeof gr.onPostCommitFiberRoot=="function")try{gr.onPostCommitFiberRoot(os,l)}catch{}w=!0}return w}finally{fn=g,ks.transition=u}}return!1}function Zk(l,u,g){u=lc(g,u),u=gk(l,u,1),l=Yi(l,u,1),u=Tr(),l!==null&&(Ss(l,1,u),Kr(l,u))}function Un(l,u,g){if(l.tag===3)Zk(l,l,g);else for(;u!==null;){if(u.tag===3){Zk(u,l,g);break}else if(u.tag===1){var w=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof w.componentDidCatch=="function"&&(Qi===null||!Qi.has(w))){l=lc(g,l),l=vk(u,l,1),u=Yi(u,l,1),l=Tr(),u!==null&&(Ss(u,1,l),Kr(u,l));break}}u=u.return}}function JU(l,u,g){var w=l.pingCache;w!==null&&w.delete(u),u=Tr(),l.pingedLanes|=l.suspendedLanes&g,dr===l&&(yr&g)===g&&(er===4||er===3&&(yr&130023424)===yr&&500>le()-dy?Uo(l,0):uy|=g),Kr(l,u)}function Jk(l,u){u===0&&((l.mode&1)===0?u=1:(u=jt,jt<<=1,(jt&130023424)===0&&(jt=4194304)));var g=Tr();l=ni(l,u),l!==null&&(Ss(l,u,g),Kr(l,g))}function e7(l){var u=l.memoizedState,g=0;u!==null&&(g=u.retryLane),Jk(l,g)}function t7(l,u){var g=0;switch(l.tag){case 13:var w=l.stateNode,C=l.memoizedState;C!==null&&(g=C.retryLane);break;case 19:w=l.stateNode;break;default:throw Error(n(314))}w!==null&&w.delete(u),Jk(l,g)}var eE;eE=function(l,u,g){if(l!==null)if(l.memoizedProps!==u.pendingProps||Ur.current)Vr=!0;else{if((l.lanes&g)===0&&(u.flags&128)===0)return Vr=!1,qU(l,u,g);Vr=(l.flags&131072)!==0}else Vr=!1,Mn&&(u.flags&1048576)!==0&&OA(u,Mp,u.index);switch(u.lanes=0,u.tag){case 2:var w=u.type;Yp(l,u),l=u.pendingProps;var C=ec(u,Nr.current);ic(u,g),C=qx(null,u,w,l,C,g);var T=Ux();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,Wr(w)?(T=!0,Tp(u)):T=!1,u.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,Ix(u),C.updater=Kp,u.stateNode=C,C._reactInternals=u,Yx(u,w,l,g),u=Jx(null,u,w,!0,T,g)):(u.tag=0,Mn&&T&&Cx(u),Pr(null,u,C,g),u=u.child),u;case 16:w=u.elementType;e:{switch(Yp(l,u),l=u.pendingProps,C=w._init,w=C(w._payload),u.type=w,C=u.tag=r7(w),l=ta(w,l),C){case 0:u=Zx(null,u,w,l,g);break e;case 1:u=_k(null,u,w,l,g);break e;case 11:u=wk(null,u,w,l,g);break e;case 14:u=jk(null,u,w,ta(w.type,l),g);break e}throw Error(n(306,w,""))}return u;case 0:return w=u.type,C=u.pendingProps,C=u.elementType===w?C:ta(w,C),Zx(l,u,w,C,g);case 1:return w=u.type,C=u.pendingProps,C=u.elementType===w?C:ta(w,C),_k(l,u,w,C,g);case 3:e:{if(Ak(u),l===null)throw Error(n(387));w=u.pendingProps,T=u.memoizedState,C=T.element,qA(l,u),zp(u,w,null,g);var $=u.memoizedState;if(w=$.element,T.isDehydrated)if(T={element:w,isDehydrated:!1,cache:$.cache,pendingSuspenseBoundaries:$.pendingSuspenseBoundaries,transitions:$.transitions},u.updateQueue.baseState=T,u.memoizedState=T,u.flags&256){C=lc(Error(n(423)),u),u=kk(l,u,w,g,C);break e}else if(w!==C){C=lc(Error(n(424)),u),u=kk(l,u,w,g,C);break e}else for(us=Wi(u.stateNode.containerInfo.firstChild),cs=u,Mn=!0,ea=null,g=zA(u,null,w,g),u.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling;else{if(rc(),w===C){u=si(l,u,g);break e}Pr(l,u,w,g)}u=u.child}return u;case 5:return VA(u),l===null&&kx(u),w=u.type,C=u.pendingProps,T=l!==null?l.memoizedProps:null,$=C.children,yx(w,C)?$=null:T!==null&&yx(w,T)&&(u.flags|=32),Ck(l,u),Pr(l,u,$,g),u.child;case 6:return l===null&&kx(u),null;case 13:return Ek(l,u,g);case 4:return $x(u,u.stateNode.containerInfo),w=u.pendingProps,l===null?u.child=sc(u,null,w,g):Pr(l,u,w,g),u.child;case 11:return w=u.type,C=u.pendingProps,C=u.elementType===w?C:ta(w,C),wk(l,u,w,C,g);case 7:return Pr(l,u,u.pendingProps,g),u.child;case 8:return Pr(l,u,u.pendingProps.children,g),u.child;case 12:return Pr(l,u,u.pendingProps.children,g),u.child;case 10:e:{if(w=u.type._context,C=u.pendingProps,T=u.memoizedProps,$=C.value,jn(Dp,w._currentValue),w._currentValue=$,T!==null)if(Js(T.value,$)){if(T.children===C.children&&!Ur.current){u=si(l,u,g);break e}}else for(T=u.child,T!==null&&(T.return=u);T!==null;){var ee=T.dependencies;if(ee!==null){$=T.child;for(var ce=ee.firstContext;ce!==null;){if(ce.context===w){if(T.tag===1){ce=ri(-1,g&-g),ce.tag=2;var je=T.updateQueue;if(je!==null){je=je.shared;var Be=je.pending;Be===null?ce.next=ce:(ce.next=Be.next,Be.next=ce),je.pending=ce}}T.lanes|=g,ce=T.alternate,ce!==null&&(ce.lanes|=g),Ox(T.return,g,u),ee.lanes|=g;break}ce=ce.next}}else if(T.tag===10)$=T.type===u.type?null:T.child;else if(T.tag===18){if($=T.return,$===null)throw Error(n(341));$.lanes|=g,ee=$.alternate,ee!==null&&(ee.lanes|=g),Ox($,g,u),$=T.sibling}else $=T.child;if($!==null)$.return=T;else for($=T;$!==null;){if($===u){$=null;break}if(T=$.sibling,T!==null){T.return=$.return,$=T;break}$=$.return}T=$}Pr(l,u,C.children,g),u=u.child}return u;case 9:return C=u.type,w=u.pendingProps.children,ic(u,g),C=_s(C),w=w(C),u.flags|=1,Pr(l,u,w,g),u.child;case 14:return w=u.type,C=ta(w,u.pendingProps),C=ta(w.type,C),jk(l,u,w,C,g);case 15:return Sk(l,u,u.type,u.pendingProps,g);case 17:return w=u.type,C=u.pendingProps,C=u.elementType===w?C:ta(w,C),Yp(l,u),u.tag=1,Wr(w)?(l=!0,Tp(u)):l=!1,ic(u,g),hk(u,w,C),Yx(u,w,C,g),Jx(null,u,w,!0,l,g);case 19:return Tk(l,u,g);case 22:return Nk(l,u,g)}throw Error(n(156,u.tag))};function tE(l,u){return Ul(l,u)}function n7(l,u,g,w){this.tag=l,this.key=g,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 Es(l,u,g,w){return new n7(l,u,g,w)}function yy(l){return l=l.prototype,!(!l||!l.isReactComponent)}function r7(l){if(typeof l=="function")return yy(l)?1:0;if(l!=null){if(l=l.$$typeof,l===F)return 11;if(l===L)return 14}return 2}function to(l,u){var g=l.alternate;return g===null?(g=Es(l.tag,u,l.key,l.mode),g.elementType=l.elementType,g.type=l.type,g.stateNode=l.stateNode,g.alternate=l,l.alternate=g):(g.pendingProps=u,g.type=l.type,g.flags=0,g.subtreeFlags=0,g.deletions=null),g.flags=l.flags&14680064,g.childLanes=l.childLanes,g.lanes=l.lanes,g.child=l.child,g.memoizedProps=l.memoizedProps,g.memoizedState=l.memoizedState,g.updateQueue=l.updateQueue,u=l.dependencies,g.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},g.sibling=l.sibling,g.index=l.index,g.ref=l.ref,g}function ih(l,u,g,w,C,T){var $=2;if(w=l,typeof l=="function")yy(l)&&($=1);else if(typeof l=="string")$=5;else e:switch(l){case P:return Vo(g.children,C,T,u);case R:$=8,C|=8;break;case M:return l=Es(12,g,u,C|2),l.elementType=M,l.lanes=T,l;case G:return l=Es(13,g,u,C),l.elementType=G,l.lanes=T,l;case H:return l=Es(19,g,u,C),l.elementType=H,l.lanes=T,l;case Y:return oh(g,C,T,u);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case D:$=10;break e;case U:$=9;break e;case F:$=11;break e;case L:$=14;break e;case I:$=16,w=null;break e}throw Error(n(130,l==null?l:typeof l,""))}return u=Es($,g,u,C),u.elementType=l,u.type=w,u.lanes=T,u}function Vo(l,u,g,w){return l=Es(7,l,w,u),l.lanes=g,l}function oh(l,u,g,w){return l=Es(22,l,w,u),l.elementType=Y,l.lanes=g,l.stateNode={isHidden:!1},l}function by(l,u,g){return l=Es(6,l,null,u),l.lanes=g,l}function wy(l,u,g){return u=Es(4,l.children!==null?l.children:[],l.key,u),u.lanes=g,u.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},u}function s7(l,u,g,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=mn(0),this.expirationTimes=mn(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mn(0),this.identifierPrefix=w,this.onRecoverableError=C,this.mutableSourceEagerHydrationData=null}function jy(l,u,g,w,C,T,$,ee,ce){return l=new s7(l,u,g,ee,ce),u===1?(u=1,T===!0&&(u|=8)):u=0,T=Es(3,null,null,u),l.current=T,T.stateNode=l,T.memoizedState={element:w,isDehydrated:g,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ix(T),l}function a7(l,u,g){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:E,key:w==null?null:""+w,children:l,containerInfo:u,implementation:g}}function nE(l){if(!l)return Hi;l=l._reactInternals;e:{if(_n(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(Wr(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break e}}u=u.return}while(u!==null);throw Error(n(171))}if(l.tag===1){var g=l.type;if(Wr(g))return PA(l,g,u)}return u}function rE(l,u,g,w,C,T,$,ee,ce){return l=jy(g,w,!0,l,C,T,$,ee,ce),l.context=nE(null),g=l.current,w=Tr(),C=Ji(g),T=ri(w,C),T.callback=u??null,Yi(g,T,C),l.current.lanes=C,Ss(l,C,w),Kr(l,w),l}function lh(l,u,g,w){var C=u.current,T=Tr(),$=Ji(C);return g=nE(g),u.context===null?u.context=g:u.pendingContext=g,u=ri(T,$),u.payload={element:l},w=w===void 0?null:w,w!==null&&(u.callback=w),l=Yi(C,u,$),l!==null&&(sa(l,C,$,T),Fp(l,C,$)),$}function ch(l){return l=l.current,l.child?(l.child.tag===5,l.child.stateNode):null}function sE(l,u){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var g=l.retryLane;l.retryLane=g!==0&&g<u?g:u}}function Sy(l,u){sE(l,u),(l=l.alternate)&&sE(l,u)}function i7(){return null}var aE=typeof reportError=="function"?reportError:function(l){console.error(l)};function Ny(l){this._internalRoot=l}uh.prototype.render=Ny.prototype.render=function(l){var u=this._internalRoot;if(u===null)throw Error(n(409));lh(l,u,null,null)},uh.prototype.unmount=Ny.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var u=l.containerInfo;qo(function(){lh(null,l,null,null)}),u[Za]=null}};function uh(l){this._internalRoot=l}uh.prototype.unstable_scheduleHydration=function(l){if(l){var u=q_();l={blockedOn:null,target:l,priority:u};for(var g=0;g<Bi.length&&u!==0&&u<Bi[g].priority;g++);Bi.splice(g,0,l),g===0&&V_(l)}};function Cy(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function dh(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function iE(){}function o7(l,u,g,w,C){if(C){if(typeof w=="function"){var T=w;w=function(){var je=ch($);T.call(je)}}var $=rE(u,w,l,0,null,!1,!1,"",iE);return l._reactRootContainer=$,l[Za]=$.current,Ju(l.nodeType===8?l.parentNode:l),qo(),$}for(;C=l.lastChild;)l.removeChild(C);if(typeof w=="function"){var ee=w;w=function(){var je=ch(ce);ee.call(je)}}var ce=jy(l,0,!1,null,null,!1,!1,"",iE);return l._reactRootContainer=ce,l[Za]=ce.current,Ju(l.nodeType===8?l.parentNode:l),qo(function(){lh(u,ce,g,w)}),ce}function fh(l,u,g,w,C){var T=g._reactRootContainer;if(T){var $=T;if(typeof C=="function"){var ee=C;C=function(){var ce=ch($);ee.call(ce)}}lh(u,$,l,C)}else $=o7(g,u,l,C,w);return ch($)}z_=function(l){switch(l.tag){case 3:var u=l.stateNode;if(u.current.memoizedState.isDehydrated){var g=et(u.pendingLanes);g!==0&&(Oo(u,g|1),Kr(u,le()),(an&6)===0&&(dc=le()+500,Ki()))}break;case 13:qo(function(){var w=ni(l,1);if(w!==null){var C=Tr();sa(w,l,1,C)}}),Sy(l,1)}},Xv=function(l){if(l.tag===13){var u=ni(l,134217728);if(u!==null){var g=Tr();sa(u,l,134217728,g)}Sy(l,134217728)}},B_=function(l){if(l.tag===13){var u=Ji(l),g=ni(l,u);if(g!==null){var w=Tr();sa(g,l,u,w)}Sy(l,u)}},q_=function(){return fn},U_=function(l,u){var g=fn;try{return fn=l,u()}finally{fn=g}},Ue=function(l,u,g){switch(u){case"input":if(ut(l,g),u=g.name,g.type==="radio"&&u!=null){for(g=l;g.parentNode;)g=g.parentNode;for(g=g.querySelectorAll("input[name="+JSON.stringify(""+u)+'][type="radio"]'),u=0;u<g.length;u++){var w=g[u];if(w!==l&&w.form===l.form){var C=Ep(w);if(!C)throw Error(n(90));fe(w),ut(w,C)}}}break;case"textarea":Pt(l,g);break;case"select":u=g.value,u!=null&&Ae(l,!!g.multiple,u,!1)}},Ge=gy,Ie=qo;var l7={usingClientEntryPoint:!1,Events:[nd,Zl,Ep,Le,$e,gy]},gd={findFiberByHostInstance:Mo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},c7={bundleType:gd.bundleType,version:gd.version,rendererPackageName:gd.rendererPackageName,rendererConfig:gd.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:A.ReactCurrentDispatcher,findHostInstanceByFiber:function(l){return l=To(l),l===null?null:l.stateNode},findFiberByHostInstance:gd.findFiberByHostInstance||i7,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 ph=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ph.isDisabled&&ph.supportsFiber)try{os=ph.inject(c7),gr=ph}catch{}}return Gr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=l7,Gr.createPortal=function(l,u){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Cy(u))throw Error(n(200));return a7(l,u,null,g)},Gr.createRoot=function(l,u){if(!Cy(l))throw Error(n(299));var g=!1,w="",C=aE;return u!=null&&(u.unstable_strictMode===!0&&(g=!0),u.identifierPrefix!==void 0&&(w=u.identifierPrefix),u.onRecoverableError!==void 0&&(C=u.onRecoverableError)),u=jy(l,1,!1,null,null,g,!1,w,C),l[Za]=u.current,Ju(l.nodeType===8?l.parentNode:l),new Ny(u)},Gr.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=To(u),l=l===null?null:l.stateNode,l},Gr.flushSync=function(l){return qo(l)},Gr.hydrate=function(l,u,g){if(!dh(u))throw Error(n(200));return fh(null,l,u,!0,g)},Gr.hydrateRoot=function(l,u,g){if(!Cy(l))throw Error(n(405));var w=g!=null&&g.hydratedSources||null,C=!1,T="",$=aE;if(g!=null&&(g.unstable_strictMode===!0&&(C=!0),g.identifierPrefix!==void 0&&(T=g.identifierPrefix),g.onRecoverableError!==void 0&&($=g.onRecoverableError)),u=rE(u,null,l,1,g??null,C,!1,T,$),l[Za]=u.current,Ju(l),w)for(l=0;l<w.length;l++)g=w[l],C=g._getVersion,C=C(g._source),u.mutableSourceEagerHydrationData==null?u.mutableSourceEagerHydrationData=[g,C]:u.mutableSourceEagerHydrationData.push(g,C);return new uh(u)},Gr.render=function(l,u,g){if(!dh(u))throw Error(n(200));return fh(null,l,u,!1,g)},Gr.unmountComponentAtNode=function(l){if(!dh(l))throw Error(n(40));return l._reactRootContainer?(qo(function(){fh(null,null,l,!1,function(){l._reactRootContainer=null,l[Za]=null})}),!0):!1},Gr.unstable_batchedUpdates=gy,Gr.unstable_renderSubtreeIntoContainer=function(l,u,g,w){if(!dh(g))throw Error(n(200));if(l==null||l._reactInternals===void 0)throw Error(n(38));return fh(l,u,g,!1,w)},Gr.version="18.3.1-next-f1338f8080-20240426",Gr}var hE;function oD(){if(hE)return ky.exports;hE=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(),ky.exports=v7(),ky.exports}var mE;function x7(){if(mE)return mh;mE=1;var e=oD();return mh.createRoot=e.createRoot,mh.hydrateRoot=e.hydrateRoot,mh}var y7=x7(),m=IN();const X=vn(m),vg=d7({__proto__:null,default:X},[m]),b7=1,w7=1e6;let Ty=0;function j7(){return Ty=(Ty+1)%Number.MAX_SAFE_INTEGER,Ty.toString()}const Ry=new Map,gE=e=>{if(Ry.has(e))return;const t=setTimeout(()=>{Ry.delete(e),Dd({type:"REMOVE_TOAST",toastId:e})},w7);Ry.set(e,t)},S7=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,b7)};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?gE(n):e.toasts.forEach(r=>{gE(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)}}},Bh=[];let qh={toasts:[]};function Dd(e){qh=S7(qh,e),Bh.forEach(t=>{t(qh)})}function Me({...e}){const t=j7(),n=a=>Dd({type:"UPDATE_TOAST",toast:{...a,id:t}}),r=()=>Dd({type:"DISMISS_TOAST",toastId:t});return Dd({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||r()}}}),{id:t,dismiss:r,update:n}}function N7(){const[e,t]=m.useState(qh);return m.useEffect(()=>(Bh.push(t),()=>{const n=Bh.indexOf(t);n>-1&&Bh.splice(n,1)}),[e]),{...e,toast:Me,dismiss:n=>Dd({type:"DISMISS_TOAST",toastId:n})}}var bu=oD();const lD=vn(bu);function qe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e?.(a),n===!1||!a.defaultPrevented)return t?.(a)}}function vE(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function zr(...e){return t=>{let n=!1;const r=e.map(a=>{const i=vE(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():vE(e[a],null)}}}}function Mt(...e){return m.useCallback(zr(...e),e)}function C7(e,t){const n=m.createContext(t),r=i=>{const{children:o,...c}=i,d=m.useMemo(()=>c,Object.values(c));return s.jsx(n.Provider,{value:d,children:o})};r.displayName=e+"Provider";function a(i){const o=m.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,a]}function Sr(e,t=[]){let n=[];function r(i,o){const c=m.createContext(o),d=n.length;n=[...n,o];const f=p=>{const{scope:v,children:x,...j}=p,b=v?.[e]?.[d]||c,y=m.useMemo(()=>j,Object.values(j));return s.jsx(b.Provider,{value:y,children:x})};f.displayName=i+"Provider";function h(p,v){const x=v?.[e]?.[d]||c,j=m.useContext(x);if(j)return j;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[f,h]}const a=()=>{const i=n.map(o=>m.createContext(o));return function(c){const d=c?.[e]||i;return m.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return a.scopeName=e,[r,_7(a,...t)]}function _7(...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 m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function xE(e){const t=A7(e),n=m.forwardRef((r,a)=>{const{children:i,...o}=r,c=m.Children.toArray(i),d=c.find(E7);if(d){const f=d.props.children,h=c.map(p=>p===d?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function A7(e){const t=m.forwardRef((n,r)=>{const{children:a,...i}=n;if(m.isValidElement(a)){const o=T7(a),c=P7(i,a.props);return a.type!==m.Fragment&&(c.ref=r?zr(r,o):o),m.cloneElement(a,c)}return m.Children.count(a)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var k7=Symbol("radix.slottable");function E7(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===k7}function P7(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 T7(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 Ff(e){const t=e+"CollectionProvider",[n,r]=Sr(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=b=>{const{scope:y,children:S}=b,N=X.useRef(null),_=X.useRef(new Map).current;return s.jsx(a,{scope:y,itemMap:_,collectionRef:N,children:S})};o.displayName=t;const c=e+"CollectionSlot",d=xE(c),f=X.forwardRef((b,y)=>{const{scope:S,children:N}=b,_=i(c,S),A=Mt(y,_.collectionRef);return s.jsx(d,{ref:A,children:N})});f.displayName=c;const h=e+"CollectionItemSlot",p="data-radix-collection-item",v=xE(h),x=X.forwardRef((b,y)=>{const{scope:S,children:N,..._}=b,A=X.useRef(null),k=Mt(y,A),E=i(h,S);return X.useEffect(()=>(E.itemMap.set(A,{ref:A,..._}),()=>{E.itemMap.delete(A)})),s.jsx(v,{[p]:"",ref:k,children:N})});x.displayName=h;function j(b){const y=i(e+"CollectionConsumer",b);return X.useCallback(()=>{const N=y.collectionRef.current;if(!N)return[];const _=Array.from(N.querySelectorAll(`[${p}]`));return Array.from(y.itemMap.values()).sort((E,P)=>_.indexOf(E.ref.current)-_.indexOf(P.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:o,Slot:f,ItemSlot:x},j,r]}function R7(e){const t=O7(e),n=m.forwardRef((r,a)=>{const{children:i,...o}=r,c=m.Children.toArray(i),d=c.find(I7);if(d){const f=d.props.children,h=c.map(p=>p===d?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:m.isValidElement(f)?m.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=m.forwardRef((n,r)=>{const{children:a,...i}=n;if(m.isValidElement(a)){const o=D7(a),c=$7(i,a.props);return a.type!==m.Fragment&&(c.ref=r?zr(r,o):o),m.cloneElement(a,c)}return m.Children.count(a)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var M7=Symbol("radix.slottable");function I7(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===M7}function $7(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 D7(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var L7=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ft=L7.reduce((e,t)=>{const n=R7(`Primitive.${t}`),r=m.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 $N(e,t){e&&bu.flushSync(()=>e.dispatchEvent(t))}function Gn(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>t.current?.(...n),[])}function F7(e,t=globalThis?.document){const n=Gn(e);m.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 z7="DismissableLayer",yS="dismissableLayer.update",B7="dismissableLayer.pointerDownOutside",q7="dismissableLayer.focusOutside",yE,cD=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Tl=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:c,...d}=e,f=m.useContext(cD),[h,p]=m.useState(null),v=h?.ownerDocument??globalThis?.document,[,x]=m.useState({}),j=Mt(t,P=>p(P)),b=Array.from(f.layers),[y]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),S=b.indexOf(y),N=h?b.indexOf(h):-1,_=f.layersWithOutsidePointerEventsDisabled.size>0,A=N>=S,k=W7(P=>{const R=P.target,M=[...f.branches].some(D=>D.contains(R));!A||M||(a?.(P),o?.(P),P.defaultPrevented||c?.())},v),E=V7(P=>{const R=P.target;[...f.branches].some(D=>D.contains(R))||(i?.(P),o?.(P),P.defaultPrevented||c?.())},v);return F7(P=>{N===f.layers.size-1&&(r?.(P),!P.defaultPrevented&&c&&(P.preventDefault(),c()))},v),m.useEffect(()=>{if(h)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(yE=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),bE(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=yE)}},[h,v,n,f]),m.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),bE())},[h,f]),m.useEffect(()=>{const P=()=>x({});return document.addEventListener(yS,P),()=>document.removeEventListener(yS,P)},[]),s.jsx(ft.div,{...d,ref:j,style:{pointerEvents:_?A?"auto":"none":void 0,...e.style},onFocusCapture:qe(e.onFocusCapture,E.onFocusCapture),onBlurCapture:qe(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:qe(e.onPointerDownCapture,k.onPointerDownCapture)})});Tl.displayName=z7;var U7="DismissableLayerBranch",uD=m.forwardRef((e,t)=>{const n=m.useContext(cD),r=m.useRef(null),a=Mt(t,r);return m.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),s.jsx(ft.div,{...e,ref:a})});uD.displayName=U7;function W7(e,t=globalThis?.document){const n=Gn(e),r=m.useRef(!1),a=m.useRef(()=>{});return m.useEffect(()=>{const i=c=>{if(c.target&&!r.current){let d=function(){dD(B7,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 V7(e,t=globalThis?.document){const n=Gn(e),r=m.useRef(!1);return m.useEffect(()=>{const a=i=>{i.target&&!r.current&&dD(q7,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 bE(){const e=new CustomEvent(yS);document.dispatchEvent(e)}function dD(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?$N(a,i):a.dispatchEvent(i)}var H7=Tl,K7=uD,ir=globalThis?.document?m.useLayoutEffect:()=>{},G7="Portal",Rl=m.forwardRef((e,t)=>{const{container:n,...r}=e,[a,i]=m.useState(!1);ir(()=>i(!0),[]);const o=n||a&&globalThis?.document?.body;return o?lD.createPortal(s.jsx(ft.div,{...r,ref:t}),o):null});Rl.displayName=G7;function Y7(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var Zn=e=>{const{present:t,children:n}=e,r=X7(t),a=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=Mt(r.ref,Q7(a));return typeof n=="function"||r.isPresent?m.cloneElement(a,{ref:i}):null};Zn.displayName="Presence";function X7(e){const[t,n]=m.useState(),r=m.useRef(null),a=m.useRef(e),i=m.useRef("none"),o=e?"mounted":"unmounted",[c,d]=Y7(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const f=gh(r.current);i.current=c==="mounted"?f:"none"},[c]),ir(()=>{const f=r.current,h=a.current;if(h!==e){const v=i.current,x=gh(f);e?d("MOUNT"):x==="none"||f?.display==="none"?d("UNMOUNT"):d(h&&v!==x?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,d]),ir(()=>{if(t){let f;const h=t.ownerDocument.defaultView??window,p=x=>{const b=gh(r.current).includes(CSS.escape(x.animationName));if(x.target===t&&b&&(d("ANIMATION_END"),!a.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",f=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},v=x=>{x.target===t&&(i.current=gh(r.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{h.clearTimeout(f),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:m.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function gh(e){return e?.animationName||"none"}function Q7(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=vg[" useInsertionEffect ".trim().toString()]||ir;function js({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,o]=J7({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:a;{const h=m.useRef(e!==void 0);m.useEffect(()=>{const p=h.current;p!==c&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=c},[c,r])}const f=m.useCallback(h=>{if(c){const p=e9(h)?h(e):h;p!==e&&o.current?.(p)}else i(h)},[c,e,i,o]);return[d,f]}function J7({defaultProp:e,onChange:t}){const[n,r]=m.useState(e),a=m.useRef(n),i=m.useRef(t);return Z7(()=>{i.current=t},[t]),m.useEffect(()=>{a.current!==n&&(i.current?.(n),a.current=n)},[n,a]),[n,r,i]}function e9(e){return typeof e=="function"}var fD=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"}),t9="VisuallyHidden",xg=m.forwardRef((e,t)=>s.jsx(ft.span,{...e,ref:t,style:{...fD,...e.style}}));xg.displayName=t9;var n9=xg,DN="ToastProvider",[LN,r9,s9]=Ff("Toast"),[pD]=Sr("Toast",[s9]),[a9,yg]=pD(DN),hD=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:a="right",swipeThreshold:i=50,children:o}=e,[c,d]=m.useState(null),[f,h]=m.useState(0),p=m.useRef(!1),v=m.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${DN}\`. Expected non-empty \`string\`.`),s.jsx(LN.Provider,{scope:t,children:s.jsx(a9,{scope:t,label:n,duration:r,swipeDirection:a,swipeThreshold:i,toastCount:f,viewport:c,onViewportChange:d,onToastAdd:m.useCallback(()=>h(x=>x+1),[]),onToastRemove:m.useCallback(()=>h(x=>x-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:v,children:o})})};hD.displayName=DN;var mD="ToastViewport",i9=["F8"],bS="toast.viewportPause",wS="toast.viewportResume",gD=m.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=i9,label:a="Notifications ({hotkey})",...i}=e,o=yg(mD,n),c=r9(n),d=m.useRef(null),f=m.useRef(null),h=m.useRef(null),p=m.useRef(null),v=Mt(t,p,o.onViewportChange),x=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=o.toastCount>0;m.useEffect(()=>{const y=S=>{r.length!==0&&r.every(_=>S[_]||S.code===_)&&p.current?.focus()};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),m.useEffect(()=>{const y=d.current,S=p.current;if(j&&y&&S){const N=()=>{if(!o.isClosePausedRef.current){const E=new CustomEvent(bS);S.dispatchEvent(E),o.isClosePausedRef.current=!0}},_=()=>{if(o.isClosePausedRef.current){const E=new CustomEvent(wS);S.dispatchEvent(E),o.isClosePausedRef.current=!1}},A=E=>{!y.contains(E.relatedTarget)&&_()},k=()=>{y.contains(document.activeElement)||_()};return y.addEventListener("focusin",N),y.addEventListener("focusout",A),y.addEventListener("pointermove",N),y.addEventListener("pointerleave",k),window.addEventListener("blur",N),window.addEventListener("focus",_),()=>{y.removeEventListener("focusin",N),y.removeEventListener("focusout",A),y.removeEventListener("pointermove",N),y.removeEventListener("pointerleave",k),window.removeEventListener("blur",N),window.removeEventListener("focus",_)}}},[j,o.isClosePausedRef]);const b=m.useCallback(({tabbingDirection:y})=>{const N=c().map(_=>{const A=_.ref.current,k=[A,...y9(A)];return y==="forwards"?k:k.reverse()});return(y==="forwards"?N.reverse():N).flat()},[c]);return m.useEffect(()=>{const y=p.current;if(y){const S=N=>{const _=N.altKey||N.ctrlKey||N.metaKey;if(N.key==="Tab"&&!_){const k=document.activeElement,E=N.shiftKey;if(N.target===y&&E){f.current?.focus();return}const M=b({tabbingDirection:E?"backwards":"forwards"}),D=M.findIndex(U=>U===k);Oy(M.slice(D+1))?N.preventDefault():E?f.current?.focus():h.current?.focus()}};return y.addEventListener("keydown",S),()=>y.removeEventListener("keydown",S)}},[c,b]),s.jsxs(K7,{ref:d,role:"region","aria-label":a.replace("{hotkey}",x),tabIndex:-1,style:{pointerEvents:j?void 0:"none"},children:[j&&s.jsx(jS,{ref:f,onFocusFromOutsideViewport:()=>{const y=b({tabbingDirection:"forwards"});Oy(y)}}),s.jsx(LN.Slot,{scope:n,children:s.jsx(ft.ol,{tabIndex:-1,...i,ref:v})}),j&&s.jsx(jS,{ref:h,onFocusFromOutsideViewport:()=>{const y=b({tabbingDirection:"backwards"});Oy(y)}})]})});gD.displayName=mD;var vD="ToastFocusProxy",jS=m.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...a}=e,i=yg(vD,n);return s.jsx(xg,{tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:o=>{const c=o.relatedTarget;!i.viewport?.contains(c)&&r()}})});jS.displayName=vD;var zf="Toast",o9="toast.swipeStart",l9="toast.swipeMove",c9="toast.swipeCancel",u9="toast.swipeEnd",xD=m.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:a,onOpenChange:i,...o}=e,[c,d]=js({prop:r,defaultProp:a??!0,onChange:i,caller:zf});return s.jsx(Zn,{present:n||c,children:s.jsx(p9,{open:c,...o,ref:t,onClose:()=>d(!1),onPause:Gn(e.onPause),onResume:Gn(e.onResume),onSwipeStart:qe(e.onSwipeStart,f=>{f.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:qe(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:qe(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:qe(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)})})})});xD.displayName=zf;var[d9,f9]=pD(zf,{onClose(){}}),p9=m.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:v,onSwipeEnd:x,...j}=e,b=yg(zf,n),[y,S]=m.useState(null),N=Mt(t,H=>S(H)),_=m.useRef(null),A=m.useRef(null),k=a||b.duration,E=m.useRef(0),P=m.useRef(k),R=m.useRef(0),{onToastAdd:M,onToastRemove:D}=b,U=Gn(()=>{y?.contains(document.activeElement)&&b.viewport?.focus(),o()}),F=m.useCallback(H=>{!H||H===1/0||(window.clearTimeout(R.current),E.current=new Date().getTime(),R.current=window.setTimeout(U,H))},[U]);m.useEffect(()=>{const H=b.viewport;if(H){const L=()=>{F(P.current),f?.()},I=()=>{const Y=new Date().getTime()-E.current;P.current=P.current-Y,window.clearTimeout(R.current),d?.()};return H.addEventListener(bS,I),H.addEventListener(wS,L),()=>{H.removeEventListener(bS,I),H.removeEventListener(wS,L)}}},[b.viewport,k,d,f,F]),m.useEffect(()=>{i&&!b.isClosePausedRef.current&&F(k)},[i,k,b.isClosePausedRef,F]),m.useEffect(()=>(M(),()=>D()),[M,D]);const G=m.useMemo(()=>y?CD(y):null,[y]);return b.viewport?s.jsxs(s.Fragment,{children:[G&&s.jsx(h9,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:G}),s.jsx(d9,{scope:n,onClose:U,children:bu.createPortal(s.jsx(LN.ItemSlot,{scope:n,children:s.jsx(H7,{asChild:!0,onEscapeKeyDown:qe(c,()=>{b.isFocusedToastEscapeKeyDownRef.current||U(),b.isFocusedToastEscapeKeyDownRef.current=!1}),children:s.jsx(ft.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":b.swipeDirection,...j,ref:N,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:qe(e.onKeyDown,H=>{H.key==="Escape"&&(c?.(H.nativeEvent),H.nativeEvent.defaultPrevented||(b.isFocusedToastEscapeKeyDownRef.current=!0,U()))}),onPointerDown:qe(e.onPointerDown,H=>{H.button===0&&(_.current={x:H.clientX,y:H.clientY})}),onPointerMove:qe(e.onPointerMove,H=>{if(!_.current)return;const L=H.clientX-_.current.x,I=H.clientY-_.current.y,Y=!!A.current,W=["left","right"].includes(b.swipeDirection),O=["left","up"].includes(b.swipeDirection)?Math.min:Math.max,Q=W?O(0,L):0,q=W?0:O(0,I),z=H.pointerType==="touch"?10:2,K={x:Q,y:q},J={originalEvent:H,delta:K};Y?(A.current=K,vh(l9,p,J,{discrete:!1})):wE(K,b.swipeDirection,z)?(A.current=K,vh(o9,h,J,{discrete:!1}),H.target.setPointerCapture(H.pointerId)):(Math.abs(L)>z||Math.abs(I)>z)&&(_.current=null)}),onPointerUp:qe(e.onPointerUp,H=>{const L=A.current,I=H.target;if(I.hasPointerCapture(H.pointerId)&&I.releasePointerCapture(H.pointerId),A.current=null,_.current=null,L){const Y=H.currentTarget,W={originalEvent:H,delta:L};wE(L,b.swipeDirection,b.swipeThreshold)?vh(u9,x,W,{discrete:!0}):vh(c9,v,W,{discrete:!0}),Y.addEventListener("click",O=>O.preventDefault(),{once:!0})}})})})}),b.viewport)})]}):null}),h9=e=>{const{__scopeToast:t,children:n,...r}=e,a=yg(zf,t),[i,o]=m.useState(!1),[c,d]=m.useState(!1);return v9(()=>o(!0)),m.useEffect(()=>{const f=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(f)},[]),c?null:s.jsx(Rl,{asChild:!0,children:s.jsx(xg,{...r,children:i&&s.jsxs(s.Fragment,{children:[a.label," ",n]})})})},m9="ToastTitle",yD=m.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(ft.div,{...r,ref:t})});yD.displayName=m9;var g9="ToastDescription",bD=m.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(ft.div,{...r,ref:t})});bD.displayName=g9;var wD="ToastAction",jD=m.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?s.jsx(ND,{altText:n,asChild:!0,children:s.jsx(FN,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${wD}\`. Expected non-empty \`string\`.`),null)});jD.displayName=wD;var SD="ToastClose",FN=m.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,a=f9(SD,n);return s.jsx(ND,{asChild:!0,children:s.jsx(ft.button,{type:"button",...r,ref:t,onClick:qe(e.onClick,a.onClose)})})});FN.displayName=SD;var ND=m.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...a}=e;return s.jsx(ft.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...a,ref:t})});function CD(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),x9(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(...CD(r))}}),t}function vh(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?$N(a,i):a.dispatchEvent(i)}var wE=(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 v9(e=()=>{}){const t=Gn(e);ir(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function x9(e){return e.nodeType===e.ELEMENT_NODE}function y9(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 Oy(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var b9=hD,_D=gD,AD=xD,kD=yD,ED=bD,PD=jD,TD=FN;function RD(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=RD(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Yt(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=RD(e))&&(r&&(r+=" "),r+=t);return r}const jE=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,SE=Yt,Ol=(e,t)=>n=>{var r;if(t?.variants==null)return SE(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 v=jE(h)||jE(p);return a[f][v]}),c=n&&Object.entries(n).reduce((f,h)=>{let[p,v]=h;return v===void 0||(f[p]=v),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,h)=>{let{class:p,className:v,...x}=h;return Object.entries(x).every(j=>{let[b,y]=j;return Array.isArray(y)?y.includes({...i,...c}[b]):{...i,...c}[b]===y})?[...f,p,v]:f},[]);return SE(e,o,d,n?.class,n?.className)};const w9=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),OD=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();var j9={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 S9=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:i,iconNode:o,...c},d)=>m.createElement("svg",{ref:d,...j9,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:OD("lucide",a),...c},[...o.map(([f,h])=>m.createElement(f,h)),...Array.isArray(i)?i:[i]]));const vt=(e,t)=>{const n=m.forwardRef(({className:r,...a},i)=>m.createElement(S9,{ref:i,iconNode:t,className:OD(`lucide-${w9(e)}`,r),...a}));return n.displayName=`${e}`,n};const MD=vt("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 ID=vt("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 go=vt("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const Fr=vt("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 $D=vt("CalendarRange",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M17 14h-6",key:"bkmgh3"}],["path",{d:"M13 18H7",key:"bb0bb7"}],["path",{d:"M7 14h.01",key:"1qa3f1"}],["path",{d:"M17 18h.01",key:"1bdyru"}]]);const Bc=vt("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 qc=vt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const tn=vt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const zN=vt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const ma=vt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const Oc=vt("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);const My=vt("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 ga=vt("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const N9=vt("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 tl=vt("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 C9=vt("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const NE=vt("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);const xa=vt("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const ss=vt("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 DD=vt("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 Ir=vt("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 bg=vt("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 Xh=vt("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 _9=vt("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 LD=vt("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 SS=vt("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 FD=vt("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 A9=vt("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);const zD=vt("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 k9=vt("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 E9=vt("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);const P9=vt("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);const NS=vt("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 BD=vt("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 T9=vt("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 CS=vt("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);const R9=vt("ListPlus",[["path",{d:"M11 12H3",key:"51ecnj"}],["path",{d:"M16 6H3",key:"1wxfjs"}],["path",{d:"M16 18H3",key:"12xzn7"}],["path",{d:"M18 9v6",key:"1twb98"}],["path",{d:"M21 12h-6",key:"bt1uis"}]]);const jr=vt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const qD=vt("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 O9=vt("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 UD=vt("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 Ac=vt("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 M9=vt("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);const _S=vt("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 AS=vt("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 CE=vt("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);const wg=vt("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 va=vt("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const yi=vt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const BN=vt("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 zs=vt("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 I9=vt("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 qN=vt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);const $9=vt("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 UN=vt("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 D9=vt("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const Zr=vt("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 L9=vt("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);const Ld=vt("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);const WD=vt("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 Bs=vt("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 Uh=vt("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 F9=vt("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 Uc=vt("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 VD=vt("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 pa=vt("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 ns=vt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),WN="-",z9=e=>{const t=q9(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const c=o.split(WN);return c[0]===""&&c.length!==1&&c.shift(),HD(c,t)||B9(o)},getConflictingClassGroupIds:(o,c)=>{const d=n[o]||[];return c&&r[o]?[...d,...r[o]]:d}}},HD=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?HD(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(WN);return t.validators.find(({validator:o})=>o(i))?.classGroupId},_E=/^\[(.+)\]$/,B9=e=>{if(_E.test(e)){const t=_E.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},q9=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return W9(Object.entries(e.classGroups),n).forEach(([i,o])=>{kS(o,r,i,t)}),r},kS=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:AE(t,a);i.classGroupId=n;return}if(typeof a=="function"){if(U9(a)){kS(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([i,o])=>{kS(o,AE(t,i),n,r)})})},AE=(e,t)=>{let n=e;return t.split(WN).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},U9=e=>e.isThemeGetter,W9=(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,V9=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)}}},KD="!",H9=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,a=t[0],i=t.length,o=c=>{const d=[];let f=0,h=0,p;for(let y=0;y<c.length;y++){let S=c[y];if(f===0){if(S===a&&(r||c.slice(y,y+i)===t)){d.push(c.slice(h,y)),h=y+i;continue}if(S==="/"){p=y;continue}}S==="["?f++:S==="]"&&f--}const v=d.length===0?c:c.substring(h),x=v.startsWith(KD),j=x?v.substring(1):v,b=p&&p>h?p-h:void 0;return{modifiers:d,hasImportantModifier:x,baseClassName:j,maybePostfixModifierPosition:b}};return n?c=>n({className:c,parseClassName:o}):o},K9=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},G9=e=>({cache:V9(e.cacheSize),parseClassName:H9(e),...z9(e)}),Y9=/\s+/,X9=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,i=[],o=e.trim().split(Y9);let c="";for(let d=o.length-1;d>=0;d-=1){const f=o[d],{modifiers:h,hasImportantModifier:p,baseClassName:v,maybePostfixModifierPosition:x}=n(f);let j=!!x,b=r(j?v.substring(0,x):v);if(!b){if(!j){c=f+(c.length>0?" "+c:c);continue}if(b=r(v),!b){c=f+(c.length>0?" "+c:c);continue}j=!1}const y=K9(h).join(":"),S=p?y+KD:y,N=S+b;if(i.includes(N))continue;i.push(N);const _=a(b,j);for(let A=0;A<_.length;++A){const k=_[A];i.push(S+k)}c=f+(c.length>0?" "+c:c)}return c};function Q9(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=GD(t))&&(r&&(r+=" "),r+=n);return r}const GD=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=GD(e[r]))&&(n&&(n+=" "),n+=t);return n};function Z9(e,...t){let n,r,a,i=o;function o(d){const f=t.reduce((h,p)=>p(h),e());return n=G9(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=X9(d,n);return a(d,h),h}return function(){return i(Q9.apply(null,arguments))}}const En=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},YD=/^\[(?:([a-z-]+):)?(.+)\]$/i,J9=/^\d+\/\d+$/,eW=new Set(["px","full","screen"]),tW=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,nW=/\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$/,rW=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,sW=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,aW=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ii=e=>Mc(e)||eW.has(e)||J9.test(e),ro=e=>wu(e,"length",pW),Mc=e=>!!e&&!Number.isNaN(Number(e)),Iy=e=>wu(e,"number",Mc),xd=e=>!!e&&Number.isInteger(Number(e)),iW=e=>e.endsWith("%")&&Mc(e.slice(0,-1)),Zt=e=>YD.test(e),so=e=>tW.test(e),oW=new Set(["length","size","percentage"]),lW=e=>wu(e,oW,XD),cW=e=>wu(e,"position",XD),uW=new Set(["image","url"]),dW=e=>wu(e,uW,mW),fW=e=>wu(e,"",hW),yd=()=>!0,wu=(e,t,n)=>{const r=YD.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},pW=e=>nW.test(e)&&!rW.test(e),XD=()=>!1,hW=e=>sW.test(e),mW=e=>aW.test(e),gW=()=>{const e=En("colors"),t=En("spacing"),n=En("blur"),r=En("brightness"),a=En("borderColor"),i=En("borderRadius"),o=En("borderSpacing"),c=En("borderWidth"),d=En("contrast"),f=En("grayscale"),h=En("hueRotate"),p=En("invert"),v=En("gap"),x=En("gradientColorStops"),j=En("gradientColorStopPositions"),b=En("inset"),y=En("margin"),S=En("opacity"),N=En("padding"),_=En("saturate"),A=En("scale"),k=En("sepia"),E=En("skew"),P=En("space"),R=En("translate"),M=()=>["auto","contain","none"],D=()=>["auto","hidden","clip","visible","scroll"],U=()=>["auto",Zt,t],F=()=>[Zt,t],G=()=>["",ii,ro],H=()=>["auto",Mc,Zt],L=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],I=()=>["solid","dashed","dotted","double","none"],Y=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],W=()=>["start","end","center","between","around","evenly","stretch"],O=()=>["","0",Zt],Q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>[Mc,Zt];return{cacheSize:500,separator:":",theme:{colors:[yd],spacing:[ii,ro],blur:["none","",so,Zt],brightness:q(),borderColor:[e],borderRadius:["none","","full",so,Zt],borderSpacing:F(),borderWidth:G(),contrast:q(),grayscale:O(),hueRotate:q(),invert:O(),gap:F(),gradientColorStops:[e],gradientColorStopPositions:[iW,ro],inset:U(),margin:U(),opacity:q(),padding:F(),saturate:q(),scale:q(),sepia:O(),skew:q(),space:F(),translate:F()},classGroups:{aspect:[{aspect:["auto","square","video",Zt]}],container:["container"],columns:[{columns:[so]}],"break-after":[{"break-after":Q()}],"break-before":[{"break-before":Q()}],"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:[...L(),Zt]}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],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",xd,Zt]}],basis:[{basis:U()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Zt]}],grow:[{grow:O()}],shrink:[{shrink:O()}],order:[{order:["first","last","none",xd,Zt]}],"grid-cols":[{"grid-cols":[yd]}],"col-start-end":[{col:["auto",{span:["full",xd,Zt]},Zt]}],"col-start":[{"col-start":H()}],"col-end":[{"col-end":H()}],"grid-rows":[{"grid-rows":[yd]}],"row-start-end":[{row:["auto",{span:[xd,Zt]},Zt]}],"row-start":[{"row-start":H()}],"row-end":[{"row-end":H()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Zt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Zt]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...W()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...W(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...W(),"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:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Zt,t]}],"min-w":[{"min-w":[Zt,t,"min","max","fit"]}],"max-w":[{"max-w":[Zt,t,"none","full","min","max","fit","prose",{screen:[so]},so]}],h:[{h:[Zt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Zt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Zt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Zt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",so,ro]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Iy]}],"font-family":[{font:[yd]}],"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",Zt]}],"line-clamp":[{"line-clamp":["none",Mc,Iy]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ii,Zt]}],"list-image":[{"list-image":["none",Zt]}],"list-style-type":[{list:["none","disc","decimal",Zt]}],"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:[...I(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ii,ro]}],"underline-offset":[{"underline-offset":["auto",ii,Zt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Zt]}],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",Zt]}],"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:[...L(),cW]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",lW]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},dW]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[j]}],"gradient-via-pos":[{via:[j]}],"gradient-to-pos":[{to:[j]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[S]}],"border-style":[{border:[...I(),"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:I()}],"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:["",...I()]}],"outline-offset":[{"outline-offset":[ii,Zt]}],"outline-w":[{outline:[ii,ro]}],"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":[ii,ro]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",so,fW]}],"shadow-color":[{shadow:[yd]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...Y(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Y()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",so,Zt]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[p]}],saturate:[{saturate:[_]}],sepia:[{sepia:[k]}],"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":[k]}],"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",Zt]}],duration:[{duration:q()}],ease:[{ease:["linear","in","out","in-out",Zt]}],delay:[{delay:q()}],animate:[{animate:["none","spin","ping","pulse","bounce",Zt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[A]}],"scale-x":[{"scale-x":[A]}],"scale-y":[{"scale-y":[A]}],rotate:[{rotate:[xd,Zt]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Zt]}],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",Zt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Zt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ii,ro,Iy]}],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"]}}},vW=Z9(gW);function Re(...e){return vW(Yt(e))}function zn(e,t=""){return typeof e=="string"&&e.trim().length>0?e.trim():t}const xW=b9,QD=m.forwardRef(({className:e,...t},n)=>s.jsx(_D,{ref:n,className:Re("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}));QD.displayName=_D.displayName;const yW=Ol("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"}}),ZD=m.forwardRef(({className:e,variant:t,...n},r)=>s.jsx(AD,{ref:r,className:Re(yW({variant:t}),e),...n}));ZD.displayName=AD.displayName;const bW=m.forwardRef(({className:e,...t},n)=>s.jsx(PD,{ref:n,className:Re("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}));bW.displayName=PD.displayName;const JD=m.forwardRef(({className:e,...t},n)=>s.jsx(TD,{ref:n,className:Re("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(ns,{className:"h-4 w-4"})}));JD.displayName=TD.displayName;const e5=m.forwardRef(({className:e,...t},n)=>s.jsx(kD,{ref:n,className:Re("text-sm font-semibold",e),...t}));e5.displayName=kD.displayName;const t5=m.forwardRef(({className:e,...t},n)=>s.jsx(ED,{ref:n,className:Re("text-sm opacity-90",e),...t}));t5.displayName=ED.displayName;function wW(){const{toasts:e}=N7();return s.jsxs(xW,{children:[e.map(function({id:t,title:n,description:r,action:a,...i}){return s.jsxs(ZD,{...i,children:[s.jsxs("div",{className:"grid gap-1",children:[n&&s.jsx(e5,{children:n}),r&&s.jsx(t5,{children:r})]}),a,s.jsx(JD,{})]},t)}),s.jsx(QD,{})]})}var kE=["light","dark"],jW="(prefers-color-scheme: dark)",SW=m.createContext(void 0),NW={setTheme:e=>{},themes:[]},CW=()=>{var e;return(e=m.useContext(SW))!=null?e:NW};m.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?kE.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",v=(j,b=!1,y=!0)=>{let S=o?o[j]:j,N=b?j+"|| ''":`'${S}'`,_="";return a&&y&&!b&&kE.includes(j)&&(_+=`d.style.colorScheme = '${j}';`),n==="class"?b||S?_+=`c.add(${N})`:_+="null":S&&(_+=`d[s](n,${N})`),_},x=e?`!function(){${h}${v(e)}}()`:r?`!function(){try{${h}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${f})){var t='${jW}',m=window.matchMedia(t);if(m.media!==t||m.matches){${v("dark")}}else{${v("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${v(o?"x[e]":"e",!0)}}${f?"":"else{"+v(i,!1,!1)+"}"}${p}}catch(e){}}()`:`!function(){try{${h}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${v(o?"x[e]":"e",!0)}}else{${v(i,!1,!1)};}${p}}catch(t){}}();`;return m.createElement("script",{nonce:d,dangerouslySetInnerHTML:{__html:x}})});var _W=e=>{switch(e){case"success":return EW;case"info":return TW;case"warning":return PW;case"error":return RW;default:return null}},AW=Array(12).fill(0),kW=({visible:e,className:t})=>X.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},X.createElement("div",{className:"sonner-spinner"},AW.map((n,r)=>X.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),EW=X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},X.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"})),PW=X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},X.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"})),TW=X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},X.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"})),RW=X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},X.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"})),OW=X.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"},X.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),X.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),MW=()=>{let[e,t]=X.useState(document.hidden);return X.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},ES=1,IW=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:ES++,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],X.isValidElement(d))a=!1,this.create({id:n,type:"default",message:d});else if(DW(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||ES++;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}},Xr=new IW,$W=(e,t)=>{let n=t?.id||ES++;return Xr.addToast({title:e,...t,id:n}),n},DW=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",LW=$W,FW=()=>Xr.toasts,zW=()=>Xr.getActiveToasts();Object.assign(LW,{success:Xr.success,info:Xr.info,warning:Xr.warning,error:Xr.error,custom:Xr.custom,message:Xr.message,promise:Xr.promise,dismiss:Xr.dismiss,loading:Xr.loading},{getHistory:FW,getToasts:zW});function BW(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))}BW(`: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 xh(e){return e.label!==void 0}var qW=3,UW="32px",WW="16px",EE=4e3,VW=356,HW=14,KW=20,GW=200;function aa(...e){return e.filter(Boolean).join(" ")}function YW(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var XW=e=>{var t,n,r,a,i,o,c,d,f,h,p;let{invert:v,toast:x,unstyled:j,interacting:b,setHeights:y,visibleToasts:S,heights:N,index:_,toasts:A,expanded:k,removeToast:E,defaultRichColors:P,closeButton:R,style:M,cancelButtonStyle:D,actionButtonStyle:U,className:F="",descriptionClassName:G="",duration:H,position:L,gap:I,loadingIcon:Y,expandByDefault:W,classNames:O,icons:Q,closeButtonAriaLabel:q="Close toast",pauseWhenPageIsHidden:z}=e,[K,J]=X.useState(null),[ne,he]=X.useState(null),[ie,me]=X.useState(!1),[se,ge]=X.useState(!1),[Oe,fe]=X.useState(!1),[xe,we]=X.useState(!1),[ot,lt]=X.useState(!1),[ut,At]=X.useState(0),[Xe,Se]=X.useState(0),Ae=X.useRef(x.duration||H||EE),Je=X.useRef(null),dt=X.useRef(null),Pt=_===0,Xt=_+1<=S,kt=x.type,nn=x.dismissible!==!1,Jt=x.className||"",zt=x.descriptionClassName||"",_e=X.useMemo(()=>N.findIndex($e=>$e.toastId===x.id)||0,[N,x.id]),Qe=X.useMemo(()=>{var $e;return($e=x.closeButton)!=null?$e:R},[x.closeButton,R]),Ze=X.useMemo(()=>x.duration||H||EE,[x.duration,H]),_t=X.useRef(0),Bt=X.useRef(0),ue=X.useRef(0),Ke=X.useRef(null),[De,re]=L.split("-"),Ne=X.useMemo(()=>N.reduce(($e,Ge,Ie)=>Ie>=_e?$e:$e+Ge.height,0),[N,_e]),Ue=MW(),B=x.invert||v,oe=kt==="loading";Bt.current=X.useMemo(()=>_e*I+Ne,[_e,Ne]),X.useEffect(()=>{Ae.current=Ze},[Ze]),X.useEffect(()=>{me(!0)},[]),X.useEffect(()=>{let $e=dt.current;if($e){let Ge=$e.getBoundingClientRect().height;return Se(Ge),y(Ie=>[{toastId:x.id,height:Ge,position:x.position},...Ie]),()=>y(Ie=>Ie.filter(V=>V.toastId!==x.id))}},[y,x.id]),X.useLayoutEffect(()=>{if(!ie)return;let $e=dt.current,Ge=$e.style.height;$e.style.height="auto";let Ie=$e.getBoundingClientRect().height;$e.style.height=Ge,Se(Ie),y(V=>V.find(ve=>ve.toastId===x.id)?V.map(ve=>ve.toastId===x.id?{...ve,height:Ie}:ve):[{toastId:x.id,height:Ie,position:x.position},...V])},[ie,x.title,x.description,y,x.id]);let de=X.useCallback(()=>{ge(!0),At(Bt.current),y($e=>$e.filter(Ge=>Ge.toastId!==x.id)),setTimeout(()=>{E(x)},GW)},[x,E,y,Bt]);X.useEffect(()=>{if(x.promise&&kt==="loading"||x.duration===1/0||x.type==="loading")return;let $e;return k||b||z&&Ue?(()=>{if(ue.current<_t.current){let Ge=new Date().getTime()-_t.current;Ae.current=Ae.current-Ge}ue.current=new Date().getTime()})():Ae.current!==1/0&&(_t.current=new Date().getTime(),$e=setTimeout(()=>{var Ge;(Ge=x.onAutoClose)==null||Ge.call(x,x),de()},Ae.current)),()=>clearTimeout($e)},[k,b,x,kt,z,Ue,de]),X.useEffect(()=>{x.delete&&de()},[de,x.delete]);function Le(){var $e,Ge,Ie;return Q!=null&&Q.loading?X.createElement("div",{className:aa(O?.loader,($e=x?.classNames)==null?void 0:$e.loader,"sonner-loader"),"data-visible":kt==="loading"},Q.loading):Y?X.createElement("div",{className:aa(O?.loader,(Ge=x?.classNames)==null?void 0:Ge.loader,"sonner-loader"),"data-visible":kt==="loading"},Y):X.createElement(kW,{className:aa(O?.loader,(Ie=x?.classNames)==null?void 0:Ie.loader),visible:kt==="loading"})}return X.createElement("li",{tabIndex:0,ref:dt,className:aa(F,Jt,O?.toast,(t=x?.classNames)==null?void 0:t.toast,O?.default,O?.[kt],(n=x?.classNames)==null?void 0:n[kt]),"data-sonner-toast":"","data-rich-colors":(r=x.richColors)!=null?r:P,"data-styled":!(x.jsx||x.unstyled||j),"data-mounted":ie,"data-promise":!!x.promise,"data-swiped":ot,"data-removed":se,"data-visible":Xt,"data-y-position":De,"data-x-position":re,"data-index":_,"data-front":Pt,"data-swiping":Oe,"data-dismissible":nn,"data-type":kt,"data-invert":B,"data-swipe-out":xe,"data-swipe-direction":ne,"data-expanded":!!(k||W&&ie),style:{"--index":_,"--toasts-before":_,"--z-index":A.length-_,"--offset":`${se?ut:Bt.current}px`,"--initial-height":W?"auto":`${Xe}px`,...M,...x.style},onDragEnd:()=>{fe(!1),J(null),Ke.current=null},onPointerDown:$e=>{oe||!nn||(Je.current=new Date,At(Bt.current),$e.target.setPointerCapture($e.pointerId),$e.target.tagName!=="BUTTON"&&(fe(!0),Ke.current={x:$e.clientX,y:$e.clientY}))},onPointerUp:()=>{var $e,Ge,Ie,V;if(xe||!nn)return;Ke.current=null;let ve=Number((($e=dt.current)==null?void 0:$e.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ee=Number(((Ge=dt.current)==null?void 0:Ge.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),tt=new Date().getTime()-((Ie=Je.current)==null?void 0:Ie.getTime()),te=K==="x"?ve:Ee,Fe=Math.abs(te)/tt;if(Math.abs(te)>=KW||Fe>.11){At(Bt.current),(V=x.onDismiss)==null||V.call(x,x),he(K==="x"?ve>0?"right":"left":Ee>0?"down":"up"),de(),we(!0),lt(!1);return}fe(!1),J(null)},onPointerMove:$e=>{var Ge,Ie,V,ve;if(!Ke.current||!nn||((Ge=window.getSelection())==null?void 0:Ge.toString().length)>0)return;let Ee=$e.clientY-Ke.current.y,tt=$e.clientX-Ke.current.x,te=(Ie=e.swipeDirections)!=null?Ie:YW(L);!K&&(Math.abs(tt)>1||Math.abs(Ee)>1)&&J(Math.abs(tt)>Math.abs(Ee)?"x":"y");let Fe={x:0,y:0};K==="y"?(te.includes("top")||te.includes("bottom"))&&(te.includes("top")&&Ee<0||te.includes("bottom")&&Ee>0)&&(Fe.y=Ee):K==="x"&&(te.includes("left")||te.includes("right"))&&(te.includes("left")&&tt<0||te.includes("right")&&tt>0)&&(Fe.x=tt),(Math.abs(Fe.x)>0||Math.abs(Fe.y)>0)&<(!0),(V=dt.current)==null||V.style.setProperty("--swipe-amount-x",`${Fe.x}px`),(ve=dt.current)==null||ve.style.setProperty("--swipe-amount-y",`${Fe.y}px`)}},Qe&&!x.jsx?X.createElement("button",{"aria-label":q,"data-disabled":oe,"data-close-button":!0,onClick:oe||!nn?()=>{}:()=>{var $e;de(),($e=x.onDismiss)==null||$e.call(x,x)},className:aa(O?.closeButton,(a=x?.classNames)==null?void 0:a.closeButton)},(i=Q?.close)!=null?i:OW):null,x.jsx||m.isValidElement(x.title)?x.jsx?x.jsx:typeof x.title=="function"?x.title():x.title:X.createElement(X.Fragment,null,kt||x.icon||x.promise?X.createElement("div",{"data-icon":"",className:aa(O?.icon,(o=x?.classNames)==null?void 0:o.icon)},x.promise||x.type==="loading"&&!x.icon?x.icon||Le():null,x.type!=="loading"?x.icon||Q?.[kt]||_W(kt):null):null,X.createElement("div",{"data-content":"",className:aa(O?.content,(c=x?.classNames)==null?void 0:c.content)},X.createElement("div",{"data-title":"",className:aa(O?.title,(d=x?.classNames)==null?void 0:d.title)},typeof x.title=="function"?x.title():x.title),x.description?X.createElement("div",{"data-description":"",className:aa(G,zt,O?.description,(f=x?.classNames)==null?void 0:f.description)},typeof x.description=="function"?x.description():x.description):null),m.isValidElement(x.cancel)?x.cancel:x.cancel&&xh(x.cancel)?X.createElement("button",{"data-button":!0,"data-cancel":!0,style:x.cancelButtonStyle||D,onClick:$e=>{var Ge,Ie;xh(x.cancel)&&nn&&((Ie=(Ge=x.cancel).onClick)==null||Ie.call(Ge,$e),de())},className:aa(O?.cancelButton,(h=x?.classNames)==null?void 0:h.cancelButton)},x.cancel.label):null,m.isValidElement(x.action)?x.action:x.action&&xh(x.action)?X.createElement("button",{"data-button":!0,"data-action":!0,style:x.actionButtonStyle||U,onClick:$e=>{var Ge,Ie;xh(x.action)&&((Ie=(Ge=x.action).onClick)==null||Ie.call(Ge,$e),!$e.defaultPrevented&&de())},className:aa(O?.actionButton,(p=x?.classNames)==null?void 0:p.actionButton)},x.action.label):null))};function PE(){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 QW(e,t){let n={};return[e,t].forEach((r,a)=>{let i=a===1,o=i?"--mobile-offset":"--offset",c=i?WW:UW;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 ZW=m.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:v,style:x,visibleToasts:j=qW,toastOptions:b,dir:y=PE(),gap:S=HW,loadingIcon:N,icons:_,containerAriaLabel:A="Notifications",pauseWhenPageIsHidden:k}=e,[E,P]=X.useState([]),R=X.useMemo(()=>Array.from(new Set([r].concat(E.filter(z=>z.position).map(z=>z.position)))),[E,r]),[M,D]=X.useState([]),[U,F]=X.useState(!1),[G,H]=X.useState(!1),[L,I]=X.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Y=X.useRef(null),W=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),O=X.useRef(null),Q=X.useRef(!1),q=X.useCallback(z=>{P(K=>{var J;return(J=K.find(ne=>ne.id===z.id))!=null&&J.delete||Xr.dismiss(z.id),K.filter(({id:ne})=>ne!==z.id)})},[]);return X.useEffect(()=>Xr.subscribe(z=>{if(z.dismiss){P(K=>K.map(J=>J.id===z.id?{...J,delete:!0}:J));return}setTimeout(()=>{lD.flushSync(()=>{P(K=>{let J=K.findIndex(ne=>ne.id===z.id);return J!==-1?[...K.slice(0,J),{...K[J],...z},...K.slice(J+1)]:[z,...K]})})})}),[]),X.useEffect(()=>{if(h!=="system"){I(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?I("dark"):I("light")),typeof window>"u")return;let z=window.matchMedia("(prefers-color-scheme: dark)");try{z.addEventListener("change",({matches:K})=>{I(K?"dark":"light")})}catch{z.addListener(({matches:J})=>{try{I(J?"dark":"light")}catch(ne){console.error(ne)}})}},[h]),X.useEffect(()=>{E.length<=1&&F(!1)},[E]),X.useEffect(()=>{let z=K=>{var J,ne;a.every(he=>K[he]||K.code===he)&&(F(!0),(J=Y.current)==null||J.focus()),K.code==="Escape"&&(document.activeElement===Y.current||(ne=Y.current)!=null&&ne.contains(document.activeElement))&&F(!1)};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[a]),X.useEffect(()=>{if(Y.current)return()=>{O.current&&(O.current.focus({preventScroll:!0}),O.current=null,Q.current=!1)}},[Y.current]),X.createElement("section",{ref:t,"aria-label":`${A} ${W}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map((z,K)=>{var J;let[ne,he]=z.split("-");return E.length?X.createElement("ol",{key:z,dir:y==="auto"?PE():y,tabIndex:-1,ref:Y,className:c,"data-sonner-toaster":!0,"data-theme":L,"data-y-position":ne,"data-lifted":U&&E.length>1&&!i,"data-x-position":he,style:{"--front-toast-height":`${((J=M[0])==null?void 0:J.height)||0}px`,"--width":`${VW}px`,"--gap":`${S}px`,...x,...QW(d,f)},onBlur:ie=>{Q.current&&!ie.currentTarget.contains(ie.relatedTarget)&&(Q.current=!1,O.current&&(O.current.focus({preventScroll:!0}),O.current=null))},onFocus:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||Q.current||(Q.current=!0,O.current=ie.relatedTarget)},onMouseEnter:()=>F(!0),onMouseMove:()=>F(!0),onMouseLeave:()=>{G||F(!1)},onDragEnd:()=>F(!1),onPointerDown:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||H(!0)},onPointerUp:()=>H(!1)},E.filter(ie=>!ie.position&&K===0||ie.position===z).map((ie,me)=>{var se,ge;return X.createElement(XW,{key:ie.id,icons:_,index:me,toast:ie,defaultRichColors:p,duration:(se=b?.duration)!=null?se:v,className:b?.className,descriptionClassName:b?.descriptionClassName,invert:n,visibleToasts:j,closeButton:(ge=b?.closeButton)!=null?ge:o,interacting:G,position:z,style:b?.style,unstyled:b?.unstyled,classNames:b?.classNames,cancelButtonStyle:b?.cancelButtonStyle,actionButtonStyle:b?.actionButtonStyle,removeToast:q,toasts:E.filter(Oe=>Oe.position==ie.position),heights:M.filter(Oe=>Oe.position==ie.position),setHeights:D,expandByDefault:i,gap:S,loadingIcon:N,expanded:U,pauseWhenPageIsHidden:k,swipeDirections:e.swipeDirections})})):null}))});const JW=({...e})=>{const{theme:t="system"}=CW();return s.jsx(ZW,{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 eV=vg[" useId ".trim().toString()]||(()=>{}),tV=0;function ar(e){const[t,n]=m.useState(eV());return ir(()=>{n(r=>r??String(tV++))},[e]),e||(t?`radix-${t}`:"")}const nV=["top","right","bottom","left"],vo=Math.min,ms=Math.max,Qh=Math.round,yh=Math.floor,Da=e=>({x:e,y:e}),rV={left:"right",right:"left",bottom:"top",top:"bottom"},sV={start:"end",end:"start"};function PS(e,t,n){return ms(e,vo(t,n))}function bi(e,t){return typeof e=="function"?e(t):e}function wi(e){return e.split("-")[0]}function ju(e){return e.split("-")[1]}function VN(e){return e==="x"?"y":"x"}function HN(e){return e==="y"?"height":"width"}const aV=new Set(["top","bottom"]);function Ia(e){return aV.has(wi(e))?"y":"x"}function KN(e){return VN(Ia(e))}function iV(e,t,n){n===void 0&&(n=!1);const r=ju(e),a=KN(e),i=HN(a);let o=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=Zh(o)),[o,Zh(o)]}function oV(e){const t=Zh(e);return[TS(e),t,TS(t)]}function TS(e){return e.replace(/start|end/g,t=>sV[t])}const TE=["left","right"],RE=["right","left"],lV=["top","bottom"],cV=["bottom","top"];function uV(e,t,n){switch(e){case"top":case"bottom":return n?t?RE:TE:t?TE:RE;case"left":case"right":return t?lV:cV;default:return[]}}function dV(e,t,n,r){const a=ju(e);let i=uV(wi(e),n==="start",r);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map(TS)))),i}function Zh(e){return e.replace(/left|right|bottom|top/g,t=>rV[t])}function fV(e){return{top:0,right:0,bottom:0,left:0,...e}}function n5(e){return typeof e!="number"?fV(e):{top:e,right:e,bottom:e,left:e}}function Jh(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 OE(e,t,n){let{reference:r,floating:a}=e;const i=Ia(t),o=KN(t),c=HN(o),d=wi(t),f=i==="y",h=r.x+r.width/2-a.width/2,p=r.y+r.height/2-a.height/2,v=r[c]/2-a[c]/2;let x;switch(d){case"top":x={x:h,y:r.y-a.height};break;case"bottom":x={x:h,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:p};break;case"left":x={x:r.x-a.width,y:p};break;default:x={x:r.x,y:r.y}}switch(ju(t)){case"start":x[o]-=v*(n&&f?-1:1);break;case"end":x[o]+=v*(n&&f?-1:1);break}return x}async function pV(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:v=!1,padding:x=0}=bi(t,e),j=n5(x),y=c[v?p==="floating"?"reference":"floating":p],S=Jh(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:f,rootBoundary:h,strategy:d})),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)),A=await(i.isElement==null?void 0:i.isElement(_))?await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1}:{x:1,y:1},k=Jh(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:N,offsetParent:_,strategy:d}):N);return{top:(S.top-k.top+j.top)/A.y,bottom:(k.bottom-S.bottom+j.bottom)/A.y,left:(S.left-k.left+j.left)/A.x,right:(k.right-S.right+j.right)/A.x}}const hV=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}=OE(f,r,d),v=r,x={},j=0;for(let y=0;y<c.length;y++){var b;const{name:S,fn:N}=c[y],{x:_,y:A,data:k,reset:E}=await N({x:h,y:p,initialPlacement:r,placement:v,strategy:a,middlewareData:x,rects:f,platform:{...o,detectOverflow:(b=o.detectOverflow)!=null?b:pV},elements:{reference:e,floating:t}});h=_??h,p=A??p,x={...x,[S]:{...x[S],...k}},E&&j<=50&&(j++,typeof E=="object"&&(E.placement&&(v=E.placement),E.rects&&(f=E.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:a}):E.rects),{x:h,y:p}=OE(f,v,d)),y=-1)}return{x:h,y:p,placement:v,strategy:a,middlewareData:x}},mV=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}=bi(e,t)||{};if(f==null)return{};const p=n5(h),v={x:n,y:r},x=KN(a),j=HN(x),b=await o.getDimensions(f),y=x==="y",S=y?"top":"left",N=y?"bottom":"right",_=y?"clientHeight":"clientWidth",A=i.reference[j]+i.reference[x]-v[x]-i.floating[j],k=v[x]-i.reference[x],E=await(o.getOffsetParent==null?void 0:o.getOffsetParent(f));let P=E?E[_]:0;(!P||!await(o.isElement==null?void 0:o.isElement(E)))&&(P=c.floating[_]||i.floating[j]);const R=A/2-k/2,M=P/2-b[j]/2-1,D=vo(p[S],M),U=vo(p[N],M),F=D,G=P-b[j]-U,H=P/2-b[j]/2+R,L=PS(F,H,G),I=!d.arrow&&ju(a)!=null&&H!==L&&i.reference[j]/2-(H<F?D:U)-b[j]/2<0,Y=I?H<F?H-F:H-G:0;return{[x]:v[x]+Y,data:{[x]:L,centerOffset:H-L-Y,...I&&{alignmentOffset:Y}},reset:I}}}),gV=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:v,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:j="none",flipAlignment:b=!0,...y}=bi(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const S=wi(a),N=Ia(c),_=wi(c)===c,A=await(d.isRTL==null?void 0:d.isRTL(f.floating)),k=v||(_||!b?[Zh(c)]:oV(c)),E=j!=="none";!v&&E&&k.push(...dV(c,b,j,A));const P=[c,...k],R=await d.detectOverflow(t,y),M=[];let D=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&M.push(R[S]),p){const H=iV(a,o,A);M.push(R[H[0]],R[H[1]])}if(D=[...D,{placement:a,overflows:M}],!M.every(H=>H<=0)){var U,F;const H=(((U=i.flip)==null?void 0:U.index)||0)+1,L=P[H];if(L&&(!(p==="alignment"?N!==Ia(L):!1)||D.every(W=>Ia(W.placement)===N?W.overflows[0]>0:!0)))return{data:{index:H,overflows:D},reset:{placement:L}};let I=(F=D.filter(Y=>Y.overflows[0]<=0).sort((Y,W)=>Y.overflows[1]-W.overflows[1])[0])==null?void 0:F.placement;if(!I)switch(x){case"bestFit":{var G;const Y=(G=D.filter(W=>{if(E){const O=Ia(W.placement);return O===N||O==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(O=>O>0).reduce((O,Q)=>O+Q,0)]).sort((W,O)=>W[1]-O[1])[0])==null?void 0:G[0];Y&&(I=Y);break}case"initialPlacement":I=c;break}if(a!==I)return{reset:{placement:I}}}return{}}}};function ME(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function IE(e){return nV.some(t=>e[t]>=0)}const vV=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...i}=bi(e,t);switch(a){case"referenceHidden":{const o=await r.detectOverflow(t,{...i,elementContext:"reference"}),c=ME(o,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:IE(c)}}}case"escaped":{const o=await r.detectOverflow(t,{...i,altBoundary:!0}),c=ME(o,n.floating);return{data:{escapedOffsets:c,escaped:IE(c)}}}default:return{}}}}},r5=new Set(["left","top"]);async function xV(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),o=wi(n),c=ju(n),d=Ia(n)==="y",f=r5.has(o)?-1:1,h=i&&d?-1:1,p=bi(t,e);let{mainAxis:v,crossAxis:x,alignmentAxis:j}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof j=="number"&&(x=c==="end"?j*-1:j),d?{x:x*h,y:v*f}:{x:v*f,y:x*h}}const yV=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 xV(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}}}}},bV=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}=bi(e,t),h={x:n,y:r},p=await i.detectOverflow(t,f),v=Ia(wi(a)),x=VN(v);let j=h[x],b=h[v];if(o){const S=x==="y"?"top":"left",N=x==="y"?"bottom":"right",_=j+p[S],A=j-p[N];j=PS(_,j,A)}if(c){const S=v==="y"?"top":"left",N=v==="y"?"bottom":"right",_=b+p[S],A=b-p[N];b=PS(_,b,A)}const y=d.fn({...t,[x]:j,[v]:b});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[x]:o,[v]:c}}}}}},wV=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}=bi(e,t),h={x:n,y:r},p=Ia(a),v=VN(p);let x=h[v],j=h[p];const b=bi(c,t),y=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(d){const _=v==="y"?"height":"width",A=i.reference[v]-i.floating[_]+y.mainAxis,k=i.reference[v]+i.reference[_]-y.mainAxis;x<A?x=A:x>k&&(x=k)}if(f){var S,N;const _=v==="y"?"width":"height",A=r5.has(wi(a)),k=i.reference[p]-i.floating[_]+(A&&((S=o.offset)==null?void 0:S[p])||0)+(A?0:y.crossAxis),E=i.reference[p]+i.reference[_]+(A?0:((N=o.offset)==null?void 0:N[p])||0)-(A?y.crossAxis:0);j<k?j=k:j>E&&(j=E)}return{[v]:x,[p]:j}}}},jV=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}=bi(e,t),h=await o.detectOverflow(t,f),p=wi(a),v=ju(a),x=Ia(a)==="y",{width:j,height:b}=i.floating;let y,S;p==="top"||p==="bottom"?(y=p,S=v===(await(o.isRTL==null?void 0:o.isRTL(c.floating))?"start":"end")?"left":"right"):(S=p,y=v==="end"?"top":"bottom");const N=b-h.top-h.bottom,_=j-h.left-h.right,A=vo(b-h[y],N),k=vo(j-h[S],_),E=!t.middlewareData.shift;let P=A,R=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=N),E&&!v){const D=ms(h.left,0),U=ms(h.right,0),F=ms(h.top,0),G=ms(h.bottom,0);x?R=j-2*(D!==0||U!==0?D+U:ms(h.left,h.right)):P=b-2*(F!==0||G!==0?F+G:ms(h.top,h.bottom))}await d({...t,availableWidth:R,availableHeight:P});const M=await o.getDimensions(c.floating);return j!==M.width||b!==M.height?{reset:{rects:!0}}:{}}}};function jg(){return typeof window<"u"}function Su(e){return s5(e)?(e.nodeName||"").toLowerCase():"#document"}function ys(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Va(e){var t;return(t=(s5(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function s5(e){return jg()?e instanceof Node||e instanceof ys(e).Node:!1}function ya(e){return jg()?e instanceof Element||e instanceof ys(e).Element:!1}function Ba(e){return jg()?e instanceof HTMLElement||e instanceof ys(e).HTMLElement:!1}function $E(e){return!jg()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ys(e).ShadowRoot}const SV=new Set(["inline","contents"]);function Bf(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=ba(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!SV.has(a)}const NV=new Set(["table","td","th"]);function CV(e){return NV.has(Su(e))}const _V=[":popover-open",":modal"];function Sg(e){return _V.some(t=>{try{return e.matches(t)}catch{return!1}})}const AV=["transform","translate","scale","rotate","perspective"],kV=["transform","translate","scale","rotate","perspective","filter"],EV=["paint","layout","strict","content"];function GN(e){const t=YN(),n=ya(e)?ba(e):e;return AV.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)||kV.some(r=>(n.willChange||"").includes(r))||EV.some(r=>(n.contain||"").includes(r))}function PV(e){let t=xo(e);for(;Ba(t)&&!Wc(t);){if(GN(t))return t;if(Sg(t))return null;t=xo(t)}return null}function YN(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const TV=new Set(["html","body","#document"]);function Wc(e){return TV.has(Su(e))}function ba(e){return ys(e).getComputedStyle(e)}function Ng(e){return ya(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xo(e){if(Su(e)==="html")return e;const t=e.assignedSlot||e.parentNode||$E(e)&&e.host||Va(e);return $E(t)?t.host:t}function a5(e){const t=xo(e);return Wc(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ba(t)&&Bf(t)?t:a5(t)}function Kd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=a5(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),o=ys(a);if(i){const c=RS(o);return t.concat(o,o.visualViewport||[],Bf(a)?a:[],c&&n?Kd(c):[])}return t.concat(a,Kd(a,[],n))}function RS(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function i5(e){const t=ba(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Ba(e),i=a?e.offsetWidth:n,o=a?e.offsetHeight:r,c=Qh(n)!==i||Qh(r)!==o;return c&&(n=i,r=o),{width:n,height:r,$:c}}function XN(e){return ya(e)?e:e.contextElement}function Ic(e){const t=XN(e);if(!Ba(t))return Da(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=i5(t);let o=(i?Qh(n.width):n.width)/r,c=(i?Qh(n.height):n.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!c||!Number.isFinite(c))&&(c=1),{x:o,y:c}}const RV=Da(0);function o5(e){const t=ys(e);return!YN()||!t.visualViewport?RV:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function OV(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ys(e)?!1:t}function ml(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=XN(e);let o=Da(1);t&&(r?ya(r)&&(o=Ic(r)):o=Ic(e));const c=OV(i,n,r)?o5(i):Da(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 v=ys(i),x=r&&ya(r)?ys(r):r;let j=v,b=RS(j);for(;b&&r&&x!==j;){const y=Ic(b),S=b.getBoundingClientRect(),N=ba(b),_=S.left+(b.clientLeft+parseFloat(N.paddingLeft))*y.x,A=S.top+(b.clientTop+parseFloat(N.paddingTop))*y.y;d*=y.x,f*=y.y,h*=y.x,p*=y.y,d+=_,f+=A,j=ys(b),b=RS(j)}}return Jh({width:h,height:p,x:d,y:f})}function Cg(e,t){const n=Ng(e).scrollLeft;return t?t.left+n:ml(Va(e)).left+n}function l5(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Cg(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function MV(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",o=Va(r),c=t?Sg(t.floating):!1;if(r===o||c&&i)return n;let d={scrollLeft:0,scrollTop:0},f=Da(1);const h=Da(0),p=Ba(r);if((p||!p&&!i)&&((Su(r)!=="body"||Bf(o))&&(d=Ng(r)),Ba(r))){const x=ml(r);f=Ic(r),h.x=x.x+r.clientLeft,h.y=x.y+r.clientTop}const v=o&&!p&&!i?l5(o,d):Da(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+h.x+v.x,y:n.y*f.y-d.scrollTop*f.y+h.y+v.y}}function IV(e){return Array.from(e.getClientRects())}function $V(e){const t=Va(e),n=Ng(e),r=e.ownerDocument.body,a=ms(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=ms(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Cg(e);const c=-n.scrollTop;return ba(r).direction==="rtl"&&(o+=ms(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:o,y:c}}const DE=25;function DV(e,t){const n=ys(e),r=Va(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=YN();(!h||h&&t==="fixed")&&(c=a.offsetLeft,d=a.offsetTop)}const f=Cg(r);if(f<=0){const h=r.ownerDocument,p=h.body,v=getComputedStyle(p),x=h.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,j=Math.abs(r.clientWidth-p.clientWidth-x);j<=DE&&(i-=j)}else f<=DE&&(i+=f);return{width:i,height:o,x:c,y:d}}const LV=new Set(["absolute","fixed"]);function FV(e,t){const n=ml(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=Ba(e)?Ic(e):Da(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 LE(e,t,n){let r;if(t==="viewport")r=DV(e,n);else if(t==="document")r=$V(Va(e));else if(ya(t))r=FV(t,n);else{const a=o5(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Jh(r)}function c5(e,t){const n=xo(e);return n===t||!ya(n)||Wc(n)?!1:ba(n).position==="fixed"||c5(n,t)}function zV(e,t){const n=t.get(e);if(n)return n;let r=Kd(e,[],!1).filter(c=>ya(c)&&Su(c)!=="body"),a=null;const i=ba(e).position==="fixed";let o=i?xo(e):e;for(;ya(o)&&!Wc(o);){const c=ba(o),d=GN(o);!d&&c.position==="fixed"&&(a=null),(i?!d&&!a:!d&&c.position==="static"&&!!a&&LV.has(a.position)||Bf(o)&&!d&&c5(e,o))?r=r.filter(h=>h!==o):a=c,o=xo(o)}return t.set(e,r),r}function BV(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const o=[...n==="clippingAncestors"?Sg(t)?[]:zV(t,this._c):[].concat(n),r],c=o[0],d=o.reduce((f,h)=>{const p=LE(t,h,a);return f.top=ms(p.top,f.top),f.right=vo(p.right,f.right),f.bottom=vo(p.bottom,f.bottom),f.left=ms(p.left,f.left),f},LE(t,c,a));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function qV(e){const{width:t,height:n}=i5(e);return{width:t,height:n}}function UV(e,t,n){const r=Ba(t),a=Va(t),i=n==="fixed",o=ml(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const d=Da(0);function f(){d.x=Cg(a)}if(r||!r&&!i)if((Su(t)!=="body"||Bf(a))&&(c=Ng(t)),r){const x=ml(t,!0,i,t);d.x=x.x+t.clientLeft,d.y=x.y+t.clientTop}else a&&f();i&&!r&&a&&f();const h=a&&!r&&!i?l5(a,c):Da(0),p=o.left+c.scrollLeft-d.x-h.x,v=o.top+c.scrollTop-d.y-h.y;return{x:p,y:v,width:o.width,height:o.height}}function $y(e){return ba(e).position==="static"}function FE(e,t){if(!Ba(e)||ba(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Va(e)===n&&(n=n.ownerDocument.body),n}function u5(e,t){const n=ys(e);if(Sg(e))return n;if(!Ba(e)){let a=xo(e);for(;a&&!Wc(a);){if(ya(a)&&!$y(a))return a;a=xo(a)}return n}let r=FE(e,t);for(;r&&CV(r)&&$y(r);)r=FE(r,t);return r&&Wc(r)&&$y(r)&&!GN(r)?n:r||PV(e)||n}const WV=async function(e){const t=this.getOffsetParent||u5,n=this.getDimensions,r=await n(e.floating);return{reference:UV(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function VV(e){return ba(e).direction==="rtl"}const HV={convertOffsetParentRelativeRectToViewportRelativeRect:MV,getDocumentElement:Va,getClippingRect:BV,getOffsetParent:u5,getElementRects:WV,getClientRects:IV,getDimensions:qV,getScale:Ic,isElement:ya,isRTL:VV};function d5(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function KV(e,t){let n=null,r;const a=Va(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:v,height:x}=f;if(c||t(),!v||!x)return;const j=yh(p),b=yh(a.clientWidth-(h+v)),y=yh(a.clientHeight-(p+x)),S=yh(h),_={rootMargin:-j+"px "+-b+"px "+-y+"px "+-S+"px",threshold:ms(0,vo(1,d))||1};let A=!0;function k(E){const P=E[0].intersectionRatio;if(P!==d){if(!A)return o();P?o(!1,P):r=setTimeout(()=>{o(!1,1e-7)},1e3)}P===1&&!d5(f,e.getBoundingClientRect())&&o(),A=!1}try{n=new IntersectionObserver(k,{..._,root:a.ownerDocument})}catch{n=new IntersectionObserver(k,_)}n.observe(e)}return o(!0),i}function GV(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=XN(e),h=a||i?[...f?Kd(f):[],...Kd(t)]:[];h.forEach(S=>{a&&S.addEventListener("scroll",n,{passive:!0}),i&&S.addEventListener("resize",n)});const p=f&&c?KV(f,n):null;let v=-1,x=null;o&&(x=new ResizeObserver(S=>{let[N]=S;N&&N.target===f&&x&&(x.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var _;(_=x)==null||_.observe(t)})),n()}),f&&!d&&x.observe(f),x.observe(t));let j,b=d?ml(e):null;d&&y();function y(){const S=ml(e);b&&!d5(b,S)&&n(),b=S,j=requestAnimationFrame(y)}return n(),()=>{var S;h.forEach(N=>{a&&N.removeEventListener("scroll",n),i&&N.removeEventListener("resize",n)}),p?.(),(S=x)==null||S.disconnect(),x=null,d&&cancelAnimationFrame(j)}}const YV=yV,XV=bV,QV=gV,ZV=jV,JV=vV,zE=mV,eH=wV,tH=(e,t,n)=>{const r=new Map,a={platform:HV,...n},i={...a.platform,_c:r};return hV(e,t,{...a,platform:i})};var nH=typeof document<"u",rH=function(){},Wh=nH?m.useLayoutEffect:rH;function em(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(!em(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)&&!em(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function f5(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function BE(e,t){const n=f5(e);return Math.round(t*n)/n}function Dy(e){const t=m.useRef(e);return Wh(()=>{t.current=e}),t}function sH(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]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,x]=m.useState(r);em(v,r)||x(r);const[j,b]=m.useState(null),[y,S]=m.useState(null),N=m.useCallback(W=>{W!==E.current&&(E.current=W,b(W))},[]),_=m.useCallback(W=>{W!==P.current&&(P.current=W,S(W))},[]),A=i||j,k=o||y,E=m.useRef(null),P=m.useRef(null),R=m.useRef(h),M=d!=null,D=Dy(d),U=Dy(a),F=Dy(f),G=m.useCallback(()=>{if(!E.current||!P.current)return;const W={placement:t,strategy:n,middleware:v};U.current&&(W.platform=U.current),tH(E.current,P.current,W).then(O=>{const Q={...O,isPositioned:F.current!==!1};H.current&&!em(R.current,Q)&&(R.current=Q,bu.flushSync(()=>{p(Q)}))})},[v,t,n,U,F]);Wh(()=>{f===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,p(W=>({...W,isPositioned:!1})))},[f]);const H=m.useRef(!1);Wh(()=>(H.current=!0,()=>{H.current=!1}),[]),Wh(()=>{if(A&&(E.current=A),k&&(P.current=k),A&&k){if(D.current)return D.current(A,k,G);G()}},[A,k,G,D,M]);const L=m.useMemo(()=>({reference:E,floating:P,setReference:N,setFloating:_}),[N,_]),I=m.useMemo(()=>({reference:A,floating:k}),[A,k]),Y=m.useMemo(()=>{const W={position:n,left:0,top:0};if(!I.floating)return W;const O=BE(I.floating,h.x),Q=BE(I.floating,h.y);return c?{...W,transform:"translate("+O+"px, "+Q+"px)",...f5(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:O,top:Q}},[n,c,I.floating,h.x,h.y]);return m.useMemo(()=>({...h,update:G,refs:L,elements:I,floatingStyles:Y}),[h,G,L,I,Y])}const aH=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?zE({element:r.current,padding:a}).fn(n):{}:r?zE({element:r,padding:a}).fn(n):{}}}},iH=(e,t)=>({...YV(e),options:[e,t]}),oH=(e,t)=>({...XV(e),options:[e,t]}),lH=(e,t)=>({...eH(e),options:[e,t]}),cH=(e,t)=>({...QV(e),options:[e,t]}),uH=(e,t)=>({...ZV(e),options:[e,t]}),dH=(e,t)=>({...JV(e),options:[e,t]}),fH=(e,t)=>({...aH(e),options:[e,t]});var pH="Arrow",p5=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return s.jsx(ft.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"})})});p5.displayName=pH;var hH=p5;function _g(e){const[t,n]=m.useState(void 0);return ir(()=>{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 QN="Popper",[h5,jo]=Sr(QN),[mH,m5]=h5(QN),g5=e=>{const{__scopePopper:t,children:n}=e,[r,a]=m.useState(null);return s.jsx(mH,{scope:t,anchor:r,onAnchorChange:a,children:n})};g5.displayName=QN;var v5="PopperAnchor",x5=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=m5(v5,n),o=m.useRef(null),c=Mt(t,o),d=m.useRef(null);return m.useEffect(()=>{const f=d.current;d.current=r?.current||o.current,f!==d.current&&i.onAnchorChange(d.current)}),r?null:s.jsx(ft.div,{...a,ref:c})});x5.displayName=v5;var ZN="PopperContent",[gH,vH]=h5(ZN),y5=m.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:v=!1,updatePositionStrategy:x="optimized",onPlaced:j,...b}=e,y=m5(ZN,n),[S,N]=m.useState(null),_=Mt(t,ie=>N(ie)),[A,k]=m.useState(null),E=_g(A),P=E?.width??0,R=E?.height??0,M=r+(i!=="center"?"-"+i:""),D=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},U=Array.isArray(f)?f:[f],F=U.length>0,G={padding:D,boundary:U.filter(yH),altBoundary:F},{refs:H,floatingStyles:L,placement:I,isPositioned:Y,middlewareData:W}=sH({strategy:"fixed",placement:M,whileElementsMounted:(...ie)=>GV(...ie,{animationFrame:x==="always"}),elements:{reference:y.anchor},middleware:[iH({mainAxis:a+R,alignmentAxis:o}),d&&oH({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?lH():void 0,...G}),d&&cH({...G}),uH({...G,apply:({elements:ie,rects:me,availableWidth:se,availableHeight:ge})=>{const{width:Oe,height:fe}=me.reference,xe=ie.floating.style;xe.setProperty("--radix-popper-available-width",`${se}px`),xe.setProperty("--radix-popper-available-height",`${ge}px`),xe.setProperty("--radix-popper-anchor-width",`${Oe}px`),xe.setProperty("--radix-popper-anchor-height",`${fe}px`)}}),A&&fH({element:A,padding:c}),bH({arrowWidth:P,arrowHeight:R}),v&&dH({strategy:"referenceHidden",...G})]}),[O,Q]=j5(I),q=Gn(j);ir(()=>{Y&&q?.()},[Y,q]);const z=W.arrow?.x,K=W.arrow?.y,J=W.arrow?.centerOffset!==0,[ne,he]=m.useState();return ir(()=>{S&&he(window.getComputedStyle(S).zIndex)},[S]),s.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...L,transform:Y?L.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[W.transformOrigin?.x,W.transformOrigin?.y].join(" "),...W.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(gH,{scope:n,placedSide:O,onArrowChange:k,arrowX:z,arrowY:K,shouldHideArrow:J,children:s.jsx(ft.div,{"data-side":O,"data-align":Q,...b,ref:_,style:{...b.style,animation:Y?void 0:"none"}})})})});y5.displayName=ZN;var b5="PopperArrow",xH={top:"bottom",right:"left",bottom:"top",left:"right"},w5=m.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=vH(b5,r),o=xH[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(hH,{...a,ref:n,style:{...a.style,display:"block"}})})});w5.displayName=b5;function yH(e){return e!==null}var bH=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]=j5(n),p={start:"0%",center:"50%",end:"100%"}[h],v=(a.arrow?.x??0)+c/2,x=(a.arrow?.y??0)+d/2;let j="",b="";return f==="bottom"?(j=o?p:`${v}px`,b=`${-d}px`):f==="top"?(j=o?p:`${v}px`,b=`${r.floating.height+d}px`):f==="right"?(j=`${-d}px`,b=o?p:`${x}px`):f==="left"&&(j=`${r.floating.width+d}px`,b=o?p:`${x}px`),{data:{x:j,y:b}}}});function j5(e){const[t,n="center"]=e.split("-");return[t,n]}var Ag=g5,qf=x5,kg=y5,Eg=w5,wH=Symbol("radix.slottable");function jH(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=wH,t}var[Pg]=Sr("Tooltip",[jo]),Tg=jo(),S5="TooltipProvider",SH=700,OS="tooltip.open",[NH,JN]=Pg(S5),N5=e=>{const{__scopeTooltip:t,delayDuration:n=SH,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:i}=e,o=m.useRef(!0),c=m.useRef(!1),d=m.useRef(0);return m.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),s.jsx(NH,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(d.current),o.current=!1},[]),onClose:m.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:m.useCallback(f=>{c.current=f},[]),disableHoverableContent:a,children:i})};N5.displayName=S5;var Gd="Tooltip",[CH,Uf]=Pg(Gd),C5=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:i,disableHoverableContent:o,delayDuration:c}=e,d=JN(Gd,e.__scopeTooltip),f=Tg(t),[h,p]=m.useState(null),v=ar(),x=m.useRef(0),j=o??d.disableHoverableContent,b=c??d.delayDuration,y=m.useRef(!1),[S,N]=js({prop:r,defaultProp:a??!1,onChange:P=>{P?(d.onOpen(),document.dispatchEvent(new CustomEvent(OS))):d.onClose(),i?.(P)},caller:Gd}),_=m.useMemo(()=>S?y.current?"delayed-open":"instant-open":"closed",[S]),A=m.useCallback(()=>{window.clearTimeout(x.current),x.current=0,y.current=!1,N(!0)},[N]),k=m.useCallback(()=>{window.clearTimeout(x.current),x.current=0,N(!1)},[N]),E=m.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{y.current=!0,N(!0),x.current=0},b)},[b,N]);return m.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),s.jsx(Ag,{...f,children:s.jsx(CH,{scope:t,contentId:v,open:S,stateAttribute:_,trigger:h,onTriggerChange:p,onTriggerEnter:m.useCallback(()=>{d.isOpenDelayedRef.current?E():A()},[d.isOpenDelayedRef,E,A]),onTriggerLeave:m.useCallback(()=>{j?k():(window.clearTimeout(x.current),x.current=0)},[k,j]),onOpen:A,onClose:k,disableHoverableContent:j,children:n})})};C5.displayName=Gd;var MS="TooltipTrigger",_5=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Uf(MS,n),i=JN(MS,n),o=Tg(n),c=m.useRef(null),d=Mt(t,c,a.onTriggerChange),f=m.useRef(!1),h=m.useRef(!1),p=m.useCallback(()=>f.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),s.jsx(qf,{asChild:!0,...o,children:s.jsx(ft.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:d,onPointerMove:qe(e.onPointerMove,v=>{v.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),h.current=!0)}),onPointerLeave:qe(e.onPointerLeave,()=>{a.onTriggerLeave(),h.current=!1}),onPointerDown:qe(e.onPointerDown,()=>{a.open&&a.onClose(),f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:qe(e.onFocus,()=>{f.current||a.onOpen()}),onBlur:qe(e.onBlur,a.onClose),onClick:qe(e.onClick,a.onClose)})})});_5.displayName=MS;var eC="TooltipPortal",[_H,AH]=Pg(eC,{forceMount:void 0}),A5=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:a}=e,i=Uf(eC,t);return s.jsx(_H,{scope:t,forceMount:n,children:s.jsx(Zn,{present:n||i.open,children:s.jsx(Rl,{asChild:!0,container:a,children:r})})})};A5.displayName=eC;var Vc="TooltipContent",k5=m.forwardRef((e,t)=>{const n=AH(Vc,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...i}=e,o=Uf(Vc,e.__scopeTooltip);return s.jsx(Zn,{present:r||o.open,children:o.disableHoverableContent?s.jsx(E5,{side:a,...i,ref:t}):s.jsx(kH,{side:a,...i,ref:t})})}),kH=m.forwardRef((e,t)=>{const n=Uf(Vc,e.__scopeTooltip),r=JN(Vc,e.__scopeTooltip),a=m.useRef(null),i=Mt(t,a),[o,c]=m.useState(null),{trigger:d,onClose:f}=n,h=a.current,{onPointerInTransitChange:p}=r,v=m.useCallback(()=>{c(null),p(!1)},[p]),x=m.useCallback((j,b)=>{const y=j.currentTarget,S={x:j.clientX,y:j.clientY},N=OH(S,y.getBoundingClientRect()),_=MH(S,N),A=IH(b.getBoundingClientRect()),k=DH([..._,...A]);c(k),p(!0)},[p]);return m.useEffect(()=>()=>v(),[v]),m.useEffect(()=>{if(d&&h){const j=y=>x(y,h),b=y=>x(y,d);return d.addEventListener("pointerleave",j),h.addEventListener("pointerleave",b),()=>{d.removeEventListener("pointerleave",j),h.removeEventListener("pointerleave",b)}}},[d,h,x,v]),m.useEffect(()=>{if(o){const j=b=>{const y=b.target,S={x:b.clientX,y:b.clientY},N=d?.contains(y)||h?.contains(y),_=!$H(S,o);N?v():_&&(v(),f())};return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[d,h,o,f,v]),s.jsx(E5,{...e,ref:i})}),[EH,PH]=Pg(Gd,{isInside:!1}),TH=jH("TooltipContent"),E5=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:o,...c}=e,d=Uf(Vc,n),f=Tg(n),{onClose:h}=d;return m.useEffect(()=>(document.addEventListener(OS,h),()=>document.removeEventListener(OS,h)),[h]),m.useEffect(()=>{if(d.trigger){const p=v=>{v.target?.contains(d.trigger)&&h()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[d.trigger,h]),s.jsx(Tl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:p=>p.preventDefault(),onDismiss:h,children:s.jsxs(kg,{"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(TH,{children:r}),s.jsx(EH,{scope:n,isInside:!0,children:s.jsx(n9,{id:d.contentId,role:"tooltip",children:a||r})})]})})});k5.displayName=Vc;var P5="TooltipArrow",RH=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Tg(n);return PH(P5,n).isInside?null:s.jsx(Eg,{...a,...r,ref:t})});RH.displayName=P5;function OH(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 MH(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 IH(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 $H(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,v=d.y;h>r!=v>r&&n<(p-f)*(r-h)/(v-h)+f&&(a=!a)}return a}function DH(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),LH(t)}function LH(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 FH=N5,zH=C5,BH=_5,qH=A5,T5=k5;const ji=FH,Si=zH,Ni=BH,qa=m.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(qH,{children:s.jsx(T5,{ref:r,sideOffset:t,className:Re("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})}));qa.displayName=T5.displayName;var Rg=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(){}},UH=class extends Rg{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},R5=new UH,WH={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},VH=class{#e=WH;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},IS=new VH;function HH(e){setTimeout(e,0)}var KH=typeof window>"u"||"Deno"in globalThis;function la(){}function GH(e,t){return typeof e=="function"?e(t):e}function YH(e){return typeof e=="number"&&e>=0&&e!==1/0}function XH(e,t){return Math.max(e+(t||0)-Date.now(),0)}function $S(e,t){return typeof e=="function"?e(t):e}function QH(e,t){return typeof e=="function"?e(t):e}function qE(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:i,queryKey:o,stale:c}=e;if(o){if(r){if(t.queryHash!==tC(o,t.options))return!1}else if(!Xd(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 UE(e,t){const{exact:n,status:r,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Yd(t.options.mutationKey)!==Yd(i))return!1}else if(!Xd(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function tC(e,t){return(t?.queryKeyHashFn||Yd)(e)}function Yd(e){return JSON.stringify(e,(t,n)=>DS(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function Xd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Xd(e[n],t[n])):!1}var ZH=Object.prototype.hasOwnProperty;function O5(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=WE(e)&&WE(t);if(!r&&!(DS(e)&&DS(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],v=e[p],x=t[p];if(v===x){d[p]=v,(r?h<i:ZH.call(e,p))&&f++;continue}if(v===null||x===null||typeof v!="object"||typeof x!="object"){d[p]=x;continue}const j=O5(v,x,n+1);d[p]=j,j===v&&f++}return i===c&&f===i?e:d}function WE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function DS(e){if(!VE(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!VE(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function VE(e){return Object.prototype.toString.call(e)==="[object Object]"}function JH(e){return new Promise(t=>{IS.setTimeout(t,e)})}function eK(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?O5(e,t):t}function tK(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function nK(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var nC=Symbol();function M5(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===nC?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function rK(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 I5=(()=>{let e=()=>KH;return{isServer(){return e()},setIsServer(t){e=t}}})();function sK(){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 aK=HH;function iK(){let e=[],t=0,n=c=>{c()},r=c=>{c()},a=aK;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 Or=iK(),oK=class extends Rg{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},tm=new oK;function lK(e){return Math.min(1e3*2**e,3e4)}function $5(e){return(e??"online")==="online"?tm.isOnline():!0}var LS=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function D5(e){let t=!1,n=0,r;const a=sK(),i=()=>a.status!=="pending",o=b=>{if(!i()){const y=new LS(b);v(y),e.onCancel?.(y)}},c=()=>{t=!0},d=()=>{t=!1},f=()=>R5.isFocused()&&(e.networkMode==="always"||tm.isOnline())&&e.canRun(),h=()=>$5(e.networkMode)&&e.canRun(),p=b=>{i()||(r?.(),a.resolve(b))},v=b=>{i()||(r?.(),a.reject(b))},x=()=>new Promise(b=>{r=y=>{(i()||f())&&b(y)},e.onPause?.()}).then(()=>{r=void 0,i()||e.onContinue?.()}),j=()=>{if(i())return;let b;const y=n===0?e.initialPromise:void 0;try{b=y??e.fn()}catch(S){b=Promise.reject(S)}Promise.resolve(b).then(p).catch(S=>{if(i())return;const N=e.retry??(I5.isServer()?0:3),_=e.retryDelay??lK,A=typeof _=="function"?_(n,S):_,k=N===!0||typeof N=="number"&&n<N||typeof N=="function"&&N(n,S);if(t||!k){v(S);return}n++,e.onFail?.(n,S),JH(A).then(()=>f()?void 0:x()).then(()=>{t?v(S):j()})})};return{promise:a,status:()=>a.status,cancel:o,continue:()=>(r?.(),a),cancelRetry:c,continueRetry:d,canStart:h,start:()=>(h()?j():x().then(j),a)}}var L5=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),YH(this.gcTime)&&(this.#e=IS.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(I5.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(IS.clearTimeout(this.#e),this.#e=void 0)}};function cK(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=>{rK(j,()=>t.signal,()=>h=!0)},v=M5(t.options,t.fetchOptions),x=async(j,b,y)=>{if(h)return Promise.reject(t.signal.reason);if(b==null&&j.pages.length)return Promise.resolve(j);const N=(()=>{const E={client:t.client,queryKey:t.queryKey,pageParam:b,direction:y?"backward":"forward",meta:t.options.meta};return p(E),E})(),_=await v(N),{maxPages:A}=t.options,k=y?nK:tK;return{pages:k(j.pages,_,A),pageParams:k(j.pageParams,b,A)}};if(a&&i.length){const j=a==="backward",b=j?uK:HE,y={pages:i,pageParams:o},S=b(r,y);c=await x(y,S,j)}else{const j=e??i.length;do{const b=d===0?o[0]??r.initialPageParam:HE(r,c);if(d>0&&b==null)break;c=await x(c,b),d++}while(d<j)}return c};t.options.persister?t.fetchFn=()=>t.options.persister?.(f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=f}}}function HE(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 uK(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var dK=class extends L5{#e;#t;#n;#s;#a;#r;#l;#i;constructor(e){super(),this.#i=!1,this.#l=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#a=e.client,this.#s=this.#a.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=GE(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#l,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=GE(this.options);t.data!==void 0&&(this.setState(KE(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#s.remove(this)}setData(e,t){const n=eK(this.state.data,e,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#o({type:"setState",state:e})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(la).catch(la):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>QH(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===nC||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>$S(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:!XH(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.#s.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#i||this.#c()?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#s.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const d=this.observers.find(f=>f.options.queryFn);d&&this.setOptions(d.options)}const n=new AbortController,r=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(this.#i=!0,n.signal)})},a=()=>{const d=M5(this.options,t),h=(()=>{const p={client:this.#a,queryKey:this.queryKey,meta:this.meta};return r(p),p})();return this.#i=!1,this.options.persister?this.options.persister(d,h,this):d(h)},o=(()=>{const d={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#a,state:this.state,fetchFn:a};return r(d),d})();(this.#e==="infinite"?cK(this.options.pages):this.options.behavior)?.onFetch(o,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#o({type:"fetch",meta:o.fetchOptions?.meta}),this.#r=D5({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:d=>{d instanceof LS&&d.revert&&this.setState({...this.#n,fetchStatus:"idle"}),n.abort()},onFail:(d,f)=>{this.#o({type:"failed",failureCount:d,error:f})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const d=await this.#r.start();if(d===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(d),this.#s.config.onSuccess?.(d,this),this.#s.config.onSettled?.(d,this.state.error,this),d}catch(d){if(d instanceof LS){if(d.silent)return this.#r.promise;if(d.revert){if(this.state.data===void 0)throw d;return this.state.data}}throw this.#o({type:"error",error:d}),this.#s.config.onError?.(d,this),this.#s.config.onSettled?.(this.state.data,d,this),d}finally{this.scheduleGc()}}#o(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...fK(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...KE(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),Or.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#s.notify({query:this,type:"updated",action:e})})}};function fK(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:$5(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function KE(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function GE(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var pK=class extends L5{#e;#t;#n;#s;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||hK(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#a({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=D5({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(i,o)=>{this.#a({type:"failed",failureCount:i,error:o})},onPause:()=>{this.#a({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",a=!this.#s.canStart();try{if(r)t();else{this.#a({type:"pending",variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const o=await this.options.onMutate?.(e,n);o!==this.state.context&&this.#a({type:"pending",context:o,variables:e,isPaused:a})}const i=await this.#s.start();return await this.#n.config.onSuccess?.(i,e,this.state.context,this,n),await this.options.onSuccess?.(i,e,this.state.context,n),await this.#n.config.onSettled?.(i,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(i,null,e,this.state.context,n),this.#a({type:"success",data:i}),i}catch(i){try{await this.#n.config.onError?.(i,e,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onError?.(i,e,this.state.context,n)}catch(o){Promise.reject(o)}try{await this.#n.config.onSettled?.(void 0,i,this.state.variables,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onSettled?.(void 0,i,e,this.state.context,n)}catch(o){Promise.reject(o)}throw this.#a({type:"error",error:i}),i}finally{this.#n.runNext(this)}}#a(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),Or.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function hK(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var mK=class extends Rg{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new pK({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=bh(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=bh(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=bh(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(a=>a.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=bh(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Or.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>UE(t,n))}findAll(e={}){return this.getAll().filter(t=>UE(e,t))}notify(e){Or.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Or.batch(()=>Promise.all(e.map(t=>t.continue().catch(la))))}};function bh(e){return e.options.scope?.id}var gK=class extends Rg{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,a=t.queryHash??tC(r,t);let i=this.get(a);return i||(i=new dK({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(){Or.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=>qE(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>qE(e,n)):t}notify(e){Or.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Or.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Or.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},vK=class{#e;#t;#n;#s;#a;#r;#l;#i;constructor(e={}){this.#e=e.queryCache||new gK,this.#t=e.mutationCache||new mK,this.#n=e.defaultOptions||{},this.#s=new Map,this.#a=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#l=R5.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=tm.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#l?.(),this.#l=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime($S(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=GH(t,i);if(o!==void 0)return this.#e.build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Or.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;Or.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Or.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Or.batch(()=>this.#e.findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(la).catch(la)}invalidateQueries(e,t={}){return Or.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=Or.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($S(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._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(la).catch(la)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return tm.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#s.set(Yd(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(r=>{Xd(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#a.set(Yd(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#a.values()],n={};return t.forEach(r=>{Xd(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=tC(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===nC&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},xK=m.createContext(void 0),yK=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(xK.Provider,{value:e,children:t}));function Qd(){return Qd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qd.apply(null,arguments)}var lo;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(lo||(lo={}));const YE="popstate";function bK(e){e===void 0&&(e={});function t(r,a){let{pathname:i,search:o,hash:c}=r.location;return FS("",{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:nm(a)}return jK(t,n,null,e)}function Bn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function rC(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function wK(){return Math.random().toString(36).substr(2,8)}function XE(e,t){return{usr:e.state,key:e.key,idx:t}}function FS(e,t,n,r){return n===void 0&&(n=null),Qd({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Nu(t):t,{state:n,key:t&&t.key||r||wK()})}function nm(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 Nu(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 jK(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:i=!1}=r,o=a.history,c=lo.Pop,d=null,f=h();f==null&&(f=0,o.replaceState(Qd({},o.state,{idx:f}),""));function h(){return(o.state||{idx:null}).idx}function p(){c=lo.Pop;let y=h(),S=y==null?null:y-f;f=y,d&&d({action:c,location:b.location,delta:S})}function v(y,S){c=lo.Push;let N=FS(b.location,y,S);f=h()+1;let _=XE(N,f),A=b.createHref(N);try{o.pushState(_,"",A)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;a.location.assign(A)}i&&d&&d({action:c,location:b.location,delta:1})}function x(y,S){c=lo.Replace;let N=FS(b.location,y,S);f=h();let _=XE(N,f),A=b.createHref(N);o.replaceState(_,"",A),i&&d&&d({action:c,location:b.location,delta:0})}function j(y){let S=a.location.origin!=="null"?a.location.origin:a.location.href,N=typeof y=="string"?y:nm(y);return N=N.replace(/ $/,"%20"),Bn(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(y){if(d)throw new Error("A history only accepts one active listener");return a.addEventListener(YE,p),d=y,()=>{a.removeEventListener(YE,p),d=null}},createHref(y){return t(a,y)},createURL:j,encodeLocation(y){let S=j(y);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:v,replace:x,go(y){return o.go(y)}};return b}var QE;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(QE||(QE={}));function SK(e,t,n){return n===void 0&&(n="/"),NK(e,t,n)}function NK(e,t,n,r){let a=typeof t=="string"?Nu(t):t,i=Hc(a.pathname||"/",n);if(i==null)return null;let o=F5(e);CK(o);let c=null,d=$K(i);for(let f=0;c==null&&f<o.length;++f)c=MK(o[f],d);return c}function F5(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("/")&&(Bn(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=uo([r,d.relativePath]),h=n.concat(d);i.children&&i.children.length>0&&(Bn(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),F5(i.children,t,h,f)),!(i.path==null&&!i.index)&&t.push({path:f,score:RK(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 z5(i.path))a(i,o,d)}),t}function z5(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=z5(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 CK(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:OK(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const _K=/^:[\w-]+$/,AK=3,kK=2,EK=1,PK=10,TK=-2,ZE=e=>e==="*";function RK(e,t){let n=e.split("/"),r=n.length;return n.some(ZE)&&(r+=TK),t&&(r+=kK),n.filter(a=>!ZE(a)).reduce((a,i)=>a+(_K.test(i)?AK:i===""?EK:PK),r)}function OK(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 MK(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=gn({path:d.relativePath,caseSensitive:d.caseSensitive,end:f},h),v=d.route;if(!p)return null;Object.assign(a,p.params),o.push({params:a,pathname:uo([i,p.pathname]),pathnameBase:BK(uo([i,p.pathnameBase])),route:v}),p.pathnameBase!=="/"&&(i=uo([i,p.pathnameBase]))}return o}function gn(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=IK(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:v,isOptional:x}=h;if(v==="*"){let b=c[p]||"";o=i.slice(0,i.length-b.length).replace(/(.)\/+$/,"$1")}const j=c[p];return x&&!j?f[v]=void 0:f[v]=(j||"").replace(/%2F/g,"/"),f},{}),pathname:i,pathnameBase:o,pattern:e}}function IK(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),rC(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 $K(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return rC(!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 Hc(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 DK=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,LK=e=>DK.test(e);function FK(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Nu(e):e,i;if(n)if(LK(n))i=n;else{if(n.includes("//")){let o=n;n=B5(n),rC(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?i=JE(n.substring(1),"/"):i=JE(n,t)}else i=t;return{pathname:i,search:qK(r),hash:UK(a)}}function JE(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 Ly(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 zK(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function sC(e,t){let n=zK(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function aC(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=Nu(e):(a=Qd({},e),Bn(!a.pathname||!a.pathname.includes("?"),Ly("?","pathname","search",a)),Bn(!a.pathname||!a.pathname.includes("#"),Ly("#","pathname","hash",a)),Bn(!a.search||!a.search.includes("#"),Ly("#","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 v=o.split("/");for(;v[0]==="..";)v.shift(),p-=1;a.pathname=v.join("/")}c=p>=0?t[p]:"/"}let d=FK(a,c),f=o&&o!=="/"&&o.endsWith("/"),h=(i||o===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(f||h)&&(d.pathname+="/"),d}const B5=e=>e.replace(/\/\/+/g,"/"),uo=e=>B5(e.join("/")),BK=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),qK=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,UK=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function WK(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const q5=["post","put","patch","delete"];new Set(q5);const VK=["get",...q5];new Set(VK);function Zd(){return Zd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zd.apply(null,arguments)}const Og=m.createContext(null),U5=m.createContext(null),Ei=m.createContext(null),Mg=m.createContext(null),Ha=m.createContext({outlet:null,matches:[],isDataRoute:!1}),W5=m.createContext(null);function HK(e,t){let{relative:n}=t===void 0?{}:t;Cu()||Bn(!1);let{basename:r,navigator:a}=m.useContext(Ei),{hash:i,pathname:o,search:c}=Ig(e,{relative:n}),d=o;return r!=="/"&&(d=o==="/"?r:uo([r,o])),a.createHref({pathname:d,search:c,hash:i})}function Cu(){return m.useContext(Mg)!=null}function Sa(){return Cu()||Bn(!1),m.useContext(Mg).location}function V5(e){m.useContext(Ei).static||m.useLayoutEffect(e)}function Xs(){let{isDataRoute:e}=m.useContext(Ha);return e?oG():KK()}function KK(){Cu()||Bn(!1);let e=m.useContext(Og),{basename:t,future:n,navigator:r}=m.useContext(Ei),{matches:a}=m.useContext(Ha),{pathname:i}=Sa(),o=JSON.stringify(sC(a,n.v7_relativeSplatPath)),c=m.useRef(!1);return V5(()=>{c.current=!0}),m.useCallback(function(f,h){if(h===void 0&&(h={}),!c.current)return;if(typeof f=="number"){r.go(f);return}let p=aC(f,JSON.parse(o),i,h.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:uo([t,p.pathname])),(h.replace?r.replace:r.push)(p,h.state,h)},[t,r,o,i,e])}const GK=m.createContext(null);function YK(e){let t=m.useContext(Ha).outlet;return t&&m.createElement(GK.Provider,{value:e},t)}function Ml(){let{matches:e}=m.useContext(Ha),t=e[e.length-1];return t?t.params:{}}function Ig(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=m.useContext(Ei),{matches:a}=m.useContext(Ha),{pathname:i}=Sa(),o=JSON.stringify(sC(a,r.v7_relativeSplatPath));return m.useMemo(()=>aC(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function XK(e,t){return QK(e,t)}function QK(e,t,n,r){Cu()||Bn(!1);let{navigator:a}=m.useContext(Ei),{matches:i}=m.useContext(Ha),o=i[i.length-1],c=o?o.params:{};o&&o.pathname;let d=o?o.pathnameBase:"/";o&&o.route;let f=Sa(),h;if(t){var p;let y=typeof t=="string"?Nu(t):t;d==="/"||(p=y.pathname)!=null&&p.startsWith(d)||Bn(!1),h=y}else h=f;let v=h.pathname||"/",x=v;if(d!=="/"){let y=d.replace(/^\//,"").split("/");x="/"+v.replace(/^\//,"").split("/").slice(y.length).join("/")}let j=SK(e,{pathname:x}),b=nG(j&&j.map(y=>Object.assign({},y,{params:Object.assign({},c,y.params),pathname:uo([d,a.encodeLocation?a.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?d:uo([d,a.encodeLocation?a.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),i,n,r);return t&&b?m.createElement(Mg.Provider,{value:{location:Zd({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:lo.Pop}},b):b}function ZK(){let e=iG(),t=WK(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 m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:a},n):null,null)}const JK=m.createElement(ZK,null);class eG extends m.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?m.createElement(Ha.Provider,{value:this.props.routeContext},m.createElement(W5.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function tG(e){let{routeContext:t,match:n,children:r}=e,a=m.useContext(Og);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),m.createElement(Ha.Provider,{value:t},r)}function nG(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||Bn(!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:v,errors:x}=n,j=p.route.loader&&v[p.route.id]===void 0&&(!x||x[p.route.id]===void 0);if(p.route.lazy||j){d=!0,f>=0?o=o.slice(0,f+1):o=[o[0]];break}}}return o.reduceRight((h,p,v)=>{let x,j=!1,b=null,y=null;n&&(x=c&&p.route.id?c[p.route.id]:void 0,b=p.route.errorElement||JK,d&&(f<0&&v===0?(lG("route-fallback"),j=!0,y=null):f===v&&(j=!0,y=p.route.hydrateFallbackElement||null)));let S=t.concat(o.slice(0,v+1)),N=()=>{let _;return x?_=b:j?_=y:p.route.Component?_=m.createElement(p.route.Component,null):p.route.element?_=p.route.element:_=h,m.createElement(tG,{match:p,routeContext:{outlet:h,matches:S,isDataRoute:n!=null},children:_})};return n&&(p.route.ErrorBoundary||p.route.errorElement||v===0)?m.createElement(eG,{location:n.location,revalidation:n.revalidation,component:b,error:x,children:N(),routeContext:{outlet:null,matches:S,isDataRoute:!0}}):N()},null)}var H5=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(H5||{}),K5=(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})(K5||{});function rG(e){let t=m.useContext(Og);return t||Bn(!1),t}function sG(e){let t=m.useContext(U5);return t||Bn(!1),t}function aG(e){let t=m.useContext(Ha);return t||Bn(!1),t}function G5(e){let t=aG(),n=t.matches[t.matches.length-1];return n.route.id||Bn(!1),n.route.id}function iG(){var e;let t=m.useContext(W5),n=sG(),r=G5();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function oG(){let{router:e}=rG(H5.UseNavigateStable),t=G5(K5.UseNavigateStable),n=m.useRef(!1);return V5(()=>{n.current=!0}),m.useCallback(function(a,i){i===void 0&&(i={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,Zd({fromRouteId:t},i)))},[e,t])}const eP={};function lG(e,t,n){eP[e]||(eP[e]=!0)}function cG(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function Y5(e){let{to:t,replace:n,state:r,relative:a}=e;Cu()||Bn(!1);let{future:i,static:o}=m.useContext(Ei),{matches:c}=m.useContext(Ha),{pathname:d}=Sa(),f=Xs(),h=aC(t,sC(c,i.v7_relativeSplatPath),d,a==="path"),p=JSON.stringify(h);return m.useEffect(()=>f(JSON.parse(p),{replace:n,state:r,relative:a}),[f,p,a,n,r]),null}function tP(e){return YK(e.context)}function yn(e){Bn(!1)}function uG(e){let{basename:t="/",children:n=null,location:r,navigationType:a=lo.Pop,navigator:i,static:o=!1,future:c}=e;Cu()&&Bn(!1);let d=t.replace(/^\/*/,"/"),f=m.useMemo(()=>({basename:d,navigator:i,static:o,future:Zd({v7_relativeSplatPath:!1},c)}),[d,c,i,o]);typeof r=="string"&&(r=Nu(r));let{pathname:h="/",search:p="",hash:v="",state:x=null,key:j="default"}=r,b=m.useMemo(()=>{let y=Hc(h,d);return y==null?null:{location:{pathname:y,search:p,hash:v,state:x,key:j},navigationType:a}},[d,h,p,v,x,j,a]);return b==null?null:m.createElement(Ei.Provider,{value:f},m.createElement(Mg.Provider,{children:n,value:b}))}function dG(e){let{children:t,location:n}=e;return XK(zS(t),n)}new Promise(()=>{});function zS(e,t){t===void 0&&(t=[]);let n=[];return m.Children.forEach(e,(r,a)=>{if(!m.isValidElement(r))return;let i=[...t,a];if(r.type===m.Fragment){n.push.apply(n,zS(r.props.children,i));return}r.type!==yn&&Bn(!1),!r.props.index||!r.props.children||Bn(!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=zS(r.props.children,i)),n.push(o)}),n}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)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rm.apply(null,arguments)}function X5(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function fG(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function pG(e,t){return e.button===0&&(!t||t==="_self")&&!fG(e)}function BS(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function hG(e,t){let n=BS(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(i=>{n.append(a,i)})}),n}const mG=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],gG=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],vG="6";try{window.__reactRouterVersion=vG}catch{}const xG=m.createContext({isTransitioning:!1}),yG="startTransition",nP=vg[yG];function bG(e){let{basename:t,children:n,future:r,window:a}=e,i=m.useRef();i.current==null&&(i.current=bK({window:a,v5Compat:!0}));let o=i.current,[c,d]=m.useState({action:o.action,location:o.location}),{v7_startTransition:f}=r||{},h=m.useCallback(p=>{f&&nP?nP(()=>d(p)):d(p)},[d,f]);return m.useLayoutEffect(()=>o.listen(h),[o,h]),m.useEffect(()=>cG(r),[r]),m.createElement(uG,{basename:t,children:n,location:c.location,navigationType:c.action,navigator:o,future:r})}const wG=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",jG=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Tt=m.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:i,replace:o,state:c,target:d,to:f,preventScrollReset:h,viewTransition:p}=t,v=X5(t,mG),{basename:x}=m.useContext(Ei),j,b=!1;if(typeof f=="string"&&jG.test(f)&&(j=f,wG))try{let _=new URL(window.location.href),A=f.startsWith("//")?new URL(_.protocol+f):new URL(f),k=Hc(A.pathname,x);A.origin===_.origin&&k!=null?f=k+A.search+A.hash:b=!0}catch{}let y=HK(f,{relative:a}),S=CG(f,{replace:o,state:c,target:d,preventScrollReset:h,relative:a,viewTransition:p});function N(_){r&&r(_),_.defaultPrevented||S(_)}return m.createElement("a",rm({},v,{href:j||y,onClick:b||i?r:N,ref:n,target:d}))}),SG=m.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=X5(t,gG),v=Ig(d,{relative:p.relative}),x=Sa(),j=m.useContext(U5),{navigator:b,basename:y}=m.useContext(Ei),S=j!=null&&_G(v)&&f===!0,N=b.encodeLocation?b.encodeLocation(v).pathname:v.pathname,_=x.pathname,A=j&&j.navigation&&j.navigation.location?j.navigation.location.pathname:null;a||(_=_.toLowerCase(),A=A?A.toLowerCase():null,N=N.toLowerCase()),A&&y&&(A=Hc(A,y)||A);const k=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let E=_===N||!o&&_.startsWith(N)&&_.charAt(k)==="/",P=A!=null&&(A===N||!o&&A.startsWith(N)&&A.charAt(N.length)==="/"),R={isActive:E,isPending:P,isTransitioning:S},M=E?r:void 0,D;typeof i=="function"?D=i(R):D=[i,E?"active":null,P?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let U=typeof c=="function"?c(R):c;return m.createElement(Tt,rm({},p,{"aria-current":M,className:D,ref:n,style:U,to:d,viewTransition:f}),typeof h=="function"?h(R):h)});var qS;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(qS||(qS={}));var rP;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(rP||(rP={}));function NG(e){let t=m.useContext(Og);return t||Bn(!1),t}function CG(e,t){let{target:n,replace:r,state:a,preventScrollReset:i,relative:o,viewTransition:c}=t===void 0?{}:t,d=Xs(),f=Sa(),h=Ig(e,{relative:o});return m.useCallback(p=>{if(pG(p,n)){p.preventDefault();let v=r!==void 0?r:nm(f)===nm(h);d(e,{replace:v,state:a,preventScrollReset:i,relative:o,viewTransition:c})}},[f,d,h,r,a,n,e,i,o,c])}function Pi(e){let t=m.useRef(BS(e)),n=m.useRef(!1),r=Sa(),a=m.useMemo(()=>hG(r.search,n.current?null:t.current),[r.search]),i=Xs(),o=m.useCallback((c,d)=>{const f=BS(typeof c=="function"?c(a):c);n.current=!0,i("?"+f,d)},[i,a]);return[a,o]}function _G(e,t){t===void 0&&(t={});let n=m.useContext(xG);n==null&&Bn(!1);let{basename:r}=NG(qS.useViewTransitionState),a=Ig(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=Hc(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Hc(n.nextLocation.pathname,r)||n.nextLocation.pathname;return gn(a.pathname,o)!=null||gn(a.pathname,i)!=null}var AG=Symbol.for("react.lazy"),sm=vg[" use ".trim().toString()];function kG(e){return typeof e=="object"&&e!==null&&"then"in e}function Q5(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===AG&&"_payload"in e&&kG(e._payload)}function $g(e){const t=EG(e),n=m.forwardRef((r,a)=>{let{children:i,...o}=r;Q5(i)&&typeof sm=="function"&&(i=sm(i._payload));const c=m.Children.toArray(i),d=c.find(TG);if(d){const f=d.props.children,h=c.map(p=>p===d?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}var So=$g("Slot");function EG(e){const t=m.forwardRef((n,r)=>{let{children:a,...i}=n;if(Q5(a)&&typeof sm=="function"&&(a=sm(a._payload)),m.isValidElement(a)){const o=OG(a),c=RG(i,a.props);return a.type!==m.Fragment&&(c.ref=r?zr(r,o):o),m.cloneElement(a,c)}return m.Children.count(a)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var PG=Symbol("radix.slottable");function TG(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===PG}function RG(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 OG(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 Fy=768;function MG(){const[e,t]=m.useState(void 0);return m.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Fy-1}px)`),r=()=>{t(window.innerWidth<Fy)};return n.addEventListener("change",r),t(window.innerWidth<Fy),()=>n.removeEventListener("change",r)},[]),!!e}const iC=Ol("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"}}),Z=m.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},i)=>{const o=r?So:"button";return s.jsx(o,{className:Re(iC({variant:t,size:n,className:e})),ref:i,...a})});Z.displayName="Button";const Et=m.forwardRef(({className:e,type:t,...n},r)=>s.jsx("input",{type:t,className:Re("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}));Et.displayName="Input";var IG=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$G=IG.reduce((e,t)=>{const n=$g(`Primitive.${t}`),r=m.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}},{}),DG="Separator",sP="horizontal",LG=["horizontal","vertical"],Z5=m.forwardRef((e,t)=>{const{decorative:n,orientation:r=sP,...a}=e,i=FG(r)?r:sP,c=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return s.jsx($G.div,{"data-orientation":i,...c,...a,ref:t})});Z5.displayName=DG;function FG(e){return LG.includes(e)}var J5=Z5;const e3=m.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},a)=>s.jsx(J5,{ref:a,decorative:n,orientation:t,className:Re("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));e3.displayName=J5.displayName;var zy="focusScope.autoFocusOnMount",By="focusScope.autoFocusOnUnmount",aP={bubbles:!1,cancelable:!0},zG="FocusScope",Wf=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[c,d]=m.useState(null),f=Gn(a),h=Gn(i),p=m.useRef(null),v=Mt(t,b=>d(b)),x=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let b=function(_){if(x.paused||!c)return;const A=_.target;c.contains(A)?p.current=A:io(p.current,{select:!0})},y=function(_){if(x.paused||!c)return;const A=_.relatedTarget;A!==null&&(c.contains(A)||io(p.current,{select:!0}))},S=function(_){if(document.activeElement===document.body)for(const k of _)k.removedNodes.length>0&&io(c)};document.addEventListener("focusin",b),document.addEventListener("focusout",y);const N=new MutationObserver(S);return c&&N.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",y),N.disconnect()}}},[r,c,x.paused]),m.useEffect(()=>{if(c){oP.add(x);const b=document.activeElement;if(!c.contains(b)){const S=new CustomEvent(zy,aP);c.addEventListener(zy,f),c.dispatchEvent(S),S.defaultPrevented||(BG(HG(t3(c)),{select:!0}),document.activeElement===b&&io(c))}return()=>{c.removeEventListener(zy,f),setTimeout(()=>{const S=new CustomEvent(By,aP);c.addEventListener(By,h),c.dispatchEvent(S),S.defaultPrevented||io(b??document.body,{select:!0}),c.removeEventListener(By,h),oP.remove(x)},0)}}},[c,f,h,x]);const j=m.useCallback(b=>{if(!n&&!r||x.paused)return;const y=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,S=document.activeElement;if(y&&S){const N=b.currentTarget,[_,A]=qG(N);_&&A?!b.shiftKey&&S===A?(b.preventDefault(),n&&io(_,{select:!0})):b.shiftKey&&S===_&&(b.preventDefault(),n&&io(A,{select:!0})):S===N&&b.preventDefault()}},[n,r,x.paused]);return s.jsx(ft.div,{tabIndex:-1,...o,ref:v,onKeyDown:j})});Wf.displayName=zG;function BG(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(io(r,{select:t}),document.activeElement!==n)return}function qG(e){const t=t3(e),n=iP(t,e),r=iP(t.reverse(),e);return[n,r]}function t3(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 iP(e,t){for(const n of e)if(!UG(n,{upTo:t}))return n}function UG(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 WG(e){return e instanceof HTMLInputElement&&"select"in e}function io(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&WG(e)&&t&&e.select()}}var oP=VG();function VG(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=lP(e,t),e.unshift(t)},remove(t){e=lP(e,t),e[0]?.resume()}}}function lP(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function HG(e){return e.filter(t=>t.tagName!=="A")}var qy=0;function Dg(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??cP()),document.body.insertAdjacentElement("beforeend",e[1]??cP()),qy++,()=>{qy===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),qy--}},[])}function cP(){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 Ra=function(){return Ra=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},Ra.apply(this,arguments)};function n3(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 KG(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 Vh="right-scroll-bar-position",Hh="width-before-scroll-bar",GG="with-scroll-bars-hidden",YG="--removed-body-scroll-bar-size";function Uy(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function XG(e,t){var n=m.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 QG=typeof window<"u"?m.useLayoutEffect:m.useEffect,uP=new WeakMap;function ZG(e,t){var n=XG(null,function(r){return e.forEach(function(a){return Uy(a,r)})});return QG(function(){var r=uP.get(n);if(r){var a=new Set(r),i=new Set(e),o=n.current;a.forEach(function(c){i.has(c)||Uy(c,null)}),i.forEach(function(c){a.has(c)||Uy(c,o)})}uP.set(n,e)},[e]),n}function JG(e){return e}function eY(e,t){t===void 0&&(t=JG);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 tY(e){e===void 0&&(e={});var t=eY(null);return t.options=Ra({async:!0,ssr:!1},e),t}var r3=function(e){var t=e.sideCar,n=n3(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return m.createElement(r,Ra({},n))};r3.isSideCarExport=!0;function nY(e,t){return e.useMedium(t),r3}var s3=tY(),Wy=function(){},Lg=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:Wy,onWheelCapture:Wy,onTouchMoveCapture:Wy}),a=r[0],i=r[1],o=e.forwardProps,c=e.children,d=e.className,f=e.removeScrollBar,h=e.enabled,p=e.shards,v=e.sideCar,x=e.noRelative,j=e.noIsolation,b=e.inert,y=e.allowPinchZoom,S=e.as,N=S===void 0?"div":S,_=e.gapMode,A=n3(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=v,E=ZG([n,t]),P=Ra(Ra({},A),a);return m.createElement(m.Fragment,null,h&&m.createElement(k,{sideCar:s3,removeScrollBar:f,shards:p,noRelative:x,noIsolation:j,inert:b,setCallbacks:i,allowPinchZoom:!!y,lockRef:n,gapMode:_}),o?m.cloneElement(m.Children.only(c),Ra(Ra({},P),{ref:E})):m.createElement(N,Ra({},P,{className:d,ref:E}),c))});Lg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Lg.classNames={fullWidth:Hh,zeroRight:Vh};var rY=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function sY(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=rY();return t&&e.setAttribute("nonce",t),e}function aY(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function iY(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var oY=function(){var e=0,t=null;return{add:function(n){e==0&&(t=sY())&&(aY(t,n),iY(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},lY=function(){var e=oY();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},a3=function(){var e=lY(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},cY={left:0,top:0,right:0,gap:0},Vy=function(e){return parseInt(e||"",10)||0},uY=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[Vy(n),Vy(r),Vy(a)]},dY=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return cY;var t=uY(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])}},fY=a3(),$c="data-scroll-locked",pY=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(GG,` {
|
|
11
|
+
overflow: hidden `).concat(r,`;
|
|
12
|
+
padding-right: `).concat(c,"px ").concat(r,`;
|
|
13
|
+
}
|
|
14
|
+
body[`).concat($c,`] {
|
|
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(Vh,` {
|
|
28
|
+
right: `).concat(c,"px ").concat(r,`;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.`).concat(Hh,` {
|
|
32
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.`).concat(Vh," .").concat(Vh,` {
|
|
36
|
+
right: 0 `).concat(r,`;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.`).concat(Hh," .").concat(Hh,` {
|
|
40
|
+
margin-right: 0 `).concat(r,`;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
body[`).concat($c,`] {
|
|
44
|
+
`).concat(YG,": ").concat(c,`px;
|
|
45
|
+
}
|
|
46
|
+
`)},dP=function(){var e=parseInt(document.body.getAttribute($c)||"0",10);return isFinite(e)?e:0},hY=function(){m.useEffect(function(){return document.body.setAttribute($c,(dP()+1).toString()),function(){var e=dP()-1;e<=0?document.body.removeAttribute($c):document.body.setAttribute($c,e.toString())}},[])},mY=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;hY();var i=m.useMemo(function(){return dY(a)},[a]);return m.createElement(fY,{styles:pY(i,!t,a,n?"":"!important")})},US=!1;if(typeof window<"u")try{var wh=Object.defineProperty({},"passive",{get:function(){return US=!0,!0}});window.addEventListener("test",wh,wh),window.removeEventListener("test",wh,wh)}catch{US=!1}var pc=US?{passive:!1}:!1,gY=function(e){return e.tagName==="TEXTAREA"},i3=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!gY(e)&&n[t]==="visible")},vY=function(e){return i3(e,"overflowY")},xY=function(e){return i3(e,"overflowX")},fP=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=o3(e,r);if(a){var i=l3(e,r),o=i[1],c=i[2];if(o>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},yY=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},bY=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},o3=function(e,t){return e==="v"?vY(t):xY(t)},l3=function(e,t){return e==="v"?yY(t):bY(t)},wY=function(e,t){return e==="h"&&t==="rtl"?-1:1},jY=function(e,t,n,r,a){var i=wY(e,window.getComputedStyle(t).direction),o=i*r,c=n.target,d=t.contains(c),f=!1,h=o>0,p=0,v=0;do{if(!c)break;var x=l3(e,c),j=x[0],b=x[1],y=x[2],S=b-y-i*j;(j||S)&&o3(e,c)&&(p+=S,v+=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(v)<1)&&(f=!0),f},jh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},pP=function(e){return[e.deltaX,e.deltaY]},hP=function(e){return e&&"current"in e?e.current:e},SY=function(e,t){return e[0]===t[0]&&e[1]===t[1]},NY=function(e){return`
|
|
47
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
48
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
49
|
+
`)},CY=0,hc=[];function _Y(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),a=m.useState(CY++)[0],i=m.useState(a3)[0],o=m.useRef(e);m.useEffect(function(){o.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var b=KG([e.lockRef.current],(e.shards||[]).map(hP),!0).filter(Boolean);return b.forEach(function(y){return y.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),b.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var c=m.useCallback(function(b,y){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!o.current.allowPinchZoom;var S=jh(b),N=n.current,_="deltaX"in b?b.deltaX:N[0]-S[0],A="deltaY"in b?b.deltaY:N[1]-S[1],k,E=b.target,P=Math.abs(_)>Math.abs(A)?"h":"v";if("touches"in b&&P==="h"&&E.type==="range")return!1;var R=window.getSelection(),M=R&&R.anchorNode,D=M?M===E||M.contains(E):!1;if(D)return!1;var U=fP(P,E);if(!U)return!0;if(U?k=P:(k=P==="v"?"h":"v",U=fP(P,E)),!U)return!1;if(!r.current&&"changedTouches"in b&&(_||A)&&(r.current=k),!k)return!0;var F=r.current||k;return jY(F,y,b,F==="h"?_:A)},[]),d=m.useCallback(function(b){var y=b;if(!(!hc.length||hc[hc.length-1]!==i)){var S="deltaY"in y?pP(y):jh(y),N=t.current.filter(function(k){return k.name===y.type&&(k.target===y.target||y.target===k.shadowParent)&&SY(k.delta,S)})[0];if(N&&N.should){y.cancelable&&y.preventDefault();return}if(!N){var _=(o.current.shards||[]).map(hP).filter(Boolean).filter(function(k){return k.contains(y.target)}),A=_.length>0?c(y,_[0]):!o.current.noIsolation;A&&y.cancelable&&y.preventDefault()}}},[]),f=m.useCallback(function(b,y,S,N){var _={name:b,delta:y,target:S,should:N,shadowParent:AY(S)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(A){return A!==_})},1)},[]),h=m.useCallback(function(b){n.current=jh(b),r.current=void 0},[]),p=m.useCallback(function(b){f(b.type,pP(b),b.target,c(b,e.lockRef.current))},[]),v=m.useCallback(function(b){f(b.type,jh(b),b.target,c(b,e.lockRef.current))},[]);m.useEffect(function(){return hc.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:v}),document.addEventListener("wheel",d,pc),document.addEventListener("touchmove",d,pc),document.addEventListener("touchstart",h,pc),function(){hc=hc.filter(function(b){return b!==i}),document.removeEventListener("wheel",d,pc),document.removeEventListener("touchmove",d,pc),document.removeEventListener("touchstart",h,pc)}},[]);var x=e.removeScrollBar,j=e.inert;return m.createElement(m.Fragment,null,j?m.createElement(i,{styles:NY(a)}):null,x?m.createElement(mY,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function AY(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const kY=nY(s3,_Y);var Vf=m.forwardRef(function(e,t){return m.createElement(Lg,Ra({},e,{ref:t,sideCar:kY}))});Vf.classNames=Lg.classNames;var EY=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},mc=new WeakMap,Sh=new WeakMap,Nh={},Hy=0,c3=function(e){return e&&(e.host||c3(e.parentNode))},PY=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=c3(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})},TY=function(e,t,n,r){var a=PY(t,Array.isArray(e)?e:[e]);Nh[n]||(Nh[n]=new WeakMap);var i=Nh[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(v){if(c.has(v))h(v);else try{var x=v.getAttribute(r),j=x!==null&&x!=="false",b=(mc.get(v)||0)+1,y=(i.get(v)||0)+1;mc.set(v,b),i.set(v,y),o.push(v),b===1&&j&&Sh.set(v,!0),y===1&&v.setAttribute(n,"true"),j||v.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",v,S)}})};return h(t),c.clear(),Hy++,function(){o.forEach(function(p){var v=mc.get(p)-1,x=i.get(p)-1;mc.set(p,v),i.set(p,x),v||(Sh.has(p)||p.removeAttribute(r),Sh.delete(p)),x||p.removeAttribute(n)}),Hy--,Hy||(mc=new WeakMap,mc=new WeakMap,Sh=new WeakMap,Nh={})}},Fg=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=EY(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),TY(r,a,n,"aria-hidden")):function(){return null}};function RY(e){const t=OY(e),n=m.forwardRef((r,a)=>{const{children:i,...o}=r,c=m.Children.toArray(i),d=c.find(IY);if(d){const f=d.props.children,h=c.map(p=>p===d?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function OY(e){const t=m.forwardRef((n,r)=>{const{children:a,...i}=n;if(m.isValidElement(a)){const o=DY(a),c=$Y(i,a.props);return a.type!==m.Fragment&&(c.ref=r?zr(r,o):o),m.cloneElement(a,c)}return m.Children.count(a)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var MY=Symbol("radix.slottable");function IY(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===MY}function $Y(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 DY(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 zg="Dialog",[u3,d3]=Sr(zg),[LY,Na]=u3(zg),f3=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:o=!0}=e,c=m.useRef(null),d=m.useRef(null),[f,h]=js({prop:r,defaultProp:a??!1,onChange:i,caller:zg});return s.jsx(LY,{scope:t,triggerRef:c,contentRef:d,contentId:ar(),titleId:ar(),descriptionId:ar(),open:f,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(p=>!p),[h]),modal:o,children:n})};f3.displayName=zg;var p3="DialogTrigger",h3=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Na(p3,n),i=Mt(t,a.triggerRef);return s.jsx(ft.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":cC(a.open),...r,ref:i,onClick:qe(e.onClick,a.onOpenToggle)})});h3.displayName=p3;var oC="DialogPortal",[FY,m3]=u3(oC,{forceMount:void 0}),g3=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=Na(oC,t);return s.jsx(FY,{scope:t,forceMount:n,children:m.Children.map(r,o=>s.jsx(Zn,{present:n||i.open,children:s.jsx(Rl,{asChild:!0,container:a,children:o})}))})};g3.displayName=oC;var am="DialogOverlay",v3=m.forwardRef((e,t)=>{const n=m3(am,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Na(am,e.__scopeDialog);return i.modal?s.jsx(Zn,{present:r||i.open,children:s.jsx(BY,{...a,ref:t})}):null});v3.displayName=am;var zY=RY("DialogOverlay.RemoveScroll"),BY=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Na(am,n);return s.jsx(Vf,{as:zY,allowPinchZoom:!0,shards:[a.contentRef],children:s.jsx(ft.div,{"data-state":cC(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),gl="DialogContent",x3=m.forwardRef((e,t)=>{const n=m3(gl,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Na(gl,e.__scopeDialog);return s.jsx(Zn,{present:r||i.open,children:i.modal?s.jsx(qY,{...a,ref:t}):s.jsx(UY,{...a,ref:t})})});x3.displayName=gl;var qY=m.forwardRef((e,t)=>{const n=Na(gl,e.__scopeDialog),r=m.useRef(null),a=Mt(t,n.contentRef,r);return m.useEffect(()=>{const i=r.current;if(i)return Fg(i)},[]),s.jsx(y3,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:qe(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:qe(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0;(o.button===2||c)&&i.preventDefault()}),onFocusOutside:qe(e.onFocusOutside,i=>i.preventDefault())})}),UY=m.forwardRef((e,t)=>{const n=Na(gl,e.__scopeDialog),r=m.useRef(!1),a=m.useRef(!1);return s.jsx(y3,{...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()}})}),y3=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,c=Na(gl,n),d=m.useRef(null),f=Mt(t,d);return Dg(),s.jsxs(s.Fragment,{children:[s.jsx(Wf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(Tl,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":cC(c.open),...o,ref:f,onDismiss:()=>c.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(VY,{titleId:c.titleId}),s.jsx(KY,{contentRef:d,descriptionId:c.descriptionId})]})]})}),lC="DialogTitle",b3=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Na(lC,n);return s.jsx(ft.h2,{id:a.titleId,...r,ref:t})});b3.displayName=lC;var w3="DialogDescription",j3=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Na(w3,n);return s.jsx(ft.p,{id:a.descriptionId,...r,ref:t})});j3.displayName=w3;var S3="DialogClose",N3=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Na(S3,n);return s.jsx(ft.button,{type:"button",...r,ref:t,onClick:qe(e.onClick,()=>a.onOpenChange(!1))})});N3.displayName=S3;function cC(e){return e?"open":"closed"}var C3="DialogTitleWarning",[WY,_3]=C7(C3,{contentName:gl,titleName:lC,docsSlug:"dialog"}),VY=({titleId:e})=>{const t=_3(C3),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
50
|
+
|
|
51
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
52
|
+
|
|
53
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},HY="DialogDescriptionWarning",KY=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${_3(HY).contentName}}.`;return m.useEffect(()=>{const a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Bg=f3,GY=h3,qg=g3,_u=v3,Au=x3,Hf=b3,Kf=j3,Ug=N3;const A3=Bg,YY=qg,k3=m.forwardRef(({className:e,...t},n)=>s.jsx(_u,{className:Re("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}));k3.displayName=_u.displayName;const XY=Ol("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"}}),uC=m.forwardRef(({side:e="right",className:t,children:n,...r},a)=>s.jsxs(YY,{children:[s.jsx(k3,{}),s.jsxs(Au,{ref:a,className:Re(XY({side:e}),t),...r,children:[n,s.jsxs(Ug,{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(ns,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));uC.displayName=Au.displayName;const E3=({className:e,...t})=>s.jsx("div",{className:Re("flex flex-col space-y-2 text-center sm:text-left",e),...t});E3.displayName="SheetHeader";const P3=m.forwardRef(({className:e,...t},n)=>s.jsx(Hf,{ref:n,className:Re("text-lg font-semibold text-foreground",e),...t}));P3.displayName=Hf.displayName;const QY=m.forwardRef(({className:e,...t},n)=>s.jsx(Kf,{ref:n,className:Re("text-sm text-muted-foreground",e),...t}));QY.displayName=Kf.displayName;function mP({className:e,...t}){return s.jsx("div",{className:Re("animate-pulse rounded-md bg-muted",e),...t})}const ZY="sidebar:state",JY=3600*24*7,eX="16rem",tX="18rem",nX="3rem",rX="b",T3=m.createContext(null);function Gf(){const e=m.useContext(T3);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const R3=m.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:a,children:i,...o},c)=>{const d=MG(),[f,h]=m.useState(!1),[p,v]=m.useState(e),x=t??p,j=m.useCallback(N=>{const _=typeof N=="function"?N(x):N;n?n(_):v(_),document.cookie=`${ZY}=${_}; path=/; max-age=${JY}`},[n,x]),b=m.useCallback(()=>d?h(N=>!N):j(N=>!N),[d,j,h]);m.useEffect(()=>{const N=_=>{_.key===rX&&(_.metaKey||_.ctrlKey)&&(_.preventDefault(),b())};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[b]);const y=x?"expanded":"collapsed",S=m.useMemo(()=>({state:y,open:x,setOpen:j,isMobile:d,openMobile:f,setOpenMobile:h,toggleSidebar:b}),[y,x,j,d,f,h,b]);return s.jsx(T3.Provider,{value:S,children:s.jsx(ji,{delayDuration:0,children:s.jsx("div",{style:{"--sidebar-width":eX,"--sidebar-width-icon":nX,...a},className:Re("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",r),ref:c,...o,children:i})})})});R3.displayName="SidebarProvider";const O3=m.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}=Gf();return n==="none"?s.jsx("div",{className:Re("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",r),ref:o,...i,children:a}):c?s.jsx(A3,{open:f,onOpenChange:h,...i,children:s.jsx(uC,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":tX},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:Re("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:Re("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})})]})});O3.displayName="Sidebar";const M3=m.forwardRef(({className:e,onClick:t,...n},r)=>{const{toggleSidebar:a}=Gf();return s.jsxs(Z,{ref:r,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:Re("h-7 w-7",e),onClick:i=>{t?.(i),a()},...n,children:[s.jsx(M9,{}),s.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});M3.displayName="SidebarTrigger";const sX=m.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:r}=Gf();return s.jsx("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:Re("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})});sX.displayName="SidebarRail";const aX=m.forwardRef(({className:e,...t},n)=>s.jsx("main",{ref:n,className:Re("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}));aX.displayName="SidebarInset";const iX=m.forwardRef(({className:e,...t},n)=>s.jsx(Et,{ref:n,"data-sidebar":"input",className:Re("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));iX.displayName="SidebarInput";const I3=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"header",className:Re("flex flex-col gap-2 p-2",e),...t}));I3.displayName="SidebarHeader";const $3=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"footer",className:Re("flex flex-col gap-2 p-2",e),...t}));$3.displayName="SidebarFooter";const WS=m.forwardRef(({className:e,...t},n)=>s.jsx(e3,{ref:n,"data-sidebar":"separator",className:Re("mx-2 w-auto bg-sidebar-border",e),...t}));WS.displayName="SidebarSeparator";const D3=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"content",className:Re("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));D3.displayName="SidebarContent";const L3=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"group",className:Re("relative flex w-full min-w-0 flex-col p-2",e),...t}));L3.displayName="SidebarGroup";const F3=m.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const a=t?So:"div";return s.jsx(a,{ref:r,"data-sidebar":"group-label",className:Re("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})});F3.displayName="SidebarGroupLabel";const oX=m.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const a=t?So:"button";return s.jsx(a,{ref:r,"data-sidebar":"group-action",className:Re("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})});oX.displayName="SidebarGroupAction";const z3=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"group-content",className:Re("w-full text-sm",e),...t}));z3.displayName="SidebarGroupContent";const B3=m.forwardRef(({className:e,...t},n)=>s.jsx("ul",{ref:n,"data-sidebar":"menu",className:Re("flex w-full min-w-0 flex-col gap-1",e),...t}));B3.displayName="SidebarMenu";const q3=m.forwardRef(({className:e,...t},n)=>s.jsx("li",{ref:n,"data-sidebar":"menu-item",className:Re("group/menu-item relative",e),...t}));q3.displayName="SidebarMenuItem";const lX=Ol("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),U3=m.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:a,className:i,...o},c)=>{const d=e?So:"button",{isMobile:f,state:h}=Gf(),p=s.jsx(d,{ref:c,"data-sidebar":"menu-button","data-size":r,"data-active":t,className:Re(lX({variant:n,size:r}),i),...o});return a?(typeof a=="string"&&(a={children:a}),s.jsxs(Si,{children:[s.jsx(Ni,{asChild:!0,children:p}),s.jsx(qa,{side:"right",align:"center",hidden:h!=="collapsed"||f,...a})]})):p});U3.displayName="SidebarMenuButton";const cX=m.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},a)=>{const i=t?So:"button";return s.jsx(i,{ref:a,"data-sidebar":"menu-action",className:Re("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})});cX.displayName="SidebarMenuAction";const uX=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:Re("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}));uX.displayName="SidebarMenuBadge";const dX=m.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{const a=m.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return s.jsxs("div",{ref:r,"data-sidebar":"menu-skeleton",className:Re("flex h-8 items-center gap-2 rounded-md px-2",e),...n,children:[t&&s.jsx(mP,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),s.jsx(mP,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":a}})]})});dX.displayName="SidebarMenuSkeleton";const fX=m.forwardRef(({className:e,...t},n)=>s.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:Re("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}));fX.displayName="SidebarMenuSub";const pX=m.forwardRef(({...e},t)=>s.jsx("li",{ref:t,...e}));pX.displayName="SidebarMenuSubItem";const hX=m.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:r,...a},i)=>{const o=e?So:"a";return s.jsx(o,{ref:i,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:Re("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})});hX.displayName="SidebarMenuSubButton";const W3=m.forwardRef(({className:e,activeClassName:t,pendingClassName:n,to:r,...a},i)=>s.jsx(SG,{ref:i,to:r,className:({isActive:o,isPending:c})=>Re(e,o&&t,c&&n),...a}));W3.displayName="NavLink";function mX({width:e=24,height:t=24,from:n="#53afba",to:r="#76fffb",...a}){const i=`grad-${m.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 gX=[{title:"Home",items:[{title:"Dashboard",url:"/",icon:BD}]},{title:"Lab",items:[{title:"MCP Evaluations",url:"/mcp-evaluations",icon:FD},{title:"Analyze MCP",url:"/tool-analysis",icon:qD},{title:"OAuth Debugger",url:"/oauth-debugger",icon:D9}]},{title:"Libraries",items:[{title:"Test Cases",url:"/libraries/test-cases",icon:LD},{title:"MCP servers",url:"/libraries/servers",icon:DD},{title:"Agents",url:"/libraries/agents",icon:Fr}]},{title:"Execution",items:[{title:"Run Evaluation",url:"/run",icon:va},{title:"Evaluation Results",url:"/results",icon:Bc},{title:"Compare Evaluations",url:"/compare",icon:zD},{title:"MCP Analysis Results",url:"/tool-analysis-results",icon:UD},{title:"Custom Reports",url:"/markdown-reports",icon:Ac}]},{title:"Workspace",items:[{title:"Settings",url:"/settings",icon:UN},{title:"MCPLab MCP server",url:"/settings/mcp",icon:CS}]}];function vX(e={version:null}){const t=e.version??null,{state:n}=Gf(),r=n==="collapsed",a=Sa(),i=m.useMemo(()=>gX,[]);return s.jsxs(O3,{collapsible:"icon",children:[s.jsx(I3,{className:`border-b border-sidebar-border py-3 ${r?"px-2":"px-4"}`,children:s.jsxs("div",{className:`flex items-center ${r?"justify-center overflow-visible":"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(mX,{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(D3,{children:i.map((o,c)=>s.jsxs("div",{children:[c>0&&!r&&s.jsx(WS,{className:"my-1.5"}),s.jsxs(L3,{className:r?"px-2":"px-3 py-2",children:[!r&&s.jsx(F3,{className:"px-1 pb-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-muted-foreground/90",children:o.title}),s.jsx(z3,{children:s.jsx(B3,{children:o.items.map(d=>s.jsx(q3,{children:s.jsx(U3,{asChild:!0,isActive:d.url==="/"?a.pathname==="/":d.url==="/settings"?a.pathname==="/settings":a.pathname.startsWith(d.url),tooltip:d.title,children:s.jsxs(W3,{to:d.url,end:d.url==="/"||d.url==="/settings",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($3,{className:r?"px-2 py-2":"px-3 py-3",children:[s.jsx(WS,{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(k9,{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 V3=m.forwardRef(({...e},t)=>s.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));V3.displayName="Breadcrumb";const H3=m.forwardRef(({className:e,...t},n)=>s.jsx("ol",{ref:n,className:Re("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 K3=m.forwardRef(({className:e,...t},n)=>s.jsx("li",{ref:n,className:Re("inline-flex items-center gap-1.5",e),...t}));K3.displayName="BreadcrumbItem";const G3=m.forwardRef(({asChild:e,className:t,...n},r)=>{const a=e?So:"a";return s.jsx(a,{ref:r,className:Re("transition-colors hover:text-foreground",t),...n})});G3.displayName="BreadcrumbLink";const Y3=m.forwardRef(({className:e,...t},n)=>s.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:Re("font-normal text-foreground",e),...t}));Y3.displayName="BreadcrumbPage";const X3=({children:e,className:t,...n})=>s.jsx("li",{role:"presentation","aria-hidden":"true",className:Re("[&>svg]:size-3.5",t),...n,children:e??s.jsx(zN,{})});X3.displayName="BreadcrumbSeparator";function Oa(){return{input:0,output:0,total:0,hasInput:!1,hasOutput:!1,hasTotal:!1}}function jc(e,t){t&&(typeof t.inputTokens=="number"&&(e.input+=t.inputTokens,e.hasInput=!0),typeof t.outputTokens=="number"&&(e.output+=t.outputTokens,e.hasOutput=!0),typeof t.totalTokens=="number"&&(e.total+=t.totalTokens,e.hasTotal=!0))}function ci(e){return!e.hasInput&&!e.hasOutput&&!e.hasTotal?null:{inputTokens:e.hasInput?e.input:null,outputTokens:e.hasOutput?e.output:null,totalTokens:e.hasTotal?e.total:null}}function xX(e){const t=Oa();for(const n of e)jc(t,n);return ci(t)}const yX={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",pdf:"application/pdf",txt:"text/plain",md:"text/markdown",csv:"text/csv"};function bX(e){return e.startsWith("image/")?"image":"document"}function wX(e){return e?.split(".").pop()?.toLowerCase()??""}function jX(e){if(e.media_type)return e.media_type;if(e.path)return yX[wX(e.path)]}function SX(e,t){return`${e}-${t+1}`}function Fd(e){return zn(e)||void 0}function NX(e){const t=e.media_type??jX(e)??"application/octet-stream";return{type:bX(t),media_type:t,data:e.data??"",...e.url?{url:e.url}:{},...e.name?{name:e.name}:{}}}function CX(e){switch(e.type){case"regex":return{type:"response_regex",value:e.pattern};case"contains":return{type:"response_contains",value:e.value};case"not_contains":return{type:"response_not_contains",value:e.value};case"starts_with":return{type:"response_starts_with",value:e.value};case"ends_with":return{type:"response_ends_with",value:e.value};case"equals":return{type:"response_equals",value:e.value};case"jsonpath":return{type:"response_jsonpath",path:e.path,equals:e.equals};case"jsonpath_exists":return{type:"response_jsonpath_exists",path:e.path};case"jsonpath_not_exists":return{type:"response_jsonpath_not_exists",path:e.path};default:throw new Error(`Unsupported response assertion type in config: ${String(e?.type??"(missing type)")}`)}}function _X(e){return e.type==="required_tool"||e.type==="forbidden_tool"||e.type==="tool_sequence"||e.type==="agent_check"?null:e.type==="response_contains"?e.value?{type:"contains",value:e.value}:null:e.type==="response_not_contains"?e.value?{type:"not_contains",value:e.value}:null:e.type==="response_starts_with"?e.value?{type:"starts_with",value:e.value}:null:e.type==="response_ends_with"?e.value?{type:"ends_with",value:e.value}:null:e.type==="response_equals"?e.value?{type:"equals",value:e.value}:null:e.type==="response_regex"?e.value?{type:"regex",pattern:e.value}:null:e.type==="response_jsonpath"?e.path?.trim()?e.equals!==void 0?{type:"jsonpath",path:e.path.trim(),equals:e.equals}:{type:"jsonpath",path:e.path.trim()}:null:e.type==="response_jsonpath_exists"?e.path?.trim()?{type:"jsonpath_exists",path:e.path.trim()}:null:e.type==="response_jsonpath_not_exists"&&e.path?.trim()?{type:"jsonpath_not_exists",path:e.path.trim()}:null}function AX(e,t){const n=e.filter(h=>h.type==="required_tool").map(h=>h.value).filter(h=>typeof h=="string"&&h.length>0),r=e.filter(h=>h.type==="forbidden_tool").map(h=>h.value).filter(h=>typeof h=="string"&&h.length>0),a=e.find(h=>h.type==="tool_sequence")?.sequence?.map(h=>h.trim()).filter(h=>typeof h=="string"&&h.length>0),i=e.map(h=>_X(h)).filter(h=>!!h),o=e.filter(h=>h.type==="agent_check").flatMap(h=>h.label?.trim()&&h.prompt?.trim()?[{label:h.label.trim(),prompt:h.prompt.trim()}]:[]),c=n.length>0||r.length>0?{...n.length>0?{required_tools:n}:{},...r.length>0?{forbidden_tools:r}:{}}:void 0,d={...t?.include_prompt?{include_prompt:!0}:{},...t?.include_tool_sequence?{include_tool_sequence:!0}:{}},f=Object.keys(d).length>0;if(!(!c&&!a?.length&&i.length===0&&o.length===0&&!f))return{...c?{tool_constraints:c}:{},...a&&a.length>0?{tool_sequence:a}:{},...i.length>0?{response_assertions:i}:{},...o.length>0?{agent_assertions:o}:{},...f?{agent_context:d}:{}}}function kX(e){if(e.length!==0)return e.map(t=>({name:t.name,from:"final_text",regex:t.pattern}))}function Q3(e,t){const n=AX(e.evalRules,e.agentContext),r=kX(e.extractRules);return{id:e.id,name:Fd(e.name),mcp_servers:t,prompt:e.prompt,attachments:e.attachments,eval:n,extract:r}}function gP(e){if(!("id"in e)||!e.id)return null;const t=String(e.id),n=e.auth,r={id:t,name:String(e.name||t),transport:"streamable-http",url:String(e.url||""),authType:n?.type==="bearer"?"bearer":n?.type==="api_key"||n?.type==="oauth_client_credentials"?"api-key":n?.type==="oauth_authorization_code"?"oauth2":"none",authValue:n?.type==="bearer"?String(n.token||"")||(n.env?`\${${n.env}}`:void 0):n?.type==="api_key"?String(n.value||""):void 0,apiKeyHeaderName:n?.type==="api_key"?String(n.header_name||""):void 0,oauthClientId:n?.type==="oauth_authorization_code"&&String(n.client_id||"")||void 0,oauthClientSecret:n?.type==="oauth_authorization_code"&&String(n.client_secret||"")||void 0,oauthRedirectUrl:n?.type==="oauth_authorization_code"&&String(n.redirect_url||"")||void 0,oauthScope:(n?.type==="oauth_authorization_code"||n?.type==="oauth_client_credentials")&&String(n.scope||"")||void 0,oauthMode:n?.type==="oauth_authorization_code"?n.mode:void 0,oauthAuthorizationUrl:n?.type==="oauth_authorization_code"&&String(n.authorization_url||"")||void 0,oauthTokenEndpoint:n?.type==="oauth_authorization_code"&&String(n.token_url||"")||void 0,oauthTokenUrl:n?.type==="oauth_client_credentials"?String(n.token_url||""):void 0,oauthClientIdEnv:n?.type==="oauth_client_credentials"?String(n.client_id_env||""):void 0,oauthClientSecretEnv:n?.type==="oauth_client_credentials"?String(n.client_secret_env||""):void 0,oauthAudience:n?.type==="oauth_client_credentials"&&String(n.audience||"")||void 0};return{id:t,server:r}}function Kh(e){const t=typeof e.config.name=="string"&&e.config.name.trim().length>0?e.config.name.trim():void 0,n=Array.isArray(e.config.servers)?e.config.servers:[],r=Array.isArray(e.config.agents)?e.config.agents:[],a=new Map,i=[],o=[];for(const p of n){if("ref"in p){const y=String(p.ref||"").trim();if(!y)continue;a.set(y,y),o.push({kind:"referenced",ref:y});continue}const v=String(p.id||p.name||"").trim();if(!v)continue;const x=v;a.set(v,x);const j=p.auth?.type==="bearer"?"bearer":p.auth?.type==="api_key"||p.auth?.type==="oauth_client_credentials"?"api-key":p.auth?.type==="oauth_authorization_code"?"oauth2":"none",b={id:x,name:String(p.name||v),transport:"streamable-http",url:p.url,authType:j,authValue:p.auth?.type==="bearer"?p.auth.token??(p.auth.env?`\${${p.auth.env}}`:void 0):p.auth?.type==="api_key"?p.auth.value:void 0,apiKeyHeaderName:p.auth?.type==="api_key"?p.auth.header_name:void 0,oauthClientId:p.auth?.type==="oauth_authorization_code"?p.auth.client_id:void 0,oauthClientSecret:p.auth?.type==="oauth_authorization_code"?p.auth.client_secret:void 0,oauthRedirectUrl:p.auth?.type==="oauth_authorization_code"?p.auth.redirect_url:void 0,oauthScope:p.auth?.type==="oauth_authorization_code"||p.auth?.type==="oauth_client_credentials"?p.auth.scope:void 0,oauthMode:p.auth?.type==="oauth_authorization_code"?p.auth.mode:void 0,oauthAuthorizationUrl:p.auth?.type==="oauth_authorization_code"?p.auth.authorization_url:void 0,oauthTokenEndpoint:p.auth?.type==="oauth_authorization_code"?p.auth.token_url:void 0,oauthTokenUrl:p.auth?.type==="oauth_client_credentials"?p.auth.token_url:void 0,oauthClientIdEnv:p.auth?.type==="oauth_client_credentials"?p.auth.client_id_env:void 0,oauthClientSecretEnv:p.auth?.type==="oauth_client_credentials"?p.auth.client_secret_env:void 0,oauthAudience:p.auth?.type==="oauth_client_credentials"?p.auth.audience:void 0};i.push(b),o.push({kind:"inline",server:b})}const c=[],d=[];for(const p of r){if("ref"in p){const y=String(p.ref||"").trim();if(!y)continue;d.push({kind:"referenced",ref:y});continue}const v=String(p.id||p.name||"").trim();if(!v)continue;const x=v,j=p.provider==="azure_openai"?"azure":p.provider,b={id:x,name:String(p.name||v),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,v)=>{if("ref"in p){const y=String(p.ref||"").trim();if(!y)return;const S=p.mcp_servers,N=Array.isArray(S)?S.flatMap(_=>{const A=_;if("ref"in A&&A.ref)return[{kind:"referenced",ref:String(A.ref)}];const k=gP(A);return k?[{kind:"inline",server:k.server}]:[]}):void 0;h.push({kind:"referenced",ref:y,...N?{mcpServers:N}:{}});return}const x=[];for(const y of p.eval?.tool_constraints?.required_tools??[])x.push({type:"required_tool",value:y});for(const y of p.eval?.tool_constraints?.forbidden_tools??[])x.push({type:"forbidden_tool",value:y});p.eval?.tool_sequence?.length&&x.push({type:"tool_sequence",sequence:[...p.eval.tool_sequence]});for(const y of p.eval?.response_assertions??[])x.push(CX(y));for(const y of p.eval?.agent_assertions??[])x.push({type:"agent_check",label:y.label,prompt:y.prompt});const j=p.eval?.agent_context&&(p.eval.agent_context.include_prompt||p.eval.agent_context.include_tool_sequence)?{include_prompt:p.eval.agent_context.include_prompt,include_tool_sequence:p.eval.agent_context.include_tool_sequence}:void 0,b={id:p.id||SX("scn",v),name:Fd(p.name)||p.id||`Scenario ${v+1}`,serverIds:(()=>{if((p.servers??[]).length>0)return p.servers.map(S=>a.get(S)??S).filter(Boolean);const y=p.mcp_servers;return Array.isArray(y)?y.flatMap(S=>{if("ref"in S&&S.ref)return[String(S.ref)];const N=gP(S);if(N){const _=N.id;return a.has(_)||(a.set(_,_),i.push(N.server),o.push({kind:"inline",server:i[i.length-1]})),[_]}return[]}):[]})(),prompt:p.prompt,attachments:p.attachments?.map(NX),evalRules:x,extractRules:(p.extract??[]).map(y=>({name:y.name,pattern:y.regex})),...j?{agentContext:j}:{}};f.push(b),h.push({kind:"inline",scenario:b})}),{id:e.id,name:t||e.name,configName:t,configHash:e.hash,description:e.path,...e.relativePath?{relativePath:e.relativePath}:{},...e.suitePath!==void 0?{suitePath:e.suitePath}:{},loadError:e.error,loadWarnings:e.warnings,servers:i,serverEntries:o,agents:c,agentEntries:d,scenarios:f,scenarioEntries:h,runDefaults:e.config.run_defaults?.selected_agents&&e.config.run_defaults.selected_agents.length>0?{selectedAgentNames:[...e.config.run_defaults.selected_agents]}:void 0,createdAt:e.mtime,updatedAt:e.mtime,sourcePath:e.path}}function EX(e){const t={id:"library",name:"library",path:"library",mtime:new Date(0).toISOString(),hash:"",config:{servers:Object.entries(e.servers).map(([r,a])=>({id:r,name:Fd(a.name)||r,transport:a.transport,url:a.url,auth:a.auth})),agents:Object.entries(e.agents).map(([r,a])=>({id:r,name:Fd(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.map((r,a)=>({...r,name:Fd(r.name)||r.id||`Scenario ${a+1}`}))}},n=Kh(t);return{servers:n.servers,agents:n.agents,scenarios:n.scenarios}}function vP(e){const t=new Map,n=x=>{const j=x.id,b=x.authValue?.trim()??"",y=x.apiKeyHeaderName?.trim()??"",S=x.authType==="bearer"?(()=>{if(!b)throw new Error(`Server '${j}' is missing bearer token value`);return{type:"bearer",token:b}})():x.authType==="api-key"&&!x.oauthTokenUrl?{type:"api_key",...y?{header_name:y}:{},value:(()=>{if(!b)throw new Error(`Server '${j}' is missing API key value`);return b})()}:x.authType==="api-key"?{type:"oauth_client_credentials",token_url:x.oauthTokenUrl||"",client_id_env:x.oauthClientIdEnv||"",client_secret_env:x.oauthClientSecretEnv||"",...x.oauthScope?{scope:x.oauthScope}:{},...x.oauthAudience?{audience:x.oauthAudience}:{}}:x.authType==="oauth2"?{type:"oauth_authorization_code",...x.oauthMode==="dcr"?{mode:"dcr"}:{},...x.oauthMode!=="dcr"&&x.oauthClientId?{client_id:x.oauthClientId}:{},...x.oauthClientSecret?{client_secret:x.oauthClientSecret}:{},...x.oauthRedirectUrl?{redirect_url:x.oauthRedirectUrl}:{},...x.oauthScope?{scope:x.oauthScope}:{},...x.oauthAuthorizationUrl?{authorization_url:x.oauthAuthorizationUrl}:{},...x.oauthTokenEndpoint?{token_url:x.oauthTokenEndpoint}:{}}:void 0;return{id:j,...x.name&&x.name!==j?{name:x.name}:{},transport:"http",url:x.url||"http://localhost:3000/mcp",...S!==void 0?{auth:S}:{}}},r=e.serverEntries&&e.serverEntries.length>0?e.serverEntries:[...e.servers.map(x=>({kind:"inline",server:x}))],a=new Set,i=new Map,o=r.flatMap(x=>{if(x.kind==="referenced"){const b=String(x.ref||"").trim();return!b||a.has(b)?[]:(a.add(b),t.set(b,b),[{ref:b}])}const j=n(x.server);return t.set(x.server.id,j.id),i.set(j.id,j),[j]}),c=x=>{const j=x.id;return{id:j,...x.name&&x.name!==j?{name:x.name}:{},provider:x.provider==="azure"?"azure_openai":x.provider==="anthropic"?"anthropic":"openai",model:x.model,temperature:x.temperature,max_tokens:x.maxTokens,max_turns:x.maxTurns,system:x.systemPrompt}},d=e.agentEntries&&e.agentEntries.length>0?e.agentEntries:[...e.agents.map(x=>({kind:"inline",agent:x}))],f=new Set,h=d.flatMap(x=>{if(x.kind==="referenced"){const j=String(x.ref||"").trim();return!j||f.has(j)?[]:(f.add(j),[{ref:j}])}return[c(x.agent)]}),p=x=>{const j=x.serverIds.length>0?x.serverIds.map(b=>{const y=t.get(b)??b;return i.get(y)??{ref:y}}):void 0;return Q3(x,j)},v=e.scenarioEntries&&e.scenarioEntries.length>0?e.scenarioEntries.map(x=>x.kind==="referenced"?{ref:x.ref,...Array.isArray(x.mcpServers)?{mcp_servers:x.mcpServers.map(j=>j.kind==="referenced"?{ref:j.ref}:n(j.server))}:{}}:p(x.scenario)):[...e.scenarios.map(x=>p(x))];return{name:e.configName?.trim()||void 0,servers:o,agents:h,scenarios:v,run_defaults:e.runDefaults?.selectedAgentNames&&e.runDefaults.selectedAgentNames.length>0?{selected_agents:[...e.runDefaults.selectedAgentNames]}:void 0}}function PX(e){const t=Object.fromEntries((e.servers??[]).map(r=>[r.id,(()=>{const a=r.authValue?.trim()??"",i=r.apiKeyHeaderName?.trim()??"";return{...r.name&&r.name!==r.id?{name:r.name}:{},transport:"http",url:r.url||"http://localhost:3000/mcp",auth:r.authType==="bearer"?(()=>{if(!a)throw new Error(`Server '${r.id}' is missing bearer token value`);return{type:"bearer",token:a}})():r.authType==="api-key"&&!r.oauthTokenUrl?{type:"api_key",...i?{header_name:i}:{},value:(()=>{if(!a)throw new Error(`Server '${r.id}' is missing API key value`);return a})()}:r.authType==="api-key"?{type:"oauth_client_credentials",token_url:r.oauthTokenUrl||"",client_id_env:r.oauthClientIdEnv||"",client_secret_env:r.oauthClientSecretEnv||"",...r.oauthScope?{scope:r.oauthScope}:{},...r.oauthAudience?{audience:r.oauthAudience}:{}}:r.authType==="oauth2"?{type:"oauth_authorization_code",...r.oauthMode==="dcr"?{mode:"dcr"}:{},...r.oauthMode!=="dcr"&&r.oauthClientId?{client_id:r.oauthClientId}:{},...r.oauthClientSecret?{client_secret:r.oauthClientSecret}:{},...r.oauthRedirectUrl?{redirect_url:r.oauthRedirectUrl}:{},...r.oauthScope?{scope:r.oauthScope}:{},...r.oauthAuthorizationUrl?{authorization_url:r.oauthAuthorizationUrl}:{},...r.oauthTokenEndpoint?{token_url:r.oauthTokenEndpoint}:{}}:void 0}})()])),n=Object.fromEntries(e.agents.map(r=>[r.id,{...r.name&&r.name!==r.id?{name:r.name}:{},provider:r.provider==="azure"?"azure_openai":r.provider==="anthropic"?"anthropic":"openai",model:r.model,temperature:r.temperature,max_tokens:r.maxTokens,max_turns:r.maxTurns,system:r.systemPrompt}]));return{servers:t,agents:n,scenarios:e.scenarios.map(r=>Q3(r,r.serverIds.length>0?r.serverIds.map(a=>({ref:a})):void 0))}}function TX(e,t){if(e)return`${e}::${t??""}`}function Ky(e){return e.type==="text"}function Z3(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 J3(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"){for(const c of o.content)c.type==="text"?n.push({id:`user_prompt-${n.length}`,kind:"user_prompt",text:c.text,timestamp:o.ts}):c.type==="image"?n.push({id:`attachment-${n.length}`,kind:"user_prompt",text:`[Attached image: ${c.name??"image"}]`,timestamp:o.ts}):c.type==="document"&&n.push({id:`attachment-${n.length}`,kind:"user_prompt",text:`[Attached document: ${c.name??"document"} (${c.media_type})]`,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 v of d.content)v.type==="tool_result"&&(v.tool_use_id?h.set(v.tool_use_id,v):p.push(v));for(const v of c){n.push({id:`tool_call-${n.length}`,kind:"tool_call",text:xP(v.input??{}),toolName:v.name,timestamp:o.ts,estimatedTokens:v.estimated_tokens?{inputTokens:v.estimated_tokens.input,outputTokens:v.estimated_tokens.output,totalTokens:v.estimated_tokens.total}:void 0,estimatedTokenMethod:v.estimated_tokens?.method});const x=h.get(v.id);if(!x)continue;const j=x.content.filter(Ky).map(b=>b.text).join(`
|
|
54
|
+
`);n.push({id:`tool_result-${n.length}`,kind:"tool_result",text:j,toolName:x.name,ok:!x.is_error,durationMs:x.duration_ms,timestamp:x.ts_end??d.ts,estimatedTokens:x.estimated_tokens?{inputTokens:x.estimated_tokens.input,outputTokens:x.estimated_tokens.output,totalTokens:x.estimated_tokens.total}:void 0,estimatedTokenMethod:x.estimated_tokens?.method}),h.delete(v.id)}for(const v of[...h.values(),...p]){const x=v.content.filter(Ky).map(j=>j.text).join(`
|
|
55
|
+
`);n.push({id:`tool_result-${n.length}`,kind:"tool_result",text:x,toolName:v.name,ok:!v.is_error,durationMs:v.duration_ms,timestamp:v.ts_end??d.ts,estimatedTokens:v.estimated_tokens?{inputTokens:v.estimated_tokens.input,outputTokens:v.estimated_tokens.output,totalTokens:v.estimated_tokens.total}:void 0,estimatedTokenMethod:v.estimated_tokens?.method})}i+=1}else for(const h of c)n.push({id:`tool_call-${n.length}`,kind:"tool_call",text:xP(h.input??{}),toolName:h.name,timestamp:o.ts,estimatedTokens:h.estimated_tokens?{inputTokens:h.estimated_tokens.input,outputTokens:h.estimated_tokens.output,totalTokens:h.estimated_tokens.total}:void 0,estimatedTokenMethod:h.estimated_tokens?.method});continue}if(o.role==="tool")for(const c of o.content){if(c.type!=="tool_result")continue;const d=c.content.filter(Ky).map(f=>f.text).join(`
|
|
56
|
+
`);n.push({id:`tool_result-${n.length}`,kind:"tool_result",text:d,toolName:c.name,ok:!c.is_error,durationMs:c.duration_ms,timestamp:c.ts_end??o.ts,estimatedTokens:c.estimated_tokens?{inputTokens:c.estimated_tokens.input,outputTokens:c.estimated_tokens.output,totalTokens:c.estimated_tokens.total}:void 0,estimatedTokenMethod:c.estimated_tokens?.method})}}return typeof r=="number"&&n[r]&&(n[r]={...n[r],kind:"assistant_final"}),n}function xP(e){try{return JSON.stringify(e)}catch{return String(e)}}function yP(e,t){t&&(typeof t.input_tokens=="number"&&(e.input+=t.input_tokens,e.hasInput=!0),typeof t.output_tokens=="number"&&(e.output+=t.output_tokens,e.hasOutput=!0),typeof t.total_tokens=="number"&&(e.total+=t.total_tokens,e.hasTotal=!0))}function Gy(e,t){if(typeof e!="number"||t<=0)return new Array(t).fill(void 0);const n=Math.floor(e/t),r=e%t;return Array.from({length:t},(a,i)=>n+(i<r?1:0))}function eL(e){const t=Oa(),n=Oa(),r=new Map;if(!e)return{assistant:null,tool:null,perTool:{}};for(const i of e.messages??[]){if(i.role!=="assistant")continue;yP(t,i.usage);const o=i.content.filter(p=>p.type==="tool_use");if(o.length===0)continue;if(o.every(p=>!!p.estimated_tokens)){for(const p of o){const v=p.estimated_tokens;n.input+=v.input,n.hasInput=!0,n.output+=v.output,n.hasOutput=!0,n.total+=v.total,n.hasTotal=!0;const x=r.get(p.name)??Oa();x.input+=v.input,x.hasInput=!0,x.output+=v.output,x.hasOutput=!0,x.total+=v.total,x.hasTotal=!0,r.set(p.name,x)}continue}yP(n,i.usage);const d=Gy(i.usage?.input_tokens,o.length),f=Gy(i.usage?.output_tokens,o.length),h=Gy(i.usage?.total_tokens,o.length);for(let p=0;p<o.length;p+=1){const v=o[p].name,x=r.get(v)??Oa(),j=d[p],b=f[p],y=h[p];typeof j=="number"&&(x.input+=j,x.hasInput=!0),typeof b=="number"&&(x.output+=b,x.hasOutput=!0),typeof y=="number"&&(x.total+=y,x.hasTotal=!0),r.set(v,x)}}const a={};for(const[i,o]of Array.from(r.entries()).sort((c,d)=>c[0].localeCompare(d[0]))){const c=ci(o);c&&(a[i]=c)}return{assistant:ci(t),tool:ci(n),perTool:a}}function tL(e,t){if(t){const n=Date.parse(t.ts_start),r=Date.parse(t.ts_end);if(Number.isFinite(n)&&Number.isFinite(r))return Math.max(0,r-n)}return e.tool_durations_ms.reduce((n,r)=>n+r,0)}function bP(e,t=[]){const n=new Map;for(const o of t){const c=TX(o.scenario_id,o.agent);if(!c)continue;const d=n.get(c)??[];d.push(o),n.set(c,d)}const r=e.scenarios.map(o=>{const c=n.get(`${o.scenario_id}::${o.agent}`)??[],d=new Map;for(const y of c)d.set(y.run_index,y);const f=o.runs.map((y,S)=>{const N=d.get(y.run_index)??c[S],_=eL(N);return{runIndex:y.run_index,passed:y.pass,error:y.error,toolCalls:Z3(y,N),assistantTokenUsage:_.assistant,toolTokenUsage:_.tool,toolTokenUsageByTool:_.perTool,finalAnswer:y.final_text,conversation:J3(N),duration:tL(y,N),extractedValues:Object.fromEntries(Object.entries(y.extracted).map(([A,k])=>[A,String(k??"")])),failureReasons:y.failures,checkResults:y.check_results}}),h=Oa(),p=Oa(),v=new Map;for(const y of f){jc(h,y.assistantTokenUsage),jc(p,y.toolTokenUsage);for(const[S,N]of Object.entries(y.toolTokenUsageByTool??{})){const _=v.get(S)??Oa();jc(_,N),v.set(S,_)}}const x={};for(const[y,S]of Array.from(v.entries()).sort((N,_)=>N[0].localeCompare(_[0]))){const N=ci(S);N&&(x[y]=N)}const j=f.length===0?0:Math.round(f.reduce((y,S)=>y+S.duration,0)/f.length),b=f.length===0?0:f.reduce((y,S)=>y+S.toolCalls.length,0)/f.length;return{scenarioId:o.scenario_id,scenarioName:o.scenario_name||o.scenario_id,agentId:o.agent,agentName:o.agent,provider:o.provider,model:o.model,runs:f,passRate:o.pass_rate,avgToolCalls:b,avgDuration:j,assistantTokenUsage:ci(h),toolTokenUsage:ci(p),toolTokenUsageByTool:x}}),a=Oa(),i=Oa();for(const o of r)jc(a,o.assistantTokenUsage),jc(i,o.toolTokenUsage);return{id:e.metadata.run_id,configId:"",configHash:e.metadata.config_hash,configPath:e.metadata.config_path,configName:e.metadata.config_name,rerunAgents:e.metadata.rerun_agents,rerunScenarioIds:e.metadata.rerun_scenario_ids,rerunServerOverrideAll:e.metadata.rerun_server_override_all,rerunScenarioServerOverrides:e.metadata.rerun_scenario_server_overrides,timestamp:e.metadata.timestamp,runNote:e.metadata.run_note,mcpServerVersions:e.metadata.mcp_server_versions??{},scenarios:r,assistantTokenUsage:ci(a),toolTokenUsage:ci(i),overallPassRate:e.summary.pass_rate,totalScenarios:e.summary.total_scenarios,totalRuns:e.summary.total_runs,avgToolCalls:e.summary.avg_tool_calls_per_run,avgLatency:Math.round(e.summary.avg_tool_latency_ms??0),totalToolDurationMs:typeof e.metadata.total_tool_duration_ms=="number"?Math.max(0,e.metadata.total_tool_duration_ms??0):0}}function RX(e,t){const n=eL(t??void 0);return{runIndex:e.run_index,passed:e.pass,error:e.error,toolCalls:Z3(e,t??void 0),assistantTokenUsage:n.assistant,toolTokenUsage:n.tool,toolTokenUsageByTool:n.perTool,finalAnswer:e.final_text,conversation:J3(t??void 0),duration:tL(e,t??void 0),extractedValues:Object.fromEntries(Object.entries(e.extracted).map(([r,a])=>[r,String(a??"")])),failureReasons:e.failures,checkResults:e.check_results}}function OX(){return typeof window>"u"?"":window.location.port==="8685"?"http://127.0.0.1:8787":""}const ui=OX();class dC extends Error{constructor(t,n){super(n),this.status=t,this.name="ApiError"}status}async function Nt(e,t){const n=await fetch(`${ui}${e}`,{...t,headers:{"content-type":"application/json",...t?.headers||{}}});if(!n.ok){const r=await n.text();throw new dC(n.status,`Request failed (${n.status}): ${r}`)}return await n.json()}async function MX(e,t){const n=await fetch(`${ui}${e}`,{...t,headers:{}});if(!n.ok){const r=await n.text();throw new dC(n.status,`Request failed (${n.status}): ${r}`)}return n.text()}function wP(e,t){const n=new EventSource(`${ui}${e}`),r=e.replace(/\/events$/,""),a=["session_started","turn_started","tool_call_requested","tool_call_approved","tool_call_denied","tool_call_resolved","assistant_message_completed","session_warning","session_error","session_finished"];let i=!1;const o=()=>{i||(i=!0,n.close())},c=d=>{if(!i&&!(typeof d.data!="string"||!d.data))try{const f=JSON.parse(d.data);f.type==="session_finished"&&o(),t(f)}catch{}};for(const d of a)n.addEventListener(d,c);return n.onerror=()=>{if(!i){if(n.readyState===2){o();return}fetch(`${ui}${r}`,{method:"GET",cache:"no-store",headers:{accept:"application/json"}}).then(d=>{(d.status===404||d.status===410)&&o()}).catch(()=>{})}},()=>o()}function Yy(e,t,n){if(typeof n!="number"||!Number.isFinite(n))return;const r=Math.floor(n);r<=0||e.set(t,String(r))}function Xy(e,t,n){if(typeof n!="number"||!Number.isFinite(n))return;const r=Math.floor(n);r<0||e.set(t,String(r))}const ct={health:()=>Nt("/api/health"),getSettings:()=>Nt("/api/settings"),updateSettings:e=>Nt("/api/settings",{method:"PUT",body:JSON.stringify(e)}),listConfigs:()=>Nt("/api/evals"),createConfig:(e,t)=>Nt("/api/evals",{method:"POST",body:JSON.stringify({fileName:e,config:t})}),updateConfig:(e,t,n)=>Nt(`/api/evals/${e}`,{method:"PUT",body:JSON.stringify({config:t,fileName:n})}),deleteConfig:e=>Nt(`/api/evals/${e}`,{method:"DELETE"}),listRuns:e=>{const t=new URLSearchParams;e?.since?.trim()&&t.set("since",e.since.trim()),e?.until?.trim()&&t.set("until",e.until.trim()),typeof e?.lastDays=="number"&&Number.isFinite(e.lastDays)&&e.lastDays>0&&t.set("last_days",String(Math.floor(e.lastDays))),e?.scenario?.trim()&&t.set("scenario",e.scenario.trim()),Yy(t,"limit",e?.limit),Xy(t,"offset",e?.offset);const n=t.size>0?`?${t.toString()}`:"";return Nt(`/api/runs${n}`)},getLatestPassRatesByConfigIds:e=>Nt("/api/runs/latest-pass-rates",{method:"POST",body:JSON.stringify(e)}).then(t=>t.byConfigId),listMarkdownReports:e=>{const t=new URLSearchParams;Yy(t,"limit",e?.limit),Xy(t,"offset",e?.offset);const n=t.size>0?`?${t.toString()}`:"";return Nt(`/api/markdown-reports${n}`)},listToolAnalysisServers:()=>Nt("/api/tool-analysis-results/servers").then(e=>e.data),getMarkdownReport:e=>Nt(`/api/markdown-reports/content?path=${encodeURIComponent(e)}`),getMarkdownReportById:e=>Nt(`/api/markdown-reports/${encodeURIComponent(e)}`),deleteMarkdownReport:e=>Nt(`/api/markdown-reports?path=${encodeURIComponent(e)}`,{method:"DELETE"}).then(()=>{}),getRun:e=>Nt(`/api/runs/${e}`),deleteRun:e=>Nt(`/api/runs/${e}`,{method:"DELETE"}),updateRunNote:(e,t)=>Nt(`/api/runs/${encodeURIComponent(e)}/note`,{method:"PATCH",body:JSON.stringify({runNote:t??""})}).then(()=>{}),getRunTrace:e=>Nt(`/api/runs/${e}/trace`),applyResultAssistantReport:e=>Nt(`/api/runs/${encodeURIComponent(e.runId)}/assistant/apply-report`,{method:"POST",body:JSON.stringify({markdown:e.markdown,outputPath:e.outputPath,overwrite:e.overwrite})}),createResultAssistantSession:(e,t)=>Nt("/api/result-assistant/sessions",{method:"POST",body:JSON.stringify(e),signal:t}),getResultAssistantSession:e=>Nt(`/api/result-assistant/sessions/${e}`),sendResultAssistantMessage:(e,t,n)=>Nt(`/api/result-assistant/sessions/${e}/messages`,{method:"POST",body:JSON.stringify({message:t}),signal:n}),approveResultAssistantToolCall:(e,t,n)=>Nt(`/api/result-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:"POST",body:JSON.stringify(n===void 0?{}:{argumentsOverride:n})}),denyResultAssistantToolCall:(e,t)=>Nt(`/api/result-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:"POST",body:JSON.stringify({})}),closeResultAssistantSession:e=>Nt(`/api/result-assistant/sessions/${e}`,{method:"DELETE"}).then(()=>{}),subscribeResultAssistantSessionEvents:(e,t)=>wP(`/api/result-assistant/sessions/${e}/events`,t),getLibraries:()=>Nt("/api/libraries"),saveLibraries:e=>Nt("/api/libraries",{method:"PUT",body:JSON.stringify(e)}),startRun:e=>Nt("/api/runs",{method:"POST",body:JSON.stringify(e)}),runScenarioPreview:e=>Nt("/api/runs/preview",{method:"POST",body:JSON.stringify(e)}),listProviderModels:e=>Nt(`/api/providers/models?provider=${encodeURIComponent(e)}`),createScenarioAssistantSession:(e,t)=>Nt("/api/scenario-assistant/sessions",{method:"POST",body:JSON.stringify(e),signal:t}),getScenarioAssistantSession:e=>Nt(`/api/scenario-assistant/sessions/${e}`),sendScenarioAssistantMessage:(e,t,n)=>Nt(`/api/scenario-assistant/sessions/${e}/messages`,{method:"POST",body:JSON.stringify({message:t}),signal:n}),approveScenarioAssistantToolCall:(e,t)=>Nt(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:"POST",body:JSON.stringify({})}),denyScenarioAssistantToolCall:(e,t)=>Nt(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:"POST",body:JSON.stringify({})}),approveAllScenarioAssistantToolCalls:e=>Nt(`/api/scenario-assistant/sessions/${e}/tool-calls/approve-all`,{method:"POST",body:JSON.stringify({})}),closeScenarioAssistantSession:e=>Nt(`/api/scenario-assistant/sessions/${e}`,{method:"DELETE"}),subscribeScenarioAssistantSessionEvents:(e,t)=>wP(`/api/scenario-assistant/sessions/${e}/events`,t),discoverToolsForAnalysis:e=>Nt("/api/tool-analysis/discover-tools",{method:"POST",body:JSON.stringify(e)}),startToolAnalysis:e=>Nt("/api/tool-analysis/jobs",{method:"POST",body:JSON.stringify(e)}),getToolAnalysisResult:e=>Nt(`/api/tool-analysis/jobs/${e}/result`),stopToolAnalysis:e=>Nt(`/api/tool-analysis/jobs/${e}/stop`,{method:"POST"}),subscribeToolAnalysisJob:(e,t)=>{const n=new EventSource(`${ui}/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:e=>{const t=new URLSearchParams;Yy(t,"limit",e?.limit),Xy(t,"offset",e?.offset),e?.server?.trim()&&t.set("server",e.server.trim());const n=t.size>0?`?${t.toString()}`:"";return Nt(`/api/tool-analysis-results${n}`)},getToolAnalysisSavedResult:e=>Nt(`/api/tool-analysis-results/${e}`),deleteToolAnalysisSavedResult:e=>Nt(`/api/tool-analysis-results/${e}`,{method:"DELETE"}).then(()=>{}),createOAuthDebuggerSession:e=>Nt("/api/oauth-debugger/sessions",{method:"POST",body:JSON.stringify(e)}),getOAuthDebuggerSession:e=>Nt(`/api/oauth-debugger/sessions/${e}`),startOAuthDebuggerSession:e=>Nt(`/api/oauth-debugger/sessions/${e}/start`,{method:"POST",body:JSON.stringify({})}),subscribeOAuthDebuggerSession:(e,t)=>{const n=new EventSource(`${ui}/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)=>Nt(`/api/oauth-debugger/sessions/${e}/manual-callback`,{method:"POST",body:JSON.stringify(t)}),stopOAuthDebuggerSession:e=>Nt(`/api/oauth-debugger/sessions/${e}/stop`,{method:"POST",body:JSON.stringify({})}),exportOAuthDebuggerSession:(e,t)=>t==="json"?Nt(`/api/oauth-debugger/sessions/${e}/export?format=json`):MX(`/api/oauth-debugger/sessions/${e}/export?format=${t}`),createOAuthRuntimeSession:e=>Nt("/api/oauth-runtime/sessions",{method:"POST",body:JSON.stringify(e)}),getOAuthRuntimeSession:e=>Nt(`/api/oauth-runtime/sessions/${e}`),getOAuthRuntimeSessionToken:e=>Nt(`/api/oauth-runtime/sessions/${e}/token`),submitOAuthRuntimeCallback:(e,t)=>Nt(`/api/oauth-runtime/sessions/${e}/callback`,{method:"POST",body:JSON.stringify(t)}),cancelOAuthRuntimeSession:e=>Nt(`/api/oauth-runtime/sessions/${e}/cancel`,{method:"POST",body:JSON.stringify({})}),ensureOAuthServers:e=>Nt("/api/oauth-runtime/servers/ensure",{method:"POST",body:JSON.stringify(e)}),stopRun:e=>Nt(`/api/runs/jobs/${e}/stop`,{method:"POST"}),getRunQueue:()=>Nt("/api/runs/queue"),subscribeRunQueue:e=>{if(typeof SharedWorker>"u"){const r=new EventSource(`${ui}/api/runs/queue/events`);let a=!1;return r.onopen=()=>{a||e({type:"connected",ts:new Date().toISOString(),payload:{message:"SSE connected"}})},r.addEventListener("queue_event",i=>{if(!a)try{e(JSON.parse(i.data))}catch{}}),r.onerror=()=>{a||(e({type:"error",ts:new Date().toISOString(),payload:{message:"SSE connection error",reconnecting:r.readyState!==2}}),r.readyState===2&&(r.onerror=null,a=!0))},()=>{a||(a=!0,r.close())}}const t=new SharedWorker(new URL("/assets/sse-queue-worker-oGPvQ9ec.js",import.meta.url),{type:"module"});let n=!1;return t.onerror=()=>{n||e({type:"error",ts:new Date().toISOString(),payload:{message:"Queue worker failed to load"}})},t.port.onmessage=r=>{if(!n&&!(typeof r.data!="object"||!r.data)){if(r.data.type==="ping"){t.port.postMessage({type:"pong"});return}e(r.data)}},t.port.start(),t.port.postMessage({type:"init",baseUrl:ui}),()=>{n||(n=!0,t.port.postMessage({type:"close"}),t.port.onmessage=null,t.port.close())}},removeQueuedRun:e=>Nt(`/api/runs/queue/${e}`,{method:"DELETE"}).then(()=>{}),resumeQueue:()=>Nt("/api/runs/queue/resume",{method:"POST"}),subscribeRunJob:(e,t)=>{const n=new EventSource(`${ui}/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.addEventListener("oauth_required",i),n.onerror=()=>{r||(t({type:"error",ts:new Date().toISOString(),payload:{message:"SSE connection error"}}),a())},()=>{a()}}};function IX(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 $X(e){return e||`config-${Date.now()}`}const DX={async health(){return ct.health()},async listConfigs(){return(await ct.listConfigs()).map(Kh)},async createConfig(e){const t=await ct.createConfig(IX(e),vP(e));return Kh(t)},async updateConfig(e){const t=await ct.updateConfig(e.id,vP(e),$X(e.name));return Kh(t)},async deleteConfig(e){await ct.deleteConfig(e)},async listResults(e){let n=0;const r=[];for(;;){const i=await ct.listRuns({...e,limit:100,offset:n});if(r.push(...i.data),!i.has_more||i.next_offset===null)break;n=i.next_offset}const a=r.map(async i=>{const[{results:o},c]=await Promise.all([ct.getRun(i.runId),ct.getRunTrace(i.runId)]);return bP(o,c.records)});return Promise.all(a)},async listRunSummaries(e){const t=Math.max(1,Math.min(100,e?.limit??100));let n=Math.max(0,e?.offset??0);const r=[];for(;;){const a=await ct.listRuns({...e,limit:t,offset:n});if(r.push(...a.data),!a.has_more||a.next_offset===null)break;n=a.next_offset}return r},async listRunSummariesPage(e){return ct.listRuns(e)},async getLatestPassRatesByConfigIds(e){return ct.getLatestPassRatesByConfigIds(e)},async getResult(e){try{const[{results:t},n]=await Promise.all([ct.getRun(e),ct.getRunTrace(e)]);return bP(t,n.records)}catch{return}},async deleteResult(e){await ct.deleteRun(e)},async updateRunNote(e,t){await ct.updateRunNote(e,t)},async listMarkdownReports(e){if(e?.limit!==void 0||e?.offset!==void 0)return(await ct.listMarkdownReports(e)).data;const t=[];let n=0;const r=100;for(;;){const a=await ct.listMarkdownReports({limit:r,offset:n});if(t.push(...a.data),!a.has_more||a.next_offset===null)break;n=a.next_offset}return t},async listMarkdownReportsPage(e){return ct.listMarkdownReports(e)},async getMarkdownReport(e){return ct.getMarkdownReport(e)},async getMarkdownReportById(e){return ct.getMarkdownReportById(e)},async deleteMarkdownReport(e){await ct.deleteMarkdownReport(e)},async startRun(e){return ct.startRun(e)},async runScenarioPreview(e){const t=await ct.runScenarioPreview(e),n=t.scenario.run;if(!n)throw new Error("Preview run did not return a run result");return{runId:t.runId,scenarioId:t.scenario.scenarioId,agentName:t.scenario.agent,run:RX(n,t.scenario.traceRecord)}},async stopRun(e){await ct.stopRun(e)},async getRunQueue(){return ct.getRunQueue()},subscribeRunQueue(e){return ct.subscribeRunQueue(e)},async removeQueuedRun(e){await ct.removeQueuedRun(e)},async resumeQueue(){return ct.resumeQueue()},subscribeRunJob(e,t){return ct.subscribeRunJob(e,t)},async applyResultAssistantReport(e){return ct.applyResultAssistantReport(e)},async createResultAssistantSession(e,t){return ct.createResultAssistantSession(e,t)},async getResultAssistantSession(e){return ct.getResultAssistantSession(e)},async sendResultAssistantMessage(e,t,n){return ct.sendResultAssistantMessage(e,t,n)},async approveResultAssistantToolCall(e,t,n){return ct.approveResultAssistantToolCall(e,t,n)},async denyResultAssistantToolCall(e,t){return ct.denyResultAssistantToolCall(e,t)},async closeResultAssistantSession(e){await ct.closeResultAssistantSession(e)},subscribeResultAssistantSessionEvents(e,t){return ct.subscribeResultAssistantSessionEvents(e,t)},async getLibraries(){const e=await ct.getLibraries();return EX(e)},async saveLibraries(e){await ct.saveLibraries(PX(e))},async listProviderModels(e){return ct.listProviderModels(e)},async getWorkspaceSettings(){return ct.getSettings()},async updateWorkspaceSettings(e){return ct.updateSettings(e)},async createScenarioAssistantSession(e,t){return ct.createScenarioAssistantSession(e,t)},async getScenarioAssistantSession(e){return ct.getScenarioAssistantSession(e)},async sendScenarioAssistantMessage(e,t,n){return ct.sendScenarioAssistantMessage(e,t,n)},async approveScenarioAssistantToolCall(e,t){return ct.approveScenarioAssistantToolCall(e,t)},async denyScenarioAssistantToolCall(e,t){return ct.denyScenarioAssistantToolCall(e,t)},async approveAllScenarioAssistantToolCalls(e){return ct.approveAllScenarioAssistantToolCalls(e)},async closeScenarioAssistantSession(e){await ct.closeScenarioAssistantSession(e)},subscribeScenarioAssistantSessionEvents(e,t){return ct.subscribeScenarioAssistantSessionEvents(e,t)},async discoverToolsForAnalysis(e){return ct.discoverToolsForAnalysis(e)},async startToolAnalysis(e){return ct.startToolAnalysis(e)},subscribeToolAnalysisJob(e,t){return ct.subscribeToolAnalysisJob(e,t)},async getToolAnalysisResult(e){return ct.getToolAnalysisResult(e)},async stopToolAnalysis(e){return ct.stopToolAnalysis(e)},async listToolAnalysisResults(e){if(e?.limit!==void 0||e?.offset!==void 0)return(await ct.listToolAnalysisResults(e)).data;const t=[];let n=0;const r=100;for(;;){const a=await ct.listToolAnalysisResults({limit:r,offset:n});if(t.push(...a.data),!a.has_more||a.next_offset===null)break;n=a.next_offset}return t},async listToolAnalysisResultsPage(e){return ct.listToolAnalysisResults(e)},async listToolAnalysisServers(){return ct.listToolAnalysisServers()},async getToolAnalysisSavedResult(e){return ct.getToolAnalysisSavedResult(e)},async deleteToolAnalysisSavedResult(e){await ct.deleteToolAnalysisSavedResult(e)},async createOAuthDebuggerSession(e){return ct.createOAuthDebuggerSession(e)},async getOAuthDebuggerSession(e){return ct.getOAuthDebuggerSession(e)},async startOAuthDebuggerSession(e){return ct.startOAuthDebuggerSession(e)},subscribeOAuthDebuggerSession(e,t){return ct.subscribeOAuthDebuggerSession(e,t)},async submitOAuthDebuggerManualCallback(e,t){return ct.submitOAuthDebuggerManualCallback(e,t)},async stopOAuthDebuggerSession(e){return ct.stopOAuthDebuggerSession(e)},async exportOAuthDebuggerSession(e,t){return ct.exportOAuthDebuggerSession(e,t)},async createOAuthRuntimeSession(e){return ct.createOAuthRuntimeSession(e)},async getOAuthRuntimeSession(e){return ct.getOAuthRuntimeSession(e)},async getOAuthRuntimeSessionToken(e){return ct.getOAuthRuntimeSessionToken(e)},async submitOAuthRuntimeCallback(e,t){return ct.submitOAuthRuntimeCallback(e,t)},async cancelOAuthRuntimeSession(e){return ct.cancelOAuthRuntimeSession(e)},async ensureOAuthServers(e){return ct.ensureOAuthServers(e)}},nL=m.createContext(null);function LX({children:e}){const t="workspace",[n,r]=m.useState("checking"),[a,i]=m.useState(null);m.useEffect(()=>{r("checking"),ct.health().then(c=>{r("connected"),i(typeof c?.version=="string"?c.version:null)}).catch(()=>{r("disconnected"),i(null)})},[t]);const o=m.useMemo(()=>DX,[]);return s.jsx(nL.Provider,{value:{mode:t,connection:n,version:a,source:o},children:e})}function On(){const e=m.useContext(nL);if(!e)throw new Error("useDataSource must be used within DataSourceProvider");return e}const FX=5,zX=2e3;function BX(e){return e.filter(t=>t.status==="blocked_auth"&&t.blockedReason==="oauth_required").length}function qX(e){const t=e?.active??null,n=Array.isArray(e?.active_jobs)?e.active_jobs:t?[t]:[],r=Array.isArray(e?.admitting_jobs)?e.admitting_jobs:[],a=Array.isArray(e?.queued)?e.queued:[];return{active:t,active_jobs:n,admitting_jobs:r,queued:a}}function UX(){const{source:e}=On(),[t,n]=m.useState({active:null,active_jobs:[],admitting_jobs:[],queued:[]}),[r,a]=m.useState("connecting"),[i,o]=m.useState(0),c=m.useRef("connecting"),d=m.useRef(0);return m.useEffect(()=>{let f=!1,h=0,p=null,v=null;const x=()=>{p!==null&&(window.clearTimeout(p),p=null)},j=()=>{f||(x(),a("connecting"),c.current="connecting",v?.(),v=e.subscribeRunQueue(y=>{const S=y.payload.event;if(y.type==="connected"){h=0,a("connected"),c.current="connected";return}if(y.type==="queue_event"&&S){d.current+=1,a("connected"),c.current="connected",n(qX(S));return}if(y.type==="error"){if(v?.(),v=null,h>=FX){a("disconnected"),c.current="disconnected";return}h+=1,a("connecting"),c.current="connecting";const N=zX*2**(h-1);p=window.setTimeout(()=>{j()},N)}}))};j();const b=()=>{c.current!=="connected"&&j()};return window.addEventListener("focus",b),()=>{f=!0,v?.(),x(),window.removeEventListener("focus",b)}},[e,i]),m.useMemo(()=>{const f=t.active_jobs.length>0||t.admitting_jobs.length>0,h=t.queued.length,p=BX(t.queued);return{isRunning:f,queuedCount:h,oauthBlockedCount:p,streamStatus:r,reconnectStream:()=>{o(v=>v+1)}}},[t,r])}const WX=(e,t)=>{if(e==="/")return[{label:"Dashboard"}];const n=[{label:"Dashboard",to:"/"}];if(gn("/mcp-evaluations/:id/edit",e))return n.push({label:"MCP Evaluations",to:"/mcp-evaluations"},{label:"MCP Evaluation",to:e.replace(/\/edit$/,"")},{label:"Edit"}),n;if(gn("/mcp-evaluations/:id",e))return n.push({label:"MCP Evaluations",to:"/mcp-evaluations"},{label:"MCP Evaluation"}),n;if(gn("/mcp-evaluations",e))return n.push({label:"MCP Evaluations"}),n;if(gn("/settings/mcp",e))return n.push({label:"Settings",to:"/settings"},{label:"MCP Connection"}),n;if(gn("/settings",e))return n.push({label:"Settings"}),n;if(gn("/tool-analysis",e))return n.push({label:"Analyze MCP Tools"}),n;if(gn("/tool-analysis-results/:id",e)){const r=gn("/tool-analysis-results/:id",e);return n.push({label:"Tool Analysis Results",to:"/tool-analysis-results"},{label:r?.params.id??"Report"}),n}if(gn("/tool-analysis-results",e))return n.push({label:"Tool Analysis Results"}),n;if(gn("/markdown-reports/view",e))return n.push({label:"Markdown Reports",to:"/markdown-reports"},{label:"View Report"}),n;if(gn("/markdown-reports",e))return n.push({label:"Markdown Reports"}),n;if(gn("/oauth-debugger",e))return n.push({label:"OAuth Debugger"}),n;if(gn("/results/:id",e))return n.push({label:"Evaluation Results",to:"/results"},{label:"Result"}),n;if(gn("/results",e))return n.push({label:"Evaluation Results"}),n;if(gn("/run",e))return n.push({label:"Run Evaluation"}),n;if(gn("/libraries/servers/:serverId",e)){const r=gn("/libraries/servers/:serverId",e),a=r?.params.serverId?decodeURIComponent(r.params.serverId):"Server";return n.push({label:"Libraries",to:"/libraries/servers"},{label:"MCP servers",to:"/libraries/servers"},{label:a==="new"?"New Server":a}),n}if(gn("/libraries/servers",e))return n.push({label:"Libraries",to:"/libraries/servers"},{label:"MCP servers"}),n;if(gn("/libraries/agents/:agentName",e)){const r=gn("/libraries/agents/:agentName",e),a=r?.params.agentName?decodeURIComponent(r.params.agentName):"Agent";return n.push({label:"Libraries",to:"/libraries/agents"},{label:"Agents",to:"/libraries/agents"},{label:a==="new"?"New Agent":a}),n}if(gn("/libraries/agents",e))return n.push({label:"Libraries",to:"/libraries/agents"},{label:"Agents"}),n;if(gn("/libraries/test-cases/:testCaseId",e)){const r=gn("/libraries/test-cases/:testCaseId",e),a=r?.params.testCaseId?decodeURIComponent(r.params.testCaseId):"Test Case";return n.push({label:"Libraries",to:"/libraries/test-cases"},{label:"Test Cases",to:"/libraries/test-cases"},{label:a}),n}if(gn("/libraries/test-cases",e))return n.push({label:"Libraries",to:"/libraries/test-cases"},{label:"Test Cases"}),n;if(gn("/compare/results",e))return n.push({label:"Compare Evaluations",to:"/compare"},{label:"Full Result Compare"}),n;if(gn("/compare",e)){const a=new URLSearchParams(t).get("mode")==="within-run"?"Agents":"Runs";return n.push({label:"Compare Evaluations",to:"/compare"},{label:a}),n}return n};function VX(){const e=Sa(),t=new URLSearchParams(e.search).get("embed")==="1",n=WX(e.pathname,e.search),{version:r}=On(),{isRunning:a,queuedCount:i,oauthBlockedCount:o,streamStatus:c,reconnectStream:d}=UX(),f=i+(a?1:0);return t?s.jsx("main",{className:"min-h-screen overflow-auto bg-background p-4",children:s.jsx(tP,{})}):s.jsx(R3,{children:s.jsxs("div",{className:"flex min-h-screen w-full",children:[s.jsx(vX,{version:r}),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(M3,{}),s.jsx(V3,{children:s.jsx(H3,{children:n.map((h,p)=>{const v=p===n.length-1;return s.jsxs(m.Fragment,{children:[s.jsx(K3,{children:h.to&&!v?s.jsx(G3,{asChild:!0,children:s.jsx(Tt,{to:h.to,children:h.label})}):s.jsx(Y3,{children:h.label})}),!v&&s.jsx(X3,{})]},`${h.label}-${p}`)})})}),s.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[(a||i>0||o>0)&&s.jsxs(Tt,{to:"/run",className:"inline-flex items-center gap-2 rounded-full border px-2.5 py-1 hover:bg-muted/50 transition-colors",title:"Open Run Evaluation queue",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Run Queue"}),s.jsx("span",{className:`inline-flex min-w-5 items-center justify-center rounded-full px-1.5 py-0.5 text-xs font-semibold ${o>0?"bg-yellow-500/20 text-yellow-800 dark:text-yellow-300":"bg-muted text-foreground"}`,children:f}),a&&s.jsx("span",{className:"inline-block h-3 w-3 animate-spin rounded-full border-2 border-emerald-500 border-t-transparent","aria-label":"Queue processing"}),o>0&&s.jsx("span",{className:"text-xs text-yellow-700 dark:text-yellow-400",children:"OAuth wait"})]}),s.jsxs("button",{type:"button",className:"inline-flex items-center gap-2 rounded-full border px-2.5 py-1 disabled:opacity-70",onClick:()=>{c==="disconnected"&&d()},disabled:c==="connecting",title:c==="disconnected"?"Retry queue connection":c==="connecting"?"Connecting to queue stream...":"Queue stream connected",children:[s.jsx("span",{className:`h-2 w-2 rounded-full ${c==="connected"?"bg-emerald-500":c==="connecting"?"bg-amber-400":"bg-rose-500"}`,"aria-hidden":"true"}),s.jsx("span",{className:`text-xs ${c==="connected"?"text-emerald-700":c==="connecting"?"text-muted-foreground":"text-destructive"}`,children:c})]})]})]}),s.jsx("main",{className:"flex-1 overflow-auto p-6",children:s.jsx(tP,{})})]})]})})}const rL=m.createContext(null);function HX({children:e}){const{source:t}=On(),[n,r]=m.useState([]),[a,i]=m.useState(!0),o=m.useCallback(async()=>{i(!0);try{const v=await t.listConfigs();r(v)}finally{i(!1)}},[t]);m.useEffect(()=>{o()},[o]);const c=m.useCallback(v=>n.find(x=>x.id===v),[n]),d=m.useCallback(async v=>{const x=await t.createConfig(v);return r(j=>[...j,x]),x},[t]),f=m.useCallback(async(v,x)=>{const j=await t.updateConfig({...x,id:v});return r(b=>b.map(y=>y.id===v?j:y)),j},[t]),h=m.useCallback(async v=>{await t.deleteConfig(v),r(x=>x.filter(j=>j.id!==v))},[t]),p=m.useCallback(async v=>{const x=n.find(y=>y.id===v);if(!x)throw new Error("Config not found");const j={...structuredClone(x),id:`cfg-${Date.now()}`,name:`${x.name} (Copy)`,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()},b=await t.createConfig(j);return r(y=>[...y,b]),b},[n,t]);return s.jsx(rL.Provider,{value:{configs:n,loading:a,getConfig:c,addConfig:d,updateConfig:f,deleteConfig:h,cloneConfig:p,reload:o},children:e})}function Yf(){const e=m.useContext(rL);if(!e)throw new Error("useConfigs must be used within ConfigProvider");return e}const sL=m.createContext(null);function KX({children:e}){const{source:t}=On(),[n,r]=m.useState({servers:[],agents:[],scenarios:[]}),[a,i]=m.useState(!0),o=m.useCallback(async()=>{i(!0);try{const f=await t.getLibraries();r(f)}finally{i(!1)}},[t]);m.useEffect(()=>{o()},[t]),m.useEffect(()=>{const f=()=>{o()};return window.addEventListener("focus",f),()=>{window.removeEventListener("focus",f)}},[t]);const c=m.useCallback(async f=>{r(f),await t.saveLibraries(f)},[t]),d=m.useMemo(()=>({...n,loading:a,setServers:async f=>c({...n,servers:f}),setAgents:async f=>c({...n,agents:f}),setScenarios:async f=>c({...n,scenarios:f}),reload:o}),[n,a,o,c]);return s.jsx(sL.Provider,{value:d,children:e})}function Ca(){const e=m.useContext(sL);if(!e)throw new Error("useLibraries must be used within LibraryProvider");return e}const nt=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Re("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));nt.displayName="Card";const Lt=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Re("flex flex-col space-y-1.5 p-6",e),...t}));Lt.displayName="CardHeader";const Ft=m.forwardRef(({className:e,...t},n)=>s.jsx("h3",{ref:n,className:Re("text-2xl font-semibold leading-none tracking-tight",e),...t}));Ft.displayName="CardTitle";const Er=m.forwardRef(({className:e,...t},n)=>s.jsx("p",{ref:n,className:Re("text-sm text-muted-foreground",e),...t}));Er.displayName="CardDescription";const rt=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Re("p-6 pt-0",e),...t}));rt.displayName="CardContent";const GX=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Re("flex items-center p-6 pt-0",e),...t}));GX.displayName="CardFooter";const Jr=m.forwardRef(({className:e,containerClassName:t,...n},r)=>s.jsx("div",{className:Re("relative w-full overflow-auto",t),children:s.jsx("table",{ref:r,className:Re("w-full caption-bottom text-sm",e),...n})}));Jr.displayName="Table";const es=m.forwardRef(({className:e,...t},n)=>s.jsx("thead",{ref:n,className:Re("[&_tr]:border-b",e),...t}));es.displayName="TableHeader";const ts=m.forwardRef(({className:e,...t},n)=>s.jsx("tbody",{ref:n,className:Re("[&_tr:last-child]:border-0",e),...t}));ts.displayName="TableBody";const YX=m.forwardRef(({className:e,...t},n)=>s.jsx("tfoot",{ref:n,className:Re("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));YX.displayName="TableFooter";const Gt=m.forwardRef(({className:e,...t},n)=>s.jsx("tr",{ref:n,className:Re("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",e),...t}));Gt.displayName="TableRow";const ht=m.forwardRef(({className:e,...t},n)=>s.jsx("th",{ref:n,className:Re("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));ht.displayName="TableHead";const He=m.forwardRef(({className:e,...t},n)=>s.jsx("td",{ref:n,className:Re("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));He.displayName="TableCell";const XX=m.forwardRef(({className:e,...t},n)=>s.jsx("caption",{ref:n,className:Re("mt-4 text-sm text-muted-foreground",e),...t}));XX.displayName="TableCaption";function Os({title:e,value:t,subtitle:n,icon:r,trend:a}){return s.jsx(nt,{children:s.jsx(rt,{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 QX=Ol("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"}}),st=m.forwardRef(({className:e,variant:t,asChild:n,...r},a)=>{const i=n?So:"div";return s.jsx(i,{ref:a,className:Re(QX({variant:t}),e),...r})});st.displayName="Badge";function Ma({rate:e,className:t}){const n=Math.round(e*100),r=n>=80?"default":n>=50?"secondary":"destructive";return s.jsxs(st,{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,"%"]})}function ZX(e){const t=[];for(const n of e.scenarios)for(const r of n.runs)r.error&&t.push(r.error),t.push(...r.failureReasons);return t.map(n=>String(n??"").trim()).filter(Boolean)}function JX(e){const t=e.toLowerCase();return t.includes("invalid_token")||t.includes("authentication failed")||t.includes("bearer token")||t.includes("oauth")?"auth":t.includes("429")||t.includes("too many requests")||t.includes("rate limit")?"rate_limit":t.includes("scenario error:")||t.includes("failed to list tools")||t.includes("failed to connect to mcp server")||t.includes("tool call failed")||t.includes("fetch failed")||t.includes("streamable http error")?"infra":null}function eQ(e){return e==="auth"?"Auth error":e==="rate_limit"?"Rate limited":"Infra error"}function tQ(e){const t=ZX(e),n=["auth","rate_limit","infra"];for(const r of n){const a=t.find(i=>JX(i)===r);if(a)return{kind:r,label:eQ(r),detail:a}}return null}function nQ(e){return e==="auth"?"border-amber-500/30 bg-amber-500/10 text-amber-700":e==="rate_limit"?"border-orange-500/30 bg-orange-500/10 text-orange-700":"border-slate-500/30 bg-slate-500/10 text-slate-700"}function aL({run:e}){const t=tQ(e);return t?s.jsx(ji,{delayDuration:0,children:s.jsxs(Si,{children:[s.jsx(Ni,{asChild:!0,children:s.jsx(st,{variant:"outline",className:`h-5 text-[10px] ${nQ(t.kind)}`,children:t.label})}),s.jsx(qa,{className:"max-w-sm text-xs",children:s.jsx("p",{children:t.detail})})]})}):null}var Qy,jP;function as(){if(jP)return Qy;jP=1;var e=Array.isArray;return Qy=e,Qy}var Zy,SP;function iL(){if(SP)return Zy;SP=1;var e=typeof hh=="object"&&hh&&hh.Object===Object&&hh;return Zy=e,Zy}var Jy,NP;function Ka(){if(NP)return Jy;NP=1;var e=iL(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return Jy=n,Jy}var eb,CP;function Xf(){if(CP)return eb;CP=1;var e=Ka(),t=e.Symbol;return eb=t,eb}var tb,_P;function rQ(){if(_P)return tb;_P=1;var e=Xf(),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 tb=i,tb}var nb,AP;function sQ(){if(AP)return nb;AP=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return nb=n,nb}var rb,kP;function Ti(){if(kP)return rb;kP=1;var e=Xf(),t=rQ(),n=sQ(),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 rb=o,rb}var sb,EP;function Ri(){if(EP)return sb;EP=1;function e(t){return t!=null&&typeof t=="object"}return sb=e,sb}var ab,PP;function ku(){if(PP)return ab;PP=1;var e=Ti(),t=Ri(),n="[object Symbol]";function r(a){return typeof a=="symbol"||t(a)&&e(a)==n}return ab=r,ab}var ib,TP;function fC(){if(TP)return ib;TP=1;var e=as(),t=ku(),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 ib=a,ib}var ob,RP;function No(){if(RP)return ob;RP=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return ob=e,ob}var lb,OP;function pC(){if(OP)return lb;OP=1;var e=Ti(),t=No(),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 lb=o,lb}var cb,MP;function aQ(){if(MP)return cb;MP=1;var e=Ka(),t=e["__core-js_shared__"];return cb=t,cb}var ub,IP;function iQ(){if(IP)return ub;IP=1;var e=aQ(),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 ub=n,ub}var db,$P;function oL(){if($P)return db;$P=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 db=n,db}var fb,DP;function oQ(){if(DP)return fb;DP=1;var e=pC(),t=iQ(),n=No(),r=oL(),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(v){if(!n(v)||t(v))return!1;var x=e(v)?h:i;return x.test(r(v))}return fb=p,fb}var pb,LP;function lQ(){if(LP)return pb;LP=1;function e(t,n){return t?.[n]}return pb=e,pb}var hb,FP;function Il(){if(FP)return hb;FP=1;var e=oQ(),t=lQ();function n(r,a){var i=t(r,a);return e(i)?i:void 0}return hb=n,hb}var mb,zP;function Wg(){if(zP)return mb;zP=1;var e=Il(),t=e(Object,"create");return mb=t,mb}var gb,BP;function cQ(){if(BP)return gb;BP=1;var e=Wg();function t(){this.__data__=e?e(null):{},this.size=0}return gb=t,gb}var vb,qP;function uQ(){if(qP)return vb;qP=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return vb=e,vb}var xb,UP;function dQ(){if(UP)return xb;UP=1;var e=Wg(),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 xb=a,xb}var yb,WP;function fQ(){if(WP)return yb;WP=1;var e=Wg(),t=Object.prototype,n=t.hasOwnProperty;function r(a){var i=this.__data__;return e?i[a]!==void 0:n.call(i,a)}return yb=r,yb}var bb,VP;function pQ(){if(VP)return bb;VP=1;var e=Wg(),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 bb=n,bb}var wb,HP;function hQ(){if(HP)return wb;HP=1;var e=cQ(),t=uQ(),n=dQ(),r=fQ(),a=pQ();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,wb=i,wb}var jb,KP;function mQ(){if(KP)return jb;KP=1;function e(){this.__data__=[],this.size=0}return jb=e,jb}var Sb,GP;function hC(){if(GP)return Sb;GP=1;function e(t,n){return t===n||t!==t&&n!==n}return Sb=e,Sb}var Nb,YP;function Vg(){if(YP)return Nb;YP=1;var e=hC();function t(n,r){for(var a=n.length;a--;)if(e(n[a][0],r))return a;return-1}return Nb=t,Nb}var Cb,XP;function gQ(){if(XP)return Cb;XP=1;var e=Vg(),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 Cb=r,Cb}var _b,QP;function vQ(){if(QP)return _b;QP=1;var e=Vg();function t(n){var r=this.__data__,a=e(r,n);return a<0?void 0:r[a][1]}return _b=t,_b}var Ab,ZP;function xQ(){if(ZP)return Ab;ZP=1;var e=Vg();function t(n){return e(this.__data__,n)>-1}return Ab=t,Ab}var kb,JP;function yQ(){if(JP)return kb;JP=1;var e=Vg();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 kb=t,kb}var Eb,eT;function Hg(){if(eT)return Eb;eT=1;var e=mQ(),t=gQ(),n=vQ(),r=xQ(),a=yQ();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,Eb=i,Eb}var Pb,tT;function mC(){if(tT)return Pb;tT=1;var e=Il(),t=Ka(),n=e(t,"Map");return Pb=n,Pb}var Tb,nT;function bQ(){if(nT)return Tb;nT=1;var e=hQ(),t=Hg(),n=mC();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return Tb=r,Tb}var Rb,rT;function wQ(){if(rT)return Rb;rT=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return Rb=e,Rb}var Ob,sT;function Kg(){if(sT)return Ob;sT=1;var e=wQ();function t(n,r){var a=n.__data__;return e(r)?a[typeof r=="string"?"string":"hash"]:a.map}return Ob=t,Ob}var Mb,aT;function jQ(){if(aT)return Mb;aT=1;var e=Kg();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return Mb=t,Mb}var Ib,iT;function SQ(){if(iT)return Ib;iT=1;var e=Kg();function t(n){return e(this,n).get(n)}return Ib=t,Ib}var $b,oT;function NQ(){if(oT)return $b;oT=1;var e=Kg();function t(n){return e(this,n).has(n)}return $b=t,$b}var Db,lT;function CQ(){if(lT)return Db;lT=1;var e=Kg();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 Db=t,Db}var Lb,cT;function gC(){if(cT)return Lb;cT=1;var e=bQ(),t=jQ(),n=SQ(),r=NQ(),a=CQ();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,Lb=i,Lb}var Fb,uT;function lL(){if(uT)return Fb;uT=1;var e=gC(),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,Fb=n,Fb}var zb,dT;function _Q(){if(dT)return zb;dT=1;var e=lL(),t=500;function n(r){var a=e(r,function(o){return i.size===t&&i.clear(),o}),i=a.cache;return a}return zb=n,zb}var Bb,fT;function AQ(){if(fT)return Bb;fT=1;var e=_Q(),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 Bb=r,Bb}var qb,pT;function vC(){if(pT)return qb;pT=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 qb=e,qb}var Ub,hT;function kQ(){if(hT)return Ub;hT=1;var e=Xf(),t=vC(),n=as(),r=ku(),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 Ub=o,Ub}var Wb,mT;function cL(){if(mT)return Wb;mT=1;var e=kQ();function t(n){return n==null?"":e(n)}return Wb=t,Wb}var Vb,gT;function uL(){if(gT)return Vb;gT=1;var e=as(),t=fC(),n=AQ(),r=cL();function a(i,o){return e(i)?i:t(i,o)?[i]:n(r(i))}return Vb=a,Vb}var Hb,vT;function Gg(){if(vT)return Hb;vT=1;var e=ku();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return Hb=t,Hb}var Kb,xT;function xC(){if(xT)return Kb;xT=1;var e=uL(),t=Gg();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 Kb=n,Kb}var Gb,yT;function dL(){if(yT)return Gb;yT=1;var e=xC();function t(n,r,a){var i=n==null?void 0:e(n,r);return i===void 0?a:i}return Gb=t,Gb}var EQ=dL();const bs=vn(EQ);var Yb,bT;function PQ(){if(bT)return Yb;bT=1;function e(t){return t==null}return Yb=e,Yb}var TQ=PQ();const Ht=vn(TQ);var Xb,wT;function RQ(){if(wT)return Xb;wT=1;var e=Ti(),t=as(),n=Ri(),r="[object String]";function a(i){return typeof i=="string"||!t(i)&&n(i)&&e(i)==r}return Xb=a,Xb}var OQ=RQ();const vl=vn(OQ);var MQ=pC();const Vt=vn(MQ);var IQ=No();const Eu=vn(IQ);var Qb={exports:{}},pn={};var jT;function $Q(){if(jT)return pn;jT=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"),v=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),j;j=Symbol.for("react.module.reference");function b(y){if(typeof y=="object"&&y!==null){var S=y.$$typeof;switch(S){case e:switch(y=y.type,y){case n:case a:case r:case f:case h:return y;default:switch(y=y&&y.$$typeof,y){case c:case o:case d:case v:case p:case i:return y;default:return S}}case t:return S}}}return pn.ContextConsumer=o,pn.ContextProvider=i,pn.Element=e,pn.ForwardRef=d,pn.Fragment=n,pn.Lazy=v,pn.Memo=p,pn.Portal=t,pn.Profiler=a,pn.StrictMode=r,pn.Suspense=f,pn.SuspenseList=h,pn.isAsyncMode=function(){return!1},pn.isConcurrentMode=function(){return!1},pn.isContextConsumer=function(y){return b(y)===o},pn.isContextProvider=function(y){return b(y)===i},pn.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===e},pn.isForwardRef=function(y){return b(y)===d},pn.isFragment=function(y){return b(y)===n},pn.isLazy=function(y){return b(y)===v},pn.isMemo=function(y){return b(y)===p},pn.isPortal=function(y){return b(y)===t},pn.isProfiler=function(y){return b(y)===a},pn.isStrictMode=function(y){return b(y)===r},pn.isSuspense=function(y){return b(y)===f},pn.isSuspenseList=function(y){return b(y)===h},pn.isValidElementType=function(y){return typeof y=="string"||typeof y=="function"||y===n||y===a||y===r||y===f||y===h||y===x||typeof y=="object"&&y!==null&&(y.$$typeof===v||y.$$typeof===p||y.$$typeof===i||y.$$typeof===o||y.$$typeof===d||y.$$typeof===j||y.getModuleId!==void 0)},pn.typeOf=b,pn}var ST;function DQ(){return ST||(ST=1,Qb.exports=$Q()),Qb.exports}var LQ=DQ(),Zb,NT;function fL(){if(NT)return Zb;NT=1;var e=Ti(),t=Ri(),n="[object Number]";function r(a){return typeof a=="number"||t(a)&&e(a)==n}return Zb=r,Zb}var Jb,CT;function FQ(){if(CT)return Jb;CT=1;var e=fL();function t(n){return e(n)&&n!=+n}return Jb=t,Jb}var zQ=FQ();const Qf=vn(zQ);var BQ=fL();const qQ=vn(BQ);var $r=function(t){return t===0?0:t>0?1:-1},nl=function(t){return vl(t)&&t.indexOf("%")===t.length-1},at=function(t){return qQ(t)&&!Qf(t)},UQ=function(t){return Ht(t)},sr=function(t){return at(t)||vl(t)},WQ=0,Pu=function(t){var n=++WQ;return"".concat(t||"").concat(n)},Dr=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(!at(t)&&!vl(t))return r;var i;if(nl(t)){var o=t.indexOf("%");i=n*parseFloat(t.slice(0,o))/100}else i=+t;return Qf(i)&&(i=r),a&&i>n&&(i=n),i},Sc=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},VQ=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},gs=function(t,n){return at(t)&&at(n)?function(r){return t+r*(n-t)}:function(){return n}};function im(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):bs(r,t))===n})}var HQ=function(t,n){return at(t)&&at(n)?t-n:vl(t)&&vl(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function Dc(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 VS(e){"@babel/helpers - typeof";return VS=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},VS(e)}var KQ=["viewBox","children"],GQ=["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"],_T=["points","pathLength"],e0={svg:KQ,polygon:_T,polyline:_T},yC=["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"],om=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(m.isValidElement(t)&&(r=t.props),!Eu(r))return null;var a={};return Object.keys(r).forEach(function(i){yC.includes(i)&&(a[i]=n||function(o){return r[i](r,o)})}),a},YQ=function(t,n,r){return function(a){return t(n,r,a),null}},xl=function(t,n,r){if(!Eu(t)||VS(t)!=="object")return null;var a=null;return Object.keys(t).forEach(function(i){var o=t[i];yC.includes(i)&&typeof o=="function"&&(a||(a={}),a[i]=YQ(o,n,r))}),a},XQ=["children"],QQ=["children"];function AT(e,t){if(e==null)return{};var n=ZQ(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 ZQ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function HS(e){"@babel/helpers - typeof";return HS=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},HS(e)}var kT={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"},pi=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},ET=null,t0=null,bC=function e(t){if(t===ET&&Array.isArray(t0))return t0;var n=[];return m.Children.forEach(t,function(r){Ht(r)||(LQ.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),t0=n,ET=t,n};function ws(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(a){return pi(a)}):r=[pi(t)],bC(e).forEach(function(a){var i=bs(a,"type.displayName")||bs(a,"type.name");r.indexOf(i)!==-1&&n.push(a)}),n}function hs(e,t){var n=ws(e,t);return n&&n[0]}var PT=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,a=n.height;return!(!at(r)||r<=0||!at(a)||a<=0)},JQ=["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"],eZ=function(t){return t&&t.type&&vl(t.type)&&JQ.indexOf(t.type)>=0},tZ=function(t){return t&&HS(t)==="object"&&"clipDot"in t},nZ=function(t,n,r,a){var i,o=(i=e0?.[a])!==null&&i!==void 0?i:[];return n.startsWith("data-")||!Vt(t)&&(a&&o.includes(n)||GQ.includes(n))||r&&yC.includes(n)},It=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(m.isValidElement(t)&&(a=t.props),!Eu(a))return null;var i={};return Object.keys(a).forEach(function(o){var c;nZ((c=a)===null||c===void 0?void 0:c[o],o,n,r)&&(i[o]=a[o])}),i},KS=function e(t,n){if(t===n)return!0;var r=m.Children.count(t);if(r!==m.Children.count(n))return!1;if(r===0)return!0;if(r===1)return TT(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(!TT(i,o))return!1}return!0},TT=function(t,n){if(Ht(t)&&Ht(n))return!0;if(!Ht(t)&&!Ht(n)){var r=t.props||{},a=r.children,i=AT(r,XQ),o=n.props||{},c=o.children,d=AT(o,QQ);return a&&c?Dc(i,d)&&KS(a,c):!a&&!c?Dc(i,d):!1}return!1},RT=function(t,n){var r=[],a={};return bC(t).forEach(function(i,o){if(eZ(i))r.push(i);else if(i){var c=pi(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},rZ=function(t){var n=t&&t.type;return n&&kT[n]?kT[n]:null},sZ=function(t,n){return bC(n).indexOf(t)},aZ=["children","width","height","viewBox","className","style","title","desc"];function GS(){return GS=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},GS.apply(this,arguments)}function iZ(e,t){if(e==null)return{};var n=oZ(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 oZ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function YS(e){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=iZ(e,aZ),h=a||{width:n,height:r,x:0,y:0},p=Yt("recharts-surface",i);return X.createElement("svg",GS({},It(f,!0,"svg"),{className:p,width:n,height:r,style:o,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height)}),X.createElement("title",null,c),X.createElement("desc",null,d),t)}var lZ=["children","className"];function XS(){return XS=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},XS.apply(this,arguments)}function cZ(e,t){if(e==null)return{};var n=uZ(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 uZ(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 cn=X.forwardRef(function(e,t){var n=e.children,r=e.className,a=cZ(e,lZ),i=Yt("recharts-layer",r);return X.createElement("g",XS({className:i},It(a,!0),{ref:t}),n)}),hi=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]},n0,OT;function dZ(){if(OT)return n0;OT=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 n0=e,n0}var r0,MT;function fZ(){if(MT)return r0;MT=1;var e=dZ();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 r0=t,r0}var s0,IT;function pL(){if(IT)return s0;IT=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 s0=d,s0}var a0,$T;function pZ(){if($T)return a0;$T=1;function e(t){return t.split("")}return a0=e,a0}var i0,DT;function hZ(){if(DT)return i0;DT=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}",v="[\\ud800-\\udbff][\\udc00-\\udfff]",x="\\u200d",j=f+"?",b="["+i+"]?",y="(?:"+x+"(?:"+[h,p,v].join("|")+")"+b+j+")*",S=b+j+y,N="(?:"+[h+c+"?",c,p,v,o].join("|")+")",_=RegExp(d+"(?="+d+")|"+N+S,"g");function A(k){return k.match(_)||[]}return i0=A,i0}var o0,LT;function mZ(){if(LT)return o0;LT=1;var e=pZ(),t=pL(),n=hZ();function r(a){return t(a)?n(a):e(a)}return o0=r,o0}var l0,FT;function gZ(){if(FT)return l0;FT=1;var e=fZ(),t=pL(),n=mZ(),r=cL();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 l0=a,l0}var c0,zT;function vZ(){if(zT)return c0;zT=1;var e=gZ(),t=e("toUpperCase");return c0=t,c0}var xZ=vZ();const Yg=vn(xZ);function Nn(e){return function(){return e}}const hL=Math.cos,lm=Math.sin,_a=Math.sqrt,cm=Math.PI,Xg=2*cm,QS=Math.PI,ZS=2*QS,Zo=1e-6,yZ=ZS-Zo;function mL(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function bZ(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return mL;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 wZ{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?mL:bZ(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,v=h*h+p*p;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(v>Zo)if(!(Math.abs(p*d-f*h)>Zo)||!i)this._append`L${this._x1=t},${this._y1=n}`;else{let x=r-o,j=a-c,b=d*d+f*f,y=x*x+j*j,S=Math.sqrt(b),N=Math.sqrt(v),_=i*Math.tan((QS-Math.acos((b+v-y)/(2*S*N)))/2),A=_/N,k=_/S;Math.abs(A-1)>Zo&&this._append`L${t+A*h},${n+A*p}`,this._append`A${i},${i},0,0,${+(p*x>h*j)},${this._x1=t+k*d},${this._y1=n+k*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,v=o?a-i:i-a;this._x1===null?this._append`M${f},${h}`:(Math.abs(this._x1-f)>Zo||Math.abs(this._y1-h)>Zo)&&this._append`L${f},${h}`,r&&(v<0&&(v=v%ZS+ZS),v>yZ?this._append`A${r},${r},0,1,${p},${t-c},${n-d}A${r},${r},0,1,${p},${this._x1=f},${this._y1=h}`:v>Zo&&this._append`A${r},${r},0,${+(v>=QS)},${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 wC(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 wZ(t)}function jC(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function gL(e){this._context=e}gL.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 Qg(e){return new gL(e)}function vL(e){return e[0]}function xL(e){return e[1]}function yL(e,t){var n=Nn(!0),r=null,a=Qg,i=null,o=wC(c);e=typeof e=="function"?e:e===void 0?vL:Nn(e),t=typeof t=="function"?t:t===void 0?xL:Nn(t);function c(d){var f,h=(d=jC(d)).length,p,v=!1,x;for(r==null&&(i=a(x=o())),f=0;f<=h;++f)!(f<h&&n(p=d[f],f,d))===v&&((v=!v)?i.lineStart():i.lineEnd()),v&&i.point(+e(p,f,d),+t(p,f,d));if(x)return i=null,x+""||null}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:Nn(+d),c):e},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:Nn(+d),c):t},c.defined=function(d){return arguments.length?(n=typeof d=="function"?d:Nn(!!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 Ch(e,t,n){var r=null,a=Nn(!0),i=null,o=Qg,c=null,d=wC(f);e=typeof e=="function"?e:e===void 0?vL:Nn(+e),t=typeof t=="function"?t:Nn(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?xL:Nn(+n);function f(p){var v,x,j,b=(p=jC(p)).length,y,S=!1,N,_=new Array(b),A=new Array(b);for(i==null&&(c=o(N=d())),v=0;v<=b;++v){if(!(v<b&&a(y=p[v],v,p))===S)if(S=!S)x=v,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),j=v-1;j>=x;--j)c.point(_[j],A[j]);c.lineEnd(),c.areaEnd()}S&&(_[v]=+e(y,v,p),A[v]=+t(y,v,p),c.point(r?+r(y,v,p):_[v],n?+n(y,v,p):A[v]))}if(N)return c=null,N+""||null}function h(){return yL().defined(a).curve(o).context(i)}return f.x=function(p){return arguments.length?(e=typeof p=="function"?p:Nn(+p),r=null,f):e},f.x0=function(p){return arguments.length?(e=typeof p=="function"?p:Nn(+p),f):e},f.x1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:Nn(+p),f):r},f.y=function(p){return arguments.length?(t=typeof p=="function"?p:Nn(+p),n=null,f):t},f.y0=function(p){return arguments.length?(t=typeof p=="function"?p:Nn(+p),f):t},f.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:Nn(+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:Nn(!!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 bL{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 jZ(e){return new bL(e,!0)}function SZ(e){return new bL(e,!1)}const SC={draw(e,t){const n=_a(t/cm);e.moveTo(n,0),e.arc(0,0,n,0,Xg)}},NZ={draw(e,t){const n=_a(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()}},wL=_a(1/3),CZ=wL*2,_Z={draw(e,t){const n=_a(t/CZ),r=n*wL;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},AZ={draw(e,t){const n=_a(t),r=-n/2;e.rect(r,r,n,n)}},kZ=.8908130915292852,jL=lm(cm/10)/lm(7*cm/10),EZ=lm(Xg/10)*jL,PZ=-hL(Xg/10)*jL,TZ={draw(e,t){const n=_a(t*kZ),r=EZ*n,a=PZ*n;e.moveTo(0,-n),e.lineTo(r,a);for(let i=1;i<5;++i){const o=Xg*i/5,c=hL(o),d=lm(o);e.lineTo(d*n,-c*n),e.lineTo(c*r-d*a,d*r+c*a)}e.closePath()}},u0=_a(3),RZ={draw(e,t){const n=-_a(t/(u0*3));e.moveTo(0,n*2),e.lineTo(-u0*n,-n),e.lineTo(u0*n,-n),e.closePath()}},Ps=-.5,Ts=_a(3)/2,JS=1/_a(12),OZ=(JS/2+1)*3,MZ={draw(e,t){const n=_a(t/OZ),r=n/2,a=n*JS,i=r,o=n*JS+n,c=-i,d=o;e.moveTo(r,a),e.lineTo(i,o),e.lineTo(c,d),e.lineTo(Ps*r-Ts*a,Ts*r+Ps*a),e.lineTo(Ps*i-Ts*o,Ts*i+Ps*o),e.lineTo(Ps*c-Ts*d,Ts*c+Ps*d),e.lineTo(Ps*r+Ts*a,Ps*a-Ts*r),e.lineTo(Ps*i+Ts*o,Ps*o-Ts*i),e.lineTo(Ps*c+Ts*d,Ps*d-Ts*c),e.closePath()}};function IZ(e,t){let n=null,r=wC(a);e=typeof e=="function"?e:Nn(e||SC),t=typeof t=="function"?t:Nn(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:Nn(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:Nn(+i),a):t},a.context=function(i){return arguments.length?(n=i??null,a):n},a}function um(){}function dm(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 SL(e){this._context=e}SL.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:dm(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:dm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function $Z(e){return new SL(e)}function NL(e){this._context=e}NL.prototype={areaStart:um,areaEnd:um,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:dm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function DZ(e){return new NL(e)}function CL(e){this._context=e}CL.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:dm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function LZ(e){return new CL(e)}function _L(e){this._context=e}_L.prototype={areaStart:um,areaEnd:um,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 FZ(e){return new _L(e)}function BT(e){return e<0?-1:1}function qT(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(BT(i)+BT(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(c))||0}function UT(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function d0(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 fm(e){this._context=e}fm.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:d0(this,this._t0,UT(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,d0(this,UT(this,n=qT(this,e,t)),n);break;default:d0(this,this._t0,n=qT(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function AL(e){this._context=new kL(e)}(AL.prototype=Object.create(fm.prototype)).point=function(e,t){fm.prototype.point.call(this,t,e)};function kL(e){this._context=e}kL.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 zZ(e){return new fm(e)}function BZ(e){return new AL(e)}function EL(e){this._context=e}EL.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=WT(e),a=WT(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 WT(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 qZ(e){return new EL(e)}function Zg(e,t){this._context=e,this._t=t}Zg.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 UZ(e){return new Zg(e,.5)}function WZ(e){return new Zg(e,0)}function VZ(e){return new Zg(e,1)}function Kc(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 e1(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function HZ(e,t){return e[t]}function KZ(e){const t=[];return t.key=e,t}function GZ(){var e=Nn([]),t=e1,n=Kc,r=HZ;function a(i){var o=Array.from(e.apply(this,arguments),KZ),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=jC(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:Nn(Array.from(i)),a):e},a.value=function(i){return arguments.length?(r=typeof i=="function"?i:Nn(+i),a):r},a.order=function(i){return arguments.length?(t=i==null?e1:typeof i=="function"?i:Nn(Array.from(i)),a):t},a.offset=function(i){return arguments.length?(n=i??Kc,a):n},a}function YZ(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}Kc(e,t)}}function XZ(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}Kc(e,t)}}function QZ(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,v=h[r-1][1]||0,x=(p-v)/2,j=0;j<c;++j){var b=e[t[j]],y=b[r][1]||0,S=b[r-1][1]||0;x+=y-S}d+=p,f+=x*p}a[r-1][1]+=a[r-1][0]=n,d&&(n-=f/d)}a[r-1][1]+=a[r-1][0]=n,Kc(e,t)}}function Jd(e){"@babel/helpers - typeof";return Jd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jd(e)}var ZZ=["type","size","sizeType"];function t1(){return t1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},t1.apply(this,arguments)}function VT(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 HT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VT(Object(n),!0).forEach(function(r){JZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function JZ(e,t,n){return t=eJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eJ(e){var t=tJ(e,"string");return Jd(t)=="symbol"?t:t+""}function tJ(e,t){if(Jd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Jd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function nJ(e,t){if(e==null)return{};var n=rJ(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 rJ(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 PL={symbolCircle:SC,symbolCross:NZ,symbolDiamond:_Z,symbolSquare:AZ,symbolStar:TZ,symbolTriangle:RZ,symbolWye:MZ},sJ=Math.PI/180,aJ=function(t){var n="symbol".concat(Yg(t));return PL[n]||SC},iJ=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*sJ;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}},oJ=function(t,n){PL["symbol".concat(Yg(t))]=n},NC=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=nJ(t,ZZ),f=HT(HT({},d),{},{type:r,size:i,sizeType:c}),h=function(){var y=aJ(r),S=IZ().type(y).size(iJ(i,c,r));return S()},p=f.className,v=f.cx,x=f.cy,j=It(f,!0);return v===+v&&x===+x&&i===+i?X.createElement("path",t1({},j,{className:Yt("recharts-symbols",p),transform:"translate(".concat(v,", ").concat(x,")"),d:h()})):null};NC.registerSymbol=oJ;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 n1(){return n1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},n1.apply(this,arguments)}function 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 lJ(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){ef(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 cJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uJ(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,RL(r.key),r)}}function dJ(e,t,n){return t&&uJ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function fJ(e,t,n){return t=pm(t),pJ(e,TL()?Reflect.construct(t,n||[],pm(e).constructor):t.apply(e,n))}function pJ(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 hJ(e)}function hJ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function TL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(TL=function(){return!!e})()}function pm(e){return pm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},pm(e)}function mJ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r1(e,t)}function r1(e,t){return r1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},r1(e,t)}function ef(e,t,n){return t=RL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RL(e){var t=gJ(e,"string");return Gc(t)=="symbol"?t:t+""}function gJ(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 Rs=32,CC=(function(e){function t(){return cJ(this,t),fJ(this,t,arguments)}return mJ(t,e),dJ(t,[{key:"renderIcon",value:function(r){var a=this.props.inactiveColor,i=Rs/2,o=Rs/6,c=Rs/3,d=r.inactive?a:r.color;if(r.type==="plainline")return X.createElement("line",{strokeWidth:4,fill:"none",stroke:d,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:i,x2:Rs,y2:i,className:"recharts-legend-icon"});if(r.type==="line")return X.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(Rs,"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 X.createElement("path",{stroke:"none",fill:d,d:"M0,".concat(Rs/8,"h").concat(Rs,"v").concat(Rs*3/4,"h").concat(-Rs,"z"),className:"recharts-legend-icon"});if(X.isValidElement(r.legendIcon)){var f=lJ({},r);return delete f.legendIcon,X.cloneElement(r.legendIcon,f)}return X.createElement(NC,{fill:d,cx:i,cy:i,size:Rs,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:Rs,height:Rs},p={display:c==="horizontal"?"inline-block":"block",marginRight:10},v={display:"inline-block",verticalAlign:"middle",marginRight:4};return i.map(function(x,j){var b=x.formatter||d,y=Yt(ef(ef({"recharts-legend-item":!0},"legend-item-".concat(j),!0),"inactive",x.inactive));if(x.type==="none")return null;var S=Vt(x.value)?null:x.value;hi(!Vt(x.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var N=x.inactive?f:x.color;return X.createElement("li",n1({className:y,style:p,key:"legend-item-".concat(j)},xl(r.props,x,j)),X.createElement(YS,{width:o,height:o,viewBox:h,style:v},r.renderIcon(x)),X.createElement("span",{className:"recharts-legend-item-text",style:{color:N}},b?b(S,x,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 X.createElement("ul",{className:"recharts-default-legend",style:c},this.renderItems())}}])})(m.PureComponent);ef(CC,"displayName","Legend");ef(CC,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var f0,GT;function vJ(){if(GT)return f0;GT=1;var e=Hg();function t(){this.__data__=new e,this.size=0}return f0=t,f0}var p0,YT;function xJ(){if(YT)return p0;YT=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return p0=e,p0}var h0,XT;function yJ(){if(XT)return h0;XT=1;function e(t){return this.__data__.get(t)}return h0=e,h0}var m0,QT;function bJ(){if(QT)return m0;QT=1;function e(t){return this.__data__.has(t)}return m0=e,m0}var g0,ZT;function wJ(){if(ZT)return g0;ZT=1;var e=Hg(),t=mC(),n=gC(),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 g0=a,g0}var v0,JT;function OL(){if(JT)return v0;JT=1;var e=Hg(),t=vJ(),n=xJ(),r=yJ(),a=bJ(),i=wJ();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,v0=o,v0}var x0,eR;function jJ(){if(eR)return x0;eR=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return x0=t,x0}var y0,tR;function SJ(){if(tR)return y0;tR=1;function e(t){return this.__data__.has(t)}return y0=e,y0}var b0,nR;function ML(){if(nR)return b0;nR=1;var e=gC(),t=jJ(),n=SJ();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,b0=r,b0}var w0,rR;function IL(){if(rR)return w0;rR=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 w0=e,w0}var j0,sR;function $L(){if(sR)return j0;sR=1;function e(t,n){return t.has(n)}return j0=e,j0}var S0,aR;function DL(){if(aR)return S0;aR=1;var e=ML(),t=IL(),n=$L(),r=1,a=2;function i(o,c,d,f,h,p){var v=d&r,x=o.length,j=c.length;if(x!=j&&!(v&&j>x))return!1;var b=p.get(o),y=p.get(c);if(b&&y)return b==c&&y==o;var S=-1,N=!0,_=d&a?new e:void 0;for(p.set(o,c),p.set(c,o);++S<x;){var A=o[S],k=c[S];if(f)var E=v?f(k,A,S,c,o,p):f(A,k,S,o,c,p);if(E!==void 0){if(E)continue;N=!1;break}if(_){if(!t(c,function(P,R){if(!n(_,R)&&(A===P||h(A,P,d,f,p)))return _.push(R)})){N=!1;break}}else if(!(A===k||h(A,k,d,f,p))){N=!1;break}}return p.delete(o),p.delete(c),N}return S0=i,S0}var N0,iR;function NJ(){if(iR)return N0;iR=1;var e=Ka(),t=e.Uint8Array;return N0=t,N0}var C0,oR;function CJ(){if(oR)return C0;oR=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(a,i){r[++n]=[i,a]}),r}return C0=e,C0}var _0,lR;function _C(){if(lR)return _0;lR=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(a){r[++n]=a}),r}return _0=e,_0}var A0,cR;function _J(){if(cR)return A0;cR=1;var e=Xf(),t=NJ(),n=hC(),r=DL(),a=CJ(),i=_C(),o=1,c=2,d="[object Boolean]",f="[object Date]",h="[object Error]",p="[object Map]",v="[object Number]",x="[object RegExp]",j="[object Set]",b="[object String]",y="[object Symbol]",S="[object ArrayBuffer]",N="[object DataView]",_=e?e.prototype:void 0,A=_?_.valueOf:void 0;function k(E,P,R,M,D,U,F){switch(R){case N:if(E.byteLength!=P.byteLength||E.byteOffset!=P.byteOffset)return!1;E=E.buffer,P=P.buffer;case S:return!(E.byteLength!=P.byteLength||!U(new t(E),new t(P)));case d:case f:case v:return n(+E,+P);case h:return E.name==P.name&&E.message==P.message;case x:case b:return E==P+"";case p:var G=a;case j:var H=M&o;if(G||(G=i),E.size!=P.size&&!H)return!1;var L=F.get(E);if(L)return L==P;M|=c,F.set(E,P);var I=r(G(E),G(P),M,D,U,F);return F.delete(E),I;case y:if(A)return A.call(E)==A.call(P)}return!1}return A0=k,A0}var k0,uR;function LL(){if(uR)return k0;uR=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 k0=e,k0}var E0,dR;function AJ(){if(dR)return E0;dR=1;var e=LL(),t=as();function n(r,a,i){var o=a(r);return t(r)?o:e(o,i(r))}return E0=n,E0}var P0,fR;function kJ(){if(fR)return P0;fR=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 P0=e,P0}var T0,pR;function EJ(){if(pR)return T0;pR=1;function e(){return[]}return T0=e,T0}var R0,hR;function PJ(){if(hR)return R0;hR=1;var e=kJ(),t=EJ(),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 R0=i,R0}var O0,mR;function TJ(){if(mR)return O0;mR=1;function e(t,n){for(var r=-1,a=Array(t);++r<t;)a[r]=n(r);return a}return O0=e,O0}var M0,gR;function RJ(){if(gR)return M0;gR=1;var e=Ti(),t=Ri(),n="[object Arguments]";function r(a){return t(a)&&e(a)==n}return M0=r,M0}var I0,vR;function AC(){if(vR)return I0;vR=1;var e=RJ(),t=Ri(),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 I0=i,I0}var Rd={exports:{}},$0,xR;function OJ(){if(xR)return $0;xR=1;function e(){return!1}return $0=e,$0}Rd.exports;var yR;function FL(){return yR||(yR=1,(function(e,t){var n=Ka(),r=OJ(),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})(Rd,Rd.exports)),Rd.exports}var D0,bR;function kC(){if(bR)return D0;bR=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 D0=n,D0}var L0,wR;function EC(){if(wR)return L0;wR=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return L0=t,L0}var F0,jR;function MJ(){if(jR)return F0;jR=1;var e=Ti(),t=EC(),n=Ri(),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]",v="[object RegExp]",x="[object Set]",j="[object String]",b="[object WeakMap]",y="[object ArrayBuffer]",S="[object DataView]",N="[object Float32Array]",_="[object Float64Array]",A="[object Int8Array]",k="[object Int16Array]",E="[object Int32Array]",P="[object Uint8Array]",R="[object Uint8ClampedArray]",M="[object Uint16Array]",D="[object Uint32Array]",U={};U[N]=U[_]=U[A]=U[k]=U[E]=U[P]=U[R]=U[M]=U[D]=!0,U[r]=U[a]=U[y]=U[i]=U[S]=U[o]=U[c]=U[d]=U[f]=U[h]=U[p]=U[v]=U[x]=U[j]=U[b]=!1;function F(G){return n(G)&&t(G.length)&&!!U[e(G)]}return F0=F,F0}var z0,SR;function zL(){if(SR)return z0;SR=1;function e(t){return function(n){return t(n)}}return z0=e,z0}var Od={exports:{}};Od.exports;var NR;function IJ(){return NR||(NR=1,(function(e,t){var n=iL(),r=t&&!t.nodeType&&t,a=r&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===r,o=i&&n.process,c=(function(){try{var d=a&&a.require&&a.require("util").types;return d||o&&o.binding&&o.binding("util")}catch{}})();e.exports=c})(Od,Od.exports)),Od.exports}var B0,CR;function BL(){if(CR)return B0;CR=1;var e=MJ(),t=zL(),n=IJ(),r=n&&n.isTypedArray,a=r?t(r):e;return B0=a,B0}var q0,_R;function $J(){if(_R)return q0;_R=1;var e=TJ(),t=AC(),n=as(),r=FL(),a=kC(),i=BL(),o=Object.prototype,c=o.hasOwnProperty;function d(f,h){var p=n(f),v=!p&&t(f),x=!p&&!v&&r(f),j=!p&&!v&&!x&&i(f),b=p||v||x||j,y=b?e(f.length,String):[],S=y.length;for(var N in f)(h||c.call(f,N))&&!(b&&(N=="length"||x&&(N=="offset"||N=="parent")||j&&(N=="buffer"||N=="byteLength"||N=="byteOffset")||a(N,S)))&&y.push(N);return y}return q0=d,q0}var U0,AR;function DJ(){if(AR)return U0;AR=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,a=typeof r=="function"&&r.prototype||e;return n===a}return U0=t,U0}var W0,kR;function qL(){if(kR)return W0;kR=1;function e(t,n){return function(r){return t(n(r))}}return W0=e,W0}var V0,ER;function LJ(){if(ER)return V0;ER=1;var e=qL(),t=e(Object.keys,Object);return V0=t,V0}var H0,PR;function FJ(){if(PR)return H0;PR=1;var e=DJ(),t=LJ(),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 H0=a,H0}var K0,TR;function Zf(){if(TR)return K0;TR=1;var e=pC(),t=EC();function n(r){return r!=null&&t(r.length)&&!e(r)}return K0=n,K0}var G0,RR;function Jg(){if(RR)return G0;RR=1;var e=$J(),t=FJ(),n=Zf();function r(a){return n(a)?e(a):t(a)}return G0=r,G0}var Y0,OR;function zJ(){if(OR)return Y0;OR=1;var e=AJ(),t=PJ(),n=Jg();function r(a){return e(a,n,t)}return Y0=r,Y0}var X0,MR;function BJ(){if(MR)return X0;MR=1;var e=zJ(),t=1,n=Object.prototype,r=n.hasOwnProperty;function a(i,o,c,d,f,h){var p=c&t,v=e(i),x=v.length,j=e(o),b=j.length;if(x!=b&&!p)return!1;for(var y=x;y--;){var S=v[y];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 A=!0;h.set(i,o),h.set(o,i);for(var k=p;++y<x;){S=v[y];var E=i[S],P=o[S];if(d)var R=p?d(P,E,S,o,i,h):d(E,P,S,i,o,h);if(!(R===void 0?E===P||f(E,P,c,d,h):R)){A=!1;break}k||(k=S=="constructor")}if(A&&!k){var M=i.constructor,D=o.constructor;M!=D&&"constructor"in i&&"constructor"in o&&!(typeof M=="function"&&M instanceof M&&typeof D=="function"&&D instanceof D)&&(A=!1)}return h.delete(i),h.delete(o),A}return X0=a,X0}var Q0,IR;function qJ(){if(IR)return Q0;IR=1;var e=Il(),t=Ka(),n=e(t,"DataView");return Q0=n,Q0}var Z0,$R;function UJ(){if($R)return Z0;$R=1;var e=Il(),t=Ka(),n=e(t,"Promise");return Z0=n,Z0}var J0,DR;function UL(){if(DR)return J0;DR=1;var e=Il(),t=Ka(),n=e(t,"Set");return J0=n,J0}var ew,LR;function WJ(){if(LR)return ew;LR=1;var e=Il(),t=Ka(),n=e(t,"WeakMap");return ew=n,ew}var tw,FR;function VJ(){if(FR)return tw;FR=1;var e=qJ(),t=mC(),n=UJ(),r=UL(),a=WJ(),i=Ti(),o=oL(),c="[object Map]",d="[object Object]",f="[object Promise]",h="[object Set]",p="[object WeakMap]",v="[object DataView]",x=o(e),j=o(t),b=o(n),y=o(r),S=o(a),N=i;return(e&&N(new e(new ArrayBuffer(1)))!=v||t&&N(new t)!=c||n&&N(n.resolve())!=f||r&&N(new r)!=h||a&&N(new a)!=p)&&(N=function(_){var A=i(_),k=A==d?_.constructor:void 0,E=k?o(k):"";if(E)switch(E){case x:return v;case j:return c;case b:return f;case y:return h;case S:return p}return A}),tw=N,tw}var nw,zR;function HJ(){if(zR)return nw;zR=1;var e=OL(),t=DL(),n=_J(),r=BJ(),a=VJ(),i=as(),o=FL(),c=BL(),d=1,f="[object Arguments]",h="[object Array]",p="[object Object]",v=Object.prototype,x=v.hasOwnProperty;function j(b,y,S,N,_,A){var k=i(b),E=i(y),P=k?h:a(b),R=E?h:a(y);P=P==f?p:P,R=R==f?p:R;var M=P==p,D=R==p,U=P==R;if(U&&o(b)){if(!o(y))return!1;k=!0,M=!1}if(U&&!M)return A||(A=new e),k||c(b)?t(b,y,S,N,_,A):n(b,y,P,S,N,_,A);if(!(S&d)){var F=M&&x.call(b,"__wrapped__"),G=D&&x.call(y,"__wrapped__");if(F||G){var H=F?b.value():b,L=G?y.value():y;return A||(A=new e),_(H,L,S,N,A)}}return U?(A||(A=new e),r(b,y,S,N,_,A)):!1}return nw=j,nw}var rw,BR;function PC(){if(BR)return rw;BR=1;var e=HJ(),t=Ri();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 rw=n,rw}var sw,qR;function KJ(){if(qR)return sw;qR=1;var e=OL(),t=PC(),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 v=c[f];if(p&&v[2]?v[1]!==i[v[0]]:!(v[0]in i))return!1}for(;++f<h;){v=c[f];var x=v[0],j=i[x],b=v[1];if(p&&v[2]){if(j===void 0&&!(x in i))return!1}else{var y=new e;if(d)var S=d(j,b,x,i,o,y);if(!(S===void 0?t(b,j,n|r,d,y):S))return!1}}return!0}return sw=a,sw}var aw,UR;function WL(){if(UR)return aw;UR=1;var e=No();function t(n){return n===n&&!e(n)}return aw=t,aw}var iw,WR;function GJ(){if(WR)return iw;WR=1;var e=WL(),t=Jg();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 iw=n,iw}var ow,VR;function VL(){if(VR)return ow;VR=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return ow=e,ow}var lw,HR;function YJ(){if(HR)return lw;HR=1;var e=KJ(),t=GJ(),n=VL();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 lw=r,lw}var cw,KR;function XJ(){if(KR)return cw;KR=1;function e(t,n){return t!=null&&n in Object(t)}return cw=e,cw}var uw,GR;function QJ(){if(GR)return uw;GR=1;var e=uL(),t=AC(),n=as(),r=kC(),a=EC(),i=Gg();function o(c,d,f){d=e(d,c);for(var h=-1,p=d.length,v=!1;++h<p;){var x=i(d[h]);if(!(v=c!=null&&f(c,x)))break;c=c[x]}return v||++h!=p?v:(p=c==null?0:c.length,!!p&&a(p)&&r(x,p)&&(n(c)||t(c)))}return uw=o,uw}var dw,YR;function ZJ(){if(YR)return dw;YR=1;var e=XJ(),t=QJ();function n(r,a){return r!=null&&t(r,a,e)}return dw=n,dw}var fw,XR;function JJ(){if(XR)return fw;XR=1;var e=PC(),t=dL(),n=ZJ(),r=fC(),a=WL(),i=VL(),o=Gg(),c=1,d=2;function f(h,p){return r(h)&&a(p)?i(o(h),p):function(v){var x=t(v,h);return x===void 0&&x===p?n(v,h):e(p,x,c|d)}}return fw=f,fw}var pw,QR;function Tu(){if(QR)return pw;QR=1;function e(t){return t}return pw=e,pw}var hw,ZR;function eee(){if(ZR)return hw;ZR=1;function e(t){return function(n){return n?.[t]}}return hw=e,hw}var mw,JR;function tee(){if(JR)return mw;JR=1;var e=xC();function t(n){return function(r){return e(r,n)}}return mw=t,mw}var gw,eO;function nee(){if(eO)return gw;eO=1;var e=eee(),t=tee(),n=fC(),r=Gg();function a(i){return n(i)?e(r(i)):t(i)}return gw=a,gw}var vw,tO;function Ga(){if(tO)return vw;tO=1;var e=YJ(),t=JJ(),n=Tu(),r=as(),a=nee();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 vw=i,vw}var xw,nO;function HL(){if(nO)return xw;nO=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 xw=e,xw}var yw,rO;function ree(){if(rO)return yw;rO=1;function e(t){return t!==t}return yw=e,yw}var bw,sO;function see(){if(sO)return bw;sO=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 bw=e,bw}var ww,aO;function aee(){if(aO)return ww;aO=1;var e=HL(),t=ree(),n=see();function r(a,i,o){return i===i?n(a,i,o):e(a,t,o)}return ww=r,ww}var jw,iO;function iee(){if(iO)return jw;iO=1;var e=aee();function t(n,r){var a=n==null?0:n.length;return!!a&&e(n,r,0)>-1}return jw=t,jw}var Sw,oO;function oee(){if(oO)return Sw;oO=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 Sw=e,Sw}var Nw,lO;function lee(){if(lO)return Nw;lO=1;function e(){}return Nw=e,Nw}var Cw,cO;function cee(){if(cO)return Cw;cO=1;var e=UL(),t=lee(),n=_C(),r=1/0,a=e&&1/n(new e([,-0]))[1]==r?function(i){return new e(i)}:t;return Cw=a,Cw}var _w,uO;function uee(){if(uO)return _w;uO=1;var e=ML(),t=iee(),n=oee(),r=$L(),a=cee(),i=_C(),o=200;function c(d,f,h){var p=-1,v=t,x=d.length,j=!0,b=[],y=b;if(h)j=!1,v=n;else if(x>=o){var S=f?null:a(d);if(S)return i(S);j=!1,v=r,y=new e}else y=f?[]:b;e:for(;++p<x;){var N=d[p],_=f?f(N):N;if(N=h||N!==0?N:0,j&&_===_){for(var A=y.length;A--;)if(y[A]===_)continue e;f&&y.push(_),b.push(N)}else v(y,_,h)||(y!==b&&y.push(_),b.push(N))}return b}return _w=c,_w}var Aw,dO;function dee(){if(dO)return Aw;dO=1;var e=Ga(),t=uee();function n(r,a){return r&&r.length?t(r,e(a,2)):[]}return Aw=n,Aw}var fee=dee();const fO=vn(fee);function KL(e,t,n){return t===!0?fO(e,n):Vt(t)?fO(e,t):e}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)}var pee=["ref"];function pO(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 oi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pO(Object(n),!0).forEach(function(r){ev(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hO(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 mee(e,t,n){return t&&hO(e.prototype,t),n&&hO(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function gee(e,t,n){return t=hm(t),vee(e,GL()?Reflect.construct(t,n||[],hm(e).constructor):t.apply(e,n))}function vee(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 xee(e)}function xee(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 hm(e){return hm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},hm(e)}function yee(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s1(e,t)}function s1(e,t){return s1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},s1(e,t)}function ev(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=bee(e,"string");return Yc(t)=="symbol"?t:t+""}function bee(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)}function wee(e,t){if(e==null)return{};var n=jee(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 jee(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 See(e){return e.value}function Nee(e,t){if(X.isValidElement(e))return X.cloneElement(e,t);if(typeof e=="function")return X.createElement(e,t);t.ref;var n=wee(t,pee);return X.createElement(CC,n)}var mO=1,cl=(function(e){function t(){var n;hee(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=gee(this,t,[].concat(a)),ev(n,"lastBoundingBox",{width:-1,height:-1}),n}return yee(t,e),mee(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)>mO||Math.abs(a.height-this.lastBoundingBox.height)>mO)&&(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?oi({},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,v;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(o==="center"&&i==="vertical"){var x=this.getBBoxSnapshot();p={left:((f||0)-x.width)/2}}else p=o==="right"?{right:d&&d.right||0}:{left:d&&d.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(c==="middle"){var j=this.getBBoxSnapshot();v={top:((h||0)-j.height)/2}}else v=c==="bottom"?{bottom:d&&d.bottom||0}:{top:d&&d.top||0};return oi(oi({},p),v)}},{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=oi(oi({position:"absolute",width:o||"auto",height:c||"auto"},this.getDefaultPosition(d)),d);return X.createElement("div",{className:"recharts-legend-wrapper",style:p,ref:function(x){r.wrapperNode=x}},Nee(i,oi(oi({},this.props),{},{payload:KL(h,f,See)})))}}],[{key:"getWithHeight",value:function(r,a){var i=oi(oi({},this.defaultProps),r.props),o=i.layout;return o==="vertical"&&at(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||a}:null}}])})(m.PureComponent);ev(cl,"displayName","Legend");ev(cl,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var kw,gO;function Cee(){if(gO)return kw;gO=1;var e=Xf(),t=AC(),n=as(),r=e?e.isConcatSpreadable:void 0;function a(i){return n(i)||t(i)||!!(r&&i&&i[r])}return kw=a,kw}var Ew,vO;function XL(){if(vO)return Ew;vO=1;var e=LL(),t=Cee();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 Ew=n,Ew}var Pw,xO;function _ee(){if(xO)return Pw;xO=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 Pw=e,Pw}var Tw,yO;function Aee(){if(yO)return Tw;yO=1;var e=_ee(),t=e();return Tw=t,Tw}var Rw,bO;function QL(){if(bO)return Rw;bO=1;var e=Aee(),t=Jg();function n(r,a){return r&&e(r,a,t)}return Rw=n,Rw}var Ow,wO;function kee(){if(wO)return Ow;wO=1;var e=Zf();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 Ow=t,Ow}var Mw,jO;function TC(){if(jO)return Mw;jO=1;var e=QL(),t=kee(),n=t(e);return Mw=n,Mw}var Iw,SO;function ZL(){if(SO)return Iw;SO=1;var e=TC(),t=Zf();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 Iw=n,Iw}var $w,NO;function Eee(){if(NO)return $w;NO=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return $w=e,$w}var Dw,CO;function Pee(){if(CO)return Dw;CO=1;var e=ku();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 Dw=t,Dw}var Lw,_O;function Tee(){if(_O)return Lw;_O=1;var e=Pee();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 Lw=t,Lw}var Fw,AO;function Ree(){if(AO)return Fw;AO=1;var e=vC(),t=xC(),n=Ga(),r=ZL(),a=Eee(),i=zL(),o=Tee(),c=Tu(),d=as();function f(h,p,v){p.length?p=e(p,function(b){return d(b)?function(y){return t(y,b.length===1?b[0]:b)}:b}):p=[c];var x=-1;p=e(p,i(n));var j=r(h,function(b,y,S){var N=e(p,function(_){return _(b)});return{criteria:N,index:++x,value:b}});return a(j,function(b,y){return o(b,y,v)})}return Fw=f,Fw}var zw,kO;function Oee(){if(kO)return zw;kO=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 zw=e,zw}var Bw,EO;function Mee(){if(EO)return Bw;EO=1;var e=Oee(),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 Bw=n,Bw}var qw,PO;function Iee(){if(PO)return qw;PO=1;function e(t){return function(){return t}}return qw=e,qw}var Uw,TO;function JL(){if(TO)return Uw;TO=1;var e=Il(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return Uw=t,Uw}var Ww,RO;function $ee(){if(RO)return Ww;RO=1;var e=Iee(),t=JL(),n=Tu(),r=t?function(a,i){return t(a,"toString",{configurable:!0,enumerable:!1,value:e(i),writable:!0})}:n;return Ww=r,Ww}var Vw,OO;function Dee(){if(OO)return Vw;OO=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 Vw=r,Vw}var Hw,MO;function Lee(){if(MO)return Hw;MO=1;var e=$ee(),t=Dee(),n=t(e);return Hw=n,Hw}var Kw,IO;function Fee(){if(IO)return Kw;IO=1;var e=Tu(),t=Mee(),n=Lee();function r(a,i){return n(t(a,i,e),a+"")}return Kw=r,Kw}var Gw,$O;function tv(){if($O)return Gw;$O=1;var e=hC(),t=Zf(),n=kC(),r=No();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 Gw=a,Gw}var Yw,DO;function zee(){if(DO)return Yw;DO=1;var e=XL(),t=Ree(),n=Fee(),r=tv(),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 Yw=a,Yw}var Bee=zee();const RC=vn(Bee);function tf(e){"@babel/helpers - typeof";return tf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tf(e)}function a1(){return a1=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},a1.apply(this,arguments)}function qee(e,t){return Hee(e)||Vee(e,t)||Wee(e,t)||Uee()}function Uee(){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 Wee(e,t){if(e){if(typeof e=="string")return LO(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 LO(e,t)}}function LO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Vee(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,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 Hee(e){if(Array.isArray(e))return e}function FO(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 Xw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FO(Object(n),!0).forEach(function(r){Kee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kee(e,t,n){return t=Gee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gee(e){var t=Yee(e,"string");return tf(t)=="symbol"?t:t+""}function Yee(e,t){if(tf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(tf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xee(e){return Array.isArray(e)&&sr(e[0])&&sr(e[1])?e.join(" ~ "):e}var Qee=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,v=t.itemSorter,x=t.wrapperClassName,j=t.labelClassName,b=t.label,y=t.labelFormatter,S=t.accessibilityLayer,N=S===void 0?!1:S,_=function(){if(h&&h.length){var F={padding:0,margin:0},G=(v?RC(h,v):h).map(function(H,L){if(H.type==="none")return null;var I=Xw({display:"block",paddingTop:4,paddingBottom:4,color:H.color||"#000"},c),Y=H.formatter||p||Xee,W=H.value,O=H.name,Q=W,q=O;if(Y&&Q!=null&&q!=null){var z=Y(W,O,H,L,h);if(Array.isArray(z)){var K=qee(z,2);Q=K[0],q=K[1]}else Q=z}return X.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(L),style:I},sr(q)?X.createElement("span",{className:"recharts-tooltip-item-name"},q):null,sr(q)?X.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,X.createElement("span",{className:"recharts-tooltip-item-value"},Q),X.createElement("span",{className:"recharts-tooltip-item-unit"},H.unit||""))});return X.createElement("ul",{className:"recharts-tooltip-item-list",style:F},G)}return null},A=Xw({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),k=Xw({margin:0},f),E=!Ht(b),P=E?b:"",R=Yt("recharts-default-tooltip",x),M=Yt("recharts-tooltip-label",j);E&&y&&h!==void 0&&h!==null&&(P=y(b,h));var D=N?{role:"status","aria-live":"assertive"}:{};return X.createElement("div",a1({className:R,style:A},D),X.createElement("p",{className:M,style:k},X.isValidElement(P)?P:"".concat(P)),_())};function nf(e){"@babel/helpers - typeof";return nf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nf(e)}function _h(e,t,n){return t=Zee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zee(e){var t=Jee(e,"string");return nf(t)=="symbol"?t:t+""}function Jee(e,t){if(nf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(nf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var bd="recharts-tooltip-wrapper",ete={visibility:"hidden"};function tte(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return Yt(bd,_h(_h(_h(_h({},"".concat(bd,"-right"),at(n)&&t&&at(t.x)&&n>=t.x),"".concat(bd,"-left"),at(n)&&t&&at(t.x)&&n<t.x),"".concat(bd,"-bottom"),at(r)&&t&&at(t.y)&&r>=t.y),"".concat(bd,"-top"),at(r)&&t&&at(t.y)&&r<t.y))}function zO(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&&at(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 v=h,x=d[r];return v<x?Math.max(p,d[r]):Math.max(h,d[r])}var j=p+c,b=d[r]+f;return j>b?Math.max(h,d[r]):Math.max(p,d[r])}function nte(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 rte(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=zO({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:a,reverseDirection:i,tooltipDimension:o.width,viewBox:d,viewBoxDimension:d.width}),p=zO({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:a,reverseDirection:i,tooltipDimension:o.height,viewBox:d,viewBoxDimension:d.height}),f=nte({translateX:h,translateY:p,useTranslate3d:c})):f=ete,{cssProperties:f,cssClasses:tte({translateX:h,translateY:p,coordinate:n})}}function Xc(e){"@babel/helpers - typeof";return Xc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xc(e)}function BO(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 qO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BO(Object(n),!0).forEach(function(r){o1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ste(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ate(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 ite(e,t,n){return t&&ate(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ote(e,t,n){return t=mm(t),lte(e,e4()?Reflect.construct(t,n||[],mm(e).constructor):t.apply(e,n))}function lte(e,t){if(t&&(Xc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cte(e)}function cte(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 mm(e){return mm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},mm(e)}function ute(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&&i1(e,t)}function i1(e,t){return i1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},i1(e,t)}function o1(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=dte(e,"string");return Xc(t)=="symbol"?t:t+""}function dte(e,t){if(Xc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Xc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var UO=1,fte=(function(e){function t(){var n;ste(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=ote(this,t,[].concat(a)),o1(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),o1(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 ute(t,e),ite(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>UO||Math.abs(r.height-this.state.lastBoundingBox.height)>UO)&&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,v=a.isAnimationActive,x=a.offset,j=a.position,b=a.reverseDirection,y=a.useTranslate3d,S=a.viewBox,N=a.wrapperStyle,_=rte({allowEscapeViewBox:o,coordinate:h,offsetTopLeft:x,position:j,reverseDirection:b,tooltipBox:this.state.lastBoundingBox,useTranslate3d:y,viewBox:S}),A=_.cssClasses,k=_.cssProperties,E=qO(qO({transition:v&&i?"transform ".concat(c,"ms ").concat(d):void 0},k),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&p?"visible":"hidden",position:"absolute",top:0,left:0},N);return X.createElement("div",{tabIndex:-1,className:A,style:E,ref:function(R){r.wrapperNode=R}},f)}}])})(m.PureComponent),pte=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},$l={isSsr:pte()};function Qc(e){"@babel/helpers - typeof";return Qc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qc(e)}function WO(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 VO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WO(Object(n),!0).forEach(function(r){OC(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hte(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mte(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 gte(e,t,n){return t&&mte(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function vte(e,t,n){return t=gm(t),xte(e,n4()?Reflect.construct(t,n||[],gm(e).constructor):t.apply(e,n))}function xte(e,t){if(t&&(Qc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yte(e)}function yte(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 gm(e){return gm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},gm(e)}function bte(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l1(e,t)}function l1(e,t){return l1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},l1(e,t)}function OC(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=wte(e,"string");return Qc(t)=="symbol"?t:t+""}function wte(e,t){if(Qc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Qc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function jte(e){return e.dataKey}function Ste(e,t){return X.isValidElement(e)?X.cloneElement(e,t):typeof e=="function"?X.createElement(e,t):X.createElement(Qee,t)}var Qr=(function(e){function t(){return hte(this,t),vte(this,t,arguments)}return bte(t,e),gte(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,v=a.isAnimationActive,x=a.offset,j=a.payload,b=a.payloadUniqBy,y=a.position,S=a.reverseDirection,N=a.useTranslate3d,_=a.viewBox,A=a.wrapperStyle,k=j??[];p&&k.length&&(k=KL(j.filter(function(P){return P.value!=null&&(P.hide!==!0||r.props.includeHidden)}),b,jte));var E=k.length>0;return X.createElement(fte,{allowEscapeViewBox:o,animationDuration:c,animationEasing:d,isAnimationActive:v,active:i,coordinate:h,hasPayload:E,offset:x,position:y,reverseDirection:S,useTranslate3d:N,viewBox:_,wrapperStyle:A},Ste(f,VO(VO({},this.props),{},{payload:k})))}}])})(m.PureComponent);OC(Qr,"displayName","Tooltip");OC(Qr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!$l.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var Qw,HO;function Nte(){if(HO)return Qw;HO=1;var e=Ka(),t=function(){return e.Date.now()};return Qw=t,Qw}var Zw,KO;function Cte(){if(KO)return Zw;KO=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return Zw=t,Zw}var Jw,GO;function _te(){if(GO)return Jw;GO=1;var e=Cte(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return Jw=n,Jw}var ej,YO;function s4(){if(YO)return ej;YO=1;var e=_te(),t=No(),n=ku(),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 ej=d,ej}var tj,XO;function Ate(){if(XO)return tj;XO=1;var e=No(),t=Nte(),n=s4(),r="Expected a function",a=Math.max,i=Math.min;function o(c,d,f){var h,p,v,x,j,b,y=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,v=N?a(n(f.maxWait)||0,d):v,_="trailing"in f?!!f.trailing:_);function A(G){var H=h,L=p;return h=p=void 0,y=G,x=c.apply(L,H),x}function k(G){return y=G,j=setTimeout(R,d),S?A(G):x}function E(G){var H=G-b,L=G-y,I=d-H;return N?i(I,v-L):I}function P(G){var H=G-b,L=G-y;return b===void 0||H>=d||H<0||N&&L>=v}function R(){var G=t();if(P(G))return M(G);j=setTimeout(R,E(G))}function M(G){return j=void 0,_&&h?A(G):(h=p=void 0,x)}function D(){j!==void 0&&clearTimeout(j),y=0,h=b=p=j=void 0}function U(){return j===void 0?x:M(t())}function F(){var G=t(),H=P(G);if(h=arguments,p=this,b=G,H){if(j===void 0)return k(b);if(N)return clearTimeout(j),j=setTimeout(R,d),A(b)}return j===void 0&&(j=setTimeout(R,d)),x}return F.cancel=D,F.flush=U,F}return tj=o,tj}var nj,QO;function kte(){if(QO)return nj;QO=1;var e=Ate(),t=No(),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 nj=r,nj}var Ete=kte();const a4=vn(Ete);function rf(e){"@babel/helpers - typeof";return rf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rf(e)}function ZO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ah(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZO(Object(n),!0).forEach(function(r){Pte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pte(e,t,n){return t=Tte(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tte(e){var t=Rte(e,"string");return rf(t)=="symbol"?t:t+""}function Rte(e,t){if(rf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(rf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ote(e,t){return Dte(e)||$te(e,t)||Ite(e,t)||Mte()}function Mte(){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 Ite(e,t){if(e){if(typeof e=="string")return JO(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 JO(e,t)}}function JO(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 $te(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 Dte(e){if(Array.isArray(e))return e}var vm=m.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,v=e.maxHeight,x=e.children,j=e.debounce,b=j===void 0?0:j,y=e.id,S=e.className,N=e.onResize,_=e.style,A=_===void 0?{}:_,k=m.useRef(null),E=m.useRef();E.current=N,m.useImperativeHandle(t,function(){return Object.defineProperty(k.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),k.current},configurable:!0})});var P=m.useState({containerWidth:a.width,containerHeight:a.height}),R=Ote(P,2),M=R[0],D=R[1],U=m.useCallback(function(G,H){D(function(L){var I=Math.round(G),Y=Math.round(H);return L.containerWidth===I&&L.containerHeight===Y?L:{containerWidth:I,containerHeight:Y}})},[]);m.useEffect(function(){var G=function(O){var Q,q=O[0].contentRect,z=q.width,K=q.height;U(z,K),(Q=E.current)===null||Q===void 0||Q.call(E,z,K)};b>0&&(G=a4(G,b,{trailing:!0,leading:!1}));var H=new ResizeObserver(G),L=k.current.getBoundingClientRect(),I=L.width,Y=L.height;return U(I,Y),H.observe(k.current),function(){H.disconnect()}},[U,b]);var F=m.useMemo(function(){var G=M.containerWidth,H=M.containerHeight;if(G<0||H<0)return null;hi(nl(o)||nl(d),`The width(%s) and height(%s) are both fixed numbers,
|
|
62
|
+
maybe you don't need to use a ResponsiveContainer.`,o,d),hi(!n||n>0,"The aspect(%s) must be greater than zero.",n);var L=nl(o)?G:o,I=nl(d)?H:d;n&&n>0&&(L?I=L/n:I&&(L=I*n),v&&I>v&&(I=v)),hi(L>0||I>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.`,L,I,o,d,h,p,n);var Y=!Array.isArray(x)&&pi(x.type).endsWith("Chart");return X.Children.map(x,function(W){return X.isValidElement(W)?m.cloneElement(W,Ah({width:L,height:I},Y?{style:Ah({height:"100%",width:"100%",maxHeight:I,maxWidth:L},W.props.style)}:{})):W})},[n,x,d,v,p,h,M,o]);return X.createElement("div",{id:y?"".concat(y):void 0,className:Yt("recharts-responsive-container",S),style:Ah(Ah({},A),{},{width:o,height:d,minWidth:h,minHeight:p,maxHeight:v}),ref:k},F)}),nv=function(t){return null};nv.displayName="Cell";function sf(e){"@babel/helpers - typeof";return sf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sf(e)}function e2(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 c1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?e2(Object(n),!0).forEach(function(r){Lte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lte(e,t,n){return t=Fte(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fte(e){var t=zte(e,"string");return sf(t)=="symbol"?t:t+""}function zte(e,t){if(sf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(sf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gc={widthCache:{},cacheCount:0},Bte=2e3,qte={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},t2="recharts_measurement_span";function Ute(e){var t=c1({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var zd=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||$l.isSsr)return{width:0,height:0};var r=Ute(n),a=JSON.stringify({text:t,copyStyle:r});if(gc.widthCache[a])return gc.widthCache[a];try{var i=document.getElementById(t2);i||(i=document.createElement("span"),i.setAttribute("id",t2),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var o=c1(c1({},qte),r);Object.assign(i.style,o),i.textContent="".concat(t);var c=i.getBoundingClientRect(),d={width:c.width,height:c.height};return gc.widthCache[a]=d,++gc.cacheCount>Bte&&(gc.cacheCount=0,gc.widthCache={}),d}catch{return{width:0,height:0}}},Wte=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function af(e){"@babel/helpers - typeof";return af=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},af(e)}function xm(e,t){return Gte(e)||Kte(e,t)||Hte(e,t)||Vte()}function Vte(){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 Hte(e,t){if(e){if(typeof e=="string")return n2(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 n2(e,t)}}function n2(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 Kte(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 Gte(e){if(Array.isArray(e))return e}function Yte(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r2(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,Qte(r.key),r)}}function Xte(e,t,n){return t&&r2(e.prototype,t),n&&r2(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Qte(e){var t=Zte(e,"string");return af(t)=="symbol"?t:t+""}function Zte(e,t){if(af(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(af(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var s2=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,a2=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Jte=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,ene=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,i4={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},tne=Object.keys(i4),kc="NaN";function nne(e,t){return e*i4[t]}var kh=(function(){function e(t,n){Yte(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!Jte.test(n)&&(this.num=NaN,this.unit=""),tne.includes(n)&&(this.num=nne(t,n),this.unit="px")}return Xte(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=ene.exec(n))!==null&&r!==void 0?r:[],i=xm(a,3),o=i[1],c=i[2];return new e(parseFloat(o),c??"")}}])})();function o4(e){if(e.includes(kc))return kc;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=s2.exec(t))!==null&&n!==void 0?n:[],a=xm(r,4),i=a[1],o=a[2],c=a[3],d=kh.parse(i??""),f=kh.parse(c??""),h=o==="*"?d.multiply(f):d.divide(f);if(h.isNaN())return kc;t=t.replace(s2,h.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var p,v=(p=a2.exec(t))!==null&&p!==void 0?p:[],x=xm(v,4),j=x[1],b=x[2],y=x[3],S=kh.parse(j??""),N=kh.parse(y??""),_=b==="+"?S.add(N):S.subtract(N);if(_.isNaN())return kc;t=t.replace(a2,_.toString())}return t}var i2=/\(([^()]*)\)/;function rne(e){for(var t=e;t.includes("(");){var n=i2.exec(t),r=xm(n,2),a=r[1];t=t.replace(i2,o4(a))}return t}function sne(e){var t=e.replace(/\s+/g,"");return t=rne(t),t=o4(t),t}function ane(e){try{return sne(e)}catch{return kc}}function rj(e){var t=ane(e.slice(5,-1));return t===kc?"":t}var ine=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],one=["dx","dy","angle","className","breakAll"];function u1(){return u1=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},u1.apply(this,arguments)}function o2(e,t){if(e==null)return{};var n=lne(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 lne(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 l2(e,t){return fne(e)||dne(e,t)||une(e,t)||cne()}function cne(){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 une(e,t){if(e){if(typeof e=="string")return c2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c2(e,t)}}function c2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function dne(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 fne(e){if(Array.isArray(e))return e}var l4=/[ \f\n\r\t\v\u2028\u2029]+/,c4=function(t){var n=t.children,r=t.breakAll,a=t.style;try{var i=[];Ht(n)||(r?i=n.toString().split(""):i=n.toString().split(l4));var o=i.map(function(d){return{word:d,width:zd(d,a).width}}),c=r?0:zd(" ",a).width;return{wordsWithComputedWidth:o,spaceWidth:c}}catch{return null}},pne=function(t,n,r,a,i){var o=t.maxLines,c=t.children,d=t.style,f=t.breakAll,h=at(o),p=c,v=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return L.reduce(function(I,Y){var W=Y.word,O=Y.width,Q=I[I.length-1];if(Q&&(a==null||i||Q.width+O+r<Number(a)))Q.words.push(W),Q.width+=O+r;else{var q={words:[W],width:O};I.push(q)}return I},[])},x=v(n),j=function(L){return L.reduce(function(I,Y){return I.width>Y.width?I:Y})};if(!h)return x;for(var b="…",y=function(L){var I=p.slice(0,L),Y=c4({breakAll:f,style:d,children:I+b}).wordsWithComputedWidth,W=v(Y),O=W.length>o||j(W).width>Number(a);return[O,W]},S=0,N=p.length-1,_=0,A;S<=N&&_<=p.length-1;){var k=Math.floor((S+N)/2),E=k-1,P=y(E),R=l2(P,2),M=R[0],D=R[1],U=y(k),F=l2(U,1),G=F[0];if(!M&&!G&&(S=k+1),M&&G&&(N=k-1),!M&&G){A=D;break}_++}return A||x},u2=function(t){var n=Ht(t)?[]:t.toString().split(l4);return[{words:n}]},hne=function(t){var n=t.width,r=t.scaleToFit,a=t.children,i=t.style,o=t.breakAll,c=t.maxLines;if((n||r)&&!$l.isSsr){var d,f,h=c4({breakAll:o,children:a,style:i});if(h){var p=h.wordsWithComputedWidth,v=h.spaceWidth;d=p,f=v}else return u2(a);return pne({breakAll:o,children:a,maxLines:c,style:i},d,f,n,r)}return u2(a)},d2="#808080",yl=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,v=t.textAnchor,x=v===void 0?"start":v,j=t.verticalAnchor,b=j===void 0?"end":j,y=t.fill,S=y===void 0?d2:y,N=o2(t,ine),_=m.useMemo(function(){return hne({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]),A=N.dx,k=N.dy,E=N.angle,P=N.className,R=N.breakAll,M=o2(N,one);if(!sr(r)||!sr(i))return null;var D=r+(at(A)?A:0),U=i+(at(k)?k:0),F;switch(b){case"start":F=rj("calc(".concat(f,")"));break;case"middle":F=rj("calc(".concat((_.length-1)/2," * -").concat(c," + (").concat(f," / 2))"));break;default:F=rj("calc(".concat(_.length-1," * -").concat(c,")"));break}var G=[];if(p){var H=_[0].width,L=N.width;G.push("scale(".concat((at(L)?L/H:1)/H,")"))}return E&&G.push("rotate(".concat(E,", ").concat(D,", ").concat(U,")")),G.length&&(M.transform=G.join(" ")),X.createElement("text",u1({},It(M,!0),{x:D,y:U,className:Yt("recharts-text",P),textAnchor:x,fill:S.includes("url")?d2:S}),_.map(function(I,Y){var W=I.words.join(R?"":" ");return X.createElement("tspan",{x:D,dy:Y===0?F:c,key:"".concat(W,"-").concat(Y)},W)}))};function fo(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function mne(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function MC(e){let t,n,r;e.length!==2?(t=fo,n=(c,d)=>fo(e(c),d),r=(c,d)=>e(c)-d):(t=e===fo||e===mne?e:gne,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 gne(){return 0}function u4(e){return e===null?NaN:+e}function*vne(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const xne=MC(fo),Jf=xne.right;MC(u4).center;class f2 extends Map{constructor(t,n=wne){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(p2(this,t))}has(t){return super.has(p2(this,t))}set(t,n){return super.set(yne(this,t),n)}delete(t){return super.delete(bne(this,t))}}function p2({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function yne({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function bne({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function wne(e){return e!==null&&typeof e=="object"?e.valueOf():e}function jne(e=fo){if(e===fo)return d4;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 d4(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Sne=Math.sqrt(50),Nne=Math.sqrt(10),Cne=Math.sqrt(2);function ym(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>=Sne?10:i>=Nne?5:i>=Cne?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?ym(e,t,n*2):[c,d,f]}function d1(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?ym(t,e,n):ym(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 f1(e,t,n){return t=+t,e=+e,n=+n,ym(e,t,n)[2]}function p1(e,t,n){t=+t,e=+e,n=+n;const r=t<e,a=r?f1(t,e,n):f1(e,t,n);return(r?-1:1)*(a<0?1/-a:a)}function h2(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function m2(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function f4(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?d4:jne(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),v=.5*Math.sqrt(h*p*(d-p)/d)*(f-d/2<0?-1:1),x=Math.max(n,Math.floor(t-f*p/d+v)),j=Math.min(r,Math.floor(t+(d-f)*p/d+v));f4(e,t,x,j,a)}const i=e[t];let o=n,c=r;for(wd(e,n,t),a(e[r],i)>0&&wd(e,n,r);o<c;){for(wd(e,o,c),++o,--c;a(e[o],i)<0;)++o;for(;a(e[c],i)>0;)--c}a(e[n],i)===0?wd(e,n,c):(++c,wd(e,c,r)),c<=t&&(n=c+1),t<=c&&(r=c-1)}return e}function wd(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function _ne(e,t,n){if(e=Float64Array.from(vne(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return m2(e);if(t>=1)return h2(e);var r,a=(r-1)*t,i=Math.floor(a),o=h2(f4(e,i).subarray(0,i+1)),c=m2(e.subarray(i+1));return o+(c-o)*(a-i)}}function Ane(e,t,n=u4){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 kne(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 Qs(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Oi(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 h1=Symbol("implicit");function IC(){var e=new f2,t=[],n=[],r=h1;function a(i){let o=e.get(i);if(o===void 0){if(r!==h1)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 f2;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 IC(t,n).unknown(r)},Qs.apply(a,arguments),a}function of(){var e=IC().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 v=t().length,x=a<r,j=x?a:r,b=x?r:a;i=(b-j)/Math.max(1,v-d+f*2),c&&(i=Math.floor(i)),j+=(b-j-i*(v-d))*h,o=i*(1-d),c&&(j=Math.round(j),o=Math.round(o));var y=kne(v).map(function(S){return j+i*S});return n(x?y.reverse():y)}return e.domain=function(v){return arguments.length?(t(v),p()):t()},e.range=function(v){return arguments.length?([r,a]=v,r=+r,a=+a,p()):[r,a]},e.rangeRound=function(v){return[r,a]=v,r=+r,a=+a,c=!0,p()},e.bandwidth=function(){return o},e.step=function(){return i},e.round=function(v){return arguments.length?(c=!!v,p()):c},e.padding=function(v){return arguments.length?(d=Math.min(1,f=+v),p()):d},e.paddingInner=function(v){return arguments.length?(d=Math.min(1,v),p()):d},e.paddingOuter=function(v){return arguments.length?(f=+v,p()):f},e.align=function(v){return arguments.length?(h=Math.max(0,Math.min(1,v)),p()):h},e.copy=function(){return of(t(),[r,a]).round(c).paddingInner(d).paddingOuter(f).align(h)},Qs.apply(p(),arguments)}function p4(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return p4(t())},e}function Bd(){return p4(of.apply(null,arguments).paddingInner(1))}function $C(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function h4(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ep(){}var lf=.7,bm=1/lf,Lc="\\s*([+-]?\\d+)\\s*",cf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",La="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ene=/^#([0-9a-f]{3,8})$/,Pne=new RegExp(`^rgb\\(${Lc},${Lc},${Lc}\\)$`),Tne=new RegExp(`^rgb\\(${La},${La},${La}\\)$`),Rne=new RegExp(`^rgba\\(${Lc},${Lc},${Lc},${cf}\\)$`),One=new RegExp(`^rgba\\(${La},${La},${La},${cf}\\)$`),Mne=new RegExp(`^hsl\\(${cf},${La},${La}\\)$`),Ine=new RegExp(`^hsla\\(${cf},${La},${La},${cf}\\)$`),g2={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};$C(ep,uf,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:v2,formatHex:v2,formatHex8:$ne,formatHsl:Dne,formatRgb:x2,toString:x2});function v2(){return this.rgb().formatHex()}function $ne(){return this.rgb().formatHex8()}function Dne(){return m4(this).formatHsl()}function x2(){return this.rgb().formatRgb()}function uf(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ene.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?y2(t):n===3?new rs(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Eh(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Eh(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=Pne.exec(e))?new rs(t[1],t[2],t[3],1):(t=Tne.exec(e))?new rs(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Rne.exec(e))?Eh(t[1],t[2],t[3],t[4]):(t=One.exec(e))?Eh(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Mne.exec(e))?j2(t[1],t[2]/100,t[3]/100,1):(t=Ine.exec(e))?j2(t[1],t[2]/100,t[3]/100,t[4]):g2.hasOwnProperty(e)?y2(g2[e]):e==="transparent"?new rs(NaN,NaN,NaN,0):null}function y2(e){return new rs(e>>16&255,e>>8&255,e&255,1)}function Eh(e,t,n,r){return r<=0&&(e=t=n=NaN),new rs(e,t,n,r)}function Lne(e){return e instanceof ep||(e=uf(e)),e?(e=e.rgb(),new rs(e.r,e.g,e.b,e.opacity)):new rs}function m1(e,t,n,r){return arguments.length===1?Lne(e):new rs(e,t,n,r??1)}function rs(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}$C(rs,m1,h4(ep,{brighter(e){return e=e==null?bm:Math.pow(bm,e),new rs(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?lf:Math.pow(lf,e),new rs(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new rs(ul(this.r),ul(this.g),ul(this.b),wm(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:b2,formatHex:b2,formatHex8:Fne,formatRgb:w2,toString:w2}));function b2(){return`#${rl(this.r)}${rl(this.g)}${rl(this.b)}`}function Fne(){return`#${rl(this.r)}${rl(this.g)}${rl(this.b)}${rl((isNaN(this.opacity)?1:this.opacity)*255)}`}function w2(){const e=wm(this.opacity);return`${e===1?"rgb(":"rgba("}${ul(this.r)}, ${ul(this.g)}, ${ul(this.b)}${e===1?")":`, ${e})`}`}function wm(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ul(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function rl(e){return e=ul(e),(e<16?"0":"")+e.toString(16)}function j2(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ha(e,t,n,r)}function m4(e){if(e instanceof ha)return new ha(e.h,e.s,e.l,e.opacity);if(e instanceof ep||(e=uf(e)),!e)return new ha;if(e instanceof ha)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 ha(o,c,d,e.opacity)}function zne(e,t,n,r){return arguments.length===1?m4(e):new ha(e,t,n,r??1)}function ha(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}$C(ha,zne,h4(ep,{brighter(e){return e=e==null?bm:Math.pow(bm,e),new ha(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?lf:Math.pow(lf,e),new ha(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 rs(sj(e>=240?e-240:e+120,a,r),sj(e,a,r),sj(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new ha(S2(this.h),Ph(this.s),Ph(this.l),wm(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=wm(this.opacity);return`${e===1?"hsl(":"hsla("}${S2(this.h)}, ${Ph(this.s)*100}%, ${Ph(this.l)*100}%${e===1?")":`, ${e})`}`}}));function S2(e){return e=(e||0)%360,e<0?e+360:e}function Ph(e){return Math.max(0,Math.min(1,e||0))}function sj(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 DC=e=>()=>e;function Bne(e,t){return function(n){return e+n*t}}function qne(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 Une(e){return(e=+e)==1?g4:function(t,n){return n-t?qne(t,n,e):DC(isNaN(t)?n:t)}}function g4(e,t){var n=t-e;return n?Bne(e,n):DC(isNaN(e)?t:e)}const N2=(function e(t){var n=Une(t);function r(a,i){var o=n((a=m1(a)).r,(i=m1(i)).r),c=n(a.g,i.g),d=n(a.b,i.b),f=g4(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 Wne(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 Vne(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Hne(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]=Ru(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 Kne(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function jm(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Gne(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]=Ru(e[a],t[a]):r[a]=t[a];return function(i){for(a in n)r[a]=n[a](i);return r}}var g1=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,aj=new RegExp(g1.source,"g");function Yne(e){return function(){return e}}function Xne(e){return function(t){return e(t)+""}}function Qne(e,t){var n=g1.lastIndex=aj.lastIndex=0,r,a,i,o=-1,c=[],d=[];for(e=e+"",t=t+"";(r=g1.exec(e))&&(a=aj.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:jm(r,a)})),n=aj.lastIndex;return n<t.length&&(i=t.slice(n),c[o]?c[o]+=i:c[++o]=i),c.length<2?d[0]?Xne(d[0].x):Yne(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 Ru(e,t){var n=typeof t,r;return t==null||n==="boolean"?DC(t):(n==="number"?jm:n==="string"?(r=uf(t))?(t=r,N2):Qne:t instanceof uf?N2:t instanceof Date?Kne:Vne(t)?Wne:Array.isArray(t)?Hne:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Gne:jm)(e,t)}function LC(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Zne(e,t){t===void 0&&(t=e,e=Ru);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 Jne(e){return function(){return e}}function Sm(e){return+e}var C2=[0,1];function Lr(e){return e}function v1(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Jne(isNaN(t)?NaN:.5)}function ere(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function tre(e,t,n){var r=e[0],a=e[1],i=t[0],o=t[1];return a<r?(r=v1(a,r),i=n(o,i)):(r=v1(r,a),i=n(i,o)),function(c){return i(r(c))}}function nre(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]=v1(e[o],e[o+1]),i[o]=n(t[o],t[o+1]);return function(c){var d=Jf(e,c,1,r)-1;return i[d](a[d](c))}}function tp(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function rv(){var e=C2,t=C2,n=Ru,r,a,i,o=Lr,c,d,f;function h(){var v=Math.min(e.length,t.length);return o!==Lr&&(o=ere(e[0],e[v-1])),c=v>2?nre:tre,d=f=null,p}function p(v){return v==null||isNaN(v=+v)?i:(d||(d=c(e.map(r),t,n)))(r(o(v)))}return p.invert=function(v){return o(a((f||(f=c(t,e.map(r),jm)))(v)))},p.domain=function(v){return arguments.length?(e=Array.from(v,Sm),h()):e.slice()},p.range=function(v){return arguments.length?(t=Array.from(v),h()):t.slice()},p.rangeRound=function(v){return t=Array.from(v),n=LC,h()},p.clamp=function(v){return arguments.length?(o=v?!0:Lr,h()):o!==Lr},p.interpolate=function(v){return arguments.length?(n=v,h()):n},p.unknown=function(v){return arguments.length?(i=v,p):i},function(v,x){return r=v,a=x,h()}}function FC(){return rv()(Lr,Lr)}function rre(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Nm(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 Zc(e){return e=Nm(Math.abs(e)),e?e[1]:NaN}function sre(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 are(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var ire=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function df(e){if(!(t=ire.exec(e)))throw new Error("invalid format: "+e);var t;return new zC({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]})}df.prototype=zC.prototype;function zC(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+""}zC.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 ore(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 Cm;function lre(e,t){var n=Nm(e,t);if(!n)return Cm=void 0,e.toPrecision(t);var r=n[0],a=n[1],i=a-(Cm=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")+Nm(e,Math.max(0,t+i-1))[0]}function _2(e,t){var n=Nm(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 A2={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:rre,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)=>_2(e*100,t),r:_2,s:lre,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function k2(e){return e}var E2=Array.prototype.map,P2=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function cre(e){var t=e.grouping===void 0||e.thousands===void 0?k2:sre(E2.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?k2:are(E2.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",c=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function f(p,v){p=df(p);var x=p.fill,j=p.align,b=p.sign,y=p.symbol,S=p.zero,N=p.width,_=p.comma,A=p.precision,k=p.trim,E=p.type;E==="n"?(_=!0,E="g"):A2[E]||(A===void 0&&(A=12),k=!0,E="g"),(S||x==="0"&&j==="=")&&(S=!0,x="0",j="=");var P=(v&&v.prefix!==void 0?v.prefix:"")+(y==="$"?n:y==="#"&&/[boxX]/.test(E)?"0"+E.toLowerCase():""),R=(y==="$"?r:/[%p]/.test(E)?o:"")+(v&&v.suffix!==void 0?v.suffix:""),M=A2[E],D=/[defgprs%]/.test(E);A=A===void 0?6:/[gprs]/.test(E)?Math.max(1,Math.min(21,A)):Math.max(0,Math.min(20,A));function U(F){var G=P,H=R,L,I,Y;if(E==="c")H=M(F)+H,F="";else{F=+F;var W=F<0||1/F<0;if(F=isNaN(F)?d:M(Math.abs(F),A),k&&(F=ore(F)),W&&+F==0&&b!=="+"&&(W=!1),G=(W?b==="("?b:c:b==="-"||b==="("?"":b)+G,H=(E==="s"&&!isNaN(F)&&Cm!==void 0?P2[8+Cm/3]:"")+H+(W&&b==="("?")":""),D){for(L=-1,I=F.length;++L<I;)if(Y=F.charCodeAt(L),48>Y||Y>57){H=(Y===46?a+F.slice(L+1):F.slice(L))+H,F=F.slice(0,L);break}}}_&&!S&&(F=t(F,1/0));var O=G.length+F.length+H.length,Q=O<N?new Array(N-O+1).join(x):"";switch(_&&S&&(F=t(Q+F,Q.length?N-H.length:1/0),Q=""),j){case"<":F=G+F+H+Q;break;case"=":F=G+Q+F+H;break;case"^":F=Q.slice(0,O=Q.length>>1)+G+F+H+Q.slice(O);break;default:F=Q+G+F+H;break}return i(F)}return U.toString=function(){return p+""},U}function h(p,v){var x=Math.max(-8,Math.min(8,Math.floor(Zc(v)/3)))*3,j=Math.pow(10,-x),b=f((p=df(p),p.type="f",p),{suffix:P2[8+x/3]});return function(y){return b(j*y)}}return{format:f,formatPrefix:h}}var Th,BC,v4;ure({thousands:",",grouping:[3],currency:["$",""]});function ure(e){return Th=cre(e),BC=Th.format,v4=Th.formatPrefix,Th}function dre(e){return Math.max(0,-Zc(Math.abs(e)))}function fre(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Zc(t)/3)))*3-Zc(Math.abs(e)))}function pre(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Zc(t)-Zc(e))+1}function x4(e,t,n,r){var a=p1(e,t,n),i;switch(r=df(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(i=fre(a,o))&&(r.precision=i),v4(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=pre(a,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=dre(a))&&(r.precision=i-(r.type==="%")*2);break}}return BC(r)}function Co(e){var t=e.domain;return e.ticks=function(n){var r=t();return d1(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var a=t();return x4(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=f1(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 _m(){var e=FC();return e.copy=function(){return tp(e,_m())},Qs.apply(e,arguments),Co(e)}function y4(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,Sm),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return y4(e).unknown(t)},e=arguments.length?Array.from(e,Sm):[0,1],Co(n)}function b4(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 T2(e){return Math.log(e)}function R2(e){return Math.exp(e)}function hre(e){return-Math.log(-e)}function mre(e){return-Math.exp(-e)}function gre(e){return isFinite(e)?+("1e"+e):e<0?0:e}function vre(e){return e===10?gre:e===Math.E?Math.exp:t=>Math.pow(e,t)}function xre(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 O2(e){return(t,n)=>-e(-t,n)}function qC(e){const t=e(T2,R2),n=t.domain;let r=10,a,i;function o(){return a=xre(r),i=vre(r),n()[0]<0?(a=O2(a),i=O2(i),e(hre,mre)):e(T2,R2),t}return t.base=function(c){return arguments.length?(r=+c,o()):r},t.domain=function(c){return arguments.length?(n(c),o()):n()},t.ticks=c=>{const d=n();let f=d[0],h=d[d.length-1];const p=h<f;p&&([f,h]=[h,f]);let v=a(f),x=a(h),j,b;const y=c==null?10:+c;let S=[];if(!(r%1)&&x-v<y){if(v=Math.floor(v),x=Math.ceil(x),f>0){for(;v<=x;++v)for(j=1;j<r;++j)if(b=v<0?j/i(-v):j*i(v),!(b<f)){if(b>h)break;S.push(b)}}else for(;v<=x;++v)for(j=r-1;j>=1;--j)if(b=v>0?j/i(-v):j*i(v),!(b<f)){if(b>h)break;S.push(b)}S.length*2<y&&(S=d1(f,h,y))}else S=d1(v,x,Math.min(x-v,y)).map(i);return p?S.reverse():S},t.tickFormat=(c,d)=>{if(c==null&&(c=10),d==null&&(d=r===10?"s":","),typeof d!="function"&&(!(r%1)&&(d=df(d)).precision==null&&(d.trim=!0),d=BC(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(b4(n(),{floor:c=>i(Math.floor(a(c))),ceil:c=>i(Math.ceil(a(c)))})),t}function w4(){const e=qC(rv()).domain([1,10]);return e.copy=()=>tp(e,w4()).base(e.base()),Qs.apply(e,arguments),e}function M2(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function I2(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function UC(e){var t=1,n=e(M2(t),I2(t));return n.constant=function(r){return arguments.length?e(M2(t=+r),I2(t)):t},Co(n)}function j4(){var e=UC(rv());return e.copy=function(){return tp(e,j4()).constant(e.constant())},Qs.apply(e,arguments)}function $2(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function yre(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function bre(e){return e<0?-e*e:e*e}function WC(e){var t=e(Lr,Lr),n=1;function r(){return n===1?e(Lr,Lr):n===.5?e(yre,bre):e($2(n),$2(1/n))}return t.exponent=function(a){return arguments.length?(n=+a,r()):n},Co(t)}function VC(){var e=WC(rv());return e.copy=function(){return tp(e,VC()).exponent(e.exponent())},Qs.apply(e,arguments),e}function wre(){return VC.apply(null,arguments).exponent(.5)}function D2(e){return Math.sign(e)*e*e}function jre(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function S4(){var e=FC(),t=[0,1],n=!1,r;function a(i){var o=jre(e(i));return isNaN(o)?r:n?Math.round(o):o}return a.invert=function(i){return e.invert(D2(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,Sm)).map(D2)),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 S4(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Qs.apply(a,arguments),Co(a)}function N4(){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]=Ane(e,o/c);return i}function i(o){return o==null||isNaN(o=+o)?r:t[Jf(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(fo),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 N4().domain(e).range(t).unknown(r)},Qs.apply(i,arguments)}function C4(){var e=0,t=1,n=1,r=[.5],a=[0,1],i;function o(d){return d!=null&&d<=d?a[Jf(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 C4().domain([e,t]).range(a).unknown(i)},Qs.apply(Co(o),arguments)}function _4(){var e=[.5],t=[0,1],n,r=1;function a(i){return i!=null&&i<=i?t[Jf(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 _4().domain(e).range(t).unknown(n)},Qs.apply(a,arguments)}const ij=new Date,oj=new Date;function or(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=>or(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)=>(ij.setTime(+i),oj.setTime(+o),e(ij),e(oj),Math.floor(n(ij,oj))),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 Am=or(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Am.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?or(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Am);Am.range;const di=1e3,Ds=di*60,fi=Ds*60,Ci=fi*24,HC=Ci*7,L2=Ci*30,lj=Ci*365,sl=or(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*di)},(e,t)=>(t-e)/di,e=>e.getUTCSeconds());sl.range;const KC=or(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*di)},(e,t)=>{e.setTime(+e+t*Ds)},(e,t)=>(t-e)/Ds,e=>e.getMinutes());KC.range;const GC=or(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ds)},(e,t)=>(t-e)/Ds,e=>e.getUTCMinutes());GC.range;const YC=or(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*di-e.getMinutes()*Ds)},(e,t)=>{e.setTime(+e+t*fi)},(e,t)=>(t-e)/fi,e=>e.getHours());YC.range;const XC=or(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*fi)},(e,t)=>(t-e)/fi,e=>e.getUTCHours());XC.range;const np=or(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ds)/Ci,e=>e.getDate()-1);np.range;const sv=or(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ci,e=>e.getUTCDate()-1);sv.range;const A4=or(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ci,e=>Math.floor(e/Ci));A4.range;function Dl(e){return or(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())*Ds)/HC)}const av=Dl(0),km=Dl(1),Sre=Dl(2),Nre=Dl(3),Jc=Dl(4),Cre=Dl(5),_re=Dl(6);av.range;km.range;Sre.range;Nre.range;Jc.range;Cre.range;_re.range;function Ll(e){return or(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)/HC)}const iv=Ll(0),Em=Ll(1),Are=Ll(2),kre=Ll(3),eu=Ll(4),Ere=Ll(5),Pre=Ll(6);iv.range;Em.range;Are.range;kre.range;eu.range;Ere.range;Pre.range;const QC=or(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());QC.range;const ZC=or(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());ZC.range;const _i=or(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());_i.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:or(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)});_i.range;const Ai=or(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());Ai.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:or(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)});Ai.range;function k4(e,t,n,r,a,i){const o=[[sl,1,di],[sl,5,5*di],[sl,15,15*di],[sl,30,30*di],[i,1,Ds],[i,5,5*Ds],[i,15,15*Ds],[i,30,30*Ds],[a,1,fi],[a,3,3*fi],[a,6,6*fi],[a,12,12*fi],[r,1,Ci],[r,2,2*Ci],[n,1,HC],[t,1,L2],[t,3,3*L2],[e,1,lj]];function c(f,h,p){const v=h<f;v&&([f,h]=[h,f]);const x=p&&typeof p.range=="function"?p:d(f,h,p),j=x?x.range(f,+h+1):[];return v?j.reverse():j}function d(f,h,p){const v=Math.abs(h-f)/p,x=MC(([,,y])=>y).right(o,v);if(x===o.length)return e.every(p1(f/lj,h/lj,p));if(x===0)return Am.every(Math.max(p1(f,h,p),1));const[j,b]=o[v/o[x-1][2]<o[x][2]/v?x-1:x];return j.every(b)}return[c,d]}const[Tre,Rre]=k4(Ai,ZC,iv,A4,XC,GC),[Ore,Mre]=k4(_i,QC,av,np,YC,KC);function cj(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 uj(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 jd(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Ire(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=Sd(a),h=Nd(a),p=Sd(i),v=Nd(i),x=Sd(o),j=Nd(o),b=Sd(c),y=Nd(c),S=Sd(d),N=Nd(d),_={a:Y,A:W,b:O,B:Q,c:null,d:W2,e:W2,f:sse,g:hse,G:gse,H:tse,I:nse,j:rse,L:E4,m:ase,M:ise,p:q,q:z,Q:K2,s:G2,S:ose,u:lse,U:cse,V:use,w:dse,W:fse,x:null,X:null,y:pse,Y:mse,Z:vse,"%":H2},A={a:K,A:J,b:ne,B:he,c:null,d:V2,e:V2,f:wse,g:Tse,G:Ose,H:xse,I:yse,j:bse,L:T4,m:jse,M:Sse,p:ie,q:me,Q:K2,s:G2,S:Nse,u:Cse,U:_se,V:Ase,w:kse,W:Ese,x:null,X:null,y:Pse,Y:Rse,Z:Mse,"%":H2},k={a:D,A:U,b:F,B:G,c:H,d:q2,e:q2,f:Qre,g:B2,G:z2,H:U2,I:U2,j:Kre,L:Xre,m:Hre,M:Gre,p:M,q:Vre,Q:Jre,s:ese,S:Yre,u:zre,U:Bre,V:qre,w:Fre,W:Ure,x:L,X:I,y:B2,Y:z2,Z:Wre,"%":Zre};_.x=E(n,_),_.X=E(r,_),_.c=E(t,_),A.x=E(n,A),A.X=E(r,A),A.c=E(t,A);function E(se,ge){return function(Oe){var fe=[],xe=-1,we=0,ot=se.length,lt,ut,At;for(Oe instanceof Date||(Oe=new Date(+Oe));++xe<ot;)se.charCodeAt(xe)===37&&(fe.push(se.slice(we,xe)),(ut=F2[lt=se.charAt(++xe)])!=null?lt=se.charAt(++xe):ut=lt==="e"?" ":"0",(At=ge[lt])&&(lt=At(Oe,ut)),fe.push(lt),we=xe+1);return fe.push(se.slice(we,xe)),fe.join("")}}function P(se,ge){return function(Oe){var fe=jd(1900,void 0,1),xe=R(fe,se,Oe+="",0),we,ot;if(xe!=Oe.length)return null;if("Q"in fe)return new Date(fe.Q);if("s"in fe)return new Date(fe.s*1e3+("L"in fe?fe.L:0));if(ge&&!("Z"in fe)&&(fe.Z=0),"p"in fe&&(fe.H=fe.H%12+fe.p*12),fe.m===void 0&&(fe.m="q"in fe?fe.q:0),"V"in fe){if(fe.V<1||fe.V>53)return null;"w"in fe||(fe.w=1),"Z"in fe?(we=uj(jd(fe.y,0,1)),ot=we.getUTCDay(),we=ot>4||ot===0?Em.ceil(we):Em(we),we=sv.offset(we,(fe.V-1)*7),fe.y=we.getUTCFullYear(),fe.m=we.getUTCMonth(),fe.d=we.getUTCDate()+(fe.w+6)%7):(we=cj(jd(fe.y,0,1)),ot=we.getDay(),we=ot>4||ot===0?km.ceil(we):km(we),we=np.offset(we,(fe.V-1)*7),fe.y=we.getFullYear(),fe.m=we.getMonth(),fe.d=we.getDate()+(fe.w+6)%7)}else("W"in fe||"U"in fe)&&("w"in fe||(fe.w="u"in fe?fe.u%7:"W"in fe?1:0),ot="Z"in fe?uj(jd(fe.y,0,1)).getUTCDay():cj(jd(fe.y,0,1)).getDay(),fe.m=0,fe.d="W"in fe?(fe.w+6)%7+fe.W*7-(ot+5)%7:fe.w+fe.U*7-(ot+6)%7);return"Z"in fe?(fe.H+=fe.Z/100|0,fe.M+=fe.Z%100,uj(fe)):cj(fe)}}function R(se,ge,Oe,fe){for(var xe=0,we=ge.length,ot=Oe.length,lt,ut;xe<we;){if(fe>=ot)return-1;if(lt=ge.charCodeAt(xe++),lt===37){if(lt=ge.charAt(xe++),ut=k[lt in F2?ge.charAt(xe++):lt],!ut||(fe=ut(se,Oe,fe))<0)return-1}else if(lt!=Oe.charCodeAt(fe++))return-1}return fe}function M(se,ge,Oe){var fe=f.exec(ge.slice(Oe));return fe?(se.p=h.get(fe[0].toLowerCase()),Oe+fe[0].length):-1}function D(se,ge,Oe){var fe=x.exec(ge.slice(Oe));return fe?(se.w=j.get(fe[0].toLowerCase()),Oe+fe[0].length):-1}function U(se,ge,Oe){var fe=p.exec(ge.slice(Oe));return fe?(se.w=v.get(fe[0].toLowerCase()),Oe+fe[0].length):-1}function F(se,ge,Oe){var fe=S.exec(ge.slice(Oe));return fe?(se.m=N.get(fe[0].toLowerCase()),Oe+fe[0].length):-1}function G(se,ge,Oe){var fe=b.exec(ge.slice(Oe));return fe?(se.m=y.get(fe[0].toLowerCase()),Oe+fe[0].length):-1}function H(se,ge,Oe){return R(se,t,ge,Oe)}function L(se,ge,Oe){return R(se,n,ge,Oe)}function I(se,ge,Oe){return R(se,r,ge,Oe)}function Y(se){return o[se.getDay()]}function W(se){return i[se.getDay()]}function O(se){return d[se.getMonth()]}function Q(se){return c[se.getMonth()]}function q(se){return a[+(se.getHours()>=12)]}function z(se){return 1+~~(se.getMonth()/3)}function K(se){return o[se.getUTCDay()]}function J(se){return i[se.getUTCDay()]}function ne(se){return d[se.getUTCMonth()]}function he(se){return c[se.getUTCMonth()]}function ie(se){return a[+(se.getUTCHours()>=12)]}function me(se){return 1+~~(se.getUTCMonth()/3)}return{format:function(se){var ge=E(se+="",_);return ge.toString=function(){return se},ge},parse:function(se){var ge=P(se+="",!1);return ge.toString=function(){return se},ge},utcFormat:function(se){var ge=E(se+="",A);return ge.toString=function(){return se},ge},utcParse:function(se){var ge=P(se+="",!0);return ge.toString=function(){return se},ge}}}var F2={"-":"",_:" ",0:"0"},mr=/^\s*\d+/,$re=/^%/,Dre=/[\\^$*+?|[\]().{}]/g;function un(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 Lre(e){return e.replace(Dre,"\\$&")}function Sd(e){return new RegExp("^(?:"+e.map(Lre).join("|")+")","i")}function Nd(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Fre(e,t,n){var r=mr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function zre(e,t,n){var r=mr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Bre(e,t,n){var r=mr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function qre(e,t,n){var r=mr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Ure(e,t,n){var r=mr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function z2(e,t,n){var r=mr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function B2(e,t,n){var r=mr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Wre(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 Vre(e,t,n){var r=mr.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Hre(e,t,n){var r=mr.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function q2(e,t,n){var r=mr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Kre(e,t,n){var r=mr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function U2(e,t,n){var r=mr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Gre(e,t,n){var r=mr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Yre(e,t,n){var r=mr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Xre(e,t,n){var r=mr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Qre(e,t,n){var r=mr.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Zre(e,t,n){var r=$re.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Jre(e,t,n){var r=mr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function ese(e,t,n){var r=mr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function W2(e,t){return un(e.getDate(),t,2)}function tse(e,t){return un(e.getHours(),t,2)}function nse(e,t){return un(e.getHours()%12||12,t,2)}function rse(e,t){return un(1+np.count(_i(e),e),t,3)}function E4(e,t){return un(e.getMilliseconds(),t,3)}function sse(e,t){return E4(e,t)+"000"}function ase(e,t){return un(e.getMonth()+1,t,2)}function ise(e,t){return un(e.getMinutes(),t,2)}function ose(e,t){return un(e.getSeconds(),t,2)}function lse(e){var t=e.getDay();return t===0?7:t}function cse(e,t){return un(av.count(_i(e)-1,e),t,2)}function P4(e){var t=e.getDay();return t>=4||t===0?Jc(e):Jc.ceil(e)}function use(e,t){return e=P4(e),un(Jc.count(_i(e),e)+(_i(e).getDay()===4),t,2)}function dse(e){return e.getDay()}function fse(e,t){return un(km.count(_i(e)-1,e),t,2)}function pse(e,t){return un(e.getFullYear()%100,t,2)}function hse(e,t){return e=P4(e),un(e.getFullYear()%100,t,2)}function mse(e,t){return un(e.getFullYear()%1e4,t,4)}function gse(e,t){var n=e.getDay();return e=n>=4||n===0?Jc(e):Jc.ceil(e),un(e.getFullYear()%1e4,t,4)}function vse(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+un(t/60|0,"0",2)+un(t%60,"0",2)}function V2(e,t){return un(e.getUTCDate(),t,2)}function xse(e,t){return un(e.getUTCHours(),t,2)}function yse(e,t){return un(e.getUTCHours()%12||12,t,2)}function bse(e,t){return un(1+sv.count(Ai(e),e),t,3)}function T4(e,t){return un(e.getUTCMilliseconds(),t,3)}function wse(e,t){return T4(e,t)+"000"}function jse(e,t){return un(e.getUTCMonth()+1,t,2)}function Sse(e,t){return un(e.getUTCMinutes(),t,2)}function Nse(e,t){return un(e.getUTCSeconds(),t,2)}function Cse(e){var t=e.getUTCDay();return t===0?7:t}function _se(e,t){return un(iv.count(Ai(e)-1,e),t,2)}function R4(e){var t=e.getUTCDay();return t>=4||t===0?eu(e):eu.ceil(e)}function Ase(e,t){return e=R4(e),un(eu.count(Ai(e),e)+(Ai(e).getUTCDay()===4),t,2)}function kse(e){return e.getUTCDay()}function Ese(e,t){return un(Em.count(Ai(e)-1,e),t,2)}function Pse(e,t){return un(e.getUTCFullYear()%100,t,2)}function Tse(e,t){return e=R4(e),un(e.getUTCFullYear()%100,t,2)}function Rse(e,t){return un(e.getUTCFullYear()%1e4,t,4)}function Ose(e,t){var n=e.getUTCDay();return e=n>=4||n===0?eu(e):eu.ceil(e),un(e.getUTCFullYear()%1e4,t,4)}function Mse(){return"+0000"}function H2(){return"%"}function K2(e){return+e}function G2(e){return Math.floor(+e/1e3)}var vc,O4,M4;Ise({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 Ise(e){return vc=Ire(e),O4=vc.format,vc.parse,M4=vc.utcFormat,vc.utcParse,vc}function $se(e){return new Date(e)}function Dse(e){return e instanceof Date?+e:+new Date(+e)}function JC(e,t,n,r,a,i,o,c,d,f){var h=FC(),p=h.invert,v=h.domain,x=f(".%L"),j=f(":%S"),b=f("%I:%M"),y=f("%I %p"),S=f("%a %d"),N=f("%b %d"),_=f("%B"),A=f("%Y");function k(E){return(d(E)<E?x:c(E)<E?j:o(E)<E?b:i(E)<E?y:r(E)<E?a(E)<E?S:N:n(E)<E?_:A)(E)}return h.invert=function(E){return new Date(p(E))},h.domain=function(E){return arguments.length?v(Array.from(E,Dse)):v().map($se)},h.ticks=function(E){var P=v();return e(P[0],P[P.length-1],E??10)},h.tickFormat=function(E,P){return P==null?k:f(P)},h.nice=function(E){var P=v();return(!E||typeof E.range!="function")&&(E=t(P[0],P[P.length-1],E??10)),E?v(b4(P,E)):h},h.copy=function(){return tp(h,JC(e,t,n,r,a,i,o,c,d,f))},h}function Lse(){return Qs.apply(JC(Ore,Mre,_i,QC,av,np,YC,KC,sl,O4).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Fse(){return Qs.apply(JC(Tre,Rre,Ai,ZC,iv,sv,XC,GC,sl,M4).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function ov(){var e=0,t=1,n,r,a,i,o=Lr,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(v){var x,j;return arguments.length?([x,j]=v,o=p(x,j),f):[o(0),o(1)]}}return f.range=h(Ru),f.rangeRound=h(LC),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 _o(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function I4(){var e=Co(ov()(Lr));return e.copy=function(){return _o(e,I4())},Oi.apply(e,arguments)}function $4(){var e=qC(ov()).domain([1,10]);return e.copy=function(){return _o(e,$4()).base(e.base())},Oi.apply(e,arguments)}function D4(){var e=UC(ov());return e.copy=function(){return _o(e,D4()).constant(e.constant())},Oi.apply(e,arguments)}function e_(){var e=WC(ov());return e.copy=function(){return _o(e,e_()).exponent(e.exponent())},Oi.apply(e,arguments)}function zse(){return e_.apply(null,arguments).exponent(.5)}function L4(){var e=[],t=Lr;function n(r){if(r!=null&&!isNaN(r=+r))return t((Jf(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(fo),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)=>_ne(e,i/r))},n.copy=function(){return L4(t).domain(e)},Oi.apply(n,arguments)}function lv(){var e=0,t=.5,n=1,r=1,a,i,o,c,d,f=Lr,h,p=!1,v;function x(b){return isNaN(b=+b)?v:(b=.5+((b=+h(b))-i)*(r*b<r*i?c:d),f(p?Math.max(0,Math.min(1,b)):b))}x.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,x):[e,t,n]},x.clamp=function(b){return arguments.length?(p=!!b,x):p},x.interpolator=function(b){return arguments.length?(f=b,x):f};function j(b){return function(y){var S,N,_;return arguments.length?([S,N,_]=y,f=Zne(b,[S,N,_]),x):[f(0),f(.5),f(1)]}}return x.range=j(Ru),x.rangeRound=j(LC),x.unknown=function(b){return arguments.length?(v=b,x):v},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,x}}function F4(){var e=Co(lv()(Lr));return e.copy=function(){return _o(e,F4())},Oi.apply(e,arguments)}function z4(){var e=qC(lv()).domain([.1,1,10]);return e.copy=function(){return _o(e,z4()).base(e.base())},Oi.apply(e,arguments)}function B4(){var e=UC(lv());return e.copy=function(){return _o(e,B4()).constant(e.constant())},Oi.apply(e,arguments)}function t_(){var e=WC(lv());return e.copy=function(){return _o(e,t_()).exponent(e.exponent())},Oi.apply(e,arguments)}function Bse(){return t_.apply(null,arguments).exponent(.5)}const Y2=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:of,scaleDiverging:F4,scaleDivergingLog:z4,scaleDivergingPow:t_,scaleDivergingSqrt:Bse,scaleDivergingSymlog:B4,scaleIdentity:y4,scaleImplicit:h1,scaleLinear:_m,scaleLog:w4,scaleOrdinal:IC,scalePoint:Bd,scalePow:VC,scaleQuantile:N4,scaleQuantize:C4,scaleRadial:S4,scaleSequential:I4,scaleSequentialLog:$4,scaleSequentialPow:e_,scaleSequentialQuantile:L4,scaleSequentialSqrt:zse,scaleSequentialSymlog:D4,scaleSqrt:wre,scaleSymlog:j4,scaleThreshold:_4,scaleTime:Lse,scaleUtc:Fse,tickFormat:x4},Symbol.toStringTag,{value:"Module"}));var dj,X2;function cv(){if(X2)return dj;X2=1;var e=ku();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 dj=t,dj}var fj,Q2;function q4(){if(Q2)return fj;Q2=1;function e(t,n){return t>n}return fj=e,fj}var pj,Z2;function qse(){if(Z2)return pj;Z2=1;var e=cv(),t=q4(),n=Tu();function r(a){return a&&a.length?e(a,n,t):void 0}return pj=r,pj}var Use=qse();const uv=vn(Use);var hj,J2;function U4(){if(J2)return hj;J2=1;function e(t,n){return t<n}return hj=e,hj}var mj,eM;function Wse(){if(eM)return mj;eM=1;var e=cv(),t=U4(),n=Tu();function r(a){return a&&a.length?e(a,n,t):void 0}return mj=r,mj}var Vse=Wse();const dv=vn(Vse);var gj,tM;function Hse(){if(tM)return gj;tM=1;var e=vC(),t=Ga(),n=ZL(),r=as();function a(i,o){var c=r(i)?e:n;return c(i,t(o,3))}return gj=a,gj}var vj,nM;function Kse(){if(nM)return vj;nM=1;var e=XL(),t=Hse();function n(r,a){return e(t(r,a),1)}return vj=n,vj}var Gse=Kse();const Yse=vn(Gse);var xj,rM;function Xse(){if(rM)return xj;rM=1;var e=PC();function t(n,r){return e(n,r)}return xj=t,xj}var Qse=Xse();const rp=vn(Qse);var Ou=1e9,Zse={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},r_,Dn=!0,qs="[DecimalError] ",dl=qs+"Invalid argument: ",n_=qs+"Exponent out of range: ",Mu=Math.floor,Jo=Math.pow,Jse=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,vs,pr=1e7,Pn=7,W4=9007199254740991,Pm=Mu(W4/Pn),yt={};yt.absoluteValue=yt.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};yt.comparedTo=yt.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};yt.decimalPlaces=yt.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};yt.dividedBy=yt.div=function(e){return mi(this,new this.constructor(e))};yt.dividedToIntegerBy=yt.idiv=function(e){var t=this,n=t.constructor;return wn(mi(t,new n(e),0,1),n.precision)};yt.equals=yt.eq=function(e){return!this.cmp(e)};yt.exponent=function(){return Qn(this)};yt.greaterThan=yt.gt=function(e){return this.cmp(e)>0};yt.greaterThanOrEqualTo=yt.gte=function(e){return this.cmp(e)>=0};yt.isInteger=yt.isint=function(){return this.e>this.d.length-2};yt.isNegative=yt.isneg=function(){return this.s<0};yt.isPositive=yt.ispos=function(){return this.s>0};yt.isZero=function(){return this.s===0};yt.lessThan=yt.lt=function(e){return this.cmp(e)<0};yt.lessThanOrEqualTo=yt.lte=function(e){return this.cmp(e)<1};yt.logarithm=yt.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(vs))throw Error(qs+"NaN");if(n.s<1)throw Error(qs+(n.s?"NaN":"-Infinity"));return n.eq(vs)?new r(0):(Dn=!1,t=mi(ff(n,i),ff(e,i),i),Dn=!0,wn(t,a))};yt.minus=yt.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?K4(t,e):V4(t,(e.s=-e.s,e))};yt.modulo=yt.mod=function(e){var t,n=this,r=n.constructor,a=r.precision;if(e=new r(e),!e.s)throw Error(qs+"NaN");return n.s?(Dn=!1,t=mi(n,e,0,1).times(e),Dn=!0,n.minus(t)):wn(new r(n),a)};yt.naturalExponential=yt.exp=function(){return H4(this)};yt.naturalLogarithm=yt.ln=function(){return ff(this)};yt.negated=yt.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};yt.plus=yt.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?V4(t,e):K4(t,(e.s=-e.s,e))};yt.precision=yt.sd=function(e){var t,n,r,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(dl+e);if(t=Qn(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};yt.squareRoot=yt.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(qs+"NaN")}for(e=Qn(c),Dn=!1,a=Math.sqrt(+c),a==0||a==1/0?(t=$a(c.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=Mu((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(mi(c,i,o+2)).times(.5),$a(i.d).slice(0,o)===(t=$a(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),a==o&&t=="4999"){if(wn(i,n+1,0),i.times(i).eq(c)){r=i;break}}else if(t!="9999")break;o+=4}return Dn=!0,wn(r,n)};yt.times=yt.mul=function(e){var t,n,r,a,i,o,c,d,f,h=this,p=h.constructor,v=h.d,x=(e=new p(e)).d;if(!h.s||!e.s)return new p(0);for(e.s*=h.s,n=h.e+e.e,d=v.length,f=x.length,d<f&&(i=v,v=x,x=i,o=d,d=f,f=o),i=[],o=d+f,r=o;r--;)i.push(0);for(r=f;--r>=0;){for(t=0,a=d+r;a>r;)c=i[a]+x[r]*v[a-r-1]+t,i[a--]=c%pr|0,t=c/pr|0;i[a]=(i[a]+t)%pr|0}for(;!i[--o];)i.pop();return t?++n:i.shift(),e.d=i,e.e=n,Dn?wn(e,p.precision):e};yt.toDecimalPlaces=yt.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Ua(e,0,Ou),t===void 0?t=r.rounding:Ua(t,0,8),wn(n,e+Qn(n)+1,t))};yt.toExponential=function(e,t){var n,r=this,a=r.constructor;return e===void 0?n=bl(r,!0):(Ua(e,0,Ou),t===void 0?t=a.rounding:Ua(t,0,8),r=wn(new a(r),e+1,t),n=bl(r,!0,e+1)),n};yt.toFixed=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?bl(a):(Ua(e,0,Ou),t===void 0?t=i.rounding:Ua(t,0,8),r=wn(new i(a),e+Qn(a)+1,t),n=bl(r.abs(),!1,e+Qn(r)+1),a.isneg()&&!a.isZero()?"-"+n:n)};yt.toInteger=yt.toint=function(){var e=this,t=e.constructor;return wn(new t(e),Qn(e)+1,t.rounding)};yt.toNumber=function(){return+this};yt.toPower=yt.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(vs);if(c=new d(c),!c.s){if(e.s<1)throw Error(qs+"Infinity");return c}if(c.eq(vs))return c;if(r=d.precision,e.eq(vs))return wn(c,r);if(t=e.e,n=e.d.length-1,o=t>=n,i=c.s,o){if((n=h<0?-h:h)<=W4){for(a=new d(vs),t=Math.ceil(r/Pn+4),Dn=!1;n%2&&(a=a.times(c),aM(a.d,t)),n=Mu(n/2),n!==0;)c=c.times(c),aM(c.d,t);return Dn=!0,e.s<0?new d(vs).div(a):wn(a,r)}}else if(i<0)throw Error(qs+"NaN");return i=i<0&&e.d[Math.max(t,n)]&1?-1:1,c.s=1,Dn=!1,a=e.times(ff(c,r+f)),Dn=!0,a=H4(a),a.s=i,a};yt.toPrecision=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?(n=Qn(a),r=bl(a,n<=i.toExpNeg||n>=i.toExpPos)):(Ua(e,1,Ou),t===void 0?t=i.rounding:Ua(t,0,8),a=wn(new i(a),e,t),n=Qn(a),r=bl(a,e<=n||n<=i.toExpNeg,e)),r};yt.toSignificantDigits=yt.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Ua(e,1,Ou),t===void 0?t=r.rounding:Ua(t,0,8)),wn(new r(n),e,t)};yt.toString=yt.valueOf=yt.val=yt.toJSON=yt[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Qn(e),n=e.constructor;return bl(e,t<=n.toExpNeg||t>=n.toExpPos)};function V4(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)),Dn?wn(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)/pr|0,d[i]%=pr;for(n&&(d.unshift(n),++a),c=d.length;d[--c]==0;)d.pop();return t.d=d,t.e=a,Dn?wn(t,p):t}function Ua(e,t,n){if(e!==~~e||e<t||e>n)throw Error(dl+e)}function $a(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+=oo(n)),i+=r;o=e[t],r=o+"",n=Pn-r.length,n&&(i+=oo(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return i+o}var mi=(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%pr|0,o=i/pr|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*pr+r[i]-a[i];for(;!r[0]&&r.length>1;)r.shift()}return function(r,a,i,o){var c,d,f,h,p,v,x,j,b,y,S,N,_,A,k,E,P,R,M=r.constructor,D=r.s==a.s?1:-1,U=r.d,F=a.d;if(!r.s)return new M(r);if(!a.s)throw Error(qs+"Division by zero");for(d=r.e-a.e,P=F.length,k=U.length,x=new M(D),j=x.d=[],f=0;F[f]==(U[f]||0);)++f;if(F[f]>(U[f]||0)&&--d,i==null?N=i=M.precision:o?N=i+(Qn(r)-Qn(a))+1:N=i,N<0)return new M(0);if(N=N/Pn+2|0,f=0,P==1)for(h=0,F=F[0],N++;(f<k||h)&&N--;f++)_=h*pr+(U[f]||0),j[f]=_/F|0,h=_%F|0;else{for(h=pr/(F[0]+1)|0,h>1&&(F=e(F,h),U=e(U,h),P=F.length,k=U.length),A=P,b=U.slice(0,P),y=b.length;y<P;)b[y++]=0;R=F.slice(),R.unshift(0),E=F[0],F[1]>=pr/2&&++E;do h=0,c=t(F,b,P,y),c<0?(S=b[0],P!=y&&(S=S*pr+(b[1]||0)),h=S/E|0,h>1?(h>=pr&&(h=pr-1),p=e(F,h),v=p.length,y=b.length,c=t(p,b,v,y),c==1&&(h--,n(p,P<v?R:F,v))):(h==0&&(c=h=1),p=F.slice()),v=p.length,v<y&&p.unshift(0),n(b,p,y),c==-1&&(y=b.length,c=t(F,b,P,y),c<1&&(h++,n(b,P<y?R:F,y))),y=b.length):c===0&&(h++,b=[0]),j[f++]=h,c&&b[0]?b[y++]=U[A]||0:(b=[U[A]],y=1);while((A++<k||b[0]!==void 0)&&N--)}return j[0]||j.shift(),x.e=d,wn(x,o?i+Qn(x)+1:i)}})();function H4(e,t){var n,r,a,i,o,c,d=0,f=0,h=e.constructor,p=h.precision;if(Qn(e)>16)throw Error(n_+Qn(e));if(!e.s)return new h(vs);for(Dn=!1,c=p,o=new h(.03125);e.abs().gte(.1);)e=e.times(o),f+=5;for(r=Math.log(Jo(2,f))/Math.LN10*2+5|0,c+=r,n=a=i=new h(vs),h.precision=c;;){if(a=wn(a.times(e),c),n=n.times(++d),o=i.plus(mi(a,n,c)),$a(o.d).slice(0,c)===$a(i.d).slice(0,c)){for(;f--;)i=wn(i.times(i),c);return h.precision=p,t==null?(Dn=!0,wn(i,p)):i}i=o}}function Qn(e){for(var t=e.e*Pn,n=e.d[0];n>=10;n/=10)t++;return t}function yj(e,t,n){if(t>e.LN10.sd())throw Dn=!0,n&&(e.precision=n),Error(qs+"LN10 precision limit exceeded");return wn(new e(e.LN10),t)}function oo(e){for(var t="";e--;)t+="0";return t}function ff(e,t){var n,r,a,i,o,c,d,f,h,p=1,v=10,x=e,j=x.d,b=x.constructor,y=b.precision;if(x.s<1)throw Error(qs+(x.s?"NaN":"-Infinity"));if(x.eq(vs))return new b(0);if(t==null?(Dn=!1,f=y):f=t,x.eq(10))return t==null&&(Dn=!0),yj(b,f);if(f+=v,b.precision=f,n=$a(j),r=n.charAt(0),i=Qn(x),Math.abs(i)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)x=x.times(e),n=$a(x.d),r=n.charAt(0),p++;i=Qn(x),r>1?(x=new b("0."+n),i++):x=new b(r+"."+n.slice(1))}else return d=yj(b,f+2,y).times(i+""),x=ff(new b(r+"."+n.slice(1)),f-v).plus(d),b.precision=y,t==null?(Dn=!0,wn(x,y)):x;for(c=o=x=mi(x.minus(vs),x.plus(vs),f),h=wn(x.times(x),f),a=3;;){if(o=wn(o.times(h),f),d=c.plus(mi(o,new b(a),f)),$a(d.d).slice(0,f)===$a(c.d).slice(0,f))return c=c.times(2),i!==0&&(c=c.plus(yj(b,f+2,y).times(i+""))),c=mi(c,new b(p),f),b.precision=y,t==null?(Dn=!0,wn(c,y)):c;c=d,a+=2}}function sM(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=Mu(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),Dn&&(e.e>Pm||e.e<-Pm))throw Error(n_+n)}else e.s=0,e.e=0,e.d=[0];return e}function wn(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=Jo(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/Jo(10,o-a):0:p[h-1])%10&1||n==(e.s<0?8:7))),t<1||!p[0])return d?(i=Qn(e),p.length=1,t=t-i-1,p[0]=Jo(10,(Pn-t%Pn)%Pn),e.e=Mu(-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=Jo(10,Pn-r),p[h]=a>0?(f/Jo(10,o-a)%Jo(10,a)|0)*i:0),d)for(;;)if(h==0){(p[0]+=i)==pr&&(p[0]=1,++e.e);break}else{if(p[h]+=i,p[h]!=pr)break;p[h--]=0,i=1}for(r=p.length;p[--r]===0;)p.pop();if(Dn&&(e.e>Pm||e.e<-Pm))throw Error(n_+Qn(e));return e}function K4(e,t){var n,r,a,i,o,c,d,f,h,p,v=e.constructor,x=v.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new v(e),Dn?wn(t,x):t;if(d=e.d,p=t.d,r=t.e,f=e.e,d=d.slice(),o=f-r,o){for(h=o<0,h?(n=d,o=-o,c=p.length):(n=p,r=f,c=d.length),a=Math.max(Math.ceil(x/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]=pr-1;--d[i],d[a]+=pr}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,Dn?wn(t,x):t):new v(0)}function bl(e,t,n){var r,a=Qn(e),i=$a(e.d),o=i.length;return t?(n&&(r=n-o)>0?i=i.charAt(0)+"."+i.slice(1)+oo(r):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+oo(-a-1)+i,n&&(r=n-o)>0&&(i+=oo(r))):a>=o?(i+=oo(a+1-o),n&&(r=n-a-1)>0&&(i=i+"."+oo(r))):((r=a+1)<o&&(i=i.slice(0,r)+"."+i.slice(r)),n&&(r=n-o)>0&&(a+1===o&&(i+="."),i+=oo(r))),e.s<0?"-"+i:i}function aM(e,t){if(e.length>t)return e.length=t,!0}function G4(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(dl+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 sM(o,i.toString())}else if(typeof i!="string")throw Error(dl+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,Jse.test(i))sM(o,i);else throw Error(dl+i)}if(a.prototype=yt,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=G4,a.config=a.set=eae,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 eae(e){if(!e||typeof e!="object")throw Error(qs+"Object expected");var t,n,r,a=["precision",1,Ou,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<a.length;t+=3)if((r=e[n=a[t]])!==void 0)if(Mu(r)===r&&r>=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(dl+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(dl+n+": "+r);return this}var r_=G4(Zse);vs=new r_(1);const bn=r_;function tae(e){return aae(e)||sae(e)||rae(e)||nae()}function nae(){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 rae(e,t){if(e){if(typeof e=="string")return x1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return x1(e,t)}}function sae(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function aae(e){if(Array.isArray(e))return x1(e)}function x1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var iae=function(t){return t},Y4={},X4=function(t){return t===Y4},iM=function(t){return function n(){return arguments.length===0||arguments.length===1&&X4(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},oae=function e(t,n){return t===1?n:iM(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!==Y4}).length;return o>=t?n.apply(void 0,a):e(t-o,iM(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 X4(p)?d.shift():p});return n.apply(void 0,tae(h).concat(d))}))})},fv=function(t){return oae(t.length,t)},y1=function(t,n){for(var r=[],a=t;a<n;++a)r[a-t]=a;return r},lae=fv(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),cae=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return iae;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))}},b1=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},Q4=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 uae(e){var t;return e===0?t=1:t=Math.floor(new bn(e).abs().log(10).toNumber())+1,t}function dae(e,t,n){for(var r=new bn(e),a=0,i=[];r.lt(t)&&a<1e5;)i.push(r.toNumber()),r=r.add(n),a++;return i}var fae=fv(function(e,t,n){var r=+e,a=+t;return r+n*(a-r)}),pae=fv(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),hae=fv(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const pv={rangeStep:dae,getDigitCount:uae,interpolateNumber:fae,uninterpolateNumber:pae,uninterpolateTruncation:hae};function w1(e){return vae(e)||gae(e)||Z4(e)||mae()}function mae(){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 gae(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function vae(e){if(Array.isArray(e))return j1(e)}function pf(e,t){return bae(e)||yae(e,t)||Z4(e,t)||xae()}function xae(){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 Z4(e,t){if(e){if(typeof e=="string")return j1(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 j1(e,t)}}function j1(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 yae(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 bae(e){if(Array.isArray(e))return e}function J4(e){var t=pf(e,2),n=t[0],r=t[1],a=n,i=r;return n>r&&(a=r,i=n),[a,i]}function eF(e,t,n){if(e.lte(0))return new bn(0);var r=pv.getDigitCount(e.toNumber()),a=new bn(10).pow(r),i=e.div(a),o=r!==1?.05:.1,c=new bn(Math.ceil(i.div(o).toNumber())).add(n).mul(o),d=c.mul(a);return t?d:new bn(Math.ceil(d))}function wae(e,t,n){var r=1,a=new bn(e);if(!a.isint()&&n){var i=Math.abs(e);i<1?(r=new bn(10).pow(pv.getDigitCount(e)-1),a=new bn(Math.floor(a.div(r).toNumber())).mul(r)):i>1&&(a=new bn(Math.floor(e)))}else e===0?a=new bn(Math.floor((t-1)/2)):n||(a=new bn(Math.floor(e)));var o=Math.floor((t-1)/2),c=cae(lae(function(d){return a.add(new bn(d-o).mul(r)).toNumber()}),y1);return c(0,t)}function tF(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 bn(0),tickMin:new bn(0),tickMax:new bn(0)};var i=eF(new bn(t).sub(e).div(n-1),r,a),o;e<=0&&t>=0?o=new bn(0):(o=new bn(e).add(t).div(2),o=o.sub(new bn(o).mod(i)));var c=Math.ceil(o.sub(e).div(i).toNumber()),d=Math.ceil(new bn(t).sub(o).div(i).toNumber()),f=c+d+1;return f>n?tF(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 bn(c).mul(i)),tickMax:o.add(new bn(d).mul(i))})}function jae(e){var t=pf(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=J4([n,r]),d=pf(c,2),f=d[0],h=d[1];if(f===-1/0||h===1/0){var p=h===1/0?[f].concat(w1(y1(0,a-1).map(function(){return 1/0}))):[].concat(w1(y1(0,a-1).map(function(){return-1/0})),[h]);return n>r?b1(p):p}if(f===h)return wae(f,a,i);var v=tF(f,h,o,i),x=v.step,j=v.tickMin,b=v.tickMax,y=pv.rangeStep(j,b.add(new bn(.1).mul(x)),x);return n>r?b1(y):y}function Sae(e,t){var n=pf(e,2),r=n[0],a=n[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=J4([r,a]),c=pf(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=eF(new bn(f).sub(d).div(h-1),i,0),v=[].concat(w1(pv.rangeStep(new bn(d),new bn(f).sub(new bn(.99).mul(p)),p)),[f]);return r>a?b1(v):v}var Nae=Q4(jae),Cae=Q4(Sae),_ae="Invariant failed";function wl(e,t){throw new Error(_ae)}var Aae=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function tu(e){"@babel/helpers - typeof";return tu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tu(e)}function Tm(){return Tm=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},Tm.apply(this,arguments)}function kae(e,t){return Rae(e)||Tae(e,t)||Pae(e,t)||Eae()}function Eae(){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 Pae(e,t){if(e){if(typeof e=="string")return oM(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 oM(e,t)}}function oM(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 Tae(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 Rae(e){if(Array.isArray(e))return e}function Oae(e,t){if(e==null)return{};var n=Mae(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 Mae(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 Iae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $ae(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,sF(r.key),r)}}function Dae(e,t,n){return t&&$ae(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Lae(e,t,n){return t=Rm(t),Fae(e,nF()?Reflect.construct(t,n||[],Rm(e).constructor):t.apply(e,n))}function Fae(e,t){if(t&&(tu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zae(e)}function zae(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nF=function(){return!!e})()}function Rm(e){return Rm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Rm(e)}function Bae(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&S1(e,t)}function S1(e,t){return S1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},S1(e,t)}function rF(e,t,n){return t=sF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sF(e){var t=qae(e,"string");return tu(t)=="symbol"?t:t+""}function qae(e,t){if(tu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(tu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var sp=(function(e){function t(){return Iae(this,t),Lae(this,t,arguments)}return Bae(t,e),Dae(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,v=Oae(r,Aae),x=It(v,!1);this.props.direction==="x"&&h.type!=="number"&&wl();var j=d.map(function(b){var y=f(b,c),S=y.x,N=y.y,_=y.value,A=y.errorVal;if(!A)return null;var k=[],E,P;if(Array.isArray(A)){var R=kae(A,2);E=R[0],P=R[1]}else E=P=A;if(i==="vertical"){var M=h.scale,D=N+a,U=D+o,F=D-o,G=M(_-E),H=M(_+P);k.push({x1:H,y1:U,x2:H,y2:F}),k.push({x1:G,y1:D,x2:H,y2:D}),k.push({x1:G,y1:U,x2:G,y2:F})}else if(i==="horizontal"){var L=p.scale,I=S+a,Y=I-o,W=I+o,O=L(_-E),Q=L(_+P);k.push({x1:Y,y1:Q,x2:W,y2:Q}),k.push({x1:I,y1:O,x2:I,y2:Q}),k.push({x1:Y,y1:O,x2:W,y2:O})}return X.createElement(cn,Tm({className:"recharts-errorBar",key:"bar-".concat(k.map(function(q){return"".concat(q.x1,"-").concat(q.x2,"-").concat(q.y1,"-").concat(q.y2)}))},x),k.map(function(q){return X.createElement("line",Tm({},q,{key:"line-".concat(q.x1,"-").concat(q.x2,"-").concat(q.y1,"-").concat(q.y2)}))}))});return X.createElement(cn,{className:"recharts-errorBars"},j)}}])})(X.Component);rF(sp,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});rF(sp,"displayName","ErrorBar");function hf(e){"@babel/helpers - typeof";return hf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hf(e)}function lM(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 Ho(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lM(Object(n),!0).forEach(function(r){Uae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Uae(e,t,n){return t=Wae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wae(e){var t=Vae(e,"string");return hf(t)=="symbol"?t:t+""}function Vae(e,t){if(hf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(hf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var aF=function(t){var n=t.children,r=t.formattedGraphicalItems,a=t.legendWidth,i=t.legendContent,o=hs(n,cl);if(!o)return null;var c=cl.defaultProps,d=c!==void 0?Ho(Ho({},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 v=p.item,x=p.props,j=x.sectors||x.data||[];return h.concat(j.map(function(b){return{type:o.props.iconType||v.props.legendType,value:b.name,color:b.fill,payload:b}}))},[]):f=(r||[]).map(function(h){var p=h.item,v=p.type.defaultProps,x=v!==void 0?Ho(Ho({},v),p.props):{},j=x.dataKey,b=x.name,y=x.legendType,S=x.hide;return{inactive:S,dataKey:j,type:d.iconType||y||"square",color:s_(p),value:b||j,payload:x}}),Ho(Ho(Ho({},d),cl.getWithHeight(o,a)),{},{payload:f,item:o})};function mf(e){"@babel/helpers - typeof";return mf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mf(e)}function cM(e){return Yae(e)||Gae(e)||Kae(e)||Hae()}function Hae(){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 Kae(e,t){if(e){if(typeof e=="string")return N1(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 N1(e,t)}}function Gae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Yae(e){if(Array.isArray(e))return N1(e)}function N1(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 uM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Vn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uM(Object(n),!0).forEach(function(r){Fc(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fc(e,t,n){return t=Xae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xae(e){var t=Qae(e,"string");return mf(t)=="symbol"?t:t+""}function Qae(e,t){if(mf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(mf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rr(e,t,n){return Ht(e)||Ht(t)?n:sr(t)?bs(e,t,n):Vt(t)?t(e):n}function qd(e,t,n,r){var a=Yse(e,function(c){return rr(c,t)});if(n==="number"){var i=a.filter(function(c){return at(c)||parseFloat(c)});return i.length?[dv(i),uv(i)]:[1/0,-1/0]}var o=r?a.filter(function(c){return!Ht(c)}):a;return o.map(function(c){return sr(c)||c instanceof Date?c:""})}var Zae=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,v=f>=c-1?a[0].coordinate:a[f+1].coordinate,x=void 0;if($r(p-h)!==$r(v-p)){var j=[];if($r(v-p)===$r(d[1]-d[0])){x=v;var b=p+d[1]-d[0];j[0]=Math.min(b,(b+h)/2),j[1]=Math.max(b,(b+h)/2)}else{x=h;var y=v+d[1]-d[0];j[0]=Math.min(p,(y+p)/2),j[1]=Math.max(p,(y+p)/2)}var S=[Math.min(p,(x+p)/2),Math.max(p,(x+p)/2)];if(t>S[0]&&t<=S[1]||t>=j[0]&&t<=j[1]){o=a[f].index;break}}else{var N=Math.min(h,v),_=Math.max(h,v);if(t>(N+p)/2&&t<=(_+p)/2){o=a[f].index;break}}}else for(var A=0;A<c;A++)if(A===0&&t<=(r[A].coordinate+r[A+1].coordinate)/2||A>0&&A<c-1&&t>(r[A].coordinate+r[A-1].coordinate)/2&&t<=(r[A].coordinate+r[A+1].coordinate)/2||A===c-1&&t>(r[A].coordinate+r[A-1].coordinate)/2){o=r[A].index;break}return o},s_=function(t){var n,r=t,a=r.type.displayName,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Vn(Vn({},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},Jae=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),v=0,x=p.length;v<x;v++){var j=h[p[v]],b=j.items,y=j.cateAxisId,S=b.filter(function(P){return pi(P.type).indexOf("Bar")>=0});if(S&&S.length){var N=S[0].type.defaultProps,_=N!==void 0?Vn(Vn({},N),S[0].props):S[0].props,A=_.barSize,k=_[y];o[k]||(o[k]=[]);var E=Ht(A)?n:A;o[k].push({item:S[0],stackList:S.slice(1),barSize:Ht(E)?void 0:Dr(E,r,0)})}}return o},eie=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=Dr(n,a,0,!0),h,p=[];if(o[0].barSize===+o[0].barSize){var v=!1,x=a/d,j=o.reduce(function(A,k){return A+k.barSize||0},0);j+=(d-1)*f,j>=a&&(j-=(d-1)*f,f=0),j>=a&&x>0&&(v=!0,x*=.9,j=d*x);var b=(a-j)/2>>0,y={offset:b-f,size:0};h=o.reduce(function(A,k){var E={item:k.item,position:{offset:y.offset+y.size+f,size:v?x:k.barSize}},P=[].concat(cM(A),[E]);return y=P[P.length-1].position,k.stackList&&k.stackList.length&&k.stackList.forEach(function(R){P.push({item:R,position:y})}),P},p)}else{var S=Dr(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(A,k,E){var P=[].concat(cM(A),[{item:k.item,position:{offset:S+(N+f)*E+(N-_)/2,size:_}}]);return k.stackList&&k.stackList.length&&k.stackList.forEach(function(R){P.push({item:R,position:P[P.length-1].position})}),P},p)}return h},tie=function(t,n,r,a){var i=r.children,o=r.width,c=r.margin,d=o-(c.left||0)-(c.right||0),f=aF({children:i,legendWidth:d});if(f){var h=a||{},p=h.width,v=h.height,x=f.align,j=f.verticalAlign,b=f.layout;if((b==="vertical"||b==="horizontal"&&j==="middle")&&x!=="center"&&at(t[x]))return Vn(Vn({},t),{},Fc({},x,t[x]+(p||0)));if((b==="horizontal"||b==="vertical"&&x==="center")&&j!=="middle"&&at(t[j]))return Vn(Vn({},t),{},Fc({},j,t[j]+(v||0)))}return t},nie=function(t,n,r){return Ht(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},iF=function(t,n,r,a,i){var o=n.props.children,c=ws(o,sp).filter(function(f){return nie(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=rr(h,r);if(Ht(p))return f;var v=Array.isArray(p)?[dv(p),uv(p)]:[p,p],x=d.reduce(function(j,b){var y=rr(h,b,0),S=v[0]-Math.abs(Array.isArray(y)?y[0]:y),N=v[1]+Math.abs(Array.isArray(y)?y[1]:y);return[Math.min(S,j[0]),Math.max(N,j[1])]},[1/0,-1/0]);return[Math.min(x[0],f[0]),Math.max(x[1],f[1])]},[1/0,-1/0])}return null},rie=function(t,n,r,a,i){var o=n.map(function(c){return iF(t,c,r,i,a)}).filter(function(c){return!Ht(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},oF=function(t,n,r,a,i){var o=n.map(function(d){var f=d.props.dataKey;return r==="number"&&f&&iF(t,d,f,a)||qd(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},[])},lF=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},al=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?$r(c[0]-c[1])*2*f:f,n&&(t.ticks||t.niceTicks)){var h=(t.ticks||t.niceTicks).map(function(p){var v=i?i.indexOf(p):p;return{coordinate:a(v)+f,value:p,offset:f}});return h.filter(function(p){return!Qf(p.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(p,v){return{coordinate:a(p)+f,value:p,index:v,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,v){return{coordinate:a(p)+f,value:i?i[p]:p,index:v,offset:f}})},bj=new WeakMap,Rh=function(t,n){if(typeof n!="function")return t;bj.has(t)||bj.set(t,new WeakMap);var r=bj.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},cF=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:of(),realScaleType:"band"}:o==="radial"&&c==="angleAxis"?{scale:_m(),realScaleType:"linear"}:i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:Bd(),realScaleType:"point"}:i==="category"?{scale:of(),realScaleType:"band"}:{scale:_m(),realScaleType:"linear"};if(vl(a)){var d="scale".concat(Yg(a));return{scale:(Y2[d]||Bd)(),realScaleType:Y2[d]?d:"point"}}return Vt(a)?{scale:a}:{scale:Bd(),realScaleType:"point"}},dM=1e-4,uF=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])-dM,o=Math.max(a[0],a[1])+dM,c=t(n[0]),d=t(n[r-1]);(c<i||c>o||d<i||d>o)&&t.domain([n[0],n[r-1]])}},sie=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},aie=function(t,n){if(!n||n.length!==2||!at(n[0])||!at(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(!at(t[0])||t[0]<r)&&(i[0]=r),(!at(t[1])||t[1]>a)&&(i[1]=a),i[0]>a&&(i[0]=a),i[1]<r&&(i[1]=r),i},iie=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=Qf(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])}},oie=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=Qf(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)}},lie={sign:iie,expand:YZ,none:Kc,silhouette:XZ,wiggle:QZ,positive:oie},cie=function(t,n,r){var a=n.map(function(c){return c.props.dataKey}),i=lie[r],o=GZ().keys(a).value(function(c,d){return+rr(c,d,0)}).order(e1).offset(i);return o(t)},uie=function(t,n,r,a,i,o){if(!t)return null;var c=o?n.reverse():n,d={},f=c.reduce(function(p,v){var x,j=(x=v.type)!==null&&x!==void 0&&x.defaultProps?Vn(Vn({},v.type.defaultProps),v.props):v.props,b=j.stackId,y=j.hide;if(y)return p;var S=j[r],N=p[S]||{hasStack:!1,stackGroups:{}};if(sr(b)){var _=N.stackGroups[b]||{numericAxisId:r,cateAxisId:a,items:[]};_.items.push(v),N.hasStack=!0,N.stackGroups[b]=_}else N.stackGroups[Pu("_stackId_")]={numericAxisId:r,cateAxisId:a,items:[v]};return Vn(Vn({},p),{},Fc({},S,N))},d),h={};return Object.keys(f).reduce(function(p,v){var x=f[v];if(x.hasStack){var j={};x.stackGroups=Object.keys(x.stackGroups).reduce(function(b,y){var S=x.stackGroups[y];return Vn(Vn({},b),{},Fc({},y,{numericAxisId:r,cateAxisId:a,items:S.items,stackedData:cie(t,S.items,i)}))},j)}return Vn(Vn({},p),{},Fc({},v,x))},h)},dF=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=Nae(f,i,c);return t.domain([dv(h),uv(h)]),{niceTicks:h}}if(i&&a==="number"){var p=t.domain(),v=Cae(p,i,c);return{niceTicks:v}}return null};function fM(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&&!Ht(a[t.dataKey])){var c=im(n,"value",a[t.dataKey]);if(c)return c.coordinate+r/2}return n[i]?n[i].coordinate+r/2:null}var d=rr(a,Ht(o)?t.dataKey:o);return Ht(d)?null:t.scale(d)}var pM=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=rr(o,n.dataKey,n.domain[c]);return Ht(d)?null:n.scale(d)-i/2+a},die=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]},fie=function(t,n){var r,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Vn(Vn({},t.type.defaultProps),t.props):t.props,i=a.stackId;if(sr(i)){var o=n[i];if(o){var c=o.items.indexOf(t);return c>=0?o.stackedData[c]:null}}return null},pie=function(t){return t.reduce(function(n,r){return[dv(r.concat([n[0]]).filter(at)),uv(r.concat([n[1]]).filter(at))]},[1/0,-1/0])},fF=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=pie(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})},hM=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,mM=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,C1=function(t,n,r){if(Vt(t))return t(n,r);if(!Array.isArray(t))return n;var a=[];if(at(t[0]))a[0]=r?t[0]:Math.min(t[0],n[0]);else if(hM.test(t[0])){var i=+hM.exec(t[0])[1];a[0]=n[0]-i}else Vt(t[0])?a[0]=t[0](n[0]):a[0]=n[0];if(at(t[1]))a[1]=r?t[1]:Math.max(t[1],n[1]);else if(mM.test(t[1])){var o=+mM.exec(t[1])[1];a[1]=n[1]+o}else Vt(t[1])?a[1]=t[1](n[1]):a[1]=n[1];return a},Om=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=RC(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},gM=function(t,n,r){return!t||!t.length||rp(t,bs(r,"type.defaultProps.domain"))?n:t},pF=function(t,n){var r=t.type.defaultProps?Vn(Vn({},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 Vn(Vn({},It(t,!1)),{},{dataKey:a,unit:o,formatter:c,name:i||a,color:s_(t),value:rr(n,a),type:d,payload:n,chartType:f,hide:h})};function gf(e){"@babel/helpers - typeof";return gf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gf(e)}function vM(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?vM(Object(n),!0).forEach(function(r){hF(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hF(e,t,n){return t=hie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hie(e){var t=mie(e,"string");return gf(t)=="symbol"?t:t+""}function mie(e,t){if(gf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(gf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gie(e,t){return bie(e)||yie(e,t)||xie(e,t)||vie()}function vie(){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 xie(e,t){if(e){if(typeof e=="string")return xM(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 xM(e,t)}}function xM(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function yie(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function bie(e){if(Array.isArray(e))return e}var Mm=Math.PI/180,wie=function(t){return t*180/Math.PI},Cn=function(t,n,r,a){return{x:t+Math.cos(-Mm*a)*r,y:n+Math.sin(-Mm*a)*r}},mF=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},jie=function(t,n,r,a,i){var o=t.width,c=t.height,d=t.startAngle,f=t.endAngle,h=Dr(t.cx,o,o/2),p=Dr(t.cy,c,c/2),v=mF(o,c,r),x=Dr(t.innerRadius,v,0),j=Dr(t.outerRadius,v,v*.8),b=Object.keys(n);return b.reduce(function(y,S){var N=n[S],_=N.domain,A=N.reversed,k;if(Ht(N.range))a==="angleAxis"?k=[d,f]:a==="radiusAxis"&&(k=[x,j]),A&&(k=[k[1],k[0]]);else{k=N.range;var E=k,P=gie(E,2);d=P[0],f=P[1]}var R=cF(N,i),M=R.realScaleType,D=R.scale;D.domain(_).range(k),uF(D);var U=dF(D,li(li({},N),{},{realScaleType:M})),F=li(li(li({},N),U),{},{range:k,radius:j,realScaleType:M,scale:D,cx:h,cy:p,innerRadius:x,outerRadius:j,startAngle:d,endAngle:f});return li(li({},y),{},hF({},S,F))},{})},Sie=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))},Nie=function(t,n){var r=t.x,a=t.y,i=n.cx,o=n.cy,c=Sie({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:wie(f),angleInRadian:f}},Cie=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}},_ie=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},yM=function(t,n){var r=t.x,a=t.y,i=Nie({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=Cie(n),p=h.startAngle,v=h.endAngle,x=c,j;if(p<=v){for(;x>v;)x-=360;for(;x<p;)x+=360;j=x>=p&&x<=v}else{for(;x>p;)x-=360;for(;x<v;)x+=360;j=x>=v&&x<=p}return j?li(li({},n),{},{radius:o,angle:_ie(x,n)}):null},gF=function(t){return!m.isValidElement(t)&&!Vt(t)&&typeof t!="boolean"?t.className:""};function vf(e){"@babel/helpers - typeof";return vf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vf(e)}var Aie=["offset"];function kie(e){return Rie(e)||Tie(e)||Pie(e)||Eie()}function Eie(){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 Pie(e,t){if(e){if(typeof e=="string")return _1(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 _1(e,t)}}function Tie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Rie(e){if(Array.isArray(e))return _1(e)}function _1(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 Oie(e,t){if(e==null)return{};var n=Mie(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 Mie(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 bM(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 nr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bM(Object(n),!0).forEach(function(r){Iie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Iie(e,t,n){return t=$ie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $ie(e){var t=Die(e,"string");return vf(t)=="symbol"?t:t+""}function Die(e,t){if(vf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(vf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xf(){return xf=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},xf.apply(this,arguments)}var Lie=function(t){var n=t.value,r=t.formatter,a=Ht(t.children)?n:t.children;return Vt(r)?r(a):a},Fie=function(t,n){var r=$r(n-t),a=Math.min(Math.abs(n-t),360);return r*a},zie=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,v=d.outerRadius,x=d.startAngle,j=d.endAngle,b=d.clockWise,y=(p+v)/2,S=Fie(x,j),N=S>=0?1:-1,_,A;a==="insideStart"?(_=x+N*o,A=b):a==="insideEnd"?(_=j-N*o,A=!b):a==="end"&&(_=j+N*o,A=b),A=S<=0?A:!A;var k=Cn(f,h,y,_),E=Cn(f,h,y,_+(A?1:-1)*359),P="M".concat(k.x,",").concat(k.y,`
|
|
75
|
+
A`).concat(y,",").concat(y,",0,1,").concat(A?0:1,`,
|
|
76
|
+
`).concat(E.x,",").concat(E.y),R=Ht(t.id)?Pu("recharts-radial-line-"):t.id;return X.createElement("text",xf({},r,{dominantBaseline:"central",className:Yt("recharts-radial-bar-label",c)}),X.createElement("defs",null,X.createElement("path",{id:R,d:P})),X.createElement("textPath",{xlinkHref:"#".concat(R)},n))},Bie=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,v=(h+p)/2;if(a==="outside"){var x=Cn(o,c,f+r,v),j=x.x,b=x.y;return{x:j,y:b,textAnchor:j>=o?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"end"};var y=(d+f)/2,S=Cn(o,c,y,v),N=S.x,_=S.y;return{x:N,y:_,textAnchor:"middle",verticalAnchor:"middle"}},qie=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,v=p*a,x=p>0?"end":"start",j=p>0?"start":"end",b=f>=0?1:-1,y=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:x};return nr(nr({},_),r?{height:Math.max(d-r.y,0),width:f}:{})}if(i==="bottom"){var A={x:c+f/2,y:d+h+v,textAnchor:"middle",verticalAnchor:j};return nr(nr({},A),r?{height:Math.max(r.y+r.height-(d+h),0),width:f}:{})}if(i==="left"){var k={x:c-y,y:d+h/2,textAnchor:S,verticalAnchor:"middle"};return nr(nr({},k),r?{width:Math.max(k.x-r.x,0),height:h}:{})}if(i==="right"){var E={x:c+f+y,y:d+h/2,textAnchor:N,verticalAnchor:"middle"};return nr(nr({},E),r?{width:Math.max(r.x+r.width-E.x,0),height:h}:{})}var P=r?{width:f,height:h}:{};return i==="insideLeft"?nr({x:c+y,y:d+h/2,textAnchor:N,verticalAnchor:"middle"},P):i==="insideRight"?nr({x:c+f-y,y:d+h/2,textAnchor:S,verticalAnchor:"middle"},P):i==="insideTop"?nr({x:c+f/2,y:d+v,textAnchor:"middle",verticalAnchor:j},P):i==="insideBottom"?nr({x:c+f/2,y:d+h-v,textAnchor:"middle",verticalAnchor:x},P):i==="insideTopLeft"?nr({x:c+y,y:d+v,textAnchor:N,verticalAnchor:j},P):i==="insideTopRight"?nr({x:c+f-y,y:d+v,textAnchor:S,verticalAnchor:j},P):i==="insideBottomLeft"?nr({x:c+y,y:d+h-v,textAnchor:N,verticalAnchor:x},P):i==="insideBottomRight"?nr({x:c+f-y,y:d+h-v,textAnchor:S,verticalAnchor:x},P):Eu(i)&&(at(i.x)||nl(i.x))&&(at(i.y)||nl(i.y))?nr({x:c+Dr(i.x,f),y:d+Dr(i.y,h),textAnchor:"end",verticalAnchor:"end"},P):nr({x:c+f/2,y:d+h/2,textAnchor:"middle",verticalAnchor:"middle"},P)},Uie=function(t){return"cx"in t&&at(t.cx)};function hr(e){var t=e.offset,n=t===void 0?5:t,r=Oie(e,Aie),a=nr({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,v=a.textBreakAll;if(!i||Ht(c)&&Ht(d)&&!m.isValidElement(f)&&!Vt(f))return null;if(m.isValidElement(f))return m.cloneElement(f,a);var x;if(Vt(f)){if(x=m.createElement(f,a),m.isValidElement(x))return x}else x=Lie(a);var j=Uie(i),b=It(a,!0);if(j&&(o==="insideStart"||o==="insideEnd"||o==="end"))return zie(a,x,b);var y=j?Bie(a):qie(a);return X.createElement(yl,xf({className:Yt("recharts-label",p)},b,y,{breakAll:v}),x)}hr.displayName="Label";var vF=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,v=t.y,x=t.top,j=t.left,b=t.width,y=t.height,S=t.clockWise,N=t.labelViewBox;if(N)return N;if(at(b)&&at(y)){if(at(p)&&at(v))return{x:p,y:v,width:b,height:y};if(at(x)&&at(j))return{x,y:j,width:b,height:y}}return at(p)&&at(v)?{x:p,y:v,width:0,height:0}:at(n)&&at(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:{}},Wie=function(t,n){return t?t===!0?X.createElement(hr,{key:"label-implicit",viewBox:n}):sr(t)?X.createElement(hr,{key:"label-implicit",viewBox:n,value:t}):m.isValidElement(t)?t.type===hr?m.cloneElement(t,{key:"label-implicit",viewBox:n}):X.createElement(hr,{key:"label-implicit",content:t,viewBox:n}):Vt(t)?X.createElement(hr,{key:"label-implicit",content:t,viewBox:n}):Eu(t)?X.createElement(hr,xf({viewBox:n},t,{key:"label-implicit"})):null:null},Vie=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=vF(t),o=ws(a,hr).map(function(d,f){return m.cloneElement(d,{viewBox:n||i,key:"label-".concat(f)})});if(!r)return o;var c=Wie(t.label,n||i);return[c].concat(kie(o))};hr.parseViewBox=vF;hr.renderCallByParent=Vie;var wj,wM;function Hie(){if(wM)return wj;wM=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return wj=e,wj}var Kie=Hie();const Gie=vn(Kie);function yf(e){"@babel/helpers - typeof";return yf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yf(e)}var Yie=["valueAccessor"],Xie=["data","dataKey","clockWise","id","textBreakAll"];function Qie(e){return toe(e)||eoe(e)||Jie(e)||Zie()}function Zie(){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 Jie(e,t){if(e){if(typeof e=="string")return A1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return A1(e,t)}}function eoe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function toe(e){if(Array.isArray(e))return A1(e)}function A1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Im(){return Im=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Im.apply(this,arguments)}function jM(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 SM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jM(Object(n),!0).forEach(function(r){noe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function noe(e,t,n){return t=roe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function roe(e){var t=soe(e,"string");return yf(t)=="symbol"?t:t+""}function soe(e,t){if(yf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(yf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function NM(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 ioe=function(t){return Array.isArray(t.value)?Gie(t.value):t.value};function gi(e){var t=e.valueAccessor,n=t===void 0?ioe:t,r=NM(e,Yie),a=r.data,i=r.dataKey,o=r.clockWise,c=r.id,d=r.textBreakAll,f=NM(r,Xie);return!a||!a.length?null:X.createElement(cn,{className:"recharts-label-list"},a.map(function(h,p){var v=Ht(i)?n(h,p):rr(h&&h.payload,i),x=Ht(c)?{}:{id:"".concat(c,"-").concat(p)};return X.createElement(hr,Im({},It(h,!0),f,x,{parentViewBox:h.parentViewBox,value:v,textBreakAll:d,viewBox:hr.parseViewBox(Ht(o)?h:SM(SM({},h),{},{clockWise:o})),key:"label-".concat(p),index:p}))}))}gi.displayName="LabelList";function ooe(e,t){return e?e===!0?X.createElement(gi,{key:"labelList-implicit",data:t}):X.isValidElement(e)||Vt(e)?X.createElement(gi,{key:"labelList-implicit",data:t,content:e}):Eu(e)?X.createElement(gi,Im({data:t},e,{key:"labelList-implicit"})):null:null}function loe(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=ws(r,gi).map(function(o,c){return m.cloneElement(o,{data:t,key:"labelList-".concat(c)})});if(!n)return a;var i=ooe(e.label,t);return[i].concat(Qie(a))}gi.renderCallByParent=loe;function bf(e){"@babel/helpers - typeof";return bf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bf(e)}function k1(){return k1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},k1.apply(this,arguments)}function CM(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 _M(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CM(Object(n),!0).forEach(function(r){coe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function coe(e,t,n){return t=uoe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uoe(e){var t=doe(e,"string");return bf(t)=="symbol"?t:t+""}function doe(e,t){if(bf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(bf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var foe=function(t,n){var r=$r(n-t),a=Math.min(Math.abs(n-t),359.999);return r*a},Oh=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)/Mm,v=f?i:i+o*p,x=Cn(n,r,h,v),j=Cn(n,r,a,v),b=f?i-o*p:i,y=Cn(n,r,h*Math.cos(p*Mm),b);return{center:x,circleTangency:j,lineTangency:y,theta:p}},xF=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.startAngle,c=t.endAngle,d=foe(o,c),f=o+d,h=Cn(n,r,i,o),p=Cn(n,r,i,f),v="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 x=Cn(n,r,a,o),j=Cn(n,r,a,f);v+="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(x.x,",").concat(x.y," Z")}else v+="L ".concat(n,",").concat(r," Z");return v},poe=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=$r(h-f),v=Oh({cx:n,cy:r,radius:i,angle:f,sign:p,cornerRadius:o,cornerIsExternal:d}),x=v.circleTangency,j=v.lineTangency,b=v.theta,y=Oh({cx:n,cy:r,radius:i,angle:h,sign:-p,cornerRadius:o,cornerIsExternal:d}),S=y.circleTangency,N=y.lineTangency,_=y.theta,A=d?Math.abs(f-h):Math.abs(f-h)-b-_;if(A<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
|
+
`):xF({cx:n,cy:r,innerRadius:a,outerRadius:i,startAngle:f,endAngle:h});var k="M ".concat(j.x,",").concat(j.y,`
|
|
88
|
+
A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(x.x,",").concat(x.y,`
|
|
89
|
+
A`).concat(i,",").concat(i,",0,").concat(+(A>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 E=Oh({cx:n,cy:r,radius:a,angle:f,sign:p,isExternal:!0,cornerRadius:o,cornerIsExternal:d}),P=E.circleTangency,R=E.lineTangency,M=E.theta,D=Oh({cx:n,cy:r,radius:a,angle:h,sign:-p,isExternal:!0,cornerRadius:o,cornerIsExternal:d}),U=D.circleTangency,F=D.lineTangency,G=D.theta,H=d?Math.abs(f-h):Math.abs(f-h)-M-G;if(H<0&&o===0)return"".concat(k,"L").concat(n,",").concat(r,"Z");k+="L".concat(F.x,",").concat(F.y,`
|
|
92
|
+
A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(U.x,",").concat(U.y,`
|
|
93
|
+
A`).concat(a,",").concat(a,",0,").concat(+(H>180),",").concat(+(p>0),",").concat(P.x,",").concat(P.y,`
|
|
94
|
+
A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(R.x,",").concat(R.y,"Z")}else k+="L".concat(n,",").concat(r,"Z");return k},hoe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},yF=function(t){var n=_M(_M({},hoe),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,v=n.className;if(o<i||h===p)return null;var x=Yt("recharts-sector",v),j=o-i,b=Dr(c,j,0,!0),y;return b>0&&Math.abs(h-p)<360?y=poe({cx:r,cy:a,innerRadius:i,outerRadius:o,cornerRadius:Math.min(b,j/2),forceCornerRadius:d,cornerIsExternal:f,startAngle:h,endAngle:p}):y=xF({cx:r,cy:a,innerRadius:i,outerRadius:o,startAngle:h,endAngle:p}),X.createElement("path",k1({},It(n,!0),{className:x,d:y,role:"img"}))};function wf(e){"@babel/helpers - typeof";return wf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wf(e)}function E1(){return E1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},E1.apply(this,arguments)}function AM(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 kM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AM(Object(n),!0).forEach(function(r){moe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function moe(e,t,n){return t=goe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function goe(e){var t=voe(e,"string");return wf(t)=="symbol"?t:t+""}function voe(e,t){if(wf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(wf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var EM={curveBasisClosed:DZ,curveBasisOpen:LZ,curveBasis:$Z,curveBumpX:jZ,curveBumpY:SZ,curveLinearClosed:FZ,curveLinear:Qg,curveMonotoneX:zZ,curveMonotoneY:BZ,curveNatural:qZ,curveStep:UZ,curveStepAfter:VZ,curveStepBefore:WZ},Mh=function(t){return t.x===+t.x&&t.y===+t.y},Cd=function(t){return t.x},_d=function(t){return t.y},xoe=function(t,n){if(Vt(t))return t;var r="curve".concat(Yg(t));return(r==="curveMonotone"||r==="curveBump")&&n?EM["".concat(r).concat(n==="vertical"?"Y":"X")]:EM[r]||Qg},yoe=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=xoe(r,c),p=f?i.filter(function(b){return Mh(b)}):i,v;if(Array.isArray(o)){var x=f?o.filter(function(b){return Mh(b)}):o,j=p.map(function(b,y){return kM(kM({},b),{},{base:x[y]})});return c==="vertical"?v=Ch().y(_d).x1(Cd).x0(function(b){return b.base.x}):v=Ch().x(Cd).y1(_d).y0(function(b){return b.base.y}),v.defined(Mh).curve(h),v(j)}return c==="vertical"&&at(o)?v=Ch().y(_d).x1(Cd).x0(o):at(o)?v=Ch().x(Cd).y1(_d).y0(o):v=yL().x(Cd).y(_d),v.defined(Mh).curve(h),v(p)},$m=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?yoe(t):a;return m.createElement("path",E1({},It(t,!1),om(t),{className:Yt("recharts-curve",n),d:o,ref:i}))},jj={exports:{}},Sj,PM;function boe(){if(PM)return Sj;PM=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Sj=e,Sj}var Nj,TM;function woe(){if(TM)return Nj;TM=1;var e=boe();function t(){}function n(){}return n.resetWarningCache=t,Nj=function(){function r(o,c,d,f,h,p){if(p!==e){var v=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 v.name="Invariant Violation",v}}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},Nj}var RM;function joe(){return RM||(RM=1,jj.exports=woe()()),jj.exports}var Soe=joe();const hn=vn(Soe),{getOwnPropertyNames:Noe,getOwnPropertySymbols:Coe}=Object,{hasOwnProperty:_oe}=Object.prototype;function Cj(e,t){return function(r,a,i){return e(r,a,i)&&t(r,a,i)}}function Ih(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 Aoe(e){return e?.[Symbol.toStringTag]}function OM(e){return Noe(e).concat(Coe(e))}const koe=Object.hasOwn||((e,t)=>_oe.call(e,t));function Fl(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const Eoe="__v",Poe="__o",Toe="_owner",{getOwnPropertyDescriptor:MM,keys:IM}=Object;function Roe(e,t){return e.byteLength===t.byteLength&&Dm(new Uint8Array(e),new Uint8Array(t))}function Ooe(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 Moe(e,t){return e.byteLength===t.byteLength&&Dm(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function Ioe(e,t){return Fl(e.getTime(),t.getTime())}function $oe(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Doe(e,t){return e===t}function $M(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 v=o.value,x=c.value;if(n.equals(v[0],x[0],d,p,e,t,n)&&n.equals(v[1],x[1],v[0],x[0],e,t,n)){h=a[p]=!0;break}p++}if(!h)return!1;d++}return!0}const Loe=Fl;function Foe(e,t,n){const r=IM(e);let a=r.length;if(IM(t).length!==a)return!1;for(;a-- >0;)if(!bF(e,t,n,r[a]))return!1;return!0}function Ad(e,t,n){const r=OM(e);let a=r.length;if(OM(t).length!==a)return!1;let i,o,c;for(;a-- >0;)if(i=r[a],!bF(e,t,n,i)||(o=MM(e,i),c=MM(t,i),(o||c)&&(!o||!c||o.configurable!==c.configurable||o.enumerable!==c.enumerable||o.writable!==c.writable)))return!1;return!0}function zoe(e,t){return Fl(e.valueOf(),t.valueOf())}function Boe(e,t){return e.source===t.source&&e.flags===t.flags}function DM(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 Dm(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 qoe(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 bF(e,t,n,r){return(r===Toe||r===Poe||r===Eoe)&&(e.$$typeof||t.$$typeof)?!0:koe(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const Uoe="[object ArrayBuffer]",Woe="[object Arguments]",Voe="[object Boolean]",Hoe="[object DataView]",Koe="[object Date]",Goe="[object Error]",Yoe="[object Map]",Xoe="[object Number]",Qoe="[object Object]",Zoe="[object RegExp]",Joe="[object Set]",ele="[object String]",tle={"[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},nle="[object URL]",rle=Object.prototype.toString;function sle({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:v,areUrlsEqual:x,unknownTagComparators:j}){return function(y,S,N){if(y===S)return!0;if(y==null||S==null)return!1;const _=typeof y;if(_!==typeof S)return!1;if(_!=="object")return _==="number"?c(y,S,N):_==="function"?i(y,S,N):!1;const A=y.constructor;if(A!==S.constructor)return!1;if(A===Object)return d(y,S,N);if(Array.isArray(y))return t(y,S,N);if(A===Date)return r(y,S,N);if(A===RegExp)return h(y,S,N);if(A===Map)return o(y,S,N);if(A===Set)return p(y,S,N);const k=rle.call(y);if(k===Koe)return r(y,S,N);if(k===Zoe)return h(y,S,N);if(k===Yoe)return o(y,S,N);if(k===Joe)return p(y,S,N);if(k===Qoe)return typeof y.then!="function"&&typeof S.then!="function"&&d(y,S,N);if(k===nle)return x(y,S,N);if(k===Goe)return a(y,S,N);if(k===Woe)return d(y,S,N);if(tle[k])return v(y,S,N);if(k===Uoe)return e(y,S,N);if(k===Hoe)return n(y,S,N);if(k===Voe||k===Xoe||k===ele)return f(y,S,N);if(j){let E=j[k];if(!E){const P=Aoe(y);P&&(E=j[P])}if(E)return E(y,S,N)}return!1}}function ale({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:Roe,areArraysEqual:n?Ad:Ooe,areDataViewsEqual:Moe,areDatesEqual:Ioe,areErrorsEqual:$oe,areFunctionsEqual:Doe,areMapsEqual:n?Cj($M,Ad):$M,areNumbersEqual:Loe,areObjectsEqual:n?Ad:Foe,arePrimitiveWrappersEqual:zoe,areRegExpsEqual:Boe,areSetsEqual:n?Cj(DM,Ad):DM,areTypedArraysEqual:n?Cj(Dm,Ad):Dm,areUrlsEqual:qoe,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const a=Ih(r.areArraysEqual),i=Ih(r.areMapsEqual),o=Ih(r.areObjectsEqual),c=Ih(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:a,areMapsEqual:i,areObjectsEqual:o,areSetsEqual:c})}return r}function ile(e){return function(t,n,r,a,i,o,c){return e(t,n,c)}}function ole({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 lle=Ao();Ao({strict:!0});Ao({circular:!0});Ao({circular:!0,strict:!0});Ao({createInternalComparator:()=>Fl});Ao({strict:!0,createInternalComparator:()=>Fl});Ao({circular:!0,createInternalComparator:()=>Fl});Ao({circular:!0,createInternalComparator:()=>Fl,strict:!0});function Ao(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:a=!1}=e,i=ale(e),o=sle(i),c=n?n(o):ile(o);return ole({circular:t,comparator:o,createState:r,equals:c,strict:a})}function cle(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function LM(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):cle(a)};requestAnimationFrame(r)}function P1(e){"@babel/helpers - typeof";return P1=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},P1(e)}function ule(e){return hle(e)||ple(e)||fle(e)||dle()}function dle(){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 fle(e,t){if(e){if(typeof e=="string")return FM(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 FM(e,t)}}function FM(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 ple(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function hle(e){if(Array.isArray(e))return e}function mle(){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=ule(o),d=c[0],f=c.slice(1);if(typeof d=="number"){LM(a.bind(null,f),d);return}a(d),LM(a.bind(null,f));return}P1(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 jf(e){"@babel/helpers - typeof";return jf=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},jf(e)}function zM(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 BM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zM(Object(n),!0).forEach(function(r){wF(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wF(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=vle(e,"string");return jf(t)==="symbol"?t:String(t)}function vle(e,t){if(jf(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(jf(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var xle=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,a){return r.filter(function(i){return a.includes(i)})})},yle=function(t){return t},ble=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},Ud=function(t,n){return Object.keys(n).reduce(function(r,a){return BM(BM({},r),{},wF({},a,t(a,n[a])))},{})},qM=function(t,n,r){return t.map(function(a){return"".concat(ble(a)," ").concat(n,"ms ").concat(r)}).join(",")};function wle(e,t){return Nle(e)||Sle(e,t)||jF(e,t)||jle()}function jle(){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 Sle(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function Nle(e){if(Array.isArray(e))return e}function Cle(e){return kle(e)||Ale(e)||jF(e)||_le()}function _le(){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 jF(e,t){if(e){if(typeof e=="string")return T1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return T1(e,t)}}function Ale(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function kle(e){if(Array.isArray(e))return T1(e)}function T1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Lm=1e-4,SF=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},NF=function(t,n){return t.map(function(r,a){return r*Math.pow(n,a)}).reduce(function(r,a){return r+a})},UM=function(t,n){return function(r){var a=SF(t,n);return NF(a,r)}},Ele=function(t,n){return function(r){var a=SF(t,n),i=[].concat(Cle(a.map(function(o,c){return o*c}).slice(1)),[0]);return NF(i,r)}},WM=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0],i=n[1],o=n[2],c=n[3];if(n.length===1)switch(n[0]){case"linear":a=0,i=0,o=1,c=1;break;case"ease":a=.25,i=.1,o=.25,c=1;break;case"ease-in":a=.42,i=0,o=1,c=1;break;case"ease-out":a=.42,i=0,o=.58,c=1;break;case"ease-in-out":a=0,i=0,o=.58,c=1;break;default:{var d=n[0].split("(");if(d[0]==="cubic-bezier"&&d[1].split(")")[0].split(",").length===4){var f=d[1].split(")")[0].split(",").map(function(y){return parseFloat(y)}),h=wle(f,4);a=h[0],i=h[1],o=h[2],c=h[3]}}}var p=UM(a,o),v=UM(i,c),x=Ele(a,o),j=function(S){return S>1?1:S<0?0:S},b=function(S){for(var N=S>1?1:S,_=N,A=0;A<8;++A){var k=p(_)-N,E=x(_);if(Math.abs(k-N)<Lm||E<Lm)return v(_);_=j(_-k/E)}return v(_)};return b.isStepper=!1,b},Ple=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,v){var x=-(h-p)*r,j=v*i,b=v+(x-j)*c/1e3,y=v*c/1e3+h;return Math.abs(y-p)<Lm&&Math.abs(b)<Lm?[p,0]:[y,b]};return d.isStepper=!0,d.dt=c,d},Tle=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 WM(a);case"spring":return Ple();default:if(a.split("(")[0]==="cubic-bezier")return WM(a)}return typeof a=="function"?a:null};function Sf(e){"@babel/helpers - typeof";return Sf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sf(e)}function VM(e){return Mle(e)||Ole(e)||CF(e)||Rle()}function Rle(){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 Ole(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Mle(e){if(Array.isArray(e))return O1(e)}function HM(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 br(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HM(Object(n),!0).forEach(function(r){R1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function R1(e,t,n){return t=Ile(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ile(e){var t=$le(e,"string");return Sf(t)==="symbol"?t:String(t)}function $le(e,t){if(Sf(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Sf(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Dle(e,t){return zle(e)||Fle(e,t)||CF(e,t)||Lle()}function Lle(){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 CF(e,t){if(e){if(typeof e=="string")return O1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return O1(e,t)}}function O1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Fle(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 zle(e){if(Array.isArray(e))return e}var Fm=function(t,n,r){return t+(n-t)*r},M1=function(t){var n=t.from,r=t.to;return n!==r},Ble=function e(t,n,r){var a=Ud(function(i,o){if(M1(o)){var c=t(o.from,o.to,o.velocity),d=Dle(c,2),f=d[0],h=d[1];return br(br({},o),{},{from:f,velocity:h})}return o},n);return r<1?Ud(function(i,o){return M1(o)?br(br({},o),{},{velocity:Fm(o.velocity,a[i].velocity,r),from:Fm(o.from,a[i].from,r)}):o},n):e(t,a,r-1)};const qle=(function(e,t,n,r,a){var i=xle(e,t),o=i.reduce(function(y,S){return br(br({},y),{},R1({},S,[e[S],t[S]]))},{}),c=i.reduce(function(y,S){return br(br({},y),{},R1({},S,{from:e[S],velocity:0,to:t[S]}))},{}),d=-1,f,h,p=function(){return null},v=function(){return Ud(function(S,N){return N.from},c)},x=function(){return!Object.values(c).filter(M1).length},j=function(S){f||(f=S);var N=S-f,_=N/n.dt;c=Ble(n,c,_),a(br(br(br({},e),t),v())),f=S,x()||(d=requestAnimationFrame(p))},b=function(S){h||(h=S);var N=(S-h)/r,_=Ud(function(k,E){return Fm.apply(void 0,VM(E).concat([n(N)]))},o);if(a(br(br(br({},e),t),_)),N<1)d=requestAnimationFrame(p);else{var A=Ud(function(k,E){return Fm.apply(void 0,VM(E).concat([n(1)]))},o);a(br(br(br({},e),t),A))}};return p=n.isStepper?j:b,function(){return requestAnimationFrame(p),function(){cancelAnimationFrame(d)}}});function nu(e){"@babel/helpers - typeof";return nu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nu(e)}var Ule=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function Wle(e,t){if(e==null)return{};var n=Vle(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 Vle(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 _j(e){return Yle(e)||Gle(e)||Kle(e)||Hle()}function Hle(){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 Kle(e,t){if(e){if(typeof e=="string")return I1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return I1(e,t)}}function Gle(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Yle(e){if(Array.isArray(e))return I1(e)}function I1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function KM(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 ia(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KM(Object(n),!0).forEach(function(r){Md(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Md(e,t,n){return t=_F(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qle(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_F(r.key),r)}}function Zle(e,t,n){return t&&Qle(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _F(e){var t=Jle(e,"string");return nu(t)==="symbol"?t:String(t)}function Jle(e,t){if(nu(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(nu(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ece(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$1(e,t)}function $1(e,t){return $1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},$1(e,t)}function tce(e){var t=nce();return function(){var r=zm(e),a;if(t){var i=zm(this).constructor;a=Reflect.construct(r,arguments,i)}else a=r.apply(this,arguments);return D1(this,a)}}function D1(e,t){if(t&&(nu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return L1(e)}function L1(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nce(){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 zm(e){return zm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},zm(e)}var Wa=(function(e){ece(n,e);var t=tce(n);function n(r,a){var i;Xle(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,v=o.children,x=o.duration;if(i.handleStyleChange=i.handleStyleChange.bind(L1(i)),i.changeStyle=i.changeStyle.bind(L1(i)),!c||x<=0)return i.state={style:{}},typeof v=="function"&&(i.state={style:h}),D1(i);if(p&&p.length)i.state={style:p[0].style};else if(f){if(typeof v=="function")return i.state={style:f},D1(i);i.state={style:d?Md({},d,f):f}}else i.state={style:{}};return i}return Zle(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,v=this.state.style;if(c){if(!o){var x={style:d?Md({},d,h):h};this.state&&v&&(d&&v[d]!==h||!d&&v!==h)&&this.setState(x);return}if(!(lle(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&&v){var y={style:d?Md({},d,b):b};(d&&v[d]!==b||!d&&v!==b)&&this.setState(y)}this.runAnimation(ia(ia({},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,v=a.onAnimationStart,x=qle(o,c,Tle(f),d,this.changeStyle),j=function(){i.stopJSAnimation=x()};this.manager.start([v,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,v=p===void 0?0:p,x=function(b,y,S){if(S===0)return b;var N=y.duration,_=y.easing,A=_===void 0?"ease":_,k=y.style,E=y.properties,P=y.onAnimationEnd,R=S>0?o[S-1]:y,M=E||Object.keys(k);if(typeof A=="function"||A==="spring")return[].concat(_j(b),[i.runJSAnimation.bind(i,{from:R.style,to:k,duration:N,easing:A}),N]);var D=qM(M,N,A),U=ia(ia(ia({},R.style),k),{},{transition:D});return[].concat(_j(b),[U,N,P]).filter(yle)};return this.manager.start([d].concat(_j(o.reduce(x,[h,Math.max(v,c)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=mle());var i=a.begin,o=a.duration,c=a.attributeName,d=a.to,f=a.easing,h=a.onAnimationStart,p=a.onAnimationEnd,v=a.steps,x=a.children,j=this.manager;if(this.unSubscribe=j.subscribe(this.handleStyleChange),typeof f=="function"||typeof x=="function"||f==="spring"){this.runJSAnimation(a);return}if(v.length>1){this.runStepAnimation(a);return}var b=c?Md({},c,d):d,y=qM(Object.keys(b),o,f);j.start([h,i,ia(ia({},b),{},{transition:y}),o,p])}},{key:"render",value:function(){var a=this.props,i=a.children;a.begin;var o=a.duration;a.attributeName,a.easing;var c=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var d=Wle(a,Ule),f=m.Children.count(i),h=this.state.style;if(typeof i=="function")return i(h);if(!c||f===0||o<=0)return i;var p=function(x){var j=x.props,b=j.style,y=b===void 0?{}:b,S=j.className,N=m.cloneElement(x,ia(ia({},d),{},{style:ia(ia({},y),h),className:S}));return N};return f===1?p(m.Children.only(i)):X.createElement("div",null,m.Children.map(i,function(v){return p(v)}))}}]),n})(m.PureComponent);Wa.displayName="Animate";Wa.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Wa.propTypes={from:hn.oneOfType([hn.object,hn.string]),to:hn.oneOfType([hn.object,hn.string]),attributeName:hn.string,duration:hn.number,begin:hn.number,easing:hn.oneOfType([hn.string,hn.func]),steps:hn.arrayOf(hn.shape({duration:hn.number.isRequired,style:hn.object.isRequired,easing:hn.oneOfType([hn.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),hn.func]),properties:hn.arrayOf("string"),onAnimationEnd:hn.func})),children:hn.oneOfType([hn.node,hn.func]),isActive:hn.bool,canBegin:hn.bool,onAnimationEnd:hn.func,shouldReAnimate:hn.bool,onAnimationStart:hn.func,onAnimationReStart:hn.func};function Nf(e){"@babel/helpers - typeof";return Nf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nf(e)}function Bm(){return Bm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bm.apply(this,arguments)}function rce(e,t){return oce(e)||ice(e,t)||ace(e,t)||sce()}function sce(){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 ace(e,t){if(e){if(typeof e=="string")return GM(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 GM(e,t)}}function GM(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 ice(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 oce(e){if(Array.isArray(e))return e}function YM(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 XM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YM(Object(n),!0).forEach(function(r){lce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lce(e,t,n){return t=cce(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cce(e){var t=uce(e,"string");return Nf(t)=="symbol"?t:t+""}function uce(e,t){if(Nf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Nf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var QM=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],v=0,x=4;v<x;v++)p[v]=i[v]>o?o:i[v];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},dce=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),v=Math.max(o,o+d);return r>=f&&r<=h&&a>=p&&a<=v}return!1},fce={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},a_=function(t){var n=XM(XM({},fce),t),r=m.useRef(),a=m.useState(-1),i=rce(a,2),o=i[0],c=i[1];m.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var A=r.current.getTotalLength();A&&c(A)}catch{}},[]);var d=n.x,f=n.y,h=n.width,p=n.height,v=n.radius,x=n.className,j=n.animationEasing,b=n.animationDuration,y=n.animationBegin,S=n.isAnimationActive,N=n.isUpdateAnimationActive;if(d!==+d||f!==+f||h!==+h||p!==+p||h===0||p===0)return null;var _=Yt("recharts-rectangle",x);return N?X.createElement(Wa,{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(A){var k=A.width,E=A.height,P=A.x,R=A.y;return X.createElement(Wa,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:b,isActive:S,easing:j},X.createElement("path",Bm({},It(n,!0),{className:_,d:QM(P,R,k,E,v),ref:r})))}):X.createElement("path",Bm({},It(n,!0),{className:_,d:QM(d,f,h,p,v)}))},pce=["points","className","baseLinePoints","connectNulls"];function Ec(){return Ec=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ec.apply(this,arguments)}function hce(e,t){if(e==null)return{};var n=mce(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 mce(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 ZM(e){return yce(e)||xce(e)||vce(e)||gce()}function gce(){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 vce(e,t){if(e){if(typeof e=="string")return F1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return F1(e,t)}}function xce(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function yce(e){if(Array.isArray(e))return F1(e)}function F1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var JM=function(t){return t&&t.x===+t.x&&t.y===+t.y},bce=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){JM(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),JM(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},Wd=function(t,n){var r=bce(t);n&&(r=[r.reduce(function(i,o){return[].concat(ZM(i),ZM(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},wce=function(t,n,r){var a=Wd(t,r);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(Wd(n.reverse(),r).slice(1))},jce=function(t){var n=t.points,r=t.className,a=t.baseLinePoints,i=t.connectNulls,o=hce(t,pce);if(!n||!n.length)return null;var c=Yt("recharts-polygon",r);if(a&&a.length){var d=o.stroke&&o.stroke!=="none",f=wce(n,a,i);return X.createElement("g",{className:c},X.createElement("path",Ec({},It(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:f})),d?X.createElement("path",Ec({},It(o,!0),{fill:"none",d:Wd(n,i)})):null,d?X.createElement("path",Ec({},It(o,!0),{fill:"none",d:Wd(a,i)})):null)}var h=Wd(n,i);return X.createElement("path",Ec({},It(o,!0),{fill:h.slice(-1)==="Z"?o.fill:"none",className:c,d:h}))};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)}var hv=function(t){var n=t.cx,r=t.cy,a=t.r,i=t.className,o=Yt("recharts-dot",i);return n===+n&&r===+r&&a===+a?m.createElement("circle",z1({},It(t,!1),om(t),{className:o,cx:n,cy:r,r:a})):null};function Cf(e){"@babel/helpers - typeof";return Cf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cf(e)}var Sce=["x","y","top","left","width","height","className"];function B1(){return B1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},B1.apply(this,arguments)}function eI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Nce(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eI(Object(n),!0).forEach(function(r){Cce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cce(e,t,n){return t=_ce(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _ce(e){var t=Ace(e,"string");return Cf(t)=="symbol"?t:t+""}function Ace(e,t){if(Cf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Cf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kce(e,t){if(e==null)return{};var n=Ece(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 Ece(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Pce=function(t,n,r,a,i,o){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(o,",").concat(n,"h").concat(r)},Tce=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,v=t.height,x=v===void 0?0:v,j=t.className,b=kce(t,Sce),y=Nce({x:r,y:i,top:c,left:f,width:p,height:x},b);return!at(r)||!at(i)||!at(p)||!at(x)||!at(c)||!at(f)?null:X.createElement("path",B1({},It(y,!0),{className:Yt("recharts-cross",j),d:Pce(r,i,p,x,c,f)}))},Aj,tI;function Rce(){if(tI)return Aj;tI=1;var e=cv(),t=q4(),n=Ga();function r(a,i){return a&&a.length?e(a,n(i,2),t):void 0}return Aj=r,Aj}var Oce=Rce();const Mce=vn(Oce);var kj,nI;function Ice(){if(nI)return kj;nI=1;var e=cv(),t=Ga(),n=U4();function r(a,i){return a&&a.length?e(a,t(i,2),n):void 0}return kj=r,kj}var $ce=Ice();const Dce=vn($ce);var Lce=["cx","cy","angle","ticks","axisLine"],Fce=["ticks","tick","angle","tickFormatter","stroke"];function ru(e){"@babel/helpers - typeof";return ru=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ru(e)}function Vd(){return Vd=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},Vd.apply(this,arguments)}function rI(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 Ko(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rI(Object(n),!0).forEach(function(r){mv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sI(e,t){if(e==null)return{};var n=zce(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 zce(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 Bce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,kF(r.key),r)}}function qce(e,t,n){return t&&aI(e.prototype,t),n&&aI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Uce(e,t,n){return t=qm(t),Wce(e,AF()?Reflect.construct(t,n||[],qm(e).constructor):t.apply(e,n))}function Wce(e,t){if(t&&(ru(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Vce(e)}function Vce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function AF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(AF=function(){return!!e})()}function qm(e){return qm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},qm(e)}function Hce(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&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 mv(e,t,n){return t=kF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kF(e){var t=Kce(e,"string");return ru(t)=="symbol"?t:t+""}function Kce(e,t){if(ru(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ru(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gv=(function(e){function t(){return Bce(this,t),Uce(this,t,arguments)}return Hce(t,e),qce(t,[{key:"getTickValueCoord",value:function(r){var a=r.coordinate,i=this.props,o=i.angle,c=i.cx,d=i.cy;return Cn(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=Mce(c,function(h){return h.coordinate||0}),f=Dce(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=sI(r,Lce),h=c.reduce(function(j,b){return[Math.min(j[0],b.coordinate),Math.max(j[1],b.coordinate)]},[1/0,-1/0]),p=Cn(a,i,h[0],o),v=Cn(a,i,h[1],o),x=Ko(Ko(Ko({},It(f,!1)),{},{fill:"none"},It(d,!1)),{},{x1:p.x,y1:p.y,x2:v.x,y2:v.y});return X.createElement("line",Vd({className:"recharts-polar-radius-axis-line"},x))}},{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=sI(a,Fce),p=this.getTickTextAnchor(),v=It(h,!1),x=It(o,!1),j=i.map(function(b,y){var S=r.getTickValueCoord(b),N=Ko(Ko(Ko(Ko({textAnchor:p,transform:"rotate(".concat(90-c,", ").concat(S.x,", ").concat(S.y,")")},v),{},{stroke:"none",fill:f},x),{},{index:y},S),{},{payload:b});return X.createElement(cn,Vd({className:Yt("recharts-polar-radius-axis-tick",gF(o)),key:"tick-".concat(b.coordinate)},xl(r.props,b,y)),t.renderTickItem(o,N,d?d(b.value,y):b.value))});return X.createElement(cn,{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:X.createElement(cn,{className:Yt("recharts-polar-radius-axis",this.props.className)},i&&this.renderAxisLine(),o&&this.renderTicks(),hr.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(r,a,i){var o;return X.isValidElement(r)?o=X.cloneElement(r,a):Vt(r)?o=r(a):o=X.createElement(yl,Vd({},a,{className:"recharts-polar-radius-axis-tick-value"}),i),o}}])})(m.PureComponent);mv(gv,"displayName","PolarRadiusAxis");mv(gv,"axisType","radiusAxis");mv(gv,"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 su(e){"@babel/helpers - typeof";return su=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},su(e)}function el(){return el=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},el.apply(this,arguments)}function iI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Go(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iI(Object(n),!0).forEach(function(r){vv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Gce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,PF(r.key),r)}}function Yce(e,t,n){return t&&oI(e.prototype,t),n&&oI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Xce(e,t,n){return t=Um(t),Qce(e,EF()?Reflect.construct(t,n||[],Um(e).constructor):t.apply(e,n))}function Qce(e,t){if(t&&(su(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Zce(e)}function Zce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function EF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(EF=function(){return!!e})()}function Um(e){return Um=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Um(e)}function Jce(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&U1(e,t)}function U1(e,t){return U1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},U1(e,t)}function vv(e,t,n){return t=PF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PF(e){var t=eue(e,"string");return su(t)=="symbol"?t:t+""}function eue(e,t){if(su(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(su(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var tue=Math.PI/180,lI=1e-5,xv=(function(e){function t(){return Gce(this,t),Xce(this,t,arguments)}return Jce(t,e),Yce(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=Cn(i,o,c,r.coordinate),v=Cn(i,o,c+(d==="inner"?-1:1)*h,r.coordinate);return{x1:p.x,y1:p.y,x2:v.x,y2:v.y}}},{key:"getTickTextAnchor",value:function(r){var a=this.props.orientation,i=Math.cos(-r.coordinate*tue),o;return i>lI?o=a==="outer"?"start":"end":i<-lI?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=Go(Go({},It(this.props,!1)),{},{fill:"none"},It(c,!1));if(d==="circle")return X.createElement(hv,el({className:"recharts-polar-angle-axis-line"},f,{cx:a,cy:i,r:o}));var h=this.props.ticks,p=h.map(function(v){return Cn(a,i,o,v.coordinate)});return X.createElement(jce,el({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=It(this.props,!1),p=It(o,!1),v=Go(Go({},h),{},{fill:"none"},It(c,!1)),x=i.map(function(j,b){var y=r.getTickLineCoord(j),S=r.getTickTextAnchor(j),N=Go(Go(Go({textAnchor:S},h),{},{stroke:"none",fill:f},p),{},{index:b,payload:j,x:y.x2,y:y.y2});return X.createElement(cn,el({className:Yt("recharts-polar-angle-axis-tick",gF(o)),key:"tick-".concat(j.coordinate)},xl(r.props,j,b)),c&&X.createElement("line",el({className:"recharts-polar-angle-axis-tick-line"},v,y)),o&&t.renderTickItem(o,N,d?d(j.value,b):j.value))});return X.createElement(cn,{className:"recharts-polar-angle-axis-ticks"},x)}},{key:"render",value:function(){var r=this.props,a=r.ticks,i=r.radius,o=r.axisLine;return i<=0||!a||!a.length?null:X.createElement(cn,{className:Yt("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,a,i){var o;return X.isValidElement(r)?o=X.cloneElement(r,a):Vt(r)?o=r(a):o=X.createElement(yl,el({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),o}}])})(m.PureComponent);vv(xv,"displayName","PolarAngleAxis");vv(xv,"axisType","angleAxis");vv(xv,"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 Ej,cI;function nue(){if(cI)return Ej;cI=1;var e=qL(),t=e(Object.getPrototypeOf,Object);return Ej=t,Ej}var Pj,uI;function rue(){if(uI)return Pj;uI=1;var e=Ti(),t=nue(),n=Ri(),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 v=c.call(p,"constructor")&&p.constructor;return typeof v=="function"&&v instanceof v&&o.call(v)==d}return Pj=f,Pj}var sue=rue();const aue=vn(sue);var Tj,dI;function iue(){if(dI)return Tj;dI=1;var e=Ti(),t=Ri(),n="[object Boolean]";function r(a){return a===!0||a===!1||t(a)&&e(a)==n}return Tj=r,Tj}var oue=iue();const lue=vn(oue);function _f(e){"@babel/helpers - typeof";return _f=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},_f(e)}function Wm(){return Wm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wm.apply(this,arguments)}function cue(e,t){return pue(e)||fue(e,t)||due(e,t)||uue()}function uue(){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 due(e,t){if(e){if(typeof e=="string")return fI(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 fI(e,t)}}function fI(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 fue(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 pue(e){if(Array.isArray(e))return e}function pI(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 hI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pI(Object(n),!0).forEach(function(r){hue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hue(e,t,n){return t=mue(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mue(e){var t=gue(e,"string");return _f(t)=="symbol"?t:t+""}function gue(e,t){if(_f(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(_f(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var mI=function(t,n,r,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},vue={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},xue=function(t){var n=hI(hI({},vue),t),r=m.useRef(),a=m.useState(-1),i=cue(a,2),o=i[0],c=i[1];m.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,v=n.height,x=n.className,j=n.animationEasing,b=n.animationDuration,y=n.animationBegin,S=n.isUpdateAnimationActive;if(d!==+d||f!==+f||h!==+h||p!==+p||v!==+v||h===0&&p===0||v===0)return null;var N=Yt("recharts-trapezoid",x);return S?X.createElement(Wa,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:v,x:d,y:f},to:{upperWidth:h,lowerWidth:p,height:v,x:d,y:f},duration:b,animationEasing:j,isActive:S},function(_){var A=_.upperWidth,k=_.lowerWidth,E=_.height,P=_.x,R=_.y;return X.createElement(Wa,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:b,easing:j},X.createElement("path",Wm({},It(n,!0),{className:N,d:mI(P,R,A,k,E),ref:r})))}):X.createElement("g",null,X.createElement("path",Wm({},It(n,!0),{className:N,d:mI(d,f,h,p,v)})))},yue=["option","shapeType","propTransformer","activeClassName","isActive"];function Af(e){"@babel/helpers - typeof";return Af=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Af(e)}function bue(e,t){if(e==null)return{};var n=wue(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 wue(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 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 Vm(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){jue(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 jue(e,t,n){return t=Sue(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sue(e){var t=Nue(e,"string");return Af(t)=="symbol"?t:t+""}function Nue(e,t){if(Af(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Af(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Cue(e,t){return Vm(Vm({},t),e)}function _ue(e,t){return e==="symbols"}function vI(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return X.createElement(a_,n);case"trapezoid":return X.createElement(xue,n);case"sector":return X.createElement(yF,n);case"symbols":if(_ue(t))return X.createElement(NC,n);break;default:return null}}function Aue(e){return m.isValidElement(e)?e.props:e}function TF(e){var t=e.option,n=e.shapeType,r=e.propTransformer,a=r===void 0?Cue:r,i=e.activeClassName,o=i===void 0?"recharts-active-shape":i,c=e.isActive,d=bue(e,yue),f;if(m.isValidElement(t))f=m.cloneElement(t,Vm(Vm({},d),Aue(t)));else if(Vt(t))f=t(d);else if(aue(t)&&!lue(t)){var h=a(t,d);f=X.createElement(vI,{shapeType:n,elementProps:h})}else{var p=d;f=X.createElement(vI,{shapeType:n,elementProps:p})}return c?X.createElement(cn,{className:o},f):f}function yv(e,t){return t!=null&&"trapezoids"in e.props}function bv(e,t){return t!=null&&"sectors"in e.props}function kf(e,t){return t!=null&&"points"in e.props}function kue(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 Eue(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function Pue(e,t){var n=e.x===t.x,r=e.y===t.y,a=e.z===t.z;return n&&r&&a}function Tue(e,t){var n;return yv(e,t)?n=kue:bv(e,t)?n=Eue:kf(e,t)&&(n=Pue),n}function Rue(e,t){var n;return yv(e,t)?n="trapezoids":bv(e,t)?n="sectors":kf(e,t)&&(n="points"),n}function Oue(e,t){if(yv(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}if(bv(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 kf(e,t)?t.payload:{}}function Mue(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,a=Rue(n,t),i=Oue(n,t),o=r.filter(function(d,f){var h=rp(i,d),p=n.props[a].filter(function(j){var b=Tue(n,t);return b(j,t)}),v=n.props[a].indexOf(p[p.length-1]),x=f===v;return h&&x}),c=r.indexOf(o[o.length-1]);return c}var Gh;function au(e){"@babel/helpers - typeof";return au=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},au(e)}function Pc(){return Pc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pc.apply(this,arguments)}function 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 Sn(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){$s(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 Iue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,OF(r.key),r)}}function $ue(e,t,n){return t&&yI(e.prototype,t),n&&yI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Due(e,t,n){return t=Hm(t),Lue(e,RF()?Reflect.construct(t,n||[],Hm(e).constructor):t.apply(e,n))}function Lue(e,t){if(t&&(au(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Fue(e)}function Fue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function RF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(RF=function(){return!!e})()}function Hm(e){return Hm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Hm(e)}function zue(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&W1(e,t)}function W1(e,t){return W1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},W1(e,t)}function $s(e,t,n){return t=OF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OF(e){var t=Bue(e,"string");return au(t)=="symbol"?t:t+""}function Bue(e,t){if(au(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(au(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Mi=(function(e){function t(n){var r;return Iue(this,t),r=Due(this,t,[n]),$s(r,"pieRef",null),$s(r,"sectorRefs",[]),$s(r,"id",Pu("recharts-pie-")),$s(r,"handleAnimationEnd",function(){var a=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),Vt(a)&&a()}),$s(r,"handleAnimationStart",function(){var a=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),Vt(a)&&a()}),r.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},r}return zue(t,e),$ue(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=It(this.props,!1),p=It(o,!1),v=It(c,!1),x=o&&o.offsetRadius||20,j=r.map(function(b,y){var S=(b.startAngle+b.endAngle)/2,N=Cn(b.cx,b.cy,b.outerRadius+x,S),_=Sn(Sn(Sn(Sn({},h),b),{},{stroke:"none"},p),{},{index:y,textAnchor:t.getTextAnchor(N.x,b.cx)},N),A=Sn(Sn(Sn(Sn({},h),b),{},{fill:"none",stroke:b.fill},v),{},{index:y,points:[Cn(b.cx,b.cy,b.outerRadius,S),N]}),k=d;return Ht(d)&&Ht(f)?k="value":Ht(d)&&(k=f),X.createElement(cn,{key:"label-".concat(b.startAngle,"-").concat(b.endAngle,"-").concat(b.midAngle,"-").concat(y)},c&&t.renderLabelLineItem(c,A,"line"),t.renderLabelItem(o,_,rr(b,k)))});return X.createElement(cn,{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),v=d&&a.hasActiveIndex()?d:null,x=p?o:v,j=Sn(Sn({},f),{},{stroke:c?f.fill:f.stroke,tabIndex:-1});return X.createElement(cn,Pc({ref:function(y){y&&!a.sectorRefs.includes(y)&&a.sectorRefs.push(y)},tabIndex:-1,className:"recharts-pie-sector"},xl(a.props,f,h),{key:"sector-".concat(f?.startAngle,"-").concat(f?.endAngle,"-").concat(f.midAngle,"-").concat(h)}),X.createElement(TF,Pc({option:x,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,v=p.prevSectors,x=p.prevIsAnimationActive;return X.createElement(Wa,{begin:c,duration:d,isActive:o,easing:f,from:{t:0},to:{t:1},key:"pie-".concat(h,"-").concat(x),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(j){var b=j.t,y=[],S=i&&i[0],N=S.startAngle;return i.forEach(function(_,A){var k=v&&v[A],E=A>0?bs(_,"paddingAngle",0):0;if(k){var P=gs(k.endAngle-k.startAngle,_.endAngle-_.startAngle),R=Sn(Sn({},_),{},{startAngle:N+E,endAngle:N+P(b)+E});y.push(R),N=R.endAngle}else{var M=_.endAngle,D=_.startAngle,U=gs(0,M-D),F=U(b),G=Sn(Sn({},_),{},{startAngle:N+E,endAngle:N+F+E});y.push(G),N=G.endAngle}}),X.createElement(cn,null,r.renderSectorsStatically(y))})}},{key:"attachKeyboardHandlers",value:function(r){var a=this;r.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var o=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[o].focus(),a.setState({sectorToFocus:o});break}case"ArrowRight":{var c=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[c].focus(),a.setState({sectorToFocus:c});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,a=r.sectors,i=r.isAnimationActive,o=this.state.prevSectors;return i&&a&&a.length&&(!o||!rp(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,v=a.outerRadius,x=a.isAnimationActive,j=this.state.isAnimationFinished;if(i||!o||!o.length||!at(f)||!at(h)||!at(p)||!at(v))return null;var b=Yt("recharts-pie",c);return X.createElement(cn,{tabIndex:this.props.rootTabIndex,className:b,ref:function(S){r.pieRef=S}},this.renderSectors(),d&&this.renderLabels(o),hr.renderCallByParent(this.props,null,!1),(!x||j)&&gi.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(X.isValidElement(r))return X.cloneElement(r,a);if(Vt(r))return r(a);var o=Yt("recharts-pie-label-line",typeof r!="boolean"?r.className:"");return X.createElement($m,Pc({},a,{key:i,type:"linear",className:o}))}},{key:"renderLabelItem",value:function(r,a,i){if(X.isValidElement(r))return X.cloneElement(r,a);var o=i;if(Vt(r)&&(o=r(a),X.isValidElement(o)))return o;var c=Yt("recharts-pie-label-text",typeof r!="boolean"&&!Vt(r)?r.className:"");return X.createElement(yl,Pc({},a,{alignmentBaseline:"middle",className:c}),o)}}])})(m.PureComponent);Gh=Mi;$s(Mi,"displayName","Pie");$s(Mi,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!$l.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});$s(Mi,"parseDeltaAngle",function(e,t){var n=$r(t-e),r=Math.min(Math.abs(t-e),360);return n*r});$s(Mi,"getRealPieData",function(e){var t=e.data,n=e.children,r=It(e,!1),a=ws(n,nv);return t&&t.length?t.map(function(i,o){return Sn(Sn(Sn({payload:i},r),i),a&&a[o]&&a[o].props)}):a&&a.length?a.map(function(i){return Sn(Sn({},r),i.props)}):[]});$s(Mi,"parseCoordinateOfPie",function(e,t){var n=t.top,r=t.left,a=t.width,i=t.height,o=mF(a,i),c=r+Dr(e.cx,a,a/2),d=n+Dr(e.cy,i,i/2),f=Dr(e.innerRadius,o,0),h=Dr(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}});$s(Mi,"getComposedData",function(e){var t=e.item,n=e.offset,r=t.type.defaultProps!==void 0?Sn(Sn({},t.type.defaultProps),t.props):t.props,a=Gh.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,v=r.tooltipType,x=Math.abs(r.minAngle),j=Gh.parseCoordinateOfPie(r,n),b=Gh.parseDeltaAngle(o,c),y=Math.abs(b),S=f;Ht(f)&&Ht(p)?(hi(!1,`Use "dataKey" to specify the value of pie,
|
|
114
|
+
the props "valueKey" will be deprecated in 1.1.0`),S="value"):Ht(f)&&(hi(!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(R){return rr(R,S,0)!==0}).length,_=(y>=360?N:N-1)*d,A=y-N*x-_,k=a.reduce(function(R,M){var D=rr(M,S,0);return R+(at(D)?D:0)},0),E;if(k>0){var P;E=a.map(function(R,M){var D=rr(R,S,0),U=rr(R,h,M),F=(at(D)?D:0)/k,G;M?G=P.endAngle+$r(b)*d*(D!==0?1:0):G=o;var H=G+$r(b)*((D!==0?x:0)+F*A),L=(G+H)/2,I=(j.innerRadius+j.outerRadius)/2,Y=[{name:U,value:D,payload:R,dataKey:S,type:v}],W=Cn(j.cx,j.cy,I,L);return P=Sn(Sn(Sn({percent:F,cornerRadius:i,name:U,tooltipPayload:Y,midAngle:L,middleRadius:I,tooltipPosition:W},R),j),{},{value:rr(R,S),startAngle:G,endAngle:H,payload:R,paddingAngle:$r(b)*d}),P})}return Sn(Sn({},j),{},{sectors:E,data:a})});var Rj,bI;function que(){if(bI)return Rj;bI=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 Rj=n,Rj}var Oj,wI;function MF(){if(wI)return Oj;wI=1;var e=s4(),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 Oj=r,Oj}var Mj,jI;function Uue(){if(jI)return Mj;jI=1;var e=que(),t=tv(),n=MF();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 Mj=r,Mj}var Ij,SI;function Wue(){if(SI)return Ij;SI=1;var e=Uue(),t=e();return Ij=t,Ij}var Vue=Wue();const Km=vn(Vue);function Ef(e){"@babel/helpers - typeof";return Ef=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ef(e)}function 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 CI(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){IF(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 IF(e,t,n){return t=Hue(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hue(e){var t=Kue(e,"string");return Ef(t)=="symbol"?t:t+""}function Kue(e,t){if(Ef(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ef(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Gue=["Webkit","Moz","O","ms"],Yue=function(t,n){var r=t.replace(/(\w)/,function(i){return i.toUpperCase()}),a=Gue.reduce(function(i,o){return CI(CI({},i),{},IF({},o+r,n))},{});return a[t]=n,a};function iu(e){"@babel/helpers - typeof";return iu=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},iu(e)}function Gm(){return Gm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gm.apply(this,arguments)}function _I(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 $j(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_I(Object(n),!0).forEach(function(r){ps(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_I(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function AI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,DF(r.key),r)}}function Que(e,t,n){return t&&AI(e.prototype,t),n&&AI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Zue(e,t,n){return t=Ym(t),Jue(e,$F()?Reflect.construct(t,n||[],Ym(e).constructor):t.apply(e,n))}function Jue(e,t){if(t&&(iu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ede(e)}function ede(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $F(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($F=function(){return!!e})()}function Ym(e){return Ym=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ym(e)}function tde(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&V1(e,t)}function V1(e,t){return V1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},V1(e,t)}function ps(e,t,n){return t=DF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DF(e){var t=nde(e,"string");return iu(t)=="symbol"?t:t+""}function nde(e,t){if(iu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(iu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var rde=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=Bd().domain(Km(0,d)).range([i,i+o-c]),h=f.domain().map(function(p){return f(p)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:f(r),endX:f(a),scale:f,scaleValues:h}},kI=function(t){return t.changedTouches&&!!t.changedTouches.length},ou=(function(e){function t(n){var r;return Xue(this,t),r=Zue(this,t,[n]),ps(r,"handleDrag",function(a){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(a):r.state.isSlideMoving&&r.handleSlideDrag(a)}),ps(r,"handleTouchMove",function(a){a.changedTouches!=null&&a.changedTouches.length>0&&r.handleDrag(a.changedTouches[0])}),ps(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()}),ps(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),ps(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),ps(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),ps(r,"handleSlideDragStart",function(a){var i=kI(a)?a.changedTouches[0]:a;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return tde(t,e),Que(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),v=Math.max(a,i),x=t.getIndexInRange(o,p),j=t.getIndexInRange(o,v);return{startIndex:x-x%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=rr(i[r],c,r);return Vt(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,v=d.startIndex,x=d.endIndex,j=d.onChange,b=r.pageX-i;b>0?b=Math.min(b,f+h-p-c,f+h-p-o):b<0&&(b=Math.max(b,f-o,f-c));var y=this.getIndex({startX:o+b,endX:c+b});(y.startIndex!==v||y.endIndex!==x)&&j&&j(y),this.setState({startX:o+b,endX:c+b,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,a){var i=kI(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var a=this.state,i=a.brushMoveStartX,o=a.movingTravellerId,c=a.endX,d=a.startX,f=this.state[o],h=this.props,p=h.x,v=h.width,x=h.travellerWidth,j=h.onChange,b=h.gap,y=h.data,S={startX:this.state.startX,endX:this.state.endX},N=r.pageX-i;N>0?N=Math.min(N,p+v-x-f):N<0&&(N=Math.max(N,p-f)),S[o]=f+N;var _=this.getIndex(S),A=_.startIndex,k=_.endIndex,E=function(){var R=y.length-1;return o==="startX"&&(c>d?A%b===0:k%b===0)||c<d&&k===R||o==="endX"&&(c>d?k%b===0:A%b===0)||c>d&&k===R};this.setState(ps(ps({},o,f+N),"brushMoveStartX",r.pageX),function(){j&&E()&&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 v=p+r;if(!(v===-1||v>=c.length)){var x=c[v];a==="startX"&&x>=f||a==="endX"&&x<=d||this.setState(ps({},a,x),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 X.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=m.Children.only(f);return p?X.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,v=d.traveller,x=d.ariaLabel,j=d.data,b=d.startIndex,y=d.endIndex,S=Math.max(r,this.props.x),N=$j($j({},It(this.props,!1)),{},{x:S,y:f,width:h,height:p}),_=x||"Min value: ".concat((i=j[b])===null||i===void 0?void 0:i.name,", Max value: ").concat((o=j[y])===null||o===void 0?void 0:o.name);return X.createElement(cn,{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(k){["ArrowLeft","ArrowRight"].includes(k.key)&&(k.preventDefault(),k.stopPropagation(),c.handleTravellerMoveKeyboard(k.key==="ArrowRight"?1:-1,a))},onFocus:function(){c.setState({isTravellerFocused:!0})},onBlur:function(){c.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(v,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 X.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,v=h.endX,x=5,j={pointerEvents:"none",fill:f};return X.createElement(cn,{className:"recharts-brush-texts"},X.createElement(yl,Gm({textAnchor:"end",verticalAnchor:"middle",x:Math.min(p,v)-x,y:o+c/2},j),this.getTextOfTick(a)),X.createElement(yl,Gm({textAnchor:"start",verticalAnchor:"middle",x:Math.max(p,v)+d+x,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,v=this.state,x=v.startX,j=v.endX,b=v.isTextActive,y=v.isSlideMoving,S=v.isTravellerMoving,N=v.isTravellerFocused;if(!a||!a.length||!at(c)||!at(d)||!at(f)||!at(h)||f<=0||h<=0)return null;var _=Yt("recharts-brush",i),A=X.Children.count(o)===1,k=Yue("userSelect","none");return X.createElement(cn,{className:_,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:k},this.renderBackground(),A&&this.renderPanorama(),this.renderSlide(x,j),this.renderTravellerLayer(x,"startX"),this.renderTravellerLayer(j,"endX"),(b||y||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 X.createElement(X.Fragment,null,X.createElement("rect",{x:a,y:i,width:o,height:c,fill:d,stroke:"none"}),X.createElement("line",{x1:a+1,y1:f,x2:a+o-1,y2:f,fill:"none",stroke:"#fff"}),X.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 X.isValidElement(r)?i=X.cloneElement(r,a):Vt(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 $j({prevData:i,prevTravellerWidth:d,prevUpdateId:f,prevX:c,prevWidth:o},i&&i.length?rde({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 v=a.scale.domain().map(function(x){return a.scale(x)});return{prevData:i,prevTravellerWidth:d,prevUpdateId:f,prevX:c,prevWidth:o,startX:a.scale(r.startIndex),endX:a.scale(r.endIndex),scaleValues:v}}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}}])})(m.PureComponent);ps(ou,"displayName","Brush");ps(ou,"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 Dj,EI;function sde(){if(EI)return Dj;EI=1;var e=TC();function t(n,r){var a;return e(n,function(i,o,c){return a=r(i,o,c),!a}),!!a}return Dj=t,Dj}var Lj,PI;function ade(){if(PI)return Lj;PI=1;var e=IL(),t=Ga(),n=sde(),r=as(),a=tv();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 Lj=i,Lj}var ide=ade();const ode=vn(ide);var Fa=function(t,n){var r=t.alwaysShow,a=t.ifOverflow;return r&&(a="extendDomain"),a===n},Fj,TI;function lde(){if(TI)return Fj;TI=1;var e=JL();function t(n,r,a){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):n[r]=a}return Fj=t,Fj}var zj,RI;function cde(){if(RI)return zj;RI=1;var e=lde(),t=QL(),n=Ga();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 zj=r,zj}var ude=cde();const dde=vn(ude);var Bj,OI;function fde(){if(OI)return Bj;OI=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 Bj=e,Bj}var qj,MI;function pde(){if(MI)return qj;MI=1;var e=TC();function t(n,r){var a=!0;return e(n,function(i,o,c){return a=!!r(i,o,c),a}),a}return qj=t,qj}var Uj,II;function hde(){if(II)return Uj;II=1;var e=fde(),t=pde(),n=Ga(),r=as(),a=tv();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 Uj=i,Uj}var mde=hde();const gde=vn(mde);var vde=["x","y"];function Pf(e){"@babel/helpers - typeof";return Pf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pf(e)}function H1(){return H1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},H1.apply(this,arguments)}function $I(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 kd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$I(Object(n),!0).forEach(function(r){xde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$I(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xde(e,t,n){return t=yde(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yde(e){var t=bde(e,"string");return Pf(t)=="symbol"?t:t+""}function bde(e,t){if(Pf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Pf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wde(e,t){if(e==null)return{};var n=jde(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 jde(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 Sde(e,t){var n=e.x,r=e.y,a=wde(e,vde),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),v=parseInt(p,10);return kd(kd(kd(kd(kd({},t),a),o?{x:o}:{}),d?{y:d}:{}),{},{height:h,width:v,name:t.name,radius:t.radius})}function DI(e){return X.createElement(TF,H1({shapeType:"rectangle",propTransformer:Sde,activeClassName:"recharts-active-bar"},e))}var Nde=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=at(r)||UQ(r);return i?t(r,a):(i||wl(),n)}},Cde=["value","background"],LF;function lu(e){"@babel/helpers - typeof";return lu=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},lu(e)}function _de(e,t){if(e==null)return{};var n=Ade(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 Ade(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 Xm(){return Xm=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},Xm.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 Xn(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){co(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 kde(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,zF(r.key),r)}}function Ede(e,t,n){return t&&FI(e.prototype,t),n&&FI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pde(e,t,n){return t=Qm(t),Tde(e,FF()?Reflect.construct(t,n||[],Qm(e).constructor):t.apply(e,n))}function Tde(e,t){if(t&&(lu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Rde(e)}function Rde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function FF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(FF=function(){return!!e})()}function Qm(e){return Qm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Qm(e)}function Ode(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&K1(e,t)}function K1(e,t){return K1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},K1(e,t)}function co(e,t,n){return t=zF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zF(e){var t=Mde(e,"string");return lu(t)=="symbol"?t:t+""}function Mde(e,t){if(lu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(lu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var zl=(function(e){function t(){var n;kde(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=Pde(this,t,[].concat(a)),co(n,"state",{isAnimationFinished:!1}),co(n,"id",Pu("recharts-bar-")),co(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),o&&o()}),co(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),o&&o()}),n}return Ode(t,e),Ede(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=It(this.props,!1);return r&&r.map(function(p,v){var x=v===d,j=x?f:o,b=Xn(Xn(Xn({},h),p),{},{isActive:x,option:j,index:v,dataKey:c,onAnimationStart:a.handleAnimationStart,onAnimationEnd:a.handleAnimationEnd});return X.createElement(cn,Xm({className:"recharts-bar-rectangle"},xl(a.props,p,v),{key:"rectangle-".concat(p?.x,"-").concat(p?.y,"-").concat(p?.value,"-").concat(v)}),X.createElement(DI,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,v=this.state.prevData;return X.createElement(Wa,{begin:d,duration:f,isActive:c,easing:h,from:{t:0},to:{t:1},key:"bar-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(x){var j=x.t,b=i.map(function(y,S){var N=v&&v[S];if(N){var _=gs(N.x,y.x),A=gs(N.y,y.y),k=gs(N.width,y.width),E=gs(N.height,y.height);return Xn(Xn({},y),{},{x:_(j),y:A(j),width:k(j),height:E(j)})}if(o==="horizontal"){var P=gs(0,y.height),R=P(j);return Xn(Xn({},y),{},{y:y.y+y.height-R,height:R})}var M=gs(0,y.width),D=M(j);return Xn(Xn({},y),{},{width:D})});return X.createElement(cn,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||!rp(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=It(this.props.background,!1);return i.map(function(f,h){f.value;var p=f.background,v=_de(f,Cde);if(!p)return null;var x=Xn(Xn(Xn(Xn(Xn({},v),{},{fill:"#eee"},p),d),xl(r.props,f,h)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:o,index:h,className:"recharts-bar-background-rectangle"});return X.createElement(DI,Xm({key:"background-bar-".concat(h),option:r.props.background,isActive:h===c},x))})}},{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=ws(h,sp);if(!p)return null;var v=f==="vertical"?o[0].height/2:o[0].width/2,x=function(y,S){var N=Array.isArray(y.value)?y.value[1]:y.value;return{x:y.x,y:y.y,value:N,errorVal:rr(y,S)}},j={clipPath:r?"url(#clipPath-".concat(a,")"):null};return X.createElement(cn,j,p.map(function(b){return X.cloneElement(b,{key:"error-bar-".concat(a,"-").concat(b.props.dataKey),data:o,xAxis:c,yAxis:d,layout:f,offset:v,dataPointFormatter:x})}))}},{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,v=r.height,x=r.isAnimationActive,j=r.background,b=r.id;if(a||!i||!i.length)return null;var y=this.state.isAnimationFinished,S=Yt("recharts-bar",o),N=c&&c.allowDataOverflow,_=d&&d.allowDataOverflow,A=N||_,k=Ht(b)?this.id:b;return X.createElement(cn,{className:S},N||_?X.createElement("defs",null,X.createElement("clipPath",{id:"clipPath-".concat(k)},X.createElement("rect",{x:N?f:f-p/2,y:_?h:h-v/2,width:N?p:p*2,height:_?v:v*2}))):null,X.createElement(cn,{className:"recharts-bar-rectangles",clipPath:A?"url(#clipPath-".concat(k,")"):null},j?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(A,k),(!x||y)&&gi.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}}])})(m.PureComponent);LF=zl;co(zl,"displayName","Bar");co(zl,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!$l.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});co(zl,"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,v=e.offset,x=sie(r,n);if(!x)return null;var j=t.layout,b=n.type.defaultProps,y=b!==void 0?Xn(Xn({},b),n.props):n.props,S=y.dataKey,N=y.children,_=y.minPointSize,A=j==="horizontal"?o:i,k=f?A.scale.domain():null,E=die({numericAxis:A}),P=ws(N,nv),R=p.map(function(M,D){var U,F,G,H,L,I;f?U=aie(f[h+D],k):(U=rr(M,S),Array.isArray(U)||(U=[E,U]));var Y=Nde(_,LF.defaultProps.minPointSize)(U[1],D);if(j==="horizontal"){var W,O=[o.scale(U[0]),o.scale(U[1])],Q=O[0],q=O[1];F=pM({axis:i,ticks:c,bandSize:a,offset:x.offset,entry:M,index:D}),G=(W=q??Q)!==null&&W!==void 0?W:void 0,H=x.size;var z=Q-q;if(L=Number.isNaN(z)?0:z,I={x:F,y:o.y,width:H,height:o.height},Math.abs(Y)>0&&Math.abs(L)<Math.abs(Y)){var K=$r(L||Y)*(Math.abs(Y)-Math.abs(L));G-=K,L+=K}}else{var J=[i.scale(U[0]),i.scale(U[1])],ne=J[0],he=J[1];if(F=ne,G=pM({axis:o,ticks:d,bandSize:a,offset:x.offset,entry:M,index:D}),H=he-ne,L=x.size,I={x:i.x,y:G,width:i.width,height:L},Math.abs(Y)>0&&Math.abs(H)<Math.abs(Y)){var ie=$r(H||Y)*(Math.abs(Y)-Math.abs(H));H+=ie}}return Xn(Xn(Xn({},M),{},{x:F,y:G,width:H,height:L,value:f?U:U[1],payload:M,background:I},P&&P[D]&&P[D].props),{},{tooltipPayload:[pF(n,M)],tooltipPosition:{x:F+H/2,y:G+L/2}})});return Xn({data:R,layout:j},v)});function Tf(e){"@babel/helpers - typeof";return Tf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tf(e)}function Ide(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,BF(r.key),r)}}function $de(e,t,n){return t&&zI(e.prototype,t),n&&zI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function BI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ca(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BI(Object(n),!0).forEach(function(r){wv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wv(e,t,n){return t=BF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BF(e){var t=Dde(e,"string");return Tf(t)=="symbol"?t:t+""}function Dde(e,t){if(Tf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Tf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var qF=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},v=!!hs(f,zl);return h.reduce(function(x,j){var b=n[j],y=b.orientation,S=b.domain,N=b.padding,_=N===void 0?{}:N,A=b.mirror,k=b.reversed,E="".concat(y).concat(A?"Mirror":""),P,R,M,D,U;if(b.type==="number"&&(b.padding==="gap"||b.padding==="no-gap")){var F=S[1]-S[0],G=1/0,H=b.categoricalDomain.sort(HQ);if(H.forEach(function(J,ne){ne>0&&(G=Math.min((J||0)-(H[ne-1]||0),G))}),Number.isFinite(G)){var L=G/F,I=b.layout==="vertical"?r.height:r.width;if(b.padding==="gap"&&(P=L*I/2),b.padding==="no-gap"){var Y=Dr(t.barCategoryGap,L*I),W=L*I/2;P=W-Y-(W-Y)/I*Y}}}a==="xAxis"?R=[r.left+(_.left||0)+(P||0),r.left+r.width-(_.right||0)-(P||0)]:a==="yAxis"?R=d==="horizontal"?[r.top+r.height-(_.bottom||0),r.top+(_.top||0)]:[r.top+(_.top||0)+(P||0),r.top+r.height-(_.bottom||0)-(P||0)]:R=b.range,k&&(R=[R[1],R[0]]);var O=cF(b,i,v),Q=O.scale,q=O.realScaleType;Q.domain(S).range(R),uF(Q);var z=dF(Q,ca(ca({},b),{},{realScaleType:q}));a==="xAxis"?(U=y==="top"&&!A||y==="bottom"&&A,M=r.left,D=p[E]-U*b.height):a==="yAxis"&&(U=y==="left"&&!A||y==="right"&&A,M=p[E]-U*b.width,D=r.top);var K=ca(ca(ca({},b),z),{},{realScaleType:q,x:M,y:D,scale:Q,width:a==="xAxis"?r.width:b.width,height:a==="yAxis"?r.height:b.height});return K.bandSize=Om(K,z),!b.hide&&a==="xAxis"?p[E]+=(U?-1:1)*K.height:b.hide||(p[E]+=(U?-1:1)*K.width),ca(ca({},x),{},wv({},j,K))},{})},UF=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)}},Lde=function(t){var n=t.x1,r=t.y1,a=t.x2,i=t.y2;return UF({x:n,y:r},{x:a,y:i})},WF=(function(){function e(t){Ide(this,e),this.scale=t}return $de(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)}}])})();wv(WF,"EPS",1e-4);var i_=function(t){var n=Object.keys(t).reduce(function(r,a){return ca(ca({},r),{},wv({},a,WF.create(t[a])))},{});return ca(ca({},n),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.bandAware,c=i.position;return dde(a,function(d,f){return n[f].apply(d,{bandAware:o,position:c})})},isInRange:function(a){return gde(a,function(i,o){return n[o].isInRange(i)})}})};function Fde(e){return(e%180+180)%180}var zde=function(t){var n=t.width,r=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=Fde(a),o=i*Math.PI/180,c=Math.atan(r/n),d=o>c&&o<Math.PI-c?r/Math.sin(o):n/Math.cos(o);return Math.abs(d)},Wj,qI;function Bde(){if(qI)return Wj;qI=1;var e=Ga(),t=Zf(),n=Jg();function r(a){return function(i,o,c){var d=Object(i);if(!t(i)){var f=e(o,3);i=n(i),o=function(p){return f(d[p],p,d)}}var h=a(i,o,c);return h>-1?d[f?i[h]:h]:void 0}}return Wj=r,Wj}var Vj,UI;function qde(){if(UI)return Vj;UI=1;var e=MF();function t(n){var r=e(n),a=r%1;return r===r?a?r-a:r:0}return Vj=t,Vj}var Hj,WI;function Ude(){if(WI)return Hj;WI=1;var e=HL(),t=Ga(),n=qde(),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 Hj=a,Hj}var Kj,VI;function Wde(){if(VI)return Kj;VI=1;var e=Bde(),t=Ude(),n=e(t);return Kj=n,Kj}Wde();var Vde=lL();const Hde=vn(Vde);var Kde=Hde(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("")}),VF=m.createContext(void 0),HF=m.createContext(void 0),KF=m.createContext(void 0),Gde=m.createContext({}),GF=m.createContext(void 0),YF=m.createContext(0),XF=m.createContext(0),HI=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=Kde(i);return X.createElement(VF.Provider,{value:r},X.createElement(HF.Provider,{value:a},X.createElement(Gde.Provider,{value:i},X.createElement(KF.Provider,{value:h},X.createElement(GF.Provider,{value:o},X.createElement(YF.Provider,{value:f},X.createElement(XF.Provider,{value:d},c)))))))},Yde=function(){return m.useContext(GF)},QF=function(t){var n=m.useContext(VF);n==null&&wl();var r=n[t];return r==null&&wl(),r},ZF=function(t){var n=m.useContext(HF);n==null&&wl();var r=n[t];return r==null&&wl(),r},Xde=function(){var t=m.useContext(KF);return t},JF=function(){return m.useContext(XF)},ez=function(){return m.useContext(YF)};function cu(e){"@babel/helpers - typeof";return cu=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},cu(e)}function Qde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zde(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,nz(r.key),r)}}function Jde(e,t,n){return t&&Zde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function efe(e,t,n){return t=Zm(t),tfe(e,tz()?Reflect.construct(t,n||[],Zm(e).constructor):t.apply(e,n))}function tfe(e,t){if(t&&(cu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return nfe(e)}function nfe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(tz=function(){return!!e})()}function Zm(e){return Zm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Zm(e)}function rfe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&G1(e,t)}function G1(e,t){return G1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},G1(e,t)}function KI(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 GI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KI(Object(n),!0).forEach(function(r){o_(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function o_(e,t,n){return t=nz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nz(e){var t=sfe(e,"string");return cu(t)=="symbol"?t:t+""}function sfe(e,t){if(cu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(cu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function afe(e,t){return cfe(e)||lfe(e,t)||ofe(e,t)||ife()}function ife(){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 ofe(e,t){if(e){if(typeof e=="string")return YI(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return YI(e,t)}}function YI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function lfe(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 cfe(e){if(Array.isArray(e))return 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)}var ufe=function(t,n){var r;return X.isValidElement(t)?r=X.cloneElement(t,n):Vt(t)?r=t(n):r=X.createElement("line",Y1({},n,{className:"recharts-reference-line-line"})),r},dfe=function(t,n,r,a,i,o,c,d,f){var h=i.x,p=i.y,v=i.width,x=i.height;if(r){var j=f.y,b=t.y.apply(j,{position:o});if(Fa(f,"discard")&&!t.y.isInRange(b))return null;var y=[{x:h+v,y:b},{x:h,y:b}];return d==="left"?y.reverse():y}if(n){var S=f.x,N=t.x.apply(S,{position:o});if(Fa(f,"discard")&&!t.x.isInRange(N))return null;var _=[{x:N,y:p+x},{x:N,y:p}];return c==="top"?_.reverse():_}if(a){var A=f.segment,k=A.map(function(E){return t.apply(E,{position:o})});return Fa(f,"discard")&&ode(k,function(E){return!t.isInRange(E)})?null:k}return null};function ffe(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=Yde(),h=QF(a),p=ZF(i),v=Xde();if(!f||!v)return null;hi(d===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var x=i_({x:h.scale,y:p.scale}),j=sr(t),b=sr(n),y=r&&r.length===2,S=dfe(x,j,b,y,v,e.position,h.orientation,p.orientation,e);if(!S)return null;var N=afe(S,2),_=N[0],A=_.x,k=_.y,E=N[1],P=E.x,R=E.y,M=Fa(e,"hidden")?"url(#".concat(f,")"):void 0,D=GI(GI({clipPath:M},It(e,!0)),{},{x1:A,y1:k,x2:P,y2:R});return X.createElement(cn,{className:Yt("recharts-reference-line",c)},ufe(o,D),hr.renderCallByParent(e,Lde({x1:A,y1:k,x2:P,y2:R})))}var l_=(function(e){function t(){return Qde(this,t),efe(this,t,arguments)}return rfe(t,e),Jde(t,[{key:"render",value:function(){return X.createElement(ffe,this.props)}}])})(X.Component);o_(l_,"displayName","ReferenceLine");o_(l_,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function X1(){return X1=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},X1.apply(this,arguments)}function uu(e){"@babel/helpers - typeof";return uu=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},uu(e)}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 QI(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){jv(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 pfe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hfe(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,sz(r.key),r)}}function mfe(e,t,n){return t&&hfe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function gfe(e,t,n){return t=Jm(t),vfe(e,rz()?Reflect.construct(t,n||[],Jm(e).constructor):t.apply(e,n))}function vfe(e,t){if(t&&(uu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xfe(e)}function xfe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(rz=function(){return!!e})()}function Jm(e){return Jm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Jm(e)}function yfe(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 jv(e,t,n){return t=sz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sz(e){var t=bfe(e,"string");return uu(t)=="symbol"?t:t+""}function bfe(e,t){if(uu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(uu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var wfe=function(t){var n=t.x,r=t.y,a=t.xAxis,i=t.yAxis,o=i_({x:a.scale,y:i.scale}),c=o.apply({x:n,y:r},{bandAware:!0});return Fa(t,"discard")&&!o.isInRange(c)?null:c},Sv=(function(e){function t(){return pfe(this,t),gfe(this,t,arguments)}return yfe(t,e),mfe(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=sr(a),h=sr(i);if(hi(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!f||!h)return null;var p=wfe(this.props);if(!p)return null;var v=p.x,x=p.y,j=this.props,b=j.shape,y=j.className,S=Fa(this.props,"hidden")?"url(#".concat(d,")"):void 0,N=QI(QI({clipPath:S},It(this.props,!0)),{},{cx:v,cy:x});return X.createElement(cn,{className:Yt("recharts-reference-dot",y)},t.renderDot(b,N),hr.renderCallByParent(this.props,{x:v-o,y:x-o,width:2*o,height:2*o}))}}])})(X.Component);jv(Sv,"displayName","ReferenceDot");jv(Sv,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});jv(Sv,"renderDot",function(e,t){var n;return X.isValidElement(e)?n=X.cloneElement(e,t):Vt(e)?n=e(t):n=X.createElement(hv,X1({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});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 du(e){"@babel/helpers - typeof";return du=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},du(e)}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 JI(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){Nv(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 jfe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sfe(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,iz(r.key),r)}}function Nfe(e,t,n){return t&&Sfe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Cfe(e,t,n){return t=eg(t),_fe(e,az()?Reflect.construct(t,n||[],eg(e).constructor):t.apply(e,n))}function _fe(e,t){if(t&&(du(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Afe(e)}function Afe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function az(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(az=function(){return!!e})()}function eg(e){return eg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},eg(e)}function kfe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&J1(e,t)}function J1(e,t){return J1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},J1(e,t)}function Nv(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=Efe(e,"string");return du(t)=="symbol"?t:t+""}function Efe(e,t){if(du(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(du(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Pfe=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 v=i_({x:h.scale,y:p.scale}),x={x:t?v.x.apply(o,{position:"start"}):v.x.rangeMin,y:r?v.y.apply(d,{position:"start"}):v.y.rangeMin},j={x:n?v.x.apply(c,{position:"end"}):v.x.rangeMax,y:a?v.y.apply(f,{position:"end"}):v.y.rangeMax};return Fa(i,"discard")&&(!v.isInRange(x)||!v.isInRange(j))?null:UF(x,j)},Cv=(function(e){function t(){return jfe(this,t),Cfe(this,t,arguments)}return kfe(t,e),Nfe(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;hi(f===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=sr(a),v=sr(i),x=sr(o),j=sr(c),b=this.props.shape;if(!p&&!v&&!x&&!j&&!b)return null;var y=Pfe(p,v,x,j,this.props);if(!y&&!b)return null;var S=Fa(this.props,"hidden")?"url(#".concat(h,")"):void 0;return X.createElement(cn,{className:Yt("recharts-reference-area",d)},t.renderRect(b,JI(JI({clipPath:S},It(this.props,!0)),y)),hr.renderCallByParent(this.props,y))}}])})(X.Component);Nv(Cv,"displayName","ReferenceArea");Nv(Cv,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});Nv(Cv,"renderRect",function(e,t){var n;return X.isValidElement(e)?n=X.cloneElement(e,t):Vt(e)?n=e(t):n=X.createElement(a_,Z1({},t,{className:"recharts-reference-area-rect"})),n});function oz(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 Tfe(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return zde(r,n)}function Rfe(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 tg(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 Ofe(e,t){return oz(e,t+1)}function Mfe(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:oz(r,f)};var b=d,y,S=function(){return y===void 0&&(y=n(j,b)),y},N=j.coordinate,_=d===0||tg(e,N,S,h,c);_||(d=0,h=o,f+=1),_&&(h=N+e*(S()/2+a),d+=f)},v;f<=i.length;)if(v=p(),v)return v.v;return[]}function Rf(e){"@babel/helpers - typeof";return Rf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rf(e)}function e$(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 kr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?e$(Object(n),!0).forEach(function(r){Ife(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ife(e,t,n){return t=$fe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $fe(e){var t=Dfe(e,"string");return Rf(t)=="symbol"?t:t+""}function Dfe(e,t){if(Rf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Rf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Lfe(e,t,n,r,a){for(var i=(r||[]).slice(),o=i.length,c=t.start,d=t.end,f=function(v){var x=i[v],j,b=function(){return j===void 0&&(j=n(x,v)),j};if(v===o-1){var y=e*(x.coordinate+e*b()/2-d);i[v]=x=kr(kr({},x),{},{tickCoord:y>0?x.coordinate-y*e:x.coordinate})}else i[v]=x=kr(kr({},x),{},{tickCoord:x.coordinate});var S=tg(e,x.tickCoord,b,c,d);S&&(d=x.tickCoord-e*(b()/2+a),i[v]=kr(kr({},x),{},{isShow:!0}))},h=o-1;h>=0;h--)f(h);return i}function Ffe(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),v=e*(h.coordinate+e*p/2-f);o[c-1]=h=kr(kr({},h),{},{tickCoord:v>0?h.coordinate-v*e:h.coordinate});var x=tg(e,h.tickCoord,function(){return p},d,f);x&&(f=h.tickCoord-e*(p/2+a),o[c-1]=kr(kr({},h),{},{isShow:!0}))}for(var j=i?c-1:c,b=function(N){var _=o[N],A,k=function(){return A===void 0&&(A=n(_,N)),A};if(N===0){var E=e*(_.coordinate-e*k()/2-d);o[N]=_=kr(kr({},_),{},{tickCoord:E<0?_.coordinate-E*e:_.coordinate})}else o[N]=_=kr(kr({},_),{},{tickCoord:_.coordinate});var P=tg(e,_.tickCoord,k,d,f);P&&(d=_.tickCoord+e*(k()/2+a),o[N]=kr(kr({},_),{},{isShow:!0}))},y=0;y<j;y++)b(y);return o}function zfe(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(at(d)||$l.isSsr)return Ofe(a,typeof d=="number"&&at(d)?d:0);var v=[],x=c==="top"||c==="bottom"?"width":"height",j=h&&x==="width"?zd(h,{fontSize:t,letterSpacing:n}):{width:0,height:0},b=function(_,A){var k=Vt(f)?f(_.value,A):_.value;return x==="width"?Tfe(zd(k,{fontSize:t,letterSpacing:n}),j,p):zd(k,{fontSize:t,letterSpacing:n})[x]},y=a.length>=2?$r(a[1].coordinate-a[0].coordinate):1,S=Rfe(i,y,x);return d==="equidistantPreserveStart"?Mfe(y,S,b,a,o):(d==="preserveStart"||d==="preserveStartEnd"?v=Ffe(y,S,b,a,o,d==="preserveStartEnd"):v=Lfe(y,S,b,a,o),v.filter(function(N){return N.isShow}))}var Bfe=["viewBox"],qfe=["viewBox"],Ufe=["ticks"];function fu(e){"@babel/helpers - typeof";return fu=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},fu(e)}function Tc(){return Tc=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},Tc.apply(this,arguments)}function t$(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 tr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?t$(Object(n),!0).forEach(function(r){c_(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Gj(e,t){if(e==null)return{};var n=Wfe(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 Wfe(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 Vfe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n$(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,cz(r.key),r)}}function Hfe(e,t,n){return t&&n$(e.prototype,t),n&&n$(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Kfe(e,t,n){return t=ng(t),Gfe(e,lz()?Reflect.construct(t,n||[],ng(e).constructor):t.apply(e,n))}function Gfe(e,t){if(t&&(fu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Yfe(e)}function Yfe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(lz=function(){return!!e})()}function ng(e){return ng=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ng(e)}function Xfe(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&&eN(e,t)}function eN(e,t){return eN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},eN(e,t)}function c_(e,t,n){return t=cz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cz(e){var t=Qfe(e,"string");return fu(t)=="symbol"?t:t+""}function Qfe(e,t){if(fu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(fu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var _v=(function(e){function t(n){var r;return Vfe(this,t),r=Kfe(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return Xfe(t,e),Hfe(t,[{key:"shouldComponentUpdate",value:function(r,a){var i=r.viewBox,o=Gj(r,Bfe),c=this.props,d=c.viewBox,f=Gj(c,qfe);return!Dc(i,d)||!Dc(o,f)||!Dc(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,v=a.tickMargin,x,j,b,y,S,N,_=p?-1:1,A=r.tickSize||h,k=at(r.tickCoord)?r.tickCoord:r.coordinate;switch(f){case"top":x=j=r.coordinate,y=o+ +!p*d,b=y-_*A,N=b-_*v,S=k;break;case"left":b=y=r.coordinate,j=i+ +!p*c,x=j-_*A,S=x-_*v,N=k;break;case"right":b=y=r.coordinate,j=i+ +p*c,x=j+_*A,S=x+_*v,N=k;break;default:x=j=r.coordinate,y=o+ +p*d,b=y+_*A,N=b+_*v,S=k;break}return{line:{x1:x,y1:b,x2:j,y2:y},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=tr(tr(tr({},It(this.props,!1)),It(h,!1)),{},{fill:"none"});if(d==="top"||d==="bottom"){var v=+(d==="top"&&!f||d==="bottom"&&f);p=tr(tr({},p),{},{x1:a,y1:i+v*c,x2:a+o,y2:i+v*c})}else{var x=+(d==="left"&&!f||d==="right"&&f);p=tr(tr({},p),{},{x1:a+x*o,y1:i,x2:a+x*o,y2:i+c})}return X.createElement("line",Tc({},p,{className:Yt("recharts-cartesian-axis-line",bs(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,v=c.unit,x=zfe(tr(tr({},this.props),{},{ticks:r}),a,i),j=this.getTickTextAnchor(),b=this.getTickVerticalAnchor(),y=It(this.props,!1),S=It(h,!1),N=tr(tr({},y),{},{fill:"none"},It(d,!1)),_=x.map(function(A,k){var E=o.getTickLineCoord(A),P=E.line,R=E.tick,M=tr(tr(tr(tr({textAnchor:j,verticalAnchor:b},y),{},{stroke:"none",fill:f},S),R),{},{index:k,payload:A,visibleTicksCount:x.length,tickFormatter:p});return X.createElement(cn,Tc({className:"recharts-cartesian-axis-tick",key:"tick-".concat(A.value,"-").concat(A.coordinate,"-").concat(A.tickCoord)},xl(o.props,A,k)),d&&X.createElement("line",Tc({},N,P,{className:Yt("recharts-cartesian-axis-tick-line",bs(d,"className"))})),h&&t.renderTickItem(h,M,"".concat(Vt(p)?p(A.value,k):A.value).concat(v||"")))});return X.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,v=p.ticks,x=Gj(p,Ufe),j=v;return Vt(d)&&(j=v&&v.length>0?d(this.props):d(x)),o<=0||c<=0||!j||!j.length?null:X.createElement(cn,{className:Yt("recharts-cartesian-axis",f),ref:function(y){r.layerReference=y}},i&&this.renderAxisLine(),this.renderTicks(j,this.state.fontSize,this.state.letterSpacing),hr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,a,i){var o,c=Yt(a.className,"recharts-cartesian-axis-tick-value");return X.isValidElement(r)?o=X.cloneElement(r,tr(tr({},a),{},{className:c})):Vt(r)?o=r(tr(tr({},a),{},{className:c})):o=X.createElement(yl,Tc({},a,{className:"recharts-cartesian-axis-tick-value"}),i),o}}])})(m.Component);c_(_v,"displayName","CartesianAxis");c_(_v,"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 Zfe=["type","layout","connectNulls","ref"],Jfe=["key"];function pu(e){"@babel/helpers - typeof";return pu=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},pu(e)}function r$(e,t){if(e==null)return{};var n=epe(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 epe(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 Hd(){return Hd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hd.apply(this,arguments)}function s$(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 fs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?s$(Object(n),!0).forEach(function(r){ua(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xc(e){return spe(e)||rpe(e)||npe(e)||tpe()}function tpe(){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 npe(e,t){if(e){if(typeof e=="string")return tN(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 tN(e,t)}}function rpe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function spe(e){if(Array.isArray(e))return tN(e)}function tN(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 ape(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a$(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,dz(r.key),r)}}function ipe(e,t,n){return t&&a$(e.prototype,t),n&&a$(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ope(e,t,n){return t=rg(t),lpe(e,uz()?Reflect.construct(t,n||[],rg(e).constructor):t.apply(e,n))}function lpe(e,t){if(t&&(pu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cpe(e)}function cpe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function uz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(uz=function(){return!!e})()}function rg(e){return rg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},rg(e)}function upe(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&&nN(e,t)}function nN(e,t){return nN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},nN(e,t)}function ua(e,t,n){return t=dz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dz(e){var t=dpe(e,"string");return pu(t)=="symbol"?t:t+""}function dpe(e,t){if(pu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(pu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var jl=(function(e){function t(){var n;ape(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=ope(this,t,[].concat(a)),ua(n,"state",{isAnimationFinished:!0,totalLength:0}),ua(n,"generateSimpleStrokeDasharray",function(o,c){return"".concat(c,"px ").concat(o-c,"px")}),ua(n,"getStrokeDasharray",function(o,c,d){var f=d.reduce(function(S,N){return S+N});if(!f)return n.generateSimpleStrokeDasharray(c,o);for(var h=Math.floor(o/f),p=o%f,v=c-o,x=[],j=0,b=0;j<d.length;b+=d[j],++j)if(b+d[j]>p){x=[].concat(xc(d.slice(0,j)),[p-b]);break}var y=x.length%2===0?[0,v]:[v];return[].concat(xc(t.repeat(d,h)),xc(x),y).map(function(S){return"".concat(S,"px")}).join(", ")}),ua(n,"id",Pu("recharts-line-")),ua(n,"pathRef",function(o){n.mainCurve=o}),ua(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),ua(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return upe(t,e),ipe(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=ws(h,sp);if(!p)return null;var v=function(b,y){return{x:b.x,y:b.y,value:b.value,errorVal:rr(b.payload,y)}},x={clipPath:r?"url(#clipPath-".concat(a,")"):null};return X.createElement(cn,x,p.map(function(j){return X.cloneElement(j,{key:"bar-".concat(j.props.dataKey),data:o,xAxis:c,yAxis:d,layout:f,dataPointFormatter:v})}))}},{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=It(this.props,!1),v=It(d,!0),x=f.map(function(b,y){var S=fs(fs(fs({key:"dot-".concat(y),r:3},p),v),{},{index:y,cx:b.x,cy:b.y,value:b.value,dataKey:h,payload:b.payload,points:f});return t.renderDotItem(d,S)}),j={clipPath:r?"url(#clipPath-".concat(a?"":"dots-").concat(i,")"):null};return X.createElement(cn,Hd({className:"recharts-line-dots",key:"dots"},j),x)}},{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=r$(c,Zfe),v=fs(fs(fs({},It(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 X.createElement($m,Hd({},v,{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,v=o.animationEasing,x=o.animationId,j=o.animateNewValues,b=o.width,y=o.height,S=this.state,N=S.prevPoints,_=S.totalLength;return X.createElement(Wa,{begin:h,duration:p,isActive:f,easing:v,from:{t:0},to:{t:1},key:"line-".concat(x),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(A){var k=A.t;if(N){var E=N.length/c.length,P=c.map(function(F,G){var H=Math.floor(G*E);if(N[H]){var L=N[H],I=gs(L.x,F.x),Y=gs(L.y,F.y);return fs(fs({},F),{},{x:I(k),y:Y(k)})}if(j){var W=gs(b*2,F.x),O=gs(y/2,F.y);return fs(fs({},F),{},{x:W(k),y:O(k)})}return fs(fs({},F),{},{x:F.x,y:F.y})});return i.renderCurveStatically(P,r,a)}var R=gs(0,_),M=R(k),D;if(d){var U="".concat(d).split(/[,\s]+/gim).map(function(F){return parseFloat(F)});D=i.getStrokeDasharray(M,_,U)}else D=i.generateSimpleStrokeDasharray(_,M);return i.renderCurveStatically(c,r,a,{strokeDasharray:D})})}},{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||!rp(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,v=a.left,x=a.width,j=a.height,b=a.isAnimationActive,y=a.id;if(i||!c||!c.length)return null;var S=this.state.isAnimationFinished,N=c.length===1,_=Yt("recharts-line",d),A=f&&f.allowDataOverflow,k=h&&h.allowDataOverflow,E=A||k,P=Ht(y)?this.id:y,R=(r=It(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},M=R.r,D=M===void 0?3:M,U=R.strokeWidth,F=U===void 0?2:U,G=tZ(o)?o:{},H=G.clipDot,L=H===void 0?!0:H,I=D*2+F;return X.createElement(cn,{className:_},A||k?X.createElement("defs",null,X.createElement("clipPath",{id:"clipPath-".concat(P)},X.createElement("rect",{x:A?v:v-x/2,y:k?p:p-j/2,width:A?x:x*2,height:k?j:j*2})),!L&&X.createElement("clipPath",{id:"clipPath-dots-".concat(P)},X.createElement("rect",{x:v-I/2,y:p-I/2,width:x+I,height:j+I}))):null,!N&&this.renderCurve(E,P),this.renderErrorBar(E,P),(N||o)&&this.renderDots(E,L,P),(!b||S)&&gi.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(xc(r),[0]):r,o=[],c=0;c<a;++c)o=[].concat(xc(o),xc(i));return o}},{key:"renderDotItem",value:function(r,a){var i;if(X.isValidElement(r))i=X.cloneElement(r,a);else if(Vt(r))i=r(a);else{var o=a.key,c=r$(a,Jfe),d=Yt("recharts-line-dot",typeof r!="boolean"?r.className:"");i=X.createElement(hv,Hd({key:o},c,{className:d}))}return i}}])})(m.PureComponent);ua(jl,"displayName","Line");ua(jl,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!$l.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});ua(jl,"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(v,x){var j=rr(v,o);return h==="horizontal"?{x:fM({axis:n,ticks:a,bandSize:c,entry:v,index:x}),y:Ht(j)?null:r.scale(j),value:j,payload:v}:{x:Ht(j)?null:n.scale(j),y:fM({axis:r,ticks:i,bandSize:c,entry:v,index:x}),value:j,payload:v}});return fs({points:p,layout:h},f)});function hu(e){"@babel/helpers - typeof";return hu=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},hu(e)}function fpe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ppe(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,hz(r.key),r)}}function hpe(e,t,n){return t&&ppe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function mpe(e,t,n){return t=sg(t),gpe(e,fz()?Reflect.construct(t,n||[],sg(e).constructor):t.apply(e,n))}function gpe(e,t){if(t&&(hu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vpe(e)}function vpe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(fz=function(){return!!e})()}function sg(e){return sg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},sg(e)}function xpe(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&&rN(e,t)}function rN(e,t){return rN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},rN(e,t)}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=ype(e,"string");return hu(t)=="symbol"?t:t+""}function ype(e,t){if(hu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(hu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function sN(){return sN=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},sN.apply(this,arguments)}function bpe(e){var t=e.xAxisId,n=JF(),r=ez(),a=QF(t);return a==null?null:m.createElement(_v,sN({},a,{className:Yt("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(o){return al(o,!0)}}))}var yo=(function(e){function t(){return fpe(this,t),mpe(this,t,arguments)}return xpe(t,e),hpe(t,[{key:"render",value:function(){return m.createElement(bpe,this.props)}}])})(m.Component);pz(yo,"displayName","XAxis");pz(yo,"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 mu(e){"@babel/helpers - typeof";return mu=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},mu(e)}function wpe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jpe(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,vz(r.key),r)}}function Spe(e,t,n){return t&&jpe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Npe(e,t,n){return t=ag(t),Cpe(e,mz()?Reflect.construct(t,n||[],ag(e).constructor):t.apply(e,n))}function Cpe(e,t){if(t&&(mu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _pe(e)}function _pe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(mz=function(){return!!e})()}function ag(e){return ag=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ag(e)}function Ape(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&&aN(e,t)}function aN(e,t){return aN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},aN(e,t)}function gz(e,t,n){return t=vz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vz(e){var t=kpe(e,"string");return mu(t)=="symbol"?t:t+""}function kpe(e,t){if(mu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(mu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function iN(){return iN=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},iN.apply(this,arguments)}var Epe=function(t){var n=t.yAxisId,r=JF(),a=ez(),i=ZF(n);return i==null?null:m.createElement(_v,iN({},i,{className:Yt("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:r,height:a},ticksGenerator:function(c){return al(c,!0)}}))},bo=(function(e){function t(){return wpe(this,t),Npe(this,t,arguments)}return Ape(t,e),Spe(t,[{key:"render",value:function(){return m.createElement(Epe,this.props)}}])})(m.Component);gz(bo,"displayName","YAxis");gz(bo,"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 i$(e){return Ope(e)||Rpe(e)||Tpe(e)||Ppe()}function Ppe(){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 Tpe(e,t){if(e){if(typeof e=="string")return oN(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 oN(e,t)}}function Rpe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ope(e){if(Array.isArray(e))return oN(e)}function oN(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 lN=function(t,n,r,a,i){var o=ws(t,l_),c=ws(t,Sv),d=[].concat(i$(o),i$(c)),f=ws(t,Cv),h="".concat(a,"Id"),p=a[0],v=n;if(d.length&&(v=d.reduce(function(b,y){if(y.props[h]===r&&Fa(y.props,"extendDomain")&&at(y.props[p])){var S=y.props[p];return[Math.min(b[0],S),Math.max(b[1],S)]}return b},v)),f.length){var x="".concat(p,"1"),j="".concat(p,"2");v=f.reduce(function(b,y){if(y.props[h]===r&&Fa(y.props,"extendDomain")&&at(y.props[x])&&at(y.props[j])){var S=y.props[x],N=y.props[j];return[Math.min(b[0],S,N),Math.max(b[1],S,N)]}return b},v)}return i&&i.length&&(v=i.reduce(function(b,y){return at(y)?[Math.min(b[0],y),Math.max(b[1],y)]:b},v)),v},Yj={exports:{}},o$;function Mpe(){return o$||(o$=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,v){if(typeof h!="function")throw new TypeError("The listener must be a function");var x=new a(h,p||d,v),j=n?n+f:f;return d._events[j]?d._events[j].fn?d._events[j]=[d._events[j],x]:d._events[j].push(x):(d._events[j]=x,d._eventsCount++),d}function o(d,f){--d._eventsCount===0?d._events=new r:delete d._events[f]}function c(){this._events=new r,this._eventsCount=0}c.prototype.eventNames=function(){var f=[],h,p;if(this._eventsCount===0)return f;for(p in h=this._events)t.call(h,p)&&f.push(n?p.slice(1):p);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(h)):f},c.prototype.listeners=function(f){var h=n?n+f:f,p=this._events[h];if(!p)return[];if(p.fn)return[p.fn];for(var v=0,x=p.length,j=new Array(x);v<x;v++)j[v]=p[v].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,v,x,j){var b=n?n+f:f;if(!this._events[b])return!1;var y=this._events[b],S=arguments.length,N,_;if(y.fn){switch(y.once&&this.removeListener(f,y.fn,void 0,!0),S){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,h),!0;case 3:return y.fn.call(y.context,h,p),!0;case 4:return y.fn.call(y.context,h,p,v),!0;case 5:return y.fn.call(y.context,h,p,v,x),!0;case 6:return y.fn.call(y.context,h,p,v,x,j),!0}for(_=1,N=new Array(S-1);_<S;_++)N[_-1]=arguments[_];y.fn.apply(y.context,N)}else{var A=y.length,k;for(_=0;_<A;_++)switch(y[_].once&&this.removeListener(f,y[_].fn,void 0,!0),S){case 1:y[_].fn.call(y[_].context);break;case 2:y[_].fn.call(y[_].context,h);break;case 3:y[_].fn.call(y[_].context,h,p);break;case 4:y[_].fn.call(y[_].context,h,p,v);break;default:if(!N)for(k=1,N=new Array(S-1);k<S;k++)N[k-1]=arguments[k];y[_].fn.apply(y[_].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,v){var x=n?n+f:f;if(!this._events[x])return this;if(!h)return o(this,x),this;var j=this._events[x];if(j.fn)j.fn===h&&(!v||j.once)&&(!p||j.context===p)&&o(this,x);else{for(var b=0,y=[],S=j.length;b<S;b++)(j[b].fn!==h||v&&!j[b].once||p&&j[b].context!==p)&&y.push(j[b]);y.length?this._events[x]=y.length===1?y[0]:y:o(this,x)}return this},c.prototype.removeAllListeners=function(f){var h;return f?(h=n?n+f:f,this._events[h]&&o(this,h)):(this._events=new r,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c})(Yj)),Yj.exports}var Ipe=Mpe();const $pe=vn(Ipe);var Xj=new $pe,Qj="recharts.syncMouseEvents";function Of(e){"@babel/helpers - typeof";return Of=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Of(e)}function Dpe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Lpe(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,xz(r.key),r)}}function Fpe(e,t,n){return t&&Lpe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Zj(e,t,n){return t=xz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xz(e){var t=zpe(e,"string");return Of(t)=="symbol"?t:t+""}function zpe(e,t){if(Of(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Of(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Bpe=(function(){function e(){Dpe(this,e),Zj(this,"activeIndex",0),Zj(this,"coordinateList",[]),Zj(this,"layout","horizontal")}return Fpe(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,v=n.mouseHandlerCallback,x=v===void 0?null:v;this.coordinateList=(r=i??this.coordinateList)!==null&&r!==void 0?r:[],this.container=c??this.container,this.layout=f??this.layout,this.offset=p??this.offset,this.mouseHandlerCallback=x??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var 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,v=o+this.offset.top+c/2+h;this.mouseHandlerCallback({pageX:p,pageY:v})}}}])})();function qpe(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e?.[0],a=e?.[1];if(r&&a&&at(r)&&at(a))return!0}return!1}function Upe(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 yz(e){var t=e.cx,n=e.cy,r=e.radius,a=e.startAngle,i=e.endAngle,o=Cn(t,n,r,a),c=Cn(t,n,r,i);return{points:[o,c],cx:t,cy:n,radius:r,startAngle:a,endAngle:i}}function Wpe(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,v=Cn(c,d,f,p),x=Cn(c,d,h,p);r=v.x,a=v.y,i=x.x,o=x.y}else return yz(t);return[{x:r,y:a},{x:i,y:o}]}function Mf(e){"@babel/helpers - typeof";return Mf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mf(e)}function l$(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 $h(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?l$(Object(n),!0).forEach(function(r){Vpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Vpe(e,t,n){return t=Hpe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hpe(e){var t=Kpe(e,"string");return Mf(t)=="symbol"?t:t+""}function Kpe(e,t){if(Mf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Mf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Gpe(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,v=e.chartName,x=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!x||!i||!o||v!=="ScatterChart"&&a!=="axis")return null;var j,b=$m;if(v==="ScatterChart")j=o,b=Tce;else if(v==="BarChart")j=Upe(p,o,d,h),b=a_;else if(p==="radial"){var y=yz(o),S=y.cx,N=y.cy,_=y.radius,A=y.startAngle,k=y.endAngle;j={cx:S,cy:N,startAngle:A,endAngle:k,innerRadius:_,outerRadius:_},b=yF}else j={points:Wpe(p,o,d)},b=$m;var E=$h($h($h($h({stroke:"#ccc",pointerEvents:"none"},d),j),It(x,!1)),{},{payload:c,payloadIndex:f,className:Yt("recharts-tooltip-cursor",x.className)});return m.isValidElement(x)?m.cloneElement(x,E):m.createElement(b,E)}var Ype=["item"],Xpe=["children","className","width","height","style","compact","title","desc"];function gu(e){"@babel/helpers - typeof";return gu=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},gu(e)}function Rc(){return Rc=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},Rc.apply(this,arguments)}function c$(e,t){return Jpe(e)||Zpe(e,t)||wz(e,t)||Qpe()}function Qpe(){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 Zpe(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 Jpe(e){if(Array.isArray(e))return e}function u$(e,t){if(e==null)return{};var n=ehe(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 ehe(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 the(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nhe(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,jz(r.key),r)}}function rhe(e,t,n){return t&&nhe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function she(e,t,n){return t=ig(t),ahe(e,bz()?Reflect.construct(t,n||[],ig(e).constructor):t.apply(e,n))}function ahe(e,t){if(t&&(gu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ihe(e)}function ihe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function bz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(bz=function(){return!!e})()}function ig(e){return ig=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ig(e)}function ohe(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&&cN(e,t)}function cN(e,t){return cN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},cN(e,t)}function vu(e){return uhe(e)||che(e)||wz(e)||lhe()}function lhe(){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 wz(e,t){if(e){if(typeof e=="string")return uN(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 uN(e,t)}}function che(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function uhe(e){if(Array.isArray(e))return uN(e)}function uN(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 d$(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 Te(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?d$(Object(n),!0).forEach(function(r){$t(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $t(e,t,n){return t=jz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jz(e){var t=dhe(e,"string");return gu(t)=="symbol"?t:t+""}function dhe(e,t){if(gu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(gu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var fhe={xAxis:["bottom","top"],yAxis:["left","right"]},phe={width:"100%",height:"100%"},Sz={x:0,y:0};function Dh(e){return e}var hhe=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},mhe=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 Te(Te(Te({},a),Cn(a.cx,a.cy,c,o)),{},{angle:o,radius:c})}var d=i.coordinate,f=a.angle;return Te(Te(Te({},a),Cn(a.cx,a.cy,d,f)),{},{angle:f,radius:d})}return Sz},Av=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(vu(c),vu(f)):c},[]);return o.length>0?o:t&&t.length&&at(a)&&at(i)?t.slice(a,i+1):[]};function Nz(e){return e==="number"?[0,"auto"]:void 0}var dN=function(t,n,r,a){var i=t.graphicalItems,o=t.tooltipAxis,c=Av(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 v;if(o.dataKey&&!o.allowDuplicatedCategory){var x=p===void 0?c:p;v=im(x,o.dataKey,a)}else v=p&&p[r]||c[r];return v?[].concat(vu(d),[pF(f,v)]):d},[])},f$=function(t,n,r,a){var i=a||{x:t.chartX,y:t.chartY},o=hhe(i,r),c=t.orderedTooltipTicks,d=t.tooltipAxis,f=t.tooltipTicks,h=Zae(o,c,f,d);if(h>=0&&f){var p=f[h]&&f[h].value,v=dN(t,n,h,p),x=mhe(r,c,h,i);return{activeTooltipIndex:h,activeLabel:p,activePayload:v,activeCoordinate:x}}return null},ghe=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,v=t.stackOffset,x=lF(h,i);return r.reduce(function(j,b){var y,S=b.type.defaultProps!==void 0?Te(Te({},b.type.defaultProps),b.props):b.props,N=S.type,_=S.dataKey,A=S.allowDataOverflow,k=S.allowDuplicatedCategory,E=S.scale,P=S.ticks,R=S.includeHidden,M=S[o];if(j[M])return j;var D=Av(t.data,{graphicalItems:a.filter(function(z){var K,J=o in z.props?z.props[o]:(K=z.type.defaultProps)===null||K===void 0?void 0:K[o];return J===M}),dataStartIndex:d,dataEndIndex:f}),U=D.length,F,G,H;qpe(S.domain,A,N)&&(F=C1(S.domain,null,A),x&&(N==="number"||E!=="auto")&&(H=qd(D,_,"category")));var L=Nz(N);if(!F||F.length===0){var I,Y=(I=S.domain)!==null&&I!==void 0?I:L;if(_){if(F=qd(D,_,N),N==="category"&&x){var W=VQ(F);k&&W?(G=F,F=Km(0,U)):k||(F=gM(Y,F,b).reduce(function(z,K){return z.indexOf(K)>=0?z:[].concat(vu(z),[K])},[]))}else if(N==="category")k?F=F.filter(function(z){return z!==""&&!Ht(z)}):F=gM(Y,F,b).reduce(function(z,K){return z.indexOf(K)>=0||K===""||Ht(K)?z:[].concat(vu(z),[K])},[]);else if(N==="number"){var O=rie(D,a.filter(function(z){var K,J,ne=o in z.props?z.props[o]:(K=z.type.defaultProps)===null||K===void 0?void 0:K[o],he="hide"in z.props?z.props.hide:(J=z.type.defaultProps)===null||J===void 0?void 0:J.hide;return ne===M&&(R||!he)}),_,i,h);O&&(F=O)}x&&(N==="number"||E!=="auto")&&(H=qd(D,_,"category"))}else x?F=Km(0,U):c&&c[M]&&c[M].hasStack&&N==="number"?F=v==="expand"?[0,1]:fF(c[M].stackGroups,d,f):F=oF(D,a.filter(function(z){var K=o in z.props?z.props[o]:z.type.defaultProps[o],J="hide"in z.props?z.props.hide:z.type.defaultProps.hide;return K===M&&(R||!J)}),N,h,!0);if(N==="number")F=lN(p,F,M,i,P),Y&&(F=C1(Y,F,A));else if(N==="category"&&Y){var Q=Y,q=F.every(function(z){return Q.indexOf(z)>=0});q&&(F=Q)}}return Te(Te({},j),{},$t({},M,Te(Te({},S),{},{axisType:i,domain:F,categoricalDomain:H,duplicateDomain:G,originalDomain:(y=S.domain)!==null&&y!==void 0?y:L,isCategorical:x,layout:h})))},{})},vhe=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,v=Av(t.data,{graphicalItems:r,dataStartIndex:d,dataEndIndex:f}),x=v.length,j=lF(h,i),b=-1;return r.reduce(function(y,S){var N=S.type.defaultProps!==void 0?Te(Te({},S.type.defaultProps),S.props):S.props,_=N[o],A=Nz("number");if(!y[_]){b++;var k;return j?k=Km(0,x):c&&c[_]&&c[_].hasStack?(k=fF(c[_].stackGroups,d,f),k=lN(p,k,_,i)):(k=C1(A,oF(v,r.filter(function(E){var P,R,M=o in E.props?E.props[o]:(P=E.type.defaultProps)===null||P===void 0?void 0:P[o],D="hide"in E.props?E.props.hide:(R=E.type.defaultProps)===null||R===void 0?void 0:R.hide;return M===_&&!D}),"number",h),a.defaultProps.allowDataOverflow),k=lN(p,k,_,i)),Te(Te({},y),{},$t({},_,Te(Te({axisType:i},a.defaultProps),{},{hide:!0,orientation:bs(fhe,"".concat(i,".").concat(b%2),null),domain:k,originalDomain:A,isCategorical:j,layout:h})))}return y},{})},xhe=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"),v=ws(h,i),x={};return v&&v.length?x=ghe(t,{axes:v,graphicalItems:o,axisType:a,axisIdKey:p,stackGroups:c,dataStartIndex:d,dataEndIndex:f}):o&&o.length&&(x=vhe(t,{Axis:i,graphicalItems:o,axisType:a,axisIdKey:p,stackGroups:c,dataStartIndex:d,dataEndIndex:f})),x},yhe=function(t){var n=Sc(t),r=al(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:RC(r,function(a){return a.coordinate}),tooltipAxis:n,tooltipAxisBandSize:Om(n,r)}},p$=function(t){var n=t.children,r=t.defaultShowTooltip,a=hs(n,ou),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}},bhe=function(t){return!t||!t.length?!1:t.some(function(n){var r=pi(n&&n.type);return r&&r.indexOf("Bar")>=0})},h$=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"}},whe=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,v=r.margin||{},x=hs(p,ou),j=hs(p,cl),b=Object.keys(d).reduce(function(k,E){var P=d[E],R=P.orientation;return!P.mirror&&!P.hide?Te(Te({},k),{},$t({},R,k[R]+P.width)):k},{left:v.left||0,right:v.right||0}),y=Object.keys(o).reduce(function(k,E){var P=o[E],R=P.orientation;return!P.mirror&&!P.hide?Te(Te({},k),{},$t({},R,bs(k,"".concat(R))+P.height)):k},{top:v.top||0,bottom:v.bottom||0}),S=Te(Te({},y),b),N=S.bottom;x&&(S.bottom+=x.props.height||ou.defaultProps.height),j&&n&&(S=tie(S,a,r,n));var _=f-S.left-S.right,A=h-S.top-S.bottom;return Te(Te({brushBottom:N},S),{},{width:Math.max(_,0),height:Math.max(A,0)})},jhe=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},u_=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,v=function(S,N){var _=N.graphicalItems,A=N.stackGroups,k=N.offset,E=N.updateId,P=N.dataStartIndex,R=N.dataEndIndex,M=S.barSize,D=S.layout,U=S.barGap,F=S.barCategoryGap,G=S.maxBarSize,H=h$(D),L=H.numericAxisName,I=H.cateAxisName,Y=bhe(_),W=[];return _.forEach(function(O,Q){var q=Av(S.data,{graphicalItems:[O],dataStartIndex:P,dataEndIndex:R}),z=O.type.defaultProps!==void 0?Te(Te({},O.type.defaultProps),O.props):O.props,K=z.dataKey,J=z.maxBarSize,ne=z["".concat(L,"Id")],he=z["".concat(I,"Id")],ie={},me=d.reduce(function(Ae,Je){var dt=N["".concat(Je.axisType,"Map")],Pt=z["".concat(Je.axisType,"Id")];dt&&dt[Pt]||Je.axisType==="zAxis"||wl();var Xt=dt[Pt];return Te(Te({},Ae),{},$t($t({},Je.axisType,Xt),"".concat(Je.axisType,"Ticks"),al(Xt)))},ie),se=me[I],ge=me["".concat(I,"Ticks")],Oe=A&&A[ne]&&A[ne].hasStack&&fie(O,A[ne].stackGroups),fe=pi(O.type).indexOf("Bar")>=0,xe=Om(se,ge),we=[],ot=Y&&Jae({barSize:M,stackGroups:A,totalSize:jhe(me,I)});if(fe){var lt,ut,At=Ht(J)?G:J,Xe=(lt=(ut=Om(se,ge,!0))!==null&&ut!==void 0?ut:At)!==null&<!==void 0?lt:0;we=eie({barGap:U,barCategoryGap:F,bandSize:Xe!==xe?Xe:xe,sizeList:ot[he],maxBarSize:At}),Xe!==xe&&(we=we.map(function(Ae){return Te(Te({},Ae),{},{position:Te(Te({},Ae.position),{},{offset:Ae.position.offset-Xe/2})})}))}var Se=O&&O.type&&O.type.getComposedData;Se&&W.push({props:Te(Te({},Se(Te(Te({},me),{},{displayedData:q,props:S,dataKey:K,item:O,bandSize:xe,barPosition:we,offset:k,stackedData:Oe,layout:D,dataStartIndex:P,dataEndIndex:R}))),{},$t($t($t({key:O.key||"item-".concat(Q)},L,me[L]),I,me[I]),"animationId",E)),childIndex:sZ(O,S.children),item:O})}),W},x=function(S,N){var _=S.props,A=S.dataStartIndex,k=S.dataEndIndex,E=S.updateId;if(!PT({props:_}))return null;var P=_.children,R=_.layout,M=_.stackOffset,D=_.data,U=_.reverseStackOrder,F=h$(R),G=F.numericAxisName,H=F.cateAxisName,L=ws(P,r),I=uie(D,L,"".concat(G,"Id"),"".concat(H,"Id"),M,U),Y=d.reduce(function(z,K){var J="".concat(K.axisType,"Map");return Te(Te({},z),{},$t({},J,xhe(_,Te(Te({},K),{},{graphicalItems:L,stackGroups:K.axisType===G&&I,dataStartIndex:A,dataEndIndex:k}))))},{}),W=whe(Te(Te({},Y),{},{props:_,graphicalItems:L}),N?.legendBBox);Object.keys(Y).forEach(function(z){Y[z]=h(_,Y[z],W,z.replace("Map",""),n)});var O=Y["".concat(H,"Map")],Q=yhe(O),q=v(_,Te(Te({},Y),{},{dataStartIndex:A,dataEndIndex:k,updateId:E,graphicalItems:L,stackGroups:I,offset:W}));return Te(Te({formattedGraphicalItems:q,graphicalItems:L,offset:W,stackGroups:I},Q),Y)},j=(function(y){function S(N){var _,A,k;return the(this,S),k=she(this,S,[N]),$t(k,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),$t(k,"accessibilityManager",new Bpe),$t(k,"handleLegendBBoxUpdate",function(E){if(E){var P=k.state,R=P.dataStartIndex,M=P.dataEndIndex,D=P.updateId;k.setState(Te({legendBBox:E},x({props:k.props,dataStartIndex:R,dataEndIndex:M,updateId:D},Te(Te({},k.state),{},{legendBBox:E}))))}}),$t(k,"handleReceiveSyncEvent",function(E,P,R){if(k.props.syncId===E){if(R===k.eventEmitterSymbol&&typeof k.props.syncMethod!="function")return;k.applySyncEvent(P)}}),$t(k,"handleBrushChange",function(E){var P=E.startIndex,R=E.endIndex;if(P!==k.state.dataStartIndex||R!==k.state.dataEndIndex){var M=k.state.updateId;k.setState(function(){return Te({dataStartIndex:P,dataEndIndex:R},x({props:k.props,dataStartIndex:P,dataEndIndex:R,updateId:M},k.state))}),k.triggerSyncEvent({dataStartIndex:P,dataEndIndex:R})}}),$t(k,"handleMouseEnter",function(E){var P=k.getMouseInfo(E);if(P){var R=Te(Te({},P),{},{isTooltipActive:!0});k.setState(R),k.triggerSyncEvent(R);var M=k.props.onMouseEnter;Vt(M)&&M(R,E)}}),$t(k,"triggeredAfterMouseMove",function(E){var P=k.getMouseInfo(E),R=P?Te(Te({},P),{},{isTooltipActive:!0}):{isTooltipActive:!1};k.setState(R),k.triggerSyncEvent(R);var M=k.props.onMouseMove;Vt(M)&&M(R,E)}),$t(k,"handleItemMouseEnter",function(E){k.setState(function(){return{isTooltipActive:!0,activeItem:E,activePayload:E.tooltipPayload,activeCoordinate:E.tooltipPosition||{x:E.cx,y:E.cy}}})}),$t(k,"handleItemMouseLeave",function(){k.setState(function(){return{isTooltipActive:!1}})}),$t(k,"handleMouseMove",function(E){E.persist(),k.throttleTriggeredAfterMouseMove(E)}),$t(k,"handleMouseLeave",function(E){k.throttleTriggeredAfterMouseMove.cancel();var P={isTooltipActive:!1};k.setState(P),k.triggerSyncEvent(P);var R=k.props.onMouseLeave;Vt(R)&&R(P,E)}),$t(k,"handleOuterEvent",function(E){var P=rZ(E),R=bs(k.props,"".concat(P));if(P&&Vt(R)){var M,D;/.*touch.*/i.test(P)?D=k.getMouseInfo(E.changedTouches[0]):D=k.getMouseInfo(E),R((M=D)!==null&&M!==void 0?M:{},E)}}),$t(k,"handleClick",function(E){var P=k.getMouseInfo(E);if(P){var R=Te(Te({},P),{},{isTooltipActive:!0});k.setState(R),k.triggerSyncEvent(R);var M=k.props.onClick;Vt(M)&&M(R,E)}}),$t(k,"handleMouseDown",function(E){var P=k.props.onMouseDown;if(Vt(P)){var R=k.getMouseInfo(E);P(R,E)}}),$t(k,"handleMouseUp",function(E){var P=k.props.onMouseUp;if(Vt(P)){var R=k.getMouseInfo(E);P(R,E)}}),$t(k,"handleTouchMove",function(E){E.changedTouches!=null&&E.changedTouches.length>0&&k.throttleTriggeredAfterMouseMove(E.changedTouches[0])}),$t(k,"handleTouchStart",function(E){E.changedTouches!=null&&E.changedTouches.length>0&&k.handleMouseDown(E.changedTouches[0])}),$t(k,"handleTouchEnd",function(E){E.changedTouches!=null&&E.changedTouches.length>0&&k.handleMouseUp(E.changedTouches[0])}),$t(k,"handleDoubleClick",function(E){var P=k.props.onDoubleClick;if(Vt(P)){var R=k.getMouseInfo(E);P(R,E)}}),$t(k,"handleContextMenu",function(E){var P=k.props.onContextMenu;if(Vt(P)){var R=k.getMouseInfo(E);P(R,E)}}),$t(k,"triggerSyncEvent",function(E){k.props.syncId!==void 0&&Xj.emit(Qj,k.props.syncId,E,k.eventEmitterSymbol)}),$t(k,"applySyncEvent",function(E){var P=k.props,R=P.layout,M=P.syncMethod,D=k.state.updateId,U=E.dataStartIndex,F=E.dataEndIndex;if(E.dataStartIndex!==void 0||E.dataEndIndex!==void 0)k.setState(Te({dataStartIndex:U,dataEndIndex:F},x({props:k.props,dataStartIndex:U,dataEndIndex:F,updateId:D},k.state)));else if(E.activeTooltipIndex!==void 0){var G=E.chartX,H=E.chartY,L=E.activeTooltipIndex,I=k.state,Y=I.offset,W=I.tooltipTicks;if(!Y)return;if(typeof M=="function")L=M(W,E);else if(M==="value"){L=-1;for(var O=0;O<W.length;O++)if(W[O].value===E.activeLabel){L=O;break}}var Q=Te(Te({},Y),{},{x:Y.left,y:Y.top}),q=Math.min(G,Q.x+Q.width),z=Math.min(H,Q.y+Q.height),K=W[L]&&W[L].value,J=dN(k.state,k.props.data,L),ne=W[L]?{x:R==="horizontal"?W[L].coordinate:q,y:R==="horizontal"?z:W[L].coordinate}:Sz;k.setState(Te(Te({},E),{},{activeLabel:K,activeCoordinate:ne,activePayload:J,activeTooltipIndex:L}))}else k.setState(E)}),$t(k,"renderCursor",function(E){var P,R=k.state,M=R.isTooltipActive,D=R.activeCoordinate,U=R.activePayload,F=R.offset,G=R.activeTooltipIndex,H=R.tooltipAxisBandSize,L=k.getTooltipEventType(),I=(P=E.props.active)!==null&&P!==void 0?P:M,Y=k.props.layout,W=E.key||"_recharts-cursor";return X.createElement(Gpe,{key:W,activeCoordinate:D,activePayload:U,activeTooltipIndex:G,chartName:n,element:E,isActive:I,layout:Y,offset:F,tooltipAxisBandSize:H,tooltipEventType:L})}),$t(k,"renderPolarAxis",function(E,P,R){var M=bs(E,"type.axisType"),D=bs(k.state,"".concat(M,"Map")),U=E.type.defaultProps,F=U!==void 0?Te(Te({},U),E.props):E.props,G=D&&D[F["".concat(M,"Id")]];return m.cloneElement(E,Te(Te({},G),{},{className:Yt(M,G.className),key:E.key||"".concat(P,"-").concat(R),ticks:al(G,!0)}))}),$t(k,"renderPolarGrid",function(E){var P=E.props,R=P.radialLines,M=P.polarAngles,D=P.polarRadius,U=k.state,F=U.radiusAxisMap,G=U.angleAxisMap,H=Sc(F),L=Sc(G),I=L.cx,Y=L.cy,W=L.innerRadius,O=L.outerRadius;return m.cloneElement(E,{polarAngles:Array.isArray(M)?M:al(L,!0).map(function(Q){return Q.coordinate}),polarRadius:Array.isArray(D)?D:al(H,!0).map(function(Q){return Q.coordinate}),cx:I,cy:Y,innerRadius:W,outerRadius:O,key:E.key||"polar-grid",radialLines:R})}),$t(k,"renderLegend",function(){var E=k.state.formattedGraphicalItems,P=k.props,R=P.children,M=P.width,D=P.height,U=k.props.margin||{},F=M-(U.left||0)-(U.right||0),G=aF({children:R,formattedGraphicalItems:E,legendWidth:F,legendContent:f});if(!G)return null;var H=G.item,L=u$(G,Ype);return m.cloneElement(H,Te(Te({},L),{},{chartWidth:M,chartHeight:D,margin:U,onBBoxUpdate:k.handleLegendBBoxUpdate}))}),$t(k,"renderTooltip",function(){var E,P=k.props,R=P.children,M=P.accessibilityLayer,D=hs(R,Qr);if(!D)return null;var U=k.state,F=U.isTooltipActive,G=U.activeCoordinate,H=U.activePayload,L=U.activeLabel,I=U.offset,Y=(E=D.props.active)!==null&&E!==void 0?E:F;return m.cloneElement(D,{viewBox:Te(Te({},I),{},{x:I.left,y:I.top}),active:Y,label:L,payload:Y?H:[],coordinate:G,accessibilityLayer:M})}),$t(k,"renderBrush",function(E){var P=k.props,R=P.margin,M=P.data,D=k.state,U=D.offset,F=D.dataStartIndex,G=D.dataEndIndex,H=D.updateId;return m.cloneElement(E,{key:E.key||"_recharts-brush",onChange:Rh(k.handleBrushChange,E.props.onChange),data:M,x:at(E.props.x)?E.props.x:U.left,y:at(E.props.y)?E.props.y:U.top+U.height+U.brushBottom-(R.bottom||0),width:at(E.props.width)?E.props.width:U.width,startIndex:F,endIndex:G,updateId:"brush-".concat(H)})}),$t(k,"renderReferenceElement",function(E,P,R){if(!E)return null;var M=k,D=M.clipPathId,U=k.state,F=U.xAxisMap,G=U.yAxisMap,H=U.offset,L=E.type.defaultProps||{},I=E.props,Y=I.xAxisId,W=Y===void 0?L.xAxisId:Y,O=I.yAxisId,Q=O===void 0?L.yAxisId:O;return m.cloneElement(E,{key:E.key||"".concat(P,"-").concat(R),xAxis:F[W],yAxis:G[Q],viewBox:{x:H.left,y:H.top,width:H.width,height:H.height},clipPathId:D})}),$t(k,"renderActivePoints",function(E){var P=E.item,R=E.activePoint,M=E.basePoint,D=E.childIndex,U=E.isRange,F=[],G=P.props.key,H=P.item.type.defaultProps!==void 0?Te(Te({},P.item.type.defaultProps),P.item.props):P.item.props,L=H.activeDot,I=H.dataKey,Y=Te(Te({index:D,dataKey:I,cx:R.x,cy:R.y,r:4,fill:s_(P.item),strokeWidth:2,stroke:"#fff",payload:R.payload,value:R.value},It(L,!1)),om(L));return F.push(S.renderActiveDot(L,Y,"".concat(G,"-activePoint-").concat(D))),M?F.push(S.renderActiveDot(L,Te(Te({},Y),{},{cx:M.x,cy:M.y}),"".concat(G,"-basePoint-").concat(D))):U&&F.push(null),F}),$t(k,"renderGraphicChild",function(E,P,R){var M=k.filterFormatItem(E,P,R);if(!M)return null;var D=k.getTooltipEventType(),U=k.state,F=U.isTooltipActive,G=U.tooltipAxis,H=U.activeTooltipIndex,L=U.activeLabel,I=k.props.children,Y=hs(I,Qr),W=M.props,O=W.points,Q=W.isRange,q=W.baseLine,z=M.item.type.defaultProps!==void 0?Te(Te({},M.item.type.defaultProps),M.item.props):M.item.props,K=z.activeDot,J=z.hide,ne=z.activeBar,he=z.activeShape,ie=!!(!J&&F&&Y&&(K||ne||he)),me={};D!=="axis"&&Y&&Y.props.trigger==="click"?me={onClick:Rh(k.handleItemMouseEnter,E.props.onClick)}:D!=="axis"&&(me={onMouseLeave:Rh(k.handleItemMouseLeave,E.props.onMouseLeave),onMouseEnter:Rh(k.handleItemMouseEnter,E.props.onMouseEnter)});var se=m.cloneElement(E,Te(Te({},M.props),me));function ge(Je){return typeof G.dataKey=="function"?G.dataKey(Je.payload):null}if(ie)if(H>=0){var Oe,fe;if(G.dataKey&&!G.allowDuplicatedCategory){var xe=typeof G.dataKey=="function"?ge:"payload.".concat(G.dataKey.toString());Oe=im(O,xe,L),fe=Q&&q&&im(q,xe,L)}else Oe=O?.[H],fe=Q&&q&&q[H];if(he||ne){var we=E.props.activeIndex!==void 0?E.props.activeIndex:H;return[m.cloneElement(E,Te(Te(Te({},M.props),me),{},{activeIndex:we})),null,null]}if(!Ht(Oe))return[se].concat(vu(k.renderActivePoints({item:M,activePoint:Oe,basePoint:fe,childIndex:H,isRange:Q})))}else{var ot,lt=(ot=k.getItemByXY(k.state.activeCoordinate))!==null&&ot!==void 0?ot:{graphicalItem:se},ut=lt.graphicalItem,At=ut.item,Xe=At===void 0?E:At,Se=ut.childIndex,Ae=Te(Te(Te({},M.props),me),{},{activeIndex:Se});return[m.cloneElement(Xe,Ae),null,null]}return Q?[se,null,null]:[se,null]}),$t(k,"renderCustomized",function(E,P,R){return m.cloneElement(E,Te(Te({key:"recharts-customized-".concat(R)},k.props),k.state))}),$t(k,"renderMap",{CartesianGrid:{handler:Dh,once:!0},ReferenceArea:{handler:k.renderReferenceElement},ReferenceLine:{handler:Dh},ReferenceDot:{handler:k.renderReferenceElement},XAxis:{handler:Dh},YAxis:{handler:Dh},Brush:{handler:k.renderBrush,once:!0},Bar:{handler:k.renderGraphicChild},Line:{handler:k.renderGraphicChild},Area:{handler:k.renderGraphicChild},Radar:{handler:k.renderGraphicChild},RadialBar:{handler:k.renderGraphicChild},Scatter:{handler:k.renderGraphicChild},Pie:{handler:k.renderGraphicChild},Funnel:{handler:k.renderGraphicChild},Tooltip:{handler:k.renderCursor,once:!0},PolarGrid:{handler:k.renderPolarGrid,once:!0},PolarAngleAxis:{handler:k.renderPolarAxis},PolarRadiusAxis:{handler:k.renderPolarAxis},Customized:{handler:k.renderCustomized}}),k.clipPathId="".concat((_=N.id)!==null&&_!==void 0?_:Pu("recharts"),"-clip"),k.throttleTriggeredAfterMouseMove=a4(k.triggeredAfterMouseMove,(A=N.throttleDelay)!==null&&A!==void 0?A:1e3/60),k.state={},k}return ohe(S,y),rhe(S,[{key:"componentDidMount",value:function(){var _,A;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(_=this.props.margin.left)!==null&&_!==void 0?_:0,top:(A=this.props.margin.top)!==null&&A!==void 0?A:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var _=this.props,A=_.children,k=_.data,E=_.height,P=_.layout,R=hs(A,Qr);if(R){var M=R.props.defaultIndex;if(!(typeof M!="number"||M<0||M>this.state.tooltipTicks.length-1)){var D=this.state.tooltipTicks[M]&&this.state.tooltipTicks[M].value,U=dN(this.state,k,M,D),F=this.state.tooltipTicks[M].coordinate,G=(this.state.offset.top+E)/2,H=P==="horizontal",L=H?{x:F,y:G}:{y:F,x:G},I=this.state.formattedGraphicalItems.find(function(W){var O=W.item;return O.type.name==="Scatter"});I&&(L=Te(Te({},L),I.props.points[M].tooltipPosition),U=I.props.points[M].tooltipPayload);var Y={activeTooltipIndex:M,isTooltipActive:!0,activeLabel:D,activePayload:U,activeCoordinate:L};this.setState(Y),this.renderCursor(R),this.accessibilityManager.setIndex(M)}}}},{key:"getSnapshotBeforeUpdate",value:function(_,A){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==A.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==_.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==_.margin){var k,E;this.accessibilityManager.setDetails({offset:{left:(k=this.props.margin.left)!==null&&k!==void 0?k:0,top:(E=this.props.margin.top)!==null&&E!==void 0?E:0}})}return null}},{key:"componentDidUpdate",value:function(_){KS([hs(_.children,Qr)],[hs(this.props.children,Qr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var _=hs(this.props.children,Qr);if(_&&typeof _.props.shared=="boolean"){var A=_.props.shared?"axis":"item";return c.indexOf(A)>=0?A:i}return i}},{key:"getMouseInfo",value:function(_){if(!this.container)return null;var A=this.container,k=A.getBoundingClientRect(),E=Wte(k),P={chartX:Math.round(_.pageX-E.left),chartY:Math.round(_.pageY-E.top)},R=k.width/A.offsetWidth||1,M=this.inRange(P.chartX,P.chartY,R);if(!M)return null;var D=this.state,U=D.xAxisMap,F=D.yAxisMap,G=this.getTooltipEventType(),H=f$(this.state,this.props.data,this.props.layout,M);if(G!=="axis"&&U&&F){var L=Sc(U).scale,I=Sc(F).scale,Y=L&&L.invert?L.invert(P.chartX):null,W=I&&I.invert?I.invert(P.chartY):null;return Te(Te({},P),{},{xValue:Y,yValue:W},H)}return H?Te(Te({},P),H):null}},{key:"inRange",value:function(_,A){var k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,E=this.props.layout,P=_/k,R=A/k;if(E==="horizontal"||E==="vertical"){var M=this.state.offset,D=P>=M.left&&P<=M.left+M.width&&R>=M.top&&R<=M.top+M.height;return D?{x:P,y:R}:null}var U=this.state,F=U.angleAxisMap,G=U.radiusAxisMap;if(F&&G){var H=Sc(F);return yM({x:P,y:R},H)}return null}},{key:"parseEventsOfWrapper",value:function(){var _=this.props.children,A=this.getTooltipEventType(),k=hs(_,Qr),E={};k&&A==="axis"&&(k.props.trigger==="click"?E={onClick:this.handleClick}:E={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 P=om(this.props,this.handleOuterEvent);return Te(Te({},P),E)}},{key:"addListener",value:function(){Xj.on(Qj,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Xj.removeListener(Qj,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(_,A,k){for(var E=this.state.formattedGraphicalItems,P=0,R=E.length;P<R;P++){var M=E[P];if(M.item===_||M.props.key===_.key||A===pi(M.item.type)&&k===M.childIndex)return M}return null}},{key:"renderClipPath",value:function(){var _=this.clipPathId,A=this.state.offset,k=A.left,E=A.top,P=A.height,R=A.width;return X.createElement("defs",null,X.createElement("clipPath",{id:_},X.createElement("rect",{x:k,y:E,height:P,width:R})))}},{key:"getXScales",value:function(){var _=this.state.xAxisMap;return _?Object.entries(_).reduce(function(A,k){var E=c$(k,2),P=E[0],R=E[1];return Te(Te({},A),{},$t({},P,R.scale))},{}):null}},{key:"getYScales",value:function(){var _=this.state.yAxisMap;return _?Object.entries(_).reduce(function(A,k){var E=c$(k,2),P=E[0],R=E[1];return Te(Te({},A),{},$t({},P,R.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(_){var A;return(A=this.state.xAxisMap)===null||A===void 0||(A=A[_])===null||A===void 0?void 0:A.scale}},{key:"getYScaleByAxisId",value:function(_){var A;return(A=this.state.yAxisMap)===null||A===void 0||(A=A[_])===null||A===void 0?void 0:A.scale}},{key:"getItemByXY",value:function(_){var A=this.state,k=A.formattedGraphicalItems,E=A.activeItem;if(k&&k.length)for(var P=0,R=k.length;P<R;P++){var M=k[P],D=M.props,U=M.item,F=U.type.defaultProps!==void 0?Te(Te({},U.type.defaultProps),U.props):U.props,G=pi(U.type);if(G==="Bar"){var H=(D.data||[]).find(function(W){return dce(_,W)});if(H)return{graphicalItem:M,payload:H}}else if(G==="RadialBar"){var L=(D.data||[]).find(function(W){return yM(_,W)});if(L)return{graphicalItem:M,payload:L}}else if(yv(M,E)||bv(M,E)||kf(M,E)){var I=Mue({graphicalItem:M,activeTooltipItem:E,itemData:F.data}),Y=F.activeIndex===void 0?I:F.activeIndex;return{graphicalItem:Te(Te({},M),{},{childIndex:Y}),payload:kf(M,E)?F.data[I]:M.props.data[I]}}}return null}},{key:"render",value:function(){var _=this;if(!PT(this))return null;var A=this.props,k=A.children,E=A.className,P=A.width,R=A.height,M=A.style,D=A.compact,U=A.title,F=A.desc,G=u$(A,Xpe),H=It(G,!1);if(D)return X.createElement(HI,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},X.createElement(YS,Rc({},H,{width:P,height:R,title:U,desc:F}),this.renderClipPath(),RT(k,this.renderMap)));if(this.props.accessibilityLayer){var L,I;H.tabIndex=(L=this.props.tabIndex)!==null&&L!==void 0?L:0,H.role=(I=this.props.role)!==null&&I!==void 0?I:"application",H.onKeyDown=function(W){_.accessibilityManager.keyboardEvent(W)},H.onFocus=function(){_.accessibilityManager.focus()}}var Y=this.parseEventsOfWrapper();return X.createElement(HI,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},X.createElement("div",Rc({className:Yt("recharts-wrapper",E),style:Te({position:"relative",cursor:"default",width:P,height:R},M)},Y,{ref:function(O){_.container=O}}),X.createElement(YS,Rc({},H,{width:P,height:R,title:U,desc:F,style:phe}),this.renderClipPath(),RT(k,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(m.Component);$t(j,"displayName",n),$t(j,"defaultProps",Te({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},p)),$t(j,"getDerivedStateFromProps",function(y,S){var N=y.dataKey,_=y.data,A=y.children,k=y.width,E=y.height,P=y.layout,R=y.stackOffset,M=y.margin,D=S.dataStartIndex,U=S.dataEndIndex;if(S.updateId===void 0){var F=p$(y);return Te(Te(Te({},F),{},{updateId:0},x(Te(Te({props:y},F),{},{updateId:0}),S)),{},{prevDataKey:N,prevData:_,prevWidth:k,prevHeight:E,prevLayout:P,prevStackOffset:R,prevMargin:M,prevChildren:A})}if(N!==S.prevDataKey||_!==S.prevData||k!==S.prevWidth||E!==S.prevHeight||P!==S.prevLayout||R!==S.prevStackOffset||!Dc(M,S.prevMargin)){var G=p$(y),H={chartX:S.chartX,chartY:S.chartY,isTooltipActive:S.isTooltipActive},L=Te(Te({},f$(S,_,P)),{},{updateId:S.updateId+1}),I=Te(Te(Te({},G),H),L);return Te(Te(Te({},I),x(Te({props:y},I),S)),{},{prevDataKey:N,prevData:_,prevWidth:k,prevHeight:E,prevLayout:P,prevStackOffset:R,prevMargin:M,prevChildren:A})}if(!KS(A,S.prevChildren)){var Y,W,O,Q,q=hs(A,ou),z=q&&(Y=(W=q.props)===null||W===void 0?void 0:W.startIndex)!==null&&Y!==void 0?Y:D,K=q&&(O=(Q=q.props)===null||Q===void 0?void 0:Q.endIndex)!==null&&O!==void 0?O:U,J=z!==D||K!==U,ne=!Ht(_),he=ne&&!J?S.updateId:S.updateId+1;return Te(Te({updateId:he},x(Te(Te({props:y},S),{},{updateId:he,dataStartIndex:z,dataEndIndex:K}),S)),{},{prevChildren:A,dataStartIndex:z,dataEndIndex:K})}return null}),$t(j,"renderActiveDot",function(y,S,N){var _;return m.isValidElement(y)?_=m.cloneElement(y,S):Vt(y)?_=y(S):_=X.createElement(hv,S),X.createElement(cn,{className:"recharts-active-dot",key:N},_)});var b=m.forwardRef(function(S,N){return X.createElement(j,Rc({},S,{ref:N}))});return b.displayName=j.displayName,b},fN=u_({chartName:"LineChart",GraphicalChild:jl,axisComponents:[{axisType:"xAxis",AxisComp:yo},{axisType:"yAxis",AxisComp:bo}],formatAxisMap:qF}),She=u_({chartName:"BarChart",GraphicalChild:zl,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:yo},{axisType:"yAxis",AxisComp:bo}],formatAxisMap:qF}),Nhe=u_({chartName:"PieChart",GraphicalChild:Mi,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:xv},{axisType:"radiusAxis",AxisComp:gv}],formatAxisMap:jie,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});function d_(e){const t=Array.from(new Map(e.scenarios.map(v=>{const x=String(v.scenarioId??"").trim(),j=String(v.scenarioName??"").trim();return!x&&!j?null:[x||j,j||x]}).filter(v=>!!v)).values()),n=e.scenarios.map(v=>v.agentName||v.agentId).filter(Boolean),r=Array.from(new Set(n.length>0?n:e.rerunAgents??[])),a=Array.from(new Set(e.scenarios.map(v=>v.model).filter(v=>!!v))),i=t.slice(0,2).join(", "),o=t.length>2?` +${t.length-2}`:"",c=a.slice(0,2).join(", "),d=a.length>2?` +${a.length-2}`:"",f=e.configName?.trim()||"",h=e.configPath?.trim()||"",p=f&&h?`${f} · ${h}`:f||h;return{scenarioCount:t.length,agentCount:r.length,scopePreview:p||(i?`${i}${o}`:"n/a"),modelSummary:c?`${c}${d}`:""}}function il(e){const t=typeof e.toolTokensTotal=="number"?e.toolTokensTotal:null;return{id:e.runId,configId:"",configHash:e.configHash,configPath:e.configPath,configName:e.configName,rerunAgents:e.rerunAgents,rerunScenarioIds:e.rerunScenarioIds,rerunServerOverrideAll:e.rerunServerOverrideAll,rerunScenarioServerOverrides:e.rerunScenarioServerOverrides,timestamp:e.timestamp,runNote:e.runNote,mcpServerVersions:{},scenarios:(e.scenarioIds??[]).map((n,r)=>({scenarioId:n,scenarioName:e.scenarioNames?.[r]??n,agentId:"",agentName:"",runs:[],passRate:0,avgToolCalls:0,avgDuration:0})),assistantTokenUsage:null,toolTokenUsage:t===null?null:{inputTokens:null,outputTokens:null,totalTokens:t},overallPassRate:e.passRate,totalScenarios:e.totalScenarios,totalRuns:e.totalRuns,avgToolCalls:e.avgToolCalls,avgLatency:Math.round(e.avgLatencyMs??0),totalDurationMs:typeof e.totalDurationMs=="number"?Math.max(0,e.totalDurationMs):void 0,totalToolDurationMs:typeof e.totalToolDurationMs=="number"?Math.max(0,e.totalToolDurationMs):void 0}}const m$=10080*60*1e3;function g$(e){return e.length===0?0:e.reduce((t,n)=>t+n,0)/e.length}function v$(e,t=0){const n=Number(e.toFixed(t));return`${n>0?"+":""}${n.toFixed(t)}`}const Che=()=>{const{configs:e}=Yf(),{source:t}=On(),[n,r]=m.useState(!0),[a,i]=m.useState([]),[o,c]=m.useState([]),[d,f]=m.useState([]),[h,p]=m.useState("timestamp"),[v,x]=m.useState("desc"),j=I=>{if(h===I){x(Y=>Y==="asc"?"desc":"asc");return}p(I),x("desc")};m.useEffect(()=>{let I=!0;r(!0);const Y=Date.now(),W=Y-720*60*60*1e3,O=Y-m$,Q=O-m$,q=new Date(W).toISOString(),z=new Date(O).toISOString(),K=new Date(Q).toISOString(),J=new Date(O-1).toISOString(),ne=new Date(Y).toISOString(),he=async(ie,me)=>t.listRunSummaries?(await t.listRunSummaries({since:ie,until:me})).map(il):t.listResults({since:ie,until:me});return Promise.all([t.listResults({since:q,until:ne}),he(z,ne),he(K,J)]).then(([ie,me,se])=>{I&&(i(ie),c(me),f(se))}).finally(()=>{I&&r(!1)}),()=>{I=!1}},[t]);const b=e.length,y=a.length,S=o.length===0?0:o.reduce((I,Y)=>I+Y.overallPassRate,0)/o.length,N=o.length===0?0:Math.round(o.reduce((I,Y)=>I+Y.avgLatency,0)/o.length),_=g$(d.map(I=>I.overallPassRate)),A=g$(d.map(I=>I.avgLatency)),k=(S-_)*100,E=N-A,P=d.length>0,R=P?`${v$(k,1)}% from last week`:"No prior-week baseline",M=P?`${v$(E,0)}ms from last week`:"No prior-week baseline",D=P?k>0?"up":k<0?"down":"neutral":"neutral",U=P?E<0?"up":E>0?"down":"neutral":"neutral",F=m.useMemo(()=>[...a].sort((Y,W)=>{let O=0;return h==="timestamp"&&(O=new Date(Y.timestamp).getTime()-new Date(W.timestamp).getTime()),h==="passRate"&&(O=Y.overallPassRate-W.overallPassRate),h==="latency"&&(O=Y.avgLatency-W.avgLatency),h==="scenarios"&&(O=Y.totalScenarios-W.totalScenarios),v==="asc"?O:-O}),[a,h,v]),G=F.slice(0,20),H=I=>{const Y=I.toolTokenUsage?.totalTokens;return typeof Y=="number"?Y.toLocaleString():"n/a"},L=[...F].reverse().map(I=>({date:new Date(I.timestamp).toLocaleDateString("en-US",{month:"short",day:"numeric"}),passRate:Math.round(I.overallPassRate*100),latency:I.avgLatency}));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(BD,{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(Z,{asChild:!0,children:s.jsxs(Tt,{to:"/mcp-evaluations/new",children:[s.jsx(UN,{className:"mr-2 h-4 w-4"}),"New MCP Evaluation"]})}),s.jsx(Z,{variant:"outline",asChild:!0,children:s.jsxs(Tt,{to:"/run",children:[s.jsx(va,{className:"mr-2 h-4 w-4"}),"Run Evaluation"]})}),s.jsx(Z,{variant:"outline",asChild:!0,children:s.jsxs(Tt,{to:"/results",children:[s.jsx(Bc,{className:"mr-2 h-4 w-4"}),"Browse Results"]})})]})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsx(Os,{title:"MCP Evaluations",value:b,icon:NS,subtitle:`${b} active`}),s.jsx(Os,{title:"Total Runs",value:y,icon:MD,subtitle:"Last 30 days"}),s.jsx(Os,{title:"Pass Rate",value:n?"—":`${Math.round(S*100)}%`,icon:Bc,subtitle:n?"Loading...":R,trend:n?"neutral":D}),s.jsx(Os,{title:"Avg Latency",value:n?"—":`${N}ms`,icon:WD,subtitle:n?"Loading...":M,trend:n?"neutral":U})]}),s.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[s.jsxs(nt,{children:[s.jsx(Lt,{className:"pb-3",children:s.jsx(Ft,{className:"text-base",children:"Pass Rate Trend"})}),s.jsx(rt,{children:s.jsx(vm,{width:"100%",height:200,children:s.jsxs(fN,{data:L,children:[s.jsx(yo,{dataKey:"date",tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(bo,{domain:[0,100],tick:{fontSize:11},tickLine:!1,axisLine:!1,tickFormatter:I=>`${I}%`}),s.jsx(Qr,{formatter:I=>[`${I}%`,"Pass Rate"]}),s.jsx(jl,{type:"monotone",dataKey:"passRate",stroke:"hsl(38, 92%, 50%)",strokeWidth:2,dot:{r:3,fill:"hsl(38, 92%, 50%)"}})]})})})]}),s.jsxs(nt,{children:[s.jsx(Lt,{className:"pb-3",children:s.jsx(Ft,{className:"text-base",children:"Recent Tool Latency (ms)"})}),s.jsx(rt,{children:s.jsx(vm,{width:"100%",height:200,children:s.jsxs(fN,{data:L,children:[s.jsx(yo,{dataKey:"date",tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(bo,{tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(Qr,{formatter:I=>[`${I}ms`,"Latency"]}),s.jsx(jl,{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(nt,{children:[s.jsx(Lt,{className:"pb-3",children:s.jsx(Ft,{className:"text-base",children:"Recent Runs"})}),s.jsxs(rt,{className:"p-0",children:[s.jsxs(Jr,{children:[s.jsx(es,{children:s.jsxs(Gt,{children:[s.jsx(ht,{children:"Run ID"}),s.jsx(ht,{children:"Evaluated"}),s.jsx(ht,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>j("timestamp"),children:["Timestamp",h==="timestamp"?v==="asc"?s.jsx(ma,{className:"h-3.5 w-3.5"}):s.jsx(tn,{className:"h-3.5 w-3.5"}):s.jsx(Oc,{className:"h-3.5 w-3.5 text-muted-foreground"})]})}),s.jsx(ht,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex w-full items-center justify-end gap-1 hover:text-foreground",onClick:()=>j("passRate"),children:["Pass Rate",h==="passRate"?v==="asc"?s.jsx(ma,{className:"h-3.5 w-3.5"}):s.jsx(tn,{className:"h-3.5 w-3.5"}):s.jsx(Oc,{className:"h-3.5 w-3.5 text-muted-foreground"})]})}),s.jsx(ht,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>j("scenarios"),children:["Scenarios",h==="scenarios"?v==="asc"?s.jsx(ma,{className:"h-3.5 w-3.5"}):s.jsx(tn,{className:"h-3.5 w-3.5"}):s.jsx(Oc,{className:"h-3.5 w-3.5 text-muted-foreground"})]})}),s.jsx(ht,{className:"text-right",children:"Avg Tool Calls"}),s.jsx(ht,{className:"text-right",children:"Tool Tokens"})]})}),s.jsxs(ts,{children:[G.length===0&&s.jsx(Gt,{children:s.jsx(He,{colSpan:7,className:"py-8 text-center text-sm text-muted-foreground",children:"No runs in the past 30 days."})}),G.map(I=>s.jsxs(Gt,{className:"cursor-pointer",children:[s.jsx(He,{children:s.jsx(Tt,{to:`/results/${I.id}`,className:"font-mono text-xs text-primary hover:underline",children:I.id})}),s.jsx(He,{className:"text-[11px] text-muted-foreground",children:(()=>{const Y=d_(I);return s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:["Evaluated: ",Y.scenarioCount," scenario",Y.scenarioCount===1?"":"s"," · ",Y.agentCount," agent",Y.agentCount===1?"":"s",Y.modelSummary?` · ${Y.modelSummary}`:""]}),s.jsx("div",{className:"font-mono text-xs text-foreground/80",children:Y.scopePreview})]})})()}),s.jsx(He,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(xa,{className:"h-3 w-3"}),new Date(I.timestamp).toLocaleString()]})}),s.jsx(He,{className:"text-right",children:s.jsxs("div",{className:"flex flex-col items-end gap-1",children:[s.jsx(Ma,{rate:I.overallPassRate}),s.jsx(aL,{run:I})]})}),s.jsx(He,{className:"text-right font-mono text-sm",children:I.totalScenarios}),s.jsx(He,{className:"text-right font-mono text-sm",children:I.avgToolCalls.toFixed(0)}),s.jsx(He,{className:"text-right font-mono text-sm",children:H(I)})]},I.id))]})]}),F.length>20&&s.jsx("div",{className:"border-t p-4 text-center",children:s.jsx(Z,{variant:"outline",asChild:!0,children:s.jsx(Tt,{to:"/results",children:"Show more"})})})]})]})})]})};function f_({value:e,onValueChange:t,placeholder:n="Search...",className:r,inputClassName:a,clearAriaLabel:i="Clear search"}){return s.jsxs("div",{className:Re("relative",r),children:[s.jsx(Et,{value:e,onChange:o=>t(o.target.value),placeholder:n,className:Re("h-9 w-[240px] pr-8",a)}),e&&s.jsx(Z,{type:"button",variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 h-7 w-7 -translate-y-1/2 border border-border/60",onClick:()=>t(""),"aria-label":i,children:s.jsx(ns,{className:"h-4 w-4"})})]})}var _he=m.createContext(void 0);function Iu(e){const t=m.useContext(_he);return e||t||"ltr"}var Jj="rovingFocusGroup.onEntryFocus",Ahe={bubbles:!1,cancelable:!0},ap="RovingFocusGroup",[pN,Cz,khe]=Ff(ap),[Ehe,kv]=Sr(ap,[khe]),[Phe,The]=Ehe(ap),_z=m.forwardRef((e,t)=>s.jsx(pN.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(pN.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(Rhe,{...e,ref:t})})}));_z.displayName=ap;var Rhe=m.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,v=m.useRef(null),x=Mt(t,v),j=Iu(i),[b,y]=js({prop:o,defaultProp:c??null,onChange:d,caller:ap}),[S,N]=m.useState(!1),_=Gn(f),A=Cz(n),k=m.useRef(!1),[E,P]=m.useState(0);return m.useEffect(()=>{const R=v.current;if(R)return R.addEventListener(Jj,_),()=>R.removeEventListener(Jj,_)},[_]),s.jsx(Phe,{scope:n,orientation:r,dir:j,loop:a,currentTabStopId:b,onItemFocus:m.useCallback(R=>y(R),[y]),onItemShiftTab:m.useCallback(()=>N(!0),[]),onFocusableItemAdd:m.useCallback(()=>P(R=>R+1),[]),onFocusableItemRemove:m.useCallback(()=>P(R=>R-1),[]),children:s.jsx(ft.div,{tabIndex:S||E===0?-1:0,"data-orientation":r,...p,ref:x,style:{outline:"none",...e.style},onMouseDown:qe(e.onMouseDown,()=>{k.current=!0}),onFocus:qe(e.onFocus,R=>{const M=!k.current;if(R.target===R.currentTarget&&M&&!S){const D=new CustomEvent(Jj,Ahe);if(R.currentTarget.dispatchEvent(D),!D.defaultPrevented){const U=A().filter(I=>I.focusable),F=U.find(I=>I.active),G=U.find(I=>I.id===b),L=[F,G,...U].filter(Boolean).map(I=>I.ref.current);Ez(L,h)}}k.current=!1}),onBlur:qe(e.onBlur,()=>N(!1))})})}),Az="RovingFocusGroupItem",kz=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:i,children:o,...c}=e,d=ar(),f=i||d,h=The(Az,n),p=h.currentTabStopId===f,v=Cz(n),{onFocusableItemAdd:x,onFocusableItemRemove:j,currentTabStopId:b}=h;return m.useEffect(()=>{if(r)return x(),()=>j()},[r,x,j]),s.jsx(pN.ItemSlot,{scope:n,id:f,focusable:r,active:a,children:s.jsx(ft.span,{tabIndex:p?0:-1,"data-orientation":h.orientation,...c,ref:t,onMouseDown:qe(e.onMouseDown,y=>{r?h.onItemFocus(f):y.preventDefault()}),onFocus:qe(e.onFocus,()=>h.onItemFocus(f)),onKeyDown:qe(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){h.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const S=Ihe(y,h.orientation,h.dir);if(S!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let _=v().filter(A=>A.focusable).map(A=>A.ref.current);if(S==="last")_.reverse();else if(S==="prev"||S==="next"){S==="prev"&&_.reverse();const A=_.indexOf(y.currentTarget);_=h.loop?$he(_,A+1):_.slice(A+1)}setTimeout(()=>Ez(_))}}),children:typeof o=="function"?o({isCurrentTabStop:p,hasTabStop:b!=null}):o})})});kz.displayName=Az;var Ohe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Mhe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Ihe(e,t,n){const r=Mhe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Ohe[r]}function Ez(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function $he(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Pz=_z,Tz=kz;function Dhe(e){const t=Lhe(e),n=m.forwardRef((r,a)=>{const{children:i,...o}=r,c=m.Children.toArray(i),d=c.find(zhe);if(d){const f=d.props.children,h=c.map(p=>p===d?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function Lhe(e){const t=m.forwardRef((n,r)=>{const{children:a,...i}=n;if(m.isValidElement(a)){const o=qhe(a),c=Bhe(i,a.props);return a.type!==m.Fragment&&(c.ref=r?zr(r,o):o),m.cloneElement(a,c)}return m.Children.count(a)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Fhe=Symbol("radix.slottable");function zhe(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Fhe}function Bhe(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 qhe(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 hN=["Enter"," "],Uhe=["ArrowDown","PageUp","Home"],Rz=["ArrowUp","PageDown","End"],Whe=[...Uhe,...Rz],Vhe={ltr:[...hN,"ArrowRight"],rtl:[...hN,"ArrowLeft"]},Hhe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ip="Menu",[If,Khe,Ghe]=Ff(ip),[Bl,Oz]=Sr(ip,[Ghe,jo,kv]),Ev=jo(),Mz=kv(),[Yhe,ql]=Bl(ip),[Xhe,op]=Bl(ip),Iz=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:i,modal:o=!0}=e,c=Ev(t),[d,f]=m.useState(null),h=m.useRef(!1),p=Gn(i),v=Iu(a);return m.useEffect(()=>{const x=()=>{h.current=!0,document.addEventListener("pointerdown",j,{capture:!0,once:!0}),document.addEventListener("pointermove",j,{capture:!0,once:!0})},j=()=>h.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",j,{capture:!0}),document.removeEventListener("pointermove",j,{capture:!0})}},[]),s.jsx(Ag,{...c,children:s.jsx(Yhe,{scope:t,open:n,onOpenChange:p,content:d,onContentChange:f,children:s.jsx(Xhe,{scope:t,onClose:m.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:h,dir:v,modal:o,children:r})})})};Iz.displayName=ip;var Qhe="MenuAnchor",p_=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=Ev(n);return s.jsx(qf,{...a,...r,ref:t})});p_.displayName=Qhe;var h_="MenuPortal",[Zhe,$z]=Bl(h_,{forceMount:void 0}),Dz=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:a}=e,i=ql(h_,t);return s.jsx(Zhe,{scope:t,forceMount:n,children:s.jsx(Zn,{present:n||i.open,children:s.jsx(Rl,{asChild:!0,container:a,children:r})})})};Dz.displayName=h_;var Ls="MenuContent",[Jhe,m_]=Bl(Ls),Lz=m.forwardRef((e,t)=>{const n=$z(Ls,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=ql(Ls,e.__scopeMenu),o=op(Ls,e.__scopeMenu);return s.jsx(If.Provider,{scope:e.__scopeMenu,children:s.jsx(Zn,{present:r||i.open,children:s.jsx(If.Slot,{scope:e.__scopeMenu,children:o.modal?s.jsx(eme,{...a,ref:t}):s.jsx(tme,{...a,ref:t})})})})}),eme=m.forwardRef((e,t)=>{const n=ql(Ls,e.__scopeMenu),r=m.useRef(null),a=Mt(t,r);return m.useEffect(()=>{const i=r.current;if(i)return Fg(i)},[]),s.jsx(g_,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:qe(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),tme=m.forwardRef((e,t)=>{const n=ql(Ls,e.__scopeMenu);return s.jsx(g_,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),nme=Dhe("MenuContent.ScrollLock"),g_=m.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:v,onDismiss:x,disableOutsideScroll:j,...b}=e,y=ql(Ls,n),S=op(Ls,n),N=Ev(n),_=Mz(n),A=Khe(n),[k,E]=m.useState(null),P=m.useRef(null),R=Mt(t,P,y.onContentChange),M=m.useRef(0),D=m.useRef(""),U=m.useRef(0),F=m.useRef(null),G=m.useRef("right"),H=m.useRef(0),L=j?Vf:m.Fragment,I=j?{as:nme,allowPinchZoom:!0}:void 0,Y=O=>{const Q=D.current+O,q=A().filter(ie=>!ie.disabled),z=document.activeElement,K=q.find(ie=>ie.ref.current===z)?.textValue,J=q.map(ie=>ie.textValue),ne=hme(J,Q,K),he=q.find(ie=>ie.textValue===ne)?.ref.current;(function ie(me){D.current=me,window.clearTimeout(M.current),me!==""&&(M.current=window.setTimeout(()=>ie(""),1e3))})(Q),he&&setTimeout(()=>he.focus())};m.useEffect(()=>()=>window.clearTimeout(M.current),[]),Dg();const W=m.useCallback(O=>G.current===F.current?.side&&gme(O,F.current?.area),[]);return s.jsx(Jhe,{scope:n,searchRef:D,onItemEnter:m.useCallback(O=>{W(O)&&O.preventDefault()},[W]),onItemLeave:m.useCallback(O=>{W(O)||(P.current?.focus(),E(null))},[W]),onTriggerLeave:m.useCallback(O=>{W(O)&&O.preventDefault()},[W]),pointerGraceTimerRef:U,onPointerGraceIntentChange:m.useCallback(O=>{F.current=O},[]),children:s.jsx(L,{...I,children:s.jsx(Wf,{asChild:!0,trapped:a,onMountAutoFocus:qe(i,O=>{O.preventDefault(),P.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:s.jsx(Tl,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:v,onDismiss:x,children:s.jsx(Pz,{asChild:!0,..._,dir:S.dir,orientation:"vertical",loop:r,currentTabStopId:k,onCurrentTabStopIdChange:E,onEntryFocus:qe(d,O=>{S.isUsingKeyboardRef.current||O.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(kg,{role:"menu","aria-orientation":"vertical","data-state":eB(y.open),"data-radix-menu-content":"",dir:S.dir,...N,...b,ref:R,style:{outline:"none",...b.style},onKeyDown:qe(b.onKeyDown,O=>{const q=O.target.closest("[data-radix-menu-content]")===O.currentTarget,z=O.ctrlKey||O.altKey||O.metaKey,K=O.key.length===1;q&&(O.key==="Tab"&&O.preventDefault(),!z&&K&&Y(O.key));const J=P.current;if(O.target!==J||!Whe.includes(O.key))return;O.preventDefault();const he=A().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);Rz.includes(O.key)&&he.reverse(),fme(he)}),onBlur:qe(e.onBlur,O=>{O.currentTarget.contains(O.target)||(window.clearTimeout(M.current),D.current="")}),onPointerMove:qe(e.onPointerMove,$f(O=>{const Q=O.target,q=H.current!==O.clientX;if(O.currentTarget.contains(Q)&&q){const z=O.clientX>H.current?"right":"left";G.current=z,H.current=O.clientX}}))})})})})})})});Lz.displayName=Ls;var rme="MenuGroup",v_=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(ft.div,{role:"group",...r,ref:t})});v_.displayName=rme;var sme="MenuLabel",Fz=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(ft.div,{...r,ref:t})});Fz.displayName=sme;var og="MenuItem",x$="menu.itemSelect",Pv=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...a}=e,i=m.useRef(null),o=op(og,e.__scopeMenu),c=m_(og,e.__scopeMenu),d=Mt(t,i),f=m.useRef(!1),h=()=>{const p=i.current;if(!n&&p){const v=new CustomEvent(x$,{bubbles:!0,cancelable:!0});p.addEventListener(x$,x=>r?.(x),{once:!0}),$N(p,v),v.defaultPrevented?f.current=!1:o.onClose()}};return s.jsx(zz,{...a,ref:d,disabled:n,onClick:qe(e.onClick,h),onPointerDown:p=>{e.onPointerDown?.(p),f.current=!0},onPointerUp:qe(e.onPointerUp,p=>{f.current||p.currentTarget?.click()}),onKeyDown:qe(e.onKeyDown,p=>{const v=c.searchRef.current!=="";n||v&&p.key===" "||hN.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});Pv.displayName=og;var zz=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:a,...i}=e,o=m_(og,n),c=Mz(n),d=m.useRef(null),f=Mt(t,d),[h,p]=m.useState(!1),[v,x]=m.useState("");return m.useEffect(()=>{const j=d.current;j&&x((j.textContent??"").trim())},[i.children]),s.jsx(If.ItemSlot,{scope:n,disabled:r,textValue:a??v,children:s.jsx(Tz,{asChild:!0,...c,focusable:!r,children:s.jsx(ft.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:f,onPointerMove:qe(e.onPointerMove,$f(j=>{r?o.onItemLeave(j):(o.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:qe(e.onPointerLeave,$f(j=>o.onItemLeave(j))),onFocus:qe(e.onFocus,()=>p(!0)),onBlur:qe(e.onBlur,()=>p(!1))})})})}),ame="MenuCheckboxItem",Bz=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...a}=e;return s.jsx(Hz,{scope:e.__scopeMenu,checked:n,children:s.jsx(Pv,{role:"menuitemcheckbox","aria-checked":lg(n)?"mixed":n,...a,ref:t,"data-state":y_(n),onSelect:qe(a.onSelect,()=>r?.(lg(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Bz.displayName=ame;var qz="MenuRadioGroup",[ime,ome]=Bl(qz,{value:void 0,onValueChange:()=>{}}),Uz=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...a}=e,i=Gn(r);return s.jsx(ime,{scope:e.__scopeMenu,value:n,onValueChange:i,children:s.jsx(v_,{...a,ref:t})})});Uz.displayName=qz;var Wz="MenuRadioItem",Vz=m.forwardRef((e,t)=>{const{value:n,...r}=e,a=ome(Wz,e.__scopeMenu),i=n===a.value;return s.jsx(Hz,{scope:e.__scopeMenu,checked:i,children:s.jsx(Pv,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":y_(i),onSelect:qe(r.onSelect,()=>a.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Vz.displayName=Wz;var x_="MenuItemIndicator",[Hz,lme]=Bl(x_,{checked:!1}),Kz=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...a}=e,i=lme(x_,n);return s.jsx(Zn,{present:r||lg(i.checked)||i.checked===!0,children:s.jsx(ft.span,{...a,ref:t,"data-state":y_(i.checked)})})});Kz.displayName=x_;var cme="MenuSeparator",Gz=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(ft.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Gz.displayName=cme;var ume="MenuArrow",Yz=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=Ev(n);return s.jsx(Eg,{...a,...r,ref:t})});Yz.displayName=ume;var dme="MenuSub",[t0e,Xz]=Bl(dme),Id="MenuSubTrigger",Qz=m.forwardRef((e,t)=>{const n=ql(Id,e.__scopeMenu),r=op(Id,e.__scopeMenu),a=Xz(Id,e.__scopeMenu),i=m_(Id,e.__scopeMenu),o=m.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:d}=i,f={__scopeMenu:e.__scopeMenu},h=m.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return m.useEffect(()=>h,[h]),m.useEffect(()=>{const p=c.current;return()=>{window.clearTimeout(p),d(null)}},[c,d]),s.jsx(p_,{asChild:!0,...f,children:s.jsx(zz,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":eB(n.open),...e,ref:zr(t,a.onTriggerChange),onClick:p=>{e.onClick?.(p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:qe(e.onPointerMove,$f(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:qe(e.onPointerLeave,$f(p=>{h();const v=n.content?.getBoundingClientRect();if(v){const x=n.content?.dataset.side,j=x==="right",b=j?-5:5,y=v[j?"left":"right"],S=v[j?"right":"left"];i.onPointerGraceIntentChange({area:[{x:p.clientX+b,y:p.clientY},{x:y,y:v.top},{x:S,y:v.top},{x:S,y:v.bottom},{x:y,y:v.bottom}],side:x}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(p),p.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:qe(e.onKeyDown,p=>{const v=i.searchRef.current!=="";e.disabled||v&&p.key===" "||Vhe[r.dir].includes(p.key)&&(n.onOpenChange(!0),n.content?.focus(),p.preventDefault())})})})});Qz.displayName=Id;var Zz="MenuSubContent",Jz=m.forwardRef((e,t)=>{const n=$z(Ls,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=ql(Ls,e.__scopeMenu),o=op(Ls,e.__scopeMenu),c=Xz(Zz,e.__scopeMenu),d=m.useRef(null),f=Mt(t,d);return s.jsx(If.Provider,{scope:e.__scopeMenu,children:s.jsx(Zn,{present:r||i.open,children:s.jsx(If.Slot,{scope:e.__scopeMenu,children:s.jsx(g_,{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:qe(e.onFocusOutside,h=>{h.target!==c.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:qe(e.onEscapeKeyDown,h=>{o.onClose(),h.preventDefault()}),onKeyDown:qe(e.onKeyDown,h=>{const p=h.currentTarget.contains(h.target),v=Hhe[o.dir].includes(h.key);p&&v&&(i.onOpenChange(!1),c.trigger?.focus(),h.preventDefault())})})})})})});Jz.displayName=Zz;function eB(e){return e?"open":"closed"}function lg(e){return e==="indeterminate"}function y_(e){return lg(e)?"indeterminate":e?"checked":"unchecked"}function fme(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function pme(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function hme(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=pme(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 mme(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,v=d.y;h>r!=v>r&&n<(p-f)*(r-h)/(v-h)+f&&(a=!a)}return a}function gme(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return mme(n,t)}function $f(e){return t=>t.pointerType==="mouse"?e(t):void 0}var vme=Iz,xme=p_,yme=Dz,bme=Lz,wme=v_,jme=Fz,Sme=Pv,Nme=Bz,Cme=Uz,_me=Vz,Ame=Kz,kme=Gz,Eme=Yz,Pme=Qz,Tme=Jz,Tv="DropdownMenu",[Rme]=Sr(Tv,[Oz]),Br=Oz(),[Ome,tB]=Rme(Tv),nB=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:a,defaultOpen:i,onOpenChange:o,modal:c=!0}=e,d=Br(t),f=m.useRef(null),[h,p]=js({prop:a,defaultProp:i??!1,onChange:o,caller:Tv});return s.jsx(Ome,{scope:t,triggerId:ar(),triggerRef:f,contentId:ar(),open:h,onOpenChange:p,onOpenToggle:m.useCallback(()=>p(v=>!v),[p]),modal:c,children:s.jsx(vme,{...d,open:h,onOpenChange:p,dir:r,modal:c,children:n})})};nB.displayName=Tv;var rB="DropdownMenuTrigger",sB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...a}=e,i=tB(rB,n),o=Br(n);return s.jsx(xme,{asChild:!0,...o,children:s.jsx(ft.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:zr(t,i.triggerRef),onPointerDown:qe(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(i.onOpenToggle(),i.open||c.preventDefault())}),onKeyDown:qe(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&i.onOpenToggle(),c.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});sB.displayName=rB;var Mme="DropdownMenuPortal",aB=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Br(t);return s.jsx(yme,{...r,...n})};aB.displayName=Mme;var iB="DropdownMenuContent",oB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=tB(iB,n),i=Br(n),o=m.useRef(!1);return s.jsx(bme,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...r,ref:t,onCloseAutoFocus:qe(e.onCloseAutoFocus,c=>{o.current||a.triggerRef.current?.focus(),o.current=!1,c.preventDefault()}),onInteractOutside:qe(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)"}})});oB.displayName=iB;var Ime="DropdownMenuGroup",$me=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Br(n);return s.jsx(wme,{...a,...r,ref:t})});$me.displayName=Ime;var Dme="DropdownMenuLabel",lB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Br(n);return s.jsx(jme,{...a,...r,ref:t})});lB.displayName=Dme;var Lme="DropdownMenuItem",cB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Br(n);return s.jsx(Sme,{...a,...r,ref:t})});cB.displayName=Lme;var Fme="DropdownMenuCheckboxItem",uB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Br(n);return s.jsx(Nme,{...a,...r,ref:t})});uB.displayName=Fme;var zme="DropdownMenuRadioGroup",Bme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Br(n);return s.jsx(Cme,{...a,...r,ref:t})});Bme.displayName=zme;var qme="DropdownMenuRadioItem",dB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Br(n);return s.jsx(_me,{...a,...r,ref:t})});dB.displayName=qme;var Ume="DropdownMenuItemIndicator",fB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Br(n);return s.jsx(Ame,{...a,...r,ref:t})});fB.displayName=Ume;var Wme="DropdownMenuSeparator",pB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Br(n);return s.jsx(kme,{...a,...r,ref:t})});pB.displayName=Wme;var Vme="DropdownMenuArrow",Hme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Br(n);return s.jsx(Eme,{...a,...r,ref:t})});Hme.displayName=Vme;var Kme="DropdownMenuSubTrigger",hB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Br(n);return s.jsx(Pme,{...a,...r,ref:t})});hB.displayName=Kme;var Gme="DropdownMenuSubContent",mB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Br(n);return s.jsx(Tme,{...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)"}})});mB.displayName=Gme;var Yme=nB,Xme=sB,Qme=aB,gB=oB,vB=lB,xB=cB,yB=uB,bB=dB,wB=fB,jB=pB,SB=hB,NB=mB;const lp=Yme,cp=Xme,Zme=m.forwardRef(({className:e,inset:t,children:n,...r},a)=>s.jsxs(SB,{ref:a,className:Re("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(zN,{className:"ml-auto h-4 w-4"})]}));Zme.displayName=SB.displayName;const Jme=m.forwardRef(({className:e,...t},n)=>s.jsx(NB,{ref:n,className:Re("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}));Jme.displayName=NB.displayName;const $u=m.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(Qme,{children:s.jsx(gB,{ref:r,sideOffset:t,className:Re("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})}));$u.displayName=gB.displayName;const Mr=m.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(xB,{ref:r,className:Re("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}));Mr.displayName=xB.displayName;const ege=m.forwardRef(({className:e,children:t,checked:n,...r},a)=>s.jsxs(yB,{ref:a,className:Re("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(wB,{children:s.jsx(qc,{className:"h-4 w-4"})})}),t]}));ege.displayName=yB.displayName;const tge=m.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(bB,{ref:r,className:Re("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(wB,{children:s.jsx(C9,{className:"h-2 w-2 fill-current"})})}),t]}));tge.displayName=bB.displayName;const CB=m.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(vB,{ref:r,className:Re("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));CB.displayName=vB.displayName;const _B=m.forwardRef(({className:e,...t},n)=>s.jsx(jB,{ref:n,className:Re("-mx-1 my-1 h-px bg-muted",e),...t}));_B.displayName=jB.displayName;function Df(e,[t,n]){return Math.min(n,Math.max(t,e))}function nge(e){const t=rge(e),n=m.forwardRef((r,a)=>{const{children:i,...o}=r,c=m.Children.toArray(i),d=c.find(age);if(d){const f=d.props.children,h=c.map(p=>p===d?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function rge(e){const t=m.forwardRef((n,r)=>{const{children:a,...i}=n;if(m.isValidElement(a)){const o=oge(a),c=ige(i,a.props);return a.type!==m.Fragment&&(c.ref=r?zr(r,o):o),m.cloneElement(a,c)}return m.Children.count(a)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var sge=Symbol("radix.slottable");function age(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sge}function ige(e,t){const n={...t};for(const r in t){const 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 oge(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 Rv(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var lge=[" ","Enter","ArrowUp","ArrowDown"],cge=[" ","Enter"],Sl="Select",[Ov,Mv,uge]=Ff(Sl),[Du]=Sr(Sl,[uge,jo]),Iv=jo(),[dge,ko]=Du(Sl),[fge,pge]=Du(Sl),AB=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:v,required:x,form:j}=e,b=Iv(t),[y,S]=m.useState(null),[N,_]=m.useState(null),[A,k]=m.useState(!1),E=Iu(f),[P,R]=js({prop:r,defaultProp:a??!1,onChange:i,caller:Sl}),[M,D]=js({prop:o,defaultProp:c,onChange:d,caller:Sl}),U=m.useRef(null),F=y?j||!!y.closest("form"):!0,[G,H]=m.useState(new Set),L=Array.from(G).map(I=>I.props.value).join(";");return s.jsx(Ag,{...b,children:s.jsxs(dge,{required:x,scope:t,trigger:y,onTriggerChange:S,valueNode:N,onValueNodeChange:_,valueNodeHasChildren:A,onValueNodeHasChildrenChange:k,contentId:ar(),value:M,onValueChange:D,open:P,onOpenChange:R,dir:E,triggerPointerDownPosRef:U,disabled:v,children:[s.jsx(Ov.Provider,{scope:t,children:s.jsx(fge,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(I=>{H(Y=>new Set(Y).add(I))},[]),onNativeOptionRemove:m.useCallback(I=>{H(Y=>{const W=new Set(Y);return W.delete(I),W})},[]),children:n})}),F?s.jsxs(QB,{"aria-hidden":!0,required:x,tabIndex:-1,name:h,autoComplete:p,value:M,onChange:I=>D(I.target.value),disabled:v,form:j,children:[M===void 0?s.jsx("option",{value:""}):null,Array.from(G)]},L):null]})})};AB.displayName=Sl;var kB="SelectTrigger",EB=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,i=Iv(n),o=ko(kB,n),c=o.disabled||r,d=Mt(t,o.onTriggerChange),f=Mv(n),h=m.useRef("touch"),[p,v,x]=JB(b=>{const y=f().filter(_=>!_.disabled),S=y.find(_=>_.value===o.value),N=e6(y,b,S);N!==void 0&&o.onValueChange(N.value)}),j=b=>{c||(o.onOpenChange(!0),x()),b&&(o.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return s.jsx(qf,{asChild:!0,...i,children:s.jsx(ft.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":ZB(o.value)?"":void 0,...a,ref:d,onClick:qe(a.onClick,b=>{b.currentTarget.focus(),h.current!=="mouse"&&j(b)}),onPointerDown:qe(a.onPointerDown,b=>{h.current=b.pointerType;const y=b.target;y.hasPointerCapture(b.pointerId)&&y.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(j(b),b.preventDefault())}),onKeyDown:qe(a.onKeyDown,b=>{const y=p.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&v(b.key),!(y&&b.key===" ")&&lge.includes(b.key)&&(j(),b.preventDefault())})})})});EB.displayName=kB;var PB="SelectValue",TB=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:i,placeholder:o="",...c}=e,d=ko(PB,n),{onValueNodeHasChildrenChange:f}=d,h=i!==void 0,p=Mt(t,d.onValueNodeChange);return ir(()=>{f(h)},[f,h]),s.jsx(ft.span,{...c,ref:p,style:{pointerEvents:"none"},children:ZB(d.value)?s.jsx(s.Fragment,{children:o}):i})});TB.displayName=PB;var hge="SelectIcon",RB=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return s.jsx(ft.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});RB.displayName=hge;var mge="SelectPortal",OB=e=>s.jsx(Rl,{asChild:!0,...e});OB.displayName=mge;var Nl="SelectContent",MB=m.forwardRef((e,t)=>{const n=ko(Nl,e.__scopeSelect),[r,a]=m.useState();if(ir(()=>{a(new DocumentFragment)},[]),!n.open){const i=r;return i?bu.createPortal(s.jsx(IB,{scope:e.__scopeSelect,children:s.jsx(Ov.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),i):null}return s.jsx($B,{...e,ref:t})});MB.displayName=Nl;var oa=10,[IB,Eo]=Du(Nl),gge="SelectContentImpl",vge=nge("SelectContent.RemoveScroll"),$B=m.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:v,collisionPadding:x,sticky:j,hideWhenDetached:b,avoidCollisions:y,...S}=e,N=ko(Nl,n),[_,A]=m.useState(null),[k,E]=m.useState(null),P=Mt(t,ie=>A(ie)),[R,M]=m.useState(null),[D,U]=m.useState(null),F=Mv(n),[G,H]=m.useState(!1),L=m.useRef(!1);m.useEffect(()=>{if(_)return Fg(_)},[_]),Dg();const I=m.useCallback(ie=>{const[me,...se]=F().map(fe=>fe.ref.current),[ge]=se.slice(-1),Oe=document.activeElement;for(const fe of ie)if(fe===Oe||(fe?.scrollIntoView({block:"nearest"}),fe===me&&k&&(k.scrollTop=0),fe===ge&&k&&(k.scrollTop=k.scrollHeight),fe?.focus(),document.activeElement!==Oe))return},[F,k]),Y=m.useCallback(()=>I([R,_]),[I,R,_]);m.useEffect(()=>{G&&Y()},[G,Y]);const{onOpenChange:W,triggerPointerDownPosRef:O}=N;m.useEffect(()=>{if(_){let ie={x:0,y:0};const me=ge=>{ie={x:Math.abs(Math.round(ge.pageX)-(O.current?.x??0)),y:Math.abs(Math.round(ge.pageY)-(O.current?.y??0))}},se=ge=>{ie.x<=10&&ie.y<=10?ge.preventDefault():_.contains(ge.target)||W(!1),document.removeEventListener("pointermove",me),O.current=null};return O.current!==null&&(document.addEventListener("pointermove",me),document.addEventListener("pointerup",se,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",me),document.removeEventListener("pointerup",se,{capture:!0})}}},[_,W,O]),m.useEffect(()=>{const ie=()=>W(!1);return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[W]);const[Q,q]=JB(ie=>{const me=F().filter(Oe=>!Oe.disabled),se=me.find(Oe=>Oe.ref.current===document.activeElement),ge=e6(me,ie,se);ge&&setTimeout(()=>ge.ref.current.focus())}),z=m.useCallback((ie,me,se)=>{const ge=!L.current&&!se;(N.value!==void 0&&N.value===me||ge)&&(M(ie),ge&&(L.current=!0))},[N.value]),K=m.useCallback(()=>_?.focus(),[_]),J=m.useCallback((ie,me,se)=>{const ge=!L.current&&!se;(N.value!==void 0&&N.value===me||ge)&&U(ie)},[N.value]),ne=r==="popper"?mN:DB,he=ne===mN?{side:c,sideOffset:d,align:f,alignOffset:h,arrowPadding:p,collisionBoundary:v,collisionPadding:x,sticky:j,hideWhenDetached:b,avoidCollisions:y}:{};return s.jsx(IB,{scope:n,content:_,viewport:k,onViewportChange:E,itemRefCallback:z,selectedItem:R,onItemLeave:K,itemTextRefCallback:J,focusSelectedItem:Y,selectedItemText:D,position:r,isPositioned:G,searchRef:Q,children:s.jsx(Vf,{as:vge,allowPinchZoom:!0,children:s.jsx(Wf,{asChild:!0,trapped:N.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:qe(a,ie=>{N.trigger?.focus({preventScroll:!0}),ie.preventDefault()}),children:s.jsx(Tl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:s.jsx(ne,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:ie=>ie.preventDefault(),...S,...he,onPlaced:()=>H(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:qe(S.onKeyDown,ie=>{const me=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!me&&ie.key.length===1&&q(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let ge=F().filter(Oe=>!Oe.disabled).map(Oe=>Oe.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(ge=ge.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const Oe=ie.target,fe=ge.indexOf(Oe);ge=ge.slice(fe+1)}setTimeout(()=>I(ge)),ie.preventDefault()}})})})})})})});$B.displayName=gge;var xge="SelectItemAlignedPosition",DB=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,i=ko(Nl,n),o=Eo(Nl,n),[c,d]=m.useState(null),[f,h]=m.useState(null),p=Mt(t,P=>h(P)),v=Mv(n),x=m.useRef(!1),j=m.useRef(!0),{viewport:b,selectedItem:y,selectedItemText:S,focusSelectedItem:N}=o,_=m.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&f&&b&&y&&S){const P=i.trigger.getBoundingClientRect(),R=f.getBoundingClientRect(),M=i.valueNode.getBoundingClientRect(),D=S.getBoundingClientRect();if(i.dir!=="rtl"){const Oe=D.left-R.left,fe=M.left-Oe,xe=P.left-fe,we=P.width+xe,ot=Math.max(we,R.width),lt=window.innerWidth-oa,ut=Df(fe,[oa,Math.max(oa,lt-ot)]);c.style.minWidth=we+"px",c.style.left=ut+"px"}else{const Oe=R.right-D.right,fe=window.innerWidth-M.right-Oe,xe=window.innerWidth-P.right-fe,we=P.width+xe,ot=Math.max(we,R.width),lt=window.innerWidth-oa,ut=Df(fe,[oa,Math.max(oa,lt-ot)]);c.style.minWidth=we+"px",c.style.right=ut+"px"}const U=v(),F=window.innerHeight-oa*2,G=b.scrollHeight,H=window.getComputedStyle(f),L=parseInt(H.borderTopWidth,10),I=parseInt(H.paddingTop,10),Y=parseInt(H.borderBottomWidth,10),W=parseInt(H.paddingBottom,10),O=L+I+G+W+Y,Q=Math.min(y.offsetHeight*5,O),q=window.getComputedStyle(b),z=parseInt(q.paddingTop,10),K=parseInt(q.paddingBottom,10),J=P.top+P.height/2-oa,ne=F-J,he=y.offsetHeight/2,ie=y.offsetTop+he,me=L+I+ie,se=O-me;if(me<=J){const Oe=U.length>0&&y===U[U.length-1].ref.current;c.style.bottom="0px";const fe=f.clientHeight-b.offsetTop-b.offsetHeight,xe=Math.max(ne,he+(Oe?K:0)+fe+Y),we=me+xe;c.style.height=we+"px"}else{const Oe=U.length>0&&y===U[0].ref.current;c.style.top="0px";const xe=Math.max(J,L+b.offsetTop+(Oe?z:0)+he)+se;c.style.height=xe+"px",b.scrollTop=me-J+b.offsetTop}c.style.margin=`${oa}px 0`,c.style.minHeight=Q+"px",c.style.maxHeight=F+"px",r?.(),requestAnimationFrame(()=>x.current=!0)}},[v,i.trigger,i.valueNode,c,f,b,y,S,i.dir,r]);ir(()=>_(),[_]);const[A,k]=m.useState();ir(()=>{f&&k(window.getComputedStyle(f).zIndex)},[f]);const E=m.useCallback(P=>{P&&j.current===!0&&(_(),N?.(),j.current=!1)},[_,N]);return s.jsx(bge,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:x,onScrollButtonChange:E,children:s.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:s.jsx(ft.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});DB.displayName=xge;var yge="SelectPopperPosition",mN=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=oa,...i}=e,o=Iv(n);return s.jsx(kg,{...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)"}})});mN.displayName=yge;var[bge,b_]=Du(Nl,{}),gN="SelectViewport",LB=m.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,i=Eo(gN,n),o=b_(gN,n),c=Mt(t,i.onViewportChange),d=m.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(Ov.Slot,{scope:n,children:s.jsx(ft.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:qe(a.onScroll,f=>{const h=f.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:v}=o;if(v?.current&&p){const x=Math.abs(d.current-h.scrollTop);if(x>0){const j=window.innerHeight-oa*2,b=parseFloat(p.style.minHeight),y=parseFloat(p.style.height),S=Math.max(b,y);if(S<j){const N=S+x,_=Math.min(j,N),A=N-_;p.style.height=_+"px",p.style.bottom==="0px"&&(h.scrollTop=A>0?A:0,p.style.justifyContent="flex-end")}}}d.current=h.scrollTop})})})]})});LB.displayName=gN;var FB="SelectGroup",[wge,jge]=Du(FB),Sge=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=ar();return s.jsx(wge,{scope:n,id:a,children:s.jsx(ft.div,{role:"group","aria-labelledby":a,...r,ref:t})})});Sge.displayName=FB;var zB="SelectLabel",BB=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=jge(zB,n);return s.jsx(ft.div,{id:a.id,...r,ref:t})});BB.displayName=zB;var cg="SelectItem",[Nge,qB]=Du(cg),UB=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:i,...o}=e,c=ko(cg,n),d=Eo(cg,n),f=c.value===r,[h,p]=m.useState(i??""),[v,x]=m.useState(!1),j=Mt(t,N=>d.itemRefCallback?.(N,r,a)),b=ar(),y=m.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(Nge,{scope:n,value:r,disabled:a,textId:b,isSelected:f,onItemTextChange:m.useCallback(N=>{p(_=>_||(N?.textContent??"").trim())},[]),children:s.jsx(Ov.ItemSlot,{scope:n,value:r,disabled:a,textValue:h,children:s.jsx(ft.div,{role:"option","aria-labelledby":b,"data-highlighted":v?"":void 0,"aria-selected":f&&v,"data-state":f?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...o,ref:j,onFocus:qe(o.onFocus,()=>x(!0)),onBlur:qe(o.onBlur,()=>x(!1)),onClick:qe(o.onClick,()=>{y.current!=="mouse"&&S()}),onPointerUp:qe(o.onPointerUp,()=>{y.current==="mouse"&&S()}),onPointerDown:qe(o.onPointerDown,N=>{y.current=N.pointerType}),onPointerMove:qe(o.onPointerMove,N=>{y.current=N.pointerType,a?d.onItemLeave?.():y.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:qe(o.onPointerLeave,N=>{N.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:qe(o.onKeyDown,N=>{d.searchRef?.current!==""&&N.key===" "||(cge.includes(N.key)&&S(),N.key===" "&&N.preventDefault())})})})})});UB.displayName=cg;var $d="SelectItemText",WB=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...i}=e,o=ko($d,n),c=Eo($d,n),d=qB($d,n),f=pge($d,n),[h,p]=m.useState(null),v=Mt(t,S=>p(S),d.onItemTextChange,S=>c.itemTextRefCallback?.(S,d.value,d.disabled)),x=h?.textContent,j=m.useMemo(()=>s.jsx("option",{value:d.value,disabled:d.disabled,children:x},d.value),[d.disabled,d.value,x]),{onNativeOptionAdd:b,onNativeOptionRemove:y}=f;return ir(()=>(b(j),()=>y(j)),[b,y,j]),s.jsxs(s.Fragment,{children:[s.jsx(ft.span,{id:d.textId,...i,ref:v}),d.isSelected&&o.valueNode&&!o.valueNodeHasChildren?bu.createPortal(i.children,o.valueNode):null]})});WB.displayName=$d;var VB="SelectItemIndicator",HB=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return qB(VB,n).isSelected?s.jsx(ft.span,{"aria-hidden":!0,...r,ref:t}):null});HB.displayName=VB;var vN="SelectScrollUpButton",KB=m.forwardRef((e,t)=>{const n=Eo(vN,e.__scopeSelect),r=b_(vN,e.__scopeSelect),[a,i]=m.useState(!1),o=Mt(t,r.onScrollButtonChange);return ir(()=>{if(n.viewport&&n.isPositioned){let c=function(){const f=d.scrollTop>0;i(f)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),a?s.jsx(YB,{...e,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop-d.offsetHeight)}}):null});KB.displayName=vN;var xN="SelectScrollDownButton",GB=m.forwardRef((e,t)=>{const n=Eo(xN,e.__scopeSelect),r=b_(xN,e.__scopeSelect),[a,i]=m.useState(!1),o=Mt(t,r.onScrollButtonChange);return ir(()=>{if(n.viewport&&n.isPositioned){let c=function(){const f=d.scrollHeight-d.clientHeight,h=Math.ceil(d.scrollTop)<f;i(h)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),a?s.jsx(YB,{...e,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop+d.offsetHeight)}}):null});GB.displayName=xN;var YB=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,i=Eo("SelectScrollButton",n),o=m.useRef(null),c=Mv(n),d=m.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return m.useEffect(()=>()=>d(),[d]),ir(()=>{c().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),s.jsx(ft.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:qe(a.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:qe(a.onPointerMove,()=>{i.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:qe(a.onPointerLeave,()=>{d()})})}),Cge="SelectSeparator",XB=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx(ft.div,{"aria-hidden":!0,...r,ref:t})});XB.displayName=Cge;var yN="SelectArrow",_ge=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Iv(n),i=ko(yN,n),o=Eo(yN,n);return i.open&&o.position==="popper"?s.jsx(Eg,{...a,...r,ref:t}):null});_ge.displayName=yN;var Age="SelectBubbleInput",QB=m.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=m.useRef(null),i=Mt(r,a),o=Rv(t);return m.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(ft.select,{...n,style:{...fD,...n.style},ref:i,defaultValue:t})});QB.displayName=Age;function ZB(e){return e===""||e===void 0}function JB(e){const t=Gn(e),n=m.useRef(""),r=m.useRef(0),a=m.useCallback(o=>{const c=n.current+o;t(c),(function d(f){n.current=f,window.clearTimeout(r.current),f!==""&&(r.current=window.setTimeout(()=>d(""),1e3))})(c)},[t]),i=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,i]}function e6(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=kge(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 kge(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Ege=AB,t6=EB,Pge=TB,Tge=RB,Rge=OB,n6=MB,Oge=LB,r6=BB,s6=UB,Mge=WB,Ige=HB,a6=KB,i6=GB,o6=XB;const In=Ege,$n=Pge,Tn=m.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(t6,{ref:r,className:Re("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(Tge,{asChild:!0,children:s.jsx(tn,{className:"h-4 w-4 opacity-50"})})]}));Tn.displayName=t6.displayName;const l6=m.forwardRef(({className:e,...t},n)=>s.jsx(a6,{ref:n,className:Re("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(ma,{className:"h-4 w-4"})}));l6.displayName=a6.displayName;const c6=m.forwardRef(({className:e,...t},n)=>s.jsx(i6,{ref:n,className:Re("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(tn,{className:"h-4 w-4"})}));c6.displayName=i6.displayName;const Rn=m.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>s.jsx(Rge,{children:s.jsxs(n6,{ref:a,className:Re("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(l6,{}),s.jsx(Oge,{className:Re("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(c6,{})]})}));Rn.displayName=n6.displayName;const $ge=m.forwardRef(({className:e,...t},n)=>s.jsx(r6,{ref:n,className:Re("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));$ge.displayName=r6.displayName;const gt=m.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(s6,{ref:r,className:Re("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(Ige,{children:s.jsx(qc,{className:"h-4 w-4"})})}),s.jsx(Mge,{children:t})]}));gt.displayName=s6.displayName;const Dge=m.forwardRef(({className:e,...t},n)=>s.jsx(o6,{ref:n,className:Re("-mx-1 my-1 h-px bg-muted",e),...t}));Dge.displayName=o6.displayName;function bN(e){const n=(e.agentEntries&&e.agentEntries.length>0?e.agentEntries:e.agents.map(a=>({kind:"inline",agent:a}))).map(a=>a.kind==="inline"?a.agent.id:a.ref).map(a=>a.trim()).filter(Boolean),r=(e.runDefaults?.selectedAgentNames??[]).filter(a=>n.includes(a));return r.length>0?r:n}const ao=e=>e.configName?.trim()||e.name,Lge="(root)",u6="__ROOT__",y$="mcplab.configurations.collapsedSuites",eS=e=>e.suitePath&&e.suitePath.trim().length>0?e.suitePath.trim():null,Yo=e=>e??Lge,tS=e=>e===null?u6:`suite:${e}`,Fge=e=>e===u6?null:e.startsWith("suite:")?e.slice(6):null,zge=(e,t)=>t===null?e===null:e===null?!1:e===t||e.startsWith(`${t}/`),Bge=e=>{for(const t of e){const n=t.scenarioEntries??[];for(const a of n){if(a.kind==="inline"&&a.scenario?.id)return String(a.scenario.id);if(a.kind==="referenced"&&a.ref)return String(a.ref)}const r=t.scenarios??[];for(const a of r)if(a?.id)return String(a.id)}return null},qge=e=>Bge([e]),Uge=e=>{const t=qge(e);return t?{href:`/results?scenario=${encodeURIComponent(t)}`,tooltipLabel:`Open results filtered by scenario ${t}`}:{href:"/results",tooltipLabel:"Open results"}},b$=["bg-red-400","bg-red-500","bg-orange-400","bg-orange-500","bg-amber-400","bg-amber-500","bg-yellow-400","bg-yellow-500","bg-lime-400","bg-lime-500","bg-green-400","bg-green-500","bg-emerald-400","bg-emerald-500","bg-teal-400","bg-teal-500","bg-cyan-400","bg-cyan-500","bg-sky-400","bg-sky-500","bg-blue-400","bg-blue-500","bg-indigo-400","bg-indigo-500","bg-violet-400","bg-violet-500","bg-purple-400","bg-purple-500","bg-fuchsia-400","bg-fuchsia-500","bg-pink-400","bg-pink-500","bg-rose-400","bg-rose-500"];function Wge(e){if(e===null)return"bg-slate-400";const t=e.split("").reduce((n,r)=>(n+r.charCodeAt(0))%b$.length,0);return b$[t]??"bg-slate-400"}const Vge=()=>{const{configs:e,deleteConfig:t,cloneConfig:n,loading:r,reload:a}=Yf(),{source:i}=On(),o=Xs(),[c,d]=m.useState("name"),[f,h]=m.useState("asc"),[p,v]=m.useState(""),[x,j]=m.useState("all"),[b,y]=m.useState(()=>{try{const K=window.localStorage.getItem(y$);if(!K)return new Set;const J=JSON.parse(K);return Array.isArray(J)?new Set(J.filter(ne=>typeof ne=="string")):new Set}catch(K){return console.warn("Failed to restore collapsed suites from localStorage",K),new Set}}),[S,N]=m.useState(new Set),[_,A]=m.useState(new Set),[k,E]=m.useState(new Set),[P,R]=m.useState({}),M=p.trim().toLowerCase(),D=K=>{if(c===K){h(J=>J==="asc"?"desc":"asc");return}d(K),h(K==="updatedAt"?"desc":"asc")};m.useEffect(()=>{a();const K=()=>{a()};return window.addEventListener("focus",K),()=>{window.removeEventListener("focus",K)}},[a]),m.useEffect(()=>{let K=!1;return(async()=>{try{if(i.getLatestPassRatesByConfigIds){const ne=await i.getLatestPassRatesByConfigIds({lastDays:365,configs:e.map(he=>({id:he.id,sourcePath:he.sourcePath,relativePath:he.relativePath,configHash:he.configHash}))});K||R(ne);return}R({})}catch{K||R({})}})(),()=>{K=!0}},[e,i]);const U=async(K,J)=>{await t(K),Me({title:"Deleted",description:`"${J}" has been removed.`})},F=async K=>{const J=await n(K);Me({title:"Cloned",description:`Created "${ao(J)}".`}),o(`/mcp-evaluations/${J.id}`)},G=K=>K.agentEntries?.length??K.agents?.length??0,H=K=>K.scenarioEntries?.length??K.scenarios?.length??0,L=m.useMemo(()=>{const K=new Set;for(const J of e){const ne=eS(J);if(K.add(ne),!ne)continue;const he=ne.split("/").filter(Boolean);for(let ie=1;ie<he.length;ie+=1)K.add(he.slice(0,ie).join("/"))}return Array.from(K).sort((J,ne)=>Yo(J).localeCompare(Yo(ne)))},[e]),I=m.useMemo(()=>e.filter(K=>{const J=eS(K),ne=x==="all"?void 0:Fge(x),he=Yo(J);return ne!==void 0&&!zge(J,ne)?!1:M.length===0?!0:[ao(K),K.id,K.description??"",K.loadError??"",he,K.relativePath??""].join(" ").toLowerCase().includes(M)}),[e,M,x]),Y=m.useMemo(()=>[...I].sort((J,ne)=>{let he=0;return c==="name"&&(he=ao(J).localeCompare(ao(ne))),c==="scenarios"&&(he=H(J)-H(ne)),c==="agents"&&(he=G(J)-G(ne)),c==="updatedAt"&&(he=new Date(J.updatedAt).getTime()-new Date(ne.updatedAt).getTime()),f==="asc"?he:-he}),[I,c,f]),W=K=>c!==K?s.jsx(Oc,{className:"h-3.5 w-3.5 text-muted-foreground"}):f==="asc"?s.jsx(ma,{className:"h-3.5 w-3.5"}):s.jsx(tn,{className:"h-3.5 w-3.5"}),O=K=>{y(J=>{const ne=new Set(J);return ne.has(K)?ne.delete(K):ne.add(K),ne})},Q=async(K,J,ne)=>{if(_.has(K))return;const he=e.find(me=>me.id===K),ie=he?bN(he):[];A(me=>new Set(me).add(K));try{await i.startRun({configPath:J,runsPerScenario:1,...ie.length>0?{agents:ie}:{}}),N(me=>new Set(me).add(K)),window.setTimeout(()=>{N(me=>{const se=new Set(me);return se.delete(K),se})},2e3),Me({title:"Queued",description:`"${ne}" added to run queue.`})}catch(me){Me({title:"Could not queue evaluation",description:me instanceof Error?me.message:String(me),variant:"destructive"})}finally{A(me=>{const se=new Set(me);return se.delete(K),se})}};m.useEffect(()=>{try{window.localStorage.setItem(y$,JSON.stringify(Array.from(b)))}catch(K){console.warn("Failed to persist collapsed suites to localStorage (quota/private mode?)",K)}},[b]);const q=async(K,J,ne)=>{if(!k.has(K)){E(he=>new Set(he).add(K));try{const he=ne.filter(fe=>typeof fe.sourcePath=="string"&&fe.sourcePath.trim().length>0);if(he.length===0){Me({title:"No runnable evaluations",description:`Suite "${J}" has no evaluation files with a source path.`,variant:"destructive"});return}const ie=await Promise.allSettled(he.map(fe=>{const xe=bN(fe);return i.startRun({configPath:String(fe.sourcePath),runsPerScenario:1,...xe.length>0?{agents:xe}:{}})})),me=ie.filter(fe=>fe.status==="fulfilled").length,se=ie.length-me,ge=ie.find(fe=>fe.status==="rejected"),Oe=ge?ge.reason instanceof Error?ge.reason.message:String(ge.reason):void 0;Me({title:se===0?"Suite queued":"Suite queued with errors",description:se===0?`Queued ${me} evaluation${me===1?"":"s"} for suite "${J}".`:`Queued ${me}/${he.length} evaluations for suite "${J}" (${se} failed${Oe?`: ${Oe}`:""}).`,variant:se===0?"default":"destructive"})}catch(he){Me({title:"Could not queue suite",description:he instanceof Error?he.message:String(he),variant:"destructive"})}finally{E(he=>{const ie=new Set(he);return ie.delete(K),ie})}}},z=m.useMemo(()=>{const K=new Map;for(const J of Y){const ne=eS(J),he=K.get(ne);he?he.push(J):K.set(ne,[J])}return Array.from(K.entries()).sort((J,ne)=>Yo(J[0]).localeCompare(Yo(ne[0])))},[Y]);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(FD,{className:"h-6 w-6"}),"MCP Evaluations"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage your MCP evaluation suites"})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(f_,{value:p,onValueChange:v,placeholder:"Search evaluations..."}),s.jsxs(In,{value:x,onValueChange:j,children:[s.jsx(Tn,{className:"h-9 w-[200px]",children:s.jsx($n,{placeholder:"All suites"})}),s.jsxs(Rn,{children:[s.jsx(gt,{value:"all",children:"All suites"}),L.map(K=>s.jsx(gt,{value:tS(K),children:Yo(K)},tS(K)))]})]}),s.jsxs(Z,{variant:"outline",size:"sm",onClick:()=>{a()},children:[s.jsx(zs,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(Z,{variant:"outline",size:"sm",children:[s.jsx(F9,{className:"mr-2 h-4 w-4"}),"Import YAML"]}),s.jsx(Z,{size:"sm",asChild:!0,children:s.jsxs(Tt,{to:"/mcp-evaluations/new",children:[s.jsx(yi,{className:"mr-2 h-4 w-4"}),"Create New"]})})]})]}),s.jsx(nt,{children:s.jsx(rt,{className:"p-0",children:s.jsxs(Jr,{children:[s.jsx(es,{children:s.jsxs(Gt,{children:[s.jsx(ht,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>D("name"),children:["Name",W("name")]})}),s.jsx(ht,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>D("scenarios"),children:["Scenarios",W("scenarios")]})}),s.jsx(ht,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>D("agents"),children:["Agents",W("agents")]})}),s.jsx(ht,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>D("updatedAt"),children:["Last Updated",W("updatedAt")]})}),s.jsx(ht,{className:"text-right",children:"Last Run"}),s.jsx(ht,{className:"w-[220px] text-right"})]})}),s.jsxs(ts,{children:[z.map(([K,J])=>{const ne=Yo(K),he=tS(K),ie=b.has(he),me=k.has(he);return s.jsxs(m.Fragment,{children:[s.jsx(Gt,{className:"bg-muted/40 hover:bg-muted/40",children:s.jsx(He,{colSpan:6,className:"py-2",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("button",{type:"button",className:"inline-flex h-6 items-center gap-2 text-xs leading-none hover:text-foreground",onClick:()=>O(he),"aria-expanded":!ie,"aria-label":`${ie?"Expand":"Collapse"} suite ${ne}`,children:[s.jsx(zN,{className:`h-3.5 w-3.5 text-muted-foreground transition-transform ${ie?"":"rotate-90"}`,"aria-hidden":"true"}),s.jsx("span",{className:`h-2 w-2 rounded-full ${Wge(K)}`,"aria-hidden":"true"}),K===null?s.jsx(E9,{className:"h-3.5 w-3.5 text-muted-foreground","aria-hidden":"true"}):s.jsx(A9,{className:"h-3.5 w-3.5 text-muted-foreground","aria-hidden":"true"}),s.jsx("span",{className:"font-medium",children:ne}),s.jsxs("span",{className:"text-muted-foreground",children:["(",J.length,")"]})]}),s.jsxs(Z,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:me,onClick:()=>{q(he,ne,J)},children:[s.jsx(va,{className:"mr-1 h-3.5 w-3.5"}),me?"Queueing...":"Run Suite"]})]})})},`suite-${he}`),!ie&&J.map(se=>{const ge=Uge(se);return s.jsxs(Gt,{children:[s.jsx(He,{children:s.jsxs("div",{children:[s.jsx(Tt,{to:`/mcp-evaluations/${se.id}`,className:"font-medium text-sm hover:text-primary",children:ao(se)}),se.loadError&&s.jsxs(st,{variant:"destructive",className:"ml-2 align-middle text-[10px]",children:[s.jsx(Uh,{className:"mr-1 h-3 w-3"}),"Broken"]}),se.relativePath&&s.jsx("div",{className:"mt-0.5",children:s.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:se.relativePath})}),se.loadError&&s.jsx("p",{className:"text-xs text-destructive mt-0.5 break-all",children:se.loadError})]})}),s.jsx(He,{className:"text-right font-mono text-sm",children:H(se)}),s.jsx(He,{className:"text-right font-mono text-sm",children:G(se)}),s.jsx(He,{className:"text-right text-xs text-muted-foreground",children:s.jsxs("div",{className:"inline-flex items-center gap-1",children:[s.jsx(xa,{className:"h-3 w-3"}),new Date(se.updatedAt).toLocaleDateString()]})}),s.jsx(He,{className:"text-right",children:typeof P[se.id]=="number"?s.jsx("div",{className:"inline-flex justify-end",children:s.jsx(Ma,{rate:P[se.id]})}):""}),s.jsx(He,{className:"w-[220px] whitespace-nowrap",children:s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsxs(lp,{children:[s.jsx(cp,{asChild:!0,children:s.jsx(Z,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(bg,{className:"h-4 w-4"})})}),s.jsxs($u,{align:"end",children:[s.jsxs(Mr,{onClick:()=>o(`/mcp-evaluations/${se.id}`),children:[s.jsx(wg,{className:"mr-2 h-3.5 w-3.5"}),"Edit"]}),s.jsxs(Mr,{onClick:()=>{F(se.id)},children:[s.jsx(ss,{className:"mr-2 h-3.5 w-3.5"}),"Clone"]}),s.jsxs(Mr,{className:"text-destructive",onClick:()=>{U(se.id,ao(se))},children:[s.jsx(Bs,{className:"mr-2 h-3.5 w-3.5"}),"Delete"]})]})]}),s.jsx(ji,{children:s.jsxs(Si,{children:[s.jsx(Ni,{asChild:!0,children:s.jsx(Z,{size:"icon",variant:"outline",className:"h-8 w-8",asChild:!0,"aria-label":ge.tooltipLabel,children:s.jsxs(Tt,{to:ge.href,children:[s.jsx(Bc,{className:"h-3.5 w-3.5"}),s.jsx("span",{className:"sr-only",children:ge.tooltipLabel})]})})}),s.jsx(qa,{children:ge.tooltipLabel})]})}),s.jsx(ji,{children:s.jsxs(Si,{children:[s.jsx(Ni,{asChild:!0,children:s.jsx(Z,{size:"sm",variant:"outline",className:`h-8 px-2 text-xs ${S.has(se.id)?"border-green-600 bg-green-600 text-white hover:bg-green-700 hover:text-white":""}`,disabled:_.has(se.id)||!se.sourcePath,onClick:()=>se.sourcePath&&void Q(se.id,se.sourcePath,ao(se)),"aria-label":`Queue ${ao(se)}`,children:S.has(se.id)?"Queued":_.has(se.id)?"Queueing...":s.jsxs(s.Fragment,{children:[s.jsx(R9,{className:"h-3.5 w-3.5"}),s.jsx("span",{className:"sr-only",children:"Queue evaluation"})]})})}),s.jsx(qa,{children:"Queue evaluation run"})]})}),s.jsx(Z,{size:"sm",variant:"outline",asChild:!0,children:s.jsxs(Tt,{to:`/run?configId=${encodeURIComponent(se.id)}`,children:[s.jsx(va,{className:"h-3.5 w-3.5"}),"Run"]})})]})})]},se.id)})]},`suite-group-${he}`)}),!r&&e.length===0&&s.jsx(Gt,{children:s.jsx(He,{colSpan:6,className:"text-center py-12 text-muted-foreground",children:"No MCP evaluations yet. Create your first one to get started."})}),!r&&e.length>0&&Y.length===0&&s.jsx(Gt,{children:s.jsx(He,{colSpan:6,className:"text-center py-12 text-muted-foreground",children:"No MCP evaluations match this filter."})}),r&&s.jsx(Gt,{children:s.jsx(He,{colSpan:6,className:"text-center py-12 text-muted-foreground",children:"Loading MCP evaluations..."})})]})]})})})]})};var Hge=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Kge=Hge.reduce((e,t)=>{const n=$g(`Primitive.${t}`),r=m.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}},{}),Gge="Label",d6=m.forwardRef((e,t)=>s.jsx(Kge.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));d6.displayName=Gge;var f6=d6;const Yge=Ol("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ve=m.forwardRef(({className:e,...t},n)=>s.jsx(f6,{ref:n,className:Re(Yge(),e),...t}));Ve.displayName=f6.displayName;const wa=m.forwardRef(({className:e,...t},n)=>s.jsx("textarea",{className:Re("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));wa.displayName="Textarea";var $v="Tabs",[Xge]=Sr($v,[kv]),p6=kv(),[Qge,w_]=Xge($v),h6=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:i,orientation:o="horizontal",dir:c,activationMode:d="automatic",...f}=e,h=Iu(c),[p,v]=js({prop:r,onChange:a,defaultProp:i??"",caller:$v});return s.jsx(Qge,{scope:n,baseId:ar(),value:p,onValueChange:v,orientation:o,dir:h,activationMode:d,children:s.jsx(ft.div,{dir:h,"data-orientation":o,...f,ref:t})})});h6.displayName=$v;var m6="TabsList",g6=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,i=w_(m6,n),o=p6(n);return s.jsx(Pz,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:r,children:s.jsx(ft.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});g6.displayName=m6;var v6="TabsTrigger",x6=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...i}=e,o=w_(v6,n),c=p6(n),d=w6(o.baseId,r),f=j6(o.baseId,r),h=r===o.value;return s.jsx(Tz,{asChild:!0,...c,focusable:!a,active:h,children:s.jsx(ft.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:qe(e.onMouseDown,p=>{!a&&p.button===0&&p.ctrlKey===!1?o.onValueChange(r):p.preventDefault()}),onKeyDown:qe(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&o.onValueChange(r)}),onFocus:qe(e.onFocus,()=>{const p=o.activationMode!=="manual";!h&&!a&&p&&o.onValueChange(r)})})})});x6.displayName=v6;var y6="TabsContent",b6=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:i,...o}=e,c=w_(y6,n),d=w6(c.baseId,r),f=j6(c.baseId,r),h=r===c.value,p=m.useRef(h);return m.useEffect(()=>{const v=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(v)},[]),s.jsx(Zn,{present:a||h,children:({present:v})=>s.jsx(ft.div,{"data-state":h?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!v,id:f,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:v&&i})})});b6.displayName=y6;function w6(e,t){return`${e}-trigger-${t}`}function j6(e,t){return`${e}-content-${t}`}var Zge=h6,S6=g6,N6=x6,C6=b6;const Dv=Zge,up=m.forwardRef(({className:e,...t},n)=>s.jsx(S6,{ref:n,className:Re("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));up.displayName=S6.displayName;const za=m.forwardRef(({className:e,...t},n)=>s.jsx(N6,{ref:n,className:Re("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}));za.displayName=N6.displayName;const Lf=m.forwardRef(({className:e,...t},n)=>s.jsx(C6,{ref:n,className:Re("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Lf.displayName=C6.displayName;const Jge={openai:"OpenAI",anthropic:"Anthropic",azure:"Azure OpenAI",azure_openai:"Azure OpenAI",google:"Google"};function ug(e){return Jge[e]??e}const w$={openai:"bg-emerald-100 text-emerald-800",anthropic:"bg-orange-100 text-orange-800",azure:"bg-blue-100 text-blue-800",azure_openai:"bg-blue-100 text-blue-800",google:"bg-yellow-100 text-yellow-800",custom:"bg-gray-100 text-gray-800"};function _6({provider:e}){return s.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${w$[e]??w$.custom}`,children:ug(e)})}var Lv="Checkbox",[eve]=Sr(Lv),[tve,j_]=eve(Lv);function nve(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,[v,x]=js({prop:n,defaultProp:a??!1,onChange:d,caller:Lv}),[j,b]=m.useState(null),[y,S]=m.useState(null),N=m.useRef(!1),_=j?!!o||!!j.closest("form"):!0,A={checked:v,disabled:i,setChecked:x,control:j,setControl:b,name:c,form:o,value:h,hasConsumerStoppedPropagationRef:N,required:f,defaultChecked:po(a)?!1:a,isFormControl:_,bubbleInput:y,setBubbleInput:S};return s.jsx(tve,{scope:t,...A,children:rve(p)?p(A):r})}var A6="CheckboxTrigger",k6=m.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:v,isFormControl:x,bubbleInput:j}=j_(A6,e),b=Mt(a,h),y=m.useRef(d);return m.useEffect(()=>{const S=i?.form;if(S){const N=()=>p(y.current);return S.addEventListener("reset",N),()=>S.removeEventListener("reset",N)}},[i,p]),s.jsx(ft.button,{type:"button",role:"checkbox","aria-checked":po(d)?"mixed":d,"aria-required":f,"data-state":O6(d),"data-disabled":c?"":void 0,disabled:c,value:o,...r,ref:b,onKeyDown:qe(t,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:qe(n,S=>{p(N=>po(N)?!0:!N),j&&x&&(v.current=S.isPropagationStopped(),v.current||S.stopPropagation())})})});k6.displayName=A6;var S_=m.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(nve,{__scopeCheckbox:n,checked:a,defaultChecked:i,disabled:c,required:o,onCheckedChange:f,name:r,form:h,value:d,internal_do_not_use_render:({isFormControl:v})=>s.jsxs(s.Fragment,{children:[s.jsx(k6,{...p,ref:t,__scopeCheckbox:n}),v&&s.jsx(R6,{__scopeCheckbox:n})]})})});S_.displayName=Lv;var E6="CheckboxIndicator",P6=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,i=j_(E6,n);return s.jsx(Zn,{present:r||po(i.checked)||i.checked===!0,children:s.jsx(ft.span,{"data-state":O6(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});P6.displayName=E6;var T6="CheckboxBubbleInput",R6=m.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:v,setBubbleInput:x}=j_(T6,e),j=Mt(n,x),b=Rv(i),y=_g(r);m.useEffect(()=>{const N=v;if(!N)return;const _=window.HTMLInputElement.prototype,k=Object.getOwnPropertyDescriptor(_,"checked").set,E=!a.current;if(b!==i&&k){const P=new Event("click",{bubbles:E});N.indeterminate=po(i),k.call(N,po(i)?!1:i),N.dispatchEvent(P)}},[v,b,i,a]);const S=m.useRef(po(i)?!1:i);return s.jsx(ft.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??S.current,required:c,disabled:d,name:f,value:h,form:p,...t,tabIndex:-1,ref:j,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});R6.displayName=T6;function rve(e){return typeof e=="function"}function po(e){return e==="indeterminate"}function O6(e){return po(e)?"indeterminate":e?"checked":"unchecked"}const wr=m.forwardRef(({className:e,...t},n)=>s.jsx(S_,{ref:n,className:Re("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(P6,{className:Re("flex items-center justify-center text-current"),children:s.jsx(qc,{className:"h-4 w-4"})})}));wr.displayName=S_.displayName;var Fv="Collapsible",[sve]=Sr(Fv),[ave,N_]=sve(Fv),M6=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:i,onOpenChange:o,...c}=e,[d,f]=js({prop:r,defaultProp:a??!1,onChange:o,caller:Fv});return s.jsx(ave,{scope:n,disabled:i,contentId:ar(),open:d,onOpenToggle:m.useCallback(()=>f(h=>!h),[f]),children:s.jsx(ft.div,{"data-state":__(d),"data-disabled":i?"":void 0,...c,ref:t})})});M6.displayName=Fv;var I6="CollapsibleTrigger",$6=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,a=N_(I6,n);return s.jsx(ft.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":__(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...r,ref:t,onClick:qe(e.onClick,a.onOpenToggle)})});$6.displayName=I6;var C_="CollapsibleContent",D6=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=N_(C_,e.__scopeCollapsible);return s.jsx(Zn,{present:n||a.open,children:({present:i})=>s.jsx(ive,{...r,ref:t,present:i})})});D6.displayName=C_;var ive=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:a,...i}=e,o=N_(C_,n),[c,d]=m.useState(r),f=m.useRef(null),h=Mt(t,f),p=m.useRef(0),v=p.current,x=m.useRef(0),j=x.current,b=o.open||c,y=m.useRef(b),S=m.useRef(void 0);return m.useEffect(()=>{const N=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(N)},[]),ir(()=>{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,x.current=_.width,y.current||(N.style.transitionDuration=S.current.transitionDuration,N.style.animationName=S.current.animationName),d(r)}},[o.open,r]),s.jsx(ft.div,{"data-state":__(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!b,...i,ref:h,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":j?`${j}px`:void 0,...e.style},children:b&&a})});function __(e){return e?"open":"closed"}var ove=M6;const da=ove,Ms=$6,fa=D6;class lve{add(t,n,r){if(typeof arguments[0]!="string")for(let a in arguments[0])this.add(a,arguments[0][a],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(a){this[a]=this[a]||[],n&&this[a][r?"unshift":"push"](n)},this)}run(t,n){this[t]=this[t]||[],this[t].forEach(function(r){r.call(n&&n.context?n.context:n,n)})}}class cve{constructor(t){this.jsep=t,this.registered={}}register(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];n.forEach(a=>{if(typeof a!="object"||!a.name||!a.init)throw new Error("Invalid JSEP plugin format");this.registered[a.name]||(a.init(this.jsep),this.registered[a.name]=a)})}}class Ce{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+Ce.version}static addUnaryOp(t){return Ce.max_unop_len=Math.max(t.length,Ce.max_unop_len),Ce.unary_ops[t]=1,Ce}static addBinaryOp(t,n,r){return Ce.max_binop_len=Math.max(t.length,Ce.max_binop_len),Ce.binary_ops[t]=n,r?Ce.right_associative.add(t):Ce.right_associative.delete(t),Ce}static addIdentifierChar(t){return Ce.additional_identifier_chars.add(t),Ce}static addLiteral(t,n){return Ce.literals[t]=n,Ce}static removeUnaryOp(t){return delete Ce.unary_ops[t],t.length===Ce.max_unop_len&&(Ce.max_unop_len=Ce.getMaxKeyLen(Ce.unary_ops)),Ce}static removeAllUnaryOps(){return Ce.unary_ops={},Ce.max_unop_len=0,Ce}static removeIdentifierChar(t){return Ce.additional_identifier_chars.delete(t),Ce}static removeBinaryOp(t){return delete Ce.binary_ops[t],t.length===Ce.max_binop_len&&(Ce.max_binop_len=Ce.getMaxKeyLen(Ce.binary_ops)),Ce.right_associative.delete(t),Ce}static removeAllBinaryOps(){return Ce.binary_ops={},Ce.max_binop_len=0,Ce}static removeLiteral(t){return delete Ce.literals[t],Ce}static removeAllLiterals(){return Ce.literals={},Ce}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new Ce(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(n=>n.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return Ce.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!Ce.binary_ops[String.fromCharCode(t)]||Ce.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return Ce.isIdentifierStart(t)||Ce.isDecimalDigit(t)}throwError(t){const n=new Error(t+" at character "+this.index);throw n.index=this.index,n.description=t,n}runHook(t,n){if(Ce.hooks[t]){const r={context:this,node:n};return Ce.hooks.run(t,r),r.node}return n}searchHook(t){if(Ce.hooks[t]){const n={context:this};return Ce.hooks[t].find(function(r){return r.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===Ce.SPACE_CODE||t===Ce.TAB_CODE||t===Ce.LF_CODE||t===Ce.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");const t=this.gobbleExpressions(),n=t.length===1?t[0]:{type:Ce.COMPOUND,body:t};return this.runHook("after-all",n)}gobbleExpressions(t){let n=[],r,a;for(;this.index<this.expr.length;)if(r=this.code,r===Ce.SEMCOL_CODE||r===Ce.COMMA_CODE)this.index++;else if(a=this.gobbleExpression())n.push(a);else if(this.index<this.expr.length){if(r===t)break;this.throwError('Unexpected "'+this.char+'"')}return n}gobbleExpression(){const t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,Ce.max_binop_len),n=t.length;for(;n>0;){if(Ce.binary_ops.hasOwnProperty(t)&&(!Ce.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!Ce.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=n,t;t=t.substr(0,--n)}return!1}gobbleBinaryExpression(){let t,n,r,a,i,o,c,d,f;if(o=this.gobbleToken(),!o||(n=this.gobbleBinaryOp(),!n))return o;for(i={value:n,prec:Ce.binaryPrecedence(n),right_a:Ce.right_associative.has(n)},c=this.gobbleToken(),c||this.throwError("Expected expression after "+n),a=[o,i,c];n=this.gobbleBinaryOp();){if(r=Ce.binaryPrecedence(n),r===0){this.index-=n.length;break}i={value:n,prec:r,right_a:Ce.right_associative.has(n)},f=n;const h=p=>i.right_a&&p.right_a?r>p.prec:r<=p.prec;for(;a.length>2&&h(a[a.length-2]);)c=a.pop(),n=a.pop().value,o=a.pop(),t={type:Ce.BINARY_EXP,operator:n,left:o,right:c},a.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+f),a.push(i,t)}for(d=a.length-1,t=a[d];d>1;)t={type:Ce.BINARY_EXP,operator:a[d-1].value,left:a[d-2],right:t},d-=2;return t}gobbleToken(){let t,n,r,a;if(this.gobbleSpaces(),a=this.searchHook("gobble-token"),a)return this.runHook("after-token",a);if(t=this.code,Ce.isDecimalDigit(t)||t===Ce.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===Ce.SQUOTE_CODE||t===Ce.DQUOTE_CODE)a=this.gobbleStringLiteral();else if(t===Ce.OBRACK_CODE)a=this.gobbleArray();else{for(n=this.expr.substr(this.index,Ce.max_unop_len),r=n.length;r>0;){if(Ce.unary_ops.hasOwnProperty(n)&&(!Ce.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!Ce.isIdentifierPart(this.expr.charCodeAt(this.index+n.length)))){this.index+=r;const i=this.gobbleToken();return i||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:Ce.UNARY_EXP,operator:n,argument:i,prefix:!0})}n=n.substr(0,--r)}Ce.isIdentifierStart(t)?(a=this.gobbleIdentifier(),Ce.literals.hasOwnProperty(a.name)?a={type:Ce.LITERAL,value:Ce.literals[a.name],raw:a.name}:a.name===Ce.this_str&&(a={type:Ce.THIS_EXP})):t===Ce.OPAREN_CODE&&(a=this.gobbleGroup())}return a?(a=this.gobbleTokenProperty(a),this.runHook("after-token",a)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let n=this.code;for(;n===Ce.PERIOD_CODE||n===Ce.OBRACK_CODE||n===Ce.OPAREN_CODE||n===Ce.QUMARK_CODE;){let r;if(n===Ce.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==Ce.PERIOD_CODE)break;r=!0,this.index+=2,this.gobbleSpaces(),n=this.code}this.index++,n===Ce.OBRACK_CODE?(t={type:Ce.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},t.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),n=this.code,n!==Ce.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):n===Ce.OPAREN_CODE?t={type:Ce.CALL_EXP,arguments:this.gobbleArguments(Ce.CPAREN_CODE),callee:t}:(n===Ce.PERIOD_CODE||r)&&(r&&this.index--,this.gobbleSpaces(),t={type:Ce.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),r&&(t.optional=!0),this.gobbleSpaces(),n=this.code}return t}gobbleNumericLiteral(){let t="",n,r;for(;Ce.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===Ce.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);Ce.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(n=this.char,n==="e"||n==="E"){for(t+=this.expr.charAt(this.index++),n=this.char,(n==="+"||n==="-")&&(t+=this.expr.charAt(this.index++));Ce.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);Ce.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return r=this.code,Ce.isIdentifierStart(r)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(r===Ce.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===Ce.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:Ce.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="";const n=this.index,r=this.expr.charAt(this.index++);let a=!1;for(;this.index<this.expr.length;){let i=this.expr.charAt(this.index++);if(i===r){a=!0;break}else if(i==="\\")switch(i=this.expr.charAt(this.index++),i){case"n":t+=`
|
|
121
|
+
`;break;case"r":t+="\r";break;case"t":t+=" ";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=i}else t+=i}return a||this.throwError('Unclosed quote after "'+t+'"'),{type:Ce.LITERAL,value:t,raw:this.expr.substring(n,this.index)}}gobbleIdentifier(){let t=this.code,n=this.index;for(Ce.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,Ce.isIdentifierPart(t));)this.index++;return{type:Ce.IDENTIFIER,name:this.expr.slice(n,this.index)}}gobbleArguments(t){const n=[];let r=!1,a=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let i=this.code;if(i===t){r=!0,this.index++,t===Ce.CPAREN_CODE&&a&&a>=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(i===Ce.COMMA_CODE){if(this.index++,a++,a!==n.length){if(t===Ce.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===Ce.CBRACK_CODE)for(let o=n.length;o<a;o++)n.push(null)}}else if(n.length!==a&&a!==0)this.throwError("Expected comma");else{const o=this.gobbleExpression();(!o||o.type===Ce.COMPOUND)&&this.throwError("Expected comma"),n.push(o)}}return r||this.throwError("Expected "+String.fromCharCode(t)),n}gobbleGroup(){this.index++;let t=this.gobbleExpressions(Ce.CPAREN_CODE);if(this.code===Ce.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:Ce.SEQUENCE_EXP,expressions:t}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:Ce.ARRAY_EXP,elements:this.gobbleArguments(Ce.CBRACK_CODE)}}}const uve=new lve;Object.assign(Ce,{hooks:uve,plugins:new cve(Ce),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});Ce.max_unop_len=Ce.getMaxKeyLen(Ce.unary_ops);Ce.max_binop_len=Ce.getMaxKeyLen(Ce.binary_ops);const ki=e=>new Ce(e).parse(),dve=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(Ce).filter(e=>!dve.includes(e)&&ki[e]===void 0).forEach(e=>{ki[e]=Ce[e]});ki.Jsep=Ce;const fve="ConditionalExpression";var pve={name:"ternary",init(e){e.hooks.add("after-expression",function(n){if(n.node&&this.code===e.QUMARK_CODE){this.index++;const r=n.node,a=this.gobbleExpression();if(a||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;const i=this.gobbleExpression();if(i||this.throwError("Expected expression"),n.node={type:fve,test:r,consequent:a,alternate:i},r.operator&&e.binary_ops[r.operator]<=.9){let o=r;for(;o.right.operator&&e.binary_ops[o.right.operator]<=.9;)o=o.right;n.node.test=o.right,o.right=n.node,n.node=r}}else this.throwError("Expected :")}})}};ki.plugins.register(pve);const j$=47,hve=92;var mve={name:"regex",init(e){e.hooks.add("gobble-token",function(n){if(this.code===j$){const r=++this.index;let a=!1;for(;this.index<this.expr.length;){if(this.code===j$&&!a){const i=this.expr.slice(r,this.index);let o="";for(;++this.index<this.expr.length;){const d=this.code;if(d>=97&&d<=122||d>=65&&d<=90||d>=48&&d<=57)o+=this.char;else break}let c;try{c=new RegExp(i,o)}catch(d){this.throwError(d.message)}return n.node={type:e.LITERAL,value:c,raw:this.expr.slice(r-1,this.index)},n.node=this.gobbleTokenProperty(n.node),n.node}this.code===e.OBRACK_CODE?a=!0:a&&this.code===e.CBRACK_CODE&&(a=!1),this.index+=this.code===hve?2:1}this.throwError("Unclosed Regex")}})}};const nS=43,gve=45,Nc={name:"assignment",assignmentOperators:new Set(["=","*=","**=","/=","%=","+=","-=","<<=",">>=",">>>=","&=","^=","|=","||=","&&=","??="]),updateOperators:[nS,gve],assignmentPrecedence:.9,init(e){const t=[e.IDENTIFIER,e.MEMBER_EXP];Nc.assignmentOperators.forEach(r=>e.addBinaryOp(r,Nc.assignmentPrecedence,!0)),e.hooks.add("gobble-token",function(a){const i=this.code;Nc.updateOperators.some(o=>o===i&&o===this.expr.charCodeAt(this.index+1))&&(this.index+=2,a.node={type:"UpdateExpression",operator:i===nS?"++":"--",argument:this.gobbleTokenProperty(this.gobbleIdentifier()),prefix:!0},(!a.node.argument||!t.includes(a.node.argument.type))&&this.throwError(`Unexpected ${a.node.operator}`))}),e.hooks.add("after-token",function(a){if(a.node){const i=this.code;Nc.updateOperators.some(o=>o===i&&o===this.expr.charCodeAt(this.index+1))&&(t.includes(a.node.type)||this.throwError(`Unexpected ${a.node.operator}`),this.index+=2,a.node={type:"UpdateExpression",operator:i===nS?"++":"--",argument:a.node,prefix:!1})}}),e.hooks.add("after-expression",function(a){a.node&&n(a.node)});function n(r){Nc.assignmentOperators.has(r.operator)?(r.type="AssignmentExpression",n(r.left),n(r.right)):r.operator||Object.values(r).forEach(a=>{a&&typeof a=="object"&&n(a)})}}};ki.plugins.register(mve,Nc);ki.addUnaryOp("typeof");ki.addUnaryOp("void");ki.addLiteral("null",null);ki.addLiteral("undefined",void 0);function A_(e){return e.length>0?`Tool sequence · ${e.join(" -> ")}`:"Tool sequence"}function Fs({text:e,variant:t="assistant",className:n}){const r=vve(e);return s.jsx("div",{className:Re("space-y-2",t==="system"&&"text-xs",n),children:r.map((a,i)=>s.jsx(m.Fragment,{children:xve(a,i,t)},`md-${i}`))})}function vve(e){const t=e.replace(/\r\n/g,`
|
|
122
|
+
`).split(`
|
|
123
|
+
`),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 v=c.replace(/^```/,"").trim()||void 0;r+=1;const x=[];for(;r<t.length&&!i(t[r]);)x.push(t[r]),r+=1;r<t.length&&i(t[r])&&(r+=1),n.push({type:"code",lang:v,code:x.join(`
|
|
124
|
+
`)});continue}if(/^---+$/.test(c)||/^\*\*\*+$/.test(c)){n.push({type:"hr"}),r+=1;continue}if(c.startsWith(">")){const v=[];for(;r<t.length&&t[r].trim().startsWith(">");)v.push(t[r].trim().replace(/^>\s?/,"")),r+=1;n.push({type:"blockquote",text:v.join(`
|
|
125
|
+
`)});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(S$(t,r)){const v=N$(t[r]);r+=2;const x=[];for(;r<t.length&&t[r].includes("|")&&!a(t[r]);)x.push(N$(t[r])),r+=1;n.push({type:"table",headers:v,rows:x});continue}const f=c.match(/^\d+\.\s+/),h=c.match(/^[-*+]\s+/);if(f||h){const v=!!f,x=[];for(;r<t.length;){const j=t[r].trim();if(v?/^\d+\.\s+/.test(j):/^[-*+]\s+/.test(j)){x.push(j.replace(v?/^\d+\.\s+/:/^[-*+]\s+/,"")),r+=1;continue}a(t[r])&&(r+=1);break}n.push({type:"list",ordered:v,items:x});continue}const p=[o];for(r+=1;r<t.length;){const v=t[r],x=v.trim();if(a(v)||i(v)||/^---+$/.test(x)||/^#{1,4}\s+/.test(x)||x.startsWith(">")||S$(t,r)||/^\d+\.\s+/.test(x)||/^[-*+]\s+/.test(x))break;p.push(v),r+=1}n.push({type:"paragraph",text:p.join(`
|
|
126
|
+
`)})}return n}function S$(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 N$(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(t=>t.trim())}function xve(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:yc(e.text,`${t}-h`)})}if(e.type==="paragraph")return s.jsx("p",{className:Re("whitespace-pre-wrap leading-relaxed",n==="system"&&"leading-normal"),children:yc(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:yc(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:Re("space-y-1 pl-5",e.ordered?"list-decimal":"list-disc"),children:e.items.map((a,i)=>s.jsx("li",{className:"leading-relaxed",children:yc(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:yc(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:yc(i,`${t}-tdc-${a}-${o}`)},`${t}-td-${a}-${o}`))},`${t}-row-${a}`))})]})}):null}function yc(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(m.Fragment,{children:r},`${t}-${a}`)})}function L6({message:e,className:t,assistantLabel:n,renderActions:r}){const a=e.role;if(a==="tool"){const c=String(e.text??"").trim();return/^(Approved|Denied) tool call\b/i.test(c)?null:s.jsxs("div",{className:Re("rounded-md border border-sky-500/30 bg-sky-500/10 px-3 py-2 text-sm",t),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(pa,{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(a==="system")return s.jsxs("div",{className:Re("flex items-start gap-2 text-xs",t),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(BN,{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(Fs,{text:e.text,variant:"assistant"})})]});const i=a==="user",o=i?Uc:Fr;return s.jsxs("div",{className:Re(`flex items-start gap-2 text-xs ${i?"justify-end":"justify-start"}`,t),children:[!i&&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(o,{className:"h-3 w-3"})}),s.jsxs("div",{className:"relative max-w-[92%]",children:[s.jsxs("div",{className:`max-w-full break-words rounded-md border px-3 py-2 text-sm ${i?"border-primary/20 bg-primary/10":"border-border/80 bg-background shadow-sm"}`,children:[!i&&n&&s.jsx("p",{className:"mb-2 text-[11px] font-semibold text-muted-foreground",children:n}),i?s.jsx("p",{className:"whitespace-pre-wrap",children:e.text}):s.jsx(Fs,{text:e.text,variant:"assistant",className:"text-sm"})]}),r]}),i&&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(Uc,{className:"h-3 w-3"})})]})}function wN({call:e,loading:t=!1,onApprove:n,onDeny:r,defaultOpen:a,className:i,description:o}){const c=e.status==="pending",d=e.tool||e.publicToolName||"unknown_tool";return s.jsxs("details",{open:a??c,className:Re("group overflow-hidden rounded-md border border-border/60 bg-background",i),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(pa,{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 ${d}`}),s.jsx("span",{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${c?"bg-amber-100 text-amber-900":e.status==="error"?"bg-red-100 text-red-900":e.status==="denied"?"bg-gray-100 text-gray-700":"bg-muted text-muted-foreground"}`,children:c?"Needs approval":e.status==="error"?"Error":e.status==="denied"?"Denied":"Approved"})]})}),s.jsx(tn,{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:[o&&s.jsx(Fs,{text:o,variant:"assistant",className:"text-sm"}),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(e.arguments??{},null,2)})}),e.error&&s.jsx("p",{className:"text-xs text-destructive",children:e.error}),c&&s.jsxs("div",{className:"mt-2 flex justify-end gap-2",children:[s.jsx(Z,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:t,onClick:()=>r?.(e.id),children:"Deny"}),s.jsx(Z,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:t,onClick:()=>n?.(e.id),children:"Approve"})]})]})]})}function F6(){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(Fr,{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(jr,{className:"h-4 w-4 animate-spin"}),"Thinking..."]})]})}function yve({snippets:e,snippetsLabel:t,onSnippetSelect:n,disabled:r=!1,contentClassName:a="w-[360px]"}){return s.jsxs(lp,{children:[s.jsx(cp,{asChild:!0,children:s.jsxs(Z,{type:"button",variant:"ghost",size:"sm",className:"h-7 shrink-0 gap-1 px-1.5 text-[11px] font-normal text-muted-foreground/80 hover:text-muted-foreground",disabled:r,children:[s.jsx(yi,{className:"h-3 w-3"}),"Snippets",s.jsx(tn,{className:"h-3 w-3"})]})}),s.jsxs($u,{align:"start",className:a,children:[s.jsx(CB,{children:t}),s.jsx(_B,{}),e.map(i=>s.jsx(Mr,{className:"items-start whitespace-normal px-2 py-2",onSelect:()=>n(i.prompt),children:s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("div",{className:"text-xs font-medium leading-tight",children:i.label}),s.jsx("div",{className:"text-[11px] leading-snug text-muted-foreground",children:i.description})]})},i.label))]})]})}function z6({input:e,onInputChange:t,onSend:n,onCancel:r,inputPlaceholder:a,snippets:i,snippetsLabel:o,onSnippetSelect:c,loading:d=!1,disabled:f=!1,inputRef:h,snippetContentClassName:p}){const v=f||d;return s.jsxs("div",{className:"rounded-xl border bg-background p-2 shadow-sm",children:[s.jsx(wa,{ref:h,value:e,onChange:x=>t(x.target.value),placeholder:a,disabled:f,rows:1,className:"min-h-10 max-h-40 resize-none border-0 bg-transparent px-2 py-1 text-sm shadow-none focus-visible:ring-0 focus-visible:ring-offset-0",onKeyDown:x=>{x.key==="Enter"&&!x.shiftKey&&(x.preventDefault(),v||n())}}),s.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 px-1 pt-1",children:[s.jsx(yve,{snippets:i,snippetsLabel:o,onSnippetSelect:c,disabled:v,contentClassName:p}),d&&r?s.jsxs(Z,{type:"button",variant:"outline",size:"sm",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-full",onClick:r,"aria-label":"Cancel assistant message",title:"Cancel assistant message",children:[s.jsx("span",{className:"pointer-events-none absolute inset-[2px] rounded-full border border-primary/20 border-t-primary/70 motion-reduce:animate-none animate-[spin_2.2s_linear_infinite]"}),s.jsx("span",{className:"pointer-events-none absolute inset-[4px] rounded-full border border-primary/10 motion-reduce:animate-none animate-pulse"}),s.jsx(Ld,{className:"relative z-10 h-4 w-4"})]}):d?s.jsx(Z,{type:"button",size:"icon",className:"h-8 w-8 shrink-0 rounded-full",disabled:!0,"aria-label":"Assistant is loading",title:"Assistant is loading",children:s.jsx(jr,{className:"h-4 w-4 animate-spin"})}):s.jsx(Z,{type:"button",size:"icon",className:"h-8 w-8 shrink-0 rounded-full pr-0.5",onClick:n,disabled:v||!e.trim(),"aria-label":"Send assistant message",title:"Send assistant message",children:s.jsx($9,{className:"h-4 w-4"})})]})]})}const bve=Bg,wve=qg,B6=m.forwardRef(({className:e,...t},n)=>s.jsx(_u,{ref:n,className:Re("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}));B6.displayName=_u.displayName;const q6=m.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(wve,{children:[s.jsx(B6,{}),s.jsxs(Au,{ref:r,className:Re("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(Ug,{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(ns,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));q6.displayName=Au.displayName;const U6=({className:e,...t})=>s.jsx("div",{className:Re("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});U6.displayName="DialogHeader";const W6=m.forwardRef(({className:e,...t},n)=>s.jsx(Hf,{ref:n,className:Re("text-lg font-semibold leading-none tracking-tight",e),...t}));W6.displayName=Hf.displayName;const V6=m.forwardRef(({className:e,...t},n)=>s.jsx(Kf,{ref:n,className:Re("text-sm text-muted-foreground",e),...t}));V6.displayName=Kf.displayName;function jve(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var k_="ScrollArea",[H6]=Sr(k_),[Sve,Zs]=H6(k_),K6=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:a,scrollHideDelay:i=600,...o}=e,[c,d]=m.useState(null),[f,h]=m.useState(null),[p,v]=m.useState(null),[x,j]=m.useState(null),[b,y]=m.useState(null),[S,N]=m.useState(0),[_,A]=m.useState(0),[k,E]=m.useState(!1),[P,R]=m.useState(!1),M=Mt(t,U=>d(U)),D=Iu(a);return s.jsx(Sve,{scope:n,type:r,dir:D,scrollHideDelay:i,scrollArea:c,viewport:f,onViewportChange:h,content:p,onContentChange:v,scrollbarX:x,onScrollbarXChange:j,scrollbarXEnabled:k,onScrollbarXEnabledChange:E,scrollbarY:b,onScrollbarYChange:y,scrollbarYEnabled:P,onScrollbarYEnabledChange:R,onCornerWidthChange:N,onCornerHeightChange:A,children:s.jsx(ft.div,{dir:D,...o,ref:M,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})})});K6.displayName=k_;var G6="ScrollAreaViewport",Y6=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:a,...i}=e,o=Zs(G6,n),c=m.useRef(null),d=Mt(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(ft.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})})]})});Y6.displayName=G6;var Ya="ScrollAreaScrollbar",E_=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Zs(Ya,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:o}=a,c=e.orientation==="horizontal";return m.useEffect(()=>(c?i(!0):o(!0),()=>{c?i(!1):o(!1)}),[c,i,o]),a.type==="hover"?s.jsx(Nve,{...r,ref:t,forceMount:n}):a.type==="scroll"?s.jsx(Cve,{...r,ref:t,forceMount:n}):a.type==="auto"?s.jsx(X6,{...r,ref:t,forceMount:n}):a.type==="always"?s.jsx(P_,{...r,ref:t}):null});E_.displayName=Ya;var Nve=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Zs(Ya,e.__scopeScrollArea),[i,o]=m.useState(!1);return m.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(Zn,{present:n||i,children:s.jsx(X6,{"data-state":i?"visible":"hidden",...r,ref:t})})}),Cve=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Zs(Ya,e.__scopeScrollArea),i=e.orientation==="horizontal",o=Bv(()=>d("SCROLL_END"),100),[c,d]=jve("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return m.useEffect(()=>{if(c==="idle"){const f=window.setTimeout(()=>d("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(f)}},[c,a.scrollHideDelay,d]),m.useEffect(()=>{const f=a.viewport,h=i?"scrollLeft":"scrollTop";if(f){let p=f[h];const v=()=>{const x=f[h];p!==x&&(d("SCROLL"),o()),p=x};return f.addEventListener("scroll",v),()=>f.removeEventListener("scroll",v)}},[a.viewport,i,d,o]),s.jsx(Zn,{present:n||c!=="hidden",children:s.jsx(P_,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:qe(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:qe(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),X6=m.forwardRef((e,t)=>{const n=Zs(Ya,e.__scopeScrollArea),{forceMount:r,...a}=e,[i,o]=m.useState(!1),c=e.orientation==="horizontal",d=Bv(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;o(c?f:h)}},10);return xu(n.viewport,d),xu(n.content,d),s.jsx(Zn,{present:r||i,children:s.jsx(P_,{"data-state":i?"visible":"hidden",...a,ref:t})})}),P_=m.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,a=Zs(Ya,e.__scopeScrollArea),i=m.useRef(null),o=m.useRef(0),[c,d]=m.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=t8(c.viewport,c.content),h={...r,sizes:c,onSizesChange:d,hasThumb:f>0&&f<1,onThumbChange:v=>i.current=v,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:v=>o.current=v};function p(v,x){return Tve(v,o.current,c,x)}return n==="horizontal"?s.jsx(_ve,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const v=a.viewport.scrollLeft,x=C$(v,c,a.dir);i.current.style.transform=`translate3d(${x}px, 0, 0)`}},onWheelScroll:v=>{a.viewport&&(a.viewport.scrollLeft=v)},onDragScroll:v=>{a.viewport&&(a.viewport.scrollLeft=p(v,a.dir))}}):n==="vertical"?s.jsx(Ave,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const v=a.viewport.scrollTop,x=C$(v,c);i.current.style.transform=`translate3d(0, ${x}px, 0)`}},onWheelScroll:v=>{a.viewport&&(a.viewport.scrollTop=v)},onDragScroll:v=>{a.viewport&&(a.viewport.scrollTop=p(v))}}):null}),_ve=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,i=Zs(Ya,e.__scopeScrollArea),[o,c]=m.useState(),d=m.useRef(null),f=Mt(t,d,i.onScrollbarXChange);return m.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),s.jsx(Z6,{"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":zv(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,p)=>{if(i.viewport){const v=i.viewport.scrollLeft+h.deltaX;e.onWheelScroll(v),r8(v,p)&&h.preventDefault()}},onResize:()=>{d.current&&i.viewport&&o&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:fg(o.paddingLeft),paddingEnd:fg(o.paddingRight)}})}})}),Ave=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,i=Zs(Ya,e.__scopeScrollArea),[o,c]=m.useState(),d=m.useRef(null),f=Mt(t,d,i.onScrollbarYChange);return m.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),s.jsx(Z6,{"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":zv(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,p)=>{if(i.viewport){const v=i.viewport.scrollTop+h.deltaY;e.onWheelScroll(v),r8(v,p)&&h.preventDefault()}},onResize:()=>{d.current&&i.viewport&&o&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:fg(o.paddingTop),paddingEnd:fg(o.paddingBottom)}})}})}),[kve,Q6]=H6(Ya),Z6=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:a,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:c,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:h,onResize:p,...v}=e,x=Zs(Ya,n),[j,b]=m.useState(null),y=Mt(t,M=>b(M)),S=m.useRef(null),N=m.useRef(""),_=x.viewport,A=r.content-r.viewport,k=Gn(h),E=Gn(d),P=Bv(p,10);function R(M){if(S.current){const D=M.clientX-S.current.left,U=M.clientY-S.current.top;f({x:D,y:U})}}return m.useEffect(()=>{const M=D=>{const U=D.target;j?.contains(U)&&k(D,A)};return document.addEventListener("wheel",M,{passive:!1}),()=>document.removeEventListener("wheel",M,{passive:!1})},[_,j,A,k]),m.useEffect(E,[r,E]),xu(j,P),xu(x.content,P),s.jsx(kve,{scope:n,scrollbar:j,hasThumb:a,onThumbChange:Gn(i),onThumbPointerUp:Gn(o),onThumbPositionChange:E,onThumbPointerDown:Gn(c),children:s.jsx(ft.div,{...v,ref:y,style:{position:"absolute",...v.style},onPointerDown:qe(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",x.viewport&&(x.viewport.style.scrollBehavior="auto"),R(M))}),onPointerMove:qe(e.onPointerMove,R),onPointerUp:qe(e.onPointerUp,M=>{const D=M.target;D.hasPointerCapture(M.pointerId)&&D.releasePointerCapture(M.pointerId),document.body.style.webkitUserSelect=N.current,x.viewport&&(x.viewport.style.scrollBehavior=""),S.current=null})})})}),dg="ScrollAreaThumb",J6=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Q6(dg,e.__scopeScrollArea);return s.jsx(Zn,{present:n||a.hasThumb,children:s.jsx(Eve,{ref:t,...r})})}),Eve=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...a}=e,i=Zs(dg,n),o=Q6(dg,n),{onThumbPositionChange:c}=o,d=Mt(t,p=>o.onThumbChange(p)),f=m.useRef(void 0),h=Bv(()=>{f.current&&(f.current(),f.current=void 0)},100);return m.useEffect(()=>{const p=i.viewport;if(p){const v=()=>{if(h(),!f.current){const x=Rve(p,c);f.current=x,c()}};return c(),p.addEventListener("scroll",v),()=>p.removeEventListener("scroll",v)}},[i.viewport,h,c]),s.jsx(ft.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:qe(e.onPointerDownCapture,p=>{const x=p.target.getBoundingClientRect(),j=p.clientX-x.left,b=p.clientY-x.top;o.onThumbPointerDown({x:j,y:b})}),onPointerUp:qe(e.onPointerUp,o.onThumbPointerUp)})});J6.displayName=dg;var T_="ScrollAreaCorner",e8=m.forwardRef((e,t)=>{const n=Zs(T_,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?s.jsx(Pve,{...e,ref:t}):null});e8.displayName=T_;var Pve=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,a=Zs(T_,n),[i,o]=m.useState(0),[c,d]=m.useState(0),f=!!(i&&c);return xu(a.scrollbarX,()=>{const h=a.scrollbarX?.offsetHeight||0;a.onCornerHeightChange(h),d(h)}),xu(a.scrollbarY,()=>{const h=a.scrollbarY?.offsetWidth||0;a.onCornerWidthChange(h),o(h)}),f?s.jsx(ft.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 fg(e){return e?parseInt(e,10):0}function t8(e,t){const n=e/t;return isNaN(n)?0:n}function zv(e){const t=t8(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Tve(e,t,n,r="ltr"){const a=zv(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 n8([d,f],p)(e)}function C$(e,t,n="ltr"){const r=zv(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=Df(e,d);return n8([0,o],[0,c])(f)}function n8(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 r8(e,t){return e>0&&e<t}var Rve=(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 Bv(e,t){const n=Gn(e),r=m.useRef(0);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),m.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function xu(e,t){const n=Gn(t);ir(()=>{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 s8=K6,Ove=Y6,Mve=e8;const R_=m.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(s8,{ref:r,className:Re("relative overflow-hidden",e),...n,children:[s.jsx(Ove,{className:"h-full w-full rounded-[inherit]",children:t}),s.jsx(a8,{}),s.jsx(Mve,{})]}));R_.displayName=s8.displayName;const a8=m.forwardRef(({className:e,orientation:t="vertical",...n},r)=>s.jsx(E_,{ref:r,orientation:t,className:Re("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(J6,{className:"relative flex-1 rounded-full bg-border"})}));a8.displayName=E_.displayName;function jN(e){return e instanceof Error&&e.name==="AbortError"||typeof e=="object"&&e!==null&&"name"in e&&e.name==="AbortError"}function Ive(e,t,n){if(e.type==="agent_check"){const a=String(e.label??"").trim();return a?t.find(i=>i.type==="agent_check"&&i.label===a):void 0}const r=n(e);return t.find(a=>a.type===e.type&&a.label===r)}function i8({evalRules:e,failureReasons:t,runError:n,checkResults:r}){return n||t.find(i=>i.startsWith("Scenario error:"))?e.map(i=>({rule:i,status:"not_evaluated",failureReason:void 0})):r?.length?e.map(i=>{const o=Ive(i,r,qv);return{rule:i,status:o?.status??"not_evaluated",failureReason:o?.reason}}):e.map(i=>{const o=Dve(i,t);return{rule:i,status:o?"failed":"passed",failureReason:o}})}function qv(e){return e.type==="required_tool"?`Required tool · ${e.value}`:e.type==="forbidden_tool"?`Forbidden tool · ${e.value}`:e.type==="tool_sequence"?A_(e.sequence??[]):e.type==="response_contains"?`Text contains · ${e.value}`:e.type==="response_not_contains"?`Text does not contain · ${e.value}`:e.type==="response_starts_with"?`Text starts with · ${e.value}`:e.type==="response_ends_with"?`Text ends with · ${e.value}`:e.type==="response_equals"?`Text equals · ${e.value}`:e.type==="response_regex"?`Text matches regex · ${e.value}`:e.type==="response_jsonpath"?e.equals!==void 0?`JSONPath equals · ${e.path} == ${String(e.equals)}`:`JSONPath exists · ${e.path}`:e.type==="response_jsonpath_exists"?`JSONPath exists · ${e.path}`:e.type==="response_jsonpath_not_exists"?`JSONPath not exists · ${e.path}`:e.type==="agent_check"?`Agent check · ${e.label}`:`${e.type} · ${e.value}`}function $ve(e){return A_(e).replace(/^Tool sequence · /,"")}function Dve(e,t){if(e.type==="response_jsonpath_exists"){const a=String(e.path??"").trim();return a?t.find(i=>i.startsWith(`JSONPath assertion failed: ${a}`)||i.startsWith(`JSONPath assertion failed: invalid JSON for path ${a}`)):void 0}const n=e.type==="required_tool"?`Required tool not used: ${e.value}`:e.type==="forbidden_tool"?`Forbidden tool used: ${e.value}`:e.type==="tool_sequence"?`Tool sequence order was not satisfied: ${(e.sequence??[]).join(" -> ")}`:e.type==="response_contains"?`Contains assertion failed: ${e.value}`:e.type==="response_not_contains"?`Not-contains assertion failed: ${e.value}`:e.type==="response_starts_with"?`Starts-with assertion failed: ${e.value}`:e.type==="response_ends_with"?`Ends-with assertion failed: ${e.value}`:e.type==="response_equals"?`Equals assertion failed: ${e.value}`:e.type==="response_regex"?`Regex assertion failed: ${e.value}`:e.type==="response_jsonpath"?e.equals!==void 0?`JSONPath equals assertion failed: ${e.path}`:`JSONPath assertion failed: ${e.path}`:e.type==="response_jsonpath_not_exists"?`JSONPath not-exists assertion failed: ${e.path}`:e.type==="agent_check"?String(e.label??""):"";if(!n)return;const r=t.find(a=>a===n);return r||(e.type==="response_regex"?t.find(a=>a.startsWith("Regex assertion failed:")&&a.includes(e.value??"")):e.type==="response_jsonpath"||e.type==="response_jsonpath_not_exists"?t.find(a=>a.includes(e.path??"")):e.type==="tool_sequence"?t.find(a=>a.startsWith(`Tool sequence order was not satisfied: ${$ve(e.sequence??[])}`)||a.startsWith("Required tool in sequence not used:")):t.find(a=>a.startsWith(n)))}async function Lve(e){const{sessionId:t,source:n,serverName:r,onLaunchUrl:a,timeoutMs:i=5*6e4}=e,o=Date.now()+i;let c=!1;for(;Date.now()<o;){const{session:d}=await n.getOAuthRuntimeSession(t),f=d.authorizeLaunchUrl||d.authorizationUrl||"";if(f&&a&&a(f),d.status==="completed"&&d.hasAccessToken){c=!0;break}if(d.status==="error"||d.status==="stopped")throw new Error(`OAuth login failed for '${r}' (${d.status}). ${d.lastError||""}`.trim());await new Promise(h=>setTimeout(h,1500))}if(!c)throw new Error(`OAuth login timed out for '${r}'. Authorization was not completed within 5 minutes.`)}const Fve=250;async function vi(e){const{serverNames:t,source:n,onServerAuthStart:r,onServerStatus:a,timeoutMs:i=5*6e4}=e,o=Array.from(new Set(t.filter(Boolean)));if(o.length===0)return;const c=Date.now()+i,d=new Set,f=new Map;for(;Date.now()<c;){const h=await n.ensureOAuthServers({serverNames:o});for(const v of h.servers){const x=`${v.status}:${v.debugState??""}:${v.runtimeSessionId??""}`;f.get(v.serverName)!==x&&(f.set(v.serverName,x),a?.({serverName:v.serverName,status:v.status,debugState:v.debugState,tokenExpiresAt:v.tokenExpiresAt,tokenExpiresInSeconds:v.tokenExpiresInSeconds,message:v.message}))}const p=h.servers.filter(v=>v.status==="auth_required");if(p.length===0&&h.allReady)return;for(const v of p){const x=v.runtimeSessionId;if(!x)throw new Error(v.message||`OAuth login required for '${v.serverName}'.`);d.has(x)||(d.add(x),r?.(v.serverName));const j=(()=>{let b=!1;return y=>{if(b||!y)return;b=!0;const S=y.startsWith("http")?y:`${window.location.origin}${y}`;window.open(S,"_blank","noopener,noreferrer")}})();j(v.authorizeLaunchUrl||v.authorizationUrl||""),await Lve({sessionId:x,source:n,serverName:v.serverName,onLaunchUrl:j,timeoutMs:Math.max(1e4,c-Date.now())})}await new Promise(v=>{window.setTimeout(v,Fve)})}throw new Error("OAuth login timed out before all required servers were authorized.")}const zve=[{label:"Suggest Checks",description:"Propose stronger evaluation checks for this scenario.",prompt:"Review the current checks in this scenario and suggest stronger alternatives. For each suggestion, explain what failure mode it catches that the existing checks miss. Prioritize checks that are deterministic, not sensitive to minor phrasing changes, and that would reliably catch regressions."},{label:"Suggest Value Capture Rules",description:"Recommend extract/value capture rules for key outputs.",prompt:"Analyze the expected tool calls and outputs in this scenario and suggest value capture rules that extract the most meaningful structured data. For each rule, explain which field to capture, why it matters for evaluation, and what a good vs. bad captured value looks like."},{label:"Generate Structured Updates",description:"Return apply-ready Checks and Value Capture suggestions.",prompt:["Propose concrete scenario updates and include structured suggestions that can be applied directly.","Return ONLY valid JSON envelope and no markdown.","Required shape:",'{"type":"assistant_message","text":"short rationale","suggestions":{"evalRules":{"replacement":[...]}, "extractRules":{"replacement":[...]}}}',"If tool usage is clear, include at least one required_tool check.","Prefer deterministic checks and concise capture patterns."].join(`
|
|
127
|
+
`)},{label:"Improve Prompt Determinism",description:"Reduce ambiguity and improve reproducibility.",prompt:"Identify parts of this scenario's prompt or context that are ambiguous, open-ended, or likely to produce different results across runs. Suggest specific rewrites that make the expected behavior more deterministic — without changing the intent of what is being tested."},{label:"Generate Scenario Draft",description:"Create a draft scenario from the current context.",prompt:"Based on the current tool configuration and context, generate a complete scenario draft. Include a clear prompt, realistic expected tool calls with arguments, meaningful checks that validate the core behavior, and at least one value capture rule. Explain your choices so I can adjust them."}];function o8(e){if(Array.isArray(e.sequence))return e.sequence.map(n=>n.trim()).filter(Boolean);const t=typeof e.value=="string"?e.value.trim():"";return!t||t.toLowerCase()==="tool sequence"?[]:t.split(/\s*(?:->|,|\n)\s*/).map(n=>n.trim()).filter(Boolean)}function Bve(e){const t=[];let n=0;for(const r of e){if(r.type==="tool_sequence"){const a=o8(r);a.length>0?t.push({type:"tool_sequence",sequence:a}):n+=1;continue}t.push(r)}return{rules:t,skippedToolSequences:n}}function qve(e){if(e.type==="tool_sequence"){const t=o8(e);return t.length>0?`Tool sequence · ${t.join(" -> ")}`:"Tool sequence · No tool steps"}return qv(e)}function Uve({open:e,onOpenChange:t,configId:n,configPath:r,scenario:a,agents:i,servers:o,defaultAssistantAgentName:c,initialUserMessage:d,onApplyPatch:f}){const{source:h}=On(),[p,v]=m.useState(null),[x,j]=m.useState(null),[b,y]=m.useState(""),[S,N]=m.useState(!1),[_,A]=m.useState(!1),[k,E]=m.useState(new Set),P=m.useRef(null),R=m.useRef(null),M=m.useRef(null),D=m.useRef(null),U=m.useRef(0),[F,G]=m.useState(!1),H=m.useRef(!1),L=c||i[0]?.id||"",I=m.useCallback(()=>{const xe=D.current;xe&&xe.controller.abort()},[]);m.useEffect(()=>{if(!e||!L||p)return;let xe=!1;return N(!0),(async()=>{const ot=Array.from(new Set(a.serverIds.filter(ut=>o.find(Xe=>Xe.id===ut)?.authType==="oauth2")));await vi({serverNames:ot,source:h});const lt=await h.createScenarioAssistantSession({configId:n,configPath:r,scenarioId:a.id,selectedAssistantAgentName:L,context:{scenario:{id:a.id,name:a.name,prompt:a.prompt,serverNames:a.serverIds,evalRules:a.evalRules,extractRules:a.extractRules},availableServers:o.map(ut=>({name:ut.name||ut.id,url:ut.url})),availableAgents:i.map(ut=>({name:ut.name||ut.id,provider:ut.provider,model:ut.model}))}});xe||(v(lt.sessionId),W(lt.session),N(!1))})().catch(ot=>{xe||Me({title:"Could not start Scenario Assistant",description:ot instanceof Error?ot.message:String(ot),variant:"destructive"})}).finally(()=>{xe||N(!1)}),()=>{xe=!0}},[e,h,p,n,r,a,i,o,L]);const Y=()=>{I(),v(null),j(null),y(""),E(new Set),M.current=null},W=m.useCallback(xe=>{j(we=>we&&we.messages.length>xe.messages.length?we:xe)},[]),O=m.useCallback(()=>{const xe=D.current;xe&&(I(),y(xe.prompt),N(!1),A(!1))},[I]),Q=xe=>{Y(),h.closeScenarioAssistantSession(xe).catch(()=>{})};m.useEffect(()=>{e||p&&(H.current||F||Q(p))},[e,p,h,F]),m.useEffect(()=>()=>{I(),p&&h.closeScenarioAssistantSession(p).catch(()=>{})},[I,p,h]),m.useEffect(()=>{if(!e)return;F&&G(!1),H.current&&(H.current=!1);const xe=window.setTimeout(()=>{P.current?.scrollIntoView({behavior:"smooth",block:"end"})},0);return()=>window.clearTimeout(xe)},[e,S,x?.messages.length,x?.pendingToolCalls.length,x?.warnings.length]),m.useEffect(()=>{const xe=R.current;if(!xe)return;xe.style.height="0px";const we=Math.min(xe.scrollHeight,160);xe.style.height=`${Math.max(40,we)}px`},[b,e]);const q=i.length>0&&a.serverIds.length>0&&!!L,z=async xe=>{if(!p)return;const we=xe.trim();if(!we)return;const ot=++U.current,lt=new AbortController,ut=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,At={id:ut,role:"user",text:we,createdAt:new Date().toISOString()};D.current={id:ot,controller:lt,prompt:we},A(!0),j(Xe=>Xe&&{...Xe,messages:[...Xe.messages,At]}),y(""),N(!0);try{const Xe=await h.sendScenarioAssistantMessage(p,we,lt.signal);if(lt.signal.aborted||D.current?.id!==ot)return;W(Xe.session)}catch(Xe){if(jN(Xe)||lt.signal.aborted||D.current?.id!==ot)return;j(Se=>Se&&{...Se,messages:Se.messages.filter(Ae=>Ae.id!==ut)}),y(Se=>Se.trim()?Se:we),Me({title:"Scenario Assistant error",description:Xe instanceof Error?Xe.message:String(Xe),variant:"destructive"})}finally{D.current?.id===ot&&(D.current=null,N(!1),A(!1))}},K=xe=>{y(xe),requestAnimationFrame(()=>R.current?.focus())};m.useEffect(()=>{if(!e||!p||!x||!q||D.current)return;const xe=String(d??"").trim();xe&&M.current!==xe&&(M.current=xe,z(xe))},[e,p,x,q,d]),m.useEffect(()=>{if(!(!e||!p||!x))return h.subscribeScenarioAssistantSessionEvents(p,xe=>{W(xe.payload.session)})},[e,p,h,W]);const J=async xe=>{if(p){N(!0);try{const we=await h.approveScenarioAssistantToolCall(p,xe);W(we.session)}catch(we){Me({title:"Tool call failed",description:we instanceof Error?we.message:String(we),variant:"destructive"})}finally{N(!1)}}},ne=async xe=>{if(p){N(!0);try{const we=await h.denyScenarioAssistantToolCall(p,xe);W(we.session)}catch(we){Me({title:"Could not deny tool call",description:we instanceof Error?we.message:String(we),variant:"destructive"})}finally{N(!1)}}},he=async()=>{if(p){N(!0);try{const xe=await h.approveAllScenarioAssistantToolCalls(p);W(xe.session)}catch(xe){Me({title:"Could not approve all tool calls",description:xe instanceof Error?xe.message:String(xe),variant:"destructive"})}finally{N(!1)}}},ie=(xe,we,ot,lt,ut="replace")=>{if(!we)return;if(ot==="prompt"&&we.prompt&&f({prompt:we.prompt.replacement}),ot==="evalRules"&&we.evalRules){const Xe=Bve(lt??we.evalRules.replacement);f({evalRules:ut==="append"?[...a.evalRules,...Xe.rules]:Xe.rules}),Xe.skippedToolSequences>0&&Me({title:"Skipped invalid tool sequence",description:"The assistant suggested a sequence check without any tool steps.",variant:"destructive"})}if(ot==="extractRules"&&we.extractRules&&f({extractRules:we.extractRules.replacement}),xe){const Xe=`${xe}:${ot}`;E(Se=>new Set([...Se,Xe]))}Me({title:"Applied suggestion",description:`Updated ${{prompt:"Prompt",evalRules:"Checks",extractRules:"Value Capture Rules"}[ot]}`})},me=(xe,we,ot,lt)=>{if(we?.extractRules){if(f({extractRules:lt==="append"?[...a.extractRules,...ot]:ot}),xe){const ut=`${xe}:extractRules`;E(At=>new Set([...At,ut]))}Me({title:"Applied suggestion",description:"Updated Value Capture Rules"})}},se=()=>{const xe=document.activeElement;xe instanceof HTMLElement&&xe.blur()},ge=xe=>{xe||(se(),G(!1),H.current=!1),t(xe)},Oe=()=>{se(),H.current=!0,G(!0),t(!1)},fe=()=>{se(),H.current=!1,G(!1),p&&Q(p)};return s.jsxs(s.Fragment,{children:[!e&&p&&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}),x?` · ${x.messages.length} messages`:""]})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[s.jsxs(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>t(!0),children:[s.jsx(Zr,{className:"mr-1.5 h-3.5 w-3.5"}),"Resume"]}),s.jsx(Z,{type:"button",size:"sm",variant:"ghost",className:"h-8 px-2 text-muted-foreground",onClick:fe,"aria-label":"Discard assistant session",title:"Discard assistant session",children:s.jsx(ns,{className:"h-4 w-4"})})]})]}),s.jsx(bve,{open:e,onOpenChange:ge,children:s.jsxs(q6,{className:"max-w-6xl h-[85vh] flex flex-col",children:[p&&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:Oe,"aria-label":"Minimize assistant",title:"Minimize assistant",children:[s.jsx(O9,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Minimize"})]}),s.jsx(U6,{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(W6,{className:"flex items-center gap-2",children:[s.jsx(Zr,{className:"h-4 w-4"}),"Scenario Assistant"]}),s.jsx(V6,{children:"LLM-guided scenario authoring with MCP tool introspection and per-tool-call approval."})]})})}),q?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(Ve,{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(pa,{className:"h-3.5 w-3.5"}),x?`Loaded ${x.toolsLoaded} tools`:"Preparing..."]})]})}),s.jsx(R_,{className:"min-h-0 flex-1 rounded-md border p-3",children:s.jsxs("div",{className:"space-y-3",children:[x?.warnings?.map((xe,we)=>s.jsx("div",{className:"rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-900",children:xe},`${xe}-${we}`)),x?.messages.map(xe=>s.jsxs(m.Fragment,{children:[(()=>{const we=xe.pendingToolCallIds??(xe.pendingToolCallId?[xe.pendingToolCallId]:[]),ot=we.map(Se=>(x?.pendingToolCalls??[]).find(Ae=>Ae.id===Se)).filter(Se=>!!Se),lt=we.map(Se=>x.pendingToolCalls.find(Ae=>Ae.id===Se)??x.pendingToolCalls.find(Ae=>Ae.id===Se)).filter(Boolean);if(!(xe.role==="assistant"&&we.length>0))return s.jsx("div",{className:"space-y-2",children:s.jsx(Kve,{message:xe})});const At=ot.length,Xe=lt.length-At;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(Fr,{className:"h-3 w-3"})}),s.jsxs("div",{className:"w-full max-w-[92%] space-y-2",children:[lt.length>1&&At>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:[Xe," of ",lt.length," tool calls resolved"]}),s.jsxs(Z,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:At===0,onClick:()=>{he()},children:["Approve All (",At,")"]})]}),lt.map((Se,Ae)=>s.jsx(wN,{call:Se,loading:S,description:Ae===0?xe.text:void 0,onApprove:Je=>{J(Je)},onDeny:Je=>{ne(Je)}},Se.id))]})]})})(),xe.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(Zr,{className:"h-3.5 w-3.5"}),"Structured Suggestions"]}),xe.suggestions.prompt&&s.jsx(Wve,{title:"Prompt",rationale:xe.suggestions.prompt.rationale,preview:xe.suggestions.prompt.replacement,applied:k.has(`${xe.id}:prompt`),onApply:()=>ie(xe.id,xe.suggestions,"prompt")}),xe.suggestions.evalRules&&s.jsx(Vve,{rationale:xe.suggestions.evalRules.rationale,rules:xe.suggestions.evalRules.replacement,applied:k.has(`${xe.id}:evalRules`),onApply:we=>ie(xe.id,xe.suggestions,"evalRules",we,"append"),onReplace:we=>ie(xe.id,xe.suggestions,"evalRules",we,"replace")}),xe.suggestions.extractRules&&s.jsx(Hve,{rationale:xe.suggestions.extractRules.rationale,rules:xe.suggestions.extractRules.replacement,applied:k.has(`${xe.id}:extractRules`),onApply:we=>me(xe.id,xe.suggestions,we,"append"),onReplace:we=>me(xe.id,xe.suggestions,we,"replace")}),(()=>{const we=xe.suggestions?.notes,ot=Array.isArray(we)?we:typeof we=="string"?[we]:[];return ot.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:ot.map((lt,ut)=>s.jsx("li",{children:lt},`${xe.id}-note-${ut}`))})]})})()]})]},xe.id)),(x?.pendingToolCalls??[]).filter(xe=>!(x?.messages??[]).some(we=>we.pendingToolCallId===xe.id||we.pendingToolCallIds?.includes(xe.id))).map(xe=>s.jsx(wN,{call:xe,loading:S,onApprove:we=>{J(we)},onDeny:we=>{ne(we)}},xe.id)),!x&&S&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(jr,{className:"h-4 w-4 animate-spin"}),"Starting assistant session..."]}),x&&S&&s.jsx(F6,{}),s.jsx("div",{ref:P})]})}),s.jsx(z6,{input:b,onInputChange:y,onSend:()=>{z(b)},onCancel:p&&_?O:void 0,inputPlaceholder:"Get assistance with creating or refining this scenario ...",snippets:zve,snippetsLabel:"Scenario Assistant Snippets",onSnippetSelect:K,loading:S,disabled:!p,inputRef:R,snippetContentClassName:"w-[320px]"})]}):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 Wve({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.jsx("div",{className:"flex items-center justify-between gap-2",children:s.jsx("h5",{className:"text-sm font-medium",children:e})}),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}),s.jsx("div",{className:"flex justify-end",children:s.jsx(Z,{type:"button",size:"sm",className:"h-8",variant:r?"secondary":"default",onClick:a,disabled:r,children:r?s.jsxs(s.Fragment,{children:[s.jsx(ga,{className:"mr-1.5 h-3.5 w-3.5"}),"Applied"]}):"Apply"})})]})}function Vve({rationale:e,rules:t,applied:n=!1,onApply:r,onReplace:a}){const[i,o]=m.useState(()=>new Set(t.map((p,v)=>v))),c=i.size,d=t.filter((p,v)=>i.has(v)),f=c===t.length,h=(p,v)=>{o(x=>{const j=new Set(x);return v?j.add(p):j.delete(p),j})};return s.jsxs("div",{className:`space-y-2 rounded-md border p-3 ${n?"border-emerald-300 bg-emerald-50/40":""}`,children:[s.jsx("div",{className:"flex items-center justify-between gap-2",children:s.jsx("h5",{className:"text-sm font-medium",children:"Checks"})}),e&&s.jsx("p",{className:"text-xs text-muted-foreground",children:e}),s.jsxs("div",{className:"space-y-2 rounded bg-muted/60 p-2",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2 px-1",children:[s.jsxs("span",{className:"text-[11px] text-muted-foreground",children:[c," of ",t.length," selected"]}),s.jsx(Z,{type:"button",size:"sm",variant:"ghost",className:"h-6 px-2 text-[11px]",disabled:n||t.length===0,onClick:()=>o(f?new Set:new Set(t.map((p,v)=>v))),children:f?"Unselect all":"Select all"})]}),t.map((p,v)=>{const x=qve(p),j=`scenario-assistant-check-${v}-${p.type}`;return s.jsxs("div",{className:"flex items-start gap-2 rounded bg-background p-2",children:[s.jsx(wr,{id:j,checked:i.has(v),disabled:n,onCheckedChange:b=>h(v,b===!0),"aria-label":`Select ${x}`}),s.jsxs("label",{htmlFor:j,className:"min-w-0 flex-1 cursor-pointer space-y-1",children:[s.jsx("span",{className:"block text-xs font-medium",children:x}),s.jsx("code",{className:"block break-words rounded bg-muted px-1.5 py-1 text-[11px] text-muted-foreground",children:JSON.stringify(p)})]})]},`${p.type}-${v}`)})]}),s.jsx("div",{className:"flex justify-end gap-2",children:n?s.jsxs(Z,{type:"button",size:"sm",variant:"secondary",disabled:!0,children:[s.jsx(ga,{className:"mr-1.5 h-3.5 w-3.5"}),"Applied"]}):s.jsxs(s.Fragment,{children:[s.jsx(Z,{type:"button",size:"sm",className:"h-8",variant:"outline",onClick:()=>a(d),disabled:c===0,children:"Replace all"}),s.jsx(Z,{type:"button",size:"sm",className:"h-8",onClick:()=>r(d),disabled:c===0,children:"Add selected"})]})})]})}function Hve({rationale:e,rules:t,applied:n=!1,onApply:r,onReplace:a}){const[i,o]=m.useState(()=>new Set(t.map((p,v)=>v))),c=i.size,d=t.filter((p,v)=>i.has(v)),f=c===t.length,h=(p,v)=>{o(x=>{const j=new Set(x);return v?j.add(p):j.delete(p),j})};return s.jsxs("div",{className:`space-y-2 rounded-md border p-3 ${n?"border-emerald-300 bg-emerald-50/40":""}`,children:[s.jsx("div",{className:"flex items-center justify-between gap-2",children:s.jsx("h5",{className:"text-sm font-medium",children:"Value Capture Rules"})}),e&&s.jsx("p",{className:"text-xs text-muted-foreground",children:e}),s.jsxs("div",{className:"space-y-2 rounded bg-muted/60 p-2",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2 px-1",children:[s.jsxs("span",{className:"text-[11px] text-muted-foreground",children:[c," of ",t.length," selected"]}),s.jsx(Z,{type:"button",size:"sm",variant:"ghost",className:"h-6 px-2 text-[11px]",disabled:n||t.length===0,onClick:()=>o(f?new Set:new Set(t.map((p,v)=>v))),children:f?"Unselect all":"Select all"})]}),t.map((p,v)=>{const x=`${p.name} · ${p.pattern}`,j=`scenario-assistant-extract-${v}-${p.name}`;return s.jsxs("div",{className:"flex items-start gap-2 rounded bg-background p-2",children:[s.jsx(wr,{id:j,checked:i.has(v),disabled:n,onCheckedChange:b=>h(v,b===!0),"aria-label":`Select ${x}`}),s.jsxs("label",{htmlFor:j,className:"min-w-0 flex-1 cursor-pointer space-y-1",children:[s.jsx("span",{className:"block text-xs font-medium",children:x}),s.jsx("code",{className:"block break-words rounded bg-muted px-1.5 py-1 text-[11px] text-muted-foreground",children:JSON.stringify(p)})]})]},`${p.name}-${v}`)})]}),s.jsx("div",{className:"flex justify-end gap-2",children:n?s.jsxs(Z,{type:"button",size:"sm",variant:"secondary",disabled:!0,children:[s.jsx(ga,{className:"mr-1.5 h-3.5 w-3.5"}),"Applied"]}):s.jsxs(s.Fragment,{children:[s.jsx(Z,{type:"button",size:"sm",className:"h-8",variant:"outline",onClick:()=>a(d),disabled:c===0,children:"Replace all"}),s.jsx(Z,{type:"button",size:"sm",className:"h-8",onClick:()=>r(d),disabled:c===0,children:"Add selected"})]})})]})}function Kve({message:e}){const t=async a=>{try{await navigator.clipboard.writeText(a),Me({title:"Copied"})}catch(i){Me({title:"Could not copy",description:i instanceof Error?i.message:String(i),variant:"destructive"})}},n=e.role==="user"||e.role==="assistant",r=e.role==="user";return s.jsx(L6,{message:e,assistantLabel:e.role==="assistant"?"Assistant":void 0,renderActions:n?s.jsx(Z,{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(ss,{className:"h-3.5 w-3.5"})}):void 0})}function Yr(e){return typeof e=="number"?e.toLocaleString():"n/a"}function SN(e,t){const n=t?.nonPositiveLabel??"0s";if(!Number.isFinite(e)||e<=0)return n;const r=Math.floor(e),a=Math.floor(r/3600),i=Math.floor(r%3600/60),o=r%60;return a>0?`${a}h ${i}m ${o}s`:i>0?`${i}m ${o}s`:`${o}s`}function Gve({run:e,fallbackUserPrompt:t}){const[n,r]=m.useState(!0),[a,i]=m.useState(!1);return s.jsxs("div",{className:"space-y-2",children:[s.jsx(da,{open:n,onOpenChange:r,children:s.jsxs("div",{className:"rounded-md border border-muted-foreground/20 bg-card p-2",children:[s.jsx(Ms,{asChild:!0,children:s.jsx("button",{type:"button",className:"mb-2 flex w-full items-center justify-between gap-2 text-left",children:s.jsxs("p",{className:"flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:[s.jsx(tn,{className:`h-3.5 w-3.5 transition-transform ${n?"rotate-180":""}`}),s.jsx(Fr,{className:"h-3.5 w-3.5"}),"Final answer"]})})}),s.jsx(fa,{children:s.jsx(NN,{text:e.finalAnswer||"No final answer captured.",maxLength:1200,className:"text-xs text-foreground"})})]})}),s.jsx(da,{open:a,onOpenChange:i,children:s.jsxs("div",{className:"rounded-md border border-muted-foreground/20 bg-card 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(tn,{className:`h-3.5 w-3.5 transition-transform ${a?"rotate-180":""}`}),s.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Conversation trace"})]})}),s.jsxs(st,{variant:"outline",className:"h-5 text-[10px]",children:[e.toolCalls.length," tool calls"]})]}),s.jsx(fa,{children:s.jsx("div",{className:"space-y-2 rounded-md border bg-muted/20 p-2",children:e.conversation.length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No conversation trace captured."}):e.conversation.map(o=>s.jsx(Yve,{item:o,fallbackUserPrompt:t},o.id))})})]})})]})}function Yve({item:e,fallbackUserPrompt:t}){if(e.kind==="tool_call"){const d=_$(e,"input");return s.jsx(k$,{variant:"call",title:`Tool call · ${e.toolName||"unknown"}${d}`,text:e.text})}if(e.kind==="tool_result"){const d=_$(e,"output"),f=e.ok?s.jsx(ga,{className:"h-3.5 w-3.5 text-emerald-700 dark:text-emerald-300"}):s.jsx(tl,{className:"h-3.5 w-3.5 text-rose-700 dark:text-rose-300"});return s.jsx(k$,{variant:e.ok?"result_ok":"result_error",title:`Tool result · ${e.toolName||"unknown"} · ${e.ok?"ok":"error"}${typeof e.durationMs=="number"?` · ${e.durationMs}ms`:""}${d}`,text:e.text,icon:f})}const n=e.kind==="user_prompt",r=A$(e.text,e.kind),a=t?A$(t,"user_prompt"):"",i=n&&!r&&a?a:r,o=n?"User prompt":e.kind==="assistant_final"?"Agent final":"Agent",c=n?Uc:Fr;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(NN,{text:i,maxLength:280,className:"text-xs"}):s.jsx(NN,{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 _$(e,t){const n=t==="input"?e.estimatedTokens?.inputTokens:e.estimatedTokens?.outputTokens;return typeof n!="number"?"":` · estimated ${Yr(n)} tokens`}function A$(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 k$({variant:e,title:t,text:n,icon:r}){const[a,i]=m.useState(!1),o={call:"border-sky-500/30 bg-sky-500/10 text-sky-700 dark:text-sky-300",result_ok:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",result_error:"border-rose-500/30 bg-rose-500/10 text-rose-700 dark:text-rose-300"};return s.jsx(da,{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(pa,{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(fa,{children:s.jsx("p",{className:"mt-2 font-mono whitespace-pre-wrap text-foreground",children:n})})]})})}function NN({text:e,maxLength:t,className:n}){const[r,a]=m.useState(!1),i=e.length>t,o=r||!i?e:`${e.slice(0,t)}...`;return s.jsxs("div",{children:[s.jsx(Fs,{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"})]})}const l8=["image/jpeg","image/png","image/gif","image/webp"],c8=["application/pdf","text/plain","text/markdown","text/csv"];function Xve(e){return l8.includes(e)||c8.includes(e)}function E$({value:e,onValueChange:t,className:n,hideToolSequence:r=!1}){return s.jsxs(In,{value:e,onValueChange:a=>t(a),children:[s.jsx(Tn,{className:n,children:s.jsx($n,{})}),s.jsxs(Rn,{children:[s.jsx(gt,{value:"required_tool",children:"Required Tool"}),s.jsx(gt,{value:"forbidden_tool",children:"Forbidden Tool"}),!r&&s.jsx(gt,{value:"tool_sequence",children:"Tool Sequence"}),s.jsx(gt,{value:"agent_check",children:"Judge Agent"}),s.jsx(gt,{value:"response_contains",children:"Text contains"}),s.jsx(gt,{value:"response_not_contains",children:"Text does not contain"}),s.jsx(gt,{value:"response_starts_with",children:"Text starts with"}),s.jsx(gt,{value:"response_ends_with",children:"Text ends with"}),s.jsx(gt,{value:"response_equals",children:"Text equals"}),s.jsx(gt,{value:"response_regex",children:"Text matches regex"}),s.jsx(gt,{value:"response_jsonpath",children:"JSONPath (optional equals)"}),s.jsx(gt,{value:"response_jsonpath_exists",children:"JSONPath exists"}),s.jsx(gt,{value:"response_jsonpath_not_exists",children:"JSONPath not exists"})]})]})}const Qve=()=>({id:`scn-${Date.now()}`,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]});function u8(e){return A_(e).replace(/^Tool sequence · /,"")}function CN({scenarios:e,scenarioOrigins:t,scenarioOverrides:n,agents:r,servers:a,configId:i,configPath:o,defaultAssistantAgentName:c,assistantInitialPromptByScenarioId:d,assistantAutoOpenNonceByScenarioId:f,testCaseReturnToPath:h,onChange:p,readOnly:v,allowAdd:x=!v,allowStructureEdits:j=!v}){const b=(_,A)=>{const k=e.map((E,P)=>P===_?{...E,...A}:E);p(k)},y=_=>p(e.filter((A,k)=>k!==_)),S=()=>p([...e,Qve()]),N=(_,A)=>{const k=_+A;if(k<0||k>=e.length)return;const E=[...e],[P]=E.splice(_,1);E.splice(k,0,P),p(E)};return s.jsxs("div",{className:v?"space-y-2":"space-y-4",children:[!v&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"Scenarios"}),x&&j&&s.jsxs(Z,{type:"button",variant:"outline",size:"sm",onClick:S,children:[s.jsx(yi,{className:"mr-1.5 h-3.5 w-3.5"}),"Add Scenario"]})]}),e.map((_,A)=>s.jsx(Zve,{scenario:_,scenarioOrigin:t?.[A],hasMcpServerOverride:n?.[A],index:A,total:e.length,agents:r,servers:a,configId:i,configPath:o,defaultAssistantAgentName:c,assistantInitialPrompt:d?.[_.id],assistantAutoOpenNonce:f?.[_.id],testCaseReturnToPath:h,onUpdate:k=>b(A,k),onMoveUp:()=>N(A,-1),onMoveDown:()=>N(A,1),onRemove:()=>y(A),readOnly:v,allowStructureEdits:j},_.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 Zve({scenario:e,scenarioOrigin:t,hasMcpServerOverride:n,index:r,total:a,agents:i,servers:o,configId:c,configPath:d,defaultAssistantAgentName:f,assistantInitialPrompt:h,assistantAutoOpenNonce:p,testCaseReturnToPath:v,onUpdate:x,onMoveUp:j,onMoveDown:b,onRemove:y,readOnly:S,allowStructureEdits:N}){const{source:_}=On(),[A,k]=m.useState("required_tool"),[E,P]=m.useState(""),[R,M]=m.useState(""),[D,U]=m.useState(""),[F,G]=m.useState(""),[H,L]=m.useState(""),[I,Y]=m.useState(""),[W,O]=m.useState([]),[Q,q]=m.useState(!1),[z,K]=m.useState(null),[J,ne]=m.useState(null),[he,ie]=m.useState(!1),[me,se]=m.useState(null),[ge,Oe]=m.useState(""),[fe,xe]=m.useState(null),[we,ot]=m.useState(!1),[lt,ut]=m.useState(null),[At,Xe]=m.useState(""),[Se,Ae]=m.useState(""),[Je,dt]=m.useState(!1),[Pt,Xt]=m.useState(f||i[0]?.id||""),[kt,nn]=m.useState(!1),[Jt,zt]=m.useState(null),[_e,Qe]=m.useState(""),Ze=m.useRef(null);function _t(le){if(!le)return;const it=Array.from(le),Wt=new Array(it.length).fill(null);let Dt=0,qt=0;const dn=()=>{const lr=Wt.filter(os=>os!==null);lr.length>0?(x({attachments:[...e.attachments??[],...lr]}),qt>0&&Me({title:`${qt} file${qt>1?"s":""} skipped`,description:"Unsupported file type. Images must be JPEG/PNG/GIF/WebP; documents must be PDF, TXT, MD, or CSV.",variant:"destructive"})):it.length>0&&Me({title:"Could not attach files",description:qt>0?"Unsupported file type. Images must be JPEG/PNG/GIF/WebP; documents must be PDF, TXT, MD, or CSV.":"Files could not be read.",variant:"destructive"})};it.forEach((lr,os)=>{const gr=new FileReader;gr.onload=()=>{const Ro=gr.result,vr=Ro.indexOf(","),Wl=vr>=0?Ro.slice(vr+1):"";if(Wl){const ae=Ro.slice(0,vr).replace("data:","").replace(";base64",""),Pe=ae.startsWith("image/");Xve(ae)?Wt[os]={type:Pe?"image":"document",media_type:ae,data:Wl,name:lr.name}:qt++}++Dt===it.length&&dn()},gr.onerror=()=>{++Dt===it.length&&dn()},gr.readAsDataURL(lr)})}function Bt(le){x({attachments:(e.attachments??[]).filter((it,Wt)=>Wt!==le)})}const[ue,Ke]=m.useState(null),[De,re]=m.useState(!S),Ne=le=>{const it=le.target;it&&(it.closest("button, a, input, select, textarea, [role='button']")||re(Wt=>!Wt))},Ue=le=>le?e.evalRules.findIndex(it=>it===le):-1,B=()=>{if(A==="response_jsonpath"||A==="response_jsonpath_exists"||A==="response_jsonpath_not_exists"){const Dt=R.trim();if(!Dt)return;if(A==="response_jsonpath"){const qt=D.trim();let dn;qt.length>0&&(qt==="true"?dn=!0:qt==="false"?dn=!1:Number.isNaN(Number(qt))?dn=qt:dn=Number(qt)),x({evalRules:[...e.evalRules,{type:A,path:Dt,...dn!==void 0?{equals:dn}:{}}]})}else x({evalRules:[...e.evalRules,{type:A,path:Dt}]});M(""),U("");return}if(A==="agent_check"){const Dt=F.trim(),qt=H.trim();if(!Dt||!qt)return;const dn=[...e.evalRules],lr={type:"agent_check",label:Dt,prompt:qt},os=Ue(J);os>=0?dn[os]=lr:dn.push(lr),x({evalRules:dn}),G(""),L(""),ne(null),ie(!1),k("required_tool");return}if(A==="tool_sequence"){const Dt=W.map(qt=>qt.trim()).filter(qt=>typeof qt=="string"&&qt.length>0);if(Dt.length===0)return;ve(Dt);return}if(!E.trim())return;const le=[...e.evalRules],it={type:A,value:E.trim()},Wt=Ue(me);Wt>=0?le[Wt]=it:le.push(it),x({evalRules:le}),P(""),Oe(""),se(null),k("required_tool")},oe=()=>{const le=I.trim();le&&(O(it=>[...it,le]),Y(""))},de=(le,it)=>{const Wt=le+it;O(Dt=>{if(Wt<0||Wt>=Dt.length)return Dt;const qt=[...Dt],[dn]=qt.splice(le,1);return qt.splice(Wt,0,dn),qt})},Le=le=>{O(it=>it.filter((Wt,Dt)=>Dt!==le))},$e=e.evalRules.findIndex(le=>le.type==="tool_sequence"),Ge=$e>=0?e.evalRules[$e]:void 0,Ie=Ge?.type==="tool_sequence"?Ge.sequence??[]:[],V=$e>=0,ve=le=>{const it=[...e.evalRules],Wt=le.length>0?{type:"tool_sequence",sequence:le}:null,Dt=Ue(z),qt=Dt>=0?Dt:$e;qt>=0?Wt?it[qt]=Wt:it.splice(qt,1):Wt&&it.push(Wt),x({evalRules:it}),q(!1),O([]),Y(""),K(null),A==="tool_sequence"&&k("required_tool")};m.useEffect(()=>{Q&&O(Ie)},[Q,$e,Ie.join("|")]),m.useEffect(()=>{q(A==="tool_sequence")},[A]),m.useEffect(()=>{ie(A==="agent_check")},[A]),m.useEffect(()=>{z&&Ue(z)<0&&K(null),J&&Ue(J)<0&&ne(null),me&&Ue(me)<0&&se(null)},[e.evalRules,z,J,me]),m.useEffect(()=>{z&&A!=="tool_sequence"&&K(null),J&&A!=="agent_check"&&ne(null),me&&me.type!==A&&se(null)},[A,z,J,me]);const Ee=le=>{const it=e.evalRules.filter((Dt,qt)=>qt!==le),Wt=it.some(Dt=>Dt.type==="agent_check");x({evalRules:it,agentContext:Wt?e.agentContext:void 0})},tt=["response_contains","response_not_contains","response_starts_with","response_ends_with","response_equals","response_regex"],te=()=>{!At.trim()||!Se.trim()||(x({extractRules:[...e.extractRules,{name:At.trim(),pattern:Se.trim()}]}),Xe(""),Ae(""))},Fe=le=>{x({extractRules:e.extractRules.filter((it,Wt)=>Wt!==le)})},mt=le=>{const it=e.serverIds.includes(le)?e.serverIds.filter(Wt=>Wt!==le):[...e.serverIds,le];x({serverIds:it})},Qt={required_tool:"Required",forbidden_tool:"Forbidden",tool_sequence:"Sequence",response_contains:"Contains",response_not_contains:"Not Contains",response_starts_with:"Starts With",response_ends_with:"Ends With",response_equals:"Equals",response_regex:"Regex",response_jsonpath:"JSONPath",response_jsonpath_exists:"JSONPath Exists",response_jsonpath_not_exists:"JSONPath Not Exists",agent_check:"Agent"},ke={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",tool_sequence:"border-teal-300/60 bg-teal-500/10 text-teal-700",response_contains:"border-violet-300/60 bg-violet-500/10 text-violet-700",response_not_contains:"border-amber-300/60 bg-amber-500/10 text-amber-700",response_starts_with:"border-cyan-300/60 bg-cyan-500/10 text-cyan-700",response_ends_with:"border-indigo-300/60 bg-indigo-500/10 text-indigo-700",response_equals:"border-lime-300/60 bg-lime-500/10 text-lime-700",response_regex:"border-fuchsia-300/60 bg-fuchsia-500/10 text-fuchsia-700",response_jsonpath:"border-emerald-300/60 bg-emerald-500/10 text-emerald-700",response_jsonpath_exists:"border-green-300/60 bg-green-500/10 text-green-700",response_jsonpath_not_exists:"border-orange-300/60 bg-orange-500/10 text-orange-700",agent_check:"border-teal-300/60 bg-teal-500/10 text-teal-700"},en=A==="required_tool"||A==="forbidden_tool",Ct=A==="response_jsonpath"||A==="response_jsonpath_exists"||A==="response_jsonpath_not_exists",Kt=A==="tool_sequence"&&Q,Hn=A==="agent_check"&&he,_n=e.serverIds.filter(le=>o.some(it=>it.id===le)),Xa=i.map(le=>le.id).filter(Boolean),Qa=_n.length>0,[$i,To]=m.useState(""),[Di,Ul]=m.useState(0);m.useEffect(()=>{const le=(h??"").trim();le&&$i!==le&&(dt(!0),To(le))},[h,$i]),m.useEffect(()=>{p&&p!==Di&&(dt(!0),Ul(p))},[p,Di]),m.useEffect(()=>{xe(null),ut(null),Oe("")},[e.serverIds.join("|")]),m.useEffect(()=>{Oe(""),M(""),U(""),Y("")},[A]),m.useEffect(()=>{Pt&&Xa.includes(Pt)||Xt(f||i[0]?.id||"")},[Pt,f,i,Xa]);const qn=async()=>{if(Pt){nn(!0),zt(null);try{const le=e.serverIds.filter(Wt=>o.find(qt=>qt.id===Wt)?.authType==="oauth2");await vi({serverNames:le,source:_});const it=await _.runScenarioPreview({selectedAgentName:Pt,scenario:{id:e.id,name:e.name,prompt:e.prompt,serverNames:e.serverIds,attachments:e.attachments??[],evalRules:e.evalRules,extractRules:e.extractRules}});Ke(it)}catch(le){zt(le instanceof Error?le.message:String(le))}finally{nn(!1)}}},Fu=()=>{if(!ue)return;const le=P$(e.evalRules,ue.run.failureReasons,ue.run.checkResults),it=le.length?le.map(dn=>`${dn.status.toUpperCase()} - ${Jve(dn.rule)}${dn.failureReason?` (${dn.failureReason})`:""}`).join(`
|
|
128
|
+
`):"No checks configured.",Wt=Object.keys(ue.run.extractedValues).length>0?Object.entries(ue.run.extractedValues).map(([dn,lr])=>`${dn}: ${String(lr)}`).join(`
|
|
129
|
+
`):"No extracted values.",Dt=ue.run.toolCalls.length>0?ue.run.toolCalls.map((dn,lr)=>`${lr+1}. ${dn.name} (${dn.duration}ms)`).join(`
|
|
130
|
+
`):"No tool calls.",qt=[`I ran a prompt preview for scenario '${e.id}' and want you to suggest concrete updates.`,`Run ID: ${ue.runId}`,`Agent: ${ue.agentName}`,`Outcome: ${ue.run.passed?"passed":"failed"}`,`Duration: ${ue.run.duration}ms`,"","Current check outcomes:",it,"","Tool sequence:",Dt,"","Extracted values:",Wt,"","Final answer:",ue.run.finalAnswer||"(empty)","","If the run has a meaningful ordered tool path, suggest a tool_sequence check using the raw tool names in the tool sequence order, even if other tools appear between them.","Use agent_check only for semantic or fuzzy validation;","Please propose concrete updates to the Prompt, Checks, and/or Value Capture Rules based on this preview."].join(`
|
|
131
|
+
`);Qe(qt),dt(!0)},Aa=async()=>{if(!(!Qa||S)){ot(!0),ut(null);try{const le=_n.filter(Wt=>o.find(qt=>qt.id===Wt)?.authType==="oauth2");await vi({serverNames:le,source:_});const it=new Set;for(const Wt of _n){const Dt=await _.discoverToolsForAnalysis({serverNames:[Wt]});for(const qt of Dt.servers)for(const dn of qt.tools)it.add(dn.name)}xe(Array.from(it).sort((Wt,Dt)=>Wt.localeCompare(Dt)))}catch(le){ut(le instanceof Error?le.message:"Failed to load tools")}finally{ot(!1)}}};return s.jsx(da,{open:De,onOpenChange:re,children:s.jsxs(nt,{className:S?"rounded-md border shadow-none":"border-dashed",children:[s.jsxs(Lt,{className:`${S?"px-3 py-3":"pb-3"} flex-row items-center justify-between space-y-0 cursor-pointer`,onClick:Ne,children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[!S&&s.jsx(Ms,{asChild:!0,children:s.jsx(Z,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",children:s.jsx(tn,{className:`h-3.5 w-3.5 transition-transform ${De?"rotate-0":"-rotate-90"}`})})}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[r+1,"."]}),s.jsx(Ft,{className:"truncate text-sm font-medium",children:e.name||`Scenario ${r+1}`}),S&&t==="referenced"&&s.jsx(Z,{type:"button",size:"sm",variant:"outline",className:"h-6 px-2 text-xs",asChild:!0,children:s.jsx(Tt,{to:`/libraries/test-cases/${encodeURIComponent(e.id)}${v?`?returnTo=${encodeURIComponent(v)}`:""}`,children:"Edit test"})})]}),S?s.jsxs("div",{className:"flex items-center gap-2",children:[t&&s.jsx(st,{variant:t==="inline"?"secondary":"outline",children:t==="referenced"?"Referenced":"Inline"}),n&&s.jsx(st,{variant:"secondary",children:"Override"}),s.jsx(Ms,{asChild:!0,children:s.jsx(Z,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8","aria-label":De?"Collapse scenario details":"Expand scenario details",children:s.jsx(tn,{className:`h-4 w-4 transition-transform ${De?"rotate-180":""}`})})})]}):N&&s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsxs(Z,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>dt(!0),title:i.length===0?"Add at least one agent in the config":e.serverIds.length===0?"Select at least one server for this scenario":"Open Scenario Assistant",children:[s.jsx(Zr,{className:"h-3.5 w-3.5 text-amber-500"}),"Ask Assistant"]}),s.jsx(Z,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:j,disabled:r===0,"aria-label":"Move scenario up",children:s.jsx(ma,{className:"h-3.5 w-3.5"})}),s.jsx(Z,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:b,disabled:r===a-1,"aria-label":"Move scenario down",children:s.jsx(tn,{className:"h-3.5 w-3.5"})}),s.jsx(Z,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:y,children:s.jsx(Bs,{className:"h-3.5 w-3.5 text-destructive"})})]})]}),s.jsx(fa,{children:s.jsxs(rt,{className:"space-y-3",children:[s.jsx(Uve,{open:Je,onOpenChange:le=>{dt(le),le||Qe("")},configId:c,configPath:d,scenario:e,agents:i,servers:o,defaultAssistantAgentName:f,initialUserMessage:_e||h,onApplyPatch:le=>x({...le.prompt!==void 0?{prompt:le.prompt}:{},...le.evalRules!==void 0?{evalRules:le.evalRules}:{},...le.extractRules!==void 0?{extractRules:le.extractRules}:{}})}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Ve,{className:"text-xs",children:"Name"}),s.jsx(Et,{value:e.name,onChange:le=>x({name:le.target.value}),disabled:S,placeholder:"e.g. List directory"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Ve,{className:"text-xs",children:"Servers"}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[o.map(le=>s.jsx(st,{variant:e.serverIds.includes(le.id)?"default":"outline",className:`cursor-pointer text-xs ${e.serverIds.includes(le.id)?"":"opacity-50"}`,onClick:()=>!S&&mt(le.id),children:le.name||le.id},le.id)),o.length===0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:"Add servers above first"})]})]}),s.jsxs(nt,{className:"border bg-card",children:[s.jsxs(Lt,{className:"pb-2",children:[s.jsx(Ft,{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.jsxs(rt,{className:"space-y-3 pt-0",children:[s.jsx(wa,{value:e.prompt,onChange:le=>x({prompt:le.target.value}),disabled:S,placeholder:"The prompt to send to the agent...",rows:4,className:"text-xs"}),s.jsxs("div",{children:[s.jsx("input",{ref:Ze,type:"file",accept:[...l8,...c8,".md"].join(","),multiple:!0,className:"hidden",onChange:le=>_t(le.target.files)}),(e.attachments?.length??0)>0?s.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.attachments?.map((le,it)=>s.jsxs("div",{className:"group relative",title:`${le.name??`attachment ${it+1}`}`,children:[s.jsx("div",{className:"flex h-16 w-16 items-center justify-center overflow-hidden rounded border bg-muted",children:le.type==="image"?s.jsx("img",{src:`data:${le.media_type};base64,${le.data}`,alt:le.name??`attachment ${it+1}`,className:"h-full w-full object-cover"}):s.jsx(SS,{className:"h-6 w-6 text-muted-foreground"})}),le.name&&s.jsx("p",{className:"mt-0.5 max-w-[64px] truncate text-center text-xs text-muted-foreground",children:le.name}),!S&&s.jsx("button",{type:"button",onClick:()=>Bt(it),className:"absolute -right-1 -top-1 hidden h-4 w-4 items-center justify-center rounded-full bg-destructive text-destructive-foreground group-hover:flex","aria-label":"Remove attachment",children:s.jsx(ns,{className:"h-2.5 w-2.5"})})]},it)),!S&&s.jsx("button",{type:"button",onClick:()=>Ze.current?.click(),className:"flex h-16 w-16 items-center justify-center self-start rounded border border-dashed text-muted-foreground hover:border-foreground hover:text-foreground","aria-label":"Attach file",title:"Attach file (image or document)",children:s.jsx(CE,{className:"h-4 w-4"})})]}):!S&&s.jsxs("button",{type:"button",onClick:()=>Ze.current?.click(),className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground",children:[s.jsx(CE,{className:"h-3.5 w-3.5"}),"Attach file"]})]})]})]}),!S&&s.jsxs(nt,{className:"border bg-muted/20",children:[s.jsxs(Lt,{className:"pb-2",children:[s.jsx(Ft,{className:"text-sm",children:"Run Prompt Preview"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Execute the current draft prompt once and inspect final answer, conversation trace, tool calls, and check outcomes."})]}),s.jsxs(rt,{className:"space-y-3",children:[s.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{className:"text-xs",children:"Agent"}),s.jsxs(In,{value:Pt,onValueChange:Xt,children:[s.jsx(Tn,{className:"h-8 text-xs",children:s.jsx($n,{placeholder:"Select agent"})}),s.jsx(Rn,{children:i.map(le=>s.jsx(gt,{value:le.id,children:le.name||le.id},le.id))})]})]}),s.jsx("div",{className:"flex items-end",children:s.jsx(Z,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5 px-2 text-xs",onClick:()=>{qn()},disabled:kt||!Pt||!e.prompt.trim()||e.serverIds.length===0,children:kt?s.jsxs(s.Fragment,{children:[s.jsx(jr,{className:"h-3.5 w-3.5 animate-spin"}),"Running..."]}):s.jsxs(s.Fragment,{children:[s.jsx(va,{className:"h-3.5 w-3.5"}),"Run Prompt"]})})})]}),!e.prompt.trim()&&s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Add a prompt to run preview."}),e.serverIds.length===0&&s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Select at least one server to run preview."}),Jt&&s.jsx("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:Jt}),ue&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[s.jsx(st,{variant:ue.run.passed?"default":"destructive",children:ue.run.passed?"Passed":"Failed"}),s.jsxs(st,{variant:"outline",children:[ue.run.duration,"ms"]}),s.jsxs(st,{variant:"outline",children:[ue.run.toolCalls.length," tool calls"]}),s.jsx(st,{variant:"outline",className:"font-mono",children:ue.agentName}),s.jsxs(Z,{type:"button",variant:"outline",size:"sm",className:"ml-auto h-6 gap-1.5 px-2 text-[11px]",onClick:Fu,children:[s.jsx(Zr,{className:"h-3.5 w-3.5 text-amber-500"}),"Send to Assistant"]})]}),e.evalRules.length===0?s.jsxs("div",{className:"rounded-md border bg-muted/20 p-2",children:[s.jsx("p",{className:"mb-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Check results"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"No checks configured for this scenario."})]}):(()=>{const le=P$(e.evalRules,ue.run.failureReasons,ue.run.checkResults),it=le.filter(Dt=>Dt.status==="passed"),Wt=le.filter(Dt=>Dt.status==="failed");return s.jsxs("div",{className:"rounded-md border bg-muted/20 p-2",children:[s.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[s.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Checks"}),s.jsxs(st,{variant:"outline",className:"h-5 border-success/30 bg-success/10 text-success text-[10px]",children:[it.length," passed"]}),s.jsxs(st,{variant:"outline",className:`h-5 text-[10px] ${Wt.length>0?"border-destructive/30 bg-destructive/10 text-destructive":""}`,children:[Wt.length," failed"]})]}),s.jsx("div",{className:"space-y-1",children:le.map((Dt,qt)=>s.jsxs("div",{className:`flex items-start justify-between gap-2 rounded-md border px-2 py-1.5 text-xs ${Dt.status==="failed"?"border-destructive/20 bg-destructive/5":"border-success/20 bg-success/5"}`,children:[s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[Dt.status==="failed"?s.jsx(tl,{className:"h-3.5 w-3.5 shrink-0 text-destructive"}):s.jsx(ga,{className:"h-3.5 w-3.5 shrink-0 text-success"}),s.jsx("span",{className:"font-medium",children:exe(Dt.rule)})]}),Dt.failureReason&&s.jsx("p",{className:"mt-1 pl-5 text-[11px] text-muted-foreground",children:txe(Dt.failureReason)})]}),s.jsx(st,{variant:"outline",className:`shrink-0 text-[10px] ${Dt.status==="failed"?"border-destructive/30 text-destructive":"border-success/30 text-success"}`,children:Dt.status})]},`${e.id}-preview-check-${qt}`))})]})})(),ue.run.failureReasons.length>0&&s.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2",children:[s.jsx("p",{className:"mb-1 text-[11px] font-semibold uppercase tracking-wide text-destructive",children:"Check failures"}),s.jsx("ul",{className:"list-disc space-y-1 pl-4 text-xs text-destructive",children:ue.run.failureReasons.map((le,it)=>s.jsx("li",{children:le},`${ue.runId}-failure-${it}`))})]}),Object.keys(ue.run.extractedValues).length>0&&s.jsxs("div",{className:"rounded-md border bg-background p-2",children:[s.jsx("p",{className:"mb-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Extracted values"}),s.jsx("div",{className:"grid gap-1.5 sm:grid-cols-2",children:Object.entries(ue.run.extractedValues).map(([le,it])=>s.jsxs("div",{className:"rounded border bg-muted/20 px-2 py-1 text-xs",children:[s.jsx("div",{className:"font-mono text-[11px] text-muted-foreground",children:le}),s.jsx("div",{className:"break-all",children:String(it)})]},le))})]}),s.jsx(Gve,{run:ue.run,fallbackUserPrompt:e.prompt})]})]})]}),s.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[s.jsxs(nt,{className:"border bg-muted/20",children:[s.jsx(Lt,{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(Ft,{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."})]}),!S&&s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs(Z,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>dt(!0),title:"Ask for help improving checks",children:[s.jsx(Zr,{className:"h-3.5 w-3.5 text-amber-500"}),"Ask Assistant"]})})]})}),s.jsx(rt,{className:"space-y-2",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{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((le,it)=>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 ${ke[le.type]}`,children:Qt[le.type]}),le.type==="agent_check"?s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"font-medium leading-tight",children:le.label||"Unnamed check"}),le.prompt&&s.jsx("div",{className:"mt-0.5 break-words text-[11px] leading-snug text-muted-foreground",children:le.prompt})]}):le.type==="tool_sequence"?s.jsx("span",{className:"font-mono break-all",children:u8(le.sequence??[])}):s.jsx("span",{className:"font-mono break-all",children:le.path?le.equals!==void 0?`${le.path} == ${String(le.equals)}`:le.path:le.value})]})}),!S&&s.jsxs("div",{className:"flex items-center gap-1",children:[(le.type==="tool_sequence"||le.type==="agent_check"||tt.includes(le.type))&&s.jsx(Z,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 text-[11px]",onClick:()=>{if(le.type==="tool_sequence"){k("tool_sequence"),O(le.sequence??[]),K(le),q(!0);return}if(le.type==="agent_check"){k("agent_check"),ne(le),G(le.label??""),L(le.prompt??""),ie(!0);return}k(le.type),se(le),P(le.value??"")},"aria-label":`Edit check ${it+1}`,children:s.jsx(L9,{className:"h-3.5 w-3.5"})}),s.jsx(Z,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>Ee(it),"aria-label":`Remove check ${it+1}`,children:s.jsx(ns,{className:"h-3.5 w-3.5"})})]})]},it))}),!S&&s.jsxs("div",{className:"space-y-2",children:[Hn?s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsx(E$,{value:A,onValueChange:k,className:"h-8 w-[14.5rem] shrink-0 text-xs"}),s.jsx(Et,{value:F,onChange:le=>G(le.target.value),placeholder:"Prompt name",className:"h-8 text-xs"}),s.jsx(Z,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:B,children:J!==null?"Update check":"Add check"})]}),s.jsx(wa,{value:H,onChange:le=>L(le.target.value),placeholder:"Judge prompt. Example: Confirm the answer includes a valid earliest and latest timestamp range, and that neither is 'Not available'.",className:"min-h-[64px] text-xs"})]}):s.jsxs("div",{className:"flex gap-2 items-end",children:[s.jsx(E$,{value:A,onValueChange:k,className:"h-8 w-[14.5rem] shrink-0 text-xs",hideToolSequence:V&&A!=="tool_sequence"}),Ct?s.jsxs(s.Fragment,{children:[s.jsx(Et,{value:R,onChange:le=>M(le.target.value),placeholder:"JSONPath (e.g. $.status)",className:"h-8 text-xs font-mono",onKeyDown:le=>le.key==="Enter"&&(le.preventDefault(),B())}),A==="response_jsonpath"&&s.jsx(Et,{value:D,onChange:le=>U(le.target.value),placeholder:"Equals (optional)",className:"h-8 w-[12rem] text-xs font-mono",onKeyDown:le=>le.key==="Enter"&&(le.preventDefault(),B())})]}):Kt?s.jsxs("div",{className:"min-w-0 flex-1 flex items-end gap-2",children:[s.jsx(Et,{value:I,onChange:le=>Y(le.target.value),placeholder:"Tool name",className:"h-8 text-xs font-mono",onKeyDown:le=>le.key==="Enter"&&(le.preventDefault(),oe())}),s.jsx(Z,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:oe,children:"Add step"})]}):s.jsx(Et,{value:E,onChange:le=>P(le.target.value),placeholder:"Value",className:"h-8 text-xs font-mono",onKeyDown:le=>le.key==="Enter"&&(le.preventDefault(),B())}),s.jsx(Z,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:B,children:me!==null?"Update check":"Add"})]}),Kt&&s.jsxs("div",{className:"space-y-2 rounded-md border bg-background px-2 py-2",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(Ve,{className:"text-xs",children:"Sequence steps"}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Require these tools in order. Other tools may appear between them."})]}),!S&&W.length>0&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Z,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2 text-[11px]",onClick:()=>O([]),children:"Clear"}),s.jsx(Z,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-[11px]",onClick:()=>ve(W),children:V?"Update sequence":"Add sequence"})]})]}),W.length===0?s.jsx("p",{className:"rounded-md border border-dashed bg-muted/20 px-2 py-2 text-xs text-muted-foreground",children:"No ordered tool sequence yet."}):s.jsx("div",{className:"space-y-1.5",children:W.map((le,it)=>s.jsxs("div",{className:"flex items-center gap-2 rounded-md border bg-muted/10 px-2 py-1.5",children:[s.jsxs("span",{className:"text-xs font-medium",children:[it+1,"."]}),s.jsx("span",{className:"min-w-0 flex-1 font-mono text-xs break-all",children:le}),!S&&s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Z,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>de(it,-1),disabled:it===0,"aria-label":`Move tool ${it+1} up`,children:s.jsx(ma,{className:"h-3.5 w-3.5"})}),s.jsx(Z,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>de(it,1),disabled:it===W.length-1,"aria-label":`Move tool ${it+1} down`,children:s.jsx(tn,{className:"h-3.5 w-3.5"})}),s.jsx(Z,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>Le(it),"aria-label":`Remove tool ${it+1}`,children:s.jsx(ns,{className:"h-3.5 w-3.5"})})]})]},`${e.id}-tool-sequence-draft-${it}`))})]}),en&&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(Ve,{className:"mb-1 block text-[11px] text-muted-foreground",children:"Pick from selected server tools (optional)"}),s.jsxs(In,{value:ge,onValueChange:le=>{Oe(le),P(le)},disabled:we||!fe||fe.length===0,children:[s.jsx(Tn,{className:"h-8 text-xs",children:s.jsx($n,{placeholder:we?"Loading tools...":fe&&fe.length>0?"Select tool to insert in value field":"Load tools first"})}),s.jsx(Rn,{children:(fe??[]).map(le=>s.jsx(gt,{value:le,children:le},le))})]})]}),s.jsx(Z,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:Aa,disabled:!Qa||we,children:we?"Loading...":fe?"Refresh tools":"Load tools"})]}),!Qa&&s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Select at least one server in this scenario to load tool names."}),lt&&s.jsxs("p",{className:"text-[11px] text-destructive",children:["Could not load tools: ",lt]})]})]})]})})]}),s.jsxs(nt,{className:"border bg-muted/10",children:[s.jsx(Lt,{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(Ft,{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 and comparisons."})]}),!S&&s.jsxs(Z,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>dt(!0),title:"Ask for help improving value capture rules",children:[s.jsx(Zr,{className:"h-3.5 w-3.5 text-amber-500"}),"Ask Assistant"]})]})}),s.jsx(rt,{className:"space-y-2",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{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((le,it)=>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:le.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:le.pattern})]})}),!S&&s.jsx(Z,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>Fe(it),"aria-label":`Remove value capture rule ${it+1}`,children:s.jsx(ns,{className:"h-3.5 w-3.5"})})]},it))}),!S&&s.jsxs("div",{className:"flex gap-2 items-end",children:[s.jsx(Et,{value:At,onChange:le=>Xe(le.target.value),placeholder:"Field name",className:"h-8 text-xs w-36"}),s.jsx(Et,{value:Se,onChange:le=>Ae(le.target.value),placeholder:"Regex pattern",className:"h-8 text-xs font-mono",onKeyDown:le=>le.key==="Enter"&&(le.preventDefault(),te())}),s.jsx(Z,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:te,children:"Add"})]})]})})]})]}),e.evalRules.some(le=>le.type==="agent_check")&&s.jsxs(nt,{className:"border bg-muted/10",children:[s.jsx(Lt,{className:"pb-2",children:s.jsxs("div",{className:"min-w-0",children:[s.jsx(Ft,{className:"text-sm",children:"Judge context"}),s.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Extra context is shared across all judge checks in this scenario and sent once in the batched judge request."})]})}),s.jsxs(rt,{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(wr,{id:`judge-ctx-prompt-${e.id}`,checked:e.agentContext?.include_prompt??!1,disabled:S,className:"mt-0.5",onCheckedChange:le=>{x({agentContext:{...e.agentContext,include_prompt:le===!0}})}}),s.jsxs("div",{children:[s.jsx(Ve,{htmlFor:`judge-ctx-prompt-${e.id}`,className:"cursor-pointer text-xs font-medium",children:"Include prompt"}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Sends the scenario prompt so the judge can verify the answer addresses the original question."})]})]}),s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(wr,{id:`judge-ctx-tools-${e.id}`,checked:e.agentContext?.include_tool_sequence??!1,disabled:S,className:"mt-0.5",onCheckedChange:le=>{x({agentContext:{...e.agentContext,include_tool_sequence:le===!0}})}}),s.jsxs("div",{children:[s.jsx(Ve,{htmlFor:`judge-ctx-tools-${e.id}`,className:"cursor-pointer text-xs font-medium",children:"Include tool sequence"}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Sends the list of called tool names so the judge can reason about which tools were used."})]})]})]})]})]})})]})})}function P$(e,t,n){return i8({evalRules:e,failureReasons:t,checkResults:n})}function Jve(e){return e.type==="agent_check"?`${e.type}: ${e.label??""} — ${e.prompt??""}`:e.type==="tool_sequence"?`${e.type}: ${u8(e.sequence??[])}`:e.path?e.equals!==void 0?`${e.type}: ${e.path} == ${String(e.equals)}`:`${e.type}: ${e.path}`:`${e.type}: ${e.value??""}`}const exe=qv;function txe(e){const t=String(e??"").trim(),n=t.match(/^Regex assertion failed:\s*(.+)$/i);return n?`Text match failed: ${n[1]}`:t}function d8(e){const t=e.name?.trim()||e.id||"Server",n=e.authValue?.trim()||"",r=e.oauthTokenUrl?.trim()||"";return e.authType==="bearer"&&n.length===0?`${t}: bearer token is required.`:e.authType==="api-key"&&r.length===0&&n.length===0?`${t}: API key value is required.`:null}const nxe=()=>({id:`cfg-${Date.now()}`,name:"",configName:"",description:"",servers:[],serverEntries:[],agents:[],agentEntries:[],scenarios:[],scenarioEntries:[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),T$=()=>{const{id:e,tab:t}=Ml(),n=Sa(),r=Xs(),[a,i]=Pi(),{getConfig:o,addConfig:c,updateConfig:d,loading:f}=Yf(),{source:h}=On(),{servers:p,agents:v,scenarios:x}=Ca(),j=e==="new",b=!j&&!!e,y=b?o(e):void 0,[S,N]=m.useState(j||t==="edit"),[_,A]=m.useState(()=>y?structuredClone(y):nxe()),[k,E]=m.useState(""),[P,R]=m.useState(""),[M,D]=m.useState({}),[U,F]=m.useState({}),[G,H]=m.useState({}),L=m.useMemo(()=>{const V=t||a.get("tab");return V==="agents"||V==="scenarios"?V:"scenarios"},[t,a]),I=`${n.pathname}${n.search}`;m.useEffect(()=>{y&&!S&&A(structuredClone(y))},[y,S]),m.useEffect(()=>{t==="edit"&&!j&&N(!0)},[t,j]);const Y=V=>A(ve=>({...ve,...V})),W=m.useMemo(()=>_.serverEntries&&_.serverEntries.length>0?_.serverEntries:(_.servers??[]).map(V=>({kind:"inline",server:V})),[_.serverEntries,_.servers]),O=m.useMemo(()=>_.scenarioEntries&&_.scenarioEntries.length>0?_.scenarioEntries:_.scenarios.map(V=>({kind:"inline",scenario:V})),[_.scenarioEntries,_.scenarios]),Q=V=>{Y({scenarioEntries:V,scenarios:V.filter(ve=>ve.kind==="inline").map(ve=>ve.scenario)})},q=m.useMemo(()=>_.agentEntries&&_.agentEntries.length>0?_.agentEntries:_.agents.map(V=>({kind:"inline",agent:V})),[_.agentEntries,_.agents]),z=V=>{Y({agentEntries:V,agents:V.filter(ve=>ve.kind==="inline").map(ve=>ve.agent)})},K=!S,J=_.runDefaults?.selectedAgentNames??[],ne=async()=>{if(!_.name.trim()){Me({title:"Validation Error",description:"Config ID is required.",variant:"destructive"});return}const V=W.map(ke=>ke.kind==="referenced"?{kind:"referenced",ref:p.find(Ct=>Ct.id===ke.ref)?.id||ke.ref}:ke),ve=q.map(ke=>ke.kind==="referenced"?{kind:"referenced",ref:v.find(Ct=>Ct.id===ke.ref)?.id||ke.ref}:ke),Ee=O.map(ke=>{if(ke.kind==="referenced"){const en=x.find(Kt=>Kt.id===ke.ref),Ct=(ke.mcpServers??[]).map(Kt=>Kt.kind==="referenced"?{kind:"referenced",ref:p.find(_n=>_n.id===Kt.ref)?.id||Kt.ref}:Kt);return{kind:"referenced",ref:en?.id||ke.ref,...ke.mcpServers!==void 0?{mcpServers:Ct}:{}}}return ke}),tt=V.filter(ke=>ke.kind==="inline").map(ke=>({server:ke.server,error:d8(ke.server)})).find(ke=>!!ke.error);if(tt?.error){Me({title:"Validation Error",description:tt.error,variant:"destructive"});return}if(Ee.filter(ke=>ke.kind==="inline").some(ke=>!ke.scenario.name?.trim())){Me({title:"Validation Error",description:"Inline scenarios must have a name before saving.",variant:"destructive"});return}const Fe=new Set(ve.map(ke=>ke.kind==="inline"?ke.agent.id:ke.ref)),mt=(_.runDefaults?.selectedAgentNames??[]).filter(ke=>Fe.has(ke)),Qt={..._,serverEntries:V,servers:V.filter(ke=>ke.kind==="inline").map(ke=>ke.server),agentEntries:ve,agents:ve.filter(ke=>ke.kind==="inline").map(ke=>ke.agent),scenarioEntries:Ee,scenarios:Ee.filter(ke=>ke.kind==="inline").map(ke=>ke.scenario),runDefaults:mt.length>0?{..._.runDefaults??{},selectedAgentNames:mt}:void 0,updatedAt:new Date().toISOString()};if(j){const ke=await c(Qt);A(ke);const en=zn(ke.configName,zn(ke.name,ke.id));Me({title:"MCP Evaluation Created",description:`"${en}" has been saved.`}),r(`/mcp-evaluations/${ke.id}`)}else{const ke=await d(_.id,Qt);A(ke);const en=zn(ke.configName,zn(ke.name,ke.id));Me({title:"MCP Evaluation Updated",description:`"${en}" has been updated.`}),N(!1),r(`/mcp-evaluations/${ke.id}`,{replace:!0})}},he=zn(_.configName,zn(_.name,_.id)),ie=j?"New MCP Evaluation":S?`Editing: ${he}`:he,me=j?"/mcp-evaluations/new":`/mcp-evaluations/${encodeURIComponent(_.id||e||"")}`,se=!!y?.loadError,ge=m.useMemo(()=>v.map(V=>({id:V.id,ref:V.id,label:zn(V.name,V.id),model:V.model})).sort((V,ve)=>V.label.localeCompare(ve.label)),[v]),Oe=(V,ve)=>{const Ee=ve?Array.from(new Set([...J,V])):J.filter(tt=>tt!==V);Y({runDefaults:{..._.runDefaults??{},selectedAgentNames:Ee}})},fe=V=>{const ve=new Set([...q.filter(Fe=>Fe.kind==="inline").map(Fe=>zn(Fe.agent.name,Fe.agent.id)),...v.map(Fe=>zn(Fe.name,Fe.id))]),Ee=`${V}-custom`;let tt=Ee,te=2;for(;ve.has(tt);)tt=`${Ee}-${te}`,te+=1;return tt},xe=()=>{const ve={id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096};z([{kind:"inline",agent:ve},...q]),D(Ee=>({...Ee,[ve.id]:!0}))},we=()=>{const V=v.find(tt=>tt.id===P);if(!V)return;const ve=V.id;new Set(q.filter(tt=>tt.kind==="referenced").map(tt=>tt.ref)).has(ve)||z([...q,{kind:"referenced",ref:ve}]),R("")},ot=()=>{const V=new Set(q.filter(Ee=>Ee.kind==="referenced").map(Ee=>Ee.ref)),ve=v.filter(Ee=>!V.has(Ee.id)).map(Ee=>({kind:"referenced",ref:Ee.id}));ve.length>0&&z([...q,...ve])},lt=()=>{const V=v.find(te=>te.id===P);if(!V)return;const ve=zn(V.name,V.id),Ee=fe(ve),tt={...structuredClone(V),id:`agt-${Date.now()}`,name:Ee};z([...q,{kind:"inline",agent:tt}]),D(te=>({...te,[tt.id]:!0})),R(""),Me({title:"Imported agent as inline",description:Ee})},ut=V=>{const ve=q[V];if(!ve)return;const Ee=ve.kind==="inline"?ve.agent.id:ve.ref,tt=J.filter(te=>te!==Ee);Y({runDefaults:{..._.runDefaults??{},selectedAgentNames:tt}}),ve.kind==="inline"&&D(te=>{const Fe={...te};return delete Fe[ve.agent.id],Fe}),z(q.filter((te,Fe)=>Fe!==V))},At=(V,ve)=>{const Ee=V+ve;if(Ee<0||Ee>=q.length)return;const tt=[...q],[te]=tt.splice(V,1);tt.splice(Ee,0,te),z(tt)},Xe=V=>{const ve=q[V];if(!ve||ve.kind!=="referenced")return;const Ee=nn(ve.ref);if(!Ee){Me({title:"Referenced agent not found",variant:"destructive"});return}const tt=zn(Ee.name,Ee.id),te=fe(tt),Fe={...structuredClone(Ee),id:`agt-${Date.now()}`,name:te},mt=[...q];if(mt[V]={kind:"inline",agent:Fe},z(mt),J.includes(ve.ref)){const Qt=J.map(ke=>ke===ve.ref?Fe.id:ke);Y({runDefaults:{..._.runDefaults??{},selectedAgentNames:Array.from(new Set(Qt))}})}D(Qt=>({...Qt,[Fe.id]:!0})),Me({title:"Referenced agent converted to inline",description:te})},Se=()=>{const V=x.find(Ee=>Ee.id===k);if(!V)return;const ve={...structuredClone(V),id:`scn-${Date.now()}`,serverIds:[...V.serverIds]};Q([...O,{kind:"inline",scenario:ve}]),H(Ee=>({...Ee,[ve.id]:!0})),E("")},Ae=()=>{const ve={id:`scn-${Date.now()}`,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};Q([{kind:"inline",scenario:ve},...O]),H(Ee=>({...Ee,[ve.id]:!0}))},Je=()=>{const V=x.find(tt=>tt.id===k);if(!V)return;const ve=V.id;new Set(O.filter(tt=>tt.kind==="referenced").map(tt=>tt.ref)).has(ve)||Q([...O,{kind:"referenced",ref:ve}]),E("")},dt=V=>{const ve=O[V];ve?.kind==="inline"&&H(Ee=>{const tt={...Ee};return delete tt[ve.scenario.id],tt}),Q(O.filter((Ee,tt)=>tt!==V))},Pt=(V,ve)=>{const Ee=V+ve;if(Ee<0||Ee>=O.length)return;const tt=[...O],[te]=tt.splice(V,1);tt.splice(Ee,0,te),Q(tt)},Xt=V=>{const ve=O[V];if(!ve||ve.kind!=="referenced")return;const Ee=Jt(ve.ref);if(!Ee){Me({title:"Referenced scenario not found",variant:"destructive"});return}const tt=new Set(O.filter(Ct=>Ct.kind==="inline").map(Ct=>Ct.scenario.name?.trim().toLowerCase()).filter(Boolean)),te=`${zn(Ee.name,Ee.id)}-custom`;let Fe=te,mt=2;for(;tt.has(Fe.toLowerCase());)Fe=`${te}-${mt}`,mt+=1;const Qt=Date.now(),ke={...structuredClone(Ee),id:`scn-${Qt}`,name:Fe,serverIds:ve.mcpServers&&ve.mcpServers.length>0?ve.mcpServers.map(Ct=>Ct.kind==="referenced"?Ct.ref:Ct.server.id):[...Ee.serverIds]},en=[...O];en[V]={kind:"inline",scenario:ke},Q(en),H(Ct=>({...Ct,[ke.id]:!0})),Me({title:"Referenced scenario converted to inline",description:Fe})},kt=V=>p.find(ve=>ve.id===V),nn=V=>v.find(ve=>ve.id===V),Jt=V=>x.find(ve=>ve.id===V),zt=W.filter(V=>V.kind==="referenced").map(V=>V.ref),_e=zt.map(kt).filter(V=>!!V),Qe=q.filter(V=>V.kind==="referenced").map(V=>V.ref),Ze=Qe.map(nn).filter(V=>!!V);q.filter(V=>V.kind==="inline");const _t=q.flatMap(V=>{if(V.kind==="referenced"){const ve=nn(V.ref);return ve?[{agent:ve,origin:"referenced",ref:V.ref}]:[]}return[{agent:V.agent,origin:"inline",ref:void 0}]}),Bt=O.filter(V=>V.kind==="referenced").map(V=>V.ref),ue=O.flatMap(V=>{if(V.kind==="referenced"){const ve=Jt(V.ref);if(!ve)return[];if(V.mcpServers===void 0)return[{scenario:ve,origin:"referenced",hasMcpServerOverride:!1}];const Ee=V.mcpServers.flatMap(tt=>tt.kind==="referenced"?[tt.ref]:[tt.server.id]);return[{scenario:{...ve,serverIds:Ee},origin:"referenced",hasMcpServerOverride:!0}]}return[{scenario:V.scenario,origin:"inline",hasMcpServerOverride:!1}]}),Ke=Array.from(new Map([...v,..._.agents,...Ze].map(V=>[V.id,V])).values()),De=Array.from(new Map([...p,..._.servers??[],..._e].map(V=>[V.id,V])).values()),re=O.filter(V=>V.kind==="referenced").flatMap(V=>(V.mcpServers??[]).filter(ve=>ve.kind==="referenced").map(ve=>ve.ref)),Ne=Array.from(new Set([...zt,...re].filter(V=>!kt(V)))),Ue=Qe.filter(V=>!nn(V)),B=Bt.filter(V=>!Jt(V));new Set(Ne);const oe=new Set(B),de=q.length,Le=O.length,$e=[...p],Ge=(V,ve)=>{const Ee=O[V];if(!Ee||Ee.kind!=="referenced")return;const tt=[...O];tt[V]={kind:"referenced",ref:Ee.ref,mcpServers:ve.map(te=>({kind:"referenced",ref:te}))},Q(tt)},Ie=V=>{const ve=O[V];if(!ve||ve.kind!=="referenced")return;const Ee=[...O];Ee[V]={kind:"referenced",ref:ve.ref},Q(Ee)};return m.useEffect(()=>{if(!P)return;v.some(ve=>ve.id===P)||R("")},[v,P]),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Z,{variant:"ghost",size:"icon",asChild:!0,className:"h-8 w-8",children:s.jsx(Tt,{to:"/mcp-evaluations",children:s.jsx(go,{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":f?"Loading configuration...":y?y.loadError?"MCP evaluation could not be fully loaded":s.jsxs(s.Fragment,{children:["Last updated ",s.jsx("span",{children:new Date(_.updatedAt).toLocaleDateString()})]}):"MCP evaluation not found"})]}),s.jsxs("div",{className:"flex gap-2 shrink-0",children:[b&&!S&&s.jsx(Z,{size:"sm",onClick:()=>{N(!0),r(`${me}/edit`)},children:"Edit"}),b&&!S&&y&&!se&&s.jsx(Z,{size:"sm",variant:"outline",asChild:!0,children:s.jsxs(Tt,{to:`/run?configId=${encodeURIComponent(y.id)}`,children:[s.jsx(va,{className:"h-3.5 w-3.5"}),"Run Evaluation"]})}),b&&!S&&se&&s.jsxs(st,{variant:"destructive",className:"py-1 px-3 text-xs",children:[s.jsx(Uh,{className:"mr-1 h-3 w-3"}),"Broken config"]}),S&&s.jsxs(s.Fragment,{children:[!j&&s.jsx(Z,{variant:"outline",size:"sm",onClick:()=>{A(structuredClone(y)),N(!1),r(me)},children:"Cancel"}),s.jsxs(Z,{size:"sm",onClick:()=>{ne()},children:[s.jsx(I9,{className:"mr-1.5 h-3.5 w-3.5"}),"Save"]})]})]})]}),se&&!S&&s.jsx(nt,{className:"border-destructive/40",children:s.jsxs(rt,{className:"pt-6 space-y-3",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(Uh,{className:"mt-0.5 h-5 w-5 text-destructive"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold",children:"This configuration is broken"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"The file is still present, but it could not be loaded because one or more references or fields are invalid."})]})]}),s.jsxs("div",{className:"rounded-md border bg-muted/20 p-3",children:[s.jsx("p",{className:"text-xs font-medium mb-1",children:"File"}),s.jsx("p",{className:"text-xs font-mono break-all",children:y?.sourcePath||y?.description})]}),s.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3",children:[s.jsx("p",{className:"text-xs font-medium mb-1 text-destructive",children:"Load Error"}),s.jsx("p",{className:"text-xs break-all text-destructive",children:y?.loadError})]}),(Ne.length>0||Ue.length>0||B.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"}),Ne.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Servers:"," ",s.jsx("span",{className:"text-destructive",children:Ne.join(", ")})]}),Ue.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Agents: ",s.jsx("span",{className:"text-destructive",children:Ue.join(", ")})]}),B.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Scenarios:"," ",s.jsx("span",{className:"text-destructive",children:B.join(", ")})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Valid items still render below. Only the missing references are marked as broken."})]})}),!se&&(_.loadWarnings?.length??0)>0&&s.jsx(nt,{className:"border-amber-500/30",children:s.jsxs(rt,{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(Uh,{className:"h-4 w-4"}),"Migration warnings"]}),_.loadWarnings?.map((V,ve)=>s.jsx("p",{className:"text-xs text-muted-foreground",children:V},`${V}-${ve}`))]})}),s.jsxs("div",{className:"flex gap-4",children:[s.jsx(st,{variant:L==="scenarios"?"default":"outline",className:"py-1 px-3 text-xs",children:s.jsxs(Tt,{to:`${me}/scenarios`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[s.jsx(SS,{className:"h-3 w-3"}),Le," scenario",Le!==1?"s":""]})}),s.jsx(st,{variant:L==="agents"?"default":"outline",className:"py-1 px-3 text-xs",children:s.jsxs(Tt,{to:`${me}/agents`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[s.jsx(Fr,{className:"h-3 w-3"}),de," agent",de!==1?"s":""]})})]}),s.jsx(nt,{children:s.jsx(rt,{className:"pt-6 space-y-3",children:s.jsxs("div",{className:`grid gap-4 ${K||!j?"sm:grid-cols-2":"sm:grid-cols-3"}`,children:[!K&&j&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Ve,{className:"text-xs",children:"Config ID"}),s.jsx(Et,{value:_.name,onChange:V=>Y({name:V.target.value}),disabled:K,placeholder:"e.g. check-weather"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Ve,{className:"text-xs",children:"Name (optional)"}),s.jsx(Et,{value:_.configName||"",onChange:V=>Y({configName:V.target.value}),disabled:K,placeholder:"e.g. Weather checks baseline"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Ve,{className:"text-xs",children:"Description"}),s.jsx(Et,{value:_.description||"",onChange:V=>Y({description:V.target.value}),disabled:K,placeholder:"Brief description..."})]})]})})}),s.jsxs(Dv,{value:L,onValueChange:V=>{if(V!=="servers"&&V!=="agents"&&V!=="scenarios")return;const ve=new URLSearchParams(a);if(ve.delete("tab"),i(ve,{replace:!0}),e&&e!=="new"){r(`/mcp-evaluations/${encodeURIComponent(e)}/${V}`,{replace:!0});return}r(`/mcp-evaluations/${e??"new"}/${V}`,{replace:!0})},className:"space-y-4",children:[s.jsxs(up,{children:[s.jsxs(za,{value:"scenarios",className:"gap-1.5",children:[s.jsx(SS,{className:"h-3.5 w-3.5"}),"Scenarios"]}),s.jsxs(za,{value:"agents",className:"gap-1.5",children:[s.jsx(Fr,{className:"h-3.5 w-3.5"}),"Agents"]})]}),s.jsxs(Lf,{value:"agents",children:[!K&&s.jsx(nt,{className:"mb-4",children:s.jsxs(rt,{className:"pt-4 space-y-3",children:[s.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",children:[s.jsxs(In,{value:P,onValueChange:R,children:[s.jsx(Tn,{className:"h-8",children:s.jsx($n,{placeholder:"Select agent from library"})}),s.jsx(Rn,{children:ge.map(V=>s.jsx(gt,{value:V.id,children:V.label},V.id))})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Z,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!P,onClick:we,children:"Add Ref"}),s.jsx(Z,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!P,onClick:lt,children:"Import Inline"}),s.jsx(Z,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:v.length===0||v.every(V=>q.some(ve=>ve.kind==="referenced"&&ve.ref===V.id)),onClick:ot,children:"Add All Refs"}),s.jsx(Z,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:xe,children:"Add agent"})]})]}),s.jsxs("div",{className:"space-y-2",children:[q.map((V,ve)=>{const Ee=V.kind==="referenced"?nn(V.ref):null,tt=V.kind==="inline"?zn(V.agent.name,V.agent.id):zn(Ee?.name,V.ref),te=V.kind==="inline"?V.agent.model:Ee?.model||"unknown",Fe=V.kind==="inline"?V.agent.id:V.ref,mt=V.kind==="referenced"&&!Ee,Qt=V.kind==="inline"?V.agent.id:V.ref,ke=J.includes(Qt),en=V.kind==="inline"&&!!M[V.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(Z,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>At(ve,-1),disabled:ve===0,"aria-label":"Move agent up",children:s.jsx(ma,{className:"h-3 w-3"})}),s.jsx(Z,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>At(ve,1),disabled:ve===q.length-1,"aria-label":"Move agent down",children:s.jsx(tn,{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:tt}),s.jsx(st,{variant:V.kind==="inline"?"secondary":"outline",children:V.kind==="inline"?"Inline":"Referenced"}),s.jsx(st,{variant:"outline",className:"font-mono text-[10px]",children:te}),ke&&s.jsx(st,{variant:"outline",className:"text-xs border-emerald-300 text-emerald-700 bg-emerald-50",children:"Default"}),mt&&s.jsx(st,{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:ke,onChange:Ct=>Oe(Qt,Ct.target.checked)}),s.jsx("span",{children:"Default"})]}),V.kind==="inline"&&s.jsx(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>D(Ct=>({...Ct,[V.agent.id]:!Ct[V.agent.id]})),children:en?"Collapse":"Expand"}),V.kind==="referenced"&&s.jsx(s.Fragment,{children:s.jsx(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>Xe(ve),disabled:mt,children:"Convert to inline"})}),s.jsx(Z,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>ut(ve),"aria-label":"Remove agent entry",children:s.jsx(Bs,{className:"h-3.5 w-3.5"})})]})]}),V.kind==="inline"&&en&&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(Ve,{className:"text-xs",children:"Name"}),s.jsx(Et,{value:V.agent.name,onChange:Ct=>{const Kt=[...q];Kt[ve]={kind:"inline",agent:{...V.agent,name:Ct.target.value}},z(Kt)},placeholder:"e.g. GPT-5 Mini custom"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Ve,{className:"text-xs",children:"Provider"}),s.jsxs(In,{value:V.agent.provider,onValueChange:Ct=>{const Kt=[...q];Kt[ve]={kind:"inline",agent:{...V.agent,provider:Ct}},z(Kt)},children:[s.jsx(Tn,{children:s.jsx($n,{})}),s.jsxs(Rn,{children:[s.jsx(gt,{value:"openai",children:"OpenAI"}),s.jsx(gt,{value:"anthropic",children:"Anthropic"}),s.jsx(gt,{value:"azure",children:"Azure OpenAI"}),s.jsx(gt,{value:"google",children:"Google"}),s.jsx(gt,{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(Ve,{className:"text-xs",children:"Model"}),s.jsx(Et,{value:V.agent.model,onChange:Ct=>{const Kt=[...q];Kt[ve]={kind:"inline",agent:{...V.agent,model:Ct.target.value}},z(Kt)},className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Ve,{className:"text-xs",children:"Max Tokens"}),s.jsx(Et,{type:"number",min:1,max:128e3,value:V.agent.maxTokens,onChange:Ct=>{const Kt=[...q];Kt[ve]={kind:"inline",agent:{...V.agent,maxTokens:parseInt(Ct.target.value)||0}},z(Kt)},className:"font-mono text-xs"})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Ve,{className:"text-xs",children:"Temperature"}),s.jsx(Et,{type:"number",min:0,max:2,step:.01,value:V.agent.temperature,onChange:Ct=>{const Kt=[...q];Kt[ve]={kind:"inline",agent:{...V.agent,temperature:Number(Ct.target.value)||0}},z(Kt)},className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Ve,{className:"text-xs",children:"System Prompt"}),s.jsx(wa,{value:V.agent.systemPrompt||"",onChange:Ct=>{const Kt=[...q];Kt[ve]={kind:"inline",agent:{...V.agent,systemPrompt:Ct.target.value}},z(Kt)},rows:3,className:"text-xs"})]})]})]},`agent-entry-${ve}-${Fe}`)}),q.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents configured yet. Add inline agents or references."})]}),Ue.length>0&&s.jsxs("p",{className:"text-xs text-destructive",children:["Missing agent refs: ",Ue.join(", ")]})]})}),K?s.jsx(nt,{children:s.jsx(rt,{className:"pt-4",children:s.jsxs("div",{className:"space-y-2",children:[_t.map((V,ve)=>{const Ee=zn(V.agent.name,V.agent.id),tt=J.includes(V.origin==="inline"?V.agent.id:V.ref||V.agent.id),te=V.ref??V.agent.id,Fe=!!U[te];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:Ee})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[tt&&s.jsx(st,{variant:"outline",className:"text-xs border-emerald-300 text-emerald-700 bg-emerald-50",children:"Default"}),s.jsx(st,{variant:V.origin==="inline"?"secondary":"outline",children:V.origin==="inline"?"Inline":"Referenced"}),s.jsx(Z,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8",onClick:()=>F(mt=>({...mt,[te]:!mt[te]})),"aria-label":Fe?"Collapse agent details":"Expand agent details",children:s.jsx(tn,{className:`h-4 w-4 transition-transform ${Fe?"rotate-180":""}`})})]})]}),Fe&&s.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 border-t pt-2",children:[s.jsx(_6,{provider:V.agent.provider}),s.jsx(st,{variant:"outline",className:"text-xs font-mono",children:V.agent.model}),s.jsxs(st,{variant:"outline",className:"text-xs font-mono",children:["max_tokens: ",V.agent.maxTokens]}),s.jsxs(st,{variant:"outline",className:"text-xs font-mono",children:["temperature: ",V.agent.temperature]})]})]},`agent-view-${ve}-${V.ref??V.agent.id}`)}),_t.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No agents configured."})]})})}):null]}),s.jsxs(Lf,{value:"scenarios",children:[!K&&s.jsx(nt,{className:"mb-4",children:s.jsxs(rt,{className:"pt-4 space-y-3",children:[s.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",children:[s.jsxs(In,{value:k,onValueChange:E,children:[s.jsx(Tn,{className:"h-8",children:s.jsx($n,{placeholder:"Select scenario from library"})}),s.jsx(Rn,{children:[...x].sort((V,ve)=>zn(V.name,V.id).localeCompare(zn(ve.name,ve.id))).map(V=>s.jsx(gt,{value:V.id,children:zn(V.name,V.id)},V.id))})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Z,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!k,onClick:Je,children:"Add Ref"}),s.jsx(Z,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!k,onClick:Se,children:"Import Inline"}),s.jsx(Z,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:Ae,children:"Add scenario"})]})]}),s.jsxs("div",{className:"space-y-2",children:[O.map((V,ve)=>{const Ee=V.kind==="referenced"?Jt(V.ref):null,tt=V.kind==="inline"?zn(V.scenario.name,V.scenario.id):zn(Ee?.name,V.ref),te=V.kind==="inline"&&zn(V.scenario.name).length===0,Fe=V.kind==="referenced"&&oe.has(V.ref),mt=V.kind==="referenced"&&Array.isArray(V.mcpServers),Qt=V.kind==="inline"&&!!G[V.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(Z,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>Pt(ve,-1),disabled:ve===0,"aria-label":"Move scenario up",children:s.jsx(ma,{className:"h-3 w-3"})}),s.jsx(Z,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>Pt(ve,1),disabled:ve===O.length-1,"aria-label":"Move scenario down",children:s.jsx(tn,{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:tt}),s.jsx(st,{variant:V.kind==="inline"?"secondary":"outline",children:V.kind==="inline"?"Inline":"Referenced"}),mt&&s.jsx(st,{variant:"secondary",children:"Override"}),te&&s.jsx(st,{variant:"destructive",children:"Name required"}),Fe&&s.jsx(st,{variant:"destructive",children:"Missing"})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[V.kind==="inline"&&s.jsx(Z,{type:"button",size:"icon",variant:"outline",className:"h-7 w-7",onClick:()=>H(ke=>({...ke,[V.scenario.id]:!ke[V.scenario.id]})),"aria-label":Qt?"Collapse scenario details":"Expand scenario details",children:s.jsx(tn,{className:`h-3.5 w-3.5 transition-transform ${Qt?"rotate-180":""}`})}),V.kind==="referenced"&&s.jsx(s.Fragment,{children:s.jsx(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>Xt(ve),disabled:Fe,children:"Convert to inline"})}),s.jsx(Z,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>dt(ve),"aria-label":"Remove scenario entry",children:s.jsx(Bs,{className:"h-3.5 w-3.5"})})]})]}),V.kind==="inline"&&Qt&&s.jsx("div",{className:"border-t px-3 py-3",children:s.jsx(CN,{scenarios:[V.scenario],scenarioOrigins:["inline"],agents:[..._.agents,...Ze],servers:[..._.servers??[],..._e],configId:_.id,configPath:_.sourcePath,defaultAssistantAgentName:_.runDefaults?.selectedAgentNames?.[0],onChange:ke=>{const en=ke[0];if(!en)return;const Ct=[...O];Ct[ve]={kind:"inline",scenario:en},Q(Ct)},readOnly:!1,allowAdd:!1,allowStructureEdits:!1})}),V.kind==="referenced"&&!Fe&&s.jsxs("div",{className:"border-t px-3 py-3 space-y-2",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Optional MCP server override for this referenced scenario."}),s.jsx("div",{className:"flex flex-wrap gap-2",children:$e.map(ke=>{const en=(V.mcpServers??[]).some(Ct=>Ct.kind==="referenced"&&Ct.ref===ke.id);return s.jsx(Z,{type:"button",size:"sm",variant:en?"default":"outline",className:`h-7 text-xs ${en?"":"opacity-70"}`,onClick:()=>{const Ct=(V.mcpServers??[]).filter(Hn=>Hn.kind==="referenced").map(Hn=>Hn.ref),Kt=Ct.includes(ke.id)?Ct.filter(Hn=>Hn!==ke.id):[...Ct,ke.id];Ge(ve,Kt)},children:zn(ke.name,ke.id)},`${V.ref}-override-server-${ke.id}`)})}),mt&&s.jsx(Z,{type:"button",size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>Ie(ve),children:"Reset override"})]})]},`scenario-entry-${ve}-${V.kind==="inline"?V.scenario.id:V.ref}`)}),O.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No scenarios configured yet. Add inline scenarios or references."})]}),B.length>0&&s.jsxs("p",{className:"text-xs text-destructive",children:["Missing scenario refs: ",B.join(", ")]})]})}),K?s.jsx(nt,{children:s.jsx(rt,{className:"pt-4",children:s.jsx(CN,{scenarios:ue.map(V=>V.scenario),scenarioOrigins:ue.map(V=>V.origin),scenarioOverrides:ue.map(V=>V.hasMcpServerOverride),agents:Ke,servers:De,configId:_.id,configPath:_.sourcePath,defaultAssistantAgentName:_.runDefaults?.selectedAgentNames?.[0],testCaseReturnToPath:I,onChange:()=>{},readOnly:!0})})}):null]})]})]})};var rxe=Symbol("radix.slottable");function sxe(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=rxe,t}var f8="AlertDialog",[axe]=Sr(f8,[d3]),Ii=d3(),p8=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ii(t);return s.jsx(Bg,{...r,...n,modal:!0})};p8.displayName=f8;var ixe="AlertDialogTrigger",oxe=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=Ii(n);return s.jsx(GY,{...a,...r,ref:t})});oxe.displayName=ixe;var lxe="AlertDialogPortal",h8=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ii(t);return s.jsx(qg,{...r,...n})};h8.displayName=lxe;var cxe="AlertDialogOverlay",m8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=Ii(n);return s.jsx(_u,{...a,...r,ref:t})});m8.displayName=cxe;var zc="AlertDialogContent",[uxe,dxe]=axe(zc),fxe=sxe("AlertDialogContent"),g8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...a}=e,i=Ii(n),o=m.useRef(null),c=Mt(t,o),d=m.useRef(null);return s.jsx(WY,{contentName:zc,titleName:v8,docsSlug:"alert-dialog",children:s.jsx(uxe,{scope:n,cancelRef:d,children:s.jsxs(Au,{role:"alertdialog",...i,...a,ref:c,onOpenAutoFocus:qe(a.onOpenAutoFocus,f=>{f.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[s.jsx(fxe,{children:r}),s.jsx(hxe,{contentRef:o})]})})})});g8.displayName=zc;var v8="AlertDialogTitle",x8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=Ii(n);return s.jsx(Hf,{...a,...r,ref:t})});x8.displayName=v8;var y8="AlertDialogDescription",b8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=Ii(n);return s.jsx(Kf,{...a,...r,ref:t})});b8.displayName=y8;var pxe="AlertDialogAction",w8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=Ii(n);return s.jsx(Ug,{...a,...r,ref:t})});w8.displayName=pxe;var j8="AlertDialogCancel",S8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=dxe(j8,n),i=Ii(n),o=Mt(t,a);return s.jsx(Ug,{...i,...r,ref:o})});S8.displayName=j8;var hxe=({contentRef:e})=>{const t=`\`${zc}\` requires a description for the component to be accessible for screen reader users.
|
|
132
|
+
|
|
133
|
+
You can add a description to the \`${zc}\` by passing a \`${y8}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
134
|
+
|
|
135
|
+
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 \`${zc}\`. 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.
|
|
136
|
+
|
|
137
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return m.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},mxe=p8,gxe=h8,N8=m8,C8=g8,_8=w8,A8=S8,k8=x8,E8=b8;const ja=mxe,vxe=gxe,P8=m.forwardRef(({className:e,...t},n)=>s.jsx(N8,{className:Re("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}));P8.displayName=N8.displayName;const Us=m.forwardRef(({className:e,...t},n)=>s.jsxs(vxe,{children:[s.jsx(P8,{}),s.jsx(C8,{ref:n,className:Re("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})]}));Us.displayName=C8.displayName;const Ws=({className:e,...t})=>s.jsx("div",{className:Re("flex flex-col space-y-2 text-center sm:text-left",e),...t});Ws.displayName="AlertDialogHeader";const Vs=({className:e,...t})=>s.jsx("div",{className:Re("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Vs.displayName="AlertDialogFooter";const Hs=m.forwardRef(({className:e,...t},n)=>s.jsx(k8,{ref:n,className:Re("text-lg font-semibold",e),...t}));Hs.displayName=k8.displayName;const Ks=m.forwardRef(({className:e,...t},n)=>s.jsx(E8,{ref:n,className:Re("text-sm text-muted-foreground",e),...t}));Ks.displayName=E8.displayName;const Gs=m.forwardRef(({className:e,...t},n)=>s.jsx(_8,{ref:n,className:Re(iC(),e),...t}));Gs.displayName=_8.displayName;const Ys=m.forwardRef(({className:e,...t},n)=>s.jsx(A8,{ref:n,className:Re(iC({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Ys.displayName=A8.displayName;const xxe=()=>{const{servers:e,setServers:t,reload:n,loading:r}=Ca(),a=Xs(),[i,o]=m.useState(null),[c,d]=m.useState(""),f=c.trim().toLowerCase(),h=b=>b.name?.trim()||b.id,p=async b=>{const y=`${h(b)}-copy`;let S=y,N=1;for(;e.some(A=>(A.name?.trim()||A.id)===S);)S=`${y}-${N}`,N+=1;const _={...structuredClone(b),id:`srv-${Date.now()}`,name:S};await t([...e,_]),Me({title:"Server duplicated",description:`Created ${S}.`})},v=async b=>{await t(e.filter(y=>y.id!==b.id)),Me({title:"Server deleted",description:`${h(b)} was removed.`}),o(null)},x=b=>b.transport==="stdio"?[b.command,...b.args||[]].filter(Boolean).join(" "):b.url||"",j=m.useMemo(()=>[...f.length===0?e:e.filter(y=>[h(y),y.id,y.transport,x(y),y.authType??""].join(" ").toLowerCase().includes(f))].sort((y,S)=>h(y).localeCompare(h(S),void 0,{sensitivity:"base"})),[e,f]);return 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(DD,{className:"h-6 w-6"}),"MCP Servers"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Reusable MCP server definitions shared across configurations."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(f_,{value:c,onValueChange:d,placeholder:"Search MCP servers..."}),s.jsxs(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>{n()},disabled:r,children:[s.jsx(zs,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(Z,{type:"button",size:"sm",onClick:()=>a("/libraries/servers/new"),children:[s.jsx(yi,{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(Z,{type:"button",size:"sm",className:"mt-4",onClick:()=>a("/libraries/servers/new"),children:[s.jsx(yi,{className:"mr-2 h-4 w-4"}),"Add Server"]})]}):j.length===0?s.jsx("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed py-12 text-center",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:"No servers match this filter."})}):s.jsx(nt,{children:s.jsx(rt,{className:"p-0",children:s.jsxs(Jr,{children:[s.jsx(es,{children:s.jsxs(Gt,{children:[s.jsx(ht,{children:"Name"}),s.jsx(ht,{children:"Transport"}),s.jsx(ht,{children:"Endpoint"}),s.jsx(ht,{children:"Auth"}),s.jsx(ht,{className:"text-right",children:"Actions"})]})}),s.jsx(ts,{children:j.map(b=>s.jsxs(Gt,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>a(`/libraries/servers/${encodeURIComponent(b.id)}`),children:[s.jsx(He,{className:"font-medium",children:h(b)}),s.jsx(He,{children:s.jsx(st,{variant:"secondary",className:"font-mono text-xs",children:b.transport})}),s.jsx(He,{children:s.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:x(b)})}),s.jsx(He,{children:!b.authType||b.authType==="none"?s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"}):s.jsx(st,{variant:"outline",className:"text-xs",children:b.authType})}),s.jsx(He,{className:"text-right",onClick:y=>y.stopPropagation(),children:s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsxs(Z,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>o(b),children:[s.jsx(Bs,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>{p(b)},children:[s.jsx(ss,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsxs(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>a(`/libraries/servers/${encodeURIComponent(b.id)}`),children:[s.jsx(wg,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})]})})]},b.id))})]})})}),s.jsx(ja,{open:!!i,onOpenChange:b=>!b&&o(null),children:s.jsxs(Us,{children:[s.jsxs(Ws,{children:[s.jsx(Hs,{children:"Delete server?"}),s.jsxs(Ks,{children:["This will permanently remove"," ",s.jsx("span",{className:"font-mono",children:i?h(i):""})," ","from the library. This action cannot be undone."]})]}),s.jsxs(Vs,{children:[s.jsx(Ys,{children:"Cancel"}),s.jsx(Gs,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{i&&v(i)},children:"Delete Server"})]})]})})]})},R$={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"},O$=()=>({id:`srv-${Date.now()}`,name:"",transport:"stdio",authType:"none"}),yxe=()=>{const{serverId:e}=Ml(),t=Xs(),{servers:n,setServers:r}=Ca(),{source:a}=On(),i=e==="new",o=e?decodeURIComponent(e):"",c=i?null:n.find(L=>L.id===o||L.name===o),d=L=>L.name?.trim()||L.id,[f,h]=m.useState(()=>c??O$()),[p,v]=m.useState(!1),[x,j]=m.useState(!1),[b,y]=m.useState({status:"idle"}),[S,N]=m.useState(!1),[_,A]=m.useState(!1),[k,E]=m.useState([]),[P,R]=m.useState(!1),M=m.useRef(null);m.useEffect(()=>{const L=i?`new:${o||"new"}`:`srv:${o}`;if(M.current!==L){if(i){h(O$()),R(!1),M.current=L;return}c&&(h(c),R(!1),M.current=L)}},[i,o,c]);const D=L=>{R(!1),h(I=>({...I,authType:L,...L!=="bearer"&&L!=="api-key"?{authValue:void 0}:{},...L!=="api-key"?{apiKeyHeaderName:void 0}:{apiKeyHeaderName:I.apiKeyHeaderName||"X-API-Key"},...L!=="oauth2"?{oauthClientId:void 0,oauthClientSecret:void 0,oauthRedirectUrl:void 0,oauthScope:void 0,oauthMode:void 0,oauthAuthorizationUrl:void 0,oauthTokenEndpoint:void 0}:{oauthRedirectUrl:I.oauthRedirectUrl||void 0}}))},U=async()=>{if(N(!0),y({status:"loading"}),E([]),f.authType==="oauth2")try{A(!0),await vi({serverNames:[f.id],source:a,onServerStatus:L=>{const I=new Date().toLocaleTimeString(),Y=typeof L.tokenExpiresInSeconds=="number"?` (valid ${SN(L.tokenExpiresInSeconds,{nonPositiveLabel:"expired"})}; until ${new Date(L.tokenExpiresAt||Date.now()).toLocaleTimeString()})`:"";if(L.status==="auth_required"){E(W=>[...W,`[${I}] OAuth debug: callback required for '${L.serverName}'`]);return}L.status==="ready"&&(L.debugState==="refreshed"?E(W=>[...W,`[${I}] OAuth debug: token refreshed (no callback)${Y}`]):L.debugState==="reused"?E(W=>[...W,`[${I}] OAuth debug: session/token reused${Y}`]):E(W=>[...W,`[${I}] OAuth debug: authorized${Y}`]))}})}catch(L){y({status:"error",message:`OAuth login failed: ${L instanceof Error?L.message:String(L)}`,testedAt:new Date().toISOString()}),A(!1);return}finally{A(!1)}try{const I=(await a.discoverToolsForAnalysis({serverNames:[f.id]})).servers[0];I&&I.warnings.length===0?y({status:"success",toolNames:I.tools.map(Y=>Y.name),toolCount:I.tools.length,mcpServerVersion:I.mcpServerVersion,mcpServerImplementation:I.mcpServerImplementation,testedAt:new Date().toISOString()}):y({status:"error",message:I?.warnings[0]??"Connection failed",testedAt:new Date().toISOString()})}catch(L){y({status:"error",message:L instanceof Error?L.message:String(L),testedAt:new Date().toISOString()})}},F=async()=>{if(!f.name.trim()){Me({title:"Name is required",variant:"destructive"});return}const L=d8(f);if(L){Me({title:"Validation Error",description:L,variant:"destructive"});return}const I={...f,authValue:f.authValue?.trim(),apiKeyHeaderName:f.apiKeyHeaderName?.trim()||void 0};j(!0);try{if(i)await r([...n,I]),Me({title:"Server created"}),t(`/libraries/servers/${encodeURIComponent(I.id)}`);else{const Y=n.map(W=>W.id===c?.id?I:W);await r(Y),Me({title:"Server saved"}),I.id!==o&&t(`/libraries/servers/${encodeURIComponent(I.id)}`,{replace:!0})}}finally{j(!1)}},G=async()=>{const L=n.filter(I=>I.id!==c?.id);await r(L),Me({title:"Server deleted"}),t("/libraries/servers")},H=()=>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(Tt,{to:"/libraries/servers",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(go,{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(Tt,{to:"/libraries/servers",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(go,{className:"h-4 w-4"})," Servers"]}),s.jsx("h1",{className:"text-2xl font-bold",children:i?"New Server":d(f)})]}),!i&&s.jsxs(Z,{type:"button",onClick:()=>{U()},disabled:b.status==="loading"||_,children:[s.jsx(VD,{className:"mr-2 h-4 w-4"}),"Test Connection"]})]}),S&&s.jsxs(nt,{children:[s.jsxs(Lt,{className:"flex-row items-center justify-between space-y-0",children:[s.jsx(Ft,{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(ns,{className:"h-4 w-4"})})]}),s.jsxs(rt,{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}),H()&&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:H()})]})]}),b.status==="loading"&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(jr,{className:"h-4 w-4 animate-spin"}),_?"Waiting for OAuth login in browser…":"Connecting to MCP server…"]}),k.length>0&&s.jsx("div",{className:"space-y-0.5",children:k.map((L,I)=>s.jsx("p",{className:"text-xs text-muted-foreground",children:L},I))})]}),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(qc,{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(L=>s.jsx("li",{className:"font-mono text-xs",children:L},L))})]}),(b.mcpServerImplementation||b.mcpServerVersion)&&s.jsx("div",{className:"rounded-md border bg-muted/40 p-3",children:s.jsxs("div",{className:"flex items-start gap-2",children:[b.mcpServerImplementation?.icons?.[0]?.src?s.jsx("img",{src:b.mcpServerImplementation.icons[0].src,alt:b.mcpServerImplementation.title||b.mcpServerImplementation.name,className:"h-7 w-7 rounded-sm border bg-background object-contain"}):null,s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"MCP server"}),s.jsx("p",{className:"truncate text-sm",children:b.mcpServerImplementation?b.mcpServerImplementation.title||b.mcpServerImplementation.name:"Unknown MCP server"}),b.mcpServerVersion?s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Version:"," ",s.jsx("code",{className:"font-mono",children:b.mcpServerVersion})]}):null,b.mcpServerImplementation?.description?s.jsx("p",{className:"text-xs text-muted-foreground",children:b.mcpServerImplementation.description}):null]})]})}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(b.testedAt).toLocaleString()]}),k.length>0&&s.jsx("div",{className:"space-y-0.5",children:k.map((L,I)=>s.jsx("p",{className:"text-xs text-muted-foreground",children:L},I))})]}),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]}),R$[f.transport]&&s.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:["Hint: ",R$[f.transport]]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(b.testedAt).toLocaleString()]})]})]})]}),s.jsxs(nt,{children:[s.jsx(Lt,{children:s.jsx(Ft,{className:"text-base",children:"Configuration"})}),s.jsxs(rt,{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(Ve,{children:"Name"}),s.jsx(Et,{value:f.name,onChange:L=>h(I=>({...I,name:L.target.value})),placeholder:"e.g. Filesystem MCP"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Ve,{children:"Transport"}),s.jsxs(In,{value:f.transport,onValueChange:L=>h(I=>({...I,transport:L})),children:[s.jsx(Tn,{children:s.jsx($n,{})}),s.jsxs(Rn,{children:[s.jsx(gt,{value:"stdio",children:"stdio"}),s.jsx(gt,{value:"sse",children:"SSE"}),s.jsx(gt,{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(Ve,{children:"Command"}),s.jsx(Et,{value:f.command||"",onChange:L=>h(I=>({...I,command:L.target.value})),placeholder:"npx",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Ve,{children:"Args (comma-separated)"}),s.jsx(Et,{value:(f.args||[]).join(", "),onChange:L=>h(I=>({...I,args:L.target.value.split(",").map(Y=>Y.trim()).filter(Boolean)})),placeholder:"-y, @mcp/server",className:"font-mono text-xs"})]})]}):s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Ve,{children:"URL"}),s.jsx(Et,{value:f.url||"",onChange:L=>h(I=>({...I,url:L.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(Ve,{children:"Auth Type"}),s.jsxs(In,{value:f.authType||"none",onValueChange:L=>D(L),children:[s.jsx(Tn,{children:s.jsx($n,{})}),s.jsxs(Rn,{children:[s.jsx(gt,{value:"none",children:"None"}),s.jsx(gt,{value:"bearer",children:"Bearer Token"}),s.jsx(gt,{value:"api-key",children:"API Key"}),s.jsx(gt,{value:"oauth2",children:"OAuth 2.0"})]})]})]}),f.authType==="bearer"&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Ve,{children:"Token"}),s.jsx(Et,{value:f.authValue||"",onChange:L=>h(I=>({...I,authValue:L.target.value})),placeholder:"${DATABRICKS_TOKEN}",className:"font-mono text-xs"})]})]}),f.authType==="bearer"&&s.jsxs("p",{className:"text-xs text-muted-foreground -mt-1",children:["Use ",s.jsx("code",{className:"rounded bg-muted px-1",children:"${VAR_NAME}"})," to reference an environment variable, or enter a token directly."]}),f.authType==="api-key"&&s.jsxs("div",{className:"space-y-3 rounded-md border p-3",children:[s.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:"API Key"}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Ve,{className:"text-xs",children:"Header Name"}),s.jsx(Et,{value:f.apiKeyHeaderName||"X-API-Key",onChange:L=>h(I=>({...I,apiKeyHeaderName:L.target.value})),placeholder:"X-API-Key",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Ve,{className:"text-xs",children:"Value"}),s.jsx(Et,{value:f.authValue||"",onChange:L=>h(I=>({...I,authValue:L.target.value})),placeholder:"${MY_API_KEY}",className:"font-mono text-xs"})]})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Use ",s.jsx("code",{className:"rounded bg-muted px-1",children:"${VAR_NAME}"})," to reference an environment variable, or enter a value directly."]})]}),f.authType==="oauth2"&&s.jsxs("div",{className:"space-y-3 rounded-md border p-3",children:[s.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:"OAuth 2.0 Flow"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Z,{type:"button",variant:!f.oauthMode||f.oauthMode==="pre_registered"?"default":"outline",size:"sm",onClick:()=>h(L=>({...L,oauthMode:"pre_registered"})),children:"Pre-registered"}),s.jsx(Z,{type:"button",variant:f.oauthMode==="dcr"?"default":"outline",size:"sm",onClick:()=>h(L=>({...L,oauthMode:"dcr",oauthClientId:void 0,oauthClientSecret:void 0})),children:"DCR (Dynamic)"})]}),(!f.oauthMode||f.oauthMode==="pre_registered")&&s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Ve,{className:"text-xs",children:"Client ID"}),s.jsx(Et,{value:f.oauthClientId||"",onChange:L=>h(I=>({...I,oauthClientId:L.target.value})),placeholder:"your-client-id",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Ve,{className:"text-xs",children:"Client Secret (optional)"}),s.jsx(Et,{type:"password",value:f.oauthClientSecret||"",onChange:L=>h(I=>({...I,oauthClientSecret:L.target.value})),placeholder:"••••••••",className:"font-mono text-xs"})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Ve,{className:"text-xs",children:"Scope (optional, space-separated)"}),s.jsx(Et,{value:f.oauthScope||"",onChange:L=>h(I=>({...I,oauthScope:L.target.value})),placeholder:"openid profile mcp",className:"font-mono text-xs"})]}),s.jsxs("div",{children:[s.jsxs("button",{type:"button",className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",onClick:()=>R(L=>!L),children:[s.jsx("span",{children:P?"▾":"▸"}),"Advanced — manual endpoint overrides"]}),P&&s.jsxs("div",{className:"mt-2 grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Ve,{className:"text-xs",children:"Authorization URL"}),s.jsx(Et,{value:f.oauthAuthorizationUrl||"",onChange:L=>h(I=>({...I,oauthAuthorizationUrl:L.target.value||void 0})),placeholder:"leave blank to use .well-known discovery",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Ve,{className:"text-xs",children:"Token URL"}),s.jsx(Et,{value:f.oauthTokenEndpoint||"",onChange:L=>h(I=>({...I,oauthTokenEndpoint:L.target.value||void 0})),placeholder:"leave blank to use .well-known discovery",className:"font-mono text-xs"})]})]})]})]}),s.jsxs("div",{className:"flex items-center justify-between pt-2",children:[s.jsx("div",{children:!i&&s.jsx(Z,{type:"button",variant:"destructive",size:"sm",onClick:()=>v(!0),children:"Delete"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Z,{type:"button",variant:"outline",size:"sm",onClick:()=>t("/libraries/servers"),children:"Cancel"}),s.jsxs(Z,{type:"button",size:"sm",onClick:()=>{F()},disabled:x,children:[x&&s.jsx(jr,{className:"mr-2 h-4 w-4 animate-spin"}),i?"Create Server":"Save"]})]})]})]})]}),s.jsx(ja,{open:p,onOpenChange:v,children:s.jsxs(Us,{children:[s.jsxs(Ws,{children:[s.jsx(Hs,{children:"Delete server?"}),s.jsxs(Ks,{children:["This will permanently remove the server ",s.jsx("span",{className:"font-mono",children:f.name}),". This action cannot be undone."]})]}),s.jsxs(Vs,{children:[s.jsx(Ys,{children:"Cancel"}),s.jsx(Gs,{onClick:()=>{G()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},bxe=()=>{const{agents:e,setAgents:t,reload:n,loading:r}=Ca(),a=Xs(),[i,o]=m.useState(null),[c,d]=m.useState(""),f=c.trim().toLowerCase(),h=m.useMemo(()=>f.length===0?e:e.filter(x=>{const j=x.name.toLowerCase(),b=x.model.toLowerCase();return j.includes(f)||b.includes(f)}),[e,f]),p=async x=>{const j=`${x.name}-copy`;let b=j,y=1;for(;e.some(N=>N.name===b);)b=`${j}-${y}`,y+=1;const S={...structuredClone(x),id:`agt-${Date.now()}`,name:b};await t([...e,S]),Me({title:"Agent duplicated",description:`Created ${b}.`})},v=async x=>{await t(e.filter(j=>j.id!==x.id)),Me({title:"Agent deleted",description:`${x.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(Fr,{className:"h-6 w-6"}),"Agents"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Reusable agent profiles shared across configurations."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(f_,{value:c,onValueChange:d,placeholder:"Search agents..."}),s.jsxs(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>{n()},disabled:r,children:[s.jsx(zs,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(Z,{type:"button",size:"sm",onClick:()=>a("/libraries/agents/new"),children:[s.jsx(yi,{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(Z,{type:"button",size:"sm",className:"mt-4",onClick:()=>a("/libraries/agents/new"),children:[s.jsx(yi,{className:"mr-2 h-4 w-4"}),"Add Agent"]})]}):h.length===0?s.jsx("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed py-12 text-center",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents match this filter."})}):s.jsx(nt,{children:s.jsx(rt,{className:"p-0",children:s.jsxs(Jr,{children:[s.jsx(es,{children:s.jsxs(Gt,{children:[s.jsx(ht,{children:"Name"}),s.jsx(ht,{children:"Provider"}),s.jsx(ht,{children:"Model"}),s.jsx(ht,{children:"Max Tokens"}),s.jsx(ht,{children:"Temperature"}),s.jsx(ht,{className:"text-right",children:"Actions"})]})}),s.jsx(ts,{children:h.map(x=>s.jsxs(Gt,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>a(`/libraries/agents/${encodeURIComponent(x.id)}`),children:[s.jsx(He,{className:"font-medium",children:x.name}),s.jsx(He,{children:s.jsx(_6,{provider:x.provider})}),s.jsx(He,{children:s.jsx("span",{className:"font-mono text-xs",children:x.model})}),s.jsx(He,{className:"font-mono text-xs",children:x.maxTokens}),s.jsx(He,{className:"font-mono text-xs",children:x.temperature.toFixed(2)}),s.jsx(He,{className:"text-right",onClick:j=>j.stopPropagation(),children:s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsxs(Z,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>o(x),children:[s.jsx(Bs,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>{p(x)},children:[s.jsx(ss,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsxs(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>a(`/libraries/agents/${encodeURIComponent(x.id)}`),children:[s.jsx(wg,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})]})})]},x.id))})]})})}),s.jsx(ja,{open:!!i,onOpenChange:x=>!x&&o(null),children:s.jsxs(Us,{children:[s.jsxs(Ws,{children:[s.jsx(Hs,{children:"Delete agent?"}),s.jsxs(Ks,{children:["This will permanently remove ",s.jsx("span",{className:"font-mono",children:i?.name})," ","from the library. This action cannot be undone."]})]}),s.jsxs(Vs,{children:[s.jsx(Ys,{children:"Cancel"}),s.jsx(Gs,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{i&&v(i)},children:"Delete Agent"})]})]})})]})};var T8=["PageUp","PageDown"],R8=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],O8={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Lu="Slider",[_N,wxe,jxe]=Ff(Lu),[M8]=Sr(Lu,[jxe]),[Sxe,Uv]=M8(Lu),I8=m.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:v=()=>{},inverted:x=!1,form:j,...b}=e,y=m.useRef(new Set),S=m.useRef(0),_=o==="horizontal"?Nxe:Cxe,[A=[],k]=js({prop:h,defaultProp:f,onChange:U=>{[...y.current][S.current]?.focus(),p(U)}}),E=m.useRef(A);function P(U){const F=Pxe(A,U);D(U,F)}function R(U){D(U,S.current)}function M(){const U=E.current[S.current];A[S.current]!==U&&v(A)}function D(U,F,{commit:G}={commit:!1}){const H=Mxe(i),L=Ixe(Math.round((U-r)/i)*i+r,H),I=Df(L,[r,a]);k((Y=[])=>{const W=kxe(Y,I,F);if(Oxe(W,d*i)){S.current=W.indexOf(I);const O=String(W)!==String(Y);return O&&G&&v(W),O?W:Y}else return Y})}return s.jsx(Sxe,{scope:e.__scopeSlider,name:n,disabled:c,min:r,max:a,valueIndexToChangeRef:S,thumbs:y.current,values:A,orientation:o,form:j,children:s.jsx(_N.Provider,{scope:e.__scopeSlider,children:s.jsx(_N.Slot,{scope:e.__scopeSlider,children:s.jsx(_,{"aria-disabled":c,"data-disabled":c?"":void 0,...b,ref:t,onPointerDown:qe(b.onPointerDown,()=>{c||(E.current=A)}),min:r,max:a,inverted:x,onSlideStart:c?void 0:P,onSlideMove:c?void 0:R,onSlideEnd:c?void 0:M,onHomeKeyDown:()=>!c&&D(r,0,{commit:!0}),onEndKeyDown:()=>!c&&D(a,A.length-1,{commit:!0}),onStepKeyDown:({event:U,direction:F})=>{if(!c){const L=T8.includes(U.key)||U.shiftKey&&R8.includes(U.key)?10:1,I=S.current,Y=A[I],W=i*L*F;D(Y+W,I,{commit:!0})}}})})})})});I8.displayName=Lu;var[$8,D8]=M8(Lu,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Nxe=m.forwardRef((e,t)=>{const{min:n,max:r,dir:a,inverted:i,onSlideStart:o,onSlideMove:c,onSlideEnd:d,onStepKeyDown:f,...h}=e,[p,v]=m.useState(null),x=Mt(t,_=>v(_)),j=m.useRef(void 0),b=Iu(a),y=b==="ltr",S=y&&!i||!y&&i;function N(_){const A=j.current||p.getBoundingClientRect(),k=[0,A.width],P=O_(k,S?[n,r]:[r,n]);return j.current=A,P(_-A.left)}return s.jsx($8,{scope:e.__scopeSlider,startEdge:S?"left":"right",endEdge:S?"right":"left",direction:S?1:-1,size:"width",children:s.jsx(L8,{dir:b,"data-orientation":"horizontal",...h,ref:x,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:_=>{const A=N(_.clientX);o?.(A)},onSlideMove:_=>{const A=N(_.clientX);c?.(A)},onSlideEnd:()=>{j.current=void 0,d?.()},onStepKeyDown:_=>{const k=O8[S?"from-left":"from-right"].includes(_.key);f?.({event:_,direction:k?-1:1})}})})}),Cxe=m.forwardRef((e,t)=>{const{min:n,max:r,inverted:a,onSlideStart:i,onSlideMove:o,onSlideEnd:c,onStepKeyDown:d,...f}=e,h=m.useRef(null),p=Mt(t,h),v=m.useRef(void 0),x=!a;function j(b){const y=v.current||h.current.getBoundingClientRect(),S=[0,y.height],_=O_(S,x?[r,n]:[n,r]);return v.current=y,_(b-y.top)}return s.jsx($8,{scope:e.__scopeSlider,startEdge:x?"bottom":"top",endEdge:x?"top":"bottom",size:"height",direction:x?1:-1,children:s.jsx(L8,{"data-orientation":"vertical",...f,ref:p,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:b=>{const y=j(b.clientY);i?.(y)},onSlideMove:b=>{const y=j(b.clientY);o?.(y)},onSlideEnd:()=>{v.current=void 0,c?.()},onStepKeyDown:b=>{const S=O8[x?"from-bottom":"from-top"].includes(b.key);d?.({event:b,direction:S?-1:1})}})})}),L8=m.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:a,onSlideEnd:i,onHomeKeyDown:o,onEndKeyDown:c,onStepKeyDown:d,...f}=e,h=Uv(Lu,n);return s.jsx(ft.span,{...f,ref:t,onKeyDown:qe(e.onKeyDown,p=>{p.key==="Home"?(o(p),p.preventDefault()):p.key==="End"?(c(p),p.preventDefault()):T8.concat(R8).includes(p.key)&&(d(p),p.preventDefault())}),onPointerDown:qe(e.onPointerDown,p=>{const v=p.target;v.setPointerCapture(p.pointerId),p.preventDefault(),h.thumbs.has(v)?v.focus():r(p)}),onPointerMove:qe(e.onPointerMove,p=>{p.target.hasPointerCapture(p.pointerId)&&a(p)}),onPointerUp:qe(e.onPointerUp,p=>{const v=p.target;v.hasPointerCapture(p.pointerId)&&(v.releasePointerCapture(p.pointerId),i(p))})})}),F8="SliderTrack",z8=m.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=Uv(F8,n);return s.jsx(ft.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...r,ref:t})});z8.displayName=F8;var AN="SliderRange",B8=m.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=Uv(AN,n),i=D8(AN,n),o=m.useRef(null),c=Mt(t,o),d=a.values.length,f=a.values.map(v=>W8(v,a.min,a.max)),h=d>1?Math.min(...f):0,p=100-Math.max(...f);return s.jsx(ft.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,...r,ref:c,style:{...e.style,[i.startEdge]:h+"%",[i.endEdge]:p+"%"}})});B8.displayName=AN;var kN="SliderThumb",q8=m.forwardRef((e,t)=>{const n=wxe(e.__scopeSlider),[r,a]=m.useState(null),i=Mt(t,c=>a(c)),o=m.useMemo(()=>r?n().findIndex(c=>c.ref.current===r):-1,[n,r]);return s.jsx(_xe,{...e,ref:i,index:o})}),_xe=m.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:a,...i}=e,o=Uv(kN,n),c=D8(kN,n),[d,f]=m.useState(null),h=Mt(t,N=>f(N)),p=d?o.form||!!d.closest("form"):!0,v=_g(d),x=o.values[r],j=x===void 0?0:W8(x,o.min,o.max),b=Exe(r,o.values.length),y=v?.[c.size],S=y?Txe(y,j,c.direction):0;return m.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(_N.ItemSlot,{scope:e.__scopeSlider,children:s.jsx(ft.span,{role:"slider","aria-label":e["aria-label"]||b,"aria-valuemin":o.min,"aria-valuenow":x,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...i,ref:h,style:x===void 0?{display:"none"}:e.style,onFocus:qe(e.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),p&&s.jsx(U8,{name:a??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:x},r)]})});q8.displayName=kN;var Axe="RadioBubbleInput",U8=m.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const a=m.useRef(null),i=Mt(a,r),o=Rv(t);return m.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(ft.input,{style:{display:"none"},...n,ref:i,defaultValue:t})});U8.displayName=Axe;function kxe(e=[],t,n){const r=[...e];return r[n]=t,r.sort((a,i)=>a-i)}function W8(e,t,n){const i=100/(n-t)*(e-t);return Df(i,[0,100])}function Exe(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Pxe(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 Txe(e,t,n){const r=e/2,i=O_([0,50],[0,r]);return(r-i(t)*n)*n}function Rxe(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Oxe(e,t){if(t>0){const n=Rxe(e);return Math.min(...n)>=t}return!0}function O_(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 Mxe(e){return(String(e).split(".")[1]||"").length}function Ixe(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var V8=I8,$xe=z8,Dxe=B8,Lxe=q8;const H8=m.forwardRef(({className:e,...t},n)=>s.jsxs(V8,{ref:n,className:Re("relative flex w-full touch-none select-none items-center",e),...t,children:[s.jsx($xe,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:s.jsx(Dxe,{className:"absolute h-full bg-primary"})}),s.jsx(Lxe,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));H8.displayName=V8.displayName;function Fxe(e){const t=zxe(e),n=m.forwardRef((r,a)=>{const{children:i,...o}=r,c=m.Children.toArray(i),d=c.find(qxe);if(d){const f=d.props.children,h=c.map(p=>p===d?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function zxe(e){const t=m.forwardRef((n,r)=>{const{children:a,...i}=n;if(m.isValidElement(a)){const o=Wxe(a),c=Uxe(i,a.props);return a.type!==m.Fragment&&(c.ref=r?zr(r,o):o),m.cloneElement(a,c)}return m.Children.count(a)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Bxe=Symbol("radix.slottable");function qxe(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Bxe}function Uxe(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 Wxe(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 Wv="Popover",[K8]=Sr(Wv,[jo]),dp=jo(),[Vxe,Po]=K8(Wv),G8=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:o=!1}=e,c=dp(t),d=m.useRef(null),[f,h]=m.useState(!1),[p,v]=js({prop:r,defaultProp:a??!1,onChange:i,caller:Wv});return s.jsx(Ag,{...c,children:s.jsx(Vxe,{scope:t,contentId:ar(),triggerRef:d,open:p,onOpenChange:v,onOpenToggle:m.useCallback(()=>v(x=>!x),[v]),hasCustomAnchor:f,onCustomAnchorAdd:m.useCallback(()=>h(!0),[]),onCustomAnchorRemove:m.useCallback(()=>h(!1),[]),modal:o,children:n})})};G8.displayName=Wv;var Y8="PopoverAnchor",Hxe=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Po(Y8,n),i=dp(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:c}=a;return m.useEffect(()=>(o(),()=>c()),[o,c]),s.jsx(qf,{...i,...r,ref:t})});Hxe.displayName=Y8;var X8="PopoverTrigger",Q8=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Po(X8,n),i=dp(n),o=Mt(t,a.triggerRef),c=s.jsx(ft.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":nq(a.open),...r,ref:o,onClick:qe(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:s.jsx(qf,{asChild:!0,...i,children:c})});Q8.displayName=X8;var M_="PopoverPortal",[Kxe,Gxe]=K8(M_,{forceMount:void 0}),Z8=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=Po(M_,t);return s.jsx(Kxe,{scope:t,forceMount:n,children:s.jsx(Zn,{present:n||i.open,children:s.jsx(Rl,{asChild:!0,container:a,children:r})})})};Z8.displayName=M_;var yu="PopoverContent",J8=m.forwardRef((e,t)=>{const n=Gxe(yu,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,i=Po(yu,e.__scopePopover);return s.jsx(Zn,{present:r||i.open,children:i.modal?s.jsx(Xxe,{...a,ref:t}):s.jsx(Qxe,{...a,ref:t})})});J8.displayName=yu;var Yxe=Fxe("PopoverContent.RemoveScroll"),Xxe=m.forwardRef((e,t)=>{const n=Po(yu,e.__scopePopover),r=m.useRef(null),a=Mt(t,r),i=m.useRef(!1);return m.useEffect(()=>{const o=r.current;if(o)return Fg(o)},[]),s.jsx(Vf,{as:Yxe,allowPinchZoom:!0,children:s.jsx(eq,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:qe(e.onCloseAutoFocus,o=>{o.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:qe(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:qe(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),Qxe=m.forwardRef((e,t)=>{const n=Po(yu,e.__scopePopover),r=m.useRef(!1),a=m.useRef(!1);return s.jsx(eq,{...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()}})}),eq=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,...p}=e,v=Po(yu,n),x=dp(n);return Dg(),s.jsx(Wf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(Tl,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:h,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>v.onOpenChange(!1),children:s.jsx(kg,{"data-state":nq(v.open),role:"dialog",id:v.contentId,...x,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),tq="PopoverClose",Zxe=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Po(tq,n);return s.jsx(ft.button,{type:"button",...r,ref:t,onClick:qe(e.onClick,()=>a.onOpenChange(!1))})});Zxe.displayName=tq;var Jxe="PopoverArrow",eye=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=dp(n);return s.jsx(Eg,{...a,...r,ref:t})});eye.displayName=Jxe;function nq(e){return e?"open":"closed"}var tye=G8,nye=Q8,rye=Z8,rq=J8;const ho=tye,mo=nye,xi=m.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>s.jsx(rye,{children:s.jsx(rq,{ref:a,align:t,sideOffset:n,className:Re("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})}));xi.displayName=rq.displayName;var M$=1,sye=.9,aye=.8,iye=.17,rS=.1,sS=.999,oye=.9999,lye=.99,cye=/[\\\/_+.#"@\[\(\{&]/,uye=/[\\\/_+.#"@\[\(\{&]/g,dye=/[\s-]/,sq=/[\s-]/g;function EN(e,t,n,r,a,i,o){if(i===t.length)return a===e.length?M$:lye;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,v,x,j;f>=0;)p=EN(e,t,n,r,f+1,i+1,o),p>h&&(f===a?p*=M$:cye.test(e.charAt(f-1))?(p*=aye,x=e.slice(a,f-1).match(uye),x&&a>0&&(p*=Math.pow(sS,x.length))):dye.test(e.charAt(f-1))?(p*=sye,j=e.slice(a,f-1).match(sq),j&&a>0&&(p*=Math.pow(sS,j.length))):(p*=iye,a>0&&(p*=Math.pow(sS,f-a))),e.charAt(f)!==t.charAt(i)&&(p*=oye)),(p<rS&&n.charAt(f-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(f-1)!==r.charAt(i))&&(v=EN(e,t,n,r,f+1,i+2,o),v*rS>p&&(p=v*rS)),p>h&&(h=p),f=n.indexOf(d,f+1);return o[c]=h,h}function I$(e){return e.toLowerCase().replace(sq," ")}function fye(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,EN(e,t,I$(e),I$(t),0,0,{})}var Ed='[cmdk-group=""]',aS='[cmdk-group-items=""]',pye='[cmdk-group-heading=""]',aq='[cmdk-item=""]',$$=`${aq}:not([aria-disabled="true"])`,PN="cmdk-item-select",Cc="data-value",hye=(e,t,n)=>fye(e,t,n),iq=m.createContext(void 0),fp=()=>m.useContext(iq),oq=m.createContext(void 0),I_=()=>m.useContext(oq),lq=m.createContext(void 0),cq=m.forwardRef((e,t)=>{let n=_c(()=>{var z,K;return{search:"",value:(K=(z=e.value)!=null?z:e.defaultValue)!=null?K:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=_c(()=>new Set),a=_c(()=>new Map),i=_c(()=>new Map),o=_c(()=>new Set),c=uq(e),{label:d,children:f,value:h,onValueChange:p,filter:v,shouldFilter:x,loop:j,disablePointerSelection:b=!1,vimBindings:y=!0,...S}=e,N=ar(),_=ar(),A=ar(),k=m.useRef(null),E=Cye();Cl(()=>{if(h!==void 0){let z=h.trim();n.current.value=z,P.emit()}},[h]),Cl(()=>{E(6,G)},[]);let P=m.useMemo(()=>({subscribe:z=>(o.current.add(z),()=>o.current.delete(z)),snapshot:()=>n.current,setState:(z,K,J)=>{var ne,he,ie,me;if(!Object.is(n.current[z],K)){if(n.current[z]=K,z==="search")F(),D(),E(1,U);else if(z==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let se=document.getElementById(A);se?se.focus():(ne=document.getElementById(N))==null||ne.focus()}if(E(7,()=>{var se;n.current.selectedItemId=(se=H())==null?void 0:se.id,P.emit()}),J||E(5,G),((he=c.current)==null?void 0:he.value)!==void 0){let se=K??"";(me=(ie=c.current).onValueChange)==null||me.call(ie,se);return}}P.emit()}},emit:()=>{o.current.forEach(z=>z())}}),[]),R=m.useMemo(()=>({value:(z,K,J)=>{var ne;K!==((ne=i.current.get(z))==null?void 0:ne.value)&&(i.current.set(z,{value:K,keywords:J}),n.current.filtered.items.set(z,M(K,J)),E(2,()=>{D(),P.emit()}))},item:(z,K)=>(r.current.add(z),K&&(a.current.has(K)?a.current.get(K).add(z):a.current.set(K,new Set([z]))),E(3,()=>{F(),D(),n.current.value||U(),P.emit()}),()=>{i.current.delete(z),r.current.delete(z),n.current.filtered.items.delete(z);let J=H();E(4,()=>{F(),J?.getAttribute("id")===z&&U(),P.emit()})}),group:z=>(a.current.has(z)||a.current.set(z,new Set),()=>{i.current.delete(z),a.current.delete(z)}),filter:()=>c.current.shouldFilter,label:d||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:N,inputId:A,labelId:_,listInnerRef:k}),[]);function M(z,K){var J,ne;let he=(ne=(J=c.current)==null?void 0:J.filter)!=null?ne:hye;return z?he(z,n.current.search,K):0}function D(){if(!n.current.search||c.current.shouldFilter===!1)return;let z=n.current.filtered.items,K=[];n.current.filtered.groups.forEach(ne=>{let he=a.current.get(ne),ie=0;he.forEach(me=>{let se=z.get(me);ie=Math.max(se,ie)}),K.push([ne,ie])});let J=k.current;L().sort((ne,he)=>{var ie,me;let se=ne.getAttribute("id"),ge=he.getAttribute("id");return((ie=z.get(ge))!=null?ie:0)-((me=z.get(se))!=null?me:0)}).forEach(ne=>{let he=ne.closest(aS);he?he.appendChild(ne.parentElement===he?ne:ne.closest(`${aS} > *`)):J.appendChild(ne.parentElement===J?ne:ne.closest(`${aS} > *`))}),K.sort((ne,he)=>he[1]-ne[1]).forEach(ne=>{var he;let ie=(he=k.current)==null?void 0:he.querySelector(`${Ed}[${Cc}="${encodeURIComponent(ne[0])}"]`);ie?.parentElement.appendChild(ie)})}function U(){let z=L().find(J=>J.getAttribute("aria-disabled")!=="true"),K=z?.getAttribute(Cc);P.setState("value",K||void 0)}function F(){var z,K,J,ne;if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let he=0;for(let ie of r.current){let me=(K=(z=i.current.get(ie))==null?void 0:z.value)!=null?K:"",se=(ne=(J=i.current.get(ie))==null?void 0:J.keywords)!=null?ne:[],ge=M(me,se);n.current.filtered.items.set(ie,ge),ge>0&&he++}for(let[ie,me]of a.current)for(let se of me)if(n.current.filtered.items.get(se)>0){n.current.filtered.groups.add(ie);break}n.current.filtered.count=he}function G(){var z,K,J;let ne=H();ne&&(((z=ne.parentElement)==null?void 0:z.firstChild)===ne&&((J=(K=ne.closest(Ed))==null?void 0:K.querySelector(pye))==null||J.scrollIntoView({block:"nearest"})),ne.scrollIntoView({block:"nearest"}))}function H(){var z;return(z=k.current)==null?void 0:z.querySelector(`${aq}[aria-selected="true"]`)}function L(){var z;return Array.from(((z=k.current)==null?void 0:z.querySelectorAll($$))||[])}function I(z){let K=L()[z];K&&P.setState("value",K.getAttribute(Cc))}function Y(z){var K;let J=H(),ne=L(),he=ne.findIndex(me=>me===J),ie=ne[he+z];(K=c.current)!=null&&K.loop&&(ie=he+z<0?ne[ne.length-1]:he+z===ne.length?ne[0]:ne[he+z]),ie&&P.setState("value",ie.getAttribute(Cc))}function W(z){let K=H(),J=K?.closest(Ed),ne;for(;J&&!ne;)J=z>0?Sye(J,Ed):Nye(J,Ed),ne=J?.querySelector($$);ne?P.setState("value",ne.getAttribute(Cc)):Y(z)}let O=()=>I(L().length-1),Q=z=>{z.preventDefault(),z.metaKey?O():z.altKey?W(1):Y(1)},q=z=>{z.preventDefault(),z.metaKey?I(0):z.altKey?W(-1):Y(-1)};return m.createElement(ft.div,{ref:t,tabIndex:-1,...S,"cmdk-root":"",onKeyDown:z=>{var K;(K=S.onKeyDown)==null||K.call(S,z);let J=z.nativeEvent.isComposing||z.keyCode===229;if(!(z.defaultPrevented||J))switch(z.key){case"n":case"j":{y&&z.ctrlKey&&Q(z);break}case"ArrowDown":{Q(z);break}case"p":case"k":{y&&z.ctrlKey&&q(z);break}case"ArrowUp":{q(z);break}case"Home":{z.preventDefault(),I(0);break}case"End":{z.preventDefault(),O();break}case"Enter":{z.preventDefault();let ne=H();if(ne){let he=new Event(PN);ne.dispatchEvent(he)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:R.inputId,id:R.labelId,style:Aye},d),Vv(e,z=>m.createElement(oq.Provider,{value:P},m.createElement(iq.Provider,{value:R},z))))}),mye=m.forwardRef((e,t)=>{var n,r;let a=ar(),i=m.useRef(null),o=m.useContext(lq),c=fp(),d=uq(e),f=(r=(n=d.current)==null?void 0:n.forceMount)!=null?r:o?.forceMount;Cl(()=>{if(!f)return c.item(a,o?.id)},[f]);let h=dq(a,i,[e.value,e.children,i],e.keywords),p=I_(),v=wo(E=>E.value&&E.value===h.current),x=wo(E=>f||c.filter()===!1?!0:E.search?E.filtered.items.get(a)>0:!0);m.useEffect(()=>{let E=i.current;if(!(!E||e.disabled))return E.addEventListener(PN,j),()=>E.removeEventListener(PN,j)},[x,e.onSelect,e.disabled]);function j(){var E,P;b(),(P=(E=d.current).onSelect)==null||P.call(E,h.current)}function b(){p.setState("value",h.current,!0)}if(!x)return null;let{disabled:y,value:S,onSelect:N,forceMount:_,keywords:A,...k}=e;return m.createElement(ft.div,{ref:zr(i,t),...k,id:a,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!v,"data-disabled":!!y,"data-selected":!!v,onPointerMove:y||c.getDisablePointerSelection()?void 0:b,onClick:y?void 0:j},e.children)}),gye=m.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...i}=e,o=ar(),c=m.useRef(null),d=m.useRef(null),f=ar(),h=fp(),p=wo(x=>a||h.filter()===!1?!0:x.search?x.filtered.groups.has(o):!0);Cl(()=>h.group(o),[]),dq(o,c,[e.value,e.heading,d]);let v=m.useMemo(()=>({id:o,forceMount:a}),[a]);return m.createElement(ft.div,{ref:zr(c,t),...i,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},n&&m.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:f},n),Vv(e,x=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},m.createElement(lq.Provider,{value:v},x))))}),vye=m.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=m.useRef(null),i=wo(o=>!o.search);return!n&&!i?null:m.createElement(ft.div,{ref:zr(a,t),...r,"cmdk-separator":"",role:"separator"})}),xye=m.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,i=I_(),o=wo(f=>f.search),c=wo(f=>f.selectedItemId),d=fp();return m.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),m.createElement(ft.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)}})}),yye=m.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,i=m.useRef(null),o=m.useRef(null),c=wo(f=>f.selectedItemId),d=fp();return m.useEffect(()=>{if(o.current&&i.current){let f=o.current,h=i.current,p,v=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let x=f.offsetHeight;h.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return v.observe(f),()=>{cancelAnimationFrame(p),v.unobserve(f)}}},[]),m.createElement(ft.div,{ref:zr(i,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:d.listId},Vv(e,f=>m.createElement("div",{ref:zr(o,d.listInnerRef),"cmdk-list-sizer":""},f)))}),bye=m.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:i,container:o,...c}=e;return m.createElement(Bg,{open:n,onOpenChange:r},m.createElement(qg,{container:o},m.createElement(_u,{"cmdk-overlay":"",className:a}),m.createElement(Au,{"aria-label":e.label,"cmdk-dialog":"",className:i},m.createElement(cq,{ref:t,...c}))))}),wye=m.forwardRef((e,t)=>wo(n=>n.filtered.count===0)?m.createElement(ft.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),jye=m.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...i}=e;return m.createElement(ft.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Vv(e,o=>m.createElement("div",{"aria-hidden":!0},o)))}),is=Object.assign(cq,{List:yye,Item:mye,Input:xye,Group:gye,Separator:vye,Dialog:bye,Empty:wye,Loading:jye});function Sye(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Nye(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function uq(e){let t=m.useRef(e);return Cl(()=>{t.current=e}),t}var Cl=typeof window>"u"?m.useEffect:m.useLayoutEffect;function _c(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function wo(e){let t=I_(),n=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,n,n)}function dq(e,t,n,r=[]){let a=m.useRef(),i=fp();return Cl(()=>{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(Cc,c),a.current=c}),a}var Cye=()=>{let[e,t]=m.useState(),n=_c(()=>new Map);return Cl(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function _ye(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Vv({asChild:e,children:t},n){return e&&m.isValidElement(t)?m.cloneElement(_ye(t),{ref:t.ref},n(t.props.children)):n(t)}var Aye={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const _l=m.forwardRef(({className:e,...t},n)=>s.jsx(is,{ref:n,className:Re("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));_l.displayName=is.displayName;const Al=m.forwardRef(({className:e,...t},n)=>s.jsxs("div",{className:"flex items-center border-b px-3","data-cmdk-input-wrapper":"",children:[s.jsx(qN,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),s.jsx(is.Input,{ref:n,className:Re("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})]}));Al.displayName=is.Input.displayName;const kl=m.forwardRef(({className:e,...t},n)=>s.jsx(is.List,{ref:n,className:Re("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));kl.displayName=is.List.displayName;const El=m.forwardRef((e,t)=>s.jsx(is.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));El.displayName=is.Empty.displayName;const Pl=m.forwardRef(({className:e,...t},n)=>s.jsx(is.Group,{ref:n,className:Re("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}));Pl.displayName=is.Group.displayName;const kye=m.forwardRef(({className:e,...t},n)=>s.jsx(is.Separator,{ref:n,className:Re("-mx-1 h-px bg-border",e),...t}));kye.displayName=is.Separator.displayName;const xs=m.forwardRef(({className:e,...t},n)=>s.jsx(is.Item,{ref:n,className:Re("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}));xs.displayName=is.Item.displayName;const D$={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:[]},L$={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"},F$=()=>({id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096}),Eye=()=>{const{agentName:e}=Ml(),t=Xs(),{agents:n,setAgents:r}=Ca(),{source:a}=On(),i=e==="new",o=e?decodeURIComponent(e):"",c=i?null:n.find(O=>O.id===o)??n.find(O=>O.name===o),[d,f]=m.useState(()=>c??F$()),[h,p]=m.useState(!1),[v,x]=m.useState(!1),[j,b]=m.useState({status:"idle"}),[y,S]=m.useState(!1),[N,_]=m.useState([]),[A,k]=m.useState(!1),[E,P]=m.useState(!1),[R,M]=m.useState(!1),D=m.useRef(null);m.useEffect(()=>{const O=i?`new:${o||"new"}`:`agt:${o}`;if(D.current!==O){if(i){f(F$()),D.current=O;return}c&&(f(c),D.current=O)}},[i,o,c]);const U=d.provider==="anthropic"||d.provider==="openai"||d.provider==="azure",F=Array.from(new Set([...D$[d.provider]||[],...N])),G=F.includes(d.model),H=R||!!d.model&&!G,L=async()=>{if(S(!0),d.provider==="google"||d.provider==="custom"){b({status:"unsupported"});return}b({status:"loading"});try{const O=await a.listProviderModels(d.provider);b({status:"success",items:O.items,source:O.source,kind:O.kind,testedAt:new Date().toISOString()})}catch(O){b({status:"error",message:O instanceof Error?O.message:String(O),testedAt:new Date().toISOString()})}},I=async()=>{if(!U){Me({title:"Provider discovery not supported",description:"Model discovery is available for Anthropic, OpenAI, and Azure OpenAI."});return}k(!0);try{const O=await a.listProviderModels(d.provider);_(O.items),Me({title:O.kind==="deployments"?"Deployments loaded":"Models loaded",description:`${O.items.length} ${O.kind} from ${O.source}`})}catch(O){Me({title:"Could not load provider models",description:String(O instanceof Error?O.message:O),variant:"destructive"})}finally{k(!1)}},Y=async()=>{if(!d.name.trim()){Me({title:"Name is required",variant:"destructive"});return}x(!0);try{if(i)await r([...n,d]),Me({title:"Agent created"}),t(`/libraries/agents/${encodeURIComponent(d.id)}`);else{const O=n.map(Q=>Q.id===c?.id?d:Q);await r(O),Me({title:"Agent saved"}),d.id!==o&&t(`/libraries/agents/${encodeURIComponent(d.id)}`,{replace:!0})}}finally{x(!1)}},W=async()=>{const O=n.filter(Q=>Q.id!==c?.id);await r(O),Me({title:"Agent deleted"}),t("/libraries/agents")};return!i&&!c?s.jsxs("div",{className:"space-y-4",children:[s.jsxs(Tt,{to:"/libraries/agents",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(go,{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(Tt,{to:"/libraries/agents",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(go,{className:"h-4 w-4"})," Agents"]}),s.jsx("h1",{className:"text-2xl font-bold",children:i?"New Agent":d.name})]}),!i&&s.jsxs(Z,{type:"button",onClick:()=>{L()},children:[s.jsx(VD,{className:"mr-2 h-4 w-4"}),"Test Connection"]})]}),y&&s.jsxs(nt,{children:[s.jsxs(Lt,{className:"flex-row items-center justify-between space-y-0",children:[s.jsx(Ft,{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(ns,{className:"h-4 w-4"})})]}),s.jsxs(rt,{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(jr,{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(qc,{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(O=>s.jsx("li",{className:"font-mono text-xs",children:O},O))})]}),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]}),L$[d.provider]&&s.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:["Hint: ",L$[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(nt,{children:[s.jsx(Lt,{children:s.jsx(Ft,{className:"text-base",children:"Configuration"})}),s.jsxs(rt,{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(Ve,{children:"Name"}),s.jsx(Et,{value:d.name,onChange:O=>f(Q=>({...Q,name:O.target.value})),placeholder:"e.g. GPT-4o"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Ve,{children:"Provider"}),s.jsxs(In,{value:d.provider,onValueChange:O=>f(Q=>({...Q,provider:O,model:D$[O]?.[0]||""})),children:[s.jsx(Tn,{children:s.jsx($n,{})}),s.jsxs(Rn,{children:[s.jsx(gt,{value:"openai",children:"OpenAI"}),s.jsx(gt,{value:"anthropic",children:"Anthropic"}),s.jsx(gt,{value:"azure",children:"Azure OpenAI"}),s.jsx(gt,{value:"google",children:"Google"}),s.jsx(gt,{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(Ve,{children:d.provider==="azure"?"Deployment":"Model"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(ho,{open:E,onOpenChange:P,children:[s.jsx(mo,{asChild:!0,children:s.jsxs(Z,{type:"button",variant:"outline",role:"combobox","aria-expanded":E,"aria-controls":"agent-model-command-list",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(tn,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(xi,{className:"w-[420px] p-0",align:"start",children:s.jsxs(_l,{children:[s.jsx(Al,{placeholder:`Search ${d.provider==="azure"?"deployments":"models"}...`}),s.jsxs(kl,{id:"agent-model-command-list",children:[s.jsxs(El,{children:["No ",d.provider==="azure"?"deployments":"models"," found."]}),s.jsxs(Pl,{heading:d.provider==="azure"?"Deployments":"Models",children:[F.map(O=>s.jsxs(xs,{value:O,onSelect:Q=>{f(q=>({...q,model:Q})),M(!1),P(!1)},children:[s.jsx(qc,{className:Re("mr-2 h-4 w-4",d.model===O?"opacity-100":"opacity-0")}),s.jsx("span",{className:"font-mono text-xs",children:O})]},O)),s.jsx(xs,{value:"__custom_model_id__",onSelect:()=>{M(!0),P(!1)},children:s.jsx("span",{className:"font-medium",children:d.provider==="azure"?"Custom deployment ID...":"Custom model ID..."})})]})]})]})})]}),U&&s.jsxs(Z,{type:"button",variant:"outline",size:"sm",className:"h-9 shrink-0 text-xs",onClick:()=>{I()},disabled:A,title:d.provider==="azure"?"Fetch Azure OpenAI deployments":`Fetch ${d.provider} models`,children:[A?s.jsx(jr,{className:"mr-1 h-3 w-3 animate-spin"}):s.jsx(zs,{className:"mr-1 h-3 w-3"}),d.provider==="azure"?"Fetch Deployments":"Fetch Models"]})]}),H&&s.jsx(Et,{value:d.model,onChange:O=>f(Q=>({...Q,model:O.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(Ve,{children:"Max Tokens"}),s.jsx(Et,{type:"number",min:1,max:128e3,value:d.maxTokens,onChange:O=>f(Q=>({...Q,maxTokens:parseInt(O.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(Ve,{children:"Max Turns"}),s.jsx(Et,{type:"number",min:1,max:50,value:d.maxTurns??"",onChange:O=>{const Q=O.target.value.trim();f(q=>({...q,maxTurns:Q&&parseInt(Q)||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(Ve,{children:"Temperature"}),s.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:d.temperature.toFixed(2)})]}),s.jsx(H8,{value:[d.temperature],onValueChange:([O])=>f(Q=>({...Q,temperature:O})),min:0,max:2,step:.01})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Ve,{children:"System Prompt"}),s.jsx(wa,{value:d.systemPrompt||"",onChange:O=>f(Q=>({...Q,systemPrompt:O.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(Z,{type:"button",variant:"destructive",size:"sm",onClick:()=>p(!0),children:"Delete"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Z,{type:"button",variant:"outline",size:"sm",onClick:()=>t("/libraries/agents"),children:"Cancel"}),s.jsxs(Z,{type:"button",size:"sm",onClick:()=>{Y()},disabled:v,children:[v&&s.jsx(jr,{className:"mr-2 h-4 w-4 animate-spin"}),i?"Create Agent":"Save"]})]})]})]})]}),s.jsx(ja,{open:h,onOpenChange:p,children:s.jsxs(Us,{children:[s.jsxs(Ws,{children:[s.jsx(Hs,{children:"Delete agent?"}),s.jsxs(Ks,{children:["This will permanently remove the agent ",s.jsx("span",{className:"font-mono",children:d.name}),". This action cannot be undone."]})]}),s.jsxs(Vs,{children:[s.jsx(Ys,{children:"Cancel"}),s.jsx(Gs,{onClick:()=>{W()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},z$="mcplab.resultAssistantScenarioHandoff",B$=()=>{const{testCaseId:e}=Ml(),[t,n]=Pi(),r=Xs(),{source:a}=On(),{scenarios:i,setScenarios:o,agents:c,servers:d,reload:f,loading:h}=Ca(),[p,v]=m.useState(""),[x,j]=m.useState("all"),[b,y]=m.useState("name"),[S,N]=m.useState("asc"),[_,A]=m.useState(""),[k,E]=m.useState(null),[P,R]=m.useState("idle"),[M,D]=m.useState(""),[U,F]=m.useState(""),[G,H]=m.useState(0),[L,I]=m.useState(null),Y=m.useRef(null),W=m.useRef(!1),O=m.useRef(!1),Q=m.useRef(null),q=m.useRef(0),z=m.useRef(i);z.current=i;const K=m.useRef(o);K.current=o;const J=e?decodeURIComponent(e):void 0,ne=t.get("returnTo")?.trim()||"",he=ne.startsWith("/")?ne:"",ie=J?i.findIndex(Se=>Se.id===J):-1,me=ie>=0?i[ie]:void 0,se=async Se=>{if(!me||ie<0||!Se)return;const Ae=[...i];Ae[ie]=Se,await o(Ae)},ge=async()=>{const Se=Q.current;if(!Se||!me)return;if(W.current){O.current=!0;return}W.current=!0,O.current=!1;const Ae=++q.current;R("saving"),D("");try{await se(Se),Ae===q.current&&R("saved")}catch(Je){const dt=Je instanceof Error?Je.message:String(Je);Ae===q.current&&(R("error"),D(dt)),Me({title:"Could not save scenario",description:dt,variant:"destructive"})}finally{W.current=!1,O.current&&(O.current=!1,ge())}},Oe=Se=>{Q.current=Se,R("dirty"),D(""),Y.current&&window.clearTimeout(Y.current),Y.current=window.setTimeout(()=>{Y.current=null,ge()},700)},fe=async()=>{const Se=`scn-${Date.now()}`;let Ae=Se,Je=1;for(;i.some(Pt=>Pt.id===Ae);)Ae=`${Se}-${Je}`,Je+=1;const dt={id:Ae,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};await o([...i,dt]),r(`/libraries/test-cases/${encodeURIComponent(Ae)}`),Me({title:"Test case created",description:`Opened ${Ae} for editing.`})},xe=Se=>{const Ae=(Se||`scn-${Date.now()}`).trim().replace(/\s+/g,"-").replace(/[^a-zA-Z0-9_-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")||`scn-${Date.now()}`;let Je=Ae,dt=1;for(;i.some(Pt=>Pt.id===Je);)Je=`${Ae}-${dt}`,dt+=1;return Je},we=async(Se,Ae=!1)=>{const Je=xe(`${Se.id}-copy`),dt={...structuredClone(Se),id:Je,name:Se.name?`${Se.name} (Copy)`:""};await o([...i,dt]),Me({title:"Test case duplicated",description:`Created ${dt.id}.`}),Ae&&r(`/libraries/test-cases/${encodeURIComponent(dt.id)}`)},ot=async Se=>{Y.current&&(window.clearTimeout(Y.current),Y.current=null);const Ae=i.filter(Je=>Je.id!==Se.id);await o(Ae),Me({title:"Test case deleted",description:`${Se.id} was removed.`}),me?.id===Se.id&&(E(null),Q.current=null,R("idle"),D(""),r("/libraries/test-cases"))},lt=Se=>Se.map(Ae=>d.find(Je=>Je.id===Ae)).filter(Boolean).map(Ae=>Ae?.name||Ae?.id).filter(Boolean),ut=m.useMemo(()=>{const Se=new Set;for(const Ae of i)for(const Je of lt(Ae.serverIds))Se.add(Je);return Array.from(Se).sort((Ae,Je)=>Ae.localeCompare(Je))},[i,d]),At=m.useMemo(()=>{const Se=p.trim().toLowerCase(),Ae=i.filter(Je=>{const dt=(Je.name||"").toLowerCase(),Pt=Je.id.toLowerCase(),Xt=(Je.prompt||"").toLowerCase(),kt=lt(Je.serverIds);return x!=="all"&&!kt.includes(x)?!1:Se?dt.includes(Se)||Pt.includes(Se)||Xt.includes(Se)||kt.some(nn=>nn.toLowerCase().includes(Se)):!0});return Ae.sort((Je,dt)=>{const Pt=lt(Je.serverIds),Xt=lt(dt.serverIds);let kt=0;switch(b){case"id":kt=Je.id.localeCompare(dt.id);break;case"servers":kt=Pt.length-Xt.length;break;case"evalRules":kt=Je.evalRules.length-dt.evalRules.length;break;case"extractRules":kt=Je.extractRules.length-dt.extractRules.length;break;default:kt=(Je.name||Je.id).localeCompare(dt.name||dt.id);break}return kt===0&&(kt=Je.id.localeCompare(dt.id)),S==="asc"?kt:-kt}),Ae},[i,p,x,b,S,d]);m.useEffect(()=>{let Se=!0;return a.getWorkspaceSettings().then(Ae=>{!Se||!Ae||A(Ae.scenarioAssistantAgentName??"")}).catch(()=>{Se&&A("")}),()=>{Se=!1}},[a]),m.useEffect(()=>{if(J&&t.get("assistantHandoff")==="1")try{const Se=window.sessionStorage.getItem(z$);if(!Se)return;const Ae=JSON.parse(Se);if(!Ae||Ae.scenarioId!==J||!Ae.prompt)return;F(String(Ae.prompt)),H(Date.now()),window.sessionStorage.removeItem(z$);const Je=new URLSearchParams(t);Je.delete("assistantHandoff"),n(Je,{replace:!0}),Me({title:"Suggestion sent to Scenario Assistant",description:"Review the suggestion and apply changes in the scenario editor."})}catch{}},[J,t,n]),m.useEffect(()=>{const Se=Y.current!==null||W.current,Ae=Q.current;if(me&&Ae?.id===me.id&&Se)return;if(!!Ae&&Ae.id!==me?.id&&(Y.current!==null||O.current)){Y.current!==null&&(window.clearTimeout(Y.current),Y.current=null),O.current=!1;const dt=z.current,Pt=dt.findIndex(Xt=>Xt.id===Ae.id);if(Pt>=0){const Xt=[...dt];Xt[Pt]=Ae,K.current(Xt)}}Y.current&&(window.clearTimeout(Y.current),Y.current=null),W.current=!1,O.current=!1,me?(E(structuredClone(me)),Q.current=structuredClone(me),R("idle"),D("")):(E(null),Q.current=null,R("idle"),D(""))},[me]),m.useEffect(()=>()=>{Y.current&&window.clearTimeout(Y.current)},[]);const Xe=_||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(LD,{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:[me&&s.jsxs(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>r("/libraries/test-cases"),children:[s.jsx(go,{className:"mr-2 h-4 w-4"}),"Back to Overview"]}),me&&he&&s.jsx(Z,{type:"button",size:"sm",variant:"outline",asChild:!0,children:s.jsxs(Tt,{to:he,children:[s.jsx(go,{className:"mr-2 h-4 w-4"}),"Back to evaluation"]})}),s.jsxs(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>{f()},disabled:h,children:[s.jsx(zs,{className:"mr-2 h-4 w-4"}),"Refresh"]}),!me&&s.jsxs(Z,{type:"button",size:"sm",onClick:()=>{fe()},children:[s.jsx(yi,{className:"mr-1.5 h-3.5 w-3.5"}),"Add Test Case"]})]})]}),!me&&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(Ve,{className:"text-xs",children:"Search"}),s.jsxs("div",{className:"relative",children:[s.jsx(qN,{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(Et,{value:p,onChange:Se=>v(Se.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(Ve,{className:"text-xs",children:"Server Filter"}),s.jsxs(In,{value:x,onValueChange:j,children:[s.jsx(Tn,{className:"h-8 text-xs",children:s.jsx($n,{})}),s.jsxs(Rn,{children:[s.jsx(gt,{value:"all",children:"All servers"}),ut.map(Se=>s.jsx(gt,{value:Se,children:Se},Se))]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Ve,{className:"text-xs",children:"Sort By"}),s.jsxs(In,{value:b,onValueChange:Se=>y(Se),children:[s.jsx(Tn,{className:"h-8 text-xs",children:s.jsx($n,{})}),s.jsxs(Rn,{children:[s.jsx(gt,{value:"name",children:"Name"}),s.jsx(gt,{value:"id",children:"ID"}),s.jsx(gt,{value:"servers",children:"# Servers"}),s.jsx(gt,{value:"evalRules",children:"# Eval Rules"}),s.jsx(gt,{value:"extractRules",children:"# Extract Rules"})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Ve,{className:"text-xs",children:"Direction"}),s.jsxs(In,{value:S,onValueChange:Se=>N(Se),children:[s.jsx(Tn,{className:"h-8 w-28 text-xs",children:s.jsx($n,{})}),s.jsxs(Rn,{children:[s.jsx(gt,{value:"asc",children:"Ascending"}),s.jsx(gt,{value:"desc",children:"Descending"})]})]})]})]}),s.jsx(nt,{children:s.jsxs(rt,{className:"space-y-3 pt-6",children:[s.jsxs("div",{className:"text-xs text-muted-foreground",children:["Showing ",At.length," of ",i.length," test case",i.length!==1?"s":"","."]}),J&&!me&&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:J})," was not found."]}),i.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No library test cases yet."}):At.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:At.map(Se=>{const Ae=J===Se.id,Je=`/libraries/test-cases/${encodeURIComponent(Se.id)}`,dt=lt(Se.serverIds);return s.jsx("div",{className:`rounded-lg border p-3 ${Ae?"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(Tt,{to:Je,className:"font-medium truncate hover:underline",children:Se.name||Se.id}),s.jsx(st,{variant:"outline",className:"font-mono text-[10px]",children:Se.id}),Ae&&s.jsx(st,{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:[dt.length," server",dt.length!==1?"s":""]}),s.jsxs("span",{children:[Se.evalRules.length," eval rule",Se.evalRules.length!==1?"s":""]}),s.jsxs("span",{children:[Se.extractRules.length," extract rule",Se.extractRules.length!==1?"s":""]})]}),dt.length>0&&s.jsx("div",{className:"flex flex-wrap gap-1",children:dt.map(Pt=>s.jsx(st,{variant:"secondary",className:"text-[10px]",children:Pt},`${Se.id}-${Pt}`))})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(Z,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>I(Se),children:[s.jsx(Bs,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>{we(Se)},children:[s.jsx(ss,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsx(Z,{type:"button",size:"sm",variant:Ae?"default":"outline",asChild:!0,children:s.jsxs(Tt,{to:Je,children:[s.jsx(wg,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})})]})]})},Se.id)})})]})})]}),me&&k?s.jsxs(nt,{children:[s.jsx(Lt,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs(Ft,{className:"text-base",children:["Edit Test Case ·"," ",s.jsx("code",{className:"font-mono text-muted-foreground",children:me.id})]}),s.jsx(st,{variant:"outline",className:`text-[10px] ${P==="saving"?"border-amber-300 text-amber-700":P==="saved"?"border-emerald-300 text-emerald-700":P==="error"?"border-destructive/40 text-destructive":P==="dirty"?"border-sky-300 text-sky-700":""}`,children:P==="saving"?"Saving...":P==="saved"?"Saved":P==="error"?"Save failed":P==="dirty"?"Unsaved changes":"Ready"})]}),P==="error"&&M&&s.jsx("div",{className:"text-[11px] text-destructive",children:M})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>{we(k,!0)},children:[s.jsx(ss,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsxs(Z,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>I(k),children:[s.jsx(Bs,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]})]})]})}),s.jsx(rt,{className:"pt-3",children:s.jsx(CN,{scenarios:[k],agents:c,servers:d,defaultAssistantAgentName:Xe,assistantInitialPromptByScenarioId:U&&k?.id?{[k.id]:U}:void 0,assistantAutoOpenNonceByScenarioId:k?.id&&G?{[k.id]:G}:void 0,onChange:Se=>{const Ae=Se[0];Ae&&(E(Ae),Oe(Ae))},allowAdd:!1})})]}):null,s.jsx(ja,{open:!!L,onOpenChange:Se=>!Se&&I(null),children:s.jsxs(Us,{children:[s.jsxs(Ws,{children:[s.jsx(Hs,{children:"Delete test case?"}),s.jsxs(Ks,{children:["This will permanently remove"," ",s.jsx("span",{className:"font-medium",children:L?.name||L?.id})," ","from the library. This action cannot be undone."]})]}),s.jsxs(Vs,{children:[s.jsx(Ys,{children:"Cancel"}),s.jsx(Gs,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{L&&(ot(L),I(null))},children:"Delete Test Case"})]})]})})]})},Pye=()=>{const{source:e}=On(),{agents:t,reload:n,loading:r}=Ca(),[a,i]=m.useState(!1),[o,c]=m.useState(!1),[d,f]=m.useState(""),[h,p]=m.useState(""),[v,x]=m.useState("1"),j=m.useMemo(()=>d||t[0]?.name||"",[d,t]),b=m.useCallback(async()=>{i(!0);try{const A=await e.getWorkspaceSettings();f(A?.scenarioAssistantAgentName??""),p(A?.evaluationJudgeAgentName??""),x(String(A?.defaultQueueWorkers??1))}catch(A){f(""),p(""),x("1"),Me({title:"Could not load settings",description:A instanceof Error?A.message:String(A),variant:"destructive"})}finally{i(!1)}},[e]);m.useEffect(()=>{b()},[b]);const y=async A=>{const k=d;f(A),c(!0);try{await e.updateWorkspaceSettings({scenarioAssistantAgentName:A||void 0}),Me({title:"Settings updated",description:A?`Default assistant agent set to ${A}.`:"Default assistant agent cleared (will use first available agent by default)."})}catch(E){f(k),Me({title:"Could not save settings",description:E instanceof Error?E.message:String(E),variant:"destructive"})}finally{c(!1)}},S=async A=>{const k=v;x(A),c(!0);try{await e.updateWorkspaceSettings({defaultQueueWorkers:Number(A)}),Me({title:"Settings updated",description:`Evaluation workers set to ${A}.`})}catch(E){x(k),Me({title:"Could not save settings",description:E instanceof Error?E.message:String(E),variant:"destructive"})}finally{c(!1)}},N=async A=>{const k=h;p(A),c(!0);try{await e.updateWorkspaceSettings({evaluationJudgeAgentName:A||void 0}),Me({title:"Settings updated",description:A?`Default evaluation judge set to ${A}.`:"Default evaluation judge cleared."})}catch(E){p(k),Me({title:"Could not save settings",description:E instanceof Error?E.message:String(E),variant:"destructive"})}finally{c(!1)}},_=async()=>{await Promise.all([n(),b()])};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(UN,{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(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>{_()},disabled:r||a,children:[s.jsx(zs,{className:"mr-2 h-4 w-4"}),"Refresh"]})]}),s.jsxs(nt,{children:[s.jsxs(Lt,{className:"pb-3",children:[s.jsx(Ft,{className:"text-base",children:"Assistant Defaults"}),s.jsx(Er,{children:"Default assistant agent used across assistant flows. If unset, MCP Lab uses the first available agent automatically."})]}),s.jsxs(rt,{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(Ve,{className:"text-xs",children:"Default Assistant Agent"}),s.jsxs(In,{value:j||"__none__",onValueChange:A=>{y(A==="__none__"?"":A)},disabled:o,children:[s.jsx(Tn,{className:"h-9 text-sm",children:s.jsx($n,{placeholder:"Select assistant agent"})}),s.jsxs(Rn,{children:[s.jsx(gt,{value:"__none__",children:"None (use first agent)"}),t.map(A=>s.jsxs(gt,{value:A.id,children:[A.name||A.id," · ",A.model]},A.id))]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Applies to the assistant flows that use the workspace default. MCP Evaluation editors can still override the assistant agent from their evaluation context."})]}),s.jsx("div",{className:"text-xs text-muted-foreground",children:"Saved in workspace settings"})]})]}),s.jsxs(nt,{children:[s.jsxs(Lt,{className:"pb-3",children:[s.jsx(Ft,{className:"text-base",children:"Evaluation Judge"}),s.jsx(Er,{children:"Default judge agent used by semantic agent checks during scenario evaluation runs."})]}),s.jsxs(rt,{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(Ve,{className:"text-xs",children:"Default Evaluation Judge"}),s.jsxs(In,{value:h||"__none__",onValueChange:A=>{N(A==="__none__"?"":A)},disabled:o,children:[s.jsx(Tn,{className:"h-9 text-sm",children:s.jsx($n,{placeholder:"Select evaluation judge"})}),s.jsxs(Rn,{children:[s.jsx(gt,{value:"__none__",children:"None"}),t.map(A=>s.jsxs(gt,{value:A.id,children:[A.name||A.id," · ",A.model]},A.id))]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Used by agent checks that semantically evaluate the final answer. If unset, runs with agent checks will fail before execution."})]}),s.jsx("div",{className:"text-xs text-muted-foreground",children:"Saved in workspace settings"})]})]}),s.jsxs(nt,{children:[s.jsxs(Lt,{className:"pb-3",children:[s.jsx(Ft,{className:"text-base",children:"Evaluation Queue"}),s.jsx(Er,{children:"Control how many queued evaluation runs may execute in parallel."})]}),s.jsxs(rt,{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(Ve,{className:"text-xs",children:"Evaluation workers"}),s.jsxs(In,{value:v,onValueChange:A=>{S(A)},disabled:o,children:[s.jsx(Tn,{className:"h-9 text-sm",children:s.jsx($n,{placeholder:"Select worker count"})}),s.jsx(Rn,{children:Array.from({length:8},(A,k)=>String(k+1)).map(A=>s.jsx(gt,{value:A,children:A},A))})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Number of queued evaluation runs that may execute in parallel."})]}),s.jsx("div",{className:"text-xs text-muted-foreground",children:"Saved in workspace settings"})]})]})]})},Tye=Ol("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"}}),fl=m.forwardRef(({className:e,variant:t,...n},r)=>s.jsx("div",{ref:r,role:"alert",className:Re(Tye({variant:t}),e),...n}));fl.displayName="Alert";const pl=m.forwardRef(({className:e,...t},n)=>s.jsx("h5",{ref:n,className:Re("mb-1 font-medium leading-none tracking-tight",e),...t}));pl.displayName="AlertTitle";const hl=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Re("text-sm [&_p]:leading-relaxed",e),...t}));hl.displayName="AlertDescription";const Rye="127.0.0.1",Oye=3011,Mye="/mcp",Iye=`http://${Rye}:${Oye}${Mye}`;function $ye(e){return navigator.clipboard.writeText(e)}function fq({text:e,label:t}){const[n,r]=m.useState(!1),a=async()=>{try{await $ye(e),r(!0),Me({title:"Copied",description:`${t} copied to clipboard.`}),window.setTimeout(()=>r(!1),1500)}catch(i){Me({title:"Copy failed",description:i instanceof Error?i.message:String(i),variant:"destructive"})}};return s.jsxs(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>{a()},children:[s.jsx(ss,{className:"mr-2 h-3.5 w-3.5"}),n?"Copied":"Copy"]})}function iS({label:e,value:t,copyText:n,valueClassName:r=""}){return s.jsx("div",{className:"rounded-lg border bg-muted/20 p-3",children:s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground",children:e}),s.jsx("div",{className:`mt-1 break-all text-sm font-medium ${r}`,children:t})]}),n&&s.jsx(fq,{text:n,label:e})]})})}function q$({title:e,description:t,code:n,iconSrc:r}){return s.jsxs(nt,{children:[s.jsxs(Lt,{className:"pb-3",children:[s.jsxs(Ft,{className:"flex items-center gap-2 text-base",children:[s.jsx("img",{src:r,alt:"","aria-hidden":"true",className:"h-4 w-4"}),e]}),s.jsx(Er,{children:t})]}),s.jsxs(rt,{className:"space-y-3",children:[s.jsx("pre",{className:"max-h-80 overflow-auto rounded-lg border bg-muted/30 p-3 text-xs whitespace-pre-wrap break-all",children:n}),s.jsx("div",{className:"flex justify-end",children:s.jsx(fq,{text:n,label:e})})]})]})}const Dye=()=>{const{source:e}=On(),[t,n]=m.useState(!0),[r,a]=m.useState(null),i=m.useCallback(async()=>{n(!0);try{const p=await e.health();a(p)}catch(p){a(null),Me({title:"Could not load MCP connection info",description:p instanceof Error?p.message:String(p),variant:"destructive"})}finally{n(!1)}},[e]);m.useEffect(()=>{i()},[i]);const o=r?.mcp?.enabled?r.mcp:null,c=o?.directUrl??Iye,d=o?.transport??"streamable-http",f=m.useMemo(()=>JSON.stringify({mcpServers:{mcplab:{command:"npx",args:["mcp-remote",c]}}},null,2),[c]),h=m.useMemo(()=>JSON.stringify({name:"mcplab",transport:d,url:c},null,2),[c,d]);return 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(CS,{className:"h-6 w-6"}),"MCP Connection Info"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Copy the local MCPLab MCP server details into Claude Desktop or any MCP-capable client."})]}),s.jsxs(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>{i()},disabled:t,children:[s.jsx(zs,{className:"mr-2 h-4 w-4"}),"Refresh"]})]}),!o&&s.jsxs(fl,{children:[s.jsx(CS,{className:"h-4 w-4"}),s.jsx(pl,{children:"MCP server not reported"}),s.jsx(hl,{children:"The page is showing the default local connection details. Start MCP Lab in dev mode to see the live runtime endpoint and package version."})]}),s.jsxs("div",{className:"grid gap-6 xl:grid-cols-[1.1fr_0.9fr]",children:[s.jsxs(nt,{children:[s.jsxs(Lt,{className:"pb-3",children:[s.jsx(Ft,{className:"text-base",children:"Connection Details"}),s.jsx(Er,{children:"The local server is exposed over streamable HTTP."})]}),s.jsx(rt,{className:"space-y-3",children:s.jsxs("div",{className:"grid gap-3",children:[s.jsx(iS,{label:"Direct MCP URL",value:c,copyText:c}),s.jsx(iS,{label:"Transport",value:d}),s.jsx(iS,{label:"Authentication",value:"none"})]})})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsx(q$,{title:"Claude Desktop",description:"Use mcp-remote to bridge Claude Desktop to the local streamable HTTP MCP server.",code:f,iconSrc:"/icons/claude-color.svg"}),s.jsx(q$,{title:"OpenAI / MCP-capable client",description:"Use this endpoint block in any client or adapter that accepts a single MCP-over-HTTP server.",code:h,iconSrc:"/icons/openai.svg"})]})]})]})};function Lye(e,t=[]){let n=[];function r(i,o){const c=m.createContext(o);c.displayName=i+"Context";const d=n.length;n=[...n,o];const f=p=>{const{scope:v,children:x,...j}=p,b=v?.[e]?.[d]||c,y=m.useMemo(()=>j,Object.values(j));return s.jsx(b.Provider,{value:y,children:x})};f.displayName=i+"Provider";function h(p,v){const x=v?.[e]?.[d]||c,j=m.useContext(x);if(j)return j;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[f,h]}const a=()=>{const i=n.map(o=>m.createContext(o));return function(c){const d=c?.[e]||i;return m.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return a.scopeName=e,[r,Fye(a,...t)]}function Fye(...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 m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var zye=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],pq=zye.reduce((e,t)=>{const n=$g(`Primitive.${t}`),r=m.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}},{}),$_="Progress",D_=100,[Bye]=Lye($_),[qye,Uye]=Bye($_),hq=m.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:a,getValueLabel:i=Wye,...o}=e;(a||a===0)&&!U$(a)&&console.error(Vye(`${a}`,"Progress"));const c=U$(a)?a:D_;r!==null&&!W$(r,c)&&console.error(Hye(`${r}`,"Progress"));const d=W$(r,c)?r:null,f=pg(d)?i(d,c):void 0;return s.jsx(qye,{scope:n,value:d,max:c,children:s.jsx(pq.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":pg(d)?d:void 0,"aria-valuetext":f,role:"progressbar","data-state":vq(d,c),"data-value":d??void 0,"data-max":c,...o,ref:t})})});hq.displayName=$_;var mq="ProgressIndicator",gq=m.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,a=Uye(mq,n);return s.jsx(pq.div,{"data-state":vq(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...r,ref:t})});gq.displayName=mq;function Wye(e,t){return`${Math.round(e/t*100)}%`}function vq(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function pg(e){return typeof e=="number"}function U$(e){return pg(e)&&!isNaN(e)&&e>0}function W$(e,t){return pg(e)&&!isNaN(e)&&e<=t&&e>=0}function Vye(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${D_}\`.`}function Hye(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
138
|
+
- a positive number
|
|
139
|
+
- less than the value passed to \`max\` (or ${D_} if no \`max\` prop is set)
|
|
140
|
+
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
141
|
+
|
|
142
|
+
Defaulting to \`null\`.`}var xq=hq,Kye=gq;const Hv=m.forwardRef(({className:e,value:t,...n},r)=>s.jsx(xq,{ref:r,className:Re("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:s.jsx(Kye,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Hv.displayName=xq.displayName;function yq(e){const t=e.toLowerCase();return t.includes("side-effectful prefix")||t.includes("destructive behavior")||t.includes("destructivehint")||t.includes("non-read-only behavior")||t.includes("readonlyhint: false")||t.includes("additive behavior")}function V$(e){try{return JSON.stringify(e,null,2)}catch{return"[schema not serializable]"}}const Xo=["critical","high","medium","low","info"];function Lh(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 Gye(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 H$(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"tool"}async function oS(e,t){const n=typeof t=="string"?t:JSON.stringify(t,null,2);try{await navigator.clipboard.writeText(n),Me({title:`${e} copied`})}catch(r){Me({title:`Could not copy ${e.toLowerCase()}`,description:r instanceof Error?r.message:String(r),variant:"destructive"})}}function lS({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(T9,{className:"h-3.5 w-3.5"}),"Suggested improvement"]}),s.jsx("p",{children:e})]})}function Yye({label:e,reason:t,variantClassName:n}){return s.jsx(ji,{delayDuration:0,children:s.jsxs(Si,{children:[s.jsx(Ni,{asChild:!0,children:s.jsx(st,{variant:"outline",className:n,children:e})}),s.jsx(qa,{className:"max-w-sm text-xs",children:s.jsx("p",{children:t})})]})})}function L_(e){const t=[],n=(r,a)=>{t.push(`#### ${r}`),t.push("```json");try{t.push(JSON.stringify(a,null,2))}catch{t.push('"[schema not serializable]"')}t.push("```")};if(t.push("# MCP Tool Analysis Report",""),t.push(`- Created: ${e.createdAt}`),t.push(`- Assistant Agent: ${e.assistantAgentName}`),t.push(`- Assistant Model: ${e.assistantAgentModel}`),e.mcpServerVersions&&Object.keys(e.mcpServerVersions).length>0){const r=Object.entries(e.mcpServerVersions).map(([a,i])=>`${a}: ${i??"unknown"}`).join(", ");t.push(`- MCP Server Versions: ${r}`)}t.push(`- Modes: ${[e.modes.metadataReview?"metadata review":null,e.modes.deeperAnalysis?"deeper analysis":null].filter(Boolean).join(" + ")}`),t.push("","## Summary"),t.push(`- Servers analyzed: ${e.summary.serversAnalyzed}`),t.push(`- Tools analyzed: ${e.summary.toolsAnalyzed}`),t.push(`- Tools skipped: ${e.summary.toolsSkipped}`,"");for(const r of e.servers){t.push(`## Server: ${r.serverName}`),r.warnings.length>0&&t.push(...r.warnings.map(a=>`- Warning: ${a}`),"");for(const a of r.tools){if(t.push(`### ${a.publicToolName}`),a.title&&t.push(`- Title: ${a.title}`),t.push(`- Safety: ${a.safetyClassification} (${a.classificationReason})`),a.inputSchema!==void 0&&n("Input schema",a.inputSchema),a.outputSchema!==void 0&&n("Output schema",a.outputSchema),a.metadataReview?.issues.length){t.push("#### Metadata issues");for(const i of a.metadataReview.issues)t.push(` - [${i.severity}] ${i.title}: ${i.detail}`)}if(a.deeperAnalysis)if(!a.deeperAnalysis.attempted)t.push(`- Deeper analysis: skipped (${a.deeperAnalysis.skippedReason??"unknown"})`);else{t.push(`- Deeper analysis sample calls: ${a.deeperAnalysis.sampleCalls.length}`);for(const i of a.deeperAnalysis.sampleCalls){t.push(` - Call ${i.callIndex}: ${i.ok?"ok":"error"}${i.durationMs?` (${i.durationMs}ms)`:""}`),i.error&&t.push(` - Error: ${i.error}`);for(const o of i.observations)t.push(` - ${o}`)}}if(a.overallRecommendations.length>0){t.push("#### Recommendations");for(const i of a.overallRecommendations)t.push(` - ${i}`)}if(a.metadataReview?.evalReadinessNotes.length){t.push("#### Agent/Eval readiness notes");for(const i of a.metadataReview.evalReadinessNotes)t.push(` - ${i}`)}t.push("")}}return`${t.join(`
|
|
143
|
+
`)}
|
|
144
|
+
`}function bq({report:e}){const[t,n]=Pi(),[r,a]=m.useState([...Xo]),[i,o]=m.useState(new Set),[c,d]=m.useState(""),[f,h]=m.useState(!1),p=t.get("groupBy")==="severity"?"severity":"tool",v=m.useRef(null),x=c.trim().toLowerCase(),j=m.useMemo(()=>new Set(r),[r]),b=R=>{a(M=>{const D=M.includes(R)?M.filter(U=>U!==R):[...M,R];return D.length===0?[...Xo]:D})},y=R=>{const M=new URLSearchParams(t);R==="severity"?M.set("groupBy","severity"):M.delete("groupBy"),n(M,{replace:!0})},S=m.useMemo(()=>{const R={critical:[],high:[],medium:[],low:[],info:[]};for(const M of e.servers)for(const D of M.tools){const U=`tool-${H$(`${M.serverName}-${D.publicToolName}`)}`,F=`${M.serverName}::${D.publicToolName}`,G=D.publicToolName.split("::").pop()??D.publicToolName;for(const H of D.metadataReview?.issues??[]){const L=H.severity;R[L].push({key:`${F}-metadata-${H.id}`,toolAnchorId:U,toolLabel:F,toolDisplayName:G,sourceLabel:"Metadata review",issue:{id:H.id,title:H.title,detail:H.detail,severity:L,suggestion:H.suggestion}})}for(const H of D.deeperAnalysis?.sampleCalls??[])for(const L of H.issues){const I=L.severity;R[I].push({key:`${F}-call-${H.callIndex}-${L.id}`,toolAnchorId:U,toolLabel:F,toolDisplayName:G,sourceLabel:`Sample call ${H.callIndex}`,issue:{id:L.id,title:L.title,detail:L.detail,severity:I,suggestion:L.suggestion}})}}return R},[e.servers]),N=m.useMemo(()=>Array.from(new Set(e.servers.flatMap(R=>R.tools.map(M=>M.publicToolName)).map(R=>R.split("::").pop()??R))).sort((R,M)=>R.localeCompare(M)),[e.servers]),_=R=>x.length===0?!0:(R.toLowerCase().split("::").pop()??R.toLowerCase()).includes(x),A=R=>{if(!v.current)return;v.current.querySelectorAll("details").forEach(D=>{D.open=R})},k=()=>o(new Set(Xo)),E=()=>o(new Set),P=R=>{o(M=>{const D=new Set(M);return D.has(R)?D.delete(R):D.add(R),D})};return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[s.jsx(nt,{children:s.jsxs(rt,{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(nt,{children:s.jsxs(rt,{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(nt,{children:s.jsxs(rt,{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(nt,{children:[s.jsxs(Lt,{className:"pb-3",children:[s.jsx(Ft,{className:"text-base",children:"Analysis Overview"}),s.jsx(Er,{children:"Visual breakdown of findings by severity. Click badges to filter the report."})]}),s.jsx(rt,{children:s.jsxs("div",{className:"flex flex-wrap gap-2",children:[Xo.filter(R=>e.summary.issueCounts[R]>0).map(R=>{const M=j.has(R);return s.jsx("button",{type:"button",onClick:()=>b(R),className:"rounded-full","aria-pressed":M,children:s.jsxs(st,{variant:"outline",className:`capitalize font-normal ${M?Lh(R):Gye(R)} ${M?"ring-1 ring-current":"opacity-70"}`,children:[R,": ",e.summary.issueCounts[R]]})},R)}),s.jsx(Z,{type:"button",size:"sm",variant:"ghost",onClick:()=>a([...Xo]),className:"h-7 px-2 text-xs",children:"Reset"})]})})]}),s.jsxs("div",{className:"space-y-0",children:[s.jsx(Dv,{value:p,onValueChange:R=>{(R==="tool"||R==="severity")&&y(R)},className:"min-w-0 px-3 pt-1",children:s.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-2 border-b",children:[s.jsxs(up,{className:"h-auto justify-start rounded-none bg-transparent p-0",children:[s.jsx(za,{value:"tool",className:"-mb-px h-10 rounded-none rounded-t border border-border border-b-border bg-muted/20 px-6 text-sm font-semibold text-muted-foreground data-[state=active]:z-10 data-[state=active]:bg-card data-[state=active]:text-foreground data-[state=active]:border-border data-[state=active]:border-b-card data-[state=active]:shadow-none",children:"Report by Tool"}),s.jsx(za,{value:"severity",className:"-mb-px h-10 rounded-none rounded-t border border-border border-b-border bg-muted/20 px-6 text-sm font-semibold text-muted-foreground data-[state=active]:z-10 data-[state=active]:bg-card data-[state=active]:text-foreground data-[state=active]:border-border data-[state=active]:border-b-card data-[state=active]:shadow-none",children:"By Severity"})]}),s.jsxs("div",{className:"mb-2 flex min-w-0 items-center gap-2",children:[s.jsx("span",{className:"whitespace-nowrap text-xs text-muted-foreground",children:"Filter tools"}),s.jsxs(ho,{open:f,onOpenChange:h,children:[s.jsx(mo,{asChild:!0,children:s.jsxs(Z,{type:"button",variant:"outline",role:"combobox","aria-expanded":f,"aria-controls":"tool-filter-command-list",className:"h-8 w-[320px] max-w-full justify-between text-xs font-normal",children:[s.jsx("span",{className:"truncate text-left",children:c||"All tools"}),s.jsx(tn,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(xi,{className:"w-[320px] p-0",align:"end",children:s.jsxs(_l,{children:[s.jsx(Al,{placeholder:"Search tools..."}),s.jsxs(kl,{id:"tool-filter-command-list",children:[s.jsx(El,{children:"No tools found."}),s.jsxs(Pl,{children:[s.jsx(xs,{value:"all tools",onSelect:()=>{d(""),h(!1)},children:"All tools"}),N.map(R=>s.jsx(xs,{value:R,onSelect:()=>{d(R),h(!1)},children:R},R))]})]})]})})]}),p==="severity"&&s.jsxs(s.Fragment,{children:[s.jsx(Z,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:E,children:"Expand all"}),s.jsx(Z,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:k,children:"Collapse all"})]}),p==="tool"&&s.jsxs(s.Fragment,{children:[s.jsx(Z,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>A(!0),children:"Expand all"}),s.jsx(Z,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>A(!1),children:"Collapse all"})]})]})]})}),p==="severity"?s.jsx("div",{className:"space-y-4",children:Xo.filter(R=>j.has(R)).map(R=>{const M=S[R].filter(U=>_(U.toolLabel));if(M.length===0)return null;const D=i.has(R);return s.jsxs(nt,{children:[s.jsx(Lt,{className:"pb-3",children:s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx(Ft,{className:"text-base capitalize",children:R}),s.jsxs(Er,{children:[M.length," finding(s)"]})]}),s.jsx("div",{className:"flex gap-2",children:s.jsx(Z,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>P(R),children:D?"Expand":"Collapse"})})]})}),!D&&s.jsx(rt,{className:"space-y-2",children:M.map((U,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:U.issue.title})]}),s.jsx(st,{variant:"outline",className:`shrink-0 text-[10px] ${Lh(U.issue.severity)}`,children:U.issue.severity})]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",U.issue.detail]}),s.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-[11px]",children:[s.jsx(st,{variant:"secondary",className:"font-normal",children:U.sourceLabel}),s.jsx(Z,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 font-mono text-[11px]",title:U.toolLabel,onClick:()=>{y("tool"),requestAnimationFrame(()=>{document.getElementById(U.toolAnchorId)?.scrollIntoView({behavior:"smooth",block:"start"})})},children:U.toolDisplayName})]}),U.issue.suggestion&&s.jsx(lS,{text:U.issue.suggestion})]},U.key))})]},R)})}):s.jsx("div",{ref:v,className:"space-y-4",children:e.servers.map(R=>{const M=R.tools.filter(D=>{const U=`${R.serverName}::${D.publicToolName}`;if(!_(U))return!1;const F=[...D.metadataReview?.issues??[],...D.deeperAnalysis?.sampleCalls.flatMap(G=>G.issues)??[]];return F.length===0?r.length===Xo.length:F.some(G=>j.has(G.severity))});return M.length===0?null:s.jsxs(nt,{children:[s.jsxs(Lt,{className:"pb-3",children:[s.jsx(Ft,{className:"text-base",children:R.serverName}),s.jsxs(Er,{children:["Discovered ",R.toolCountDiscovered," · Showing ",M.length," of"," ",R.toolCountAnalyzed," analyzed · Skipped ",R.toolCountSkipped]})]}),s.jsxs(rt,{className:"space-y-3",children:[R.warnings.length>0&&s.jsxs(fl,{children:[s.jsx(pl,{children:"Warnings"}),s.jsx(hl,{children:s.jsx("ul",{className:"ml-4 list-disc space-y-1",children:R.warnings.map(D=>s.jsx("li",{children:D},`${R.serverName}-${D}`))})})]}),M.map(D=>{const U=D.publicToolName.split("::").pop()??D.publicToolName,F=yq(D.classificationReason),G=D.safetyClassification==="read_only"?"read-only":F?"write/delete":"unsafe/unknown",H=D.safetyClassification==="read_only"?"border-emerald-200 bg-emerald-50 text-emerald-700":F?"border-amber-300 bg-amber-50 text-amber-800":"border-slate-300 bg-slate-100 text-slate-700";return s.jsxs("details",{id:`tool-${H$(`${R.serverName}-${D.publicToolName}`)}`,className:"group rounded-md border p-3",children:[s.jsx("summary",{className:"cursor-pointer list-none",children:s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx("div",{className:"min-w-0 truncate font-mono text-sm",title:D.publicToolName,children:U}),s.jsx(Yye,{label:G,reason:D.classificationReason,variantClassName:H})]}),s.jsx(tn,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),D.title&&s.jsx("p",{className:"text-sm text-foreground/85",children:D.title}),D.description&&s.jsx("p",{className:"text-xs text-muted-foreground",children:D.description})]})}),s.jsxs("div",{className:"mt-3 space-y-2",children:[s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[s.jsxs(Z,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-[11px]",onClick:()=>{oS("Tool info",{server:R.serverName,name:D.publicToolName,title:D.title,description:D.description})},children:[s.jsx(ss,{className:"mr-1.5 h-3.5 w-3.5"}),"Copy Tool Info"]}),s.jsxs(Z,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-[11px]",onClick:()=>{oS("Schemas",{server:R.serverName,name:D.publicToolName,inputSchema:D.inputSchema,outputSchema:D.outputSchema})},disabled:D.inputSchema===void 0&&D.outputSchema===void 0,children:[s.jsx(ss,{className:"mr-1.5 h-3.5 w-3.5"}),"Copy Schemas"]}),s.jsxs(Z,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-[11px]",onClick:()=>{oS("Metadata review",{server:R.serverName,name:D.publicToolName,metadataReview:D.metadataReview})},disabled:!D.metadataReview,children:[s.jsx(ss,{className:"mr-1.5 h-3.5 w-3.5"}),"Copy Metadata Review"]})]}),(D.inputSchema!==void 0||D.outputSchema!==void 0)&&s.jsxs("details",{className:"group/schema rounded border bg-muted/10 p-2",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-2 text-xs font-medium",children:[s.jsx("span",{children:"Schemas"}),s.jsx(tn,{className:"h-4 w-4 text-muted-foreground transition-transform group-open/schema:rotate-180"})]}),s.jsxs("div",{className:"mt-2 space-y-2",children:[D.inputSchema!==void 0&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-[11px] font-medium text-muted-foreground",children:"Input schema"}),s.jsx("pre",{className:"max-h-52 overflow-auto rounded border bg-muted/20 p-2 text-[11px]",children:V$(D.inputSchema)})]}),D.outputSchema!==void 0&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-[11px] font-medium text-muted-foreground",children:"Output schema"}),s.jsx("pre",{className:"max-h-52 overflow-auto rounded border bg-muted/20 p-2 text-[11px]",children:V$(D.outputSchema)})]})]})]}),D.metadataReview&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-xs font-medium",children:"Metadata review"}),D.metadataReview.issues.filter(L=>j.has(L.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:D.metadataReview.issues.filter(L=>j.has(L.severity)).map((L,I)=>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:I+1}),s.jsx("span",{className:"min-w-0 font-bold leading-tight",children:L.title})]}),s.jsx(st,{variant:"outline",className:`shrink-0 text-[10px] ${Lh(L.severity)}`,children:L.severity})]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",L.detail]}),L.suggestion&&s.jsx(lS,{text:L.suggestion})]},L.id))})]}),D.deeperAnalysis&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-xs font-medium",children:"Deeper analysis"}),D.deeperAnalysis.attempted?s.jsx("div",{className:"space-y-2",children:D.deeperAnalysis.sampleCalls.map(L=>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(st,{variant:L.ok?"secondary":"destructive",className:"text-[10px]",children:L.ok?"ok":"error"}),s.jsxs("span",{children:["Call ",L.callIndex]}),L.durationMs!==void 0&&s.jsxs("span",{className:"text-muted-foreground",children:[L.durationMs,"ms"]})]}),L.error&&s.jsx("p",{className:"text-destructive",children:L.error}),L.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:L.observations.map((I,Y)=>s.jsx("li",{children:I},`${D.publicToolName}-obs-${L.callIndex}-${Y}`))})]}),L.issues.filter(I=>j.has(I.severity)).length>0&&s.jsx("div",{className:"mt-2 space-y-1",children:L.issues.filter(I=>j.has(I.severity)).map((I,Y)=>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:Y+1}),s.jsx("span",{className:"min-w-0 font-bold leading-tight",children:I.title})]}),s.jsx(st,{variant:"outline",className:`shrink-0 text-[10px] ${Lh(I.severity)}`,children:I.severity})]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",I.detail]}),I.suggestion&&s.jsx(lS,{text:I.suggestion})]},`${L.callIndex}-${I.id}`))})]},`${D.publicToolName}-call-${L.callIndex}`))}):s.jsx("p",{className:"text-xs text-muted-foreground",children:D.deeperAnalysis.skippedReason??"Skipped"})]})]})]},D.publicToolName)})]})]},R.serverName)})})]})]})}function wq(e){return{reportId:e.reportId,createdAt:e.createdAt,tools:e.report.servers.flatMap(t=>t.tools.map(n=>({server:t.serverName,name:n.publicToolName,title:n.title,description:n.description,inputSchema:n.inputSchema,outputSchema:n.outputSchema})))}}function Xye(e){const t=e.selectedToolNames?.length?new Set(e.selectedToolNames):null;return{serverName:e.serverName,tools:e.tools.filter(n=>!t||t.has(n.name)).map(n=>({name:n.name,title:n.title,description:n.description,inputSchema:n.inputSchema,outputSchema:n.outputSchema}))}}function K$(e){return e.trim().toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}function Qye(e,t){const n=["tool-info",K$(e)],r=t?.trim();return r&&n.push(`v${K$(r)}`),`${n.filter(Boolean).join("-")}.json`}function Zye(e){let t=0;const n=new Set,r=new Set;for(const i of e){const o=typeof i.payload?.message=="string"?i.payload.message:"";if(!o)continue;const c=o.match(/\((\d+)\s+selected\s+of\s+\d+\s+discovered\)/i);c&&(t=Math.max(t,Number(c[1])||0));const d=o.match(/^Started\s+(.+)$/);d&&n.add(d[1]);const f=o.match(/^Finished\s+(.+)$/);f&&r.add(f[1])}const a=t>0?Math.max(0,Math.min(100,Math.round(r.size/t*100))):0;return{totalTools:t,startedTools:n.size,finishedTools:r.size,percent:a}}const cS="mcplab.toolAnalysis.activeJobId";function uS(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)}async function Jye(e,t){try{await navigator.clipboard.writeText(t),Me({title:`${e} copied`})}catch(n){Me({title:`Could not copy ${e.toLowerCase()}`,description:n instanceof Error?n.message:String(n),variant:"destructive"})}}function G$({text:e}){return s.jsxs(Si,{children:[s.jsx(Ni,{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(N9,{className:"h-3.5 w-3.5"})})}),s.jsx(qa,{className:"max-w-xs text-xs",children:s.jsx("p",{children:e})})]})}function ebe(e,t){const n=t.toLowerCase();return n.includes("failed to load tools")||n.includes("failed to connect to mcp server")?`Could not load tools from '${e}'. Check that the MCP server is running and reachable, then try Refresh Servers / Discover Tools again.`:t}function tbe({label:e,reason:t,variantClassName:n}){return s.jsx(ji,{delayDuration:0,children:s.jsxs(Si,{children:[s.jsx(Ni,{asChild:!0,children:s.jsx(st,{variant:"outline",className:n,children:e})}),s.jsx(qa,{className:"max-w-sm text-xs",children:s.jsx("p",{children:t})})]})})}const nbe=()=>{const e=_e=>`tool-analysis-${Date.now()}.${_e}`,{source:t}=On(),{servers:n,agents:r,loading:a,reload:i}=Ca(),[o,c]=m.useState(""),[d,f]=m.useState([]),[h,p]=m.useState(!1),[v,x]=m.useState([]),[j,b]=m.useState({}),[y,S]=m.useState(""),[N,_]=m.useState(!0),[A,k]=m.useState(!1),[E,P]=m.useState(2),[R,M]=m.useState(1),[D,U]=m.useState(1e4),[F,G]=m.useState(null),[H,L]=m.useState([]),[I,Y]=m.useState(null),[W,O]=m.useState(null),[Q,q]=m.useState(!1),[z,K]=m.useState("configure"),[J,ne]=m.useState("idle"),[he,ie]=m.useState(!1),me=m.useRef(null),se=m.useRef(null),ge=o||r[0]?.name||"",Oe=m.useMemo(()=>Zye(H),[H]);m.useEffect(()=>{let _e=!0;return t.getWorkspaceSettings().then(Qe=>{!_e||!Qe||c(Qe.scenarioAssistantAgentName??"")}).catch(()=>{_e&&c("")}),()=>{_e=!1}},[t]),m.useEffect(()=>()=>{me.current?.()},[]),m.useEffect(()=>{const _e=se.current;_e&&requestAnimationFrame(()=>{_e.scrollTop=_e.scrollHeight})},[H.length]);const fe=()=>{try{sessionStorage.removeItem(cS)}catch{}},xe=_e=>{try{sessionStorage.setItem(cS,_e)}catch{}},we=_e=>{me.current?.(),me.current=t.subscribeToolAnalysisJob(_e,Qe=>{if(L(Ze=>[...Ze,Qe]),Qe.type==="completed")t.getToolAnalysisResult(_e).then(Ze=>{Y(Ze.report),O(Ze.savedReportId??null)}).catch(Ze=>Me({title:"Could not load analysis report",description:Ze instanceof Error?Ze.message:String(Ze),variant:"destructive"})).finally(()=>{fe(),G(null),q(!1),ne("idle"),K("run")});else if(Qe.type==="error"){const Ze=String(Qe.payload?.message??"");fe(),ne(Ze.toLowerCase().includes("abort")?"stopped":"error"),G(null),q(!1)}})};m.useEffect(()=>{if(F||I)return;let _e="";try{_e=sessionStorage.getItem(cS)??""}catch{_e=""}if(_e)return K("run"),ne("running"),q(!0),G(_e),L([]),we(_e),()=>{}},[t,F,I]);const ot=async()=>{if(d.length===0){x([]),b({});return}const _e=d.filter(Qe=>n.find(_t=>_t.id===Qe)?.authType==="oauth2");try{_e.length>0&&(ie(!0),await vi({serverNames:_e,source:t,onServerAuthStart:Qe=>{Me({title:`OAuth login required for ${Qe}`,description:"Complete login in the opened browser tab. Discovery will continue automatically."})}}))}catch(Qe){Me({title:"OAuth login failed",description:Qe instanceof Error?Qe.message:String(Qe),variant:"destructive"}),ie(!1);return}finally{ie(!1)}p(!0);try{const Qe=await t.discoverToolsForAnalysis({serverNames:d});x(Qe.servers),b(Ze=>{const _t={};for(const Bt of Qe.servers){const ue=Ze[Bt.serverName]??[],Ke=Bt.tools.map(re=>re.name),De=ue.filter(re=>Ke.includes(re));_t[Bt.serverName]=De.length>0?De:Ke}return _t})}catch(Qe){Me({title:"Could not discover MCP tools",description:Qe instanceof Error?Qe.message:String(Qe),variant:"destructive"})}finally{p(!1)}};m.useEffect(()=>{ot()},[d.join("|")]);const lt=m.useMemo(()=>{const _e=y.trim().toLowerCase();return _e?v.map(Qe=>({...Qe,tools:Qe.tools.filter(Ze=>Ze.name.toLowerCase().includes(_e)||(Ze.description||"").toLowerCase().includes(_e))})).filter(Qe=>Qe.tools.length>0):v},[v,y]),ut=m.useMemo(()=>Object.values(j).reduce((_e,Qe)=>_e+Qe.length,0),[j]),At=d[0]??"",Xe=async()=>{if(!N&&!A){Me({title:"Select at least one mode",variant:"destructive"});return}if(d.length!==1){Me({title:"Select exactly one server",variant:"destructive"});return}if(ut===0){Me({title:"Select at least one tool",variant:"destructive"});return}q(!0),L([]),Y(null),O(null),K("run"),ne("running");try{const _e=d[0];n.find(_t=>_t.id===_e)?.authType==="oauth2"&&(ie(!0),await vi({serverNames:[_e],source:t,onServerAuthStart:_t=>{Me({title:`OAuth login required for ${_t}`,description:"Complete login in the opened browser tab. Analysis will continue automatically."})}}));const{jobId:Ze}=await t.startToolAnalysis({serverNames:d,selectedToolsByServer:j,maxParallelTools:E,modes:{metadataReview:N,deeperAnalysis:A},deeperAnalysisOptions:{autoRunPolicy:"read_only_allowlist",sampleCallsPerTool:R,toolCallTimeoutMs:D}});G(Ze),xe(Ze),we(Ze)}catch(_e){q(!1),ne("error"),K("run"),Me({title:"Could not start tool analysis",description:_e instanceof Error?_e.message:String(_e),variant:"destructive"})}finally{ie(!1)}},Se=()=>{const _e=d[0],Qe=v.find(_t=>_t.serverName===_e);if(!_e||!Qe){Me({title:"No discovered tool info available",description:"Select a server and discover tools before downloading tool info.",variant:"destructive"});return}const Ze=Xye({serverName:Qe.serverName,tools:Qe.tools,selectedToolNames:j[Qe.serverName]});uS(Qye(Qe.serverName,Qe.mcpServerVersion),`${JSON.stringify(Ze,null,2)}
|
|
145
|
+
`,"application/json")},Ae=async()=>{if(!F)return;const _e=F;try{const Qe=await t.stopToolAnalysis(_e);if(Qe.status==="completed"){me.current?.(),me.current=null;const Ze=await t.getToolAnalysisResult(_e);Y(Ze.report),O(Ze.savedReportId??null),fe(),G(null),q(!1),ne("idle"),K("run"),Me({title:"Analysis already finished",description:"Showing the result overview."});return}if(Qe.status==="stopped"){me.current?.(),me.current=null,fe(),G(null),q(!1),ne("stopped"),Me({title:"Analysis stopped"});return}if(Qe.status==="error"){me.current?.(),me.current=null,fe(),G(null),q(!1),ne("error"),Me({title:"Analysis already ended with an error",description:"Review the progress log and return to Configure Analysis."});return}Me({title:"Stopping analysis..."})}catch(Qe){Me({title:"Could not stop analysis",description:Qe instanceof Error?Qe.message:String(Qe),variant:"destructive"})}},Je=()=>{K("configure"),ne("idle"),G(null)},dt=(_e,Qe)=>{f(Ze=>Qe?[_e]:Ze.filter(_t=>_t!==_e))},Pt=(_e,Qe,Ze)=>{b(_t=>{const Bt=new Set(_t[_e]??[]);return Ze?Bt.add(Qe):Bt.delete(Qe),{..._t,[_e]:Array.from(Bt)}})},Xt=(_e,Qe)=>{b(Ze=>({...Ze,[_e]:Qe}))},kt=!0,nn=F!==null||H.length>0||J==="stopped"||J==="error",Jt=!!I,zt=_e=>{if(_e==="configure"&&kt){K("configure");return}if(_e==="run"&&nn){K("run");return}_e==="report"&&Jt&&K("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(qD,{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:()=>zt("configure"),className:"rounded-full","aria-label":"Open Configure Analysis",children:s.jsx(st,{variant:z==="configure"?"default":"outline",className:"cursor-pointer",children:"Configure Analysis"})}),s.jsx("button",{type:"button",onClick:()=>zt("run"),disabled:!nn,className:"rounded-full disabled:cursor-not-allowed disabled:opacity-60","aria-label":"Open Run Analysis",children:s.jsx(st,{variant:z==="run"?"default":"outline",className:nn?"cursor-pointer":"cursor-not-allowed",children:"Run Analysis"})}),s.jsx("button",{type:"button",onClick:()=>zt("report"),disabled:!Jt,className:"rounded-full disabled:cursor-not-allowed disabled:opacity-60","aria-label":"Open Report",children:s.jsx(st,{variant:z==="report"?"default":"outline",className:Jt?"cursor-pointer":"cursor-not-allowed",children:"Report"})})]})]}),z==="configure"&&s.jsxs(nt,{children:[s.jsxs(Lt,{children:[s.jsx(Ft,{className:"text-base",children:"Run MCP analysis"}),s.jsx(Er,{children:"Select servers and tools, choose metadata review and/or deeper sample-call analysis, then run the report."})]}),s.jsxs(rt,{className:"space-y-5",children:[!ge&&s.jsxs(fl,{children:[s.jsx(pl,{children:"No assistant agent available"}),s.jsxs(hl,{children:["Add a library agent in"," ",s.jsx(Tt,{to:"/libraries/agents",className:"underline",children:"Agents"})," ","and optionally set the default Scenario Assistant Agent in"," ",s.jsx(Tt,{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(Ve,{className:"text-xs",children:"Servers"}),s.jsxs(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>{i()},disabled:a||he,children:[s.jsx(zs,{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:n.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No library servers configured."}):n.map(_e=>{const Qe=d.includes(_e.id);return s.jsxs("label",{className:"flex items-start gap-2 rounded-md border p-2 text-sm",children:[s.jsx(wr,{checked:Qe,onCheckedChange:Ze=>dt(_e.id,!!Ze)}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"font-medium",children:_e.name||_e.id}),_e.url&&s.jsx("div",{className:"truncate text-xs text-muted-foreground",children:_e.url})]})]},_e.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(Ve,{className:"text-xs",children:"Filter visible tools"}),s.jsxs("div",{className:"relative",children:[s.jsx(qN,{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(Et,{className:"h-9 pl-8",placeholder:"Filter tools by name or description...",value:y,onChange:_e=>S(_e.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(Ve,{className:"text-xs",children:At?`Tools for ${At}`:"Tools"}),s.jsxs("div",{className:"ml-auto flex flex-wrap items-center gap-2",children:[s.jsxs(Z,{type:"button",size:"sm",variant:"outline",onClick:Se,disabled:h||he||d.length===0||v.length===0,children:[s.jsx(Ir,{className:"mr-2 h-4 w-4"}),"Download Tool Info"]}),s.jsxs(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>{ot()},disabled:h||he||d.length===0,children:[h&&s.jsx(jr,{className:"mr-2 h-4 w-4 animate-spin"}),"Discover Tools"]})]})]}),s.jsx("div",{className:"space-y-3 rounded-md border p-3",children:d.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"Select a server to discover tools."}):h&&v.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading tools..."}):lt.length===0&&!h?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No discovered tools match the current filters."}):lt.map(_e=>{const Qe=new Set(j[_e.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:_e.serverName}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(Z,{type:"button",size:"sm",variant:"ghost",onClick:()=>{Jye("Tool list",`${JSON.stringify({server:_e.serverName,tools:_e.tools.map(Ze=>({name:Ze.name,title:Ze.title,description:Ze.description}))},null,2)}
|
|
146
|
+
`)},children:[s.jsx(ss,{className:"mr-1.5 h-3.5 w-3.5"}),"Copy"]}),s.jsx(Z,{type:"button",size:"sm",variant:"ghost",onClick:()=>Xt(_e.serverName,_e.tools.map(Ze=>Ze.name)),children:"Select all"}),s.jsx(Z,{type:"button",size:"sm",variant:"ghost",onClick:()=>Xt(_e.serverName,[]),children:"Clear"})]})]}),_e.warnings.length>0&&s.jsx("div",{className:"mb-2 space-y-1",children:_e.warnings.map(Ze=>s.jsx("div",{className:"text-xs text-amber-700",children:ebe(_e.serverName,Ze)},`${_e.serverName}-${Ze}`))}),s.jsx("div",{className:"grid gap-2",children:_e.tools.map(Ze=>{const _t=yq(Ze.classificationReason),Bt=Ze.safetyClassification==="read_only"?"read-only":_t?"write/delete":"unsafe/unknown",ue=Ze.safetyClassification==="read_only"?"border-emerald-200 bg-emerald-50 text-emerald-700":_t?"border-amber-300 bg-amber-50 text-amber-800":"border-slate-300 bg-slate-100 text-slate-700";return s.jsxs("label",{className:"flex items-start gap-2 rounded border p-2",children:[s.jsx(wr,{checked:Qe.has(Ze.name),onCheckedChange:Ke=>Pt(_e.serverName,Ze.name,!!Ke)}),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:Ze.name}),Ze.title&&s.jsx("span",{className:"text-xs text-muted-foreground",children:Ze.title}),s.jsx(tbe,{label:Bt,reason:Ze.classificationReason,variantClassName:ue}),Ze.inputSchema&&s.jsx(st,{variant:"outline",className:"border-border text-[10px] text-muted-foreground",children:"schema: input"}),Ze.outputSchema&&s.jsx(st,{variant:"outline",className:"border-border text-[10px] text-muted-foreground",children:"schema: output"})]}),Ze.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:Ze.description})]})]},`${_e.serverName}-${Ze.name}`)})})]},_e.serverName)})}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Selected tools: ",ut]})]}),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(wr,{checked:N,onCheckedChange:_e=>_(!!_e)}),s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Metadata / schema review",s.jsx(G$,{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(wr,{checked:A,onCheckedChange:_e=>k(!!_e)}),s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Deeper analysis",s.jsx(G$,{text:"Runs sample MCP tool calls automatically for read-only 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(Ve,{className:"text-xs",children:"Max parallel tools"}),s.jsx(Et,{type:"number",min:1,max:8,value:E,onChange:_e=>P(Math.max(1,Math.min(8,Number(_e.target.value)||2))),className:"h-8"})]}),A?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{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(Ve,{className:"text-xs",children:"Sample calls per tool"}),s.jsx(Et,{type:"number",min:1,max:5,value:R,onChange:_e=>M(Math.max(1,Math.min(5,Number(_e.target.value)||1))),className:"h-8"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{className:"text-xs",children:"Tool call timeout (ms)"}),s.jsx(Et,{type:"number",min:1e3,max:6e4,step:500,value:D,onChange:_e=>U(Math.max(1e3,Math.min(6e4,Number(_e.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(Z,{type:"button",onClick:()=>{Xe()},disabled:Q||he||!!F,children:[(Q||!!F)&&s.jsx(jr,{className:"mr-2 h-4 w-4 animate-spin"}),"Analyze Tools"]})})]})]}),z==="run"&&s.jsxs(nt,{children:[s.jsx(Lt,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(Ft,{className:"flex items-center gap-2 text-base",children:s.jsx("span",{children:"Progress"})}),s.jsx(Er,{children:F?"Live tool-analysis job events:":I?"Analysis finished. Review the summary below or open the saved report details.":J==="stopped"?"Analysis was stopped. You can return to Configure Analysis.":J==="error"?"Analysis ended with an error. Review the log and go back to Configure Analysis.":"Analysis finished."})]}),F?s.jsx(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>{Ae()},children:"Stop Analysis"}):s.jsx(Z,{type:"button",size:"sm",variant:"outline",onClick:Je,children:"Back to Configure Analysis"})]})}),s.jsxs(rt,{className:"space-y-2",children:[F&&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(jr,{className:"h-3.5 w-3.5 animate-spin"}),"Analysis is still running..."]}),(Oe.totalTools>0||F)&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[s.jsx("span",{children:Oe.totalTools>0?`${Oe.finishedTools}/${Oe.totalTools} tools finished`:"Preparing analysis..."}),s.jsx("span",{children:Oe.totalTools>0?`${Oe.percent}%`:"0%"})]}),s.jsx(Hv,{value:Oe.totalTools>0?Oe.percent:0,className:"h-2"})]}),H.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:F?"Starting analysis...":"No progress events captured."}):s.jsx("div",{ref:se,className:"max-h-64 space-y-1 overflow-auto rounded border bg-muted/20 p-2",children:H.map((_e,Qe)=>s.jsxs("div",{className:"text-xs",children:[s.jsx("span",{className:"mr-2 font-mono text-muted-foreground",children:new Date(_e.ts).toLocaleTimeString()}),s.jsx(st,{variant:"outline",className:"mr-2 text-[10px]",children:_e.type}),s.jsx("span",{className:"break-all",children:typeof _e.payload.message=="string"?_e.payload.message:JSON.stringify(_e.payload)})]},`${_e.ts}-${Qe}`))}),!F&&I&&s.jsx(nt,{className:"mt-2 border-green-200 bg-green-50/40 dark:border-green-900/40 dark:bg-green-950/10",children:s.jsxs(rt,{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:[I.summary.toolsAnalyzed," tools analyzed, ",I.summary.toolsSkipped," ","skipped, across ",I.summary.serversAnalyzed," server",I.summary.serversAnalyzed!==1?"s":"","."]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[W&&s.jsx(Z,{asChild:!0,size:"sm",children:s.jsx(Tt,{to:`/tool-analysis-results/${W}`,children:"Open result details"})}),s.jsx(Z,{asChild:!0,size:"sm",variant:"outline",children:s.jsx(Tt,{to:"/tool-analysis-results",children:"View all results"})}),s.jsx(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>zt("report"),children:"View inline report"})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[I.summary.issueCounts.critical>0&&s.jsxs(st,{className:"bg-red-600 text-white hover:bg-red-600",children:["Critical: ",I.summary.issueCounts.critical]}),I.summary.issueCounts.high>0&&s.jsxs(st,{className:"bg-orange-500 text-white hover:bg-orange-500",children:["High: ",I.summary.issueCounts.high]}),I.summary.issueCounts.medium>0&&s.jsxs(st,{className:"bg-amber-500 text-white hover:bg-amber-500",children:["Medium: ",I.summary.issueCounts.medium]}),I.summary.issueCounts.low>0&&s.jsxs(st,{className:"bg-blue-500 text-white hover:bg-blue-500",children:["Low: ",I.summary.issueCounts.low]}),I.summary.issueCounts.info>0&&s.jsxs(st,{variant:"outline",children:["Info: ",I.summary.issueCounts.info]}),Object.values(I.summary.issueCounts).every(_e=>_e===0)&&s.jsx(st,{className:"bg-green-600 text-white hover:bg-green-600",children:"No findings"})]})]})})]})]}),z==="report"&&I&&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:[I.summary.toolsAnalyzed," tools analyzed across"," ",I.summary.serversAnalyzed," server",I.summary.serversAnalyzed!==1?"s":"","."]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Z,{type:"button",size:"sm",variant:"outline",onClick:Je,children:"Back to Configure Analysis"}),W&&s.jsxs(s.Fragment,{children:[s.jsx(Z,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx(Tt,{to:`/tool-analysis-results/${W}`,children:"Open saved report"})}),s.jsx(Z,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx(Tt,{to:"/tool-analysis-results",children:"View all reports"})})]}),s.jsxs(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>uS(e("json"),`${JSON.stringify(I,null,2)}
|
|
147
|
+
`,"application/json"),children:[s.jsx(Ir,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>uS(e("md"),L_(I),"text/markdown"),children:[s.jsx(Ir,{className:"mr-2 h-4 w-4"}),"Export Markdown"]})]})]}),s.jsx(bq,{report:I})]})]})};function Kv(e){const[t,n]=m.useState(0),[r,a]=m.useState(!1),[i,o]=m.useState(0),c=m.useCallback(()=>{n(v=>Math.max(0,v-e))},[e]),d=m.useCallback(()=>{n(v=>v+e)},[e]),f=m.useCallback(()=>n(0),[]),h=m.useCallback(v=>{a(v.has_more),o(v.total_count)},[]),p=m.useCallback(v=>i<=0||v<=0?"Showing 0 of 0":`Showing ${t+1}-${Math.min(t+v,i)} of ${i}`,[t,i]);return m.useMemo(()=>({limit:e,offset:t,hasMore:r,totalCount:i,setOffset:n,setHasMore:a,setTotalCount:o,prev:c,next:d,reset:f,updateMeta:h,rangeLabel:p}),[r,e,d,t,c,p,f,i,h])}function dS(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 rbe(){const{source:e}=On(),[t,n]=m.useState([]),[r,a]=m.useState(!0),[i,o]=m.useState(null),[c,d]=m.useState(!1),[f,h]=m.useState("all"),[p,v]=m.useState(!1),[x,j]=m.useState([]),b=100,y=Kv(b),{offset:S,hasMore:N}=y,_=async()=>{a(!0);try{if(e.listToolAnalysisResultsPage){const P=await e.listToolAnalysisResultsPage({limit:b,offset:S,server:f==="all"?void 0:f});n(P.data),y.updateMeta(P)}else n(await e.listToolAnalysisResults({limit:b,offset:S,server:f==="all"?void 0:f}))}catch(P){Me({title:"Could not load tool analysis results",description:P instanceof Error?P.message:String(P),variant:"destructive"})}finally{a(!1)}};m.useEffect(()=>{_()},[S,f]),m.useEffect(()=>{e.listToolAnalysisServers&&e.listToolAnalysisServers().then(P=>j(P)).catch(()=>{j([])})},[e]),m.useEffect(()=>{e.listToolAnalysisServers||j(Array.from(new Set(t.flatMap(P=>P.serverNames))).sort((P,R)=>P.localeCompare(R)))},[t,e]),m.useEffect(()=>{y.reset()},[y.reset,f]);const A=m.useMemo(()=>t.find(P=>P.reportId===i)??null,[t,i]),k=async()=>{if(i){d(!0);try{await e.deleteToolAnalysisSavedResult(i),n(P=>P.filter(R=>R.reportId!==i)),Me({title:"Tool analysis report deleted"}),o(null)}catch(P){Me({title:"Could not delete report",description:P instanceof Error?P.message:String(P),variant:"destructive"})}finally{d(!1)}}},E=async(P,R)=>{try{const M=await e.getToolAnalysisSavedResult(P);R==="json"?dS(`${P}.json`,`${JSON.stringify(M,null,2)}
|
|
148
|
+
`,"application/json"):R==="tool_schemas"?dS(`${P}-tool-schemas.json`,`${JSON.stringify(wq(M),null,2)}
|
|
149
|
+
`,"application/json"):dS(`${P}.md`,L_(M.report),"text/markdown")}catch(M){Me({title:"Could not export saved report",description:M instanceof Error?M.message:String(M),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(UD,{className:"h-6 w-6"}),"Tool Analysis Results"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Browse persisted Analyze MCP Tools reports."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"MCP server"}),s.jsxs(ho,{open:p,onOpenChange:v,children:[s.jsx(mo,{asChild:!0,children:s.jsxs(Z,{type:"button",variant:"outline",role:"combobox","aria-expanded":p,"aria-controls":"tool-analysis-server-command-list",className:`h-9 w-[240px] justify-between font-normal ${f!=="all"?"border-primary/40":""}`,children:[s.jsx("span",{className:"truncate text-left",children:f==="all"?"All servers":f}),s.jsx(tn,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(xi,{className:"w-[240px] p-0",align:"start",children:s.jsxs(_l,{children:[s.jsx(Al,{placeholder:"Search MCP servers..."}),s.jsxs(kl,{id:"tool-analysis-server-command-list",children:[s.jsx(El,{children:"No servers found."}),s.jsxs(Pl,{children:[s.jsx(xs,{value:"all servers",onSelect:()=>{h("all"),v(!1)},children:"All servers"}),x.map(P=>s.jsx(xs,{value:P,onSelect:()=>{h(P),v(!1)},children:P},P))]})]})]})})]})]}),s.jsx(Z,{variant:"outline",onClick:()=>{_()},disabled:r,children:r?"Refreshing...":"Refresh"}),s.jsx(Z,{variant:"outline",onClick:y.prev,disabled:r||S===0,children:"Prev"}),s.jsx(Z,{variant:"outline",onClick:y.next,disabled:r||!N,children:"Next"}),s.jsx(Z,{asChild:!0,variant:"outline",children:s.jsx(Tt,{to:"/tool-analysis",children:"Analyze MCP Tools"})})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:y.rangeLabel(t.length)}),s.jsx(nt,{children:s.jsx(rt,{className:"p-0",children:r?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"Loading tool analysis results..."}):t.length===0?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"No saved tool analysis reports yet."}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"border-b px-4 py-3",children:s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Showing ",s.jsx("span",{className:"font-medium text-foreground",children:t.length})," ","reports"]})}),t.length===0?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"No reports for the selected MCP server."}):s.jsxs(Jr,{children:[s.jsx(es,{children:s.jsxs(Gt,{children:[s.jsx(ht,{children:"Report ID"}),s.jsx(ht,{children:"Evaluated"}),s.jsx(ht,{children:"Timestamp"}),s.jsx(ht,{children:"Issues"}),s.jsx(ht,{children:"Modes"}),s.jsx(ht,{className:"w-10"})]})}),s.jsx(ts,{children:t.map(P=>s.jsxs(Gt,{children:[s.jsx(He,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(Tt,{to:`/tool-analysis-results/${P.reportId}`,className:"font-mono text-xs text-primary hover:underline",children:P.reportId}),s.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[P.assistantAgentName," · ",P.assistantAgentModel]})]})}),s.jsx(He,{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:P.serverNames.length})," ","· Tools:"," ",s.jsx("span",{className:"font-medium text-foreground",children:P.summary.toolsAnalyzed})," · ","Skipped:"," ",s.jsx("span",{className:"font-medium text-foreground",children:P.summary.toolsSkipped})]}),s.jsxs("div",{className:"font-mono text-xs text-foreground/80",children:[P.serverNames.slice(0,2).join(", "),P.serverNames.length>2?` +${P.serverNames.length-2}`:""]})]})}),s.jsx(He,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(xa,{className:"h-3 w-3"}),new Date(P.createdAt).toLocaleString()]})}),s.jsx(He,{children:s.jsxs("div",{className:"flex flex-wrap gap-1",children:[["critical","high","medium","low","info"].map(R=>P.summary.issueCounts[R]>0?s.jsxs(st,{variant:"outline",className:"capitalize",children:[R,": ",P.summary.issueCounts[R]]},`${P.reportId}-${R}`):null),Object.values(P.summary.issueCounts).every(R=>R===0)&&s.jsx(st,{variant:"outline",children:"No issues"})]})}),s.jsx(He,{children:s.jsxs("div",{className:"flex flex-wrap gap-1",children:[P.modes.metadataReview&&s.jsx(st,{variant:"outline",children:"metadata"}),P.modes.deeperAnalysis&&s.jsx(st,{variant:"outline",children:"deeper"})]})}),s.jsx(He,{children:s.jsxs(lp,{children:[s.jsx(cp,{asChild:!0,children:s.jsx(Z,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(bg,{className:"h-4 w-4"})})}),s.jsxs($u,{align:"end",children:[s.jsx(Mr,{asChild:!0,children:s.jsx(Tt,{to:`/tool-analysis-results/${P.reportId}`,children:"View"})}),s.jsxs(Mr,{onSelect:()=>{E(P.reportId,"json")},children:[s.jsx(Ir,{className:"mr-2 h-3.5 w-3.5"})," Export JSON"]}),s.jsxs(Mr,{onSelect:()=>{E(P.reportId,"markdown")},children:[s.jsx(Ir,{className:"mr-2 h-3.5 w-3.5"})," Export Markdown"]}),s.jsxs(Mr,{className:"text-destructive",onSelect:R=>{R.preventDefault(),o(P.reportId)},children:[s.jsx(Bs,{className:"mr-2 h-3.5 w-3.5"})," Delete"]}),s.jsxs(Mr,{onSelect:()=>{E(P.reportId,"tool_schemas")},children:[s.jsx(Ir,{className:"mr-2 h-3.5 w-3.5"})," Export MCP Info"]})]})]})})]},P.reportId))})]})]})})}),s.jsx(ja,{open:!!i,onOpenChange:P=>!P&&o(null),children:s.jsxs(Us,{children:[s.jsxs(Ws,{children:[s.jsx(Hs,{children:"Delete tool analysis report?"}),s.jsx(Ks,{children:A?`Delete saved report '${A.reportId}' from disk? This cannot be undone.`:"Delete this saved report from disk? This cannot be undone."})]}),s.jsxs(Vs,{children:[s.jsx(Ys,{disabled:c,children:"Cancel"}),s.jsx(Gs,{onClick:P=>{P.preventDefault(),k()},disabled:c,children:c?"Deleting...":"Delete"})]})]})})]})}function fS(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 sbe(){const{id:e=""}=Ml(),t=Xs(),{source:n}=On(),[r,a]=m.useState(null),[i,o]=m.useState(!0),[c,d]=m.useState(!1),[f,h]=m.useState(!1),[p,v]=m.useState(!1);m.useEffect(()=>{let j=!0;return o(!0),d(!1),n.getToolAnalysisSavedResult(e).then(b=>{j&&a(b)}).catch(b=>{if(!j)return;const y=b instanceof Error?b.message:String(b);if(y.includes("(404)")){d(!0),a(null);return}Me({title:"Could not load saved tool analysis report",description:y,variant:"destructive"})}).finally(()=>{j&&o(!1)}),()=>{j=!1}},[e,n]);const x=async()=>{v(!0);try{await n.deleteToolAnalysisSavedResult(e),Me({title:"Tool analysis report deleted"}),t("/tool-analysis-results")}catch(j){Me({title:"Could not delete report",description:j instanceof Error?j.message:String(j),variant:"destructive"})}finally{v(!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(Z,{asChild:!0,variant:"outline",children:s.jsx(Tt,{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-xs text-muted-foreground",children:[s.jsxs("span",{className:"inline-flex items-center gap-1 align-middle",children:[s.jsx(xa,{className:"h-3 w-3 shrink-0"}),new Date(r.createdAt).toLocaleString()]})," ","· ",r.serverNames.join(", ")||"—"]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.report.mcpServerVersions&&Object.keys(r.report.mcpServerVersions).length>0&&s.jsxs("span",{className:"inline-flex items-center align-middle rounded-sm border border-border/60 bg-muted/30 px-1.5 py-1 text-[11px] leading-none text-muted-foreground",children:[s.jsx("span",{className:"font-medium",children:"MCP:"}),s.jsx("span",{className:"ml-1 font-mono",children:Object.entries(r.report.mcpServerVersions).map(([j,b])=>`${j}: ${b??"unknown"}`).join(", ")})]}),s.jsx(Z,{asChild:!0,size:"sm",variant:"outline",children:s.jsx(Tt,{to:"/tool-analysis-results",children:"Back to results"})}),s.jsxs(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>fS(`${r.reportId}.json`,`${JSON.stringify(r,null,2)}
|
|
150
|
+
`,"application/json"),children:[s.jsx(Ir,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>fS(`${r.reportId}.md`,L_(r.report),"text/markdown"),children:[s.jsx(Ir,{className:"mr-2 h-4 w-4"}),"Export Markdown"]}),s.jsxs(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>fS(`${r.reportId}-tool-schemas.json`,`${JSON.stringify(wq(r),null,2)}
|
|
151
|
+
`,"application/json"),children:[s.jsx(Ir,{className:"mr-2 h-4 w-4"}),"Export MCP info"]}),s.jsxs(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>h(!0),children:[s.jsx(Bs,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]}),s.jsx(bq,{report:r.report}),s.jsx(ja,{open:f,onOpenChange:h,children:s.jsxs(Us,{children:[s.jsxs(Ws,{children:[s.jsx(Hs,{children:"Delete tool analysis report?"}),s.jsxs(Ks,{children:["Delete saved report '",r.reportId,"' from disk? This cannot be undone."]})]}),s.jsxs(Vs,{children:[s.jsx(Ys,{disabled:p,children:"Cancel"}),s.jsx(Gs,{onClick:j=>{j.preventDefault(),x()},disabled:p,children:p?"Deleting...":"Delete"})]})]})})]})}const abe=[{id:"configure",label:"Configure Debug Session"},{id:"run",label:"Run / Inspect Flow"},{id:"report",label:"Report / Export"}],ibe="resolve_target_metadata",obe="token_exchange",lbe="resource_probe";function Rr({text:e}){return s.jsx(ji,{delayDuration:200,children:s.jsxs(Si,{children:[s.jsx(Ni,{type:"button",className:"inline-flex shrink-0 items-center",onClick:t=>t.preventDefault(),children:s.jsx(P9,{className:"h-3.5 w-3.5 text-muted-foreground/50 hover:text-muted-foreground"})}),s.jsx(qa,{className:"max-w-xs text-xs leading-relaxed",children:e})]})})}function Y$(e){return navigator.clipboard.writeText(e)}function pS(){return typeof window>"u"?"":window.location.port==="8685"?"http://127.0.0.1:8787":""}function hS(e){if(!e)return"No metadata payload captured.";try{return JSON.stringify(JSON.parse(e),null,2)}catch{return`Non-JSON response body:
|
|
152
|
+
${e}`}}function cbe(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(`
|
|
153
|
+
`)}
|
|
154
|
+
`}function ube(){const{source:e}=On(),{servers:t,reload:n,loading:r}=Ca(),[a,i]=m.useState("configure"),[o,c]=m.useState(""),[d,f]=m.useState("pre_registered"),[h,p]=m.useState("local_callback"),[v,x]=m.useState(!0),[j,b]=m.useState(!0),[y,S]=m.useState(!0),[N,_]=m.useState(""),[A,k]=m.useState(""),[E,P]=m.useState(""),[R,M]=m.useState(""),[D,U]=m.useState("__default__"),[F,G]=m.useState("{}"),[H,L]=m.useState(""),[I,Y]=m.useState(""),[W,O]=m.useState(""),[Q,q]=m.useState(""),[z,K]=m.useState(""),[J,ne]=m.useState(""),[he,ie]=m.useState(""),[me,se]=m.useState(""),[ge,Oe]=m.useState(null),[fe,xe]=m.useState(null),[we,ot]=m.useState([]),[lt,ut]=m.useState(!1),[At,Xe]=m.useState(!1),[Se,Ae]=m.useState(!1),[Je,dt]=m.useState("all"),[Pt,Xt]=m.useState("all"),[kt,nn]=m.useState("inspector"),Jt=m.useRef(null),zt=m.useRef(null),_e=m.useRef(!1),Qe=m.useRef(j);m.useEffect(()=>{Qe.current=j},[j]),m.useEffect(()=>()=>{Jt.current?.(),Jt.current=null},[]),m.useEffect(()=>{zt.current?.scrollIntoView({behavior:"smooth",block:"end"})},[we.length]);const Ze=m.useMemo(()=>t.filter(te=>te.authType==="oauth2").slice().sort((te,Fe)=>(te.name||te.id).localeCompare(Fe.name||Fe.id,void 0,{sensitivity:"base"})),[t]),_t=Ze.find(te=>te.id===o);m.useEffect(()=>{o&&(Ze.some(te=>te.id===o)||c(""))},[Ze,o]),m.useEffect(()=>{_t&&(_t.oauthMode==="dcr"?(f("dcr"),P(""),M("")):(f("pre_registered"),P(_t.oauthClientId??""),M(_t.oauthClientSecret??"")),_(_t.oauthScope??""),q(_t.oauthAuthorizationUrl??""),K(_t.oauthTokenEndpoint??""))},[_t?.id]);const Bt=m.useMemo(()=>{const te=ge?.stepStates.length??0,Fe=ge?.stepStates.filter(ke=>ke.status==="completed"||ke.status==="skipped").length??0,mt=ge?.stepStates.filter(ke=>ke.status==="failed").length??0,Qt=te>0?Math.round((Fe+mt)/te*100):0;return{total:te,completed:Fe,failed:mt,percent:Qt}},[ge]),ue=m.useMemo(()=>{const te=ge?.network??[],Fe=new Map,mt=[],Qt=ke=>`${ke.stepId}::${ke.label}::${ke.url}`;for(const ke of te){if(ke.phase==="request"){const Hn=mt.length;mt.push({key:ke.id,stepId:ke.stepId,label:ke.label,method:ke.method,url:ke.url,request:ke});const _n=Qt(ke),Xa=Fe.get(_n)??[];Xa.push(Hn),Fe.set(_n,Xa);continue}const en=Qt(ke),Ct=Fe.get(en),Kt=Ct?.shift();if(typeof Kt=="number"){mt[Kt]={...mt[Kt],response:ke},Ct&&Ct.length>0?Fe.set(en,Ct):Fe.delete(en);continue}mt.push({key:ke.id,stepId:ke.stepId,label:ke.label,method:ke.method,url:ke.url,response:ke})}return mt.filter(ke=>Je!=="all"&&ke.stepId!==Je?!1:Pt==="error"?typeof ke.response?.status=="number"&&ke.response.status>=400:Pt==="ok"?typeof ke.response?.status=="number"&&ke.response.status<400:!0)},[ge?.network,Je,Pt]),Ke=!!fe,De=!!(ge&&(ge.status==="completed"||ge.status==="error"||ge.status==="stopped")),re=m.useMemo(()=>{const te=new Map;return(ge?.stepStates??[]).forEach((Fe,mt)=>{te.set(Fe.id,mt+1)}),te},[ge?.stepStates]),Ne=m.useMemo(()=>{const te=(ge?.network??[]).filter(Fe=>Fe.phase==="response");return{resourceMetadata:te.find(Fe=>Fe.label==="Protected Resource Metadata"),authorizationServerMetadata:te.find(Fe=>Fe.label==="Authorization Server Metadata")}},[ge?.network]),Ue=m.useMemo(()=>{const te=new Map;for(const Fe of ge?.network??[]){const mt=te.get(Fe.stepId)??{requests:[],responses:[]};Fe.phase==="request"&&mt.requests.push(Fe),Fe.phase==="response"&&mt.responses.push(Fe),te.set(Fe.stepId,mt)}return te},[ge?.network]),B=te=>{if(te==="configure"||te==="run"&&Ke||te==="report"&&De)return i(te)},oe=()=>{let te;if(d==="dcr"&&F.trim())try{te=JSON.parse(F)}catch{throw new Error("DCR metadata JSON is invalid")}if(!_t)throw new Error("Select an MCP server");return{profile:"latest",target:{serverName:_t.id,overrides:{authorizationServerMetadataUrl:W||void 0,authorizationEndpoint:Q||void 0,tokenEndpoint:z||void 0,registrationEndpoint:J||void 0,cimdUrl:H||void 0,resourceBaseUrl:he||void 0}},registrationMethod:d,clientConfig:{preRegistered:d==="pre_registered"?{clientId:E.trim(),clientSecret:R.trim()||void 0,tokenEndpointAuthMethod:D==="__default__"?void 0:D||void 0}:void 0,dcr:d==="dcr"?{metadata:te,tokenEndpointAuthMethod:D==="__default__"?void 0:D||void 0}:void 0,cimd:d==="cimd"?{cimdUrl:H||void 0,expectedClientId:I||void 0}:void 0},runtime:{redirectMode:h,scopes:N.split(/[,\s]+/).map(Fe=>Fe.trim()).filter(Boolean),resource:A.trim()||void 0,usePkce:y,codeChallengeMethod:"S256"},display:{showSensitiveValues:v}}},de=te=>{Jt.current?.(),Jt.current=e.subscribeOAuthDebuggerSession(te,Fe=>{ot(Qt=>[...Qt,Fe]),(Fe.type==="completed"||Fe.type==="error"||Fe.type==="stopped")&&ut(!1),e.getOAuthDebuggerSession(te).then(Qt=>{Oe(Qt.session),Qt.session.uiHints.authorizationUrl&&Le(`${pS()}/api/oauth-debugger/sessions/${te}/authorize`),Qt.session.status==="completed"&&i("report")}).catch(()=>{})})},Le=te=>{!Qe.current||_e.current||!te||(_e.current=!0,window.open(te,"_blank","noopener,noreferrer"))},$e=async()=>{Xe(!0),_e.current=!1;try{const te=oe(),Fe=await e.createOAuthDebuggerSession(te);xe(Fe.sessionId),Oe(Fe.session),ot([]),i("run"),de(Fe.sessionId);const mt=await e.startOAuthDebuggerSession(Fe.sessionId);Oe(mt.session),ut(!0),(mt.session.status==="waiting_for_user"||mt.session.status==="waiting_for_browser_callback")&&(ut(!1),mt.session.uiHints.authorizationUrl&&Le(`${pS()}/api/oauth-debugger/sessions/${Fe.sessionId}/authorize`))}catch(te){Me({title:"Could not start OAuth Debugger session",description:te instanceof Error?te.message:String(te),variant:"destructive"})}finally{Xe(!1)}},Ge=async()=>{if(fe)try{Xe(!0);const te=await e.submitOAuthDebuggerManualCallback(fe,{redirectUrl:me.trim()||void 0});Oe(te.session),se(""),ut(!0)}catch(te){Me({title:"Could not submit callback",description:te instanceof Error?te.message:String(te),variant:"destructive"})}finally{Xe(!1)}},Ie=async()=>{if(fe){Ae(!0);try{const te=await e.stopOAuthDebuggerSession(fe);if(ut(!1),te.status!=="running"){const Fe=await e.getOAuthDebuggerSession(fe);Oe(Fe.session),Fe.session.status==="completed"?i("report"):i("run")}}catch(te){Me({title:"Could not stop session",description:te instanceof Error?te.message:String(te),variant:"destructive"})}finally{Ae(!1)}}},V=async()=>{Jt.current?.(),Jt.current=null,Oe(null),xe(null),ot([]),ut(!1),Ae(!1),Xe(!1),se(""),dt("all"),Xt("all"),nn("inspector"),i("run"),await $e()},ve=async te=>{if(!(!fe||!ge))try{const Fe=await e.exportOAuthDebuggerSession(fe,te);let mt="";const Qt=te==="json"?"json":te==="raw"?"txt":"md";typeof Fe=="string"?mt=Fe:mt=`${JSON.stringify(Fe,null,2)}
|
|
155
|
+
`;const ke=new Blob([mt],{type:"text/plain;charset=utf-8"}),en=URL.createObjectURL(ke),Ct=document.createElement("a");Ct.href=en,Ct.download=`oauth-debugger-${fe}.${Qt}`,Ct.click(),URL.revokeObjectURL(en)}catch(Fe){if(te==="markdown"){const mt=cbe(ge,we),Qt=new Blob([mt],{type:"text/markdown;charset=utf-8"}),ke=URL.createObjectURL(Qt),en=document.createElement("a");en.href=ke,en.download=`oauth-debugger-${ge.id}.md`,en.click(),URL.revokeObjectURL(ke);return}Me({title:"Export failed",description:Fe instanceof Error?Fe.message:String(Fe),variant:"destructive"})}},Ee=fe?`${pS()}/api/oauth-debugger/sessions/${fe}/authorize`:void 0,tt=te=>te==="error"?"destructive":te==="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:abe.map(te=>{const Fe=a===te.id,mt=te.id==="configure"||te.id==="run"&&Ke||te.id==="report"&&De;return s.jsx("button",{type:"button",onClick:()=>mt&&B(te.id),disabled:!mt,className:"rounded-full",children:s.jsx(st,{variant:Fe?"default":"outline",className:mt?"":"opacity-50",children:te.label})},te.id)})})]}),a==="configure"&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs(nt,{children:[s.jsx(Lt,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(Ft,{className:"text-base",children:"Target MCP Server"}),s.jsx(Er,{children:"Select one MCP server from Libraries and optionally override endpoints."})]}),s.jsxs(Z,{type:"button",variant:"outline",size:"sm",onClick:()=>{n()},disabled:r,children:[s.jsx(zs,{className:`mr-2 h-4 w-4 ${r?"animate-spin":""}`}),"Refresh Servers"]})]})}),s.jsx(rt,{className:"space-y-3",children:s.jsxs("div",{className:"max-w-xl space-y-2",children:[s.jsx(Ve,{children:"MCP Server"}),s.jsxs(In,{value:o,onValueChange:c,children:[s.jsx(Tn,{children:s.jsx($n,{placeholder:"Select an MCP server"})}),s.jsx(Rn,{children:Ze.map(te=>s.jsx(gt,{value:te.id,children:te.name||te.id},te.id))})]}),Ze.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"}),"."]}),_t&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:[_t.transport," ·"," ",_t.url||_t.command||"No URL/command"," · ",s.jsxs("span",{className:"text-primary",children:[_t.oauthMode==="dcr"?"DCR":"pre-registered"," fields pre-filled"]})]})]})})]}),s.jsxs(nt,{children:[s.jsxs(Lt,{className:"pb-3",children:[s.jsx(Ft,{className:"text-base",children:"Client Registration Method"}),s.jsx(Er,{children:"How your OAuth client is identified with the authorization server."})]}),s.jsxs(rt,{className:"space-y-3",children:[s.jsx("div",{className:"grid gap-2 md:grid-cols-3",children:[{id:"pre_registered",label:"Pre-registered client",hint:"You already have a client_id issued by the authorization server."},{id:"dcr",label:"Dynamic Client Registration",hint:"The server issues a client_id automatically at the start of the flow (RFC 7591)."},{id:"cimd",label:"Client ID Metadata Document",hint:"The client identifies itself via a hosted JSON metadata document at a public URL (RFC 9728)."}].map(te=>s.jsxs("button",{type:"button",onClick:()=>f(te.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 shrink-0 rounded-full ${d===te.id?"bg-primary":"bg-muted-foreground/30"}`}),s.jsx("span",{className:"text-sm font-medium",children:te.label})]}),s.jsx("p",{className:"mt-1 pl-5 text-xs text-muted-foreground",children:te.hint})]},te.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.jsxs(Ve,{className:"text-xs flex items-center gap-1",children:["Redirect mode",s.jsx(Rr,{text:"Local callback (recommended): MCP Lab automatically captures the redirect after you log in — no copy-pasting needed. Manual: you complete the browser login and then paste the final redirect URL back here."})]}),s.jsxs(In,{value:h,onValueChange:te=>p(te),children:[s.jsx(Tn,{children:s.jsx($n,{})}),s.jsxs(Rn,{children:[s.jsx(gt,{value:"local_callback",children:"Local callback (recommended)"}),s.jsx(gt,{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.jsxs(Ve,{className:"text-xs flex items-center gap-1",children:["client_id",s.jsx(Rr,{text:"The unique identifier for your application, issued by the authorization server when you registered the client."})]}),s.jsx(Et,{value:E,onChange:te=>P(te.target.value)})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs(Ve,{className:"text-xs flex items-center gap-1",children:["client_secret",s.jsx(Rr,{text:"Leave empty for public clients (e.g. SPAs or mobile apps). Required for confidential clients that authenticate with the token endpoint."})]}),s.jsx(Et,{value:R,onChange:te=>M(te.target.value),type:"password",placeholder:"optional"})]})]}),d==="cimd"&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs(Ve,{className:"text-xs flex items-center gap-1",children:["CIMD URL",s.jsx(Rr,{text:"A publicly reachable URL hosting a JSON document that describes this client. The authorization server fetches it to identify the client."})]}),s.jsx(Et,{value:H,onChange:te=>L(te.target.value),placeholder:"https://.../client-metadata.json"})]})]})]}),s.jsxs(nt,{children:[s.jsxs(Lt,{className:"pb-3",children:[s.jsx(Ft,{className:"text-base",children:"Runtime OAuth Inputs"}),s.jsx(Er,{children:"Parameters sent in the authorization request."})]}),s.jsxs(rt,{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{className:"text-xs",children:"Scopes"}),s.jsx(Et,{value:N,onChange:te=>_(te.target.value),placeholder:"openid profile email"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Space or comma separated. Leave empty to use scopes auto-discovered from the server metadata."})]}),s.jsxs("div",{className:"flex items-center gap-2 md:col-span-2",children:[s.jsx(wr,{checked:y,onCheckedChange:te=>S(!!te)}),s.jsxs(Ve,{className:"flex items-center gap-1",children:["Use PKCE (S256)",s.jsx(Rr,{text:"Proof Key for Code Exchange — generates a one-time code verifier so the authorization code can't be hijacked. Recommended for all clients; required for public clients."})]})]}),s.jsxs("div",{className:"flex items-center gap-2 md:col-span-2",children:[s.jsx(wr,{checked:j,onCheckedChange:te=>b(!!te)}),s.jsx(Ve,{children:"Auto-open browser when authorization URL is ready"})]})]})]}),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.jsxs(Ve,{className:"text-xs flex items-center gap-1",children:["Token endpoint auth method",s.jsx(Rr,{text:"How your client authenticates when exchanging the authorization code for a token. Choose 'none' for public clients (no secret). Leave as server default if unsure."})]}),s.jsxs(In,{value:D,onValueChange:U,children:[s.jsx(Tn,{children:s.jsx($n,{placeholder:"Server default (recommended)"})}),s.jsxs(Rn,{children:[s.jsx(gt,{value:"__default__",children:"Server default (let the server decide)"}),s.jsx(gt,{value:"client_secret_basic",children:"client_secret_basic — credentials in Authorization header"}),s.jsx(gt,{value:"client_secret_post",children:"client_secret_post — credentials in request body"}),s.jsx(gt,{value:"none",children:"none — public client, no secret"}),s.jsx(gt,{value:"private_key_jwt",children:"private_key_jwt — signed JWT assertion"})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:'Use "server default" unless the server requires a specific method.'})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs(Ve,{className:"text-xs flex items-center gap-1",children:["Resource / audience",s.jsx(Rr,{text:"Some servers (RFC 8707) require the target API's URI in the token request to scope the token. Only set this if your server explicitly requires it."})]}),s.jsx(Et,{value:A,onChange:te=>k(te.target.value),placeholder:"https://api.example.com"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional. Only needed for servers that use resource indicators."})]})]}),d==="dcr"&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs(Ve,{className:"text-xs flex items-center gap-1",children:["DCR metadata JSON",s.jsx(Rr,{text:'Extra fields for the dynamic client registration request (RFC 7591), e.g. {"client_name": "My App"}. redirect_uris and grant_types are always added automatically.'})]}),s.jsx(wa,{value:F,onChange:te=>G(te.target.value),className:"min-h-32 font-mono text-xs"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional extra fields for the registration request body."})]}),d==="cimd"&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs(Ve,{className:"text-xs flex items-center gap-1",children:["Expected client_id",s.jsx(Rr,{text:"If you know what client_id the server should assign from the metadata document, enter it here for verification. Leave blank to accept whatever the server returns."})]}),s.jsx(Et,{value:I,onChange:te=>Y(te.target.value),placeholder:"optional"})]}),s.jsxs("div",{className:"rounded-md border bg-background p-3",children:[s.jsx("div",{className:"mb-1 text-sm font-medium",children:"Endpoint overrides"}),s.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:"Override specific endpoints if auto-discovery fails or you want to test against a specific URL. Leave blank to use what the server advertises."}),s.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsxs(Ve,{className:"text-xs flex items-center gap-1",children:["Authorization server metadata URL",s.jsx(Rr,{text:"The /.well-known/oauth-authorization-server URL. Override if the server uses a non-standard path."})]}),s.jsx(Et,{value:W,onChange:te=>O(te.target.value),placeholder:"https://.../.well-known/oauth-authorization-server"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs(Ve,{className:"text-xs flex items-center gap-1",children:["Resource server base URL",s.jsx(Rr,{text:"The MCP server's base URL used to look up its /.well-known/oauth-protected-resource metadata. Override if the server uses a different base path."})]}),s.jsx(Et,{value:he,onChange:te=>ie(te.target.value),placeholder:"https://resource.example.com"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs(Ve,{className:"text-xs flex items-center gap-1",children:["Authorization endpoint",s.jsx(Rr,{text:"The URL where users are redirected to log in and grant consent. Normally discovered automatically from the server metadata."})]}),s.jsx(Et,{value:Q,onChange:te=>q(te.target.value),placeholder:"https://.../authorize"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs(Ve,{className:"text-xs flex items-center gap-1",children:["Token endpoint",s.jsx(Rr,{text:"The URL your app calls to exchange the authorization code for an access token. Normally discovered automatically."})]}),s.jsx(Et,{value:z,onChange:te=>K(te.target.value),placeholder:"https://.../token"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs(Ve,{className:"text-xs flex items-center gap-1",children:["Registration endpoint (DCR)",s.jsx(Rr,{text:"The URL used to dynamically register a new client (RFC 7591). Only relevant when using DCR. Override if the server doesn't advertise it in its metadata."})]}),s.jsx(Et,{value:J,onChange:te=>ne(te.target.value),placeholder:"https://.../register"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs(Ve,{className:"text-xs flex items-center gap-1",children:["CIMD URL override",s.jsx(Rr,{text:"Override the Client ID Metadata Document URL. Use this if the server doesn't discover it automatically or you want to test with a specific metadata document."})]}),s.jsx(Et,{value:H,onChange:te=>L(te.target.value),placeholder:"https://.../client-metadata.json"})]})]})]}),s.jsxs(fl,{children:[s.jsx(My,{className:"h-4 w-4"}),s.jsx(pl,{children:"Secrets display"}),s.jsxs(hl,{className:"space-y-2",children:[s.jsx("p",{children:"By default, full tokens and secrets are visible in the network inspector and exports — useful for debugging but not for sharing."}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(wr,{checked:!v,onCheckedChange:te=>x(te===!1)}),s.jsx(Ve,{children:"Hide sensitive values in inspector"})]})]})]})]})]}),s.jsx("div",{className:"flex justify-end",children:s.jsxs(Z,{type:"button",onClick:()=>{$e()},disabled:At,children:[At&&s.jsx(jr,{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(nt,{className:"xl:col-span-1 min-w-0",children:[s.jsx(Lt,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(Ft,{className:"text-base",children:"Progress"}),s.jsx(Er,{children:"Visual OAuth flow guide with live session events and next-step actions."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[ge?.uiHints.authorizationUrl&&Ee&&s.jsx(Z,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsxs("a",{href:Ee,target:"_blank",rel:"noopener noreferrer",children:[s.jsx(Xh,{className:"mr-2 h-4 w-4"}),"Open Authorization URL"]})}),s.jsxs(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>{V()},disabled:At,children:[s.jsx(zs,{className:"mr-2 h-4 w-4"}),"Restart"]}),fe&&s.jsxs(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>{Ie()},disabled:Se||!fe,children:[(Se||lt)&&Se&&s.jsx(jr,{className:"mr-2 h-4 w-4 animate-spin"}),s.jsx(Ld,{className:"mr-2 h-4 w-4"}),"Stop Debug Session"]})]})]})}),s.jsxs(rt,{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:[Bt.completed+Bt.failed,"/",Bt.total," steps"]}),s.jsxs("span",{children:[Bt.percent,"%"]})]}),s.jsx(Hv,{value:Bt.percent,className:"h-2"})]}),ge?.status==="waiting_for_user"&&s.jsx(nt,{children:s.jsxs(rt,{className:"pt-4 space-y-2",children:[s.jsx("div",{className:"text-sm font-medium",children:"Manual callback required"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Open the authorization URL, complete authentication, then paste the final redirect URL here."}),s.jsx(wa,{value:me,onChange:te=>se(te.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(Z,{type:"button",size:"sm",onClick:()=>{Ge()},disabled:At||!me.trim(),children:[At&&s.jsx(jr,{className:"mr-2 h-4 w-4 animate-spin"}),"Continue"]}),ge.uiHints.authorizationUrl&&Ee&&s.jsx(Z,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx("a",{href:Ee,target:"_blank",rel:"noopener noreferrer",children:"Open Authorization URL"})})]})]})}),ge?.status==="waiting_for_browser_callback"&&s.jsxs(fl,{children:[s.jsx(My,{className:"h-4 w-4"}),s.jsx(pl,{children:"Waiting for browser callback"}),s.jsxs(hl,{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:ge.uiHints.callbackUrl}),ge.uiHints.authorizationUrl&&Ee&&s.jsx("div",{className:"pt-2",children:s.jsx(Z,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsxs("a",{href:Ee,target:"_blank",rel:"noopener noreferrer",children:[s.jsx(Xh,{className:"mr-2 h-4 w-4"}),"Open Authorization URL"]})})})]})]}),s.jsx("div",{className:"space-y-2",children:ge?.stepStates.map(te=>{const Fe=re.get(te.id),mt=Ue.get(te.id),Qt=te.id===obe||te.id===lbe,ke=!!(mt&&(mt.requests.length>0||mt.responses.length>0)),en=Qt&&te.status!=="pending"&&ke;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:"min-w-0 flex items-start gap-2",children:[s.jsx("div",{className:"mt-0.5 inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full border bg-muted text-xs font-semibold",children:Fe}),s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"inline-flex items-center gap-1 text-sm font-medium",children:[s.jsx("span",{children:te.title}),te.status==="completed"&&s.jsx(ga,{className:"h-4 w-4 shrink-0 text-emerald-600","aria-hidden":"true"})]}),s.jsx("div",{className:"text-xs text-muted-foreground",children:te.description})]})]}),s.jsx(st,{variant:te.status==="failed"?"destructive":te.status==="completed"?"outline":te.status==="active"?"secondary":"outline",className:te.status==="completed"?"border-emerald-300 bg-emerald-50 text-emerald-700":void 0,children:te.status})]}),te.outcomeSummary&&s.jsx("p",{className:"mt-2 text-xs text-muted-foreground break-all whitespace-pre-line",children:te.outcomeSummary}),te.id===ibe&&s.jsxs("details",{className:"mt-3 rounded-md border bg-muted/20 p-3",children:[s.jsx("summary",{className:"cursor-pointer text-xs font-semibold text-muted-foreground",children:"OAuth Metadata Sources"}),s.jsxs("div",{className:"mt-3 space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-xs font-medium",children:"Resource Metadata"}),s.jsxs("p",{className:"text-xs text-muted-foreground break-all",children:["From ",Ne.resourceMetadata?.url??"not captured"]}),s.jsx("pre",{className:"max-h-56 overflow-x-auto rounded-md bg-muted p-2 text-xs",children:hS(Ne.resourceMetadata?.bodyText)})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-xs font-medium",children:"Authorization Server Metadata"}),s.jsxs("p",{className:"text-xs text-muted-foreground break-all",children:["From"," ",Ne.authorizationServerMetadata?.url??"not captured"]}),s.jsx("pre",{className:"max-h-56 overflow-x-auto rounded-md bg-muted p-2 text-xs",children:hS(Ne.authorizationServerMetadata?.bodyText)})]})]})]}),en&&mt&&s.jsxs("details",{className:"mt-3 rounded-md border bg-muted/20 p-3",children:[s.jsx("summary",{className:"cursor-pointer text-xs font-semibold text-muted-foreground",children:"Captured exchange details"}),s.jsx("div",{className:"mt-3 space-y-3",children:Array.from({length:Math.max(mt.requests.length,mt.responses.length)}).map((Ct,Kt)=>{const Hn=mt.requests[Kt],_n=mt.responses[Kt];return s.jsxs("div",{className:"rounded-md border bg-background p-2",children:[s.jsx("div",{className:"text-xs font-medium",children:Hn?.label??_n?.label??`Exchange ${Kt+1}`}),s.jsxs("p",{className:"mt-1 text-xs text-muted-foreground break-all",children:[Hn?.method?`${Hn.method} `:"",Hn?.url??_n?.url??"-"]}),typeof _n?.status=="number"&&s.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["HTTP ",_n.status]}),Hn?.bodyText&&s.jsx("pre",{className:"mt-2 max-h-40 overflow-auto rounded bg-muted p-2 text-xs",children:Hn.bodyText}),_n?.bodyText&&s.jsx("pre",{className:"mt-2 max-h-48 overflow-auto rounded bg-muted p-2 text-xs",children:hS(_n.bodyText)})]},`${te.id}-exchange-${Kt}`)})})]})]},te.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 min-w-0",children:s.jsxs(nt,{children:[s.jsx(Lt,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(Ft,{className:"text-base",children:"Inspect"}),s.jsx(Er,{children:"Live events and network requests/responses for the OAuth flow."})]}),s.jsxs(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>{ve("raw")},disabled:!fe||!ge,children:[s.jsx(Ir,{className:"mr-2 h-4 w-4"}),"Copy/Export Raw Trace"]})]})}),s.jsx(rt,{className:"space-y-3",children:s.jsxs(Dv,{value:kt,onValueChange:te=>nn(te),className:"min-w-0",children:[s.jsxs(up,{className:"grid grid-cols-2",children:[s.jsx(za,{value:"inspector",children:"Network Inspector"}),s.jsx(za,{value:"events",children:"Live Debug"})]}),s.jsx(Lf,{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:[we.length===0?s.jsx("p",{className:"text-muted-foreground",children:"No events yet."}):we.map((te,Fe)=>s.jsxs("div",{className:"break-all",children:[s.jsx("span",{className:"mr-2 font-mono text-muted-foreground",children:new Date(te.ts).toLocaleTimeString()}),s.jsx(st,{variant:"outline",className:"mr-2 text-[10px]",children:te.type}),typeof te.payload.message=="string"?te.payload.message:JSON.stringify(te.payload)]},`${te.ts}-${Fe}`)),s.jsx("div",{ref:zt})]})}),s.jsxs(Lf,{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(Ve,{className:"text-xs",children:"Filter by step"}),s.jsxs(In,{value:Je,onValueChange:dt,children:[s.jsx(Tn,{className:"h-8",children:s.jsx($n,{})}),s.jsxs(Rn,{children:[s.jsx(gt,{value:"all",children:"All steps"}),(ge?.stepStates??[]).map(te=>s.jsxs(gt,{value:te.id,children:[re.get(te.id),". ",te.title]},te.id))]})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{className:"text-xs",children:"Filter by status"}),s.jsxs(In,{value:Pt,onValueChange:Xt,children:[s.jsx(Tn,{className:"h-8",children:s.jsx($n,{})}),s.jsxs(Rn,{children:[s.jsx(gt,{value:"all",children:"All"}),s.jsx(gt,{value:"ok",children:"Successful responses"}),s.jsx(gt,{value:"error",children:"Error responses"})]})]})]})]}),s.jsx("div",{className:"max-h-[34rem] min-w-0 space-y-2 overflow-auto",children:ue.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No network exchanges captured yet."}):ue.map(te=>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 flex items-start gap-2",children:[s.jsx("div",{className:"mt-0.5 inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full border bg-muted text-xs font-semibold",children:re.get(te.stepId)}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium",children:te.label}),s.jsxs("div",{className:"text-xs text-muted-foreground break-all",children:[te.method?`${te.method} `:"",te.url]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(st,{variant:"outline",children:"request"}),s.jsx(st,{variant:"outline",children:"response"}),typeof te.response?.status=="number"&&s.jsx(st,{variant:te.response.status>=400?"destructive":"secondary",children:te.response.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:"Request Headers"}),s.jsx("pre",{className:"max-h-40 max-w-full overflow-auto whitespace-pre-wrap break-all rounded bg-muted p-2 text-xs",children:JSON.stringify(te.request?.headers??{},null,2)})]}),te.request?.bodyText&&s.jsxs("div",{children:[s.jsx("div",{className:"mb-1 text-xs font-medium",children:"Request Body"}),s.jsx("pre",{className:"max-h-64 max-w-full overflow-auto whitespace-pre-wrap break-all rounded bg-muted p-2 text-xs",children:te.request.bodyText})]}),s.jsxs("div",{children:[s.jsx("div",{className:"mb-1 text-xs font-medium",children:"Response Headers"}),s.jsx("pre",{className:"max-h-40 max-w-full overflow-auto whitespace-pre-wrap break-all rounded bg-muted p-2 text-xs",children:JSON.stringify(te.response?.headers??{},null,2)})]}),te.response?.bodyText&&s.jsxs("div",{children:[s.jsx("div",{className:"mb-1 text-xs font-medium",children:"Response Body"}),s.jsx("pre",{className:"max-h-64 max-w-full overflow-auto whitespace-pre-wrap break-all rounded bg-muted p-2 text-xs",children:te.response.bodyText})]}),s.jsx("div",{className:"flex gap-2",children:s.jsxs(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>{Y$(JSON.stringify(te,null,2))},children:[s.jsx(ss,{className:"mr-2 h-4 w-4"}),"Copy JSON"]})})]})]},te.key))})]})]})})]})})]})}),a==="report"&&ge&&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(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>i("configure"),children:"Back to Configure"}),s.jsxs(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>{ve("json")},children:[s.jsx(Ir,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>{ve("markdown")},children:[s.jsx(Ir,{className:"mr-2 h-4 w-4"}),"Export Markdown"]}),s.jsxs(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>{ve("raw")},children:[s.jsx(Ir,{className:"mr-2 h-4 w-4"}),"Copy/Export Raw Trace"]})]})]}),s.jsxs(fl,{children:[s.jsx(My,{className:"h-4 w-4"}),s.jsx(pl,{children:"Secrets display mode"}),s.jsx(hl,{children:ge.summary?.showSensitiveValues?"This session is configured to show full tokens and secrets in network logs/exports.":"Sensitive values are hidden in the inspector for this session."})]}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[s.jsx(nt,{children:s.jsxs(rt,{className:"pt-4",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Status"}),s.jsx("div",{className:"text-lg font-semibold",children:ge.status})]})}),s.jsx(nt,{children:s.jsxs(rt,{className:"pt-4",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Requests"}),s.jsx("div",{className:"text-lg font-semibold",children:ge.networkSummary.requestCount})]})}),s.jsx(nt,{children:s.jsxs(rt,{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:ge.networkSummary.errorCount})]})}),s.jsx(nt,{children:s.jsxs(rt,{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:ge.validations.length})]})})]}),s.jsxs(nt,{children:[s.jsx(Lt,{className:"pb-3",children:s.jsx(Ft,{className:"text-base",children:"Key values"})}),s.jsxs(rt,{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx(Ve,{className:"text-xs",children:"Issuer"}),s.jsx("p",{className:"text-sm break-all",children:ge.summary?.issuer||"-"})]}),s.jsxs("div",{children:[s.jsx(Ve,{className:"text-xs",children:"Client ID"}),s.jsx("p",{className:"text-sm break-all",children:ge.summary?.clientId||"-"})]}),s.jsxs("div",{children:[s.jsx(Ve,{className:"text-xs",children:"Redirect URI"}),s.jsx("p",{className:"text-sm break-all",children:ge.summary?.redirectUri||"-"})]}),s.jsxs("div",{children:[s.jsx(Ve,{className:"text-xs",children:"Token endpoint status"}),s.jsx("p",{className:"text-sm",children:ge.summary?.tokenEndpointStatus??"-"})]}),s.jsxs("div",{children:[s.jsx(Ve,{className:"text-xs",children:"Token type"}),s.jsx("p",{className:"text-sm",children:ge.summary?.tokenType||"-"})]}),s.jsxs("div",{children:[s.jsx(Ve,{className:"text-xs",children:"Scopes granted"}),s.jsx("p",{className:"text-sm break-all",children:(ge.summary?.grantedScopes??[]).join(", ")||"-"})]}),s.jsxs("div",{children:[s.jsx(Ve,{className:"text-xs",children:"Token validity"}),s.jsxs("p",{className:"text-sm",children:[typeof ge.summary?.accessTokenValidForSeconds=="number"?`${SN(ge.summary.accessTokenValidForSeconds)} remaining`:typeof ge.summary?.accessTokenExpiresInSeconds=="number"?`${SN(ge.summary.accessTokenExpiresInSeconds)} from issuance`:"No expiry advertised by token endpoint",ge.summary?.accessTokenExpiresAt?s.jsxs(s.Fragment,{children:[" (until ",s.jsx("span",{children:new Date(ge.summary.accessTokenExpiresAt).toLocaleTimeString()}),")"]}):""]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Source:"," ",ge.summary?.accessTokenExpirySource==="expires_in"?"token endpoint expires_in":ge.summary?.accessTokenExpirySource==="jwt_exp"?"JWT exp claim":"not available"]})]}),s.jsxs("div",{children:[s.jsx(Ve,{className:"text-xs",children:"Refresh option"}),s.jsx("p",{className:"text-sm",children:ge.summary?.refreshTokenAvailable?"Refresh token available (silent refresh possible)":"No refresh token in response (full login likely required after expiry)"})]}),ge.summary?.accessToken&&s.jsxs("div",{className:"md:col-span-2 space-y-1",children:[s.jsx(Ve,{className:"text-xs",children:"Access token"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("code",{className:"flex-1 truncate rounded bg-muted px-2 py-1 text-xs font-mono text-muted-foreground",children:[ge.summary.accessToken.slice(0,48),"…"]}),s.jsxs(Z,{type:"button",size:"sm",variant:"outline",className:"shrink-0 h-7 px-2 text-xs",onClick:()=>{Y$(ge.summary.accessToken)},children:[s.jsx(ss,{className:"mr-1 h-3 w-3"}),"Copy token"]})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:['Visible because "Hide sensitive values" is off. Use this token with the CLI via'," ",s.jsx("code",{className:"font-mono",children:"--oauth-token"}),"."]})]})]})]}),s.jsxs(nt,{children:[s.jsx(Lt,{className:"pb-3",children:s.jsx(Ft,{className:"text-base",children:"Validation findings"})}),s.jsx(rt,{className:"space-y-2",children:ge.validations.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No validation findings recorded."}):ge.validations.map((te,Fe)=>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:Fe+1}),s.jsx("span",{className:"font-bold",children:te.title})]}),s.jsx(st,{variant:tt(te.severity),children:te.severity})]}),s.jsxs("p",{className:"text-sm",children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",te.detail]}),te.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:te.recommendation})]}),s.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Step: ",te.stepId,te.specReference&&s.jsxs(s.Fragment,{children:[" · ",s.jsx("a",{href:te.specReference,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"Spec reference"})]})]})]},te.id))})]})]})]})}var Gv="Switch",[dbe]=Sr(Gv),[fbe,pbe]=dbe(Gv),jq=m.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,[v,x]=m.useState(null),j=Mt(t,_=>x(_)),b=m.useRef(!1),y=v?h||!!v.closest("form"):!0,[S,N]=js({prop:a,defaultProp:i??!1,onChange:f,caller:Gv});return s.jsxs(fbe,{scope:n,checked:S,disabled:c,children:[s.jsx(ft.button,{type:"button",role:"switch","aria-checked":S,"aria-required":o,"data-state":_q(S),"data-disabled":c?"":void 0,disabled:c,value:d,...p,ref:j,onClick:qe(e.onClick,_=>{N(A=>!A),y&&(b.current=_.isPropagationStopped(),b.current||_.stopPropagation())})}),y&&s.jsx(Cq,{control:v,bubbles:!b.current,name:r,value:d,checked:S,required:o,disabled:c,form:h,style:{transform:"translateX(-100%)"}})]})});jq.displayName=Gv;var Sq="SwitchThumb",Nq=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,a=pbe(Sq,n);return s.jsx(ft.span,{"data-state":_q(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});Nq.displayName=Sq;var hbe="SwitchBubbleInput",Cq=m.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...a},i)=>{const o=m.useRef(null),c=Mt(o,i),d=Rv(n),f=_g(t);return m.useEffect(()=>{const h=o.current;if(!h)return;const p=window.HTMLInputElement.prototype,x=Object.getOwnPropertyDescriptor(p,"checked").set;if(d!==n&&x){const j=new Event("click",{bubbles:r});x.call(h,n),h.dispatchEvent(j)}},[d,n,r]),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}})});Cq.displayName=hbe;function _q(e){return e?"checked":"unchecked"}var Aq=jq,mbe=Nq;const hg=m.forwardRef(({className:e,...t},n)=>s.jsx(Aq,{className:Re("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(mbe,{className:Re("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")})}));hg.displayName=Aq.displayName;function gbe(e){const t=e.filter(n=>typeof n.sourcePath=="string"&&n.sourcePath.trim().length>0&&typeof n.relativePath=="string"&&n.relativePath.trim().length>0).map(n=>[n.sourcePath,n.relativePath]);return new Map(t)}function vbe(e){const t=e.filter(n=>typeof n.sourcePath=="string"&&n.sourcePath.trim().length>0).map(n=>[n.sourcePath,n.configName?.trim()||n.name]);return new Map(t)}function xbe(e,t){const n=new Map;for(const r of e){if(!r.sourcePath)continue;const a=new Map,i=r.scenarioEntries&&r.scenarioEntries.length>0?r.scenarioEntries:r.scenarios.map(o=>({kind:"inline",scenario:o}));for(const o of i){if(o.kind==="inline"){a.set(o.scenario.id,o.scenario.name?.trim()||o.scenario.id);continue}const c=t.find(d=>d.id===o.ref);a.set(o.ref,c?.name?.trim()||o.ref)}n.set(r.sourcePath,a)}return n}function mS(e,t){const n=t.get(e);if(n)return n;const r=e.replace(/\\/g,"/"),a="/evals/",i=r.lastIndexOf(a);if(i>=0)return r.slice(i+a.length);const o=r.split("/").filter(Boolean);return o.length<=1?r:o.slice(-3).join("/")}function gS(e,t,n){const r=t.get(n);if(!e||e.length===0){if(r&&r.size===1){const i=r.values().next().value;if(i)return i}return"All scenarios"}if(!r)return e.length===1?e[0]:`${e[0]} +${e.length-1}`;const a=e.map(i=>r.get(i)??i);return a.length===1?a[0]:`${a[0]} +${a.length-1}`}const vS="mcplab.runEvaluation.activeJobId";function ybe(e){return e.configName?.trim()||e.name}function bbe(e){if(e.suitePath?.trim())return e.suitePath.trim();if(e.relativePath?.includes("/")){const t=e.relativePath.lastIndexOf("/");return e.relativePath.slice(0,t)}return null}function Wn(){return new Date().toLocaleTimeString()}const wbe=()=>{const[e]=Pi(),[t,n]=m.useState(""),[r,a]=m.useState("1"),[i,o]=m.useState(!1),[c,d]=m.useState(0),[f,h]=m.useState([]),[p,v]=m.useState(!1),[x,j]=m.useState(!1),[b,y]=m.useState(""),[S,N]=m.useState(null),[_,A]=m.useState([]),[k,E]=m.useState([]),[P,R]=m.useState(!1),[M,D]=m.useState([]),[U,F]=m.useState({}),[G,H]=m.useState({}),[L,I]=m.useState(""),[Y,W]=m.useState([]),[O,Q]=m.useState([]),[q,z]=m.useState([]),[K,J]=m.useState(!1),[ne,he]=m.useState(null),ie=m.useRef(null),me=m.useRef(null),se=m.useRef(!1),{configs:ge,reload:Oe}=Yf(),{source:fe}=On(),{agents:xe,scenarios:we,servers:ot,reload:lt}=Ca(),ut=b.trim(),At=ut?`/results/${encodeURIComponent(ut)}${t?`?configId=${encodeURIComponent(t)}`:""}`:"/results",Xe=ge.find(re=>re.id===t),Se=m.useMemo(()=>gbe(ge),[ge]),Ae=m.useMemo(()=>vbe(ge),[ge]),Je=m.useMemo(()=>xbe(ge,we),[ge,we]),dt=O[0]??null,Pt=e.get("configId"),Xt=m.useMemo(()=>{if(!Xe)return[];const re=new Map,Ne=Xe.agentEntries&&Xe.agentEntries.length>0?Xe.agentEntries:Xe.agents.map(Ue=>({kind:"inline",agent:Ue}));for(const Ue of Ne){if(Ue.kind==="inline"){const oe=Ue.agent.id;re.has(oe)||re.set(oe,Ue.agent);continue}const B=xe.find(oe=>oe.id===Ue.ref);B&&!re.has(B.id)&&re.set(B.id,B)}for(const Ue of xe)re.has(Ue.id)||re.set(Ue.id,Ue);return Array.from(re.values())},[Xe,xe]),kt=m.useMemo(()=>{if(!Xe)return[];const re=new Map,Ne=Xe.scenarioEntries&&Xe.scenarioEntries.length>0?Xe.scenarioEntries:Xe.scenarios.map(Ue=>({kind:"inline",scenario:Ue}));for(const Ue of Ne){if(Ue.kind==="inline"){re.has(Ue.scenario.id)||re.set(Ue.scenario.id,Ue.scenario);continue}const B=we.find(oe=>oe.id===Ue.ref);B&&!re.has(B.id)&&re.set(B.id,B)}return Array.from(re.values())},[Xe,we]),nn=m.useMemo(()=>{const re=new Map;for(const Ne of ot)re.has(Ne.id)||re.set(Ne.id,{id:Ne.id,name:Ne.name});for(const Ne of Xe?.servers??[])re.set(Ne.id,{id:Ne.id,name:Ne.name});return Array.from(re.values()).sort((Ne,Ue)=>Ne.id.localeCompare(Ue.id))},[Xe?.servers,ot]);m.useEffect(()=>{Pt&&ge.some(re=>re.id===Pt)&&n(Pt)},[Pt,ge]);const Jt=m.useRef("");m.useEffect(()=>{const re=Xe?`${Xe.id}::${Xe.sourcePath??""}`:"";if(re===Jt.current)return;if(Jt.current=re,!Xe){A([]),E([]),R(!1),D([]),F({}),H({});return}const Ne=bN(Xe);A(Ne.length>0?Ne:Xt.map(Ue=>Ue.id)),E(kt.map(Ue=>Ue.id)),R(!1),D([]),F({}),H({})},[Xe?.id,Xe?.sourcePath,Xt,kt]);const zt=async()=>{if(!Xe?.sourcePath){h(Ie=>[...Ie,`[${Wn()}] Missing source path for selected config.`]);return}const re=Xt.filter(Ie=>_.includes(Ie.id));if(re.length===0){h(Ie=>[...Ie,`[${Wn()}] Select at least one agent.`]);return}const Ne=kt.filter(Ie=>k.includes(Ie.id)),Ue=new Set(Ne.map(Ie=>Ie.id)),B=P||Object.values(U).some(Boolean),oe=Object.fromEntries(Object.entries(G).filter(([Ie])=>Ue.has(Ie)&&U[Ie])),de=Ne.map(Ie=>{const V=oe[Ie.id]??(P?M:Ie.serverIds||[]);return`${Ie.id}=[${V.join(", ")}]`}).join("; ");if(Ne.length===0){h(Ie=>[...Ie,`[${Wn()}] Select at least one test.`]);return}if(P&&M.length===0){h(Ie=>[...Ie,`[${Wn()}] Select at least one server for "Override MCP Servers for Selected Tests", or turn that override off.`]);return}const Le=Object.entries(oe).filter(([,Ie])=>!Array.isArray(Ie)||Ie.length===0).map(([Ie])=>Ie);if(Le.length>0){h(Ie=>[...Ie,`[${Wn()}] Select at least one server for per-scenario overrides on: ${Le.join(", ")}, or turn those overrides off.`]);return}const $e=Array.from(new Set(Ne.flatMap(Ie=>B?oe[Ie.id]?oe[Ie.id]??[]:P?M:Ie.serverIds||[]:Ie.serverIds||[]).filter(Ie=>{const V=(Xe.servers??[]).find(Ee=>Ee.id===Ie),ve=ot.find(Ee=>Ee.id===Ie);return(V||ve)?.authType==="oauth2"})));try{$e.length>0&&(J(!0),await vi({serverNames:$e,source:fe,onServerAuthStart:Ie=>{h(V=>[...V,`[${Wn()}] OAuth login required for '${Ie}'. Complete the browser sign-in flow...`])}}),h(Ie=>[...Ie,`[${Wn()}] OAuth login completed for required server(s): ${$e.join(", ")}.`]))}catch(Ie){const V=Ie instanceof Error?Ie.message:String(Ie);h(ve=>[...ve,`[${Wn()}] OAuth error: ${V}`]),J(!1);return}finally{J(!1)}o(!0),v(!1),j(!1),y("");const Ge=(Xe.serverEntries??[]).some(Ie=>Ie.kind==="referenced")||(Xe.agentEntries??[]).some(Ie=>Ie.kind==="referenced")||(Xe.scenarioEntries??[]).some(Ie=>Ie.kind==="referenced")?"refs-composed":"single-file/inline";h([`[${Wn()}] Starting evaluation run...`,`[${Wn()}] Config=${Xe.name} mode=${Ge} agents=${re.map(Ie=>Ie.name||Ie.id).join(", ")} tests=${Ne.map(Ie=>Ie.id).join(", ")} runs=${Number(r)}${L.trim()?` note=${L.trim()}`:""}`,`[${Wn()}] Effective MCP servers per selected test: ${de||"(none)"}`]),d(10);try{const{jobId:Ie}=await fe.startRun({configPath:Xe.sourcePath,runsPerScenario:Number(r),agents:re.map(V=>V.id),scenarioIds:Ne.map(V=>V.id),...B&&P?{serverOverrideAll:M}:{},...B&&Object.keys(oe).length>0?{scenarioServerOverrides:oe}:{},runNote:L.trim()?L.trim():void 0});N(Ie),_t(Ie),De(Ie),Bt()}catch(Ie){const V=Ie instanceof Error?Ie.message:String(Ie),ve=V.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(Ee=>[...Ee,`[${Wn()}] Error: ${V}${ve}`]),o(!1),d(0),N(null),J(!1)}},_e=()=>{zt()},Qe=()=>{S&&fe.stopRun(S),me.current?.(),me.current=null,Ze(),N(null),o(!1),v(!1),j(!0),h(re=>[...re,`[${Wn()}] Run aborted by user.`]),Bt()};m.useEffect(()=>{ie.current&&(ie.current.scrollTop=ie.current.scrollHeight)},[f]),m.useEffect(()=>()=>{me.current?.()},[]),m.useEffect(()=>{if(S||p)return;let re="";try{re=sessionStorage.getItem(vS)??""}catch{re=""}if(re)return N(re),o(!0),v(!1),j(!1),h(Ne=>Ne.length>0?Ne:[`[${Wn()}] Reattached to in-progress evaluation run...`]),De(re),()=>{}},[S,p]);const Ze=()=>{try{sessionStorage.removeItem(vS)}catch{}},_t=re=>{try{sessionStorage.setItem(vS,re)}catch{}},Bt=async()=>{try{const re=await fe.getRunQueue();W(re.queued),Q(re.active_jobs??(re.active?[re.active]:[])),z(re.admitting_jobs??[]);const Ne=S==null?void 0:re.queued.find(Ue=>Ue.jobId===S&&Ue.status==="blocked_auth"&&Ue.blockedReason==="oauth_required");Ne&&(Ne.requiredServers??[]).length>0?he(Ue=>Ue?.jobId===Ne.jobId?Ue:{jobId:Ne.jobId,servers:Ne.requiredServers}):(ne?.jobId&&ne.jobId!==S||S!=null&&!re.queued.some(Ue=>Ue.jobId===S&&Ue.status==="blocked_auth"&&Ue.blockedReason==="oauth_required"))&&he(null)}catch{}},ue=()=>{Oe(),lt()};m.useEffect(()=>{ue(),Bt();const re=()=>{ue(),Bt()};return window.addEventListener("focus",re),()=>{window.removeEventListener("focus",re)}},[Oe,lt]);const Ke=async re=>{try{await fe.removeQueuedRun(re),W(Ne=>Ne.filter(Ue=>Ue.jobId!==re))}catch(Ne){const Ue=Ne instanceof Error?Ne.message:String(Ne);if(Ue.includes("Use the /stop endpoint"))try{await fe.stopRun(re)}catch{}else Me({title:"Could not remove queued run",description:Ue,variant:"destructive"})}Bt()},De=re=>{S===re&&me.current||(me.current?.(),me.current=fe.subscribeRunJob(re,Ne=>{const Ue=new Date(Ne.ts).toLocaleTimeString();if(Ne.type==="queued"){h(B=>{const oe=Ne.payload.position?` (position ${Ne.payload.position})`:"",de=`[${Ue}] Run queued${oe}. Waiting for active run to finish...`;return B.includes(de)?B:[...B,de]}),d(5);return}if(Ne.type==="oauth_required"){const B=Array.isArray(Ne.payload.servers)?Ne.payload.servers:[],oe=String(Ne.payload.jobId??"");he({jobId:oe,servers:B}),h(de=>{const Le=`[${Ue}] OAuth required for server(s): ${B.join(", ")}. Click "Connect & Resume" to authenticate.`;return de.includes(Le)?de:[...de,Le]});return}if(Ne.type==="started"&&(he(null),se.current=!1,o(!0),v(!1),j(!1),h(B=>{const oe=`[${Ue}] Run started.`;return B.includes(oe)?B:[...B,oe]}),d(B=>Math.max(B,30)),Bt()),Ne.type==="log"){const B=String(Ne.payload.message??"").trim();B&&(h(oe=>{const de=`[${Ue}] ${B}`;return oe.includes(de)?oe:[...oe,de]}),d(oe=>{const de=B.toLowerCase();if(de.startsWith("loading mcp evaluation config"))return Math.max(oe,15);if(de.startsWith("loaded config"))return Math.max(oe,20);if(de.startsWith("selected "))return Math.max(oe,30);if(de.startsWith("using requested agents")||de.startsWith("using run default agents")||de.startsWith("using config-declared agents"))return Math.max(oe,35);if(de.startsWith("expanded to "))return Math.max(oe,45);if(de.startsWith("running evaluation"))return Math.max(oe,50);const Le=de.match(/^scenario (\d+)\/(\d+) finished:/);if(Le){const $e=Number(Le[1]),Ge=Number(Le[2]);return Math.max(oe,50+Math.round($e/Ge*25))}return de.startsWith("evaluation execution finished")?Math.max(oe,78):de.startsWith("writing results to ")?Math.max(oe,94):de.startsWith("run finished:")?Math.max(oe,98):oe}))}if(Ne.type==="completed"){const B=String(Ne.payload.runId??"").trim();he(null),se.current=!1,h(oe=>{const de=`[${Ue}] Run completed.`;return oe.includes(de)?oe:[...oe,de]}),d(100),o(!1),v(!0),j(!1),y(B),Ze(),N(null),me.current?.(),me.current=null,Bt()}if(Ne.type==="error"){const B=String(Ne.payload.message??"Unknown error"),oe=B.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.":"";he(null),se.current=!1,h(de=>[...de,`[${Ue}] Error: ${B}${oe}`]),o(!1),v(!1),j(!1),d(0),Ze(),N(null),me.current?.(),me.current=null,Bt()}}))};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(va,{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(nt,{children:s.jsxs(rt,{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(Ve,{children:"MCP Evaluation"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(In,{value:t,onValueChange:n,children:[s.jsx(Tn,{children:s.jsx($n,{placeholder:"Select a config"})}),s.jsx(Rn,{children:ge.map(re=>{const Ne=bbe(re);return s.jsxs(gt,{value:re.id,children:[s.jsx("span",{children:ybe(re)}),Ne&&s.jsxs("span",{className:"ml-2 text-muted-foreground",children:["(",Ne,")"]})]},re.id)})})]}),s.jsx(Z,{type:"button",variant:"outline",size:"icon",className:"h-10 w-10 shrink-0",onClick:ue,"aria-label":"Refresh configs",title:"Refresh configs",children:s.jsx(zs,{className:"h-4 w-4"})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:"Variance Runs"}),s.jsx(Et,{type:"number",min:"1",max:"10",value:r,onChange:re=>a(re.target.value)})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Ve,{htmlFor:"run-note",children:"Run Note"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[L.length,"/500"]})]}),s.jsx(wa,{id:"run-note",value:L,onChange:re=>I(re.target.value.slice(0,500)),placeholder:"Optional context for this run (for example: mcp-server v1.8.2 #staging)",rows:2})]}),Xe&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Ve,{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:()=>A(Xt.map(re=>re.id)),children:"Select all"}),s.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>A([]),children:"Clear"})]})]}),s.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:Xt.map(re=>{const Ne=_.includes(re.id);return s.jsxs("label",{className:"flex items-center gap-2 text-sm rounded-md border p-2",children:[s.jsx(wr,{checked:Ne,onCheckedChange:Ue=>{const B=Ue===!0;A(oe=>B?[...oe,re.id]:oe.filter(de=>de!==re.id))}}),s.jsx("span",{children:re.name||re.id})]},re.id)})}),Xt.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents available. Add agents to your workspace library, or define inline agents in this config."})]}),Xe&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Ve,{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:()=>E(kt.map(re=>re.id)),children:"Select all"}),s.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>E([]),children:"Clear"})]})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[k.length," of ",kt.length," selected"]}),s.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:kt.map(re=>{const Ne=k.includes(re.id),Ue=G[re.id],B=!!U[re.id],oe=B&&Array.isArray(Ue),de=new Set(re.serverIds||[]);return s.jsxs("div",{className:"flex flex-col gap-2 text-sm rounded-md border p-2 cursor-pointer",onClick:Le=>{const $e=Le.target;$e&&($e.closest("button, a, input, select, textarea, [role='button']")||E(Ge=>Ne?Ge.filter(Ie=>Ie!==re.id):[...Ge,re.id]))},children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(wr,{checked:Ne,onCheckedChange:Le=>{const $e=Le===!0;E(Ge=>$e?[...Ge,re.id]:Ge.filter(Ie=>Ie!==re.id))}}),s.jsxs("span",{className:"min-w-0",children:[s.jsxs("span",{className:"block font-medium",children:[re.name||re.id," ",oe&&s.jsx("span",{className:"rounded bg-primary/10 px-1.5 py-0.5 text-[10px] text-primary",children:"Override"})]}),s.jsx("span",{className:"block font-mono text-xs text-muted-foreground truncate",children:re.id})]})]}),Ne&&s.jsxs("div",{className:"pl-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Ve,{className:"text-[11px] text-muted-foreground",children:'Per-scenario: "Override MCP Servers"'}),s.jsx(hg,{checked:B,onCheckedChange:Le=>{if(F($e=>({...$e,[re.id]:Le})),!Le)H($e=>{const Ge={...$e};return delete Ge[re.id],Ge});else if(!G[re.id]){const $e=P&&M.length>0?[...M]:[...re.serverIds||[]];H(Ge=>({...Ge,[re.id]:$e}))}}})]}),B&&s.jsx("div",{className:"mt-1 flex flex-wrap gap-1.5",children:nn.map(Le=>{const $e=Le.id,Ge=(Ue??[]).includes($e),Ie=de.has($e);return s.jsx(st,{variant:Ge?"default":"outline",className:`cursor-pointer text-xs ${Ge?"":"opacity-60 hover:opacity-100"}`,style:!Ge&&Ie?{borderColor:"hsl(var(--primary))"}:void 0,onClick:V=>{V.stopPropagation(),H(ve=>{const Ee=ve[re.id]??[],tt=Ee.includes($e)?Ee.filter(te=>te!==$e):[...Ee,$e];return{...ve,[re.id]:tt}})},children:Le.name?.trim()?Le.name:$e},$e)})})]})]},re.id)})}),s.jsxs("div",{className:"space-y-1 rounded-md border p-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"text-xs",children:[s.jsx("span",{children:"Override MCP Servers for selected Tests "}),s.jsx("span",{className:"text-muted-foreground",children:"Selected tests run against the servers you choose here. Applies only to this run."})]}),s.jsx(hg,{checked:P,onCheckedChange:R})]}),P&&s.jsx("div",{className:"flex flex-wrap gap-1.5",children:nn.map(re=>{const Ne=re.id,Ue=M.includes(Ne);return s.jsx(st,{variant:Ue?"default":"outline",className:`cursor-pointer text-xs ${Ue?"":"opacity-60 hover:opacity-100"}`,onClick:()=>D(B=>B.includes(Ne)?B.filter(oe=>oe!==Ne):[...B,Ne]),children:re.name?.trim()?re.name:Ne},Ne)})})]})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(Z,{onClick:_e,disabled:!t||K||Xt.length>0&&_.length===0||kt.length>0&&k.length===0,children:[s.jsx(va,{className:"mr-2 h-4 w-4"}),dt?"Queue Run":"Run"]}),i&&s.jsxs(Z,{variant:"destructive",onClick:Qe,children:[s.jsx(Ld,{className:"mr-2 h-4 w-4"}),"Stop"]})]})]})}),(i||f.length>0)&&s.jsxs(nt,{children:[s.jsx(Lt,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Ft,{className:"text-base",children:"Progress"}),s.jsxs("span",{className:"text-xs text-muted-foreground font-mono",children:[Math.round(c),"%"]})]})}),s.jsxs(rt,{className:"space-y-4",children:[s.jsx(Hv,{value:c,className:"h-2"}),ne&&s.jsxs("div",{className:"flex items-center justify-between rounded-md border border-yellow-500/40 bg-yellow-500/10 px-3 py-2 text-sm",children:[s.jsxs("span",{className:"text-yellow-700 dark:text-yellow-400",children:["OAuth required for: ",s.jsx("strong",{children:ne.servers.join(", ")})]}),s.jsx(Z,{size:"sm",variant:"outline",disabled:K,onClick:()=>{se.current||(se.current=!0,J(!0),vi({serverNames:ne.servers,source:fe,onServerAuthStart:re=>{h(Ne=>[...Ne,`[${Wn()}] OAuth sign-in opened for '${re}'...`])}}).then(()=>fe.resumeQueue()).then(()=>{const re=ne?.jobId;h(Ne=>[...Ne,`[${Wn()}] OAuth complete. Resuming run...`]),re&&(N(re),_t(re),o(!0),v(!1),De(re))}).catch(re=>{const Ne=re instanceof Error?re.message:String(re);h(Ue=>[...Ue,`[${Wn()}] OAuth error: ${Ne}`]),se.current=!1}).finally(()=>{J(!1)}))},children:K?"Connecting...":"Connect & Resume"})]}),s.jsx("div",{ref:ie,className:"h-64 overflow-auto rounded-md border bg-muted/30 p-3 font-mono text-xs space-y-0.5",children:f.map((re,Ne)=>s.jsx("div",{className:re.includes("✓")?"text-success":re.includes("aborted")?"text-destructive":"text-foreground",children:re},Ne))})]})]}),s.jsxs(nt,{children:[s.jsx(Lt,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(Ft,{className:"inline-flex items-center gap-2 text-base",children:[s.jsx(xa,{className:"h-4 w-4"}),"Run Queue"]}),s.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>{Bt()},children:s.jsx(zs,{className:"h-3 w-3"})})]})}),s.jsx(rt,{children:!dt&&q.length===0&&Y.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:[O.map(re=>s.jsxs("div",{role:"button",tabIndex:0,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===re.jobId?"ring-2 ring-primary/40":""}`,onClick:()=>{S!==re.jobId&&(N(re.jobId),_t(re.jobId),o(!0),v(!1),j(!1),h([`[${Wn()}] Attached to running job ${re.jobId}...`]),d(10),De(re.jobId))},onKeyDown:Ne=>{Ne.key!=="Enter"&&Ne.key!==" "||S!==re.jobId&&(Ne.preventDefault(),N(re.jobId),_t(re.jobId),o(!0),v(!1),j(!1),h([`[${Wn()}] Attached to running job ${re.jobId}...`]),d(10),De(re.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:"text-xs font-bold",children:Ae.get(re.runParams.configPath)||gS(re.runParams.scenarioIds,Je,re.runParams.configPath)}),s.jsx("span",{className:"font-mono text-xs",children:mS(re.runParams.configPath,Se)}),re.runParams.agents&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:["agents: ",re.runParams.agents.join(", ")]}),re.runParams.runNote&&s.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["note: ",re.runParams.runNote]})]}),s.jsxs(Z,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-destructive hover:text-destructive hover:bg-destructive/10",onClick:Ne=>{Ne.stopPropagation(),fe.stopRun(re.jobId),Bt()},title:"Stop running job",children:[s.jsx(Ld,{className:"mr-1 h-3 w-3"}),"Stop"]})]},re.jobId)),q.map(re=>{const Ne=mS(re.runParams.configPath,Se),Ue=gS(re.runParams.scenarioIds,Je,re.runParams.configPath),B=Ae.get(re.runParams.configPath)||Ue,oe=re.status==="blocked_auth";return s.jsx("div",{className:`flex items-center justify-between rounded-md border p-2 text-sm ${oe?"border-yellow-500/40 bg-yellow-500/5":"border-primary/20 bg-primary/5"}`,children:s.jsxs("div",{className:"min-w-0 flex items-center gap-2 flex-wrap",children:[s.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${oe?"bg-yellow-500/15 text-yellow-700 dark:text-yellow-400":"bg-primary/10 text-primary"}`,children:oe?"Retrying OAuth":"Starting"}),s.jsx("span",{className:"text-xs font-bold",children:B}),s.jsx("span",{className:"font-mono text-xs",children:Ne}),oe&&(re.requiredServers??[]).length>0&&s.jsxs("span",{className:"text-xs text-yellow-700 dark:text-yellow-400",children:["OAuth: ",re.requiredServers.join(", ")]})]})},re.jobId)}),Y.map((re,Ne)=>{const Ue=mS(re.runParams.configPath,Se),B=gS(re.runParams.scenarioIds,Je,re.runParams.configPath),oe=Ae.get(re.runParams.configPath)||B,de=re.status==="blocked_auth";return s.jsxs("div",{className:`flex items-center justify-between rounded-md border p-2 text-sm ${de?"border-yellow-500/40 bg-yellow-500/5":""}`,children:[s.jsxs("div",{className:"min-w-0 flex items-center gap-2 flex-wrap",children:[de?s.jsxs("span",{className:"inline-flex items-center rounded-full bg-yellow-500/15 px-2 py-0.5 text-xs font-medium text-yellow-700 dark:text-yellow-400",children:["#",Ne+1," Blocked"]}):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:"text-xs font-bold",children:oe}),s.jsx("span",{className:"font-mono text-xs",children:Ue}),de&&(re.requiredServers??[]).length>0&&s.jsxs("span",{className:"text-xs text-yellow-700 dark:text-yellow-400",children:["OAuth: ",re.requiredServers.join(", ")]}),!de&&re.runParams.agents&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:["agents: ",re.runParams.agents.join(", ")]}),re.runParams.runNote&&s.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["note: ",re.runParams.runNote]})]}),s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[de&&s.jsx(Z,{size:"sm",variant:"outline",className:"h-7 text-xs border-yellow-500/50 text-yellow-700 dark:text-yellow-400 hover:bg-yellow-500/10",disabled:K,onClick:()=>{if(se.current)return;const Le=re.requiredServers??[];Le.length!==0&&(se.current=!0,he({jobId:re.jobId,servers:Le}),J(!0),vi({serverNames:Le,source:fe,onServerAuthStart:$e=>{h(Ge=>[...Ge,`[${Wn()}] OAuth sign-in opened for '${$e}'...`])}}).then(()=>fe.resumeQueue()).then(()=>{h($e=>[...$e,`[${Wn()}] OAuth complete. Resuming run...`]),N(re.jobId),_t(re.jobId),o(!0),v(!1),De(re.jobId)}).catch($e=>{const Ge=$e instanceof Error?$e.message:String($e);h(Ie=>[...Ie,`[${Wn()}] OAuth error: ${Ge}`]),se.current=!1}).finally(()=>{J(!1)}))},children:K&&ne?.jobId===re.jobId?"Connecting...":"Connect & Resume"}),s.jsx(Z,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:()=>{Ke(re.jobId)},title:"Remove from queue",children:s.jsx(ns,{className:"h-4 w-4"})})]})]},re.jobId)})]})})]}),x&&!i&&!p&&s.jsx(nt,{className:"border-amber-300/60 bg-amber-50/40",children:s.jsx(rt,{className:"pt-6",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[s.jsx(Ld,{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(Z,{type:"button",variant:"outline",onClick:()=>{h([]),d(0),j(!1)},children:"Clear Progress"}),s.jsxs(Z,{type:"button",onClick:_e,disabled:!t,children:[s.jsx(va,{className:"mr-2 h-4 w-4"}),"Run Again"]})]})]})})}),p&&s.jsx(nt,{className:"border-success/50",children:s.jsx(rt,{className:"pt-6",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(ga,{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(Z,{asChild:!0,className:"ml-auto",children:s.jsx(Tt,{to:At,children:ut?"View Results":"View Runs"})})]})})})]})};function kq({title:e,description:t,expanded:n,onToggleExpanded:r,onHide:a,messages:i,pendingToolCalls:o,loading:c,input:d,onInputChange:f,onSend:h,onCancel:p,inputPlaceholder:v,snippets:x,snippetsLabel:j="Result Assistant Snippets",onSnippetSelect:b,onApproveToolCall:y,onDenyToolCall:S,chatEndRef:N,inputRef:_,renderMessage:A,renderMessageExtras:k,className:E="min-w-0 overflow-hidden xl:flex xl:h-full xl:min-h-0 xl:flex-col",contentClassName:P="flex h-[70vh] min-h-[520px] flex-col p-0 xl:h-auto xl:min-h-0 xl:flex-1"}){return s.jsxs(nt,{className:E,children:[s.jsx(Lt,{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(Ft,{className:"flex items-center gap-2 text-base",children:[s.jsx(Zr,{className:"h-4 w-4 text-amber-500"}),e]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[s.jsxs(Z,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:r,children:[n?s.jsx(_S,{className:"h-3.5 w-3.5"}):s.jsx(AS,{className:"h-3.5 w-3.5"}),n?"Compact":"Expand"]}),s.jsx(Z,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:a,children:"Hide"})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:t})]})}),s.jsxs(rt,{className:P,children:[s.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto bg-muted/15 px-4 py-4",children:s.jsxs("div",{className:"space-y-3 pr-2",children:[i.map((R,M)=>{const D=R.role==="user",U=R.role==="assistant",F=R.role==="system",G=R.role==="tool",H=R.pendingToolCallId?o.find(I=>I.id===R.pendingToolCallId):void 0;return A?A({message:R,index:M,linkedPendingToolCall:H,isUser:D,isAssistant:U,isSystem:F,isTool:G}):U&&!!R.pendingToolCallId?s.jsxs("div",{className:"rounded-md border bg-background p-3",children:[s.jsx(Fs,{text:R.text,className:"text-sm"}),H&&s.jsx(wN,{call:H,loading:c,onApprove:y,onDeny:S,className:"mt-3"})]},`${R.id??`${R.role}-${M}`}-tool`):s.jsx(L6,{message:R},R.id??`${R.role}-${M}`)}),k,c&&s.jsx(F6,{}),s.jsx("div",{ref:N})]})}),s.jsx("div",{className:"border-t bg-background px-4 py-3",children:s.jsx(z6,{input:d,onInputChange:f,onSend:h,onCancel:p,inputPlaceholder:v,snippets:x,snippetsLabel:j,onSnippetSelect:b,loading:c,inputRef:_})})]})]})}function Pd(e){return e instanceof dC&&e.status===404}function Eq(e){const{source:t,open:n,scope:r,runId:a,onSessionSync:i}=e,[o,c]=m.useState(null),[d,f]=m.useState([]),[h,p]=m.useState([]),[v,x]=m.useState(""),[j,b]=m.useState(!1),[y,S]=m.useState(!1),N=m.useRef(null),_=m.useRef(null),A=m.useRef(0),k=m.useRef(t),E=m.useRef(i),P=m.useRef(null),R=m.useRef(null);m.useEffect(()=>{N.current=o},[o]),m.useEffect(()=>{k.current=t},[t]),m.useEffect(()=>{E.current=i},[i]);const M=m.useCallback(()=>{const O=_.current;O&&O.controller.abort()},[]),D=m.useCallback((O,Q)=>{c(Q??O.id),f(q=>q.length>O.messages.length?q:O.messages),p(O.pendingToolCalls),E.current?.(O)},[]),U=m.useCallback(async(O,Q)=>{const q=Q.session.id||O;D(Q.session,q)},[D]),F=m.useCallback(()=>{const O=_.current;O&&(M(),x(O.prompt),b(!1),S(!1))},[M]),G=m.useCallback(async()=>{const O=v.trim();if(!O||r==="run"&&!a)return;const Q=++A.current,q=new AbortController,z=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,K={id:z,role:"user",text:O,createdAt:new Date().toISOString()};_.current={id:Q,controller:q,prompt:O},S(!0),x(""),f(J=>[...J,K]),b(!0);try{let J=o;if(!J){const ne=r==="run"&&a?await t.createResultAssistantSession({runId:a,scope:"run"},q.signal):await t.createResultAssistantSession({scope:"all_runs"},q.signal);if(q.signal.aborted||_.current?.id!==Q)return;J=ne.sessionId||ne.session.id,D(ne.session,J),f(he=>he.some(me=>me.id===z)?[...ne.session.messages,K]:ne.session.messages)}try{const ne=await t.sendResultAssistantMessage(J,O,q.signal);if(q.signal.aborted||_.current?.id!==Q)return;await U(J,ne)}catch(ne){if(jN(ne)||q.signal.aborted||_.current?.id!==Q)return;if(!Pd(ne))throw ne;const he=r==="run"&&a?await t.createResultAssistantSession({runId:a,scope:"run"},q.signal):await t.createResultAssistantSession({scope:"all_runs"},q.signal);if(q.signal.aborted||_.current?.id!==Q)return;const ie=he.sessionId||he.session.id;if(D(he.session,ie),f(se=>se.some(Oe=>Oe.id===z)?[...he.session.messages,K]:he.session.messages),q.signal.aborted||_.current?.id!==Q)return;const me=await t.sendResultAssistantMessage(ie,O,q.signal);if(q.signal.aborted||_.current?.id!==Q)return;await U(ie,me)}}catch(J){if(jN(J)||q.signal.aborted||_.current?.id!==Q)return;f(ne=>ne.filter(he=>he.id!==z)),Me({title:"MCP Lab Assistant error",description:J instanceof Error?J.message:String(J),variant:"destructive"})}finally{_.current?.id===Q&&(_.current=null,b(!1),S(!1))}},[v,r,a,o,t,D,U]),H=m.useCallback(async O=>{if(o){S(!1),b(!0);try{const Q=await t.approveResultAssistantToolCall(o,O);await U(o,Q)}catch(Q){Pd(Q)&&(c(null),p([])),Me({title:"Could not approve assistant action",description:Pd(Q)?"Assistant session expired. Ask a new question to start a fresh session.":Q instanceof Error?Q.message:String(Q),variant:"destructive"})}finally{b(!1)}}},[o,t,U]),L=m.useCallback(async O=>{if(o){S(!1),b(!0);try{const Q=await t.denyResultAssistantToolCall(o,O);await U(o,Q)}catch(Q){Pd(Q)&&(c(null),p([])),Me({title:"Could not deny assistant action",description:Pd(Q)?"Assistant session expired. Ask a new question to start a fresh session.":Q instanceof Error?Q.message:String(Q),variant:"destructive"})}finally{b(!1)}}},[o,t,U]),I=m.useCallback(()=>{M();const O=N.current;O&&t.closeResultAssistantSession(O).catch(()=>{}),N.current=null,c(null),f([]),p([]),x(""),S(!1)},[M,t]),Y=m.useCallback(O=>{f(Q=>Q.length>0?Q:[{id:`msg-${Date.now()}`,role:"assistant",text:O,createdAt:new Date().toISOString()}])},[]),W=m.useCallback(O=>{x(O),requestAnimationFrame(()=>R.current?.focus())},[]);return m.useEffect(()=>{if(!n)return;const O=window.setTimeout(()=>{P.current?.scrollIntoView({behavior:"smooth",block:"end"})},0);return()=>window.clearTimeout(O)},[n,d.length,j]),m.useEffect(()=>{const O=R.current;if(!O)return;O.style.height="0px";const Q=Math.min(O.scrollHeight,160);O.style.height=`${Math.max(40,Q)}px`},[v,n]),m.useEffect(()=>{if(!(!n||!o))return k.current.subscribeResultAssistantSessionEvents(o,O=>{D(O.payload.session,O.payload.sessionId)})},[n,o,D]),m.useEffect(()=>()=>{M();const O=N.current;O&&k.current.closeResultAssistantSession(O).catch(()=>{})},[M]),{assistantSessionId:o,assistantMessages:d,assistantPendingToolCalls:h,assistantInput:v,assistantLoading:j,assistantTurnCancelable:y,cancelAssistantTurn:F,assistantChatEndRef:P,assistantInputRef:R,setAssistantInput:x,setAssistantMessages:f,askAssistant:G,approveResultAssistantToolCall:H,denyResultAssistantToolCall:L,applyResultAssistantSnippet:W,ensureIntroMessage:Y,resetAssistantSession:I}}function Yh(e){const t=String(e??"").trim();return t&&(t.split("::").pop()??t).replace(/^mcplab__/,"").replace(/^mcplab_/,"").replace(/_/g," ").replace(/\s+/g," ").trim()||"unknown_tool"}async function Pq(e,t){const n=t.configPath?.trim();if(!n)throw new Error("This run has no config path in metadata.");const a=await e.getResult(t.id)??t,i=a.rerunAgents&&a.rerunAgents.length>0?a.rerunAgents:Array.from(new Set(a.scenarios.map(o=>o.agentId).filter(Boolean)));await e.startRun({configPath:n,runsPerScenario:1,scenarioIds:a.rerunScenarioIds,agents:i.length>0?i:void 0,runNote:a.runNote,serverOverrideAll:a.rerunServerOverrideAll,scenarioServerOverrides:a.rerunScenarioServerOverrides})}function Is(e,t){if(!Number.isFinite(e)||e<=0)return"0ms";if(e<1e3)return`${Math.round(e)}ms`;if(t?.preciseUnderTenSeconds&&e<1e4){const o=e/1e3,c=Math.round(o*10)/10;return`${Number.isInteger(c)?c.toFixed(0):c.toFixed(1)}s`}const n=Math.floor(e/1e3),r=Math.floor(n/3600),a=Math.floor(n%3600/60),i=n%60;return r>0?`${r}h ${a}m ${i}s`:a>0?`${a}m ${i}s`:`${i}s`}function TN(e){return e.runs.length>0?e.runs.reduce((t,n)=>t+n.duration,0):e.avgDuration}function mg(e){return e.scenarios.some(n=>n.runs.length>0)?e.scenarios.reduce((n,r)=>n+TN(r),0):typeof e.totalDurationMs=="number"&&e.totalDurationMs>=0?e.totalDurationMs:null}function RN(e){return e.runs.length>0?e.runs.reduce((t,n)=>t+n.toolCalls.reduce((r,a)=>r+a.duration,0),0):0}function gg(e){return e.scenarios.some(n=>n.runs.length>0)?e.scenarios.reduce((n,r)=>n+RN(r),0):typeof e.totalToolDurationMs=="number"&&e.totalToolDurationMs>=0?e.totalToolDurationMs:null}const X$=8,ON="mcplab:results:time-filter",bc=[{value:"15min",label:"Last 15min",durationMs:900*1e3},{value:"30min",label:"Last 30min",durationMs:1800*1e3},{value:"1h",label:"Last hour",durationMs:3600*1e3},{value:"24h",label:"Last 24 hours",durationMs:1440*60*1e3},{value:"7d",label:"Last 7 days",durationMs:10080*60*1e3},{value:"14d",label:"Last 14 days",durationMs:336*60*60*1e3},{value:"30d",label:"Last 30 days",durationMs:720*60*60*1e3}];function ol(e){if(!e.trim())return null;const t=new Date(e);return Number.isNaN(t.getTime())?null:t}function Fh(e){const t=ol(e);return t?t.toLocaleString():""}function jbe(e){const t=ol(e);if(!t)return e;const n=t.getUTCFullYear(),r=String(t.getUTCMonth()+1).padStart(2,"0"),a=String(t.getUTCDate()).padStart(2,"0");return`${n}-${r}-${a}`}function Sbe(e){const t=ol(e);return t?t.toLocaleDateString(void 0,{weekday:"long",month:"short",day:"numeric",year:"numeric",timeZone:"UTC"}):"Unknown day"}function Tq(e){return e==="all"||e==="last"||e==="custom"}function Rq(e){return e==="15min"||e==="30min"||e==="1h"||e==="24h"||e==="7d"||e==="14d"||e==="30d"}function Q$(e){const t=e.get("time_filter"),n=e.get("time_preset");return{mode:Tq(t)?t:"all",preset:Rq(n)?n:"15min",start:e.get("time_start")??"",end:e.get("time_end")??""}}function Nbe(e){return e.has("time_filter")||e.has("time_preset")||e.has("time_start")||e.has("time_end")}function Cbe(){try{const e=localStorage.getItem(ON);if(!e)return null;const t=JSON.parse(e),n=Tq(typeof t.mode=="string"?t.mode:null)?t.mode:"all",r=Rq(typeof t.preset=="string"?t.preset:null)?t.preset:"15min";return{mode:n,preset:r,start:typeof t.start=="string"?t.start:"",end:typeof t.end=="string"?t.end:""}}catch{return null}}const _be=[{label:"Summarize Run Trends",description:"Highlight the main changes across the selected runs.",prompt:"Summarize the main trends across these runs. Call out pass-rate changes, latency, and tool usage shifts."},{label:"Explain Failures",description:"Identify the most important failures and likely root causes.",prompt:"Identify the most important failures across these runs and explain likely root causes from the traces."},{label:"Compare Agents",description:"Compare agent behavior, tool use, and answer quality across runs.",prompt:"Compare agent behavior across these runs. Highlight differences in tool use, answer quality, and consistency."},{label:"Spot Anomalies",description:"Find outliers in latency, tool calls, or pass rate.",prompt:"Find unusual runs or outliers in latency, tool calls, or pass rate, and explain why they stand out."}],Td=100,Abe=()=>{const[e,t]=Pi(),{source:n}=On(),[r]=m.useState(()=>Nbe(e)?Q$(e):Cbe()??Q$(e)),[a,i]=m.useState([]),[o,c]=m.useState(!1),[d,f]=m.useState(null),[h,p]=m.useState(!1),[v,x]=m.useState("timestamp"),[j,b]=m.useState("desc"),[y,S]=m.useState("all"),[N,_]=m.useState(!1),[A,k]=m.useState(r.mode),[E,P]=m.useState(r.preset),[R,M]=m.useState(r.start),[D,U]=m.useState(r.end),[F,G]=m.useState(!1),[H,L]=m.useState(!1),[I,Y]=m.useState(!1),W=Kv(Td),{offset:O,totalCount:Q,hasMore:q}=W,[z,K]=m.useState(null),J=y==="all"?void 0:y,ne=m.useMemo(()=>{if(A==="all")return{};if(A==="last"){const De=bc.find(Ue=>Ue.value===E)??bc[0],re=new Date;return{since:new Date(re.getTime()-De.durationMs).toISOString(),until:re.toISOString()}}const ue=ol(R),Ke=ol(D);return ue&&Ke?ue.getTime()<=Ke.getTime()?{since:ue.toISOString(),until:Ke.toISOString()}:{since:Ke.toISOString(),until:ue.toISOString()}:ue?{since:ue.toISOString()}:Ke?{until:Ke.toISOString()}:{}},[D,A,E,R]),he=ue=>{if(v===ue){b(Ke=>Ke==="asc"?"desc":"asc");return}x(ue),b(ue==="timestamp"?"desc":"asc")},ie=async()=>{c(!0);try{if(n.listRunSummariesPage){const ue=await n.listRunSummariesPage({...ne,scenario:J,limit:Td,offset:O});W.updateMeta(ue),i(ue.data.map(il))}else if(n.listRunSummaries){const ue=await n.listRunSummaries({...ne,scenario:J,limit:Td,offset:O});W.setTotalCount(ue.length),W.setHasMore(!1),i(ue.map(il))}else W.setTotalCount(0),W.setHasMore(!1),i(await n.listResults())}catch(ue){Me({title:"Could not load results",description:ue instanceof Error?ue.message:String(ue),variant:"destructive"})}finally{c(!1)}};m.useEffect(()=>{let ue=!0;return c(!0),(n.listRunSummariesPage?n.listRunSummariesPage({...ne,scenario:J,limit:Td,offset:O}).then(De=>(ue&&W.updateMeta(De),De.data.map(il))):n.listRunSummaries?n.listRunSummaries({...ne,scenario:J,limit:Td,offset:O}).then(De=>(ue&&(W.setTotalCount(De.length),W.setHasMore(!1)),De.map(il))):n.listResults()).then(De=>{ue&&i(De)}).catch(De=>{ue&&Me({title:"Could not load results",description:De instanceof Error?De.message:String(De),variant:"destructive"})}).finally(()=>{ue&&c(!1)}),()=>{ue=!1}},[J,ne,O,n]);const{assistantMessages:me,assistantPendingToolCalls:se,assistantInput:ge,assistantLoading:Oe,assistantTurnCancelable:fe,cancelAssistantTurn:xe,assistantChatEndRef:we,assistantInputRef:ot,setAssistantInput:lt,askAssistant:ut,approveResultAssistantToolCall:At,denyResultAssistantToolCall:Xe,applyResultAssistantSnippet:Se,ensureIntroMessage:Ae}=Eq({source:n,open:H,scope:"all_runs"}),Je=m.useMemo(()=>{const ue=new Map;return a.forEach(Ke=>{Ke.scenarios.forEach(De=>{const re=String(De.scenarioName??"").trim(),Ne=String(De.scenarioId??"").trim();if(Ne){ue.set(Ne,re||Ne);return}re&&ue.set(re,re)})}),Array.from(ue.entries()).map(([Ke,De])=>({value:Ke,label:De})).sort((Ke,De)=>Ke.label.localeCompare(De.label))},[a]);m.useEffect(()=>{const ue=(e.get("scenario")??"").trim();if(ue){if(Je.some(Ke=>Ke.value===ue||Ke.label===ue)){S(ue);return}a.length>0&&S("all")}},[e,Je,a.length]),m.useEffect(()=>{const ue=new URLSearchParams(e);A==="all"?(ue.delete("time_filter"),ue.delete("time_preset"),ue.delete("time_start"),ue.delete("time_end")):A==="last"?(ue.set("time_filter","last"),ue.set("time_preset",E),ue.delete("time_start"),ue.delete("time_end")):(ue.set("time_filter","custom"),ue.delete("time_preset"),R.trim()?ue.set("time_start",R.trim()):ue.delete("time_start"),D.trim()?ue.set("time_end",D.trim()):ue.delete("time_end")),ue.toString()!==e.toString()&&t(ue,{replace:!0})},[e,t,D,A,E,R]),m.useEffect(()=>{try{if(A==="all"){localStorage.removeItem(ON);return}const ue={mode:A,preset:E,start:R,end:D};localStorage.setItem(ON,JSON.stringify(ue))}catch{}},[D,A,E,R]);const dt=m.useMemo(()=>{if(n.listRunSummariesPage)return a;const ue=y==="all"?a:a.filter(B=>B.scenarios.some(oe=>{const de=String(oe.scenarioName??"").trim(),Le=String(oe.scenarioId??"").trim();return de===y||Le===y}));if(A==="all")return ue;const Ke=Date.now();if(A==="last"){const B=bc.find(de=>de.value===E)??bc[0],oe=Ke-B.durationMs;return ue.filter(de=>{const Le=new Date(de.timestamp).getTime();return Le>=oe&&Le<=Ke})}const De=ol(R)?.getTime()??null,re=ol(D)?.getTime()??null,Ne=De!==null&&re!==null?Math.min(De,re):De??null,Ue=De!==null&&re!==null?Math.max(De,re):re??null;return ue.filter(B=>{const oe=new Date(B.timestamp).getTime();return!(Number.isNaN(oe)||Ne!==null&&oe<Ne||Ue!==null&&oe>Ue)})},[a,y,n.listRunSummariesPage,D,A,E,R]);m.useEffect(()=>{W.reset()},[J,ne,W.reset]);const Pt=m.useMemo(()=>y==="all"?"All scenarios":Je.find(Ke=>Ke.value===y||Ke.label===y)?.label??y,[y,Je]),Xt=m.useMemo(()=>{if(A==="all")return"All time";if(A==="last")return bc.find(De=>De.value===E)?.label??"Last range";const ue=!!R.trim(),Ke=!!D.trim();return!ue&&!Ke?"Custom range":ue&&Ke?`${Fh(R)} - ${Fh(D)}`:ue?`From ${Fh(R)}`:`Until ${Fh(D)}`},[D,A,E,R]),kt=m.useMemo(()=>{const ue=(De,re)=>De===null&&re===null?0:De===null?1:re===null?-1:j==="asc"?De-re:re-De;return[...dt].sort((De,re)=>{if(v==="toolTokens")return ue(De.toolTokenUsage?.totalTokens??null,re.toolTokenUsage?.totalTokens??null);let Ne=0;return v==="id"&&(Ne=De.id.localeCompare(re.id)),v==="timestamp"&&(Ne=new Date(De.timestamp).getTime()-new Date(re.timestamp).getTime()),v==="passRate"&&(Ne=De.overallPassRate-re.overallPassRate),v==="scenarios"&&(Ne=De.totalScenarios-re.totalScenarios),v==="avgToolCalls"&&(Ne=De.avgToolCalls-re.avgToolCalls),j==="asc"?Ne:-Ne})},[dt,v,j]),nn=m.useMemo(()=>{const ue=[];let Ke=null;for(const De of kt){const re=jbe(De.timestamp);re!==Ke&&(ue.push({type:"day-separator",dayKey:re,dayLabel:Sbe(De.timestamp)}),Ke=re),ue.push({type:"run",run:De})}return ue},[kt]),Jt=ue=>v!==ue?s.jsx(Oc,{className:"h-3.5 w-3.5 text-muted-foreground"}):j==="asc"?s.jsx(ma,{className:"h-3.5 w-3.5"}):s.jsx(tn,{className:"h-3.5 w-3.5"}),zt=ue=>{const Ke=ue.toolTokenUsage?.totalTokens;return typeof Ke=="number"?Ke.toLocaleString():"n/a"},_e=()=>{k("all"),P("15min"),M(""),U("")},Qe=m.useMemo(()=>{const ue=new Map;for(const Ke of kt){if(Ke.scenarios.length>0){ue.set(Ke.id,d_(Ke));continue}const De=Ke.configName?.trim()||"",re=Ke.configPath?.trim()||"",Ne=De&&re?`${De} · ${re}`:De||re;ue.set(Ke.id,{scenarioCount:Ke.totalScenarios,agentCount:0,scopePreview:Ne||"n/a",modelSummary:""})}return ue},[kt]),Ze=()=>{L(!0),Ae("Ask me to compare runs, explain regressions over time, or summarize historical drift patterns.")},_t=async ue=>{p(!0);try{await n.deleteResult(ue),i(Ke=>Ke.filter(De=>De.id!==ue)),Me({title:"Run deleted",description:ue}),f(null)}catch(Ke){Me({title:"Could not delete run",description:Ke instanceof Error?Ke.message:String(Ke),variant:"destructive"})}finally{p(!1)}},Bt=async ue=>{if(!ue.configPath?.trim()){Me({title:"Cannot rerun",description:"This run has no config path in metadata.",variant:"destructive"});return}K(ue.id);try{await Pq(n,ue),Me({title:"Rerun queued",description:`${ue.id} queued with previous run settings.`})}catch(De){Me({title:"Could not rerun",description:De instanceof Error?De.message:String(De),variant:"destructive"})}finally{K(De=>De===ue.id?null:De)}};return s.jsxs("div",{className:"space-y-6",children:[s.jsx(ja,{open:d!==null,onOpenChange:ue=>{!ue&&!h&&f(null)},children:s.jsxs(Us,{children:[s.jsxs(Ws,{children:[s.jsx(Hs,{children:"Delete run?"}),s.jsxs(Ks,{children:["This will permanently remove the run artifacts from disk for"," ",s.jsx("span",{className:"font-mono",children:d??""}),"."]})]}),s.jsxs(Vs,{children:[s.jsx(Ys,{disabled:h,children:"Cancel"}),s.jsx(Gs,{disabled:h||!d,onClick:ue=>{ue.preventDefault(),d&&_t(d)},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:h?"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(Bc,{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 flex-wrap items-center gap-2",children:[s.jsxs(ho,{open:N,onOpenChange:_,children:[s.jsx(mo,{asChild:!0,children:s.jsxs(Z,{type:"button",variant:"outline",role:"combobox","aria-expanded":N,"aria-controls":"results-scenario-command-list",className:`w-[260px] justify-between font-normal ${y!=="all"?"border-primary/40":""}`,children:[s.jsx("span",{className:"truncate text-left",children:Pt}),s.jsx(tn,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(xi,{className:"w-[260px] p-0",align:"start",children:s.jsxs(_l,{children:[s.jsx(Al,{placeholder:"Search scenarios..."}),s.jsxs(kl,{id:"results-scenario-command-list",children:[s.jsx(El,{children:"No scenarios found."}),s.jsxs(Pl,{children:[s.jsx(xs,{value:"all scenarios",onSelect:()=>{S("all"),_(!1)},children:"All scenarios"}),Je.map(ue=>s.jsx(xs,{value:`${ue.label} ${ue.value}`,onSelect:()=>{S(ue.value),_(!1)},children:ue.label},ue.value))]})]})]})})]}),s.jsxs(ho,{open:F,onOpenChange:G,children:[s.jsx(mo,{asChild:!0,children:s.jsxs(Z,{type:"button",variant:"outline",role:"combobox","aria-expanded":F,"aria-controls":"results-time-command-list",className:`w-[320px] justify-between font-normal ${A!=="all"?"border-primary/40":""}`,children:[s.jsxs("span",{className:"flex min-w-0 items-center gap-2 truncate text-left",children:[s.jsx($D,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"truncate",children:Xt})]}),s.jsx(tn,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsxs(xi,{className:"w-[360px] p-0",align:"start",children:[s.jsxs("div",{className:"border-b px-3 py-2",children:[s.jsx("p",{className:"text-sm font-medium",children:"Date and time filter"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Filter runs by timestamp."})]}),s.jsxs("div",{id:"results-time-command-list",className:"grid gap-1 p-2",children:[s.jsx(Z,{type:"button",variant:A==="all"?"secondary":"ghost",className:"justify-start",onClick:()=>{_e(),G(!1)},children:"All time"}),bc.map(ue=>s.jsx(Z,{type:"button",variant:A==="last"&&E===ue.value?"secondary":"ghost",className:"justify-start",onClick:()=>{k("last"),P(ue.value),G(!1)},children:ue.label},ue.value)),s.jsx(Z,{type:"button",variant:A==="custom"?"secondary":"ghost",className:"justify-start",onClick:()=>k("custom"),children:"Custom date time range"})]}),A==="custom"&&s.jsxs("div",{className:"space-y-3 border-t p-3",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{htmlFor:"results-time-filter-start",children:"Start"}),s.jsx(Et,{id:"results-time-filter-start",type:"datetime-local",value:R,onChange:ue=>M(ue.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{htmlFor:"results-time-filter-end",children:"End"}),s.jsx(Et,{id:"results-time-filter-end",type:"datetime-local",value:D,onChange:ue=>U(ue.target.value)})]}),s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs(Z,{type:"button",variant:"ghost",size:"sm",className:"px-2",onClick:_e,children:[s.jsx(ns,{className:"mr-1.5 h-3.5 w-3.5"}),"Clear"]}),s.jsx(Z,{type:"button",size:"sm",onClick:()=>G(!1),children:"Done"})]})]})]})]}),s.jsx(Z,{variant:"outline",onClick:()=>{ie()},disabled:o,children:o?"Refreshing...":"Refresh"}),s.jsx(Z,{variant:"outline",onClick:W.prev,disabled:o||O===0,children:"Prev"}),s.jsx(Z,{variant:"outline",onClick:W.next,disabled:o||!q,children:"Next"}),s.jsxs(Z,{type:"button",variant:"outline",className:"gap-1.5",onClick:Ze,children:[s.jsx(Zr,{className:"h-4 w-4 text-amber-500"}),"MCP Lab Assistant"]})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:W.rangeLabel(a.length)}),s.jsxs("div",{className:`grid gap-6 ${H?I?"xl:grid-cols-[minmax(0,1fr)_52rem]":"xl:grid-cols-[minmax(0,1fr)_30rem]":"grid-cols-1"}`,children:[s.jsx(nt,{children:s.jsx(rt,{className:"p-0",children:s.jsxs(Jr,{children:[s.jsx(es,{children:s.jsxs(Gt,{children:[s.jsx(ht,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>he("id"),children:["Run ID",Jt("id")]})}),s.jsx(ht,{children:"Evaluated"}),s.jsx(ht,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>he("timestamp"),children:["Timestamp",Jt("timestamp")]})}),s.jsx(ht,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex w-full items-center justify-end gap-1 hover:text-foreground",onClick:()=>he("passRate"),children:["Pass Rate",Jt("passRate")]})}),s.jsx(ht,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>he("scenarios"),children:["Scenarios",Jt("scenarios")]})}),s.jsx(ht,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>he("avgToolCalls"),children:["Avg Tool Calls",Jt("avgToolCalls")]})}),s.jsx(ht,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>he("toolTokens"),children:["Tool Tokens",Jt("toolTokens")]})}),s.jsx(ht,{className:"w-10"})]})}),s.jsx(ts,{children:nn.length===0?s.jsx(Gt,{children:s.jsx(He,{colSpan:X$,className:"px-4 py-10 text-center text-sm text-muted-foreground",children:A==="all"&&y==="all"?"No runs yet.":"No runs match current filters."})}):nn.map((ue,Ke)=>ue.type==="day-separator"?s.jsx(Gt,{className:"bg-muted/30 hover:bg-muted/30",children:s.jsx(He,{colSpan:X$,className:"px-4 py-3",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"h-px flex-1 bg-border/70"}),s.jsx("span",{className:"shrink-0 rounded-full border border-border bg-background px-2.5 py-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:ue.dayLabel}),s.jsx("div",{className:"h-px flex-1 bg-border/70"})]})})},`day-${ue.dayKey}-${Ke}`):s.jsxs(Gt,{children:[s.jsx(He,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(Tt,{to:`/results/${ue.run.id}`,className:"font-mono text-xs text-primary hover:underline",children:ue.run.id}),ue.run.runNote?s.jsxs("div",{className:"text-[11px] text-muted-foreground break-words",children:["Note: ",ue.run.runNote]}):null]})}),s.jsx(He,{className:"text-[11px] text-muted-foreground",children:(()=>{const De=Qe.get(ue.run.id)??{scenarioCount:0,agentCount:0,scopePreview:"n/a",modelSummary:""};return s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:["Evaluated: ",De.scenarioCount," scenario",De.scenarioCount===1?"":"s"," · ",De.agentCount," agent",De.agentCount===1?"":"s",De.modelSummary?` · ${De.modelSummary}`:""]}),s.jsx("div",{className:"font-mono text-xs text-foreground/80",children:De.scopePreview})]})})()}),s.jsx(He,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(xa,{className:"h-3 w-3"}),new Date(ue.run.timestamp).toLocaleString()]}),(()=>{const De=mg(ue.run);return De===null?null:s.jsxs("div",{className:"font-mono text-[11px] text-muted-foreground/90",children:["Total time: ",Is(De)]})})()]})}),s.jsx(He,{className:"text-right",children:s.jsxs("div",{className:"flex flex-col items-end gap-1",children:[s.jsx(Ma,{rate:ue.run.overallPassRate}),s.jsx(aL,{run:ue.run})]})}),s.jsx(He,{className:"text-right font-mono text-sm",children:ue.run.totalScenarios}),s.jsx(He,{className:"text-right font-mono text-sm",children:ue.run.avgToolCalls.toFixed(0)}),s.jsx(He,{className:"text-right",children:s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("div",{className:"font-mono text-sm",children:zt(ue.run)}),(()=>{const De=gg(ue.run);return De===null?null:s.jsxs("div",{className:"font-mono text-[11px] text-muted-foreground/90",children:["Tool time: ",Is(De)]})})()]})}),s.jsx(He,{children:s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsxs(Z,{size:"sm",variant:"outline",disabled:z===ue.run.id,onClick:()=>{Bt(ue.run)},children:[s.jsx(va,{className:"mr-1.5 h-3.5 w-3.5"}),z===ue.run.id?"Queueing...":"Rerun"]}),s.jsxs(lp,{children:[s.jsx(cp,{asChild:!0,children:s.jsx(Z,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(bg,{className:"h-4 w-4"})})}),s.jsxs($u,{align:"end",children:[s.jsx(Mr,{asChild:!0,children:s.jsxs(Tt,{to:`/results/${ue.run.id}`,children:[s.jsx(_9,{className:"mr-2 h-3.5 w-3.5"}),"View"]})}),s.jsxs(Mr,{children:[s.jsx(Ir,{className:"mr-2 h-3.5 w-3.5"}),"Export JSON"]}),s.jsxs(Mr,{className:"text-destructive",onSelect:De=>{De.preventDefault();const re=document.activeElement;re instanceof HTMLElement&&re.blur(),f(ue.run.id)},children:[s.jsx(Bs,{className:"mr-2 h-3.5 w-3.5"}),"Delete"]})]})]})]})})]},ue.run.id))})]})})}),H&&s.jsx(kq,{title:"MCP Lab Assistant",description:"Analyze historical differences and trends across all result runs.",expanded:I,onToggleExpanded:()=>Y(ue=>!ue),onHide:()=>L(!1),messages:me,pendingToolCalls:se,loading:Oe,onCancel:fe?xe:void 0,input:ge,onInputChange:lt,onSend:()=>{ut()},inputPlaceholder:"Ask about historical run differences...",snippets:_be,onSnippetSelect:ue=>{L(!0),Se(ue)},onApproveToolCall:ue=>{At(ue)},onDenyToolCall:ue=>{Xe(ue)},chatEndRef:we,inputRef:ot,className:"min-w-0 overflow-hidden xl:flex xl:h-[calc(100vh-14rem)] xl:min-h-0 xl:flex-col",renderMessage:({message:ue,index:Ke,linkedPendingToolCall:De,isUser:re,isAssistant:Ne,isSystem:Ue,isTool:B})=>{const oe=Ne&&!!ue.pendingToolCallId;if(B&&/^(Approved|Denied) tool call\b/i.test(String(ue.text??"").trim()))return null;if(oe){const de=Yh(De?.tool??ue.toolRequestName??De?.publicToolName??ue.toolRequestPublicName??"unknown_tool");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(Fr,{className:"h-3 w-3"})}),s.jsxs("details",{open:!!De,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(pa,{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 ${de}`}),s.jsx("span",{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${De?"bg-amber-100 text-amber-900":"bg-muted text-muted-foreground"}`,children:De?"Needs approval":"Completed"})]})}),s.jsx(tn,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),s.jsx("div",{className:"min-w-0 space-y-2 border-t border-border/50 px-3 py-2",children:s.jsx(Fs,{text:ue.text,className:"text-sm"})})]})]},`${ue.id??`${ue.role}-${Ke}`}:tool`)}return s.jsxs("div",{className:`flex items-start gap-2 ${re?"justify-end":"justify-start"}`,children:[!re&&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:Ue?s.jsx(BN,{className:"h-3 w-3"}):s.jsx(Fr,{className:"h-3 w-3"})}),s.jsx("div",{className:`min-w-0 max-w-[92%] break-words rounded-md border p-3 text-sm ${re?"border-primary/20 bg-primary/10":Ue?"border-amber-400/30 bg-amber-50/70":B?"border-blue-300/30 bg-blue-50/50":"border-border/80 bg-background shadow-sm"}`,children:re?s.jsx("p",{className:"whitespace-pre-wrap",children:ue.text}):s.jsx(Fs,{text:ue.text,className:"text-sm"})}),re&&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(Uc,{className:"h-3 w-3"})})]},ue.id??`${ue.role}-${Ke}`)}})]})]})};function kbe(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=>`
|
|
156
|
+
<div class="scenario-card">
|
|
157
|
+
<div class="scenario-header" onclick="this.parentElement.classList.toggle('open')">
|
|
158
|
+
<span class="chevron">▶</span>
|
|
159
|
+
<span class="scenario-name">${Qo(c.scenarioName)}</span>
|
|
160
|
+
<span class="scenario-agent">${Qo(c.agentName)}</span>
|
|
161
|
+
<span class="mono">${c.runs.length} runs</span>
|
|
162
|
+
<span class="badge ${c.passRate>=.8?"badge-pass":c.passRate>=.5?"badge-warn":"badge-fail"}">${Math.round(c.passRate*100)}%</span>
|
|
163
|
+
<span class="mono">${c.avgToolCalls.toFixed(1)} avg tools</span>
|
|
164
|
+
</div>
|
|
165
|
+
<div class="scenario-detail">
|
|
166
|
+
${c.runs.map(d=>`
|
|
167
|
+
<div class="run-row">
|
|
168
|
+
<span class="run-status ${d.passed?"pass":"fail"}">${d.passed?"✓":"✗"}</span>
|
|
169
|
+
<span class="mono run-label">Run #${d.runIndex+1}</span>
|
|
170
|
+
<span class="mono run-duration">${d.duration}ms</span>
|
|
171
|
+
<div class="tool-pills">
|
|
172
|
+
${d.toolCalls.map(f=>`<span class="pill">${Qo(f.name)} <small>${f.duration}ms</small></span>`).join("")}
|
|
173
|
+
</div>
|
|
174
|
+
${d.failureReasons.length?`<div class="failure-reasons">${d.failureReasons.map(f=>Qo(f)).join(", ")}</div>`:""}
|
|
175
|
+
</div>`).join("")}
|
|
176
|
+
</div>
|
|
177
|
+
</div>`).join("");return`<!DOCTYPE html>
|
|
178
|
+
<html lang="en">
|
|
179
|
+
<head>
|
|
180
|
+
<meta charset="UTF-8">
|
|
181
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
182
|
+
<title>MCPLab Report — ${Qo(e.id)}</title>
|
|
183
|
+
<script src="https://cdn.jsdelivr.net/npm/chart.js@4"><\/script>
|
|
184
|
+
<style>
|
|
185
|
+
*{box-sizing:border-box;margin:0;padding:0}
|
|
186
|
+
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;background:#f9fafb;color:#1f2937;padding:2rem;max-width:1100px;margin:0 auto}
|
|
187
|
+
h1{font-size:1.5rem;font-weight:700}
|
|
188
|
+
.mono{font-family:'JetBrains Mono',ui-monospace,monospace;font-size:.8rem}
|
|
189
|
+
.header{display:flex;align-items:center;gap:1rem;margin-bottom:.25rem}
|
|
190
|
+
.sub{font-size:.75rem;color:#6b7280;margin-bottom:1.5rem}
|
|
191
|
+
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:1rem;margin-bottom:2rem}
|
|
192
|
+
.stat{background:#fff;border:1px solid #e5e7eb;border-radius:.75rem;padding:1rem}
|
|
193
|
+
.stat-label{font-size:.7rem;color:#6b7280;text-transform:uppercase;letter-spacing:.05em}
|
|
194
|
+
.stat-value{font-size:1.5rem;font-weight:700;margin-top:.25rem}
|
|
195
|
+
.charts{display:grid;grid-template-columns:1fr 1fr;gap:1.5rem;margin-bottom:2rem}
|
|
196
|
+
.chart-card{background:#fff;border:1px solid #e5e7eb;border-radius:.75rem;padding:1rem}
|
|
197
|
+
.chart-card h3{font-size:.85rem;font-weight:600;margin-bottom:.75rem}
|
|
198
|
+
canvas{max-height:220px}
|
|
199
|
+
.scenario-card{background:#fff;border:1px solid #e5e7eb;border-radius:.75rem;margin-bottom:.75rem;overflow:hidden}
|
|
200
|
+
.scenario-header{display:flex;align-items:center;gap:.75rem;padding:.75rem 1rem;cursor:pointer;font-size:.85rem}
|
|
201
|
+
.scenario-header:hover{background:#f9fafb}
|
|
202
|
+
.chevron{font-size:.6rem;transition:transform .15s;color:#9ca3af}
|
|
203
|
+
.scenario-card.open .chevron{transform:rotate(90deg)}
|
|
204
|
+
.scenario-name{font-weight:600;flex:1}
|
|
205
|
+
.scenario-agent{color:#6b7280;font-size:.8rem}
|
|
206
|
+
.scenario-detail{display:none;border-top:1px solid #e5e7eb;padding:.75rem 1rem;background:#fafafa}
|
|
207
|
+
.scenario-card.open .scenario-detail{display:block}
|
|
208
|
+
.run-row{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;padding:.5rem 0;border-bottom:1px solid #f3f4f6;font-size:.8rem}
|
|
209
|
+
.run-row:last-child{border-bottom:none}
|
|
210
|
+
.run-status{font-weight:700;font-size:1rem}
|
|
211
|
+
.run-status.pass{color:#059669}
|
|
212
|
+
.run-status.fail{color:#dc2626}
|
|
213
|
+
.run-duration{color:#6b7280}
|
|
214
|
+
.tool-pills{display:flex;flex-wrap:wrap;gap:.25rem}
|
|
215
|
+
.pill{background:#fef3c7;color:#92400e;padding:2px 8px;border-radius:9999px;font-size:.7rem;font-family:'JetBrains Mono',monospace}
|
|
216
|
+
.pill small{color:#b45309;margin-left:2px}
|
|
217
|
+
.failure-reasons{width:100%;color:#dc2626;font-size:.75rem;margin-top:.25rem}
|
|
218
|
+
.badge{padding:2px 10px;border-radius:9999px;font-size:.75rem;font-weight:600}
|
|
219
|
+
.badge-pass{background:#d1fae5;color:#065f46}
|
|
220
|
+
.badge-warn{background:#fef3c7;color:#92400e}
|
|
221
|
+
.badge-fail{background:#fee2e2;color:#991b1b}
|
|
222
|
+
.footer{text-align:center;color:#9ca3af;font-size:.7rem;margin-top:2rem;padding-top:1rem;border-top:1px solid #e5e7eb}
|
|
223
|
+
</style>
|
|
224
|
+
</head>
|
|
225
|
+
<body>
|
|
226
|
+
<div class="header">
|
|
227
|
+
<h1 class="mono">${Qo(e.id)}</h1>
|
|
228
|
+
<span class="badge ${e.overallPassRate>=.8?"badge-pass":e.overallPassRate>=.5?"badge-warn":"badge-fail"}">${Math.round(e.overallPassRate*100)}% pass</span>
|
|
229
|
+
</div>
|
|
230
|
+
<p class="sub">${new Date(e.timestamp).toLocaleString()} · Config hash: <span class="mono">${Qo(e.configHash)}</span></p>
|
|
231
|
+
|
|
232
|
+
<div class="stats">
|
|
233
|
+
<div class="stat"><div class="stat-label">Scenarios</div><div class="stat-value">${e.totalScenarios}</div></div>
|
|
234
|
+
<div class="stat"><div class="stat-label">Total Runs</div><div class="stat-value">${e.totalRuns}</div></div>
|
|
235
|
+
<div class="stat"><div class="stat-label">Pass Rate</div><div class="stat-value">${Math.round(e.overallPassRate*100)}%</div></div>
|
|
236
|
+
<div class="stat"><div class="stat-label">Avg Tool Calls</div><div class="stat-value">${e.avgToolCalls.toFixed(1)}</div></div>
|
|
237
|
+
<div class="stat"><div class="stat-label">Avg Latency</div><div class="stat-value">${e.avgLatency}ms</div></div>
|
|
238
|
+
</div>
|
|
239
|
+
|
|
240
|
+
<div class="charts">
|
|
241
|
+
<div class="chart-card"><h3>Pass / Fail</h3><canvas id="pieChart"></canvas></div>
|
|
242
|
+
<div class="chart-card"><h3>Tool Usage</h3><canvas id="barChart"></canvas></div>
|
|
243
|
+
</div>
|
|
244
|
+
|
|
245
|
+
<h2 style="font-size:1rem;font-weight:600;margin-bottom:.75rem">Scenarios</h2>
|
|
246
|
+
${o}
|
|
247
|
+
|
|
248
|
+
<div class="footer">Generated by MCPLab · ${new Date().toISOString()}</div>
|
|
249
|
+
|
|
250
|
+
<script>
|
|
251
|
+
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}}}}}});
|
|
252
|
+
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}}}}}});
|
|
253
|
+
<\/script>
|
|
254
|
+
</body>
|
|
255
|
+
</html>`}function Qo(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}const Ebe="mcplab.resultAssistantScenarioHandoff",Pbe=[{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 Z$(e){const t=new Date().toISOString().replace(/[:]/g,"-").replace(/\..+/,"");return`mcplab/reports/result-assistant/${e}-${t}.md`}function J$(e){const t=e.toFixed(1);return t.endsWith(".0")?t.slice(0,-2):t}const Tbe=()=>{const{id:e}=Ml(),t=Xs(),[n]=Pi(),{source:r}=On(),a=n.get("embed")==="1",{configs:i}=Yf(),{scenarios:o}=Ca(),[c,d]=m.useState(void 0),[f,h]=m.useState(!0),[p,v]=m.useState(!1),[x,j]=m.useState(""),[b,y]=m.useState(!1),[S,N]=m.useState(new Set),[_,A]=m.useState(new Set),[k,E]=m.useState(""),[P,R]=m.useState(!1),[M,D]=m.useState(!1),[U,F]=m.useState("assistant"),[G,H]=m.useState(null),[L,I]=m.useState(!1),[Y,W]=m.useState(""),[O,Q]=m.useState(""),[q,z]=m.useState(!1),[K,J]=m.useState(!1),[ne,he]=m.useState(!1),[ie,me]=m.useState([]),[se,ge]=m.useState(!1),[Oe,fe]=m.useState(""),[xe,we]=m.useState(null),[ot,lt]=m.useState(!1),[ut,At]=m.useState(null),[Xe,Se]=m.useState(!1),[Ae,Je]=m.useState(!1),[dt,Pt]=m.useState(!1),Xt=m.useRef(null),[kt,nn]=m.useState(!1),{assistantMessages:Jt,assistantPendingToolCalls:zt,assistantInput:_e,assistantLoading:Qe,assistantTurnCancelable:Ze,cancelAssistantTurn:_t,assistantChatEndRef:Bt,assistantInputRef:ue,setAssistantInput:Ke,askAssistant:De,approveResultAssistantToolCall:re,denyResultAssistantToolCall:Ne,applyResultAssistantSnippet:Ue,ensureIntroMessage:B,resetAssistantSession:oe}=Eq({source:r,open:P,scope:"run",runId:e,onSessionSync:void 0}),de=m.useCallback(async(ae,Pe)=>{ge(!0);try{const et=(await r.listMarkdownReports()).filter(sn=>{const on=String(sn.relativePath??""),xn=String(sn.name??"");return on.includes(ae)||xn.includes(ae)});if(me(et),Pe&&et.length>0){const sn=et.find(on=>on.relativePath===Pe||on.path===Pe||on.relativePath.endsWith(Pe)||on.path.endsWith(Pe));sn&&fe(sn.relativePath)}return et}catch{return me([]),[]}finally{ge(!1)}},[r]);m.useEffect(()=>{if(!e)return;let ae=!0;return oe(),h(!0),r.getResult(e).then(Pe=>{ae&&(d(Pe),j(Pe?.runNote??""),v(!1),h(!1))}),()=>{ae=!1}},[e,r,oe]),m.useEffect(()=>{const ae=Xt.current;if(!ae)return;const Pe=()=>{nn(ae.clientWidth<800)};if(Pe(),typeof ResizeObserver<"u"){const jt=new ResizeObserver(()=>Pe());return jt.observe(ae),()=>jt.disconnect()}return window.addEventListener("resize",Pe),()=>window.removeEventListener("resize",Pe)},[f]),m.useEffect(()=>{if(!c?.id){me([]);return}let ae=!0;return(async()=>{const Pe=await de(c.id)})(),()=>{ae=!1}},[c?.id,de]),m.useEffect(()=>{if(ie.length===0){fe(""),we(null),At(null);return}(!Oe||!ie.some(ae=>ae.relativePath===Oe))&&fe(ie[0].relativePath)},[ie,Oe]),m.useEffect(()=>{if(!P||U!=="reports")return;if(!Oe){we(null),At(null);return}let ae=!0;return lt(!0),At(null),r.getMarkdownReport(Oe).then(Pe=>{ae&&we(Pe)}).catch(Pe=>{ae&&(we(null),At(Pe instanceof Error?Pe.message:String(Pe)))}).finally(()=>{ae&<(!1)}),()=>{ae=!1}},[P,U,Oe,r]);const Le=n.get("configId")??"",$e=(n.get("agent")??"").trim(),Ge=m.useMemo(()=>{const ae=Le?i.find(Pe=>Pe.id===Le):void 0;return ae||(c?i.find(Pe=>Pe.id===c.configId):void 0)},[i,Le,c]),Ie=m.useMemo(()=>{const ae=c?.configName?.trim();if(ae)return ae;const Pe=c?.configPath?.trim();if(Pe)return Pe;const jt=Ge?.relativePath?.trim()||Ge?.name?.trim();return jt||c?.configId?.trim()||""},[c,Ge]),V=m.useMemo(()=>{const ae=c?.configName?.trim();return ae||Ge?.name?.trim()||""},[c,Ge]),ve=m.useMemo(()=>{const ae=c?.configPath?.trim();return ae||Ge?.relativePath?.trim()||""},[c,Ge]),Ee=m.useMemo(()=>{const ae=new Map;if(Ge){for(const Pe of Ge.scenarios)ae.set(Pe.id,Pe),Pe.name&&!ae.has(Pe.name)&&ae.set(Pe.name,Pe);for(const Pe of Ge.scenarioEntries??[]){if(Pe.kind!=="referenced")continue;const jt=o.find(et=>et.id===Pe.ref);jt&&(ae.set(jt.id,jt),jt.name&&ae.set(jt.name,jt),ae.has(Pe.ref)||ae.set(Pe.ref,jt))}}for(const Pe of o)ae.has(Pe.id)||ae.set(Pe.id,Pe),Pe.name&&!ae.has(Pe.name)&&ae.set(Pe.name,Pe);return ae},[Ge,o]),tt=m.useMemo(()=>"",[]);m.useEffect(()=>{if(Le&&i.some(ae=>ae.id===Le)){E(Le);return}tt&&E(ae=>ae||tt)},[Le,i,tt]);const{filteredScenarios:te,filteredTotalRuns:Fe,filteredPassCount:mt,displayPassRate:Qt,displayAvgToolCalls:ke,displayAvgLatency:en,displayDurationMs:Ct,displayToolTimeMs:Kt,displayToolTokenUsage:Hn}=m.useMemo(()=>{if(!c)return{filteredScenarios:[],filteredTotalRuns:0,filteredPassCount:0,displayPassRate:0,displayAvgToolCalls:0,displayAvgLatency:0,displayDurationMs:null,displayToolTimeMs:null,displayToolTokenUsage:null};const ae=$e?c.scenarios.filter(xn=>xn.agentId===$e||xn.agentName===$e):c.scenarios,Pe=ae.reduce((xn,cr)=>xn+cr.runs.length,0),jt=ae.reduce((xn,cr)=>xn+cr.runs.filter(qr=>qr.passed).length,0),et=ae.reduce((xn,cr)=>xn+cr.runs.reduce((qr,mn)=>qr+mn.toolCalls.length,0),0),sn=mg({...c,scenarios:ae}),on=gg({...c,scenarios:ae});return{filteredScenarios:ae,filteredTotalRuns:Pe,filteredPassCount:jt,displayPassRate:Pe===0?0:jt/Pe,displayAvgToolCalls:Pe===0?0:et/Pe,displayAvgLatency:Pe===0||sn===null?0:Math.round(sn/Pe),displayDurationMs:sn,displayToolTimeMs:on,displayToolTokenUsage:xX(ae.map(xn=>xn.toolTokenUsage))}},[c,$e]),_n=m.useMemo(()=>{const ae={};return te.forEach(Pe=>Pe.runs.forEach(jt=>jt.toolCalls.forEach(et=>{ae[et.name]=(ae[et.name]||0)+1}))),Object.entries(ae).map(([Pe,jt])=>({name:Pe,count:jt})).sort((Pe,jt)=>jt.count-Pe.count)},[te]);if(f)return s.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Loading result..."});if(!c)return s.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Result not found"});const Qa=Object.entries(c.mcpServerVersions??{}).map(([ae,Pe])=>`${ae}: ${Pe??"unknown"}`).join(", "),$i=mt,To=Math.max(0,Fe-$i),Di=[{name:"Pass",value:$i,color:"hsl(152, 69%, 40%)"},{name:"Fail",value:To,color:"hsl(0, 72%, 51%)"}],Ul=ae=>{N(Pe=>{const jt=new Set(Pe);return jt.has(ae)?jt.delete(ae):jt.add(ae),jt})},qn=(ae,Pe,jt,et)=>`${ae}:${Pe}:${jt}:${et}`,Fu=(ae,Pe)=>`${ae}::${Pe}`,Aa=ae=>{A(Pe=>{const jt=new Set(Pe);return jt.has(ae)?jt.delete(ae):jt.add(ae),jt})},le=ae=>{const Pe=!ae.endsWith(":conversation");return _.has(ae)?!Pe:Pe},it=(ae,Pe)=>{F("assistant"),R(!0),H(Pe?.scenarioId??null),B("Ask me to explain failures, tool usage, or suggest what to inspect next in this result."),ae&&Ke(ae)},Wt=zt.filter(ae=>ae.status==="pending"&&!Jt.some(Pe=>Pe.pendingToolCallId===ae.id)),Dt=ae=>{F("reports"),R(!0)},qt=()=>{F("note"),R(!0)},dn=ae=>{if(!c)return;if(!G){Me({title:"No scenario context",description:"Ask about a specific scenario or run first, then send the suggestion.",variant:"destructive"});return}const Pe=o.find(et=>et.id===G)??o.find(et=>et.name===G);if(!Pe){Me({title:"Scenario not found in library",description:`Could not find library scenario '${G}' to open in Scenario Assistant.`,variant:"destructive"});return}const jt=[`I am sending a suggestion from the Result Assistant for scenario '${G}' 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:",ae].join(`
|
|
256
|
+
`);try{window.sessionStorage.setItem(Ebe,JSON.stringify({type:"result-assistant-handoff-v1",runId:c.id,configId:Le||c.configId||"",scenarioId:Pe.id,prompt:jt,sourceReply:ae})),t(`/libraries/test-cases/${encodeURIComponent(Pe.id)}?assistantHandoff=1`)}catch(et){Me({title:"Could not create handoff",description:et instanceof Error?et.message:String(et),variant:"destructive"})}},lr=ae=>{c&&(he(!1),W(ae),Q(Z$(c.id)),z(!1),I(!0))},os=()=>{c&&(he(!0),W(""),Q(Z$(c.id)),z(!1),I(!0))},gr=async()=>{if(!c)return;if(!Y.trim()){Me({title:"No markdown to write",description:"The selected assistant response is empty.",variant:"destructive"});return}J(!0);try{const Pe=await r.applyResultAssistantReport({runId:c.id,markdown:Y,outputPath:O.trim()||void 0,overwrite:q});Me({title:"Markdown report written",description:typeof Pe.path=="string"&&Pe.path?Pe.path:Pe.outputPath}),await de(c.id,typeof Pe.path=="string"&&Pe.path||Pe.outputPath||void 0),P&&F("reports"),I(!1)}catch(Pe){Me({title:"Could not write markdown report",description:Pe instanceof Error?Pe.message:String(Pe),variant:"destructive"})}finally{J(!1)}},Ro=async ae=>{try{await navigator.clipboard.writeText(ae),Me({title:"Copied"})}catch(Pe){Me({title:"Could not copy",description:Pe instanceof Error?Pe.message:String(Pe),variant:"destructive"})}},vr=async()=>{if(c){y(!0);try{const ae=x.trim();await r.updateRunNote(c.id,ae||void 0),d(Pe=>Pe&&{...Pe,runNote:ae||void 0}),j(ae),v(!1),Me({title:"Run note saved"})}catch(ae){Me({title:"Could not save run note",description:ae instanceof Error?ae.message:String(ae),variant:"destructive"})}finally{y(!1)}}},Wl=async()=>{if(c?.id){Je(!0);try{await r.deleteResult(c.id),Me({title:"Run deleted",description:c.id}),t("/results")}catch(ae){Me({title:"Could not delete run",description:ae instanceof Error?ae.message:String(ae),variant:"destructive"})}finally{Je(!1),Se(!1)}}},pp=async()=>{if(!c?.id)return;if(!ve.trim()){Me({title:"Cannot rerun",description:"This run has no config path in metadata.",variant:"destructive"});return}Pt(!0);try{await Pq(r,c),Me({title:"Rerun queued",description:`${c.id} queued with previous run settings.`})}catch(Pe){Me({title:"Could not rerun",description:Pe instanceof Error?Pe.message:String(Pe),variant:"destructive"})}finally{Pt(!1)}};return s.jsxs("div",{className:`${P?"xl:flex xl:h-[calc(100vh-2rem-48px)] xl:min-h-0 xl:flex-col xl:overflow-hidden":""}`,children:[s.jsx("div",{className:`${P?"xl:shrink-0 xl:pb-6":"mb-6"}`,children:s.jsxs("div",{ref:Xt,className:"flex flex-wrap items-start justify-between gap-3",children:[s.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[!a&&s.jsx(Z,{variant:"ghost",size:"icon",asChild:!0,children:s.jsx(Tt,{to:"/results",children:s.jsx(go,{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(Ma,{rate:Qt})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[s.jsxs("span",{className:"inline-flex items-center gap-1 align-middle",children:[s.jsx(NE,{className:"h-3 w-3 shrink-0"}),new Date(c.timestamp).toLocaleString()]}),s.jsx("span",{className:"mx-1",children:"·"}),$e?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"inline-flex items-center align-middle",children:["Agent: ",$e]}),s.jsx("span",{className:"mx-1",children:"·"})]}):null,V?s.jsxs("span",{className:"inline-flex items-center align-middle",children:["Eval: ",s.jsx("span",{className:"ml-1 font-medium",children:V})]}):null,V&&ve?s.jsx("span",{className:"mx-1",children:"·"}):null,ve?s.jsxs("span",{className:"inline-flex items-center align-middle",children:["Path: ",s.jsx("span",{className:"ml-1 font-mono",children:ve})]}):null,!V&&!ve&&Ie?s.jsxs("span",{className:"inline-flex items-center align-middle",children:["Config: ",s.jsx("span",{className:"ml-1 font-mono",children:Ie})]}):null]})]})]}),s.jsxs("div",{className:"flex w-full min-w-0 items-center justify-between gap-2 sm:ml-auto sm:w-auto",children:[Qa?s.jsxs("span",{className:"inline-flex max-w-[18rem] min-w-0 items-center rounded-sm border border-border/60 bg-muted/30 px-1.5 py-1 text-[11px] text-muted-foreground",children:[s.jsx("span",{className:"font-medium",children:"MCP:"}),s.jsx("span",{className:"ml-1 min-w-0 truncate font-mono",children:Qa})]}):null,s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center justify-end gap-2",children:[s.jsxs(Z,{variant:"outline",size:"sm",className:`max-w-full gap-1.5 ${a?"px-2":""}`,onClick:()=>{const ae=kbe(c),Pe=new Blob([ae],{type:"text/html"}),jt=URL.createObjectURL(Pe),et=document.createElement("a");et.href=jt,et.download=`mcplab-report-${c.id}.html`,et.click(),URL.revokeObjectURL(jt)},"aria-label":"Download Report",title:"Download Report",children:[s.jsx(Ir,{className:"h-3.5 w-3.5"}),!a&&"Download Report"]}),s.jsxs(Z,{type:"button",variant:"outline",size:"sm",className:"max-w-full gap-1.5",onClick:()=>Dt(),disabled:se,children:[s.jsx(Ac,{className:"h-3.5 w-3.5"}),se?"Reports...":`Reports${ie.length?` (${ie.length})`:""}`]}),s.jsxs(Z,{type:"button",variant:"outline",size:"sm",className:"max-w-full gap-1.5","aria-label":"Run Note",onClick:()=>qt(),children:[s.jsx(Ac,{className:"h-3.5 w-3.5"}),kt?"Note":"Run Note"]}),s.jsxs(Z,{type:"button",variant:"outline",size:"sm",className:"max-w-full gap-1.5","aria-label":"MCP Lab Assistant",onClick:()=>it(),children:[s.jsx(Zr,{className:"h-4 w-4 text-amber-500"}),kt?"Assistant":"MCP Lab Assistant"]}),s.jsxs(Z,{type:"button",variant:"outline",size:"sm",className:"max-w-full gap-1.5",onClick:()=>{pp()},disabled:dt||!ve.trim(),children:[s.jsx(va,{className:"h-3.5 w-3.5"}),dt?"Queueing...":"Rerun"]}),s.jsxs(Z,{type:"button",variant:"outline",size:"sm",className:"max-w-full gap-1.5 text-destructive",onClick:()=>Se(!0),disabled:Ae,"aria-label":Ae?"Deleting run":"Delete run",children:[Ae?s.jsx(jr,{className:"h-4 w-4 animate-spin"}):s.jsx(tl,{className:"h-4 w-4"}),kt?null:Ae?"Deleting...":"Delete"]})]})]})]})}),s.jsxs("div",{className:`grid gap-6 items-start ${P?M?"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 ${P?"xl:h-full xl:min-h-0 xl:overflow-y-auto xl:pr-2":""}`,children:[s.jsxs("div",{className:`grid gap-4 ${P?"grid-cols-3":"sm:grid-cols-2 lg:grid-cols-8"}`,children:[s.jsx(Os,{title:"Scenarios",value:te.length,icon:NS}),s.jsx(Os,{title:"Total Runs",value:Fe,icon:MD}),s.jsx(Os,{title:"Pass Rate",value:`${Math.round(Qt*100)}%`,icon:Bc}),s.jsx(Os,{title:"Avg Tool Calls",value:J$(ke),icon:ga}),s.jsx(Os,{title:"Avg Latency",value:`${en}ms`,icon:WD}),Ct!==null?s.jsx(Os,{title:"Total Time",value:Is(Ct),icon:xa}):null,Kt!==null?s.jsx(Os,{title:"Tool Duration",value:Is(Kt),icon:xa}):null,s.jsx(Os,{title:"Tool Tokens",value:Yr(Hn?.totalTokens),icon:pa})]}),s.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[s.jsxs(nt,{children:[s.jsx(Lt,{className:"pb-2",children:s.jsx(Ft,{className:"text-base",children:"Pass / Fail"})}),s.jsxs(rt,{className:"flex items-center justify-center",children:[s.jsxs(Nhe,{width:180,height:180,children:[s.jsx(Mi,{data:Di,dataKey:"value",innerRadius:50,outerRadius:75,paddingAngle:3,children:Di.map((ae,Pe)=>s.jsx(nv,{fill:ae.color},Pe))}),s.jsx(Qr,{})]}),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"}),$i," 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"}),To," failed"]})]})]})]}),s.jsxs(nt,{children:[s.jsx(Lt,{className:"pb-2",children:s.jsx(Ft,{className:"text-base",children:"Tool Usage"})}),s.jsx(rt,{children:s.jsx(vm,{width:"100%",height:180,children:s.jsxs(She,{data:_n,layout:"vertical",children:[s.jsx(yo,{type:"number",tick:{fontSize:11}}),s.jsx(bo,{type:"category",dataKey:"name",tick:{fontSize:11},width:120}),s.jsx(Qr,{}),s.jsx(zl,{dataKey:"count",fill:"hsl(38, 92%, 50%)",radius:[0,4,4,0]})]})})})]})]}),s.jsxs(nt,{children:[s.jsx(Lt,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx(Ft,{className:"text-base",children:"Scenarios"}),s.jsxs(Z,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5 px-2 text-xs",onClick:()=>it("Summarize the scenario results in this run. Highlight failed scenarios/checks first, then mention notable tool usage and extracted values."),children:[s.jsx(Zr,{className:"h-4 w-4 text-amber-500"}),"Ask Assistant"]})]})}),s.jsx(rt,{className:"p-0",children:s.jsxs(Jr,{children:[s.jsx(es,{children:s.jsxs(Gt,{children:[s.jsx(ht,{className:"w-8"}),s.jsx(ht,{children:"Scenario"}),s.jsx(ht,{children:"Agent"}),s.jsx(ht,{children:"Runs"}),s.jsx(ht,{children:"Pass Rate"}),s.jsx(ht,{children:"Total Time"}),s.jsx(ht,{children:"Tool Calls"}),s.jsx(ht,{children:"Tool Tokens"}),s.jsx(ht,{children:"Tool Duration"})]})}),s.jsx(ts,{children:te.map(ae=>{const Pe=Fu(ae.scenarioId,ae.agentName),jt=ae.scenarioName||ae.scenarioId;return s.jsx(da,{open:S.has(Pe),onOpenChange:()=>Ul(Pe),asChild:!0,children:s.jsxs(s.Fragment,{children:[s.jsx(Ms,{asChild:!0,children:s.jsxs(Gt,{className:"cursor-pointer hover:bg-muted/50",children:[s.jsx(He,{children:s.jsx(tn,{className:`h-4 w-4 transition-transform ${S.has(Pe)?"rotate-180":""}`})}),s.jsx(He,{className:"font-medium text-sm",children:ae.scenarioName}),s.jsxs(He,{className:"text-sm",children:[s.jsx("div",{children:ae.agentName}),(ae.provider||ae.model)&&s.jsx("div",{className:"text-xs text-muted-foreground",children:[ae.provider?ug(ae.provider):null,ae.model].filter(Boolean).join(" · ")})]}),s.jsx(He,{className:"font-mono text-sm",children:ae.runs.length}),s.jsx(He,{children:s.jsx(Ma,{rate:ae.passRate})}),s.jsx(He,{className:"font-mono text-sm",children:Is(TN(ae),{preciseUnderTenSeconds:!0})}),s.jsx(He,{className:"font-mono text-sm",children:J$(ae.avgToolCalls)}),s.jsx(He,{className:"font-mono text-sm",children:Yr(ae.toolTokenUsage?.totalTokens)}),s.jsx(He,{className:"font-mono text-sm",children:Is(RN(ae),{preciseUnderTenSeconds:!0})})]})}),s.jsx(fa,{asChild:!0,children:s.jsx("tr",{children:s.jsx("td",{colSpan:9,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:[jt," · ",ae.agentName," ·"," ",Math.round(ae.passRate*100),"% pass rate ·"," ",Yr(ae.toolTokenUsage?.totalTokens)," tool tokens ·"," ",Is(TN(ae),{preciseUnderTenSeconds:!0})," ","total time ·"," ",Is(RN(ae),{preciseUnderTenSeconds:!0})," ","tool time"]})]}),s.jsxs(Z,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>it(`Explain why scenario '${jt}' failed (agent: ${ae.agentName}). Summarize the likely cause from the result details and suggest what to inspect next.`,{scenarioId:ae.scenarioId}),children:[s.jsx(Zr,{className:"h-4 w-4 text-amber-500"}),"Ask Assistant"]})]}),ae.runs.map(et=>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:et.passed?s.jsx(ga,{className:"h-4 w-4 text-success"}):s.jsx(tl,{className:"h-4 w-4 text-destructive"})}),s.jsxs("div",{className:"flex-1 space-y-1",children:[(()=>{const sn=Ee.get(ae.scenarioId),on=sn?Mbe(sn.evalRules,et.failureReasons,et.error,et.checkResults):[],xn=on.filter(mn=>mn.status==="failed"),cr=on.filter(mn=>mn.status==="passed"),qr=on.filter(mn=>mn.status==="not_evaluated");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 #",et.runIndex+1]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[et.duration,"ms"]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[Yr(et.toolTokenUsage?.totalTokens)," ","tool tokens"]}),!et.passed&&s.jsx(st,{variant:"outline",className:"h-5 border-destructive/30 bg-destructive/10 text-destructive text-[10px]",children:"Failed"})]}),et.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(tl,{className:"h-3.5 w-3.5"}),"Failure reasons"]}),s.jsx("ul",{className:"space-y-1 text-xs text-destructive",children:et.failureReasons.map((mn,Ss)=>s.jsxs("li",{children:["• ",rD(mn)]},Ss))})]}),on.length>0&&s.jsx(da,{open:le(qn(ae.scenarioId,ae.agentName,et.runIndex,"checks")),onOpenChange:()=>Aa(qn(ae.scenarioId,ae.agentName,et.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(tn,{className:`h-3.5 w-3.5 transition-transform ${le(qn(ae.scenarioId,ae.agentName,et.runIndex,"checks"))?"rotate-180":""}`}),s.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Checks"}),s.jsxs(st,{variant:"outline",className:"h-5 border-success/30 bg-success/10 text-success text-[10px]",children:[cr.length," passed"]}),s.jsxs(st,{variant:"outline",className:`h-5 text-[10px] ${xn.length>0?"border-destructive/30 bg-destructive/10 text-destructive":""}`,children:[xn.length," failed"]}),qr.length>0&&s.jsxs(st,{variant:"outline",className:"h-5 border-muted-foreground/30 bg-muted text-[10px] text-muted-foreground",children:[qr.length," not evaluated"]})]})}),s.jsxs(fa,{children:[qr.length>0&&s.jsx("p",{className:"mb-2 text-[11px] text-muted-foreground",children:"Checks were not evaluated because this run failed before evaluation."}),s.jsx("div",{className:"space-y-1",children:on.map((mn,Ss)=>s.jsxs("div",{className:`flex items-start justify-between gap-2 rounded-md border px-2 py-1.5 text-xs ${mn.status==="failed"?"border-destructive/20 bg-destructive/5":mn.status==="not_evaluated"?"border-muted-foreground/20 bg-muted/40":"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:[mn.status==="failed"?s.jsx(tl,{className:"h-3.5 w-3.5 shrink-0 text-destructive"}):mn.status==="not_evaluated"?s.jsx(NE,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):s.jsx(ga,{className:"h-3.5 w-3.5 shrink-0 text-success"}),s.jsx("span",{className:"font-medium",children:qv(mn.rule)})]}),mn.failureReason&&s.jsx("p",{className:"mt-1 pl-5 text-[11px] text-muted-foreground",children:rD(mn.failureReason)})]}),s.jsx(st,{variant:"outline",className:`shrink-0 text-[10px] ${mn.status==="failed"?"border-destructive/30 text-destructive":mn.status==="not_evaluated"?"border-muted-foreground/30 text-muted-foreground":"border-success/30 text-success"}`,children:mn.status})]},`${mn.rule.type}-${mn.rule.value??mn.rule.path??""}-${Ss}`))})]})]})})]})})(),s.jsx(da,{open:le(qn(ae.scenarioId,ae.agentName,et.runIndex,"extracts")),onOpenChange:()=>Aa(qn(ae.scenarioId,ae.agentName,et.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(tn,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${le(qn(ae.scenarioId,ae.agentName,et.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(NS,{className:"h-3.5 w-3.5 text-violet-600"}),"Extracted values"]})]}),s.jsxs(st,{variant:"outline",className:"h-5 text-[10px]",children:[Object.keys(et.extractedValues??{}).length," ","total"]})]})}),s.jsx(fa,{children:Object.keys(et.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(et.extractedValues??{}).map(([sn,on])=>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:sn}),s.jsx("div",{className:"font-mono break-all text-foreground",children:on===null?"null":String(on)})]},sn))})})]})}),s.jsx(da,{open:le(qn(ae.scenarioId,ae.agentName,et.runIndex,"tools")),onOpenChange:()=>Aa(qn(ae.scenarioId,ae.agentName,et.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(tn,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${le(qn(ae.scenarioId,ae.agentName,et.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(pa,{className:"h-3.5 w-3.5 text-sky-600"}),"Tool call sequence"]})]}),s.jsxs(st,{variant:"outline",className:"h-5 text-[10px]",children:[et.toolCalls.length," total"]})]})}),s.jsx(fa,{children:et.toolCalls.length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No tool calls captured for this run."}):s.jsxs("div",{className:"space-y-2",children:[s.jsx("div",{className:"flex flex-wrap gap-1",children:s.jsx(ji,{delayDuration:0,children:et.toolCalls.map((sn,on)=>{const xn=et.conversation.filter(qr=>qr.kind==="tool_call")[on]?.estimatedTokens,cr=typeof xn?.totalTokens=="number";return s.jsxs(Si,{children:[s.jsx(Ni,{asChild:!0,children:s.jsxs(st,{variant:"outline",className:"font-mono text-xs bg-background",children:[s.jsxs("span",{className:"mr-1 text-muted-foreground",children:["#",on+1]}),sn.name,s.jsxs("span",{className:"ml-1 text-muted-foreground",children:[sn.duration,"ms"]}),cr&&s.jsxs("span",{className:"ml-1 text-muted-foreground",children:["·"," ",Yr(xn?.totalTokens),"tok"]})]})}),cr&&s.jsx(qa,{className:"text-xs",children:`${sn.name} · tokens total: ${Yr(xn?.totalTokens)} · in: ${Yr(xn?.inputTokens)} · out: ${Yr(xn?.outputTokens)}`})]},on)})})}),s.jsxs("div",{className:"rounded-md border bg-background p-2",children:[s.jsxs("div",{className:"mb-1.5 flex items-center justify-between gap-2",children:[s.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Tool token estimate"}),s.jsx(st,{variant:"outline",className:"h-5 text-[10px]",children:"estimated"})]}),Object.keys(et.toolTokenUsageByTool??{}).length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"n/a"}):s.jsx("div",{className:"grid gap-1.5 sm:grid-cols-2",children:Object.entries(et.toolTokenUsageByTool??{}).map(([sn,on])=>s.jsxs("div",{className:"rounded border bg-muted/30 px-2 py-1.5 text-xs",children:[s.jsx("div",{className:"font-mono text-[11px]",children:sn}),s.jsxs("div",{className:"text-muted-foreground",children:["total:"," ",Yr(on.totalTokens)," ","· in:"," ",Yr(on.inputTokens)," ","· out:"," ",Yr(on.outputTokens)]})]},sn))})]})]})})]})}),s.jsx(da,{open:le(qn(ae.scenarioId,ae.agentName,et.runIndex,"final")),onOpenChange:()=>Aa(qn(ae.scenarioId,ae.agentName,et.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(tn,{className:`h-3.5 w-3.5 transition-transform ${le(qn(ae.scenarioId,ae.agentName,et.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(Fr,{className:"h-3.5 w-3.5"}),"Final answer"]})]})}),s.jsx(fa,{children:s.jsx(MN,{text:et.finalAnswer||"No final answer captured.",maxLength:1200,className:"text-xs text-foreground"})})]})}),s.jsx(da,{open:le(qn(ae.scenarioId,ae.agentName,et.runIndex,"conversation")),onOpenChange:()=>Aa(qn(ae.scenarioId,ae.agentName,et.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(tn,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${le(qn(ae.scenarioId,ae.agentName,et.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(Z,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>it(`Explain Run #${et.runIndex+1} for scenario '${jt}'. It ${et.passed?"passed":"failed"} in ${et.duration}ms. Focus on the tool sequence and ${et.passed?"why it passed":"what caused the failure"}.`,{scenarioId:ae.scenarioId}),children:[s.jsx(Zr,{className:"h-4 w-4 text-amber-500"}),"Ask Assistant"]})})]}),s.jsx(fa,{children:s.jsx("div",{className:"space-y-2 rounded-md border bg-muted/20 p-2",children:et.conversation.length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No conversation trace captured."}):et.conversation.map(sn=>s.jsx(Rbe,{item:sn,fallbackUserPrompt:Ee.get(ae.scenarioId)?.prompt},sn.id))})}),!le(qn(ae.scenarioId,ae.agentName,et.runIndex,"conversation"))&&s.jsx("button",{type:"button",className:"text-xs text-muted-foreground underline decoration-dotted underline-offset-2 hover:text-foreground",onClick:()=>Aa(qn(ae.scenarioId,ae.agentName,et.runIndex,"conversation")),children:"Expand to inspect user/assistant/tool messages for this run."})]})})]})]},et.runIndex))]})})})})]})},Pe)})})]})})]})]}),P&&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(Dv,{value:U,onValueChange:ae=>F(ae),className:"min-w-0 -mb-px px-3 pt-1",children:s.jsxs(up,{className:"h-auto w-full justify-start rounded-none border-b bg-transparent p-0",children:[s.jsx(za,{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(za,{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(za,{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"})]})}),U==="assistant"?s.jsx(kq,{title:"MCP Lab Assistant",description:"Ask questions about this run result, failures, and tool usage.",expanded:M,onToggleExpanded:()=>D(ae=>!ae),onHide:()=>R(!1),messages:Jt,pendingToolCalls:zt,loading:Qe,onCancel:Ze?_t:void 0,input:_e,onInputChange:Ke,onSend:()=>{De()},inputPlaceholder:"Ask about this result...",snippets:Pbe,onSnippetSelect:Ue,onApproveToolCall:ae=>{re(ae)},onDenyToolCall:ae=>{Ne(ae)},chatEndRef:Bt,inputRef:ue,className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",renderMessage:({message:ae,index:Pe,linkedPendingToolCall:jt,isUser:et,isAssistant:sn,isSystem:on,isTool:xn})=>{const cr=sn&&!!ae.pendingToolCallId;if(xn&&/^(Approved|Denied) tool call\\b/i.test(String(ae.text??"").trim()))return null;const qr=jt?.tool??ae.toolRequestName,mn=jt?.publicToolName??ae.toolRequestPublicName,Ss=sn&&!cr&&Obe(ae.text,!!G);if(cr){const Oo=jt?.status==="pending",fn=Yh(qr??mn??"unknown_tool");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(Fr,{className:"h-3 w-3"})}),s.jsxs("details",{open:!!jt,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(pa,{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 ${fn}`}),s.jsx("span",{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${Oo?"bg-amber-100 text-amber-900":"bg-muted text-muted-foreground"}`,children:Oo?"Needs approval":"Completed"})]})}),s.jsx(tn,{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(Fs,{text:ae.text,className:"text-sm"}),Oo&&jt&&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(jt.arguments??{},null,2)})}),s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx(Z,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:Qe,onClick:()=>{Ne(jt.id)},children:"Deny"}),s.jsx(Z,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:Qe,onClick:()=>{re(jt.id)},children:"Approve"})]})]})]})]})]},`${ae.id??`${ae.role}-${Pe}`}:${jt?"pending":"completed"}`)}const Yv=et||sn&&!xn&&!on;return s.jsxs("div",{className:`flex items-start gap-2 ${et?"justify-end":"justify-start"}`,children:[!et&&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:on?s.jsx(BN,{className:"h-3 w-3"}):s.jsx(Fr,{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 ${et?"border-primary/20 bg-primary/10":on?"border-amber-400/30 bg-amber-50/70":xn?"border-blue-300/30 bg-blue-50/50":"border-border/80 bg-background shadow-sm"}`,children:[!(et||on)&&s.jsx("p",{className:`mb-2 text-[11px] font-semibold text-muted-foreground ${et?"text-right":""}`,children:xn?"Tool":"Assistant"}),et?s.jsx("p",{className:"whitespace-pre-wrap",children:ae.text}):s.jsx(Fs,{text:ae.text,className:"text-sm"}),Ss&&s.jsxs("div",{className:"mt-3 flex max-w-full flex-wrap justify-end gap-2 overflow-x-auto pb-1",children:[s.jsxs(Z,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>dn(ae.text),children:[s.jsx(Zr,{className:"h-4 w-4 text-amber-500"}),"Send to Scenario Assistant"]}),s.jsxs(Z,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>lr(ae.text),children:[s.jsx(pa,{className:"h-3.5 w-3.5"}),"Apply: Write Markdown Report"]})]}),!Ss&&sn&&!cr&&s.jsx("div",{className:"mt-3 flex max-w-full justify-end overflow-x-auto pb-1",children:s.jsxs(Z,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>lr(ae.text),children:[s.jsx(pa,{className:"h-3.5 w-3.5"}),"Apply: Write Markdown Report"]})})]}),Yv&&s.jsx(Z,{type:"button",variant:"ghost",size:"icon",className:"absolute -right-8 bottom-1 h-6 w-6 text-muted-foreground",onClick:()=>{Ro(ae.text)},"aria-label":"Copy message",title:"Copy message",children:s.jsx(ss,{className:"h-3.5 w-3.5"})})]}),et&&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(Uc,{className:"h-3 w-3"})})]},ae.id??`${ae.role}-${Pe}`)},renderMessageExtras:Wt.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)"}),Wt.map(ae=>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:Yh(ae.publicToolName)}),s.jsxs("p",{className:"break-all text-xs text-muted-foreground",children:[ae.server,"::",Yh(ae.tool)]})]}),s.jsx(tn,{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(ae.arguments??{},null,2)})}),s.jsxs("div",{className:"mt-2 flex justify-end gap-2",children:[s.jsx(Z,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:Qe,onClick:()=>{Ne(ae.id)},children:"Deny"}),s.jsx(Z,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:Qe,onClick:()=>{re(ae.id)},children:"Approve"})]})]})]},ae.id))]}):null}):U==="reports"?s.jsxs(nt,{className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[s.jsx(Lt,{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(Ft,{className:"flex items-center gap-2 text-base",children:[s.jsx(Ac,{className:"h-4 w-4 text-muted-foreground"}),"Reports"]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(Z,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>D(ae=>!ae),children:[M?s.jsx(_S,{className:"h-3.5 w-3.5"}):s.jsx(AS,{className:"h-3.5 w-3.5"}),M?"Compact":"Expand"]}),s.jsx(Z,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>R(!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(rt,{className:"flex h-[70vh] min-h-[520px] flex-col p-0 xl:h-auto xl:min-h-0 xl:flex-1",children:[(se||ie.length===0||ie.length>1)&&s.jsx("div",{className:"border-b px-4 py-3",children:se?s.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading reference reports..."}):ie.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(Z,{type:"button",size:"sm",variant:"outline",className:"shrink-0 gap-1.5",onClick:()=>os(),children:[s.jsx(yi,{className:"h-3.5 w-3.5"}),"New Report"]})]}):s.jsx("div",{className:"space-y-2",children:ie.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(In,{value:Oe,onValueChange:fe,children:[s.jsx(Tn,{className:"h-8",children:s.jsx($n,{placeholder:"Select a report"})}),s.jsx(Rn,{children:ie.map(ae=>s.jsx(gt,{value:ae.relativePath,children:ae.name},ae.path))})]})]}):null})}),s.jsx(R_,{className:"min-h-0 flex-1 bg-muted/15 px-4 py-4",children:ie.length===0?s.jsx("div",{className:"text-sm text-muted-foreground",children:"No report selected."}):ot?s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(jr,{className:"h-4 w-4 animate-spin"}),"Loading report..."]}):ut?s.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive",children:["Could not load report: ",ut]}):xe?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:xe.name}),s.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:xe.relativePath}),s.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:new Date(xe.mtime).toLocaleString()})]}),s.jsx("div",{className:"rounded-md border bg-background p-3",children:s.jsx(Fs,{text:xe.content,className:"text-sm"})})]}):s.jsx("div",{className:"text-sm text-muted-foreground",children:"Select a report to preview."})})]})]}):s.jsxs(nt,{className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[s.jsx(Lt,{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(Ft,{className:"flex items-center gap-2 text-base",children:[s.jsx(Ac,{className:"h-4 w-4 text-muted-foreground"}),"Run Note"]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(Z,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>D(ae=>!ae),children:[M?s.jsx(_S,{className:"h-3.5 w-3.5"}):s.jsx(AS,{className:"h-3.5 w-3.5"}),M?"Compact":"Expand"]}),s.jsx(Z,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>R(!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(rt,{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:[x.length,"/500"]})]}),s.jsx(wa,{value:x,onChange:ae=>j(ae.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(Z,{size:"sm",onClick:()=>{vr()},disabled:b,children:b?"Saving...":"Save note"}),s.jsx(Z,{size:"sm",variant:"outline",onClick:()=>{j(c.runNote??""),v(!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(Z,{size:"sm",variant:"ghost",className:"ml-auto h-6 px-2 text-xs",onClick:()=>v(!0),children:c.runNote?"Edit":"Add note"})]})})]})]}),s.jsx(ja,{open:L,onOpenChange:ae=>!K&&I(ae),children:s.jsxs(Us,{className:"max-w-2xl",children:[s.jsxs(Ws,{children:[s.jsx(Hs,{children:ne?"Create markdown report":"Approve MCP action: write markdown report"}),s.jsx(Ks,{children:ne?"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:[!ne&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Output path"}),s.jsx(Et,{value:O,onChange:ae=>Q(ae.target.value),placeholder:"mcplab/reports/result-assistant/my-report.md",disabled:K})]}),s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx(wr,{checked:q,onCheckedChange:ae=>z(ae===!0),disabled:K}),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:ne?"Markdown content":"Markdown preview (to be written)"}),s.jsx(wa,{value:Y,onChange:ae=>W(ae.target.value),rows:10,className:"font-mono text-xs",disabled:K})]})]}),s.jsxs(Vs,{children:[s.jsx(Ys,{disabled:K,children:"Cancel"}),s.jsx(Gs,{onClick:ae=>{ae.preventDefault(),gr()},disabled:K,children:K?"Writing...":ne?"Save Report":"Approve & Write"})]})]})}),s.jsx(ja,{open:Xe,onOpenChange:Se,children:s.jsxs(Us,{children:[s.jsxs(Ws,{children:[s.jsx(Hs,{children:"Delete run?"}),s.jsxs(Ks,{children:["This will permanently remove run ",s.jsx("span",{className:"font-mono",children:c?.id}),". This action cannot be undone."]})]}),s.jsxs(Vs,{children:[s.jsx(Ys,{disabled:Ae,children:"Cancel"}),s.jsx(Gs,{disabled:Ae||!c?.id,onClick:ae=>{ae.preventDefault(),Wl()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ae?"Deleting...":"Delete"})]})]})})]})]})};function Rbe({item:e,fallbackUserPrompt:t}){if(e.kind==="tool_call"){const d=eD(e,"input");return s.jsx(nD,{variant:"call",title:`Tool call · ${e.toolName||"unknown"}${d}`,text:e.text})}if(e.kind==="tool_result"){const d=eD(e,"output"),f=e.ok?s.jsx(ga,{className:"h-3.5 w-3.5 text-emerald-700 dark:text-emerald-300"}):s.jsx(tl,{className:"h-3.5 w-3.5 text-rose-700 dark:text-rose-300"});return s.jsx(nD,{variant:e.ok?"result_ok":"result_error",title:`Tool result · ${e.toolName||"unknown"} · ${e.ok?"ok":"error"}${typeof e.durationMs=="number"?` · ${e.durationMs}ms`:""}${d}`,text:e.text,icon:f})}const n=e.kind==="user_prompt",r=tD(e.text,e.kind),a=t?tD(t,"user_prompt"):"",i=n&&!r&&a?a:r,o=n?"User prompt":e.kind==="assistant_final"?"Agent final":"Agent",c=n?Uc:Fr;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(MN,{text:i,maxLength:280,className:"text-xs"}):s.jsx(MN,{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 eD(e,t){const n=t==="input"?e.estimatedTokens?.inputTokens:e.estimatedTokens?.outputTokens;return typeof n!="number"?"":` · ${Yr(n)} tokens`}function tD(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 Obe(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 nD({variant:e,title:t,text:n,icon:r}){const[a,i]=m.useState(!1),o={call:"border-sky-500/30 bg-sky-500/10 text-sky-700 dark:text-sky-300",result_ok:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",result_error:"border-rose-500/30 bg-rose-500/10 text-rose-700 dark:text-rose-300"};return s.jsx(da,{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(pa,{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(fa,{children:s.jsx("p",{className:"mt-2 font-mono whitespace-pre-wrap text-foreground",children:n})})]})})}function MN({text:e,maxLength:t,className:n}){const[r,a]=m.useState(!1),i=e.length>t,o=r||!i?e:`${e.slice(0,t)}...`;return s.jsxs("div",{children:[s.jsx(Fs,{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 Mbe(e,t,n,r){return i8({evalRules:e,failureReasons:t,runError:n,checkResults:r})}function rD(e){const t=String(e??"").trim(),n=t.match(/^Regex assertion failed:\s*(.+)$/i);return n?`Text match failed: ${n[1]}`:t}const xS=["hsl(38, 92%, 50%)","hsl(200, 80%, 50%)","hsl(152, 69%, 40%)","hsl(280, 60%, 50%)","hsl(0, 72%, 51%)"],Ibe=9,sD="mcplab.compare.showDaySeparators",wc=[{value:"15min",label:"Last 15min",durationMs:900*1e3},{value:"30min",label:"Last 30min",durationMs:1800*1e3},{value:"1h",label:"Last hour",durationMs:3600*1e3},{value:"24h",label:"Last 24 hours",durationMs:1440*60*1e3},{value:"7d",label:"Last 7 days",durationMs:10080*60*1e3},{value:"14d",label:"Last 14 days",durationMs:336*60*60*1e3},{value:"30d",label:"Last 30 days",durationMs:720*60*60*1e3}];function ll(e){if(!e.trim())return null;const t=new Date(e);return Number.isNaN(t.getTime())?null:t}function zh(e){const t=ll(e);return t?t.toLocaleString():""}function $be(e){const t=ll(e);if(!t)return e;const n=t.getUTCFullYear(),r=String(t.getUTCMonth()+1).padStart(2,"0"),a=String(t.getUTCDate()).padStart(2,"0");return`${n}-${r}-${a}`}function Dbe(e){const t=Object.entries(e??{});return t.length===0?"—":t.sort((n,r)=>n[0].localeCompare(r[0])).map(([n,r])=>`${n}@${r??"unknown"}`).join(", ")}function Lbe(e){const t=ll(e);return t?t.toLocaleDateString(void 0,{weekday:"long",month:"short",day:"numeric",year:"numeric",timeZone:"UTC"}):"Unknown day"}function Fbe(e){return e==="all"||e==="last"||e==="custom"}function zbe(e){return e==="15min"||e==="30min"||e==="1h"||e==="24h"||e==="7d"||e==="14d"||e==="30d"}function Bbe(e){const t=e.get("time_filter"),n=e.get("time_preset");return{mode:Fbe(t)?t:"all",preset:zbe(n)?n:"15min",start:e.get("time_start")??"",end:e.get("time_end")??""}}function qbe(e,t){return e.length!==t.length?!1:e.every((n,r)=>n===t[r])}function Ube(e){const t=e.find(n=>n.provider&&n.model)??e.find(n=>n.provider||n.model);return{provider:t?.provider,model:t?.model}}const Wbe=()=>{const{source:e}=On(),[t,n]=Pi(),r=Bbe(t),a=t.get("mode")==="within-run"?"within-run":"runs",[i,o]=m.useState([]),[c,d]=m.useState({}),[f,h]=m.useState(!1),[p,v]=m.useState(new Set),[x,j]=m.useState("timestamp"),[b,y]=m.useState("desc"),[S,N]=m.useState("all"),[_,A]=m.useState(!1),[k,E]=m.useState(()=>{if(typeof window>"u")return!1;try{return window.localStorage.getItem(sD)==="1"}catch{return!1}}),[P,R]=m.useState(r.mode),[M,D]=m.useState(r.preset),[U,F]=m.useState(r.start),[G,H]=m.useState(r.end),[L,I]=m.useState(!1),Y=100,W=Kv(Y),{offset:O,hasMore:Q,totalCount:q}=W,z=t.get("runId")??"",K=(t.get("agents")??"").split(",").map(B=>B.trim()).filter(Boolean),J=t.get("scenario")??"all",[ne,he]=m.useState(z),[ie,me]=m.useState(K),[se,ge]=m.useState(J),[Oe,fe]=m.useState(!1),xe=m.useRef(0),we=m.useMemo(()=>{if(P==="all")return{};if(P==="last"){const de=wc.find($e=>$e.value===M)??wc[0],Le=new Date;return{since:new Date(Le.getTime()-de.durationMs).toISOString(),until:Le.toISOString()}}const B=ll(U)?.toISOString(),oe=ll(G)?.toISOString();return{since:B,until:oe}},[G,P,M,U]),ot=async()=>{const B=xe.current+1;xe.current=B,h(!0);try{if(e.listRunSummariesPage){const oe={limit:Y,offset:O};S!=="all"&&(oe.scenario=S),we.since&&(oe.since=we.since),we.until&&(oe.until=we.until);const de=await e.listRunSummariesPage(oe);if(xe.current!==B)return;W.updateMeta(de),o(de.data.map(il))}else{const oe=await e.listResults();if(xe.current!==B)return;o(oe)}}catch(oe){Me({title:"Could not load results",description:oe instanceof Error?oe.message:String(oe),variant:"destructive"})}finally{xe.current===B&&h(!1)}};m.useEffect(()=>{let B=!0;return xe.current+=1,h(!0),(e.listRunSummariesPage?e.listRunSummariesPage({limit:Y,offset:O,scenario:S==="all"?void 0:S,since:we.since,until:we.until}).then(de=>(B&&W.updateMeta(de),de.data.map(il))):e.listResults()).then(de=>{B&&o(de)}).catch(de=>{B&&Me({title:"Could not load results",description:de instanceof Error?de.message:String(de),variant:"destructive"})}).finally(()=>{B&&h(!1)}),()=>{B=!1}},[O,S,e,we]);const lt=B=>{if(x===B){y(oe=>oe==="asc"?"desc":"asc");return}j(B),y(B==="timestamp"?"desc":"asc")},ut=B=>{v(oe=>{const de=new Set(oe);return de.has(B)?de.delete(B):de.add(B),de})},At=m.useMemo(()=>{const B=new Set;return i.forEach(oe=>{oe.scenarios.forEach(de=>{const Le=String(de.scenarioName??"").trim(),$e=String(de.scenarioId??"").trim(),Ge=Le||$e;Ge&&B.add(Ge)})}),Array.from(B).sort((oe,de)=>oe.localeCompare(de))},[i]),Xe=m.useMemo(()=>{const B=S==="all"?i:i.filter(Ie=>Ie.scenarios.some(V=>{const ve=String(V.scenarioName??"").trim(),Ee=String(V.scenarioId??"").trim();return(ve||Ee)===S}));if(a!=="runs"||P==="all")return B;const oe=Date.now();if(P==="last"){const Ie=wc.find(ve=>ve.value===M)??wc[0],V=oe-Ie.durationMs;return B.filter(ve=>{const Ee=new Date(ve.timestamp).getTime();return Ee>=V&&Ee<=oe})}const de=ll(U)?.getTime()??null,Le=ll(G)?.getTime()??null,$e=de!==null&&Le!==null?Math.min(de,Le):de??null,Ge=de!==null&&Le!==null?Math.max(de,Le):Le??null;return B.filter(Ie=>{const V=new Date(Ie.timestamp).getTime();return!(Number.isNaN(V)||$e!==null&&V<$e||Ge!==null&&V>Ge)})},[a,i,S,G,P,M,U]),Se=m.useMemo(()=>[...Xe].sort((B,oe)=>{let de=0;return x==="id"&&(de=B.id.localeCompare(oe.id)),x==="timestamp"&&(de=new Date(B.timestamp).getTime()-new Date(oe.timestamp).getTime()),x==="passRate"&&(de=B.overallPassRate-oe.overallPassRate),x==="scenarios"&&(de=B.totalScenarios-oe.totalScenarios),b==="asc"?de:-de}),[Xe,x,b]),Ae=m.useMemo(()=>Se.filter(B=>p.has(B.id)).map(B=>c[B.id]??B),[c,Se,p]),Je=m.useMemo(()=>{if(!k)return Se.map(de=>({type:"run",run:de}));const B=[];let oe=null;for(const de of Se){const Le=$be(de.timestamp);Le!==oe&&(B.push({type:"day-separator",dayKey:Le,dayLabel:Lbe(de.timestamp)}),oe=Le),B.push({type:"run",run:de})}return B},[k,Se]);m.useEffect(()=>{if(!(typeof window>"u"))try{window.localStorage.setItem(sD,k?"1":"0")}catch{}},[k]);const dt=B=>x!==B?s.jsx(Oc,{className:"h-3.5 w-3.5 text-muted-foreground"}):b==="asc"?s.jsx(ma,{className:"h-3.5 w-3.5"}):s.jsx(tn,{className:"h-3.5 w-3.5"}),Pt=m.useMemo(()=>{const B=new Map;for(const oe of Se)B.set(oe.id,d_(oe));return B},[Se]),Xt=B=>{const oe=Array.from(new Set(B.scenarios.map(de=>de.agentId).filter(Boolean)));return oe.slice(0,Math.min(2,oe.length))},kt=B=>{const oe=Xt(B);he(B.id),me(oe),ge("all");const de=new URLSearchParams(t);de.set("mode","within-run"),de.set("runId",B.id),oe.length>0?de.set("agents",oe.join(",")):de.delete("agents"),de.delete("scenario"),n(de,{replace:!0})},nn=m.useMemo(()=>[...new Set(Ae.flatMap(B=>B.scenarios.map(oe=>oe.scenarioId)))],[Ae]),Jt=m.useMemo(()=>{const B=new Map;for(const oe of Ae)for(const de of oe.scenarios){const Le=String(de.scenarioId??"").trim();if(!Le)continue;const $e=String(de.scenarioName??"").trim();B.set(Le,$e||Le)}return B},[Ae]),zt=m.useMemo(()=>c[ne]??i.find(B=>B.id===ne),[c,i,ne]);m.useEffect(()=>{if(typeof e.getResult!="function"||p.size===0&&!ne)return;const B=new Set([...p]);ne&&B.add(ne);for(const oe of B)c[oe]||e.getResult(oe).then(de=>{de&&d(Le=>Le[oe]?Le:{...Le,[oe]:de})})},[c,p,e,ne]),m.useEffect(()=>{W.reset()},[W.reset,S,P,M,U,G]);const _e=m.useMemo(()=>{if(!zt)return[];const B=new Map;for(const oe of zt.scenarios)B.set(oe.agentId,oe.agentName||oe.agentId);return Array.from(B.entries()).map(([oe,de])=>({id:oe,name:de})).sort((oe,de)=>oe.name.localeCompare(de.name))},[zt]),Qe=m.useMemo(()=>{if(!zt)return[];const B=new Set;for(const oe of zt.scenarios){const de=String(oe.scenarioName??"").trim(),Le=String(oe.scenarioId??"").trim(),$e=de||Le;$e&&B.add($e)}return Array.from(B).sort((oe,de)=>oe.localeCompare(de))},[zt]),Ze=m.useMemo(()=>ie.join(","),[ie]);m.useEffect(()=>{if(a==="within-run"){const B=t.get("runId")??"",oe=(t.get("agents")??"").split(",").map(Le=>Le.trim()).filter(Boolean),de=t.get("scenario")??"all";he(Le=>Le===B?Le:B),me(Le=>qbe(Le,oe)?Le:oe),ge(Le=>Le===de?Le:de)}},[a,t]),m.useEffect(()=>{if(a!=="within-run"||i.length===0)return;let B=ne;(!B||!i.some(V=>V.id===B))&&(B=i[0].id);const oe=i.find(V=>V.id===B),de=(()=>{if(!oe)return[];const V=new Map;for(const ve of oe.scenarios)V.set(ve.agentId,ve.agentName||ve.agentId);return Array.from(V.keys())})(),Le=new Set(de);let $e=Ze.split(",").map(V=>V.trim()).filter(V=>!!V).filter(V=>Le.has(V));$e.length===0&&de.length>0&&($e=de.slice(0,Math.min(2,de.length)));const Ge=(()=>{if(!oe)return new Set;const V=new Set;for(const ve of oe.scenarios){const Ee=String(ve.scenarioName??"").trim(),tt=String(ve.scenarioId??"").trim(),te=Ee||tt;te&&V.add(te)}return new Set(V)})(),Ie=se!=="all"&&!Ge.has(se)?"all":se;B!==ne&&he(B),$e.join(",")!==Ze&&me($e),Ie!==se&&ge(Ie)},[a,i,ne,Ze,se]),m.useEffect(()=>{const B=new URLSearchParams(t);a==="within-run"?(B.set("mode","within-run"),ne?B.set("runId",ne):B.delete("runId"),ie.length>0?B.set("agents",ie.join(",")):B.delete("agents"),se!=="all"?B.set("scenario",se):B.delete("scenario"),B.delete("time_filter"),B.delete("time_preset"),B.delete("time_start"),B.delete("time_end")):(B.delete("mode"),B.delete("runId"),B.delete("agents"),B.delete("scenario"),P==="all"?(B.delete("time_filter"),B.delete("time_preset"),B.delete("time_start"),B.delete("time_end")):P==="last"?(B.set("time_filter","last"),B.set("time_preset",M),B.delete("time_start"),B.delete("time_end")):(B.set("time_filter","custom"),B.delete("time_preset"),U.trim()?B.set("time_start",U.trim()):B.delete("time_start"),G.trim()?B.set("time_end",G.trim()):B.delete("time_end")));const oe=t.toString(),de=B.toString();oe!==de&&n(B,{replace:!0})},[a,G,P,M,U,ne,ie,se,t,n]);const _t=m.useMemo(()=>{if(P==="all")return"All time";if(P==="last")return wc.find(de=>de.value===M)?.label??"Last range";const B=!!U.trim(),oe=!!G.trim();return!B&&!oe?"Custom range":B&&oe?`${zh(U)} - ${zh(G)}`:B?`From ${zh(U)}`:`Until ${zh(G)}`},[G,P,M,U]),Bt=()=>{R("all"),D("15min"),F(""),H("")},ue=m.useMemo(()=>{if(!zt)return[];const B=new Map;for(const de of zt.scenarios){const Le=String(de.scenarioId??"").trim(),$e=String(de.scenarioName??"").trim(),Ge=$e||Le;if(!Le&&!Ge)continue;const Ie=Le||Ge,V=B.get(Ie);if(V){V.byAgent[de.agentId]=de;continue}B.set(Ie,{scenarioId:Le||Ge,scenarioName:$e,displayLabel:Ge||Le,byAgent:{[de.agentId]:de}})}const oe=Array.from(B.values()).sort((de,Le)=>{const $e=(de.displayLabel||de.scenarioId).toLowerCase(),Ge=(Le.displayLabel||Le.scenarioId).toLowerCase();return $e.localeCompare(Ge)});return se==="all"?oe:oe.filter(de=>de.displayLabel===se)},[zt,se]),Ke=m.useMemo(()=>{const B=new Map(_e.map(oe=>[oe.id,oe]));return ie.map(oe=>B.get(oe)).filter(oe=>!!oe)},[ie,_e]),De=m.useMemo(()=>{if(!zt||Ke.length!==2)return null;const[B,oe]=Ke;return{left:B,right:oe,link:`/compare/results?left=${encodeURIComponent(zt.id)}&right=${encodeURIComponent(zt.id)}&leftConfig=${encodeURIComponent(zt.configId)}&rightConfig=${encodeURIComponent(zt.configId)}&leftAgent=${encodeURIComponent(B.id)}&rightAgent=${encodeURIComponent(oe.id)}`}},[zt,Ke]),re=m.useMemo(()=>!zt||Ke.length===0?[]:Ke.map(B=>{const oe=ue.map(Ee=>Ee.byAgent[B.id]).filter(Ee=>!!Ee),de=oe.flatMap(Ee=>Ee.runs),Le=de.length,$e=de.filter(Ee=>Ee.passed).length,Ge=de.reduce((Ee,tt)=>Ee+tt.toolCalls.length,0),Ie=de.reduce((Ee,tt)=>Ee+tt.duration,0),{provider:V,model:ve}=Ube(oe);return{agentId:B.id,agentName:B.name,provider:V,model:ve,passRate:Le===0?0:$e/Le,totalRuns:Le,avgToolCalls:Le===0?0:Ge/Le,avgLatency:Le===0?0:Ie/Le}}),[zt,Ke,ue]),Ne=B=>{me(oe=>oe.includes(B)?oe.filter(de=>de!==B):[...oe,B])},Ue=B=>s.jsxs("div",{className:"min-w-0 rounded border bg-muted/20 px-2 py-1.5",children:[s.jsxs("div",{className:"text-xs",children:[s.jsxs("span",{className:"font-mono",children:["#",B.runIndex+1]})," ",s.jsx("span",{className:B.passed?"text-emerald-700":"text-destructive",children:B.passed?"PASS":"FAIL"})," ","· tools: ",B.toolCalls.length," · ",B.duration,"ms"]}),!B.passed&&B.failureReasons.length>0&&s.jsx("div",{className:"mt-1 max-h-16 overflow-y-auto whitespace-pre-wrap break-all pr-1 text-[11px] text-muted-foreground",children:B.failureReasons.join("; ")})]},B.runIndex);return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(zD,{className:"h-6 w-6"}),"Compare Runs"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:a==="runs"?"Select 2–5 runs to compare":"Compare agents side-by-side within one run"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[a==="within-run"&&s.jsxs(Z,{variant:"outline",size:"sm",onClick:()=>{const B=new URLSearchParams(t);B.delete("mode"),B.delete("runId"),B.delete("agents"),B.delete("scenario"),n(B,{replace:!0})},children:[s.jsx(ID,{className:"mr-1.5 h-4 w-4"}),"Back to Compare"]}),a==="runs"&&s.jsxs(s.Fragment,{children:[s.jsxs(ho,{open:_,onOpenChange:A,children:[s.jsx(mo,{asChild:!0,children:s.jsxs(Z,{type:"button",variant:"outline",role:"combobox","aria-expanded":_,"aria-controls":"compare-scenario-command-list",className:`w-[260px] justify-between font-normal ${S!=="all"?"border-primary/40":""}`,children:[s.jsx("span",{className:"truncate text-left",children:S==="all"?"All scenarios":S}),s.jsx(tn,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(xi,{className:"w-[260px] p-0",align:"start",children:s.jsxs(_l,{children:[s.jsx(Al,{placeholder:"Search scenarios..."}),s.jsxs(kl,{id:"compare-scenario-command-list",children:[s.jsx(El,{children:"No scenarios found."}),s.jsxs(Pl,{children:[s.jsx(xs,{value:"all scenarios",onSelect:()=>{N("all"),A(!1)},children:"All scenarios"}),At.map(B=>s.jsx(xs,{value:B,onSelect:()=>{N(B),A(!1)},children:B},B))]})]})]})})]}),s.jsxs(ho,{open:L,onOpenChange:I,children:[s.jsx(mo,{asChild:!0,children:s.jsxs(Z,{type:"button",variant:"outline",role:"combobox","aria-expanded":L,"aria-controls":"compare-time-command-list",className:`w-[320px] justify-between font-normal ${P!=="all"?"border-primary/40":""}`,children:[s.jsxs("span",{className:"flex min-w-0 items-center gap-2 truncate text-left",children:[s.jsx($D,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"truncate",children:_t})]}),s.jsx(tn,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsxs(xi,{className:"w-[360px] p-0",align:"start",children:[s.jsxs("div",{className:"border-b px-3 py-2",children:[s.jsx("p",{className:"text-sm font-medium",children:"Date and time filter"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Filter runs by timestamp."})]}),s.jsxs("div",{id:"compare-time-command-list",className:"grid gap-1 p-2",children:[s.jsx(Z,{type:"button",variant:P==="all"?"secondary":"ghost",className:"justify-start",onClick:()=>{Bt(),I(!1)},children:"All time"}),wc.map(B=>s.jsx(Z,{type:"button",variant:P==="last"&&M===B.value?"secondary":"ghost",className:"justify-start",onClick:()=>{R("last"),D(B.value),I(!1)},children:B.label},B.value)),s.jsx(Z,{type:"button",variant:P==="custom"?"secondary":"ghost",className:"justify-start",onClick:()=>R("custom"),children:"Custom date time range"})]}),P==="custom"&&s.jsxs("div",{className:"space-y-3 border-t p-3",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{htmlFor:"compare-time-filter-start",children:"Start"}),s.jsx(Et,{id:"compare-time-filter-start",type:"datetime-local",value:U,onChange:B=>F(B.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{htmlFor:"compare-time-filter-end",children:"End"}),s.jsx(Et,{id:"compare-time-filter-end",type:"datetime-local",value:G,onChange:B=>H(B.target.value)})]}),s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs(Z,{type:"button",variant:"ghost",size:"sm",className:"px-2",onClick:Bt,children:[s.jsx(ns,{className:"mr-1.5 h-3.5 w-3.5"}),"Clear"]}),s.jsx(Z,{type:"button",size:"sm",onClick:()=>I(!1),children:"Done"})]})]})]})]})]}),s.jsxs("div",{className:"inline-flex items-center gap-2 rounded-md border px-3 py-2",children:[s.jsx(Ve,{htmlFor:"compare-day-separators-switch",className:"text-sm font-medium",children:"Group by day"}),s.jsx(hg,{id:"compare-day-separators-switch",checked:k,onCheckedChange:E,"aria-label":"Group by day"})]}),s.jsx(Z,{variant:"outline",onClick:()=>{ot()},disabled:f,children:f?"Refreshing...":"Refresh"}),s.jsx(Z,{variant:"outline",onClick:W.prev,disabled:f||O===0,children:"Prev"}),s.jsx(Z,{variant:"outline",onClick:W.next,disabled:f||!Q,children:"Next"})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:W.rangeLabel(i.length)}),a==="within-run"&&s.jsxs(nt,{children:[s.jsx(Lt,{className:"pb-3",children:s.jsx(Ft,{className:"text-base",children:"Within One Run Controls"})}),s.jsxs(rt,{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Run"}),s.jsxs(In,{value:ne,onValueChange:he,children:[s.jsx(Tn,{children:s.jsx($n,{placeholder:"Select run"})}),s.jsx(Rn,{children:i.map(B=>s.jsx(gt,{value:B.id,children:B.id},B.id))})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Scenario filter"}),s.jsxs(ho,{open:Oe,onOpenChange:fe,children:[s.jsx(mo,{asChild:!0,children:s.jsxs(Z,{type:"button",variant:"outline",role:"combobox","aria-expanded":Oe,"aria-controls":"compare-within-run-scenario-command-list",className:"w-full justify-between font-normal",children:[s.jsx("span",{className:"truncate text-left",children:se==="all"?"All scenarios":se}),s.jsx(tn,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(xi,{className:"w-[var(--radix-popover-trigger-width)] p-0",align:"start",children:s.jsxs(_l,{children:[s.jsx(Al,{placeholder:"Search scenarios..."}),s.jsxs(kl,{id:"compare-within-run-scenario-command-list",children:[s.jsx(El,{children:"No scenarios found."}),s.jsxs(Pl,{children:[s.jsx(xs,{value:"all scenarios",onSelect:()=>{ge("all"),fe(!1)},children:"All scenarios"}),Qe.map(B=>s.jsx(xs,{value:B,onSelect:()=>{ge(B),fe(!1)},children:B},B))]})]})]})})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Agents (select 2+)"}),s.jsxs("div",{className:"flex flex-wrap gap-3 rounded-md border p-3",children:[_e.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents available for selected run."}),_e.map(B=>s.jsxs("label",{className:"inline-flex items-center gap-2 text-sm",children:[s.jsx(wr,{checked:ie.includes(B.id),onCheckedChange:()=>Ne(B.id)}),s.jsx("span",{children:B.name})]},B.id))]})]})]})]}),a==="runs"&&s.jsx(nt,{children:s.jsx(rt,{className:"p-0",children:s.jsxs(Jr,{containerClassName:"max-h-[36rem] overflow-auto",children:[s.jsx(es,{className:"[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background",children:s.jsxs(Gt,{children:[s.jsx(ht,{className:"w-10"}),s.jsx(ht,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>lt("id"),children:["Run ID",dt("id")]})}),s.jsx(ht,{children:"Evaluated"}),s.jsx(ht,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>lt("timestamp"),children:["Timestamp",dt("timestamp")]})}),s.jsx(ht,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex w-full items-center justify-end gap-1 hover:text-foreground",onClick:()=>lt("passRate"),children:["Pass Rate",dt("passRate")]})}),s.jsx(ht,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>lt("scenarios"),children:["Scenarios",dt("scenarios")]})}),s.jsx(ht,{className:"text-right",children:"Tool Tokens"}),s.jsx(ht,{className:"text-right",children:"Agents"}),s.jsx(ht,{className:"w-[140px] text-right",children:"Action"})]})}),s.jsx(ts,{children:Je.map((B,oe)=>B.type==="day-separator"?s.jsx(Gt,{className:"bg-muted/30 hover:bg-muted/30",children:s.jsx(He,{colSpan:Ibe,className:"px-4 py-3",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"h-px flex-1 bg-border/70"}),s.jsx("span",{className:"shrink-0 rounded-full border border-border bg-background px-2.5 py-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:B.dayLabel}),s.jsx("div",{className:"h-px flex-1 bg-border/70"})]})})},`day-${B.dayKey}-${oe}`):s.jsxs(Gt,{children:[s.jsx(He,{children:s.jsx(wr,{checked:p.has(B.run.id),onCheckedChange:()=>ut(B.run.id),disabled:!p.has(B.run.id)&&p.size>=5})}),s.jsx(He,{className:"font-mono text-xs",children:B.run.id}),s.jsx(He,{className:"text-[11px] text-muted-foreground",children:(()=>{const de=Pt.get(B.run.id)??{scenarioCount:0,agentCount:0,scopePreview:"n/a",modelSummary:""};return s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:["Evaluated: ",de.scenarioCount," scenario",de.scenarioCount===1?"":"s"," · ",de.agentCount," agent",de.agentCount===1?"":"s",de.modelSummary?` · ${de.modelSummary}`:""]}),s.jsx("div",{className:"font-mono text-xs text-foreground/80",children:de.scopePreview})]})})()}),s.jsx(He,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(xa,{className:"h-3 w-3"}),new Date(B.run.timestamp).toLocaleString()]}),(()=>{const de=mg(B.run);return de===null?null:s.jsxs("div",{className:"font-mono text-[11px] text-muted-foreground/90",children:["Total time: ",Is(de)]})})()]})}),s.jsx(He,{className:"text-right",children:s.jsx(Ma,{rate:B.run.overallPassRate})}),s.jsx(He,{className:"text-right font-mono text-sm",children:B.run.totalScenarios}),s.jsx(He,{className:"text-right",children:s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("div",{className:"font-mono text-sm",children:Yr(B.run.toolTokenUsage?.totalTokens)}),(()=>{const de=gg(B.run);return de===null?null:s.jsxs("div",{className:"font-mono text-[11px] text-muted-foreground/90",children:["Tool time: ",Is(de)]})})()]})}),s.jsx(He,{className:"text-right font-mono text-sm",children:Pt.get(B.run.id)?.agentCount??0}),s.jsx(He,{className:"text-right",children:(Pt.get(B.run.id)?.agentCount??0)>1?s.jsx(Z,{type:"button",size:"sm",variant:"outline",onClick:()=>kt(B.run),children:"Compare agents"}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})})]},B.run.id))})]})})}),a==="runs"&&Ae.length<2&&s.jsx(nt,{children:s.jsxs(rt,{className:"py-12 text-center",children:[s.jsx("p",{className:"text-sm font-medium",children:"No runs selected"}),s.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Select 2–5 runs from the table above to start a comparison."})]})}),a==="runs"&&Ae.length>=2&&s.jsxs(s.Fragment,{children:[Ae.length===2&&s.jsx(nt,{children:s.jsx(rt,{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(Z,{asChild:!0,size:"sm",children:s.jsx(Tt,{to:`/compare/results?left=${encodeURIComponent(Ae[0].id)}&right=${encodeURIComponent(Ae[1].id)}&leftConfig=${encodeURIComponent(Ae[0].configId)}&rightConfig=${encodeURIComponent(Ae[1].configId)}`,children:"Compare full results"})})]})})}),s.jsxs(nt,{children:[s.jsx(Lt,{className:"pb-3",children:s.jsx(Ft,{className:"text-base",children:"Summary Comparison"})}),s.jsx(rt,{className:"max-h-[24rem] overflow-auto p-0",children:s.jsxs(Jr,{className:"table-fixed",children:[s.jsx(es,{className:"[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background",children:s.jsxs(Gt,{children:[s.jsx(ht,{className:"w-[220px]",children:"Metric"}),Ae.map((B,oe)=>s.jsxs(ht,{style:{color:xS[oe]},className:"font-mono text-xs",children:[s.jsx("div",{children:B.id}),B.configPath?.trim()?s.jsx("div",{className:"mt-0.5 font-mono text-[10px] font-normal text-muted-foreground",children:B.configPath.trim()}):null]},B.id))]})}),s.jsxs(ts,{children:[s.jsxs(Gt,{children:[s.jsx(He,{className:"font-medium",children:"Pass Rate"}),Ae.map(B=>s.jsx(He,{children:s.jsx(Ma,{rate:B.overallPassRate})},B.id))]}),s.jsxs(Gt,{children:[s.jsx(He,{className:"font-medium",children:"Total Runs"}),Ae.map(B=>s.jsx(He,{className:"font-mono",children:B.totalRuns},B.id))]}),s.jsxs(Gt,{children:[s.jsx(He,{className:"font-medium",children:"Tool Calls"}),Ae.map(B=>s.jsx(He,{className:"font-mono",children:B.avgToolCalls.toFixed(1)},B.id))]}),s.jsxs(Gt,{children:[s.jsx(He,{className:"font-medium",children:"Avg Latency"}),Ae.map(B=>s.jsxs(He,{className:"font-mono",children:[B.avgLatency,"ms"]},B.id))]}),s.jsxs(Gt,{children:[s.jsx(He,{className:"font-medium",children:"Total Time"}),Ae.map(B=>s.jsx(He,{className:"font-mono",children:(()=>{const oe=mg(B);return oe===null?"—":Is(oe)})()},B.id))]}),s.jsxs(Gt,{children:[s.jsx(He,{className:"font-medium",children:"Tool Time"}),Ae.map(B=>s.jsx(He,{className:"font-mono",children:(()=>{const oe=gg(B);return oe===null?"—":Is(oe)})()},B.id))]})]})]})})]}),s.jsxs(nt,{children:[s.jsx(Lt,{className:"pb-3",children:s.jsx(Ft,{className:"text-base",children:"Scenario Breakdown"})}),s.jsx(rt,{className:"max-h-[26rem] overflow-auto p-0",children:s.jsxs(Jr,{className:"table-fixed",children:[s.jsx(es,{className:"[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background",children:s.jsxs(Gt,{children:[s.jsx(ht,{className:"w-[220px]",children:"Scenario"}),Ae.map((B,oe)=>s.jsxs(ht,{style:{color:xS[oe]},className:"font-mono text-xs",children:[s.jsx("div",{children:B.id}),B.configPath?.trim()?s.jsx("div",{className:"mt-0.5 font-mono text-[10px] font-normal text-muted-foreground",children:B.configPath.trim()}):null,s.jsxs("div",{className:"mt-0.5 text-[10px] font-normal text-muted-foreground",children:["MCP: ",Dbe(B.mcpServerVersions)]})]},B.id))]})}),s.jsx(ts,{children:nn.map(B=>s.jsxs(Gt,{children:[s.jsx(He,{className:"font-medium text-sm",children:Jt.get(B)??B}),Ae.map(oe=>{const de=oe.scenarios.find(Le=>Le.scenarioId===B);return s.jsx(He,{children:de?s.jsx(Ma,{rate:de.passRate}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})},oe.id)})]},B))})]})})]})]}),a==="runs"&&Ae.length>=2&&s.jsxs(nt,{children:[s.jsx(Lt,{className:"pb-3",children:s.jsx(Ft,{className:"text-base",children:"Pass Rate Trend"})}),s.jsx(rt,{className:"h-72",children:s.jsx(vm,{width:"100%",height:"100%",children:s.jsxs(fN,{data:Ae.map((B,oe)=>({idx:oe+1,runId:B.id,passRate:Number((B.overallPassRate*100).toFixed(1))})),children:[s.jsx(yo,{dataKey:"idx",tickFormatter:B=>String(B)}),s.jsx(bo,{unit:"%",domain:[0,100]}),s.jsx(Qr,{formatter:B=>[`${B}%`,"Pass Rate"],labelFormatter:B=>`Run ${B}`}),s.jsx(cl,{}),s.jsx(jl,{type:"monotone",dataKey:"passRate",stroke:xS[0],strokeWidth:2.5,dot:!0})]})})})]}),a==="within-run"&&zt&&Ke.length<2&&s.jsx(nt,{children:s.jsx(rt,{className:"pt-6 text-sm text-muted-foreground",children:"Select at least 2 agents to compare side-by-side within this run."})}),a==="within-run"&&zt&&Ke.length>=2&&s.jsxs(s.Fragment,{children:[s.jsx(nt,{children:s.jsx(rt,{className:"pt-6",children:s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"Need full result details?"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:De?"Open a side-by-side full result view filtered by the selected agents.":"Open the complete run result page for all details and trace navigation."})]}),s.jsx(Z,{asChild:!0,size:"sm",children:De?s.jsx(Tt,{to:De.link,children:"Compare full results"}):s.jsx(Tt,{to:`/results/${encodeURIComponent(zt.id)}${zt.configId?`?configId=${encodeURIComponent(zt.configId)}`:""}`,children:"Open full result"})})]})})}),s.jsxs(nt,{children:[s.jsx(Lt,{className:"pb-3",children:s.jsx(Ft,{className:"text-base",children:"Agent Summary"})}),s.jsx(rt,{className:"max-h-[24rem] overflow-auto p-0",children:s.jsxs(Jr,{children:[s.jsx(es,{className:"[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background",children:s.jsxs(Gt,{children:[s.jsx(ht,{children:"Metric"}),re.map(B=>s.jsxs(ht,{children:[s.jsx("div",{className:"font-medium text-sm",children:B.agentName}),(B.provider||B.model)&&s.jsx("div",{className:"font-mono text-xs font-normal text-muted-foreground",children:[B.provider?ug(B.provider):null,B.model].filter(Boolean).join(" · ")})]},B.agentId))]})}),s.jsxs(ts,{children:[s.jsxs(Gt,{children:[s.jsx(He,{className:"font-medium",children:"Pass Rate"}),re.map(B=>s.jsx(He,{children:s.jsx(Ma,{rate:B.passRate})},B.agentId))]}),s.jsxs(Gt,{children:[s.jsx(He,{className:"font-medium",children:"Total Runs"}),re.map(B=>s.jsx(He,{className:"font-mono",children:B.totalRuns},B.agentId))]}),s.jsxs(Gt,{children:[s.jsx(He,{className:"font-medium",children:"Avg Tool Calls"}),re.map(B=>s.jsx(He,{className:"font-mono",children:B.avgToolCalls.toFixed(1)},B.agentId))]}),s.jsxs(Gt,{children:[s.jsx(He,{className:"font-medium",children:"Avg Latency"}),re.map(B=>s.jsxs(He,{className:"font-mono",children:[Math.round(B.avgLatency),"ms"]},B.agentId))]})]})]})})]}),s.jsxs(nt,{children:[s.jsx(Lt,{className:"pb-3",children:s.jsx(Ft,{className:"text-base",children:"Scenario × Agent Matrix"})}),s.jsx(rt,{className:"max-h-[34rem] overflow-auto p-0",children:s.jsxs(Jr,{className:"table-fixed",children:[s.jsx(es,{className:"[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background",children:s.jsxs(Gt,{children:[s.jsx(ht,{className:"w-[260px]",children:"Scenario"}),Ke.map(B=>{const oe=re.find(de=>de.agentId===B.id);return s.jsxs(ht,{children:[s.jsx("div",{className:"font-medium text-sm",children:B.name}),(oe?.provider||oe?.model)&&s.jsx("div",{className:"font-mono text-xs font-normal text-muted-foreground",children:[oe.provider?ug(oe.provider):null,oe.model].filter(Boolean).join(" · ")})]},B.id)})]})}),s.jsx(ts,{children:ue.map(B=>s.jsxs(Gt,{children:[s.jsx(He,{className:"font-medium text-sm",children:B.displayLabel}),Ke.map(oe=>{const de=B.byAgent[oe.id];return de?s.jsx(He,{className:"min-w-0 align-top",children:s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"text-xs text-muted-foreground",children:[s.jsx(Ma,{rate:de.passRate})," ",s.jsxs("span",{className:"ml-2",children:["runs: ",de.runs.length]})," · calls:"," ",de.avgToolCalls.toFixed(1)," · latency:"," ",Math.round(de.avgDuration),"ms"]}),de.runs.length>0?s.jsx("div",{className:"space-y-1.5",children:de.runs.map(Le=>Ue(Le))}):s.jsx("div",{className:"text-xs text-muted-foreground",children:"No runs captured."})]})},oe.id):s.jsx(He,{children:s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})},oe.id)})]},B.scenarioId))})]})})]})]})]})},aD=(e,t,n)=>{const r=new URLSearchParams;return t&&r.set("configId",t),n&&r.set("agent",n),r.set("embed","1"),`/results/${encodeURIComponent(e)}?${r.toString()}`},iD=(e,t,n)=>{const r=new URLSearchParams;t&&r.set("configId",t),n&&r.set("agent",n);const a=r.toString();return`/results/${encodeURIComponent(e)}${a?`?${a}`:""}`},Vbe=()=>{const{source:e}=On(),[t]=Pi(),n=t.get("left")??"",r=t.get("right")??"",a=t.get("leftConfig"),i=t.get("rightConfig"),o=t.get("leftAgent"),c=t.get("rightAgent"),d=o?`${n} · ${o}`:n,f=c?`${r} · ${c}`:r,[h,p]=m.useState(null),[v,x]=m.useState(null);return m.useEffect(()=>{if(!n||typeof e.getResult!="function"){p(null);return}let j=!0;return e.getResult(n).then(b=>{j&&p(b??null)}),()=>{j=!1}},[n,e]),m.useEffect(()=>{if(!r||typeof e.getResult!="function"){x(null);return}let j=!0;return e.getResult(r).then(b=>{j&&x(b??null)}),()=>{j=!1}},[r,e]),!n||!r?s.jsxs(nt,{children:[s.jsx(Lt,{children:s.jsx(Ft,{className:"text-base",children:"Full Result Compare"})}),s.jsxs(rt,{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(Z,{asChild:!0,variant:"outline",children:s.jsx(Tt,{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:o||c?"Side-by-side Result Detail views for deep inspection, filtered by selected agents.":"Side-by-side Result Detail views for deep inspection."})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(Z,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs(Tt,{to:"/compare",children:[s.jsx(ID,{className:"mr-1.5 h-4 w-4"}),"Back to Compare"]})}),s.jsx(Z,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs("a",{href:iD(n,a,o),target:"_blank",rel:"noreferrer",children:["Open Left",s.jsx(Xh,{className:"ml-1.5 h-3.5 w-3.5"})]})}),s.jsx(Z,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs("a",{href:iD(r,i,c),target:"_blank",rel:"noreferrer",children:["Open Right",s.jsx(Xh,{className:"ml-1.5 h-3.5 w-3.5"})]})})]})]}),s.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[s.jsxs(nt,{className:"overflow-hidden",children:[s.jsx(Lt,{className:"py-3",children:s.jsx(Ft,{className:"text-sm font-mono",children:d})}),s.jsx(rt,{className:"p-0",children:s.jsx("iframe",{title:`Result ${d}`,src:aD(n,a,o),className:"h-[calc(100vh-12rem)] w-full border-0"})})]}),s.jsxs(nt,{className:"overflow-hidden",children:[s.jsx(Lt,{className:"py-3",children:s.jsx(Ft,{className:"text-sm font-mono",children:f})}),s.jsx(rt,{className:"p-0",children:s.jsx("iframe",{title:`Result ${f}`,src:aD(r,i,c),className:"h-[calc(100vh-12rem)] w-full border-0"})})]})]})]})};function Hbe(e){return e.match(/(?:^|\/)(?:result-assistant|results?)\/([0-9]{8}-[0-9]{6})(?:-|\/)/i)?.[1]??null}function Kbe(){const{source:e}=On(),[t,n]=m.useState([]),[r,a]=m.useState(!0),[i,o]=m.useState(null),[c,d]=m.useState(!1),f=100,h=Kv(f),{offset:p,hasMore:v}=h,x=async()=>{a(!0);try{if(e.listMarkdownReportsPage){const S=await e.listMarkdownReportsPage({limit:f,offset:p});n(S.data),h.updateMeta(S)}else n(await e.listMarkdownReports({limit:f,offset:p}))}catch(S){Me({title:"Could not load markdown reports",description:S instanceof Error?S.message:String(S),variant:"destructive"})}finally{a(!1)}};m.useEffect(()=>{x()},[p]);const j=m.useMemo(()=>t[0],[t]),b=m.useMemo(()=>t.find(S=>S.relativePath===i)??null,[t,i]),y=async()=>{if(i){d(!0);try{await e.deleteMarkdownReport(i),n(S=>S.filter(N=>N.relativePath!==i)),Me({title:"Markdown report deleted"}),o(null)}catch(S){Me({title:"Could not delete markdown report",description:S instanceof Error?S.message:String(S),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(Ac,{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(Z,{variant:"outline",onClick:()=>{x()},children:"Refresh"}),j?s.jsx(Z,{asChild:!0,variant:"outline",children:s.jsx(Tt,{to:`/markdown-reports/view?id=${encodeURIComponent(j.reportId)}`,children:"Open latest"})}):null,s.jsx(Z,{variant:"outline",onClick:h.prev,disabled:r||p===0,children:"Prev"}),s.jsx(Z,{variant:"outline",onClick:h.next,disabled:r||!v,children:"Next"})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:h.rangeLabel(t.length)}),s.jsx(nt,{children:s.jsx(rt,{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(Jr,{children:[s.jsx(es,{children:s.jsxs(Gt,{children:[s.jsx(ht,{children:"Report"}),s.jsx(ht,{children:"Result"}),s.jsx(ht,{children:"Folder"}),s.jsx(ht,{children:"Timestamp"}),s.jsx(ht,{className:"w-10"})]})}),s.jsx(ts,{children:t.map(S=>s.jsxs(Gt,{children:[s.jsx(He,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(Tt,{to:`/markdown-reports/view?id=${encodeURIComponent(S.reportId)}`,className:"font-mono text-xs text-primary hover:underline",children:S.name}),s.jsx("div",{className:"font-mono text-[11px] text-muted-foreground",children:S.relativePath})]})}),s.jsx(He,{className:"text-xs text-muted-foreground font-mono",children:(()=>{const N=Hbe(S.relativePath);return N?s.jsx(Tt,{to:`/results/${encodeURIComponent(N)}`,className:"text-primary hover:underline",children:N}):s.jsx("span",{className:"text-muted-foreground",children:"—"})})()}),s.jsx(He,{className:"text-xs text-muted-foreground font-mono",children:S.relativePath.includes("/")?S.relativePath.slice(0,S.relativePath.lastIndexOf("/")):"."}),s.jsx(He,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(xa,{className:"h-3 w-3"}),new Date(S.mtime).toLocaleString()]})}),s.jsx(He,{children:s.jsxs(lp,{children:[s.jsx(cp,{asChild:!0,children:s.jsx(Z,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(bg,{className:"h-4 w-4"})})}),s.jsxs($u,{align:"end",children:[s.jsx(Mr,{asChild:!0,children:s.jsx(Tt,{to:`/markdown-reports/view?id=${encodeURIComponent(S.reportId)}`,children:"View"})}),s.jsxs(Mr,{className:"text-destructive",onSelect:N=>{N.preventDefault(),o(S.relativePath)},children:[s.jsx(Bs,{className:"mr-2 h-3.5 w-3.5"})," Delete"]})]})]})})]},S.path))})]})})}),s.jsx(ja,{open:!!i,onOpenChange:S=>!S&&o(null),children:s.jsxs(Us,{children:[s.jsxs(Ws,{children:[s.jsx(Hs,{children:"Delete markdown report?"}),s.jsx(Ks,{children:b?`Delete '${b.name}' from disk? This cannot be undone.`:"Delete this report from disk? This cannot be undone."})]}),s.jsxs(Vs,{children:[s.jsx(Ys,{disabled:c,children:"Cancel"}),s.jsx(Gs,{onClick:S=>{S.preventDefault(),y()},disabled:c,children:c?"Deleting...":"Delete"})]})]})})]})}function Gbe(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Ybe(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 Xbe(){const{source:e}=On(),[t]=Pi(),n=(t.get("id")??"").trim(),r=(t.get("path")??"").trim(),[a,i]=m.useState(null),[o,c]=m.useState(!0),[d,f]=m.useState(!1),[h,p]=m.useState(!1);if(m.useEffect(()=>{let x=!0;if(i(null),f(!1),!n&&!r){c(!1);return}return c(!0),(n&&e.getMarkdownReportById?e.getMarkdownReportById(n):e.getMarkdownReport(r)).then(b=>{x&&i(b)}).catch(b=>{if(!x)return;const y=b instanceof Error?b.message:String(b);if(y.includes("(404)")){f(!0);return}Me({title:"Could not load markdown report",description:y,variant:"destructive"})}).finally(()=>{x&&c(!1)}),()=>{x=!1}},[r,n,e]),!n&&!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:"Missing report identifier."}),s.jsx(Z,{asChild:!0,variant:"outline",children:s.jsx(Tt,{to:"/markdown-reports",children:"Back to Markdown Reports"})})]});if(o)return s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading markdown report..."});if(d||!a)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(Z,{asChild:!0,variant:"outline",children:s.jsx(Tt,{to:"/markdown-reports",children:"Back to Markdown Reports"})})]});const v=Ybe(a);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:a.name}),s.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[s.jsx("span",{className:"font-mono",children:a.relativePath}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsxs("span",{className:"inline-flex items-center gap-1 align-middle",children:[s.jsx(xa,{className:"h-3 w-3 shrink-0"}),new Date(a.mtime).toLocaleString()]}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:Gbe(a.sizeBytes)})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[v?s.jsxs(s.Fragment,{children:[s.jsx(Z,{variant:"outline",size:"sm",onClick:()=>p(!0),children:"Open Result Panel"}),s.jsx(Z,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(Tt,{to:`/results/${encodeURIComponent(v)}`,children:"Open Result"})})]}):null,s.jsx(Z,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(Tt,{to:"/markdown-reports",children:"Back to reports"})})]})]}),s.jsx(nt,{children:s.jsx(rt,{className:"pt-6",children:s.jsx(Fs,{text:a.content,variant:"assistant"})})}),v?s.jsx(A3,{open:h,onOpenChange:p,children:s.jsxs(uC,{side:"right",className:"w-[96vw] max-w-none p-0 sm:max-w-5xl",children:[s.jsx(E3,{className:"border-b px-4 py-3 pr-12",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs(P3,{className:"text-base",children:["Result ",v]}),s.jsx(Z,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(Tt,{to:`/results/${encodeURIComponent(v)}`,target:"_blank",rel:"noreferrer",children:"Open full page"})})]})}),s.jsx("div",{className:"h-[calc(100vh-64px)]",children:s.jsx("iframe",{title:`Result ${v}`,src:`/results/${encodeURIComponent(v)}?embed=1`,className:"h-full w-full border-0"})})]})}):null]})}const Qbe=()=>{const e=Sa();return m.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"})]})})},Zbe=new vK;function Jbe(){const{scenarioId:e}=Ml();return s.jsx(Y5,{to:e?`/libraries/test-cases/${encodeURIComponent(e)}`:"/libraries/test-cases",replace:!0})}const e0e=()=>s.jsx(yK,{client:Zbe,children:s.jsx(ji,{children:s.jsx(LX,{children:s.jsx(KX,{children:s.jsxs(HX,{children:[s.jsx(wW,{}),s.jsx(JW,{}),s.jsx(bG,{future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:s.jsxs(dG,{children:[s.jsxs(yn,{element:s.jsx(VX,{}),children:[s.jsx(yn,{path:"/",element:s.jsx(Che,{})}),s.jsx(yn,{path:"/mcp-evaluations",element:s.jsx(Vge,{})}),s.jsx(yn,{path:"/mcp-evaluations/:id",element:s.jsx(T$,{})}),s.jsx(yn,{path:"/mcp-evaluations/:id/:tab",element:s.jsx(T$,{})}),s.jsx(yn,{path:"/tool-analysis",element:s.jsx(nbe,{})}),s.jsx(yn,{path:"/tool-analysis-results",element:s.jsx(rbe,{})}),s.jsx(yn,{path:"/tool-analysis-results/:id",element:s.jsx(sbe,{})}),s.jsx(yn,{path:"/oauth-debugger",element:s.jsx(ube,{})}),s.jsx(yn,{path:"/libraries/servers",element:s.jsx(xxe,{})}),s.jsx(yn,{path:"/libraries/servers/:serverId",element:s.jsx(yxe,{})}),s.jsx(yn,{path:"/libraries/agents",element:s.jsx(bxe,{})}),s.jsx(yn,{path:"/libraries/agents/:agentName",element:s.jsx(Eye,{})}),s.jsx(yn,{path:"/libraries/test-cases",element:s.jsx(B$,{})}),s.jsx(yn,{path:"/libraries/test-cases/:testCaseId",element:s.jsx(B$,{})}),s.jsx(yn,{path:"/libraries/scenarios",element:s.jsx(Y5,{to:"/libraries/test-cases",replace:!0})}),s.jsx(yn,{path:"/libraries/scenarios/:scenarioId",element:s.jsx(Jbe,{})}),s.jsx(yn,{path:"/settings",element:s.jsx(Pye,{})}),s.jsx(yn,{path:"/settings/mcp",element:s.jsx(Dye,{})}),s.jsx(yn,{path:"/run",element:s.jsx(wbe,{})}),s.jsx(yn,{path:"/results",element:s.jsx(Abe,{})}),s.jsx(yn,{path:"/results/:id",element:s.jsx(Tbe,{})}),s.jsx(yn,{path:"/markdown-reports",element:s.jsx(Kbe,{})}),s.jsx(yn,{path:"/markdown-reports/view",element:s.jsx(Xbe,{})}),s.jsx(yn,{path:"/compare",element:s.jsx(Wbe,{})}),s.jsx(yn,{path:"/compare/results",element:s.jsx(Vbe,{})})]}),s.jsx(yn,{path:"*",element:s.jsx(Qbe,{})})]})})]})})})})});y7.createRoot(document.getElementById("root")).render(s.jsx(e0e,{}));
|