@inspectr/mcplab 1.24.1 → 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.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-6zaiXZWP.js +0 -256
- package/dist/app/assets/index-DBjVHflA.css +0 -1
|
@@ -1,256 +0,0 @@
|
|
|
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 Cy={exports:{}},vd={},_y={exports:{}},rn={};var lE;function f7(){if(lE)return rn;lE=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,re={},he=null,oe=null;if(z!=null)for(J in z.ref!==void 0&&(oe=z.ref),z.key!==void 0&&(he=""+z.key),z)k.call(z,J)&&!P.hasOwnProperty(J)&&(re[J]=z[J]);var me=arguments.length-2;if(me===1)re.children=K;else if(1<me){for(var ie=Array(me),ge=0;ge<me;ge++)ie[ge]=arguments[ge+2];re.children=ie}if(q&&q.defaultProps)for(J in me=q.defaultProps,me)re[J]===void 0&&(re[J]=me[J]);return{$$typeof:e,type:q,key:he,ref:oe,props:re,_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,re){var he=typeof q;(he==="undefined"||he==="boolean")&&(q=null);var oe=!1;if(q===null)oe=!0;else switch(he){case"string":case"number":oe=!0;break;case"object":switch(q.$$typeof){case e:case t:oe=!0}}if(oe)return oe=q,re=re(oe),q=J===""?"."+G(oe,0):J,A(re)?(K="",q!=null&&(K=q.replace(F,"$&/")+"/"),H(re,z,K,"",function(ge){return ge})):re!=null&&(D(re)&&(re=M(re,K+(!re.key||oe&&oe.key===re.key?"":(""+re.key).replace(F,"$&/")+"/")+q)),z.push(re)),1;if(oe=0,J=J===""?".":J+":",A(q))for(var me=0;me<q.length;me++){he=q[me];var ie=J+G(he,me);oe+=H(he,z,K,ie,re)}else if(ie=v(q),typeof ie=="function")for(q=ie.call(q),me=0;!(he=q.next()).done;)he=he.value,ie=J+G(he,me++),oe+=H(he,z,K,ie,re);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 oe}function L(q,z,K){if(q==null)return q;var J=[],re=0;return H(q,J,"","",function(he){return z.call(K,he,re++)}),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 Z(){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=Z,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),re=q.key,he=q.ref,oe=q._owner;if(z!=null){if(z.ref!==void 0&&(he=z.ref,oe=E.current),z.key!==void 0&&(re=""+z.key),q.type&&q.type.defaultProps)var me=q.type.defaultProps;for(ie in z)k.call(z,ie)&&!P.hasOwnProperty(ie)&&(J[ie]=z[ie]===void 0&&me!==void 0?me[ie]:z[ie])}var ie=arguments.length-2;if(ie===1)J.children=K;else if(1<ie){me=Array(ie);for(var ge=0;ge<ie;ge++)me[ge]=arguments[ge+2];J.children=me}return{$$typeof:e,type:q.type,key:re,ref:he,props:J,_owner:oe}},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=Z,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 cE;function IN(){return cE||(cE=1,_y.exports=f7()),_y.exports}var uE;function p7(){if(uE)return vd;uE=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 dE;function h7(){return dE||(dE=1,Cy.exports=p7()),Cy.exports}var s=h7(),mh={},Ay={exports:{}},Gr={},ky={exports:{}},Ey={};var fE;function m7(){return fE||(fE=1,(function(e){function t(W,O){var Z=W.length;W.push(O);e:for(;0<Z;){var q=Z-1>>>1,z=W[q];if(0<a(z,O))W[q]=O,W[Z]=z,Z=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],Z=W.pop();if(Z!==O){W[0]=Z;e:for(var q=0,z=W.length,K=z>>>1;q<K;){var J=2*(q+1)-1,re=W[J],he=J+1,oe=W[he];if(0>a(re,Z))he<z&&0>a(oe,re)?(W[q]=oe,W[he]=Z,q=he):(W[q]=re,W[J]=Z,q=J);else if(he<z&&0>a(oe,Z))W[q]=oe,W[he]=Z,q=he;else break e}}return O}function a(W,O){var Z=W.sortIndex-O.sortIndex;return Z!==0?Z: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 Z=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=Z,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 Z=v;v=O;try{return W()}finally{v=Z}},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 Z=v;v=W;try{return O()}finally{v=Z}},e.unstable_scheduleCallback=function(W,O,Z){var q=e.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?q+Z:q):Z=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=Z+z,W={id:h++,callback:O,priorityLevel:W,startTime:Z,expirationTime:z,sortIndex:-1},Z>q?(W.sortIndex=Z,t(f,W),n(d)===null&&W===n(f)&&(b?(S(R),R=-1):b=!0,Y(A,Z-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 Z=v;v=O;try{return W.apply(this,arguments)}finally{v=Z}}}})(Ey)),Ey}var pE;function g7(){return pE||(pE=1,ky.exports=m7()),ky.exports}var hE;function v7(){if(hE)return Gr;hE=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 Z=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(be){var w=be}Reflect.construct(l,[],u)}else{try{u.call()}catch(be){w=be}l.call(u.prototype)}else{try{throw Error()}catch(be){w=be}l()}}catch(be){if(be&&w&&typeof be.stack=="string"){for(var C=be.stack.split(`
|
|
3
|
-
`),T=w.stack.split(`
|
|
4
|
-
`),$=C.length-1,te=T.length-1;1<=$&&0<=te&&C[$]!==T[te];)te--;for(;1<=$&&0<=te;$--,te--)if(C[$]!==T[te]){if($!==1||te!==1)do if($--,te--,0>te||C[$]!==T[te]){var ue=`
|
|
5
|
-
`+C[$].replace(" at new "," at ");return l.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",l.displayName)),ue}while(1<=$&&0<=te);break}}}finally{K=!1,Error.prepareStackTrace=g}return(l=l?l.displayName||l.name:"")?z(l):""}function re(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 oe(l){var u=l.type;switch(l.tag){case 24:return"Cache";case 9:return(u.displayName||"Context")+".Consumer";case 10:return(u._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=u.render,l=l.displayName||l.name||"",u.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return u;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return 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 ie(l){var u=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function ge(l){var u=ie(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 Re(l){l._valueTracker||(l._valueTracker=ge(l))}function Q(l){if(!l)return!1;var u=l._valueTracker;if(!u)return!0;var g=u.getValue(),w="";return l&&(w=ie(l)?l.checked?"true":"false":l.value),l=w,l!==g?(u.setValue(l),!0):!1}function Ne(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 Fe(l,u){var g=u.checked;return Z({},u,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:g??l._wrapperState.initialChecked})}function pt(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 ot(l,u){u=u.checked,u!=null&&_(l,"checked",u,!1)}function bt(l,u){ot(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")?et(l,u.type,g):u.hasOwnProperty("defaultValue")&&et(l,u.type,me(u.defaultValue)),u.checked==null&&u.defaultChecked!=null&&(l.defaultChecked=!!u.defaultChecked)}function wt(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 et(l,u,g){(u!=="number"||Ne(l.ownerDocument)!==l)&&(g==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+g&&(l.defaultValue=""+g))}var _e=Array.isArray;function Ee(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 tt(l,u){if(u.dangerouslySetInnerHTML!=null)throw Error(n(91));return Z({},u,{value:void 0,defaultValue:void 0,children:""+l._wrapperState.initialValue})}function ct(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(_e(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 Se(l,u){if(u){var g=l.firstChild;if(g&&g===l.lastChild&&g.nodeType===3){g.nodeValue=u;return}}l.textContent=u}var Xe={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},Qe=["Webkit","ms","Moz","O"];Object.keys(Xe).forEach(function(l){Qe.forEach(function(u){u=u+l.charAt(0).toUpperCase()+l.substring(1),Xe[u]=Xe[l]})});function At(l,u,g){return u==null||typeof u=="boolean"||u===""?"":g||typeof u!="number"||u===0||Xe.hasOwnProperty(l)&&Xe[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=At(g,u[g],w);g==="float"&&(g="cssFloat"),w?l.setProperty(g,C):l[g]=C}}var de=Z({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(de[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 $e(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 se=null;function we(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var Ue=null,B=null,le=null;function fe(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 De(l){B?le?le.push(l):le=[l]:B=l}function Me(){if(B){var l=B,u=le;if(le=B=null,fe(l),u)for(l=0;l<u.length;l++)fe(u[l])}}function Ge(l,u){return l(u)}function Oe(){}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||le!==null)&&(Oe(),Me())}}function Ae(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 Je=!1;if(c)try{var ne={};Object.defineProperty(ne,"passive",{get:function(){Je=!0}}),window.addEventListener("test",ne,ne),window.removeEventListener("test",ne,ne)}catch{Je=!1}function Le(l,u,g,w,C,T,$,te,ue){var be=Array.prototype.slice.call(arguments,3);try{u.apply(g,be)}catch(Be){this.onError(Be)}}var ht=!1,Qt=null,Ce=!1,en=null,_t={onError:function(l){ht=!0,Qt=l}};function Kt(l,u,g,w,C,T,$,te,ue){ht=!1,Qt=null,Le.apply(_t,arguments)}function Hn(l,u,g,w,C,T,$,te,ue){if(Kt.apply(this,arguments),ht){if(ht){var be=Qt;ht=!1,Qt=null}else throw Error(n(198));Ce||(Ce=!0,en=be)}}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 Ya(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 Xa(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 Xa(C),l;if(T===w)return Xa(C),u;T=T.sibling}throw Error(n(188))}if(g.return!==w.return)g=C,w=T;else{for(var $=!1,te=C.child;te;){if(te===g){$=!0,g=C,w=T;break}if(te===w){$=!0,w=C,g=T;break}te=te.sibling}if(!$){for(te=T.child;te;){if(te===g){$=!0,g=T,w=C;break}if(te===w){$=!0,w=T,g=C;break}te=te.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,_a=t.unstable_requestPaint,ce=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 ke=64,St=4194304;function Ze(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 te=$&~C;te!==0?w=Ze(te):(T&=$,T!==0&&(w=Ze(T)))}else $=g&~C,$!==0?w=Ze($):T!==0&&(w=Ze(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),te=1<<$,ue=C[$];ue===-1?((te&g)===0||(te&w)!==0)&&(C[$]=on(te,u)):ue<=u&&(l.expiredLanes|=te),T&=~te}}function cr(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function qr(){var l=ke;return ke<<=1,(ke&4194240)===0&&(ke=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 Gv(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 z_(l){return l&=-l,1<l?4<l?(l&268435455)!==0?16:536870912:4:1}var B_,Yv,q_,U_,W_,Xv=!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 V_(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&&Yv(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 H_(l){var u=Mo(l.target);if(u!==null){var g=_n(u);if(g!==null){if(u=g.tag,u===13){if(u=Ya(g),u!==null){l.blockedOn=u,W_(l.priority,function(){q_(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=Zv(l.domEventName,l.eventSystemFlags,u[0],l.nativeEvent);if(g===null){g=l.nativeEvent;var w=new g.constructor(g.type,g);se=w,g.target.dispatchEvent(w),se=null}else return u=nd(g),u!==null&&Yv(u),l.blockedOn=g,!1;u.shift()}return!0}function K_(l,u,g){mp(l)&&g.delete(u)}function Iq(){Xv=!1,Li!==null&&mp(Li)&&(Li=null),Fi!==null&&mp(Fi)&&(Fi=null),zi!==null&&mp(zi)&&(zi=null),zu.forEach(K_),Bu.forEach(K_)}function Uu(l,u){l.blockedOn===u&&(l.blockedOn=null,Xv||(Xv=!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);)H_(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,Qv(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,Qv(l,u,g,w)}finally{fn=C,Vl.transition=T}}function Qv(l,u,g,w){if(gp){var C=Zv(l,u,g,w);if(C===null)mx(l,u,w,vp,g),V_(l,w);else if(Mq(C,l,u,g,w))w.stopPropagation();else if(V_(l,w),u&4&&-1<Oq.indexOf(l)){for(;C!==null;){var T=nd(C);if(T!==null&&B_(T),T=Zv(l,u,g,w),T===null&&mx(l,u,w,vp,g),T===C)break;C=T}C!==null&&w.stopPropagation()}else mx(l,u,w,null,g)}}var vp=null;function Zv(l,u,g,w){if(vp=null,l=we(w),l=Mo(l),l!==null)if(u=_n(l),u===null)l=null;else if(g=u.tag,g===13){if(l=Ya(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 G_(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,Jv=null,xp=null;function Y_(){if(xp)return xp;var l,u=Jv,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 X_(){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 te in l)l.hasOwnProperty(te)&&(g=l[te],this[te]=g?g(T):T[te]);return this.isDefaultPrevented=(T.defaultPrevented!=null?T.defaultPrevented:T.returnValue===!1)?bp:X_,this.isPropagationStopped=X_,this}return Z(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},ex=ls(Hl),Vu=Z({},Hl,{view:0,detail:0}),Lq=ls(Vu),tx,nx,Hu,wp=Z({},Vu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:sx,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"?(tx=l.screenX-Hu.screenX,nx=l.screenY-Hu.screenY):nx=tx=0,Hu=l),tx)},movementY:function(l){return"movementY"in l?l.movementY:nx}}),Q_=ls(wp),Fq=Z({},wp,{dataTransfer:0}),zq=ls(Fq),Bq=Z({},Vu,{relatedTarget:0}),rx=ls(Bq),qq=Z({},Hl,{animationName:0,elapsedTime:0,pseudoElement:0}),Uq=ls(qq),Wq=Z({},Hl,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),Vq=ls(Wq),Hq=Z({},Hl,{data:0}),Z_=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 sx(){return Xq}var Qq=Z({},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:sx,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=Z({},wp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),J_=ls(Jq),eU=Z({},Vu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:sx}),tU=ls(eU),nU=Z({},Hl,{propertyName:0,elapsedTime:0,pseudoElement:0}),rU=ls(nU),sU=Z({},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],ax=c&&"CompositionEvent"in window,Ku=null;c&&"documentMode"in document&&(Ku=document.documentMode);var oU=c&&"TextEvent"in window&&!Ku,eA=c&&(!ax||Ku&&8<Ku&&11>=Ku),tA=" ",nA=!1;function rA(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 sA(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 sA(u);case"keypress":return u.which!==32?null:(nA=!0,tA);case"textInput":return l=u.data,l===tA&&nA?null:l;default:return null}}function cU(l,u){if(Kl)return l==="compositionend"||!ax&&rA(l,u)?(l=Y_(),xp=Jv=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 eA&&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 aA(l){var u=l&&l.nodeName&&l.nodeName.toLowerCase();return u==="input"?!!uU[l.type]:u==="textarea"}function iA(l,u,g,w){De(w),u=_p(u,"onChange"),0<u.length&&(g=new ex("onChange","change",null,g,w),l.push({event:g,listeners:u}))}var Gu=null,Yu=null;function dU(l){NA(l,0)}function jp(l){var u=Zl(l);if(Q(u))return l}function fU(l,u){if(l==="change")return u}var oA=!1;if(c){var ix;if(c){var ox="oninput"in document;if(!ox){var lA=document.createElement("div");lA.setAttribute("oninput","return;"),ox=typeof lA.oninput=="function"}ix=ox}else ix=!1;oA=ix&&(!document.documentMode||9<document.documentMode)}function cA(){Gu&&(Gu.detachEvent("onpropertychange",uA),Yu=Gu=null)}function uA(l){if(l.propertyName==="value"&&jp(Yu)){var u=[];iA(u,Yu,l,we(l)),ve(dU,u)}}function pU(l,u,g){l==="focusin"?(cA(),Gu=u,Yu=g,Gu.attachEvent("onpropertychange",uA)):l==="focusout"&&cA()}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 dA(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function fA(l,u){var g=dA(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=dA(g)}}function pA(l,u){return l&&u?l===u?!0:l&&l.nodeType===3?!1:u&&u.nodeType===3?pA(l,u.parentNode):"contains"in l?l.contains(u):l.compareDocumentPosition?!!(l.compareDocumentPosition(u)&16):!1:!1}function hA(){for(var l=window,u=Ne();u instanceof l.HTMLIFrameElement;){try{var g=typeof u.contentWindow.location.href=="string"}catch{g=!1}if(g)l=u.contentWindow;else break;u=Ne(l.document)}return u}function lx(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=hA(),g=l.focusedElem,w=l.selectionRange;if(u!==g&&g&&g.ownerDocument&&pA(g.ownerDocument.documentElement,g)){if(w!==null&&lx(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=fA(g,T);var $=fA(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,cx=null,Qu=null,ux=!1;function mA(l,u,g){var w=g.window===g?g.document:g.nodeType===9?g:g.ownerDocument;ux||Gl==null||Gl!==Ne(w)||(w=Gl,"selectionStart"in w&&lx(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(cx,"onSelect"),0<w.length&&(u=new ex("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")},dx={},gA={};c&&(gA=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(dx[l])return dx[l];if(!Yl[l])return l;var u=Yl[l],g;for(g in u)if(u.hasOwnProperty(g)&&g in gA)return dx[l]=u[g];return l}var vA=Np("animationend"),xA=Np("animationiteration"),yA=Np("animationstart"),bA=Np("transitionend"),wA=new Map,jA="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){wA.set(l,u),i(u,[l])}for(var fx=0;fx<jA.length;fx++){var px=jA[fx],bU=px.toLowerCase(),wU=px[0].toUpperCase()+px.slice(1);Ui(bU,"on"+wU)}Ui(vA,"onAnimationEnd"),Ui(xA,"onAnimationIteration"),Ui(yA,"onAnimationStart"),Ui("dblclick","onDoubleClick"),Ui("focusin","onFocus"),Ui("focusout","onBlur"),Ui(bA,"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 SA(l,u,g){var w=l.type||"unknown-event";l.currentTarget=g,Hn(w,u,void 0,l),l.currentTarget=null}function NA(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 te=w[$],ue=te.instance,be=te.currentTarget;if(te=te.listener,ue!==T&&C.isPropagationStopped())break e;SA(C,te,be),T=ue}else for($=0;$<w.length;$++){if(te=w[$],ue=te.instance,be=te.currentTarget,te=te.listener,ue!==T&&C.isPropagationStopped())break e;SA(C,te,be),T=ue}}}if(Ce)throw l=en,Ce=!1,en=null,l}function An(l,u){var g=u[wx];g===void 0&&(g=u[wx]=new Set);var w=l+"__bubble";g.has(w)||(CA(u,l,2,!1),g.add(w))}function hx(l,u,g){var w=0;u&&(w|=4),CA(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)||hx(g,!1,l),hx(g,!0,l))});var u=l.nodeType===9?l:l.ownerDocument;u===null||u[Cp]||(u[Cp]=!0,hx("selectionchange",!1,u))}}function CA(l,u,g,w){switch(G_(u)){case 1:var C=$q;break;case 4:C=Dq;break;default:C=Qv}g=C.bind(null,u,g,l),C=void 0,!Je||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 mx(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 te=w.stateNode.containerInfo;if(te===C||te.nodeType===8&&te.parentNode===C)break;if($===4)for($=w.return;$!==null;){var ue=$.tag;if((ue===3||ue===4)&&(ue=$.stateNode.containerInfo,ue===C||ue.nodeType===8&&ue.parentNode===C))return;$=$.return}for(;te!==null;){if($=Mo(te),$===null)return;if(ue=$.tag,ue===5||ue===6){w=T=$;continue e}te=te.parentNode}}w=w.return}ve(function(){var be=T,Be=we(g),We=[];e:{var ze=wA.get(l);if(ze!==void 0){var dt=ex,yt=l;switch(l){case"keypress":if(yp(g)===0)break e;case"keydown":case"keyup":dt=Zq;break;case"focusin":yt="focus",dt=rx;break;case"focusout":yt="blur",dt=rx;break;case"beforeblur":case"afterblur":dt=rx;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":dt=Q_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":dt=zq;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":dt=tU;break;case vA:case xA:case yA:dt=Uq;break;case bA:dt=rU;break;case"scroll":dt=Lq;break;case"wheel":dt=aU;break;case"copy":case"cut":case"paste":dt=Vq;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":dt=J_}var jt=(u&4)!==0,Kn=!jt&&l==="scroll",xe=jt?ze!==null?ze+"Capture":null:ze;jt=[];for(var pe=be,ye;pe!==null;){ye=pe;var Ye=ye.stateNode;if(ye.tag===5&&Ye!==null&&(ye=Ye,xe!==null&&(Ye=Ae(pe,xe),Ye!=null&&jt.push(ed(pe,Ye,ye)))),Kn)break;pe=pe.return}0<jt.length&&(ze=new dt(ze,yt,null,g,Be),We.push({event:ze,listeners:jt}))}}if((u&7)===0){e:{if(ze=l==="mouseover"||l==="pointerover",dt=l==="mouseout"||l==="pointerout",ze&&g!==se&&(yt=g.relatedTarget||g.fromElement)&&(Mo(yt)||yt[Qa]))break e;if((dt||ze)&&(ze=Be.window===Be?Be:(ze=Be.ownerDocument)?ze.defaultView||ze.parentWindow:window,dt?(yt=g.relatedTarget||g.toElement,dt=be,yt=yt?Mo(yt):null,yt!==null&&(Kn=_n(yt),yt!==Kn||yt.tag!==5&&yt.tag!==6)&&(yt=null)):(dt=null,yt=be),dt!==yt)){if(jt=Q_,Ye="onMouseLeave",xe="onMouseEnter",pe="mouse",(l==="pointerout"||l==="pointerover")&&(jt=J_,Ye="onPointerLeave",xe="onPointerEnter",pe="pointer"),Kn=dt==null?ze:Zl(dt),ye=yt==null?ze:Zl(yt),ze=new jt(Ye,pe+"leave",dt,g,Be),ze.target=Kn,ze.relatedTarget=ye,Ye=null,Mo(Be)===be&&(jt=new jt(xe,pe+"enter",yt,g,Be),jt.target=ye,jt.relatedTarget=Kn,Ye=jt),Kn=Ye,dt&&yt)t:{for(jt=dt,xe=yt,pe=0,ye=jt;ye;ye=Xl(ye))pe++;for(ye=0,Ye=xe;Ye;Ye=Xl(Ye))ye++;for(;0<pe-ye;)jt=Xl(jt),pe--;for(;0<ye-pe;)xe=Xl(xe),ye--;for(;pe--;){if(jt===xe||xe!==null&&jt===xe.alternate)break t;jt=Xl(jt),xe=Xl(xe)}jt=null}else jt=null;dt!==null&&_A(We,ze,dt,jt,!1),yt!==null&&Kn!==null&&_A(We,Kn,yt,jt,!0)}}e:{if(ze=be?Zl(be):window,dt=ze.nodeName&&ze.nodeName.toLowerCase(),dt==="select"||dt==="input"&&ze.type==="file")var Nt=fU;else if(aA(ze))if(oA)Nt=gU;else{Nt=hU;var Rt=pU}else(dt=ze.nodeName)&&dt.toLowerCase()==="input"&&(ze.type==="checkbox"||ze.type==="radio")&&(Nt=mU);if(Nt&&(Nt=Nt(l,be))){iA(We,Nt,g,Be);break e}Rt&&Rt(l,ze,be),l==="focusout"&&(Rt=ze._wrapperState)&&Rt.controlled&&ze.type==="number"&&et(ze,"number",ze.value)}switch(Rt=be?Zl(be):window,l){case"focusin":(aA(Rt)||Rt.contentEditable==="true")&&(Gl=Rt,cx=be,Qu=null);break;case"focusout":Qu=cx=Gl=null;break;case"mousedown":ux=!0;break;case"contextmenu":case"mouseup":case"dragend":ux=!1,mA(We,g,Be);break;case"selectionchange":if(yU)break;case"keydown":case"keyup":mA(We,g,Be)}var Ot;if(ax)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?rA(l,g)&&(Ut="onCompositionEnd"):l==="keydown"&&g.keyCode===229&&(Ut="onCompositionStart");Ut&&(eA&&g.locale!=="ko"&&(Kl||Ut!=="onCompositionStart"?Ut==="onCompositionEnd"&&Kl&&(Ot=Y_()):(qi=Be,Jv="value"in qi?qi.value:qi.textContent,Kl=!0)),Rt=_p(be,Ut),0<Rt.length&&(Ut=new Z_(Ut,l,null,g,Be),We.push({event:Ut,listeners:Rt}),Ot?Ut.data=Ot:(Ot=sA(g),Ot!==null&&(Ut.data=Ot)))),(Ot=oU?lU(l,g):cU(l,g))&&(be=_p(be,"onBeforeInput"),0<be.length&&(Be=new Z_("onBeforeInput","beforeinput",null,g,Be),We.push({event:Be,listeners:be}),Be.data=Ot))}NA(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=Ae(l,g),T!=null&&w.unshift(ed(l,T,C)),T=Ae(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 _A(l,u,g,w,C){for(var T=u._reactName,$=[];g!==null&&g!==w;){var te=g,ue=te.alternate,be=te.stateNode;if(ue!==null&&ue===w)break;te.tag===5&&be!==null&&(te=be,C?(ue=Ae(g,T),ue!=null&&$.unshift(ed(g,ue,te))):C||(ue=Ae(g,T),ue!=null&&$.push(ed(g,ue,te)))),g=g.return}$.length!==0&&l.push({event:u,listeners:$})}var SU=/\r\n?/g,NU=/\u0000|\uFFFD/g;function AA(l){return(typeof l=="string"?l:""+l).replace(SU,`
|
|
6
|
-
`).replace(NU,"")}function Ap(l,u,g){if(u=AA(u),AA(l)!==u&&g)throw Error(n(425))}function kp(){}var gx=null,vx=null;function xx(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 yx=typeof setTimeout=="function"?setTimeout:void 0,CU=typeof clearTimeout=="function"?clearTimeout:void 0,kA=typeof Promise=="function"?Promise:void 0,_U=typeof queueMicrotask=="function"?queueMicrotask:typeof kA<"u"?function(l){return kA.resolve(null).then(l).catch(AU)}:yx;function AU(l){setTimeout(function(){throw l})}function bx(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 EA(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),Aa="__reactFiber$"+Ql,td="__reactProps$"+Ql,Qa="__reactContainer$"+Ql,wx="__reactEvents$"+Ql,kU="__reactListeners$"+Ql,EU="__reactHandles$"+Ql;function Mo(l){var u=l[Aa];if(u)return u;for(var g=l.parentNode;g;){if(u=g[Qa]||g[Aa]){if(g=u.alternate,u.child!==null||g!==null&&g.child!==null)for(l=EA(l);l!==null;){if(g=l[Aa])return g;l=EA(l)}return u}l=g,g=l.parentNode}return null}function nd(l){return l=l[Aa]||l[Qa],!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 jx=[],Jl=-1;function Vi(l){return{current:l}}function kn(l){0>Jl||(l.current=jx[Jl],jx[Jl]=null,Jl--)}function jn(l,u){Jl++,jx[Jl]=l.current,l.current=u}var Hi={},Sr=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(Sr)}function PA(l,u,g){if(Sr.current!==Hi)throw Error(n(168));jn(Sr,u),jn(Ur,g)}function TA(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,oe(l)||"Unknown",C));return Z({},g,w)}function Tp(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||Hi,Io=Sr.current,jn(Sr,l),jn(Ur,Ur.current),!0}function RA(l,u,g){var w=l.stateNode;if(!w)throw Error(n(169));g?(l=TA(l,u,Io),w.__reactInternalMemoizedMergedChildContext=l,kn(Ur),kn(Sr),jn(Sr,l)):kn(Ur),jn(Ur,g)}var Za=null,Rp=!1,Sx=!1;function OA(l){Za===null?Za=[l]:Za.push(l)}function PU(l){Rp=!0,OA(l)}function Ki(){if(!Sx&&Za!==null){Sx=!0;var l=0,u=fn;try{var g=Za;for(fn=1;l<g.length;l++){var w=g[l];do w=w(!0);while(w!==null)}Za=null,Rp=!1}catch(C){throw Za!==null&&(Za=Za.slice(l+1)),Ul(Wt,Ki),C}finally{fn=u,Sx=!1}}return null}var tc=[],nc=0,Op=null,Mp=0,Ns=[],Cs=0,$o=null,Ja=1,ei="";function Do(l,u){tc[nc++]=Mp,tc[nc++]=Op,Op=l,Mp=u}function MA(l,u,g){Ns[Cs++]=Ja,Ns[Cs++]=ei,Ns[Cs++]=$o,$o=l;var w=Ja;l=ei;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-=$,Ja=1<<32-vr(u)+C|g<<C|w,ei=T+l}else Ja=1<<T|g<<C|w,ei=l}function Nx(l){l.return!==null&&(Do(l,1),MA(l,1,0))}function Cx(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,ei=Ns[--Cs],Ns[Cs]=null,Ja=Ns[--Cs],Ns[Cs]=null}var cs=null,us=null,Mn=!1,ea=null;function IA(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 $A(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:Ja,overflow:ei}: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 _x(l){return(l.mode&1)!==0&&(l.flags&128)===0}function Ax(l){if(Mn){var u=us;if(u){var g=u;if(!$A(l,u)){if(_x(l))throw Error(n(418));u=Wi(g.nextSibling);var w=cs;u&&$A(l,u)?IA(w,g):(l.flags=l.flags&-4097|2,Mn=!1,cs=l)}}else{if(_x(l))throw Error(n(418));l.flags=l.flags&-4097|2,Mn=!1,cs=l}}}function DA(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 DA(l),Mn=!0,!1;var u;if((u=l.tag!==3)&&!(u=l.tag!==5)&&(u=l.type,u=u!=="head"&&u!=="body"&&!xx(l.type,l.memoizedProps)),u&&(u=us)){if(_x(l))throw LA(),Error(n(418));for(;u;)IA(l,u),u=Wi(u.nextSibling)}if(DA(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 LA(){for(var l=us;l;)l=Wi(l.nextSibling)}function rc(){us=cs=null,Mn=!1}function kx(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 te=C.refs;$===null?delete te[T]:te[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 FA(l){var u=l._init;return u(l._payload)}function zA(l){function u(xe,pe){if(l){var ye=xe.deletions;ye===null?(xe.deletions=[pe],xe.flags|=16):ye.push(pe)}}function g(xe,pe){if(!l)return null;for(;pe!==null;)u(xe,pe),pe=pe.sibling;return null}function w(xe,pe){for(xe=new Map;pe!==null;)pe.key!==null?xe.set(pe.key,pe):xe.set(pe.index,pe),pe=pe.sibling;return xe}function C(xe,pe){return xe=to(xe,pe),xe.index=0,xe.sibling=null,xe}function T(xe,pe,ye){return xe.index=ye,l?(ye=xe.alternate,ye!==null?(ye=ye.index,ye<pe?(xe.flags|=2,pe):ye):(xe.flags|=2,pe)):(xe.flags|=1048576,pe)}function $(xe){return l&&xe.alternate===null&&(xe.flags|=2),xe}function te(xe,pe,ye,Ye){return pe===null||pe.tag!==6?(pe=yy(ye,xe.mode,Ye),pe.return=xe,pe):(pe=C(pe,ye),pe.return=xe,pe)}function ue(xe,pe,ye,Ye){var Nt=ye.type;return Nt===P?Be(xe,pe,ye.props.children,Ye,ye.key):pe!==null&&(pe.elementType===Nt||typeof Nt=="object"&&Nt!==null&&Nt.$$typeof===I&&FA(Nt)===pe.type)?(Ye=C(pe,ye.props),Ye.ref=rd(xe,pe,ye),Ye.return=xe,Ye):(Ye=ih(ye.type,ye.key,ye.props,null,xe.mode,Ye),Ye.ref=rd(xe,pe,ye),Ye.return=xe,Ye)}function be(xe,pe,ye,Ye){return pe===null||pe.tag!==4||pe.stateNode.containerInfo!==ye.containerInfo||pe.stateNode.implementation!==ye.implementation?(pe=by(ye,xe.mode,Ye),pe.return=xe,pe):(pe=C(pe,ye.children||[]),pe.return=xe,pe)}function Be(xe,pe,ye,Ye,Nt){return pe===null||pe.tag!==7?(pe=Vo(ye,xe.mode,Ye,Nt),pe.return=xe,pe):(pe=C(pe,ye),pe.return=xe,pe)}function We(xe,pe,ye){if(typeof pe=="string"&&pe!==""||typeof pe=="number")return pe=yy(""+pe,xe.mode,ye),pe.return=xe,pe;if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case k:return ye=ih(pe.type,pe.key,pe.props,null,xe.mode,ye),ye.ref=rd(xe,null,pe),ye.return=xe,ye;case E:return pe=by(pe,xe.mode,ye),pe.return=xe,pe;case I:var Ye=pe._init;return We(xe,Ye(pe._payload),ye)}if(_e(pe)||O(pe))return pe=Vo(pe,xe.mode,ye,null),pe.return=xe,pe;$p(xe,pe)}return null}function ze(xe,pe,ye,Ye){var Nt=pe!==null?pe.key:null;if(typeof ye=="string"&&ye!==""||typeof ye=="number")return Nt!==null?null:te(xe,pe,""+ye,Ye);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case k:return ye.key===Nt?ue(xe,pe,ye,Ye):null;case E:return ye.key===Nt?be(xe,pe,ye,Ye):null;case I:return Nt=ye._init,ze(xe,pe,Nt(ye._payload),Ye)}if(_e(ye)||O(ye))return Nt!==null?null:Be(xe,pe,ye,Ye,null);$p(xe,ye)}return null}function dt(xe,pe,ye,Ye,Nt){if(typeof Ye=="string"&&Ye!==""||typeof Ye=="number")return xe=xe.get(ye)||null,te(pe,xe,""+Ye,Nt);if(typeof Ye=="object"&&Ye!==null){switch(Ye.$$typeof){case k:return xe=xe.get(Ye.key===null?ye:Ye.key)||null,ue(pe,xe,Ye,Nt);case E:return xe=xe.get(Ye.key===null?ye:Ye.key)||null,be(pe,xe,Ye,Nt);case I:var Rt=Ye._init;return dt(xe,pe,ye,Rt(Ye._payload),Nt)}if(_e(Ye)||O(Ye))return xe=xe.get(ye)||null,Be(pe,xe,Ye,Nt,null);$p(pe,Ye)}return null}function yt(xe,pe,ye,Ye){for(var Nt=null,Rt=null,Ot=pe,Ut=pe=0,fr=null;Ot!==null&&Ut<ye.length;Ut++){Ot.index>Ut?(fr=Ot,Ot=null):fr=Ot.sibling;var ln=ze(xe,Ot,ye[Ut],Ye);if(ln===null){Ot===null&&(Ot=fr);break}l&&Ot&&ln.alternate===null&&u(xe,Ot),pe=T(ln,pe,Ut),Rt===null?Nt=ln:Rt.sibling=ln,Rt=ln,Ot=fr}if(Ut===ye.length)return g(xe,Ot),Mn&&Do(xe,Ut),Nt;if(Ot===null){for(;Ut<ye.length;Ut++)Ot=We(xe,ye[Ut],Ye),Ot!==null&&(pe=T(Ot,pe,Ut),Rt===null?Nt=Ot:Rt.sibling=Ot,Rt=Ot);return Mn&&Do(xe,Ut),Nt}for(Ot=w(xe,Ot);Ut<ye.length;Ut++)fr=dt(Ot,xe,Ut,ye[Ut],Ye),fr!==null&&(l&&fr.alternate!==null&&Ot.delete(fr.key===null?Ut:fr.key),pe=T(fr,pe,Ut),Rt===null?Nt=fr:Rt.sibling=fr,Rt=fr);return l&&Ot.forEach(function(no){return u(xe,no)}),Mn&&Do(xe,Ut),Nt}function jt(xe,pe,ye,Ye){var Nt=O(ye);if(typeof Nt!="function")throw Error(n(150));if(ye=Nt.call(ye),ye==null)throw Error(n(151));for(var Rt=Nt=null,Ot=pe,Ut=pe=0,fr=null,ln=ye.next();Ot!==null&&!ln.done;Ut++,ln=ye.next()){Ot.index>Ut?(fr=Ot,Ot=null):fr=Ot.sibling;var no=ze(xe,Ot,ln.value,Ye);if(no===null){Ot===null&&(Ot=fr);break}l&&Ot&&no.alternate===null&&u(xe,Ot),pe=T(no,pe,Ut),Rt===null?Nt=no:Rt.sibling=no,Rt=no,Ot=fr}if(ln.done)return g(xe,Ot),Mn&&Do(xe,Ut),Nt;if(Ot===null){for(;!ln.done;Ut++,ln=ye.next())ln=We(xe,ln.value,Ye),ln!==null&&(pe=T(ln,pe,Ut),Rt===null?Nt=ln:Rt.sibling=ln,Rt=ln);return Mn&&Do(xe,Ut),Nt}for(Ot=w(xe,Ot);!ln.done;Ut++,ln=ye.next())ln=dt(Ot,xe,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?Nt=ln:Rt.sibling=ln,Rt=ln);return l&&Ot.forEach(function(u7){return u(xe,u7)}),Mn&&Do(xe,Ut),Nt}function Kn(xe,pe,ye,Ye){if(typeof ye=="object"&&ye!==null&&ye.type===P&&ye.key===null&&(ye=ye.props.children),typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case k:e:{for(var Nt=ye.key,Rt=pe;Rt!==null;){if(Rt.key===Nt){if(Nt=ye.type,Nt===P){if(Rt.tag===7){g(xe,Rt.sibling),pe=C(Rt,ye.props.children),pe.return=xe,xe=pe;break e}}else if(Rt.elementType===Nt||typeof Nt=="object"&&Nt!==null&&Nt.$$typeof===I&&FA(Nt)===Rt.type){g(xe,Rt.sibling),pe=C(Rt,ye.props),pe.ref=rd(xe,Rt,ye),pe.return=xe,xe=pe;break e}g(xe,Rt);break}else u(xe,Rt);Rt=Rt.sibling}ye.type===P?(pe=Vo(ye.props.children,xe.mode,Ye,ye.key),pe.return=xe,xe=pe):(Ye=ih(ye.type,ye.key,ye.props,null,xe.mode,Ye),Ye.ref=rd(xe,pe,ye),Ye.return=xe,xe=Ye)}return $(xe);case E:e:{for(Rt=ye.key;pe!==null;){if(pe.key===Rt)if(pe.tag===4&&pe.stateNode.containerInfo===ye.containerInfo&&pe.stateNode.implementation===ye.implementation){g(xe,pe.sibling),pe=C(pe,ye.children||[]),pe.return=xe,xe=pe;break e}else{g(xe,pe);break}else u(xe,pe);pe=pe.sibling}pe=by(ye,xe.mode,Ye),pe.return=xe,xe=pe}return $(xe);case I:return Rt=ye._init,Kn(xe,pe,Rt(ye._payload),Ye)}if(_e(ye))return yt(xe,pe,ye,Ye);if(O(ye))return jt(xe,pe,ye,Ye);$p(xe,ye)}return typeof ye=="string"&&ye!==""||typeof ye=="number"?(ye=""+ye,pe!==null&&pe.tag===6?(g(xe,pe.sibling),pe=C(pe,ye),pe.return=xe,xe=pe):(g(xe,pe),pe=yy(ye,xe.mode,Ye),pe.return=xe,xe=pe),$(xe)):g(xe,pe)}return Kn}var sc=zA(!0),BA=zA(!1),Dp=Vi(null),Lp=null,ac=null,Ex=null;function Px(){Ex=ac=Lp=null}function Tx(l){var u=Dp.current;kn(Dp),l._currentValue=u}function Rx(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,Ex=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(Ex!==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 Ox(l){Lo===null?Lo=[l]:Lo.push(l)}function qA(l,u,g,w){var C=u.interleaved;return C===null?(g.next=g,Ox(u)):(g.next=C.next,C.next=g),u.interleaved=g,ti(l,w)}function ti(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 Mx(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function UA(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 ni(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,ti(l,g)}return C=w.interleaved,C===null?(u.next=u,Ox(w)):(u.next=C.next,C.next=u),w.interleaved=u,ti(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 WA(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,te=C.shared.pending;if(te!==null){C.shared.pending=null;var ue=te,be=ue.next;ue.next=null,$===null?T=be:$.next=be,$=ue;var Be=l.alternate;Be!==null&&(Be=Be.updateQueue,te=Be.lastBaseUpdate,te!==$&&(te===null?Be.firstBaseUpdate=be:te.next=be,Be.lastBaseUpdate=ue))}if(T!==null){var We=C.baseState;$=0,Be=be=ue=null,te=T;do{var ze=te.lane,dt=te.eventTime;if((w&ze)===ze){Be!==null&&(Be=Be.next={eventTime:dt,lane:0,tag:te.tag,payload:te.payload,callback:te.callback,next:null});e:{var yt=l,jt=te;switch(ze=u,dt=g,jt.tag){case 1:if(yt=jt.payload,typeof yt=="function"){We=yt.call(dt,We,ze);break e}We=yt;break e;case 3:yt.flags=yt.flags&-65537|128;case 0:if(yt=jt.payload,ze=typeof yt=="function"?yt.call(dt,We,ze):yt,ze==null)break e;We=Z({},We,ze);break e;case 2:Gi=!0}}te.callback!==null&&te.lane!==0&&(l.flags|=64,ze=C.effects,ze===null?C.effects=[te]:ze.push(te))}else dt={eventTime:dt,lane:ze,tag:te.tag,payload:te.payload,callback:te.callback,next:null},Be===null?(be=Be=dt,ue=We):Be=Be.next=dt,$|=ze;if(te=te.next,te===null){if(te=C.shared.pending,te===null)break;ze=te,te=ze.next,ze.next=null,C.lastBaseUpdate=ze,C.shared.pending=null}}while(!0);if(Be===null&&(ue=We),C.baseState=ue,C.firstBaseUpdate=be,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 VA(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={},ka=Vi(sd),ad=Vi(sd),id=Vi(sd);function Fo(l){if(l===sd)throw Error(n(174));return l}function Ix(l,u){switch(jn(id,u),jn(ad,l),jn(ka,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(ka),jn(ka,u)}function oc(){kn(ka),kn(ad),kn(id)}function HA(l){Fo(id.current);var u=Fo(ka.current),g=nn(u,l.type);u!==g&&(jn(ad,l),jn(ka,g))}function $x(l){ad.current===l&&(kn(ka),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 Dx=[];function Lx(){for(var l=0;l<Dx.length;l++)Dx[l]._workInProgressVersionPrimary=null;Dx.length=0}var qp=A.ReactCurrentDispatcher,Fx=A.ReactCurrentBatchConfig,zo=0,Fn=null,Jn=null,ur=null,Up=!1,od=!1,ld=0,RU=0;function Nr(){throw Error(n(321))}function zx(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 Bx(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 qx(){var l=ld!==0;return ld=0,l}function Ea(){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 Ux(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 te=$=null,ue=null,be=T;do{var Be=be.lane;if((zo&Be)===Be)ue!==null&&(ue=ue.next={lane:0,action:be.action,hasEagerState:be.hasEagerState,eagerState:be.eagerState,next:null}),w=be.hasEagerState?be.eagerState:l(w,be.action);else{var We={lane:Be,action:be.action,hasEagerState:be.hasEagerState,eagerState:be.eagerState,next:null};ue===null?(te=ue=We,$=w):ue=ue.next=We,Fn.lanes|=Be,Bo|=Be}be=be.next}while(be!==null&&be!==T);ue===null?$=w:ue.next=te,Js(w,u.memoizedState)||(Vr=!0),u.memoizedState=w,u.baseState=$,u.baseQueue=ue,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 Wx(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 KA(){}function GA(l,u){var g=Fn,w=As(),C=u(),T=!Js(w.memoizedState,C);if(T&&(w.memoizedState=C,Vr=!0),w=w.queue,Vx(QA.bind(null,g,w,l),[l]),w.getSnapshot!==u||T||ur!==null&&ur.memoizedState.tag&1){if(g.flags|=2048,ud(9,XA.bind(null,g,w,C,u),void 0,null),dr===null)throw Error(n(349));(zo&30)!==0||YA(g,u,C)}return C}function YA(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 XA(l,u,g,w){u.value=g,u.getSnapshot=w,ZA(u)&&JA(l)}function QA(l,u,g){return g(function(){ZA(u)&&JA(l)})}function ZA(l){var u=l.getSnapshot;l=l.value;try{var g=u();return!Js(l,g)}catch{return!0}}function JA(l){var u=ti(l,1);u!==null&&sa(u,l,1,-1)}function ek(l){var u=Ea();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 tk(){return As().memoizedState}function Wp(l,u,g,w){var C=Ea();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&&zx(w,$.deps)){C.memoizedState=ud(u,g,T,w);return}}Fn.flags|=l,C.memoizedState=ud(1|u,g,T,w)}function nk(l,u){return Wp(8390656,8,l,u)}function Vx(l,u){return Vp(2048,8,l,u)}function rk(l,u){return Vp(4,2,l,u)}function sk(l,u){return Vp(4,4,l,u)}function ak(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 ik(l,u,g){return g=g!=null?g.concat([l]):null,Vp(4,4,ak.bind(null,u,l),g)}function Hx(){}function ok(l,u){var g=As();u=u===void 0?null:u;var w=g.memoizedState;return w!==null&&u!==null&&zx(u,w[1])?w[0]:(g.memoizedState=[l,u],l)}function lk(l,u){var g=As();u=u===void 0?null:u;var w=g.memoizedState;return w!==null&&u!==null&&zx(u,w[1])?w[0]:(l=l(),g.memoizedState=[l,u],l)}function ck(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=Fx.transition;Fx.transition={};try{l(!1),u()}finally{fn=g,Fx.transition=w}}function uk(){return As().memoizedState}function MU(l,u,g){var w=Ji(l);if(g={lane:w,action:g,hasEagerState:!1,eagerState:null,next:null},dk(l))fk(u,g);else if(g=qA(l,u,g,w),g!==null){var C=Pr();sa(g,l,w,C),pk(g,u,w)}}function IU(l,u,g){var w=Ji(l),C={lane:w,action:g,hasEagerState:!1,eagerState:null,next:null};if(dk(l))fk(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,te=T($,g);if(C.hasEagerState=!0,C.eagerState=te,Js(te,$)){var ue=u.interleaved;ue===null?(C.next=C,Ox(u)):(C.next=ue.next,ue.next=C),u.interleaved=C;return}}catch{}g=qA(l,u,C,w),g!==null&&(C=Pr(),sa(g,l,w,C),pk(g,u,w))}}function dk(l){var u=l.alternate;return l===Fn||u!==null&&u===Fn}function fk(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 pk(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:Nr,useContext:Nr,useEffect:Nr,useImperativeHandle:Nr,useInsertionEffect:Nr,useLayoutEffect:Nr,useMemo:Nr,useReducer:Nr,useRef:Nr,useState:Nr,useDebugValue:Nr,useDeferredValue:Nr,useTransition:Nr,useMutableSource:Nr,useSyncExternalStore:Nr,useId:Nr,unstable_isNewReconciler:!1},$U={readContext:_s,useCallback:function(l,u){return Ea().memoizedState=[l,u===void 0?null:u],l},useContext:_s,useEffect:nk,useImperativeHandle:function(l,u,g){return g=g!=null?g.concat([l]):null,Wp(4194308,4,ak.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=Ea();return u=u===void 0?null:u,l=l(),g.memoizedState=[l,u],l},useReducer:function(l,u,g){var w=Ea();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=Ea();return l={current:l},u.memoizedState=l},useState:ek,useDebugValue:Hx,useDeferredValue:function(l){return Ea().memoizedState=l},useTransition:function(){var l=ek(!1),u=l[0];return l=OU.bind(null,l[1]),Ea().memoizedState=l,[u,l]},useMutableSource:function(){},useSyncExternalStore:function(l,u,g){var w=Fn,C=Ea();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||YA(w,u,g)}C.memoizedState=g;var T={value:g,getSnapshot:u};return C.queue=T,nk(QA.bind(null,w,T,l),[l]),w.flags|=2048,ud(9,XA.bind(null,w,T,g,u),void 0,null),g},useId:function(){var l=Ea(),u=dr.identifierPrefix;if(Mn){var g=ei,w=Ja;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:ok,useContext:_s,useEffect:Vx,useImperativeHandle:ik,useInsertionEffect:rk,useLayoutEffect:sk,useMemo:lk,useReducer:Ux,useRef:tk,useState:function(){return Ux(cd)},useDebugValue:Hx,useDeferredValue:function(l){var u=As();return ck(u,Jn.memoizedState,l)},useTransition:function(){var l=Ux(cd)[0],u=As().memoizedState;return[l,u]},useMutableSource:KA,useSyncExternalStore:GA,useId:uk,unstable_isNewReconciler:!1},LU={readContext:_s,useCallback:ok,useContext:_s,useEffect:Vx,useImperativeHandle:ik,useInsertionEffect:rk,useLayoutEffect:sk,useMemo:lk,useReducer:Wx,useRef:tk,useState:function(){return Wx(cd)},useDebugValue:Hx,useDeferredValue:function(l){var u=As();return Jn===null?u.memoizedState=l:ck(u,Jn.memoizedState,l)},useTransition:function(){var l=Wx(cd)[0],u=As().memoizedState;return[l,u]},useMutableSource:KA,useSyncExternalStore:GA,useId:uk,unstable_isNewReconciler:!1};function ta(l,u){if(l&&l.defaultProps){u=Z({},u),l=l.defaultProps;for(var g in l)u[g]===void 0&&(u[g]=l[g]);return u}return u}function Kx(l,u,g,w){u=l.memoizedState,g=g(w,u),g=g==null?u:Z({},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=Pr(),C=Ji(l),T=ni(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=Pr(),C=Ji(l),T=ni(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=Pr(),w=Ji(l),C=ni(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 hk(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 mk(l,u,g){var w=!1,C=Hi,T=u.contextType;return typeof T=="object"&&T!==null?T=_s(T):(C=Wr(u)?Io:Sr.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 gk(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 Gx(l,u,g,w){var C=l.stateNode;C.props=g,C.state=l.memoizedState,C.refs={},Mx(l);var T=u.contextType;typeof T=="object"&&T!==null?C.context=_s(T):(T=Wr(u)?Io:Sr.current,C.context=ec(l,T)),C.state=l.memoizedState,T=u.getDerivedStateFromProps,typeof T=="function"&&(Kx(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+=re(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 Yx(l,u,g){return{value:l,source:null,stack:g??null,digest:u??null}}function Xx(l,u){try{console.error(u.value)}catch(g){setTimeout(function(){throw g})}}var FU=typeof WeakMap=="function"?WeakMap:Map;function vk(l,u,g){g=ni(-1,g),g.tag=3,g.payload={element:null};var w=u.value;return g.callback=function(){eh||(eh=!0,dy=w),Xx(l,u)},g}function xk(l,u,g){g=ni(-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(){Xx(l,u)}}var T=l.stateNode;return T!==null&&typeof T.componentDidCatch=="function"&&(g.callback=function(){Xx(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 yk(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 bk(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 wk(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=ni(-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 Er(l,u,g,w){u.child=l===null?BA(u,null,g,w):sc(u,l.child,g,w)}function jk(l,u,g,w,C){g=g.render;var T=u.ref;return ic(u,C),w=Bx(l,u,g,w,T,C),g=qx(),l!==null&&!Vr?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~C,ri(l,u,C)):(Mn&&g&&Nx(u),u.flags|=1,Er(l,u,w,C),u.child)}function Sk(l,u,g,w,C){if(l===null){var T=g.type;return typeof T=="function"&&!xy(T)&&T.defaultProps===void 0&&g.compare===null&&g.defaultProps===void 0?(u.tag=15,u.type=T,Nk(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 ri(l,u,C)}return u.flags|=1,l=to(T,w),l.ref=u.ref,l.return=u,u.child=l}function Nk(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,ri(l,u,C)}return Qx(l,u,g,w,C)}function Ck(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 Er(l,u,C,g),u.child}function _k(l,u){var g=u.ref;(l===null&&g!==null||l!==null&&l.ref!==g)&&(u.flags|=512,u.flags|=2097152)}function Qx(l,u,g,w,C){var T=Wr(g)?Io:Sr.current;return T=ec(u,T),ic(u,C),g=Bx(l,u,g,w,T,C),w=qx(),l!==null&&!Vr?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~C,ri(l,u,C)):(Mn&&w&&Nx(u),u.flags|=1,Er(l,u,g,C),u.child)}function Ak(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),mk(u,g,w),Gx(u,g,w,C),w=!0;else if(l===null){var $=u.stateNode,te=u.memoizedProps;$.props=te;var ue=$.context,be=g.contextType;typeof be=="object"&&be!==null?be=_s(be):(be=Wr(g)?Io:Sr.current,be=ec(u,be));var Be=g.getDerivedStateFromProps,We=typeof Be=="function"||typeof $.getSnapshotBeforeUpdate=="function";We||typeof $.UNSAFE_componentWillReceiveProps!="function"&&typeof $.componentWillReceiveProps!="function"||(te!==w||ue!==be)&&gk(u,$,w,be),Gi=!1;var ze=u.memoizedState;$.state=ze,zp(u,w,$,C),ue=u.memoizedState,te!==w||ze!==ue||Ur.current||Gi?(typeof Be=="function"&&(Kx(u,g,Be,w),ue=u.memoizedState),(te=Gi||hk(u,g,te,w,ze,ue,be))?(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=ue),$.props=w,$.state=ue,$.context=be,w=te):(typeof $.componentDidMount=="function"&&(u.flags|=4194308),w=!1)}else{$=u.stateNode,UA(l,u),te=u.memoizedProps,be=u.type===u.elementType?te:ta(u.type,te),$.props=be,We=u.pendingProps,ze=$.context,ue=g.contextType,typeof ue=="object"&&ue!==null?ue=_s(ue):(ue=Wr(g)?Io:Sr.current,ue=ec(u,ue));var dt=g.getDerivedStateFromProps;(Be=typeof dt=="function"||typeof $.getSnapshotBeforeUpdate=="function")||typeof $.UNSAFE_componentWillReceiveProps!="function"&&typeof $.componentWillReceiveProps!="function"||(te!==We||ze!==ue)&&gk(u,$,w,ue),Gi=!1,ze=u.memoizedState,$.state=ze,zp(u,w,$,C);var yt=u.memoizedState;te!==We||ze!==yt||Ur.current||Gi?(typeof dt=="function"&&(Kx(u,g,dt,w),yt=u.memoizedState),(be=Gi||hk(u,g,be,w,ze,yt,ue)||!1)?(Be||typeof $.UNSAFE_componentWillUpdate!="function"&&typeof $.componentWillUpdate!="function"||(typeof $.componentWillUpdate=="function"&&$.componentWillUpdate(w,yt,ue),typeof $.UNSAFE_componentWillUpdate=="function"&&$.UNSAFE_componentWillUpdate(w,yt,ue)),typeof $.componentDidUpdate=="function"&&(u.flags|=4),typeof $.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof $.componentDidUpdate!="function"||te===l.memoizedProps&&ze===l.memoizedState||(u.flags|=4),typeof $.getSnapshotBeforeUpdate!="function"||te===l.memoizedProps&&ze===l.memoizedState||(u.flags|=1024),u.memoizedProps=w,u.memoizedState=yt),$.props=w,$.state=yt,$.context=ue,w=be):(typeof $.componentDidUpdate!="function"||te===l.memoizedProps&&ze===l.memoizedState||(u.flags|=4),typeof $.getSnapshotBeforeUpdate!="function"||te===l.memoizedProps&&ze===l.memoizedState||(u.flags|=1024),w=!1)}return Zx(l,u,g,w,T,C)}function Zx(l,u,g,w,C,T){_k(l,u);var $=(u.flags&128)!==0;if(!w&&!$)return C&&RA(u,g,!1),ri(l,u,T);w=u.stateNode,zU.current=u;var te=$&&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,te,T)):Er(l,u,te,T),u.memoizedState=w.state,C&&RA(u,g,!0),u.child}function kk(l){var u=l.stateNode;u.pendingContext?PA(l,u.pendingContext,u.pendingContext!==u.context):u.context&&PA(l,u.context,!1),Ix(l,u.containerInfo)}function Ek(l,u,g,w,C){return rc(),kx(C),u.flags|=256,Er(l,u,g,w),u.child}var Jx={dehydrated:null,treeContext:null,retryLane:0};function ey(l){return{baseLanes:l,cachePool:null,transitions:null}}function Pk(l,u,g){var w=u.pendingProps,C=Ln.current,T=!1,$=(u.flags&128)!==0,te;if((te=$)||(te=l!==null&&l.memoizedState===null?!1:(C&2)!==0),te?(T=!0,u.flags&=-129):(l===null||l.memoizedState!==null)&&(C|=1),jn(Ln,C&1),l===null)return Ax(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=ey(g),u.memoizedState=Jx,l):ty(u,$));if(C=l.memoizedState,C!==null&&(te=C.dehydrated,te!==null))return BU(l,u,$,w,te,C,g);if(T){T=w.fallback,$=u.mode,C=l.child,te=C.sibling;var ue={mode:"hidden",children:w.children};return($&1)===0&&u.child!==C?(w=u.child,w.childLanes=0,w.pendingProps=ue,u.deletions=null):(w=to(C,ue),w.subtreeFlags=C.subtreeFlags&14680064),te!==null?T=to(te,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?ey(g):{baseLanes:$.baseLanes|g,cachePool:null,transitions:$.transitions},T.memoizedState=$,T.childLanes=l.childLanes&~g,u.memoizedState=Jx,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 ty(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&&kx(w),sc(u,l.child,null,g),l=ty(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=Yx(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=ey($),u.memoizedState=Jx,T);if((u.mode&1)===0)return Gp(l,u,$,null);if(C.data==="$!"){if(w=C.nextSibling&&C.nextSibling.dataset,w)var te=w.dgst;return w=te,T=Error(n(419)),w=Yx(T,w,void 0),Gp(l,u,$,w)}if(te=($&l.childLanes)!==0,Vr||te){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,ti(l,C),sa(w,l,C,-1))}return vy(),w=Yx(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++]=Ja,Ns[Cs++]=ei,Ns[Cs++]=$o,Ja=l.id,ei=l.overflow,$o=u),u=ty(u,w.children),u.flags|=4096,u)}function Tk(l,u,g){l.lanes|=u;var w=l.alternate;w!==null&&(w.lanes|=u),Rx(l.return,u,g)}function ny(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 Rk(l,u,g){var w=u.pendingProps,C=w.revealOrder,T=w.tail;if(Er(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&&Tk(l,g,u);else if(l.tag===19)Tk(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),ny(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}ny(u,!0,g,null,T);break;case"together":ny(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 ri(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:kk(u),rc();break;case 5:HA(u);break;case 1:Wr(u.type)&&Tp(u);break;case 4:Ix(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?Pk(l,u,g):(jn(Ln,Ln.current&1),l=ri(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 Rk(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,Ck(l,u,g)}return ri(l,u,g)}var Ok,ry,Mk,Ik;Ok=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}},ry=function(){},Mk=function(l,u,g,w){var C=l.memoizedProps;if(C!==w){l=u.stateNode,Fo(ka.current);var T=null;switch(g){case"input":C=Fe(l,C),w=Fe(l,w),T=[];break;case"select":C=Z({},C,{value:void 0}),w=Z({},w,{value:void 0}),T=[];break;case"textarea":C=tt(l,C),w=tt(l,w),T=[];break;default:typeof C.onClick!="function"&&typeof w.onClick=="function"&&(l.onclick=kp)}Ke(g,w);var $;g=null;for(be in C)if(!w.hasOwnProperty(be)&&C.hasOwnProperty(be)&&C[be]!=null)if(be==="style"){var te=C[be];for($ in te)te.hasOwnProperty($)&&(g||(g={}),g[$]="")}else be!=="dangerouslySetInnerHTML"&&be!=="children"&&be!=="suppressContentEditableWarning"&&be!=="suppressHydrationWarning"&&be!=="autoFocus"&&(a.hasOwnProperty(be)?T||(T=[]):(T=T||[]).push(be,null));for(be in w){var ue=w[be];if(te=C?.[be],w.hasOwnProperty(be)&&ue!==te&&(ue!=null||te!=null))if(be==="style")if(te){for($ in te)!te.hasOwnProperty($)||ue&&ue.hasOwnProperty($)||(g||(g={}),g[$]="");for($ in ue)ue.hasOwnProperty($)&&te[$]!==ue[$]&&(g||(g={}),g[$]=ue[$])}else g||(T||(T=[]),T.push(be,g)),g=ue;else be==="dangerouslySetInnerHTML"?(ue=ue?ue.__html:void 0,te=te?te.__html:void 0,ue!=null&&te!==ue&&(T=T||[]).push(be,ue)):be==="children"?typeof ue!="string"&&typeof ue!="number"||(T=T||[]).push(be,""+ue):be!=="suppressContentEditableWarning"&&be!=="suppressHydrationWarning"&&(a.hasOwnProperty(be)?(ue!=null&&be==="onScroll"&&An("scroll",l),T||te===ue||(T=[])):(T=T||[]).push(be,ue))}g&&(T=T||[]).push("style",g);var be=T;(u.updateQueue=be)&&(u.flags|=4)}},Ik=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 Cr(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(Cx(u),u.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Cr(u),null;case 1:return Wr(u.type)&&Pp(),Cr(u),null;case 3:return w=u.stateNode,oc(),kn(Ur),kn(Sr),Lx(),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&&(hy(ea),ea=null))),ry(l,u),Cr(u),null;case 5:$x(u);var C=Fo(id.current);if(g=u.type,l!==null&&u.stateNode!=null)Mk(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 Cr(u),null}if(l=Fo(ka.current),Ip(u)){w=u.stateNode,g=u.type;var T=u.memoizedProps;switch(w[Aa]=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":pt(w,T),An("invalid",w);break;case"select":w._wrapperState={wasMultiple:!!T.multiple},An("invalid",w);break;case"textarea":ct(w,T),An("invalid",w)}Ke(g,T),C=null;for(var $ in T)if(T.hasOwnProperty($)){var te=T[$];$==="children"?typeof te=="string"?w.textContent!==te&&(T.suppressHydrationWarning!==!0&&Ap(w.textContent,te,l),C=["children",te]):typeof te=="number"&&w.textContent!==""+te&&(T.suppressHydrationWarning!==!0&&Ap(w.textContent,te,l),C=["children",""+te]):a.hasOwnProperty($)&&te!=null&&$==="onScroll"&&An("scroll",w)}switch(g){case"input":Re(w),wt(w,T,!0);break;case"textarea":Re(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[Aa]=u,l[td]=w,Ok(l,u,!1,!1),u.stateNode=l;e:{switch($=$e(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":pt(l,w),C=Fe(l,w),An("invalid",l);break;case"option":C=w;break;case"select":l._wrapperState={wasMultiple:!!w.multiple},C=Z({},w,{value:void 0}),An("invalid",l);break;case"textarea":ct(l,w),C=tt(l,w),An("invalid",l);break;default:C=w}Ke(g,C),te=C;for(T in te)if(te.hasOwnProperty(T)){var ue=te[T];T==="style"?Bt(l,ue):T==="dangerouslySetInnerHTML"?(ue=ue?ue.__html:void 0,ue!=null&&zt(l,ue)):T==="children"?typeof ue=="string"?(g!=="textarea"||ue!=="")&&Se(l,ue):typeof ue=="number"&&Se(l,""+ue):T!=="suppressContentEditableWarning"&&T!=="suppressHydrationWarning"&&T!=="autoFocus"&&(a.hasOwnProperty(T)?ue!=null&&T==="onScroll"&&An("scroll",l):ue!=null&&_(l,T,ue,$))}switch(g){case"input":Re(l),wt(l,w,!1);break;case"textarea":Re(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?Ee(l,!!w.multiple,T,!1):w.defaultValue!=null&&Ee(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 Cr(u),null;case 6:if(l&&u.stateNode!=null)Ik(l,u,l.memoizedProps,w);else{if(typeof w!="string"&&u.stateNode===null)throw Error(n(166));if(g=Fo(id.current),Fo(ka.current),Ip(u)){if(w=u.stateNode,g=u.memoizedProps,w[Aa]=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[Aa]=u,u.stateNode=w}return Cr(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)LA(),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[Aa]=u}else rc(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;Cr(u),T=!1}else ea!==null&&(hy(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):vy())),u.updateQueue!==null&&(u.flags|=4),Cr(u),null);case 4:return oc(),ry(l,u),l===null&&Ju(u.stateNode.containerInfo),Cr(u),null;case 10:return Tx(u.type._context),Cr(u),null;case 17:return Wr(u.type)&&Pp(),Cr(u),null;case 19:if(kn(Ln),T=u.memoizedState,T===null)return Cr(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&&ce()>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 Cr(u),null}else 2*ce()-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=ce(),u.sibling=null,g=Ln.current,jn(Ln,w?g&1|2:g&1),u):(Cr(u),null);case 22:case 23:return gy(),w=u.memoizedState!==null,l!==null&&l.memoizedState!==null!==w&&(u.flags|=8192),w&&(u.mode&1)!==0?(ds&1073741824)!==0&&(Cr(u),u.subtreeFlags&6&&(u.flags|=8192)):Cr(u),null;case 24:return null;case 25:return null}throw Error(n(156,u.tag))}function WU(l,u){switch(Cx(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(Sr),Lx(),l=u.flags,(l&65536)!==0&&(l&128)===0?(u.flags=l&-65537|128,u):null;case 5:return $x(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 Tx(u.type._context),null;case 22:case 23:return gy(),null;case 24:return null;default:return null}}var Xp=!1,_r=!1,VU=typeof WeakSet=="function"?WeakSet:Set,vt=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 sy(l,u,g){try{g()}catch(w){Un(l,u,w)}}var $k=!1;function HU(l,u){if(gx=gp,l=hA(),lx(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,te=-1,ue=-1,be=0,Be=0,We=l,ze=null;t:for(;;){for(var dt;We!==g||C!==0&&We.nodeType!==3||(te=$+C),We!==T||w!==0&&We.nodeType!==3||(ue=$+w),We.nodeType===3&&($+=We.nodeValue.length),(dt=We.firstChild)!==null;)ze=We,We=dt;for(;;){if(We===l)break t;if(ze===g&&++be===C&&(te=$),ze===T&&++Be===w&&(ue=$),(dt=We.nextSibling)!==null)break;We=ze,ze=We.parentNode}We=dt}g=te===-1||ue===-1?null:{start:te,end:ue}}else g=null}g=g||{start:0,end:0}}else g=null;for(vx={focusedElem:l,selectionRange:g},gp=!1,vt=u;vt!==null;)if(u=vt,l=u.child,(u.subtreeFlags&1028)!==0&&l!==null)l.return=u,vt=l;else for(;vt!==null;){u=vt;try{var yt=u.alternate;if((u.flags&1024)!==0)switch(u.tag){case 0:case 11:case 15:break;case 1:if(yt!==null){var jt=yt.memoizedProps,Kn=yt.memoizedState,xe=u.stateNode,pe=xe.getSnapshotBeforeUpdate(u.elementType===u.type?jt:ta(u.type,jt),Kn);xe.__reactInternalSnapshotBeforeUpdate=pe}break;case 3:var ye=u.stateNode.containerInfo;ye.nodeType===1?ye.textContent="":ye.nodeType===9&&ye.documentElement&&ye.removeChild(ye.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,vt=l;break}vt=u.return}return yt=$k,$k=!1,yt}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&&sy(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 ay(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 Dk(l){var u=l.alternate;u!==null&&(l.alternate=null,Dk(u)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(u=l.stateNode,u!==null&&(delete u[Aa],delete u[td],delete u[wx],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 Lk(l){return l.tag===5||l.tag===3||l.tag===4}function Fk(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||Lk(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 iy(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(iy(l,u,g),l=l.sibling;l!==null;)iy(l,u,g),l=l.sibling}function oy(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(oy(l,u,g),l=l.sibling;l!==null;)oy(l,u,g),l=l.sibling}var xr=null,na=!1;function Xi(l,u,g){for(g=g.child;g!==null;)zk(l,u,g),g=g.sibling}function zk(l,u,g){if(gr&&typeof gr.onCommitFiberUnmount=="function")try{gr.onCommitFiberUnmount(os,g)}catch{}switch(g.tag){case 5:_r||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?bx(l.parentNode,g):l.nodeType===1&&bx(l,g),Wu(l)):bx(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(!_r&&(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)&&sy(g,u,$),C=C.next}while(C!==w)}Xi(l,u,g);break;case 1:if(!_r&&(cc(g,u),w=g.stateNode,typeof w.componentWillUnmount=="function"))try{w.props=g.memoizedProps,w.state=g.memoizedState,w.componentWillUnmount()}catch(te){Un(g,u,te)}Xi(l,u,g);break;case 21:Xi(l,u,g);break;case 22:g.mode&1?(_r=(w=_r)||g.memoizedState!==null,Xi(l,u,g),_r=w):Xi(l,u,g);break;default:Xi(l,u,g)}}function Bk(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,te=$;e:for(;te!==null;){switch(te.tag){case 5:xr=te.stateNode,na=!1;break e;case 3:xr=te.stateNode.containerInfo,na=!0;break e;case 4:xr=te.stateNode.containerInfo,na=!0;break e}te=te.return}if(xr===null)throw Error(n(160));zk(T,$,C),xr=null,na=!1;var ue=C.alternate;ue!==null&&(ue.return=null),C.return=null}catch(be){Un(C,u,be)}}if(u.subtreeFlags&12854)for(u=u.child;u!==null;)qk(u,l),u=u.sibling}function qk(l,u){var g=l.alternate,w=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(ra(u,l),Pa(l),w&4){try{fd(3,l,l.return),Qp(3,l)}catch(jt){Un(l,l.return,jt)}try{fd(5,l,l.return)}catch(jt){Un(l,l.return,jt)}}break;case 1:ra(u,l),Pa(l),w&512&&g!==null&&cc(g,g.return);break;case 5:if(ra(u,l),Pa(l),w&512&&g!==null&&cc(g,g.return),l.flags&32){var C=l.stateNode;try{Se(C,"")}catch(jt){Un(l,l.return,jt)}}if(w&4&&(C=l.stateNode,C!=null)){var T=l.memoizedProps,$=g!==null?g.memoizedProps:T,te=l.type,ue=l.updateQueue;if(l.updateQueue=null,ue!==null)try{te==="input"&&T.type==="radio"&&T.name!=null&&ot(C,T),$e(te,$);var be=$e(te,T);for($=0;$<ue.length;$+=2){var Be=ue[$],We=ue[$+1];Be==="style"?Bt(C,We):Be==="dangerouslySetInnerHTML"?zt(C,We):Be==="children"?Se(C,We):_(C,Be,We,be)}switch(te){case"input":bt(C,T);break;case"textarea":Pt(C,T);break;case"select":var ze=C._wrapperState.wasMultiple;C._wrapperState.wasMultiple=!!T.multiple;var dt=T.value;dt!=null?Ee(C,!!T.multiple,dt,!1):ze!==!!T.multiple&&(T.defaultValue!=null?Ee(C,!!T.multiple,T.defaultValue,!0):Ee(C,!!T.multiple,T.multiple?[]:"",!1))}C[td]=T}catch(jt){Un(l,l.return,jt)}}break;case 6:if(ra(u,l),Pa(l),w&4){if(l.stateNode===null)throw Error(n(162));C=l.stateNode,T=l.memoizedProps;try{C.nodeValue=T}catch(jt){Un(l,l.return,jt)}}break;case 3:if(ra(u,l),Pa(l),w&4&&g!==null&&g.memoizedState.isDehydrated)try{Wu(u.containerInfo)}catch(jt){Un(l,l.return,jt)}break;case 4:ra(u,l),Pa(l);break;case 13:ra(u,l),Pa(l),C=l.child,C.flags&8192&&(T=C.memoizedState!==null,C.stateNode.isHidden=T,!T||C.alternate!==null&&C.alternate.memoizedState!==null||(uy=ce())),w&4&&Bk(l);break;case 22:if(Be=g!==null&&g.memoizedState!==null,l.mode&1?(_r=(be=_r)||Be,ra(u,l),_r=be):ra(u,l),Pa(l),w&8192){if(be=l.memoizedState!==null,(l.stateNode.isHidden=be)&&!Be&&(l.mode&1)!==0)for(vt=l,Be=l.child;Be!==null;){for(We=vt=Be;vt!==null;){switch(ze=vt,dt=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 yt=ze.stateNode;if(typeof yt.componentWillUnmount=="function"){w=ze,g=ze.return;try{u=w,yt.props=u.memoizedProps,yt.state=u.memoizedState,yt.componentWillUnmount()}catch(jt){Un(w,g,jt)}}break;case 5:cc(ze,ze.return);break;case 22:if(ze.memoizedState!==null){Vk(We);continue}}dt!==null?(dt.return=ze,vt=dt):Vk(We)}Be=Be.sibling}e:for(Be=null,We=l;;){if(We.tag===5){if(Be===null){Be=We;try{C=We.stateNode,be?(T=C.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none"):(te=We.stateNode,ue=We.memoizedProps.style,$=ue!=null&&ue.hasOwnProperty("display")?ue.display:null,te.style.display=At("display",$))}catch(jt){Un(l,l.return,jt)}}}else if(We.tag===6){if(Be===null)try{We.stateNode.nodeValue=be?"":We.memoizedProps}catch(jt){Un(l,l.return,jt)}}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),Pa(l),w&4&&Bk(l);break;case 21:break;default:ra(u,l),Pa(l)}}function Pa(l){var u=l.flags;if(u&2){try{e:{for(var g=l.return;g!==null;){if(Lk(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&&(Se(C,""),w.flags&=-33);var T=Fk(l);oy(l,T,C);break;case 3:case 4:var $=w.stateNode.containerInfo,te=Fk(l);iy(l,te,$);break;default:throw Error(n(161))}}catch(ue){Un(l,l.return,ue)}l.flags&=-3}u&4096&&(l.flags&=-4097)}function KU(l,u,g){vt=l,Uk(l)}function Uk(l,u,g){for(var w=(l.mode&1)!==0;vt!==null;){var C=vt,T=C.child;if(C.tag===22&&w){var $=C.memoizedState!==null||Xp;if(!$){var te=C.alternate,ue=te!==null&&te.memoizedState!==null||_r;te=Xp;var be=_r;if(Xp=$,(_r=ue)&&!be)for(vt=C;vt!==null;)$=vt,ue=$.child,$.tag===22&&$.memoizedState!==null?Hk(C):ue!==null?(ue.return=$,vt=ue):Hk(C);for(;T!==null;)vt=T,Uk(T),T=T.sibling;vt=C,Xp=te,_r=be}Wk(l)}else(C.subtreeFlags&8772)!==0&&T!==null?(T.return=C,vt=T):Wk(l)}}function Wk(l){for(;vt!==null;){var u=vt;if((u.flags&8772)!==0){var g=u.alternate;try{if((u.flags&8772)!==0)switch(u.tag){case 0:case 11:case 15:_r||Qp(5,u);break;case 1:var w=u.stateNode;if(u.flags&4&&!_r)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&&VA(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}VA(u,$,g)}break;case 5:var te=u.stateNode;if(g===null&&u.flags&4){g=te;var ue=u.memoizedProps;switch(u.type){case"button":case"input":case"select":case"textarea":ue.autoFocus&&g.focus();break;case"img":ue.src&&(g.src=ue.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(u.memoizedState===null){var be=u.alternate;if(be!==null){var Be=be.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))}_r||u.flags&512&&ay(u)}catch(ze){Un(u,u.return,ze)}}if(u===l){vt=null;break}if(g=u.sibling,g!==null){g.return=u.return,vt=g;break}vt=u.return}}function Vk(l){for(;vt!==null;){var u=vt;if(u===l){vt=null;break}var g=u.sibling;if(g!==null){g.return=u.return,vt=g;break}vt=u.return}}function Hk(l){for(;vt!==null;){var u=vt;try{switch(u.tag){case 0:case 11:case 15:var g=u.return;try{Qp(4,u)}catch(ue){Un(u,g,ue)}break;case 1:var w=u.stateNode;if(typeof w.componentDidMount=="function"){var C=u.return;try{w.componentDidMount()}catch(ue){Un(u,C,ue)}}var T=u.return;try{ay(u)}catch(ue){Un(u,T,ue)}break;case 5:var $=u.return;try{ay(u)}catch(ue){Un(u,$,ue)}}}catch(ue){Un(u,u.return,ue)}if(u===l){vt=null;break}var te=u.sibling;if(te!==null){te.return=u.return,vt=te;break}vt=u.return}}var GU=Math.ceil,Zp=A.ReactCurrentDispatcher,ly=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,cy=0,hd=null,Hr=null,uy=0,dc=1/0,si=null,eh=!1,dy=null,Qi=null,th=!1,Zi=null,nh=0,md=0,fy=null,rh=-1,sh=0;function Pr(){return(an&6)!==0?ce():rh!==-1?rh:rh=ce()}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:G_(l.type)),l)}function sa(l,u,g,w){if(50<md)throw md=0,fy=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=ce()+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(Gk.bind(null,l)):OA(Gk.bind(null,l)),_U(function(){(an&6)===0&&Ki()}),g=null;else{switch(z_(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=nE(g,Kk.bind(null,l))}l.callbackPriority=u,l.callbackNode=g}}function Kk(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=Xk();(dr!==l||yr!==u)&&(si=null,dc=ce()+500,Uo(l,u));do try{QU();break}catch(te){Yk(l,te)}while(!0);Px(),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=py(l,C))),u===1)throw g=pd,Uo(l,0),eo(l,w),Kr(l,ce()),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=py(l,T))),u===1))throw g=pd,Uo(l,0),eo(l,w),Kr(l,ce()),g;switch(l.finishedWork=C,l.finishedLanes=w,u){case 0:case 1:throw Error(n(345));case 2:Wo(l,Hr,si);break;case 3:if(eo(l,w),(w&130023424)===w&&(u=uy+500-ce(),10<u)){if(sn(l,0)!==0)break;if(C=l.suspendedLanes,(C&w)!==w){Pr(),l.pingedLanes|=l.suspendedLanes&C;break}l.timeoutHandle=yx(Wo.bind(null,l,Hr,si),u);break}Wo(l,Hr,si);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=ce()-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=yx(Wo.bind(null,l,Hr,si),w);break}Wo(l,Hr,si);break;case 5:Wo(l,Hr,si);break;default:throw Error(n(329))}}}return Kr(l,ce()),l.callbackNode===g?Kk.bind(null,l):null}function py(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&&hy(u)),l}function hy(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&=~cy,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 Gk(l){if((an&6)!==0)throw Error(n(327));fc();var u=sn(l,0);if((u&1)===0)return Kr(l,ce()),null;var g=ah(l,u);if(l.tag!==0&&g===2){var w=cr(l);w!==0&&(u=w,g=py(l,w))}if(g===1)throw g=pd,Uo(l,0),eo(l,u),Kr(l,ce()),g;if(g===6)throw Error(n(345));return l.finishedWork=l.current.alternate,l.finishedLanes=u,Wo(l,Hr,si),Kr(l,ce()),null}function my(l,u){var g=an;an|=1;try{return l(u)}finally{an=g,an===0&&(dc=ce()+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 gy(){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(Cx(w),w.tag){case 1:w=w.type.childContextTypes,w!=null&&Pp();break;case 3:oc(),kn(Ur),kn(Sr),Lx();break;case 5:$x(w);break;case 4:oc();break;case 13:kn(Ln);break;case 19:kn(Ln);break;case 10:Tx(w.type._context);break;case 22:case 23:gy()}g=g.return}if(dr=l,Yn=l=to(l.current,null),yr=ds=u,er=0,pd=null,cy=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 Yk(l,u){do{var g=Yn;try{if(Px(),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,ly.current=null,g===null||g.return===null){er=1,pd=u,Yn=null;break}e:{var T=l,$=g.return,te=g,ue=u;if(u=yr,te.flags|=32768,ue!==null&&typeof ue=="object"&&typeof ue.then=="function"){var be=ue,Be=te,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 dt=bk($);if(dt!==null){dt.flags&=-257,wk(dt,$,te,T,u),dt.mode&1&&yk(T,be,u),u=dt,ue=be;var yt=u.updateQueue;if(yt===null){var jt=new Set;jt.add(ue),u.updateQueue=jt}else yt.add(ue);break e}else{if((u&1)===0){yk(T,be,u),vy();break e}ue=Error(n(426))}}else if(Mn&&te.mode&1){var Kn=bk($);if(Kn!==null){(Kn.flags&65536)===0&&(Kn.flags|=256),wk(Kn,$,te,T,u),kx(lc(ue,te));break e}}T=ue=lc(ue,te),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 xe=vk(T,ue,u);WA(T,xe);break e;case 1:te=ue;var pe=T.type,ye=T.stateNode;if((T.flags&128)===0&&(typeof pe.getDerivedStateFromError=="function"||ye!==null&&typeof ye.componentDidCatch=="function"&&(Qi===null||!Qi.has(ye)))){T.flags|=65536,u&=-u,T.lanes|=u;var Ye=xk(T,te,u);WA(T,Ye);break e}}T=T.return}while(T!==null)}Zk(g)}catch(Nt){u=Nt,Yn===g&&g!==null&&(Yn=g=g.return);continue}break}while(!0)}function Xk(){var l=Zp.current;return Zp.current=Hp,l===null?Hp:l}function vy(){(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=Xk();(dr!==l||yr!==u)&&(si=null,Uo(l,u));do try{XU();break}catch(C){Yk(l,C)}while(!0);if(Px(),an=g,Zp.current=w,Yn!==null)throw Error(n(261));return dr=null,yr=0,er}function XU(){for(;Yn!==null;)Qk(Yn)}function QU(){for(;Yn!==null&&!Fu();)Qk(Yn)}function Qk(l){var u=tE(l.alternate,l,ds);l.memoizedProps=l.pendingProps,u===null?Zk(l):Yn=u,ly.current=null}function Zk(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(Gv(l,T),l===dr&&(Yn=dr=null,yr=0),(g.subtreeFlags&2064)===0&&(g.flags&2064)===0||th||(th=!0,nE(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 te=an;an|=4,ly.current=null,HU(l,g),qk(g,l),xU(vx),gp=!!gx,vx=gx=null,l.current=g,KU(g),_a(),an=te,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,ce()),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=dy,dy=null,l;return(nh&1)!==0&&l.tag!==0&&fc(),T=l.pendingLanes,(T&1)!==0?l===fy?md++:(md=0,fy=l):md=0,Ki(),null}function fc(){if(Zi!==null){var l=z_(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,vt=l.current;vt!==null;){var T=vt,$=T.child;if((vt.flags&16)!==0){var te=T.deletions;if(te!==null){for(var ue=0;ue<te.length;ue++){var be=te[ue];for(vt=be;vt!==null;){var Be=vt;switch(Be.tag){case 0:case 11:case 15:fd(8,Be,T)}var We=Be.child;if(We!==null)We.return=Be,vt=We;else for(;vt!==null;){Be=vt;var ze=Be.sibling,dt=Be.return;if(Dk(Be),Be===be){vt=null;break}if(ze!==null){ze.return=dt,vt=ze;break}vt=dt}}}var yt=T.alternate;if(yt!==null){var jt=yt.child;if(jt!==null){yt.child=null;do{var Kn=jt.sibling;jt.sibling=null,jt=Kn}while(jt!==null)}}vt=T}}if((T.subtreeFlags&2064)!==0&&$!==null)$.return=T,vt=$;else e:for(;vt!==null;){if(T=vt,(T.flags&2048)!==0)switch(T.tag){case 0:case 11:case 15:fd(9,T,T.return)}var xe=T.sibling;if(xe!==null){xe.return=T.return,vt=xe;break e}vt=T.return}}var pe=l.current;for(vt=pe;vt!==null;){$=vt;var ye=$.child;if(($.subtreeFlags&2064)!==0&&ye!==null)ye.return=$,vt=ye;else e:for($=pe;vt!==null;){if(te=vt,(te.flags&2048)!==0)try{switch(te.tag){case 0:case 11:case 15:Qp(9,te)}}catch(Nt){Un(te,te.return,Nt)}if(te===$){vt=null;break e}var Ye=te.sibling;if(Ye!==null){Ye.return=te.return,vt=Ye;break e}vt=te.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 Jk(l,u,g){u=lc(g,u),u=vk(l,u,1),l=Yi(l,u,1),u=Pr(),l!==null&&(Ss(l,1,u),Kr(l,u))}function Un(l,u,g){if(l.tag===3)Jk(l,l,g);else for(;u!==null;){if(u.tag===3){Jk(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=xk(u,l,1),u=Yi(u,l,1),l=Pr(),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=Pr(),l.pingedLanes|=l.suspendedLanes&g,dr===l&&(yr&g)===g&&(er===4||er===3&&(yr&130023424)===yr&&500>ce()-uy?Uo(l,0):cy|=g),Kr(l,u)}function eE(l,u){u===0&&((l.mode&1)===0?u=1:(u=St,St<<=1,(St&130023424)===0&&(St=4194304)));var g=Pr();l=ti(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),eE(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),eE(l,g)}var tE;tE=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&&MA(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,Sr.current);ic(u,g),C=Bx(null,u,w,l,C,g);var T=qx();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,Mx(u),C.updater=Kp,u.stateNode=C,C._reactInternals=u,Gx(u,w,l,g),u=Zx(null,u,w,!0,T,g)):(u.tag=0,Mn&&T&&Nx(u),Er(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=Qx(null,u,w,l,g);break e;case 1:u=Ak(null,u,w,l,g);break e;case 11:u=jk(null,u,w,l,g);break e;case 14:u=Sk(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),Qx(l,u,w,C,g);case 1:return w=u.type,C=u.pendingProps,C=u.elementType===w?C:ta(w,C),Ak(l,u,w,C,g);case 3:e:{if(kk(u),l===null)throw Error(n(387));w=u.pendingProps,T=u.memoizedState,C=T.element,UA(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=Ek(l,u,w,g,C);break e}else if(w!==C){C=lc(Error(n(424)),u),u=Ek(l,u,w,g,C);break e}else for(us=Wi(u.stateNode.containerInfo.firstChild),cs=u,Mn=!0,ea=null,g=BA(u,null,w,g),u.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling;else{if(rc(),w===C){u=ri(l,u,g);break e}Er(l,u,w,g)}u=u.child}return u;case 5:return HA(u),l===null&&Ax(u),w=u.type,C=u.pendingProps,T=l!==null?l.memoizedProps:null,$=C.children,xx(w,C)?$=null:T!==null&&xx(w,T)&&(u.flags|=32),_k(l,u),Er(l,u,$,g),u.child;case 6:return l===null&&Ax(u),null;case 13:return Pk(l,u,g);case 4:return Ix(u,u.stateNode.containerInfo),w=u.pendingProps,l===null?u.child=sc(u,null,w,g):Er(l,u,w,g),u.child;case 11:return w=u.type,C=u.pendingProps,C=u.elementType===w?C:ta(w,C),jk(l,u,w,C,g);case 7:return Er(l,u,u.pendingProps,g),u.child;case 8:return Er(l,u,u.pendingProps.children,g),u.child;case 12:return Er(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=ri(l,u,g);break e}}else for(T=u.child,T!==null&&(T.return=u);T!==null;){var te=T.dependencies;if(te!==null){$=T.child;for(var ue=te.firstContext;ue!==null;){if(ue.context===w){if(T.tag===1){ue=ni(-1,g&-g),ue.tag=2;var be=T.updateQueue;if(be!==null){be=be.shared;var Be=be.pending;Be===null?ue.next=ue:(ue.next=Be.next,Be.next=ue),be.pending=ue}}T.lanes|=g,ue=T.alternate,ue!==null&&(ue.lanes|=g),Rx(T.return,g,u),te.lanes|=g;break}ue=ue.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,te=$.alternate,te!==null&&(te.lanes|=g),Rx($,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=$}Er(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,Er(l,u,w,g),u.child;case 14:return w=u.type,C=ta(w,u.pendingProps),C=ta(w.type,C),Sk(l,u,w,C,g);case 15:return Nk(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),mk(u,w,C),Gx(u,w,C,g),Zx(null,u,w,!0,l,g);case 19:return Rk(l,u,g);case 22:return Ck(l,u,g)}throw Error(n(156,u.tag))};function nE(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 xy(l){return l=l.prototype,!(!l||!l.isReactComponent)}function r7(l){if(typeof l=="function")return xy(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")xy(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 yy(l,u,g){return l=Es(6,l,null,u),l.lanes=g,l}function by(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 wy(l,u,g,w,C,T,$,te,ue){return l=new s7(l,u,g,te,ue),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},Mx(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 rE(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 TA(l,g,u)}return u}function sE(l,u,g,w,C,T,$,te,ue){return l=wy(g,w,!0,l,C,T,$,te,ue),l.context=rE(null),g=l.current,w=Pr(),C=Ji(g),T=ni(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=Pr(),$=Ji(C);return g=rE(g),u.context===null?u.context=g:u.pendingContext=g,u=ni(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 aE(l,u){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var g=l.retryLane;l.retryLane=g!==0&&g<u?g:u}}function jy(l,u){aE(l,u),(l=l.alternate)&&aE(l,u)}function i7(){return null}var iE=typeof reportError=="function"?reportError:function(l){console.error(l)};function Sy(l){this._internalRoot=l}uh.prototype.render=Sy.prototype.render=function(l){var u=this._internalRoot;if(u===null)throw Error(n(409));lh(l,u,null,null)},uh.prototype.unmount=Sy.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[Qa]=null}};function uh(l){this._internalRoot=l}uh.prototype.unstable_scheduleHydration=function(l){if(l){var u=U_();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&&H_(l)}};function Ny(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 oE(){}function o7(l,u,g,w,C){if(C){if(typeof w=="function"){var T=w;w=function(){var be=ch($);T.call(be)}}var $=sE(u,w,l,0,null,!1,!1,"",oE);return l._reactRootContainer=$,l[Qa]=$.current,Ju(l.nodeType===8?l.parentNode:l),qo(),$}for(;C=l.lastChild;)l.removeChild(C);if(typeof w=="function"){var te=w;w=function(){var be=ch(ue);te.call(be)}}var ue=wy(l,0,!1,null,null,!1,!1,"",oE);return l._reactRootContainer=ue,l[Qa]=ue.current,Ju(l.nodeType===8?l.parentNode:l),qo(function(){lh(u,ue,g,w)}),ue}function fh(l,u,g,w,C){var T=g._reactRootContainer;if(T){var $=T;if(typeof C=="function"){var te=C;C=function(){var ue=ch($);te.call(ue)}}lh(u,$,l,C)}else $=o7(g,u,l,C,w);return ch($)}B_=function(l){switch(l.tag){case 3:var u=l.stateNode;if(u.current.memoizedState.isDehydrated){var g=Ze(u.pendingLanes);g!==0&&(Oo(u,g|1),Kr(u,ce()),(an&6)===0&&(dc=ce()+500,Ki()))}break;case 13:qo(function(){var w=ti(l,1);if(w!==null){var C=Pr();sa(w,l,1,C)}}),jy(l,1)}},Yv=function(l){if(l.tag===13){var u=ti(l,134217728);if(u!==null){var g=Pr();sa(u,l,134217728,g)}jy(l,134217728)}},q_=function(l){if(l.tag===13){var u=Ji(l),g=ti(l,u);if(g!==null){var w=Pr();sa(g,l,u,w)}jy(l,u)}},U_=function(){return fn},W_=function(l,u){var g=fn;try{return fn=l,u()}finally{fn=g}},Ue=function(l,u,g){switch(u){case"input":if(bt(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));Q(w),bt(w,C)}}}break;case"textarea":Pt(l,g);break;case"select":u=g.value,u!=null&&Ee(l,!!g.multiple,u,!1)}},Ge=my,Oe=qo;var l7={usingClientEntryPoint:!1,Events:[nd,Zl,Ep,De,Me,my]},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(!Ny(u))throw Error(n(200));return a7(l,u,null,g)},Gr.createRoot=function(l,u){if(!Ny(l))throw Error(n(299));var g=!1,w="",C=iE;return u!=null&&(u.unstable_strictMode===!0&&(g=!0),u.identifierPrefix!==void 0&&(w=u.identifierPrefix),u.onRecoverableError!==void 0&&(C=u.onRecoverableError)),u=wy(l,1,!1,null,null,g,!1,w,C),l[Qa]=u.current,Ju(l.nodeType===8?l.parentNode:l),new Sy(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(!Ny(l))throw Error(n(405));var w=g!=null&&g.hydratedSources||null,C=!1,T="",$=iE;if(g!=null&&(g.unstable_strictMode===!0&&(C=!0),g.identifierPrefix!==void 0&&(T=g.identifierPrefix),g.onRecoverableError!==void 0&&($=g.onRecoverableError)),u=sE(u,null,l,1,g??null,C,!1,T,$),l[Qa]=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[Qa]=null})}),!0):!1},Gr.unstable_batchedUpdates=my,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 mE;function lD(){if(mE)return Ay.exports;mE=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ay.exports=v7(),Ay.exports}var gE;function x7(){if(gE)return mh;gE=1;var e=lD();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 Py=0;function j7(){return Py=(Py+1)%Number.MAX_SAFE_INTEGER,Py.toString()}const Ty=new Map,vE=e=>{if(Ty.has(e))return;const t=setTimeout(()=>{Ty.delete(e),Dd({type:"REMOVE_TOAST",toastId:e})},w7);Ty.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?vE(n):e.toasts.forEach(r=>{vE(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 Ie({...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:Ie,dismiss:n=>Dd({type:"DISMISS_TOAST",toastId:n})}}var bu=lD();const cD=vn(bu);function qe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e?.(a),n===!1||!a.defaultPrevented)return t?.(a)}}function xE(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=xE(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():xE(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 jr(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 yE(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]=jr(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=yE(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=yE(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"],ut=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",bE,uD=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(uD),[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&&(bE=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),wE(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=bE)}},[h,v,n,f]),m.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),wE())},[h,f]),m.useEffect(()=>{const P=()=>x({});return document.addEventListener(yS,P),()=>document.removeEventListener(yS,P)},[]),s.jsx(ut.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",dD=m.forwardRef((e,t)=>{const n=m.useContext(uD),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(ut.div,{...e,ref:a})});dD.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(){fD(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&&fD(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 wE(){const e=new CustomEvent(yS);document.dispatchEvent(e)}function fD(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=dD,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?cD.createPortal(s.jsx(ut.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 pD=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(ut.span,{...e,ref:t,style:{...pD,...e.style}}));xg.displayName=t9;var n9=xg,DN="ToastProvider",[LN,r9,s9]=Ff("Toast"),[hD]=jr("Toast",[s9]),[a9,yg]=hD(DN),mD=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})})};mD.displayName=DN;var gD="ToastViewport",i9=["F8"],bS="toast.viewportPause",wS="toast.viewportResume",vD=m.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=i9,label:a="Notifications ({hotkey})",...i}=e,o=yg(gD,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);Ry(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"});Ry(y)}}),s.jsx(LN.Slot,{scope:n,children:s.jsx(ut.ol,{tabIndex:-1,...i,ref:v})}),j&&s.jsx(jS,{ref:h,onFocusFromOutsideViewport:()=>{const y=b({tabbingDirection:"backwards"});Ry(y)}})]})});vD.displayName=gD;var xD="ToastFocusProxy",jS=m.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...a}=e,i=yg(xD,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=xD;var zf="Toast",o9="toast.swipeStart",l9="toast.swipeMove",c9="toast.swipeCancel",u9="toast.swipeEnd",yD=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)})})})});yD.displayName=zf;var[d9,f9]=hD(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?_D(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(ut.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,Z=W?O(0,L):0,q=W?0:O(0,I),z=H.pointerType==="touch"?10:2,K={x:Z,y:q},J={originalEvent:H,delta:K};Y?(A.current=K,vh(l9,p,J,{discrete:!1})):jE(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};jE(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",bD=m.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(ut.div,{...r,ref:t})});bD.displayName=m9;var g9="ToastDescription",wD=m.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(ut.div,{...r,ref:t})});wD.displayName=g9;var jD="ToastAction",SD=m.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?s.jsx(CD,{altText:n,asChild:!0,children:s.jsx(FN,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${jD}\`. Expected non-empty \`string\`.`),null)});SD.displayName=jD;var ND="ToastClose",FN=m.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,a=f9(ND,n);return s.jsx(CD,{asChild:!0,children:s.jsx(ut.button,{type:"button",...r,ref:t,onClick:qe(e.onClick,a.onClose)})})});FN.displayName=ND;var CD=m.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...a}=e;return s.jsx(ut.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...a,ref:t})});function _D(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),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(..._D(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 jE=(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 Ry(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var b9=mD,AD=vD,kD=yD,ED=bD,PD=wD,TD=SD,RD=FN;function OD(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=OD(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=OD(e))&&(r&&(r+=" "),r+=t);return r}const SE=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,NE=Yt,Ol=(e,t)=>n=>{var r;if(t?.variants==null)return NE(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=SE(h)||SE(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 NE(e,o,d,n?.class,n?.className)};const w9=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),MD=(...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:MD("lucide",a),...c},[...o.map(([f,h])=>m.createElement(f,h)),...Array.isArray(i)?i:[i]]));const gt=(e,t)=>{const n=m.forwardRef(({className:r,...a},i)=>m.createElement(S9,{ref:i,iconNode:t,className:MD(`lucide-${w9(e)}`,r),...a}));return n.displayName=`${e}`,n};const ID=gt("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 $D=gt("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=gt("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const Fr=gt("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 DD=gt("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=gt("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=gt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const tn=gt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const zN=gt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const ma=gt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const Oc=gt("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);const Oy=gt("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 fi=gt("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const N9=gt("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=gt("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=gt("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const CE=gt("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);const va=gt("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const ss=gt("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 LD=gt("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 Mr=gt("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=gt("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=gt("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=gt("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 FD=gt("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=gt("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 zD=gt("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=gt("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 BD=gt("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=gt("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=gt("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=gt("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=gt("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 qD=gt("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=gt("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=gt("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=gt("ListPlus",[["path",{d:"M11 12H3",key:"51ecnj"}],["path",{d:"M16 6H3",key:"1wxfjs"}],["path",{d:"M16 18H3",key:"12xzn7"}],["path",{d:"M18 9v6",key:"1twb98"}],["path",{d:"M21 12h-6",key:"bt1uis"}]]);const wr=gt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const UD=gt("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=gt("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 WD=gt("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=gt("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=gt("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);const _S=gt("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=gt("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 _E=gt("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=gt("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 ga=gt("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const yi=gt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const BN=gt("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=gt("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=gt("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=gt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);const $9=gt("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=gt("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=gt("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=gt("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=gt("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=gt("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);const VD=gt("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=gt("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=gt("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=gt("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=gt("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 HD=gt("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=gt("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=gt("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(),KD(c,t)||B9(o)},getConflictingClassGroupIds:(o,c)=>{const d=n[o]||[];return c&&r[o]?[...d,...r[o]]:d}}},KD=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?KD(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},AE=/^\[(.+)\]$/,B9=e=>{if(AE.test(e)){const t=AE.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:kE(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,kE(t,i),n,r)})})},kE=(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)}}},GD="!",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(GD),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+GD: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=YD(t))&&(r&&(r+=" "),r+=n);return r}const YD=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=YD(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},XD=/^\[(?:([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)\(.+\)$/,ai=e=>Mc(e)||eW.has(e)||J9.test(e),ro=e=>wu(e,"length",pW),Mc=e=>!!e&&!Number.isNaN(Number(e)),My=e=>wu(e,"number",Mc),xd=e=>!!e&&Number.isInteger(Number(e)),iW=e=>e.endsWith("%")&&Mc(e.slice(0,-1)),Zt=e=>XD.test(e),so=e=>tW.test(e),oW=new Set(["length","size","percentage"]),lW=e=>wu(e,oW,QD),cW=e=>wu(e,"position",QD),uW=new Set(["image","url"]),dW=e=>wu(e,uW,mW),fW=e=>wu(e,"",hW),yd=()=>!0,wu=(e,t,n)=>{const r=XD.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),QD=()=>!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=()=>["",ai,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],Z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>[Mc,Zt];return{cacheSize:500,separator:":",theme:{colors:[yd],spacing:[ai,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":Z()}],"break-before":[{"break-before":Z()}],"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",My]}],"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,My]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ai,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",ai,ro]}],"underline-offset":[{"underline-offset":["auto",ai,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":[ai,Zt]}],"outline-w":[{outline:[ai,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":[ai,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:[ai,ro,My]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},vW=Z9(gW);function Te(...e){return vW(Yt(e))}function zn(e,t=""){return typeof e=="string"&&e.trim().length>0?e.trim():t}const xW=b9,ZD=m.forwardRef(({className:e,...t},n)=>s.jsx(AD,{ref:n,className:Te("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}));ZD.displayName=AD.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"}}),JD=m.forwardRef(({className:e,variant:t,...n},r)=>s.jsx(kD,{ref:r,className:Te(yW({variant:t}),e),...n}));JD.displayName=kD.displayName;const bW=m.forwardRef(({className:e,...t},n)=>s.jsx(TD,{ref:n,className:Te("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=TD.displayName;const e5=m.forwardRef(({className:e,...t},n)=>s.jsx(RD,{ref:n,className:Te("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"})}));e5.displayName=RD.displayName;const t5=m.forwardRef(({className:e,...t},n)=>s.jsx(ED,{ref:n,className:Te("text-sm font-semibold",e),...t}));t5.displayName=ED.displayName;const n5=m.forwardRef(({className:e,...t},n)=>s.jsx(PD,{ref:n,className:Te("text-sm opacity-90",e),...t}));n5.displayName=PD.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(JD,{...i,children:[s.jsxs("div",{className:"grid gap-1",children:[n&&s.jsx(t5,{children:n}),r&&s.jsx(n5,{children:r})]}),a,s.jsx(e5,{})]},t)}),s.jsx(ZD,{})]})}var EE=["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?EE.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&&EE.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",PE=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:Z,closeButtonAriaLabel:q="Close toast",pauseWhenPageIsHidden:z}=e,[K,J]=X.useState(null),[re,he]=X.useState(null),[oe,me]=X.useState(!1),[ie,ge]=X.useState(!1),[Re,Q]=X.useState(!1),[Ne,Fe]=X.useState(!1),[pt,ot]=X.useState(!1),[bt,wt]=X.useState(0),[et,_e]=X.useState(0),Ee=X.useRef(x.duration||H||PE),tt=X.useRef(null),ct=X.useRef(null),Pt=_===0,Xt=_+1<=S,kt=x.type,nn=x.dismissible!==!1,Jt=x.className||"",zt=x.descriptionClassName||"",Se=X.useMemo(()=>N.findIndex(Me=>Me.toastId===x.id)||0,[N,x.id]),Xe=X.useMemo(()=>{var Me;return(Me=x.closeButton)!=null?Me:R},[x.closeButton,R]),Qe=X.useMemo(()=>x.duration||H||PE,[x.duration,H]),At=X.useRef(0),Bt=X.useRef(0),de=X.useRef(0),Ke=X.useRef(null),[$e,se]=L.split("-"),we=X.useMemo(()=>N.reduce((Me,Ge,Oe)=>Oe>=Se?Me:Me+Ge.height,0),[N,Se]),Ue=MW(),B=x.invert||v,le=kt==="loading";Bt.current=X.useMemo(()=>Se*I+we,[Se,we]),X.useEffect(()=>{Ee.current=Qe},[Qe]),X.useEffect(()=>{me(!0)},[]),X.useEffect(()=>{let Me=ct.current;if(Me){let Ge=Me.getBoundingClientRect().height;return _e(Ge),y(Oe=>[{toastId:x.id,height:Ge,position:x.position},...Oe]),()=>y(Oe=>Oe.filter(V=>V.toastId!==x.id))}},[y,x.id]),X.useLayoutEffect(()=>{if(!oe)return;let Me=ct.current,Ge=Me.style.height;Me.style.height="auto";let Oe=Me.getBoundingClientRect().height;Me.style.height=Ge,_e(Oe),y(V=>V.find(ve=>ve.toastId===x.id)?V.map(ve=>ve.toastId===x.id?{...ve,height:Oe}:ve):[{toastId:x.id,height:Oe,position:x.position},...V])},[oe,x.title,x.description,y,x.id]);let fe=X.useCallback(()=>{ge(!0),wt(Bt.current),y(Me=>Me.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 Me;return k||b||z&&Ue?(()=>{if(de.current<At.current){let Ge=new Date().getTime()-At.current;Ee.current=Ee.current-Ge}de.current=new Date().getTime()})():Ee.current!==1/0&&(At.current=new Date().getTime(),Me=setTimeout(()=>{var Ge;(Ge=x.onAutoClose)==null||Ge.call(x,x),fe()},Ee.current)),()=>clearTimeout(Me)},[k,b,x,kt,z,Ue,fe]),X.useEffect(()=>{x.delete&&fe()},[fe,x.delete]);function De(){var Me,Ge,Oe;return Z!=null&&Z.loading?X.createElement("div",{className:aa(O?.loader,(Me=x?.classNames)==null?void 0:Me.loader,"sonner-loader"),"data-visible":kt==="loading"},Z.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,(Oe=x?.classNames)==null?void 0:Oe.loader),visible:kt==="loading"})}return X.createElement("li",{tabIndex:0,ref:ct,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":oe,"data-promise":!!x.promise,"data-swiped":pt,"data-removed":ie,"data-visible":Xt,"data-y-position":$e,"data-x-position":se,"data-index":_,"data-front":Pt,"data-swiping":Re,"data-dismissible":nn,"data-type":kt,"data-invert":B,"data-swipe-out":Ne,"data-swipe-direction":re,"data-expanded":!!(k||W&&oe),style:{"--index":_,"--toasts-before":_,"--z-index":A.length-_,"--offset":`${ie?bt:Bt.current}px`,"--initial-height":W?"auto":`${et}px`,...M,...x.style},onDragEnd:()=>{Q(!1),J(null),Ke.current=null},onPointerDown:Me=>{le||!nn||(tt.current=new Date,wt(Bt.current),Me.target.setPointerCapture(Me.pointerId),Me.target.tagName!=="BUTTON"&&(Q(!0),Ke.current={x:Me.clientX,y:Me.clientY}))},onPointerUp:()=>{var Me,Ge,Oe,V;if(Ne||!nn)return;Ke.current=null;let ve=Number(((Me=ct.current)==null?void 0:Me.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ae=Number(((Ge=ct.current)==null?void 0:Ge.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Je=new Date().getTime()-((Oe=tt.current)==null?void 0:Oe.getTime()),ne=K==="x"?ve:Ae,Le=Math.abs(ne)/Je;if(Math.abs(ne)>=KW||Le>.11){wt(Bt.current),(V=x.onDismiss)==null||V.call(x,x),he(K==="x"?ve>0?"right":"left":Ae>0?"down":"up"),fe(),Fe(!0),ot(!1);return}Q(!1),J(null)},onPointerMove:Me=>{var Ge,Oe,V,ve;if(!Ke.current||!nn||((Ge=window.getSelection())==null?void 0:Ge.toString().length)>0)return;let Ae=Me.clientY-Ke.current.y,Je=Me.clientX-Ke.current.x,ne=(Oe=e.swipeDirections)!=null?Oe:YW(L);!K&&(Math.abs(Je)>1||Math.abs(Ae)>1)&&J(Math.abs(Je)>Math.abs(Ae)?"x":"y");let Le={x:0,y:0};K==="y"?(ne.includes("top")||ne.includes("bottom"))&&(ne.includes("top")&&Ae<0||ne.includes("bottom")&&Ae>0)&&(Le.y=Ae):K==="x"&&(ne.includes("left")||ne.includes("right"))&&(ne.includes("left")&&Je<0||ne.includes("right")&&Je>0)&&(Le.x=Je),(Math.abs(Le.x)>0||Math.abs(Le.y)>0)&&ot(!0),(V=ct.current)==null||V.style.setProperty("--swipe-amount-x",`${Le.x}px`),(ve=ct.current)==null||ve.style.setProperty("--swipe-amount-y",`${Le.y}px`)}},Xe&&!x.jsx?X.createElement("button",{"aria-label":q,"data-disabled":le,"data-close-button":!0,onClick:le||!nn?()=>{}:()=>{var Me;fe(),(Me=x.onDismiss)==null||Me.call(x,x)},className:aa(O?.closeButton,(a=x?.classNames)==null?void 0:a.closeButton)},(i=Z?.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||De():null,x.type!=="loading"?x.icon||Z?.[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:Me=>{var Ge,Oe;xh(x.cancel)&&nn&&((Oe=(Ge=x.cancel).onClick)==null||Oe.call(Ge,Me),fe())},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:Me=>{var Ge,Oe;xh(x.action)&&((Oe=(Ge=x.action).onClick)==null||Oe.call(Ge,Me),!Me.defaultPrevented&&fe())},className:aa(O?.actionButton,(p=x?.classNames)==null?void 0:p.actionButton)},x.action.label):null))};function TE(){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=TE(),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),Z=X.useRef(!1),q=X.useCallback(z=>{P(K=>{var J;return(J=K.find(re=>re.id===z.id))!=null&&J.delete||Xr.dismiss(z.id),K.filter(({id:re})=>re!==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(()=>{cD.flushSync(()=>{P(K=>{let J=K.findIndex(re=>re.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(re){console.error(re)}})}},[h]),X.useEffect(()=>{E.length<=1&&F(!1)},[E]),X.useEffect(()=>{let z=K=>{var J,re;a.every(he=>K[he]||K.code===he)&&(F(!0),(J=Y.current)==null||J.focus()),K.code==="Escape"&&(document.activeElement===Y.current||(re=Y.current)!=null&&re.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,Z.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[re,he]=z.split("-");return E.length?X.createElement("ol",{key:z,dir:y==="auto"?TE():y,tabIndex:-1,ref:Y,className:c,"data-sonner-toaster":!0,"data-theme":L,"data-y-position":re,"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:oe=>{Z.current&&!oe.currentTarget.contains(oe.relatedTarget)&&(Z.current=!1,O.current&&(O.current.focus({preventScroll:!0}),O.current=null))},onFocus:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||Z.current||(Z.current=!0,O.current=oe.relatedTarget)},onMouseEnter:()=>F(!0),onMouseMove:()=>F(!0),onMouseLeave:()=>{G||F(!1)},onDragEnd:()=>F(!1),onPointerDown:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||H(!0)},onPointerUp:()=>H(!1)},E.filter(oe=>!oe.position&&K===0||oe.position===z).map((oe,me)=>{var ie,ge;return X.createElement(XW,{key:oe.id,icons:_,index:me,toast:oe,defaultRichColors:p,duration:(ie=b?.duration)!=null?ie: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(Re=>Re.position==oe.position),heights:M.filter(Re=>Re.position==oe.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,$a=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 Ma(e){return aV.has(wi(e))?"y":"x"}function KN(e){return VN(Ma(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 RE=["left","right"],OE=["right","left"],lV=["top","bottom"],cV=["bottom","top"];function uV(e,t,n){switch(e){case"top":case"bottom":return n?t?OE:RE:t?RE:OE;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 r5(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 ME(e,t,n){let{reference:r,floating:a}=e;const i=Ma(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=r5(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}=ME(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}=ME(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=r5(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=Ma(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!==Ma(L):!1)||D.every(W=>Ma(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=Ma(W.placement);return O===N||O==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(O=>O>0).reduce((O,Z)=>O+Z,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 IE(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function $E(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=IE(o,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:$E(c)}}}case"escaped":{const o=await r.detectOverflow(t,{...i,altBoundary:!0}),c=IE(o,n.floating);return{data:{escapedOffsets:c,escaped:$E(c)}}}default:return{}}}}},s5=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=Ma(n)==="y",f=s5.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=Ma(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=Ma(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=s5.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=Ma(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 a5(e)?(e.nodeName||"").toLowerCase():"#document"}function ys(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Wa(e){var t;return(t=(a5(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function a5(e){return jg()?e instanceof Node||e instanceof ys(e).Node:!1}function xa(e){return jg()?e instanceof Element||e instanceof ys(e).Element:!1}function za(e){return jg()?e instanceof HTMLElement||e instanceof ys(e).HTMLElement:!1}function DE(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}=ya(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=xa(e)?ya(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(;za(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 ya(e){return ys(e).getComputedStyle(e)}function Ng(e){return xa(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||DE(e)&&e.host||Wa(e);return DE(t)?t.host:t}function i5(e){const t=xo(e);return Wc(t)?e.ownerDocument?e.ownerDocument.body:e.body:za(t)&&Bf(t)?t:i5(t)}function Kd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=i5(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 o5(e){const t=ya(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=za(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 xa(e)?e:e.contextElement}function Ic(e){const t=XN(e);if(!za(t))return $a(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=o5(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=$a(0);function l5(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=$a(1);t&&(r?xa(r)&&(o=Ic(r)):o=Ic(e));const c=OV(i,n,r)?l5(i):$a(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&&xa(r)?ys(r):r;let j=v,b=RS(j);for(;b&&r&&x!==j;){const y=Ic(b),S=b.getBoundingClientRect(),N=ya(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(Wa(e)).left+n}function c5(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=Wa(r),c=t?Sg(t.floating):!1;if(r===o||c&&i)return n;let d={scrollLeft:0,scrollTop:0},f=$a(1);const h=$a(0),p=za(r);if((p||!p&&!i)&&((Su(r)!=="body"||Bf(o))&&(d=Ng(r)),za(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?c5(o,d):$a(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=Wa(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 ya(r).direction==="rtl"&&(o+=ms(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:o,y:c}}const LE=25;function DV(e,t){const n=ys(e),r=Wa(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<=LE&&(i-=j)}else f<=LE&&(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=za(e)?Ic(e):$a(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 FE(e,t,n){let r;if(t==="viewport")r=DV(e,n);else if(t==="document")r=$V(Wa(e));else if(xa(t))r=FV(t,n);else{const a=l5(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Jh(r)}function u5(e,t){const n=xo(e);return n===t||!xa(n)||Wc(n)?!1:ya(n).position==="fixed"||u5(n,t)}function zV(e,t){const n=t.get(e);if(n)return n;let r=Kd(e,[],!1).filter(c=>xa(c)&&Su(c)!=="body"),a=null;const i=ya(e).position==="fixed";let o=i?xo(e):e;for(;xa(o)&&!Wc(o);){const c=ya(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&&u5(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=FE(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},FE(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}=o5(e);return{width:t,height:n}}function UV(e,t,n){const r=za(t),a=Wa(t),i=n==="fixed",o=ml(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const d=$a(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?c5(a,c):$a(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 Iy(e){return ya(e).position==="static"}function zE(e,t){if(!za(e)||ya(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Wa(e)===n&&(n=n.ownerDocument.body),n}function d5(e,t){const n=ys(e);if(Sg(e))return n;if(!za(e)){let a=xo(e);for(;a&&!Wc(a);){if(xa(a)&&!Iy(a))return a;a=xo(a)}return n}let r=zE(e,t);for(;r&&CV(r)&&Iy(r);)r=zE(r,t);return r&&Wc(r)&&Iy(r)&&!GN(r)?n:r||PV(e)||n}const WV=async function(e){const t=this.getOffsetParent||d5,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 ya(e).direction==="rtl"}const HV={convertOffsetParentRelativeRectToViewportRelativeRect:MV,getDocumentElement:Wa,getClippingRect:BV,getOffsetParent:d5,getElementRects:WV,getClientRects:IV,getDimensions:qV,getScale:Ic,isElement:xa,isRTL:VV};function f5(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=Wa(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&&!f5(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&&!f5(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,BE=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 p5(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qE(e,t){const n=p5(e);return Math.round(t*n)/n}function $y(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=$y(d),U=$y(a),F=$y(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 Z={...O,isPositioned:F.current!==!1};H.current&&!em(R.current,Z)&&(R.current=Z,bu.flushSync(()=>{p(Z)}))})},[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=qE(I.floating,h.x),Z=qE(I.floating,h.y);return c?{...W,transform:"translate("+O+"px, "+Z+"px)",...p5(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:O,top:Z}},[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?BE({element:r.current,padding:a}).fn(n):{}:r?BE({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",h5=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return s.jsx(ut.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"})})});h5.displayName=pH;var hH=h5;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",[m5,jo]=jr(QN),[mH,g5]=m5(QN),v5=e=>{const{__scopePopper:t,children:n}=e,[r,a]=m.useState(null);return s.jsx(mH,{scope:t,anchor:r,onAnchorChange:a,children:n})};v5.displayName=QN;var x5="PopperAnchor",y5=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=g5(x5,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(ut.div,{...a,ref:c})});y5.displayName=x5;var ZN="PopperContent",[gH,vH]=m5(ZN),b5=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=g5(ZN,n),[S,N]=m.useState(null),_=Mt(t,oe=>N(oe)),[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:(...oe)=>GV(...oe,{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:oe,rects:me,availableWidth:ie,availableHeight:ge})=>{const{width:Re,height:Q}=me.reference,Ne=oe.floating.style;Ne.setProperty("--radix-popper-available-width",`${ie}px`),Ne.setProperty("--radix-popper-available-height",`${ge}px`),Ne.setProperty("--radix-popper-anchor-width",`${Re}px`),Ne.setProperty("--radix-popper-anchor-height",`${Q}px`)}}),A&&fH({element:A,padding:c}),bH({arrowWidth:P,arrowHeight:R}),v&&dH({strategy:"referenceHidden",...G})]}),[O,Z]=S5(I),q=Gn(j);ir(()=>{Y&&q?.()},[Y,q]);const z=W.arrow?.x,K=W.arrow?.y,J=W.arrow?.centerOffset!==0,[re,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:re,"--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(ut.div,{"data-side":O,"data-align":Z,...b,ref:_,style:{...b.style,animation:Y?void 0:"none"}})})})});b5.displayName=ZN;var w5="PopperArrow",xH={top:"bottom",right:"left",bottom:"top",left:"right"},j5=m.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=vH(w5,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"}})})});j5.displayName=w5;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]=S5(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 S5(e){const[t,n="center"]=e.split("-");return[t,n]}var Ag=v5,qf=y5,kg=b5,Eg=j5,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]=jr("Tooltip",[jo]),Tg=jo(),N5="TooltipProvider",SH=700,OS="tooltip.open",[NH,JN]=Pg(N5),C5=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})};C5.displayName=N5;var Gd="Tooltip",[CH,Uf]=Pg(Gd),_5=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})})};_5.displayName=Gd;var MS="TooltipTrigger",A5=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(ut.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)})})});A5.displayName=MS;var eC="TooltipPortal",[_H,AH]=Pg(eC,{forceMount:void 0}),k5=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})})})};k5.displayName=eC;var Vc="TooltipContent",E5=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(P5,{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(P5,{...e,ref:i})}),[EH,PH]=Pg(Gd,{isInside:!1}),TH=jH("TooltipContent"),P5=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})})]})})});E5.displayName=Vc;var T5="TooltipArrow",RH=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Tg(n);return PH(T5,n).isInside?null:s.jsx(Eg,{...a,...r,ref:t})});RH.displayName=T5;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=C5,zH=_5,BH=A5,qH=k5,R5=E5;const ji=FH,Si=zH,Ni=BH,Ba=m.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(qH,{children:s.jsx(R5,{ref:r,sideOffset:t,className:Te("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})}));Ba.displayName=R5.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"}},O5=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 UE(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 WE(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 M5(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=VE(e)&&VE(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=M5(v,x,n+1);d[p]=j,j===v&&f++}return i===c&&f===i?e:d}function VE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function DS(e){if(!HE(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!HE(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function HE(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?M5(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 I5(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 $5=(()=>{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 Rr=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 D5(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 L5(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=()=>O5.isFocused()&&(e.networkMode==="always"||tm.isOnline())&&e.canRun(),h=()=>D5(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??($5.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 F5=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??($5.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=I5(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:KE,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:KE(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 KE(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 F5{#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=YE(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=YE(this.options);t.data!==void 0&&(this.setState(GE(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=I5(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=L5({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,...GE(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),Rr.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:D5(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function GE(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function YE(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 F5{#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=L5({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),Rr.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(){Rr.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=>WE(t,n))}findAll(e={}){return this.getAll().filter(t=>WE(e,t))}notify(e){Rr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Rr.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(){Rr.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=>UE(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>UE(e,n)):t}notify(e){Rr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Rr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Rr.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=O5.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 Rr.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;Rr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Rr.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Rr.batch(()=>this.#e.findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(la).catch(la)}invalidateQueries(e,t={}){return Rr.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=Rr.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 XE="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 QE(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 _=QE(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 _=QE(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(XE,p),d=y,()=>{a.removeEventListener(XE,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 ZE;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(ZE||(ZE={}));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=z5(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 z5(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+'".')),z5(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 B5(i.path))a(i,o,d)}),t}function B5(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=B5(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,JE=e=>e==="*";function RK(e,t){let n=e.split("/"),r=n.length;return n.some(JE)&&(r+=TK),t&&(r+=kK),n.filter(a=>!JE(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=q5(n),rC(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?i=eP(n.substring(1),"/"):i=eP(n,t)}else i=t;return{pathname:i,search:qK(r),hash:UK(a)}}function eP(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 Dy(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("?"),Dy("?","pathname","search",a)),Bn(!a.pathname||!a.pathname.includes("#"),Dy("#","pathname","hash",a)),Bn(!a.search||!a.search.includes("#"),Dy("#","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 q5=e=>e.replace(/\/\/+/g,"/"),uo=e=>q5(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 U5=["post","put","patch","delete"];new Set(U5);const VK=["get",...U5];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),W5=m.createContext(null),Ei=m.createContext(null),Mg=m.createContext(null),Va=m.createContext({outlet:null,matches:[],isDataRoute:!1}),V5=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 ja(){return Cu()||Bn(!1),m.useContext(Mg).location}function H5(e){m.useContext(Ei).static||m.useLayoutEffect(e)}function Xs(){let{isDataRoute:e}=m.useContext(Va);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(Va),{pathname:i}=ja(),o=JSON.stringify(sC(a,n.v7_relativeSplatPath)),c=m.useRef(!1);return H5(()=>{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(Va).outlet;return t&&m.createElement(GK.Provider,{value:e},t)}function Ml(){let{matches:e}=m.useContext(Va),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(Va),{pathname:i}=ja(),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(Va),o=i[i.length-1],c=o?o.params:{};o&&o.pathname;let d=o?o.pathnameBase:"/";o&&o.route;let f=ja(),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(Va.Provider,{value:this.props.routeContext},m.createElement(V5.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(Va.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 K5=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(K5||{}),G5=(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})(G5||{});function rG(e){let t=m.useContext(Og);return t||Bn(!1),t}function sG(e){let t=m.useContext(W5);return t||Bn(!1),t}function aG(e){let t=m.useContext(Va);return t||Bn(!1),t}function Y5(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(V5),n=sG(),r=Y5();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function oG(){let{router:e}=rG(K5.UseNavigateStable),t=Y5(G5.UseNavigateStable),n=m.useRef(!1);return H5(()=>{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 tP={};function lG(e,t,n){tP[e]||(tP[e]=!0)}function cG(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function X5(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(Va),{pathname:d}=ja(),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 nP(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 Q5(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",rP=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&&rP?rP(()=>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=Q5(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=Q5(t,gG),v=Ig(d,{relative:p.relative}),x=ja(),j=m.useContext(W5),{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 sP;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(sP||(sP={}));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=ja(),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=ja(),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 Z5(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;Z5(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(Z5(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 Ly=768;function MG(){const[e,t]=m.useState(void 0);return m.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Ly-1}px)`),r=()=>{t(window.innerWidth<Ly)};return n.addEventListener("change",r),t(window.innerWidth<Ly),()=>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"}}),ee=m.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},i)=>{const o=r?So:"button";return s.jsx(o,{className:Te(iC({variant:t,size:n,className:e})),ref:i,...a})});ee.displayName="Button";const Et=m.forwardRef(({className:e,type:t,...n},r)=>s.jsx("input",{type:t,className:Te("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",aP="horizontal",LG=["horizontal","vertical"],J5=m.forwardRef((e,t)=>{const{decorative:n,orientation:r=aP,...a}=e,i=FG(r)?r:aP,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})});J5.displayName=DG;function FG(e){return LG.includes(e)}var e3=J5;const t3=m.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},a)=>s.jsx(e3,{ref:a,decorative:n,orientation:t,className:Te("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));t3.displayName=e3.displayName;var Fy="focusScope.autoFocusOnMount",zy="focusScope.autoFocusOnUnmount",iP={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){lP.add(x);const b=document.activeElement;if(!c.contains(b)){const S=new CustomEvent(Fy,iP);c.addEventListener(Fy,f),c.dispatchEvent(S),S.defaultPrevented||(BG(HG(n3(c)),{select:!0}),document.activeElement===b&&io(c))}return()=>{c.removeEventListener(Fy,f),setTimeout(()=>{const S=new CustomEvent(zy,iP);c.addEventListener(zy,h),c.dispatchEvent(S),S.defaultPrevented||io(b??document.body,{select:!0}),c.removeEventListener(zy,h),lP.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(ut.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=n3(e),n=oP(t,e),r=oP(t.reverse(),e);return[n,r]}function n3(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 oP(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 lP=VG();function VG(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=cP(e,t),e.unshift(t)},remove(t){e=cP(e,t),e[0]?.resume()}}}function cP(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 By=0;function Dg(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??uP()),document.body.insertAdjacentElement("beforeend",e[1]??uP()),By++,()=>{By===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),By--}},[])}function uP(){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 Ta=function(){return Ta=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},Ta.apply(this,arguments)};function r3(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 qy(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,dP=new WeakMap;function ZG(e,t){var n=XG(null,function(r){return e.forEach(function(a){return qy(a,r)})});return QG(function(){var r=dP.get(n);if(r){var a=new Set(r),i=new Set(e),o=n.current;a.forEach(function(c){i.has(c)||qy(c,null)}),i.forEach(function(c){a.has(c)||qy(c,o)})}dP.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=Ta({async:!0,ssr:!1},e),t}var s3=function(e){var t=e.sideCar,n=r3(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,Ta({},n))};s3.isSideCarExport=!0;function nY(e,t){return e.useMedium(t),s3}var a3=tY(),Uy=function(){},Lg=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:Uy,onWheelCapture:Uy,onTouchMoveCapture:Uy}),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=r3(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=v,E=ZG([n,t]),P=Ta(Ta({},A),a);return m.createElement(m.Fragment,null,h&&m.createElement(k,{sideCar:a3,removeScrollBar:f,shards:p,noRelative:x,noIsolation:j,inert:b,setCallbacks:i,allowPinchZoom:!!y,lockRef:n,gapMode:_}),o?m.cloneElement(m.Children.only(c),Ta(Ta({},P),{ref:E})):m.createElement(N,Ta({},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])}},i3=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},Wy=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[Wy(n),Wy(r),Wy(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=i3(),$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
|
-
`)},fP=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,(fP()+1).toString()),function(){var e=fP()-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"},o3=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 o3(e,"overflowY")},xY=function(e){return o3(e,"overflowX")},pP=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=l3(e,r);if(a){var i=c3(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]},l3=function(e,t){return e==="v"?vY(t):xY(t)},c3=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=c3(e,c),j=x[0],b=x[1],y=x[2],S=b-y-i*j;(j||S)&&l3(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]},hP=function(e){return[e.deltaX,e.deltaY]},mP=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(i3)[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(mP),!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=pP(P,E);if(!U)return!0;if(U?k=P:(k=P==="v"?"h":"v",U=pP(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?hP(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(mP).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,hP(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(a3,_Y);var Vf=m.forwardRef(function(e,t){return m.createElement(Lg,Ta({},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={},Vy=0,u3=function(e){return e&&(e.host||u3(e.parentNode))},PY=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=u3(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(),Vy++,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)}),Vy--,Vy||(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",[d3,f3]=jr(zg),[LY,Sa]=d3(zg),p3=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})};p3.displayName=zg;var h3="DialogTrigger",m3=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Sa(h3,n),i=Mt(t,a.triggerRef);return s.jsx(ut.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)})});m3.displayName=h3;var oC="DialogPortal",[FY,g3]=d3(oC,{forceMount:void 0}),v3=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=Sa(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})}))})};v3.displayName=oC;var am="DialogOverlay",x3=m.forwardRef((e,t)=>{const n=g3(am,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Sa(am,e.__scopeDialog);return i.modal?s.jsx(Zn,{present:r||i.open,children:s.jsx(BY,{...a,ref:t})}):null});x3.displayName=am;var zY=RY("DialogOverlay.RemoveScroll"),BY=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Sa(am,n);return s.jsx(Vf,{as:zY,allowPinchZoom:!0,shards:[a.contentRef],children:s.jsx(ut.div,{"data-state":cC(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),gl="DialogContent",y3=m.forwardRef((e,t)=>{const n=g3(gl,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Sa(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})})});y3.displayName=gl;var qY=m.forwardRef((e,t)=>{const n=Sa(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(b3,{...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=Sa(gl,e.__scopeDialog),r=m.useRef(!1),a=m.useRef(!1);return s.jsx(b3,{...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()}})}),b3=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,c=Sa(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",w3=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Sa(lC,n);return s.jsx(ut.h2,{id:a.titleId,...r,ref:t})});w3.displayName=lC;var j3="DialogDescription",S3=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Sa(j3,n);return s.jsx(ut.p,{id:a.descriptionId,...r,ref:t})});S3.displayName=j3;var N3="DialogClose",C3=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Sa(N3,n);return s.jsx(ut.button,{type:"button",...r,ref:t,onClick:qe(e.onClick,()=>a.onOpenChange(!1))})});C3.displayName=N3;function cC(e){return e?"open":"closed"}var _3="DialogTitleWarning",[WY,A3]=C7(_3,{contentName:gl,titleName:lC,docsSlug:"dialog"}),VY=({titleId:e})=>{const t=A3(_3),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 {${A3(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=p3,GY=m3,qg=v3,_u=x3,Au=y3,Hf=w3,Kf=S3,Ug=C3;const k3=Bg,YY=qg,E3=m.forwardRef(({className:e,...t},n)=>s.jsx(_u,{className:Te("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}));E3.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(E3,{}),s.jsxs(Au,{ref:a,className:Te(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 P3=({className:e,...t})=>s.jsx("div",{className:Te("flex flex-col space-y-2 text-center sm:text-left",e),...t});P3.displayName="SheetHeader";const T3=m.forwardRef(({className:e,...t},n)=>s.jsx(Hf,{ref:n,className:Te("text-lg font-semibold text-foreground",e),...t}));T3.displayName=Hf.displayName;const QY=m.forwardRef(({className:e,...t},n)=>s.jsx(Kf,{ref:n,className:Te("text-sm text-muted-foreground",e),...t}));QY.displayName=Kf.displayName;function gP({className:e,...t}){return s.jsx("div",{className:Te("animate-pulse rounded-md bg-muted",e),...t})}const ZY="sidebar:state",JY=3600*24*7,eX="16rem",tX="18rem",nX="3rem",rX="b",R3=m.createContext(null);function Gf(){const e=m.useContext(R3);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const O3=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(R3.Provider,{value:S,children:s.jsx(ji,{delayDuration:0,children:s.jsx("div",{style:{"--sidebar-width":eX,"--sidebar-width-icon":nX,...a},className:Te("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",r),ref:c,...o,children:i})})})});O3.displayName="SidebarProvider";const M3=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:Te("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",r),ref:o,...i,children:a}):c?s.jsx(k3,{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:Te("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:Te("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})})]})});M3.displayName="Sidebar";const I3=m.forwardRef(({className:e,onClick:t,...n},r)=>{const{toggleSidebar:a}=Gf();return s.jsxs(ee,{ref:r,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:Te("h-7 w-7",e),onClick:i=>{t?.(i),a()},...n,children:[s.jsx(M9,{}),s.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});I3.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:Te("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:Te("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:Te("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));iX.displayName="SidebarInput";const $3=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"header",className:Te("flex flex-col gap-2 p-2",e),...t}));$3.displayName="SidebarHeader";const D3=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"footer",className:Te("flex flex-col gap-2 p-2",e),...t}));D3.displayName="SidebarFooter";const WS=m.forwardRef(({className:e,...t},n)=>s.jsx(t3,{ref:n,"data-sidebar":"separator",className:Te("mx-2 w-auto bg-sidebar-border",e),...t}));WS.displayName="SidebarSeparator";const L3=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"content",className:Te("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));L3.displayName="SidebarContent";const F3=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"group",className:Te("relative flex w-full min-w-0 flex-col p-2",e),...t}));F3.displayName="SidebarGroup";const z3=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:Te("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})});z3.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:Te("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 B3=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"group-content",className:Te("w-full text-sm",e),...t}));B3.displayName="SidebarGroupContent";const q3=m.forwardRef(({className:e,...t},n)=>s.jsx("ul",{ref:n,"data-sidebar":"menu",className:Te("flex w-full min-w-0 flex-col gap-1",e),...t}));q3.displayName="SidebarMenu";const U3=m.forwardRef(({className:e,...t},n)=>s.jsx("li",{ref:n,"data-sidebar":"menu-item",className:Te("group/menu-item relative",e),...t}));U3.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"}}),W3=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:Te(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(Ba,{side:"right",align:"center",hidden:h!=="collapsed"||f,...a})]})):p});W3.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:Te("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:Te("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:Te("flex h-8 items-center gap-2 rounded-md px-2",e),...n,children:[t&&s.jsx(gP,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),s.jsx(gP,{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:Te("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:Te("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 V3=m.forwardRef(({className:e,activeClassName:t,pendingClassName:n,to:r,...a},i)=>s.jsx(SG,{ref:i,to:r,className:({isActive:o,isPending:c})=>Te(e,o&&t,c&&n),...a}));V3.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:qD}]},{title:"Lab",items:[{title:"MCP Evaluations",url:"/mcp-evaluations",icon:zD},{title:"Analyze MCP",url:"/tool-analysis",icon:UD},{title:"OAuth Debugger",url:"/oauth-debugger",icon:D9}]},{title:"Libraries",items:[{title:"Test Cases",url:"/libraries/test-cases",icon:FD},{title:"MCP servers",url:"/libraries/servers",icon:LD},{title:"Agents",url:"/libraries/agents",icon:Fr}]},{title:"Execution",items:[{title:"Run Evaluation",url:"/run",icon:ga},{title:"Evaluation Results",url:"/results",icon:Bc},{title:"Compare Evaluations",url:"/compare",icon:BD},{title:"MCP Analysis Results",url:"/tool-analysis-results",icon:WD},{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=ja(),i=m.useMemo(()=>gX,[]);return s.jsxs(M3,{collapsible:"icon",children:[s.jsx($3,{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(L3,{children:i.map((o,c)=>s.jsxs("div",{children:[c>0&&!r&&s.jsx(WS,{className:"my-1.5"}),s.jsxs(F3,{className:r?"px-2":"px-3 py-2",children:[!r&&s.jsx(z3,{className:"px-1 pb-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-muted-foreground/90",children:o.title}),s.jsx(B3,{children:s.jsx(q3,{children:o.items.map(d=>s.jsx(U3,{children:s.jsx(W3,{asChild:!0,isActive:d.url==="/"?a.pathname==="/":d.url==="/settings"?a.pathname==="/settings":a.pathname.startsWith(d.url),tooltip:d.title,children:s.jsxs(V3,{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(D3,{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 H3=m.forwardRef(({...e},t)=>s.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));H3.displayName="Breadcrumb";const K3=m.forwardRef(({className:e,...t},n)=>s.jsx("ol",{ref:n,className:Te("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));K3.displayName="BreadcrumbList";const G3=m.forwardRef(({className:e,...t},n)=>s.jsx("li",{ref:n,className:Te("inline-flex items-center gap-1.5",e),...t}));G3.displayName="BreadcrumbItem";const Y3=m.forwardRef(({asChild:e,className:t,...n},r)=>{const a=e?So:"a";return s.jsx(a,{ref:r,className:Te("transition-colors hover:text-foreground",t),...n})});Y3.displayName="BreadcrumbLink";const X3=m.forwardRef(({className:e,...t},n)=>s.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:Te("font-normal text-foreground",e),...t}));X3.displayName="BreadcrumbPage";const Q3=({children:e,className:t,...n})=>s.jsx("li",{role:"presentation","aria-hidden":"true",className:Te("[&>svg]:size-3.5",t),...n,children:e??s.jsx(zN,{})});Q3.displayName="BreadcrumbSeparator";function Ra(){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 li(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=Ra();for(const n of e)jc(t,n);return li(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 Z3(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 vP(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=vP(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=vP(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 xP(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 Z3(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=>Z3(r,r.serverIds.length>0?r.serverIds.map(a=>({ref:a})):void 0))}}function TX(e,t){if(e)return`${e}::${t??""}`}function Hy(e){return e.type==="text"}function J3(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 eL(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:yP(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(Hy).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(Hy).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:yP(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(Hy).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 yP(e){try{return JSON.stringify(e)}catch{return String(e)}}function bP(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 Ky(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 tL(e){const t=Ra(),n=Ra(),r=new Map;if(!e)return{assistant:null,tool:null,perTool:{}};for(const i of e.messages??[]){if(i.role!=="assistant")continue;bP(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)??Ra();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}bP(n,i.usage);const d=Ky(i.usage?.input_tokens,o.length),f=Ky(i.usage?.output_tokens,o.length),h=Ky(i.usage?.total_tokens,o.length);for(let p=0;p<o.length;p+=1){const v=o[p].name,x=r.get(v)??Ra(),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=li(o);c&&(a[i]=c)}return{assistant:li(t),tool:li(n),perTool:a}}function nL(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 wP(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],_=tL(N);return{runIndex:y.run_index,passed:y.pass,error:y.error,toolCalls:J3(y,N),assistantTokenUsage:_.assistant,toolTokenUsage:_.tool,toolTokenUsageByTool:_.perTool,finalAnswer:y.final_text,conversation:eL(N),duration:nL(y,N),extractedValues:Object.fromEntries(Object.entries(y.extracted).map(([A,k])=>[A,String(k??"")])),failureReasons:y.failures,checkResults:y.check_results}}),h=Ra(),p=Ra(),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)??Ra();jc(_,N),v.set(S,_)}}const x={};for(const[y,S]of Array.from(v.entries()).sort((N,_)=>N[0].localeCompare(_[0]))){const N=li(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:li(h),toolTokenUsage:li(p),toolTokenUsageByTool:x}}),a=Ra(),i=Ra();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:li(a),toolTokenUsage:li(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=tL(t??void 0);return{runIndex:e.run_index,passed:e.pass,error:e.error,toolCalls:J3(e,t??void 0),assistantTokenUsage:n.assistant,toolTokenUsage:n.tool,toolTokenUsageByTool:n.perTool,finalAnswer:e.final_text,conversation:eL(t??void 0),duration:nL(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 ci=OX();class dC extends Error{constructor(t,n){super(n),this.status=t,this.name="ApiError"}status}async function Ct(e,t){const n=await fetch(`${ci}${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(`${ci}${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 jP(e,t){const n=new EventSource(`${ci}${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(`${ci}${r}`,{method:"GET",cache:"no-store",headers:{accept:"application/json"}}).then(d=>{(d.status===404||d.status===410)&&o()}).catch(()=>{})}},()=>o()}function Gy(e,t,n){if(typeof n!="number"||!Number.isFinite(n))return;const r=Math.floor(n);r<=0||e.set(t,String(r))}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))}const lt={health:()=>Ct("/api/health"),getSettings:()=>Ct("/api/settings"),updateSettings:e=>Ct("/api/settings",{method:"PUT",body:JSON.stringify(e)}),listConfigs:()=>Ct("/api/evals"),createConfig:(e,t)=>Ct("/api/evals",{method:"POST",body:JSON.stringify({fileName:e,config:t})}),updateConfig:(e,t,n)=>Ct(`/api/evals/${e}`,{method:"PUT",body:JSON.stringify({config:t,fileName:n})}),deleteConfig:e=>Ct(`/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()),Gy(t,"limit",e?.limit),Yy(t,"offset",e?.offset);const n=t.size>0?`?${t.toString()}`:"";return Ct(`/api/runs${n}`)},getLatestPassRatesByConfigIds:e=>Ct("/api/runs/latest-pass-rates",{method:"POST",body:JSON.stringify(e)}).then(t=>t.byConfigId),listMarkdownReports:e=>{const t=new URLSearchParams;Gy(t,"limit",e?.limit),Yy(t,"offset",e?.offset);const n=t.size>0?`?${t.toString()}`:"";return Ct(`/api/markdown-reports${n}`)},listToolAnalysisServers:()=>Ct("/api/tool-analysis-results/servers").then(e=>e.data),getMarkdownReport:e=>Ct(`/api/markdown-reports/content?path=${encodeURIComponent(e)}`),getMarkdownReportById:e=>Ct(`/api/markdown-reports/${encodeURIComponent(e)}`),deleteMarkdownReport:e=>Ct(`/api/markdown-reports?path=${encodeURIComponent(e)}`,{method:"DELETE"}).then(()=>{}),getRun:e=>Ct(`/api/runs/${e}`),deleteRun:e=>Ct(`/api/runs/${e}`,{method:"DELETE"}),updateRunNote:(e,t)=>Ct(`/api/runs/${encodeURIComponent(e)}/note`,{method:"PATCH",body:JSON.stringify({runNote:t??""})}).then(()=>{}),getRunTrace:e=>Ct(`/api/runs/${e}/trace`),applyResultAssistantReport:e=>Ct(`/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)=>Ct("/api/result-assistant/sessions",{method:"POST",body:JSON.stringify(e),signal:t}),getResultAssistantSession:e=>Ct(`/api/result-assistant/sessions/${e}`),sendResultAssistantMessage:(e,t,n)=>Ct(`/api/result-assistant/sessions/${e}/messages`,{method:"POST",body:JSON.stringify({message:t}),signal:n}),approveResultAssistantToolCall:(e,t,n)=>Ct(`/api/result-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:"POST",body:JSON.stringify(n===void 0?{}:{argumentsOverride:n})}),denyResultAssistantToolCall:(e,t)=>Ct(`/api/result-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:"POST",body:JSON.stringify({})}),closeResultAssistantSession:e=>Ct(`/api/result-assistant/sessions/${e}`,{method:"DELETE"}).then(()=>{}),subscribeResultAssistantSessionEvents:(e,t)=>jP(`/api/result-assistant/sessions/${e}/events`,t),getLibraries:()=>Ct("/api/libraries"),saveLibraries:e=>Ct("/api/libraries",{method:"PUT",body:JSON.stringify(e)}),startRun:e=>Ct("/api/runs",{method:"POST",body:JSON.stringify(e)}),runScenarioPreview:e=>Ct("/api/runs/preview",{method:"POST",body:JSON.stringify(e)}),listProviderModels:e=>Ct(`/api/providers/models?provider=${encodeURIComponent(e)}`),createScenarioAssistantSession:(e,t)=>Ct("/api/scenario-assistant/sessions",{method:"POST",body:JSON.stringify(e),signal:t}),getScenarioAssistantSession:e=>Ct(`/api/scenario-assistant/sessions/${e}`),sendScenarioAssistantMessage:(e,t,n)=>Ct(`/api/scenario-assistant/sessions/${e}/messages`,{method:"POST",body:JSON.stringify({message:t}),signal:n}),approveScenarioAssistantToolCall:(e,t)=>Ct(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:"POST",body:JSON.stringify({})}),denyScenarioAssistantToolCall:(e,t)=>Ct(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:"POST",body:JSON.stringify({})}),approveAllScenarioAssistantToolCalls:e=>Ct(`/api/scenario-assistant/sessions/${e}/tool-calls/approve-all`,{method:"POST",body:JSON.stringify({})}),closeScenarioAssistantSession:e=>Ct(`/api/scenario-assistant/sessions/${e}`,{method:"DELETE"}),subscribeScenarioAssistantSessionEvents:(e,t)=>jP(`/api/scenario-assistant/sessions/${e}/events`,t),discoverToolsForAnalysis:e=>Ct("/api/tool-analysis/discover-tools",{method:"POST",body:JSON.stringify(e)}),startToolAnalysis:e=>Ct("/api/tool-analysis/jobs",{method:"POST",body:JSON.stringify(e)}),getToolAnalysisResult:e=>Ct(`/api/tool-analysis/jobs/${e}/result`),stopToolAnalysis:e=>Ct(`/api/tool-analysis/jobs/${e}/stop`,{method:"POST"}),subscribeToolAnalysisJob:(e,t)=>{const n=new EventSource(`${ci}/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;Gy(t,"limit",e?.limit),Yy(t,"offset",e?.offset),e?.server?.trim()&&t.set("server",e.server.trim());const n=t.size>0?`?${t.toString()}`:"";return Ct(`/api/tool-analysis-results${n}`)},getToolAnalysisSavedResult:e=>Ct(`/api/tool-analysis-results/${e}`),deleteToolAnalysisSavedResult:e=>Ct(`/api/tool-analysis-results/${e}`,{method:"DELETE"}).then(()=>{}),createOAuthDebuggerSession:e=>Ct("/api/oauth-debugger/sessions",{method:"POST",body:JSON.stringify(e)}),getOAuthDebuggerSession:e=>Ct(`/api/oauth-debugger/sessions/${e}`),startOAuthDebuggerSession:e=>Ct(`/api/oauth-debugger/sessions/${e}/start`,{method:"POST",body:JSON.stringify({})}),subscribeOAuthDebuggerSession:(e,t)=>{const n=new EventSource(`${ci}/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)=>Ct(`/api/oauth-debugger/sessions/${e}/manual-callback`,{method:"POST",body:JSON.stringify(t)}),stopOAuthDebuggerSession:e=>Ct(`/api/oauth-debugger/sessions/${e}/stop`,{method:"POST",body:JSON.stringify({})}),exportOAuthDebuggerSession:(e,t)=>t==="json"?Ct(`/api/oauth-debugger/sessions/${e}/export?format=json`):MX(`/api/oauth-debugger/sessions/${e}/export?format=${t}`),createOAuthRuntimeSession:e=>Ct("/api/oauth-runtime/sessions",{method:"POST",body:JSON.stringify(e)}),getOAuthRuntimeSession:e=>Ct(`/api/oauth-runtime/sessions/${e}`),getOAuthRuntimeSessionToken:e=>Ct(`/api/oauth-runtime/sessions/${e}/token`),submitOAuthRuntimeCallback:(e,t)=>Ct(`/api/oauth-runtime/sessions/${e}/callback`,{method:"POST",body:JSON.stringify(t)}),cancelOAuthRuntimeSession:e=>Ct(`/api/oauth-runtime/sessions/${e}/cancel`,{method:"POST",body:JSON.stringify({})}),ensureOAuthServers:e=>Ct("/api/oauth-runtime/servers/ensure",{method:"POST",body:JSON.stringify(e)}),stopRun:e=>Ct(`/api/runs/jobs/${e}/stop`,{method:"POST"}),getRunQueue:()=>Ct("/api/runs/queue"),subscribeRunQueue:e=>{if(typeof SharedWorker>"u"){const r=new EventSource(`${ci}/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:ci}),()=>{n||(n=!0,t.port.postMessage({type:"close"}),t.port.onmessage=null,t.port.close())}},removeQueuedRun:e=>Ct(`/api/runs/queue/${e}`,{method:"DELETE"}).then(()=>{}),resumeQueue:()=>Ct("/api/runs/queue/resume",{method:"POST"}),subscribeRunJob:(e,t)=>{const n=new EventSource(`${ci}/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 lt.health()},async listConfigs(){return(await lt.listConfigs()).map(Kh)},async createConfig(e){const t=await lt.createConfig(IX(e),xP(e));return Kh(t)},async updateConfig(e){const t=await lt.updateConfig(e.id,xP(e),$X(e.name));return Kh(t)},async deleteConfig(e){await lt.deleteConfig(e)},async listResults(e){let n=0;const r=[];for(;;){const i=await lt.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([lt.getRun(i.runId),lt.getRunTrace(i.runId)]);return wP(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 lt.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 lt.listRuns(e)},async getLatestPassRatesByConfigIds(e){return lt.getLatestPassRatesByConfigIds(e)},async getResult(e){try{const[{results:t},n]=await Promise.all([lt.getRun(e),lt.getRunTrace(e)]);return wP(t,n.records)}catch{return}},async deleteResult(e){await lt.deleteRun(e)},async updateRunNote(e,t){await lt.updateRunNote(e,t)},async listMarkdownReports(e){if(e?.limit!==void 0||e?.offset!==void 0)return(await lt.listMarkdownReports(e)).data;const t=[];let n=0;const r=100;for(;;){const a=await lt.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 lt.listMarkdownReports(e)},async getMarkdownReport(e){return lt.getMarkdownReport(e)},async getMarkdownReportById(e){return lt.getMarkdownReportById(e)},async deleteMarkdownReport(e){await lt.deleteMarkdownReport(e)},async startRun(e){return lt.startRun(e)},async runScenarioPreview(e){const t=await lt.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 lt.stopRun(e)},async getRunQueue(){return lt.getRunQueue()},subscribeRunQueue(e){return lt.subscribeRunQueue(e)},async removeQueuedRun(e){await lt.removeQueuedRun(e)},async resumeQueue(){return lt.resumeQueue()},subscribeRunJob(e,t){return lt.subscribeRunJob(e,t)},async applyResultAssistantReport(e){return lt.applyResultAssistantReport(e)},async createResultAssistantSession(e,t){return lt.createResultAssistantSession(e,t)},async getResultAssistantSession(e){return lt.getResultAssistantSession(e)},async sendResultAssistantMessage(e,t,n){return lt.sendResultAssistantMessage(e,t,n)},async approveResultAssistantToolCall(e,t,n){return lt.approveResultAssistantToolCall(e,t,n)},async denyResultAssistantToolCall(e,t){return lt.denyResultAssistantToolCall(e,t)},async closeResultAssistantSession(e){await lt.closeResultAssistantSession(e)},subscribeResultAssistantSessionEvents(e,t){return lt.subscribeResultAssistantSessionEvents(e,t)},async getLibraries(){const e=await lt.getLibraries();return EX(e)},async saveLibraries(e){await lt.saveLibraries(PX(e))},async listProviderModels(e){return lt.listProviderModels(e)},async getWorkspaceSettings(){return lt.getSettings()},async updateWorkspaceSettings(e){return lt.updateSettings(e)},async createScenarioAssistantSession(e,t){return lt.createScenarioAssistantSession(e,t)},async getScenarioAssistantSession(e){return lt.getScenarioAssistantSession(e)},async sendScenarioAssistantMessage(e,t,n){return lt.sendScenarioAssistantMessage(e,t,n)},async approveScenarioAssistantToolCall(e,t){return lt.approveScenarioAssistantToolCall(e,t)},async denyScenarioAssistantToolCall(e,t){return lt.denyScenarioAssistantToolCall(e,t)},async approveAllScenarioAssistantToolCalls(e){return lt.approveAllScenarioAssistantToolCalls(e)},async closeScenarioAssistantSession(e){await lt.closeScenarioAssistantSession(e)},subscribeScenarioAssistantSessionEvents(e,t){return lt.subscribeScenarioAssistantSessionEvents(e,t)},async discoverToolsForAnalysis(e){return lt.discoverToolsForAnalysis(e)},async startToolAnalysis(e){return lt.startToolAnalysis(e)},subscribeToolAnalysisJob(e,t){return lt.subscribeToolAnalysisJob(e,t)},async getToolAnalysisResult(e){return lt.getToolAnalysisResult(e)},async stopToolAnalysis(e){return lt.stopToolAnalysis(e)},async listToolAnalysisResults(e){if(e?.limit!==void 0||e?.offset!==void 0)return(await lt.listToolAnalysisResults(e)).data;const t=[];let n=0;const r=100;for(;;){const a=await lt.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 lt.listToolAnalysisResults(e)},async listToolAnalysisServers(){return lt.listToolAnalysisServers()},async getToolAnalysisSavedResult(e){return lt.getToolAnalysisSavedResult(e)},async deleteToolAnalysisSavedResult(e){await lt.deleteToolAnalysisSavedResult(e)},async createOAuthDebuggerSession(e){return lt.createOAuthDebuggerSession(e)},async getOAuthDebuggerSession(e){return lt.getOAuthDebuggerSession(e)},async startOAuthDebuggerSession(e){return lt.startOAuthDebuggerSession(e)},subscribeOAuthDebuggerSession(e,t){return lt.subscribeOAuthDebuggerSession(e,t)},async submitOAuthDebuggerManualCallback(e,t){return lt.submitOAuthDebuggerManualCallback(e,t)},async stopOAuthDebuggerSession(e){return lt.stopOAuthDebuggerSession(e)},async exportOAuthDebuggerSession(e,t){return lt.exportOAuthDebuggerSession(e,t)},async createOAuthRuntimeSession(e){return lt.createOAuthRuntimeSession(e)},async getOAuthRuntimeSession(e){return lt.getOAuthRuntimeSession(e)},async getOAuthRuntimeSessionToken(e){return lt.getOAuthRuntimeSessionToken(e)},async submitOAuthRuntimeCallback(e,t){return lt.submitOAuthRuntimeCallback(e,t)},async cancelOAuthRuntimeSession(e){return lt.cancelOAuthRuntimeSession(e)},async ensureOAuthServers(e){return lt.ensureOAuthServers(e)}},rL=m.createContext(null);function LX({children:e}){const t="workspace",[n,r]=m.useState("checking"),[a,i]=m.useState(null);m.useEffect(()=>{r("checking"),lt.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(rL.Provider,{value:{mode:t,connection:n,version:a,source:o},children:e})}function On(){const e=m.useContext(rL);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=ja(),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(nP,{})}):s.jsx(O3,{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(I3,{}),s.jsx(H3,{children:s.jsx(K3,{children:n.map((h,p)=>{const v=p===n.length-1;return s.jsxs(m.Fragment,{children:[s.jsx(G3,{children:h.to&&!v?s.jsx(Y3,{asChild:!0,children:s.jsx(Tt,{to:h.to,children:h.label})}):s.jsx(X3,{children:h.label})}),!v&&s.jsx(Q3,{})]},`${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(nP,{})})]})]})})}const sL=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(sL.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(sL);if(!e)throw new Error("useConfigs must be used within ConfigProvider");return e}const aL=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(aL.Provider,{value:d,children:e})}function Na(){const e=m.useContext(aL);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:Te("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:Te("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:Te("text-2xl font-semibold leading-none tracking-tight",e),...t}));Ft.displayName="CardTitle";const kr=m.forwardRef(({className:e,...t},n)=>s.jsx("p",{ref:n,className:Te("text-sm text-muted-foreground",e),...t}));kr.displayName="CardDescription";const rt=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Te("p-6 pt-0",e),...t}));rt.displayName="CardContent";const GX=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Te("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:Te("relative w-full overflow-auto",t),children:s.jsx("table",{ref:r,className:Te("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:Te("[&_tr]:border-b",e),...t}));es.displayName="TableHeader";const ts=m.forwardRef(({className:e,...t},n)=>s.jsx("tbody",{ref:n,className:Te("[&_tr:last-child]:border-0",e),...t}));ts.displayName="TableBody";const YX=m.forwardRef(({className:e,...t},n)=>s.jsx("tfoot",{ref:n,className:Te("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:Te("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",e),...t}));Gt.displayName="TableRow";const ft=m.forwardRef(({className:e,...t},n)=>s.jsx("th",{ref:n,className:Te("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));ft.displayName="TableHead";const He=m.forwardRef(({className:e,...t},n)=>s.jsx("td",{ref:n,className:Te("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:Te("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:Te(QX({variant:t}),e),...r})});st.displayName="Badge";function Oa({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 iL({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(Ba,{className:"max-w-sm text-xs",children:s.jsx("p",{children:t.detail})})]})}):null}var Xy,SP;function as(){if(SP)return Xy;SP=1;var e=Array.isArray;return Xy=e,Xy}var Qy,NP;function oL(){if(NP)return Qy;NP=1;var e=typeof hh=="object"&&hh&&hh.Object===Object&&hh;return Qy=e,Qy}var Zy,CP;function Ha(){if(CP)return Zy;CP=1;var e=oL(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return Zy=n,Zy}var Jy,_P;function Xf(){if(_P)return Jy;_P=1;var e=Ha(),t=e.Symbol;return Jy=t,Jy}var eb,AP;function rQ(){if(AP)return eb;AP=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 eb=i,eb}var tb,kP;function sQ(){if(kP)return tb;kP=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return tb=n,tb}var nb,EP;function Ti(){if(EP)return nb;EP=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 nb=o,nb}var rb,PP;function Ri(){if(PP)return rb;PP=1;function e(t){return t!=null&&typeof t=="object"}return rb=e,rb}var sb,TP;function ku(){if(TP)return sb;TP=1;var e=Ti(),t=Ri(),n="[object Symbol]";function r(a){return typeof a=="symbol"||t(a)&&e(a)==n}return sb=r,sb}var ab,RP;function fC(){if(RP)return ab;RP=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 ab=a,ab}var ib,OP;function No(){if(OP)return ib;OP=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return ib=e,ib}var ob,MP;function pC(){if(MP)return ob;MP=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 ob=o,ob}var lb,IP;function aQ(){if(IP)return lb;IP=1;var e=Ha(),t=e["__core-js_shared__"];return lb=t,lb}var cb,$P;function iQ(){if($P)return cb;$P=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 cb=n,cb}var ub,DP;function lL(){if(DP)return ub;DP=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 ub=n,ub}var db,LP;function oQ(){if(LP)return db;LP=1;var e=pC(),t=iQ(),n=No(),r=lL(),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 db=p,db}var fb,FP;function lQ(){if(FP)return fb;FP=1;function e(t,n){return t?.[n]}return fb=e,fb}var pb,zP;function Il(){if(zP)return pb;zP=1;var e=oQ(),t=lQ();function n(r,a){var i=t(r,a);return e(i)?i:void 0}return pb=n,pb}var hb,BP;function Wg(){if(BP)return hb;BP=1;var e=Il(),t=e(Object,"create");return hb=t,hb}var mb,qP;function cQ(){if(qP)return mb;qP=1;var e=Wg();function t(){this.__data__=e?e(null):{},this.size=0}return mb=t,mb}var gb,UP;function uQ(){if(UP)return gb;UP=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return gb=e,gb}var vb,WP;function dQ(){if(WP)return vb;WP=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 vb=a,vb}var xb,VP;function fQ(){if(VP)return xb;VP=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 xb=r,xb}var yb,HP;function pQ(){if(HP)return yb;HP=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 yb=n,yb}var bb,KP;function hQ(){if(KP)return bb;KP=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,bb=i,bb}var wb,GP;function mQ(){if(GP)return wb;GP=1;function e(){this.__data__=[],this.size=0}return wb=e,wb}var jb,YP;function hC(){if(YP)return jb;YP=1;function e(t,n){return t===n||t!==t&&n!==n}return jb=e,jb}var Sb,XP;function Vg(){if(XP)return Sb;XP=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 Sb=t,Sb}var Nb,QP;function gQ(){if(QP)return Nb;QP=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 Nb=r,Nb}var Cb,ZP;function vQ(){if(ZP)return Cb;ZP=1;var e=Vg();function t(n){var r=this.__data__,a=e(r,n);return a<0?void 0:r[a][1]}return Cb=t,Cb}var _b,JP;function xQ(){if(JP)return _b;JP=1;var e=Vg();function t(n){return e(this.__data__,n)>-1}return _b=t,_b}var Ab,eT;function yQ(){if(eT)return Ab;eT=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 Ab=t,Ab}var kb,tT;function Hg(){if(tT)return kb;tT=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,kb=i,kb}var Eb,nT;function mC(){if(nT)return Eb;nT=1;var e=Il(),t=Ha(),n=e(t,"Map");return Eb=n,Eb}var Pb,rT;function bQ(){if(rT)return Pb;rT=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 Pb=r,Pb}var Tb,sT;function wQ(){if(sT)return Tb;sT=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return Tb=e,Tb}var Rb,aT;function Kg(){if(aT)return Rb;aT=1;var e=wQ();function t(n,r){var a=n.__data__;return e(r)?a[typeof r=="string"?"string":"hash"]:a.map}return Rb=t,Rb}var Ob,iT;function jQ(){if(iT)return Ob;iT=1;var e=Kg();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return Ob=t,Ob}var Mb,oT;function SQ(){if(oT)return Mb;oT=1;var e=Kg();function t(n){return e(this,n).get(n)}return Mb=t,Mb}var Ib,lT;function NQ(){if(lT)return Ib;lT=1;var e=Kg();function t(n){return e(this,n).has(n)}return Ib=t,Ib}var $b,cT;function CQ(){if(cT)return $b;cT=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 $b=t,$b}var Db,uT;function gC(){if(uT)return Db;uT=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,Db=i,Db}var Lb,dT;function cL(){if(dT)return Lb;dT=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,Lb=n,Lb}var Fb,fT;function _Q(){if(fT)return Fb;fT=1;var e=cL(),t=500;function n(r){var a=e(r,function(o){return i.size===t&&i.clear(),o}),i=a.cache;return a}return Fb=n,Fb}var zb,pT;function AQ(){if(pT)return zb;pT=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 zb=r,zb}var Bb,hT;function vC(){if(hT)return Bb;hT=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 Bb=e,Bb}var qb,mT;function kQ(){if(mT)return qb;mT=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 qb=o,qb}var Ub,gT;function uL(){if(gT)return Ub;gT=1;var e=kQ();function t(n){return n==null?"":e(n)}return Ub=t,Ub}var Wb,vT;function dL(){if(vT)return Wb;vT=1;var e=as(),t=fC(),n=AQ(),r=uL();function a(i,o){return e(i)?i:t(i,o)?[i]:n(r(i))}return Wb=a,Wb}var Vb,xT;function Gg(){if(xT)return Vb;xT=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 Vb=t,Vb}var Hb,yT;function xC(){if(yT)return Hb;yT=1;var e=dL(),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 Hb=n,Hb}var Kb,bT;function fL(){if(bT)return Kb;bT=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 Kb=t,Kb}var EQ=fL();const bs=vn(EQ);var Gb,wT;function PQ(){if(wT)return Gb;wT=1;function e(t){return t==null}return Gb=e,Gb}var TQ=PQ();const Ht=vn(TQ);var Yb,jT;function RQ(){if(jT)return Yb;jT=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 Yb=a,Yb}var OQ=RQ();const vl=vn(OQ);var MQ=pC();const Vt=vn(MQ);var IQ=No();const Eu=vn(IQ);var Xb={exports:{}},pn={};var ST;function $Q(){if(ST)return pn;ST=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 NT;function DQ(){return NT||(NT=1,Xb.exports=$Q()),Xb.exports}var LQ=DQ(),Qb,CT;function pL(){if(CT)return Qb;CT=1;var e=Ti(),t=Ri(),n="[object Number]";function r(a){return typeof a=="number"||t(a)&&e(a)==n}return Qb=r,Qb}var Zb,_T;function FQ(){if(_T)return Zb;_T=1;var e=pL();function t(n){return e(n)&&n!=+n}return Zb=t,Zb}var zQ=FQ();const Qf=vn(zQ);var BQ=pL();const qQ=vn(BQ);var Ir=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)},$r=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"],AT=["points","pathLength"],Jb={svg:KQ,polygon:AT,polyline:AT},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 kT(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 ET={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":""},PT=null,e0=null,bC=function e(t){if(t===PT&&Array.isArray(e0))return e0;var n=[];return m.Children.forEach(t,function(r){Ht(r)||(LQ.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),e0=n,PT=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 TT=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=Jb?.[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 RT(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(!RT(i,o))return!1}return!0},RT=function(t,n){if(Ht(t)&&Ht(n))return!0;if(!Ht(t)&&!Ht(n)){var r=t.props||{},a=r.children,i=kT(r,XQ),o=n.props||{},c=o.children,d=kT(o,QQ);return a&&c?Dc(i,d)&&KS(a,c):!a&&!c?Dc(i,d):!1}return!1},OT=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&&ET[n]?ET[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]},t0,MT;function dZ(){if(MT)return t0;MT=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 t0=e,t0}var n0,IT;function fZ(){if(IT)return n0;IT=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 n0=t,n0}var r0,$T;function hL(){if($T)return r0;$T=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 r0=d,r0}var s0,DT;function pZ(){if(DT)return s0;DT=1;function e(t){return t.split("")}return s0=e,s0}var a0,LT;function hZ(){if(LT)return a0;LT=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 a0=A,a0}var i0,FT;function mZ(){if(FT)return i0;FT=1;var e=pZ(),t=hL(),n=hZ();function r(a){return t(a)?n(a):e(a)}return i0=r,i0}var o0,zT;function gZ(){if(zT)return o0;zT=1;var e=fZ(),t=hL(),n=mZ(),r=uL();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 o0=a,o0}var l0,BT;function vZ(){if(BT)return l0;BT=1;var e=gZ(),t=e("toUpperCase");return l0=t,l0}var xZ=vZ();const Yg=vn(xZ);function Nn(e){return function(){return e}}const mL=Math.cos,lm=Math.sin,Ca=Math.sqrt,cm=Math.PI,Xg=2*cm,QS=Math.PI,ZS=2*QS,Zo=1e-6,yZ=ZS-Zo;function gL(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 gL;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?gL: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 vL(e){this._context=e}vL.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 vL(e)}function xL(e){return e[0]}function yL(e){return e[1]}function bL(e,t){var n=Nn(!0),r=null,a=Qg,i=null,o=wC(c);e=typeof e=="function"?e:e===void 0?xL:Nn(e),t=typeof t=="function"?t:t===void 0?yL: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?xL:Nn(+e),t=typeof t=="function"?t:Nn(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?yL: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 bL().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 wL{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 wL(e,!0)}function SZ(e){return new wL(e,!1)}const SC={draw(e,t){const n=Ca(t/cm);e.moveTo(n,0),e.arc(0,0,n,0,Xg)}},NZ={draw(e,t){const n=Ca(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()}},jL=Ca(1/3),CZ=jL*2,_Z={draw(e,t){const n=Ca(t/CZ),r=n*jL;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},AZ={draw(e,t){const n=Ca(t),r=-n/2;e.rect(r,r,n,n)}},kZ=.8908130915292852,SL=lm(cm/10)/lm(7*cm/10),EZ=lm(Xg/10)*SL,PZ=-mL(Xg/10)*SL,TZ={draw(e,t){const n=Ca(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=mL(o),d=lm(o);e.lineTo(d*n,-c*n),e.lineTo(c*r-d*a,d*r+c*a)}e.closePath()}},c0=Ca(3),RZ={draw(e,t){const n=-Ca(t/(c0*3));e.moveTo(0,n*2),e.lineTo(-c0*n,-n),e.lineTo(c0*n,-n),e.closePath()}},Ps=-.5,Ts=Ca(3)/2,JS=1/Ca(12),OZ=(JS/2+1)*3,MZ={draw(e,t){const n=Ca(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 NL(e){this._context=e}NL.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 NL(e)}function CL(e){this._context=e}CL.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 CL(e)}function _L(e){this._context=e}_L.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 _L(e)}function AL(e){this._context=e}AL.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 AL(e)}function qT(e){return e<0?-1:1}function UT(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(qT(i)+qT(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(c))||0}function WT(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function u0(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:u0(this,this._t0,WT(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,u0(this,WT(this,n=UT(this,e,t)),n);break;default:u0(this,this._t0,n=UT(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function kL(e){this._context=new EL(e)}(kL.prototype=Object.create(fm.prototype)).point=function(e,t){fm.prototype.point.call(this,t,e)};function EL(e){this._context=e}EL.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 kL(e)}function PL(e){this._context=e}PL.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=VT(e),a=VT(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 VT(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 PL(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 HT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function KT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HT(Object(n),!0).forEach(function(r){JZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function 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 TL={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 TL[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){TL["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=KT(KT({},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 GT(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?GT(Object(n),!0).forEach(function(r){ef(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GT(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,OL(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,RL()?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 RL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(RL=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=OL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OL(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 d0,YT;function vJ(){if(YT)return d0;YT=1;var e=Hg();function t(){this.__data__=new e,this.size=0}return d0=t,d0}var f0,XT;function xJ(){if(XT)return f0;XT=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return f0=e,f0}var p0,QT;function yJ(){if(QT)return p0;QT=1;function e(t){return this.__data__.get(t)}return p0=e,p0}var h0,ZT;function bJ(){if(ZT)return h0;ZT=1;function e(t){return this.__data__.has(t)}return h0=e,h0}var m0,JT;function wJ(){if(JT)return m0;JT=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 m0=a,m0}var g0,eR;function ML(){if(eR)return g0;eR=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,g0=o,g0}var v0,tR;function jJ(){if(tR)return v0;tR=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return v0=t,v0}var x0,nR;function SJ(){if(nR)return x0;nR=1;function e(t){return this.__data__.has(t)}return x0=e,x0}var y0,rR;function IL(){if(rR)return y0;rR=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,y0=r,y0}var b0,sR;function $L(){if(sR)return b0;sR=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 b0=e,b0}var w0,aR;function DL(){if(aR)return w0;aR=1;function e(t,n){return t.has(n)}return w0=e,w0}var j0,iR;function LL(){if(iR)return j0;iR=1;var e=IL(),t=$L(),n=DL(),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 j0=i,j0}var S0,oR;function NJ(){if(oR)return S0;oR=1;var e=Ha(),t=e.Uint8Array;return S0=t,S0}var N0,lR;function CJ(){if(lR)return N0;lR=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(a,i){r[++n]=[i,a]}),r}return N0=e,N0}var C0,cR;function _C(){if(cR)return C0;cR=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(a){r[++n]=a}),r}return C0=e,C0}var _0,uR;function _J(){if(uR)return _0;uR=1;var e=Xf(),t=NJ(),n=hC(),r=LL(),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 _0=k,_0}var A0,dR;function FL(){if(dR)return A0;dR=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 A0=e,A0}var k0,fR;function AJ(){if(fR)return k0;fR=1;var e=FL(),t=as();function n(r,a,i){var o=a(r);return t(r)?o:e(o,i(r))}return k0=n,k0}var E0,pR;function kJ(){if(pR)return E0;pR=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 E0=e,E0}var P0,hR;function EJ(){if(hR)return P0;hR=1;function e(){return[]}return P0=e,P0}var T0,mR;function PJ(){if(mR)return T0;mR=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 T0=i,T0}var R0,gR;function TJ(){if(gR)return R0;gR=1;function e(t,n){for(var r=-1,a=Array(t);++r<t;)a[r]=n(r);return a}return R0=e,R0}var O0,vR;function RJ(){if(vR)return O0;vR=1;var e=Ti(),t=Ri(),n="[object Arguments]";function r(a){return t(a)&&e(a)==n}return O0=r,O0}var M0,xR;function AC(){if(xR)return M0;xR=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 M0=i,M0}var Rd={exports:{}},I0,yR;function OJ(){if(yR)return I0;yR=1;function e(){return!1}return I0=e,I0}Rd.exports;var bR;function zL(){return bR||(bR=1,(function(e,t){var n=Ha(),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 $0,wR;function kC(){if(wR)return $0;wR=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 $0=n,$0}var D0,jR;function EC(){if(jR)return D0;jR=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return D0=t,D0}var L0,SR;function MJ(){if(SR)return L0;SR=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 L0=F,L0}var F0,NR;function BL(){if(NR)return F0;NR=1;function e(t){return function(n){return t(n)}}return F0=e,F0}var Od={exports:{}};Od.exports;var CR;function IJ(){return CR||(CR=1,(function(e,t){var n=oL(),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 z0,_R;function qL(){if(_R)return z0;_R=1;var e=MJ(),t=BL(),n=IJ(),r=n&&n.isTypedArray,a=r?t(r):e;return z0=a,z0}var B0,AR;function $J(){if(AR)return B0;AR=1;var e=TJ(),t=AC(),n=as(),r=zL(),a=kC(),i=qL(),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 B0=d,B0}var q0,kR;function DJ(){if(kR)return q0;kR=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,a=typeof r=="function"&&r.prototype||e;return n===a}return q0=t,q0}var U0,ER;function UL(){if(ER)return U0;ER=1;function e(t,n){return function(r){return t(n(r))}}return U0=e,U0}var W0,PR;function LJ(){if(PR)return W0;PR=1;var e=UL(),t=e(Object.keys,Object);return W0=t,W0}var V0,TR;function FJ(){if(TR)return V0;TR=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 V0=a,V0}var H0,RR;function Zf(){if(RR)return H0;RR=1;var e=pC(),t=EC();function n(r){return r!=null&&t(r.length)&&!e(r)}return H0=n,H0}var K0,OR;function Jg(){if(OR)return K0;OR=1;var e=$J(),t=FJ(),n=Zf();function r(a){return n(a)?e(a):t(a)}return K0=r,K0}var G0,MR;function zJ(){if(MR)return G0;MR=1;var e=AJ(),t=PJ(),n=Jg();function r(a){return e(a,n,t)}return G0=r,G0}var Y0,IR;function BJ(){if(IR)return Y0;IR=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 Y0=a,Y0}var X0,$R;function qJ(){if($R)return X0;$R=1;var e=Il(),t=Ha(),n=e(t,"DataView");return X0=n,X0}var Q0,DR;function UJ(){if(DR)return Q0;DR=1;var e=Il(),t=Ha(),n=e(t,"Promise");return Q0=n,Q0}var Z0,LR;function WL(){if(LR)return Z0;LR=1;var e=Il(),t=Ha(),n=e(t,"Set");return Z0=n,Z0}var J0,FR;function WJ(){if(FR)return J0;FR=1;var e=Il(),t=Ha(),n=e(t,"WeakMap");return J0=n,J0}var ew,zR;function VJ(){if(zR)return ew;zR=1;var e=qJ(),t=mC(),n=UJ(),r=WL(),a=WJ(),i=Ti(),o=lL(),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}),ew=N,ew}var tw,BR;function HJ(){if(BR)return tw;BR=1;var e=ML(),t=LL(),n=_J(),r=BJ(),a=VJ(),i=as(),o=zL(),c=qL(),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 tw=j,tw}var nw,qR;function PC(){if(qR)return nw;qR=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 nw=n,nw}var rw,UR;function KJ(){if(UR)return rw;UR=1;var e=ML(),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 rw=a,rw}var sw,WR;function VL(){if(WR)return sw;WR=1;var e=No();function t(n){return n===n&&!e(n)}return sw=t,sw}var aw,VR;function GJ(){if(VR)return aw;VR=1;var e=VL(),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 aw=n,aw}var iw,HR;function HL(){if(HR)return iw;HR=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return iw=e,iw}var ow,KR;function YJ(){if(KR)return ow;KR=1;var e=KJ(),t=GJ(),n=HL();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 ow=r,ow}var lw,GR;function XJ(){if(GR)return lw;GR=1;function e(t,n){return t!=null&&n in Object(t)}return lw=e,lw}var cw,YR;function QJ(){if(YR)return cw;YR=1;var e=dL(),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 cw=o,cw}var uw,XR;function ZJ(){if(XR)return uw;XR=1;var e=XJ(),t=QJ();function n(r,a){return r!=null&&t(r,a,e)}return uw=n,uw}var dw,QR;function JJ(){if(QR)return dw;QR=1;var e=PC(),t=fL(),n=ZJ(),r=fC(),a=VL(),i=HL(),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 dw=f,dw}var fw,ZR;function Tu(){if(ZR)return fw;ZR=1;function e(t){return t}return fw=e,fw}var pw,JR;function eee(){if(JR)return pw;JR=1;function e(t){return function(n){return n?.[t]}}return pw=e,pw}var hw,eO;function tee(){if(eO)return hw;eO=1;var e=xC();function t(n){return function(r){return e(r,n)}}return hw=t,hw}var mw,tO;function nee(){if(tO)return mw;tO=1;var e=eee(),t=tee(),n=fC(),r=Gg();function a(i){return n(i)?e(r(i)):t(i)}return mw=a,mw}var gw,nO;function Ka(){if(nO)return gw;nO=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 gw=i,gw}var vw,rO;function KL(){if(rO)return vw;rO=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 vw=e,vw}var xw,sO;function ree(){if(sO)return xw;sO=1;function e(t){return t!==t}return xw=e,xw}var yw,aO;function see(){if(aO)return yw;aO=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 yw=e,yw}var bw,iO;function aee(){if(iO)return bw;iO=1;var e=KL(),t=ree(),n=see();function r(a,i,o){return i===i?n(a,i,o):e(a,t,o)}return bw=r,bw}var ww,oO;function iee(){if(oO)return ww;oO=1;var e=aee();function t(n,r){var a=n==null?0:n.length;return!!a&&e(n,r,0)>-1}return ww=t,ww}var jw,lO;function oee(){if(lO)return jw;lO=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 jw=e,jw}var Sw,cO;function lee(){if(cO)return Sw;cO=1;function e(){}return Sw=e,Sw}var Nw,uO;function cee(){if(uO)return Nw;uO=1;var e=WL(),t=lee(),n=_C(),r=1/0,a=e&&1/n(new e([,-0]))[1]==r?function(i){return new e(i)}:t;return Nw=a,Nw}var Cw,dO;function uee(){if(dO)return Cw;dO=1;var e=IL(),t=iee(),n=oee(),r=DL(),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 Cw=c,Cw}var _w,fO;function dee(){if(fO)return _w;fO=1;var e=Ka(),t=uee();function n(r,a){return r&&r.length?t(r,e(a,2)):[]}return _w=n,_w}var fee=dee();const pO=vn(fee);function GL(e,t,n){return t===!0?pO(e,n):Vt(t)?pO(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 hO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ii(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hO(Object(n),!0).forEach(function(r){ev(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mO(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,XL(r.key),r)}}function mee(e,t,n){return t&&mO(e.prototype,t),n&&mO(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function gee(e,t,n){return t=hm(t),vee(e,YL()?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 YL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(YL=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=XL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XL(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 gO=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)>gO||Math.abs(a.height-this.lastBoundingBox.height)>gO)&&(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?ii({},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 ii(ii({},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=ii(ii({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,ii(ii({},this.props),{},{payload:GL(h,f,See)})))}}],[{key:"getWithHeight",value:function(r,a){var i=ii(ii({},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 Aw,vO;function Cee(){if(vO)return Aw;vO=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 Aw=a,Aw}var kw,xO;function QL(){if(xO)return kw;xO=1;var e=FL(),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 kw=n,kw}var Ew,yO;function _ee(){if(yO)return Ew;yO=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 Ew=e,Ew}var Pw,bO;function Aee(){if(bO)return Pw;bO=1;var e=_ee(),t=e();return Pw=t,Pw}var Tw,wO;function ZL(){if(wO)return Tw;wO=1;var e=Aee(),t=Jg();function n(r,a){return r&&e(r,a,t)}return Tw=n,Tw}var Rw,jO;function kee(){if(jO)return Rw;jO=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 Rw=t,Rw}var Ow,SO;function TC(){if(SO)return Ow;SO=1;var e=ZL(),t=kee(),n=t(e);return Ow=n,Ow}var Mw,NO;function JL(){if(NO)return Mw;NO=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 Mw=n,Mw}var Iw,CO;function Eee(){if(CO)return Iw;CO=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return Iw=e,Iw}var $w,_O;function Pee(){if(_O)return $w;_O=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 $w=t,$w}var Dw,AO;function Tee(){if(AO)return Dw;AO=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 Dw=t,Dw}var Lw,kO;function Ree(){if(kO)return Lw;kO=1;var e=vC(),t=xC(),n=Ka(),r=JL(),a=Eee(),i=BL(),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 Lw=f,Lw}var Fw,EO;function Oee(){if(EO)return Fw;EO=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 Fw=e,Fw}var zw,PO;function Mee(){if(PO)return zw;PO=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 zw=n,zw}var Bw,TO;function Iee(){if(TO)return Bw;TO=1;function e(t){return function(){return t}}return Bw=e,Bw}var qw,RO;function e4(){if(RO)return qw;RO=1;var e=Il(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return qw=t,qw}var Uw,OO;function $ee(){if(OO)return Uw;OO=1;var e=Iee(),t=e4(),n=Tu(),r=t?function(a,i){return t(a,"toString",{configurable:!0,enumerable:!1,value:e(i),writable:!0})}:n;return Uw=r,Uw}var Ww,MO;function Dee(){if(MO)return Ww;MO=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 Ww=r,Ww}var Vw,IO;function Lee(){if(IO)return Vw;IO=1;var e=$ee(),t=Dee(),n=t(e);return Vw=n,Vw}var Hw,$O;function Fee(){if($O)return Hw;$O=1;var e=Tu(),t=Mee(),n=Lee();function r(a,i){return n(t(a,i,e),a+"")}return Hw=r,Hw}var Kw,DO;function tv(){if(DO)return Kw;DO=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 Kw=a,Kw}var Gw,LO;function zee(){if(LO)return Gw;LO=1;var e=QL(),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 Gw=a,Gw}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 FO(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 FO(e,t)}}function FO(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 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 Yw(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){Kee(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 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=Yw({display:"block",paddingTop:4,paddingBottom:4,color:H.color||"#000"},c),Y=H.formatter||p||Xee,W=H.value,O=H.name,Z=W,q=O;if(Y&&Z!=null&&q!=null){var z=Y(W,O,H,L,h);if(Array.isArray(z)){var K=qee(z,2);Z=K[0],q=K[1]}else Z=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"},Z),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=Yw({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),k=Yw({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 BO(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=BO({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:a,reverseDirection:i,tooltipDimension:o.width,viewBox:d,viewBoxDimension:d.width}),p=BO({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 qO(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 UO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qO(Object(n),!0).forEach(function(r){o1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qO(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,n4(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,t4()?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 t4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(t4=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=n4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n4(e){var t=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 WO=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)>WO||Math.abs(r.height-this.state.lastBoundingBox.height)>WO)&&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=UO(UO({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 VO(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?VO(Object(n),!0).forEach(function(r){OC(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VO(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,s4(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,r4()?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 r4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(r4=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=s4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s4(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=GL(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,HO(HO({},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 Xw,KO;function Nte(){if(KO)return Xw;KO=1;var e=Ha(),t=function(){return e.Date.now()};return Xw=t,Xw}var Qw,GO;function Cte(){if(GO)return Qw;GO=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return Qw=t,Qw}var Zw,YO;function _te(){if(YO)return Zw;YO=1;var e=Cte(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return Zw=n,Zw}var Jw,XO;function a4(){if(XO)return Jw;XO=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 Jw=d,Jw}var ej,QO;function Ate(){if(QO)return ej;QO=1;var e=No(),t=Nte(),n=a4(),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 ej=o,ej}var tj,ZO;function kte(){if(ZO)return tj;ZO=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 tj=r,tj}var Ete=kte();const i4=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 JO(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?JO(Object(n),!0).forEach(function(r){Pte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JO(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 e2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e2(e,t)}}function e2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $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 Z,q=O[0].contentRect,z=q.width,K=q.height;U(z,K),(Z=E.current)===null||Z===void 0||Z.call(E,z,K)};b>0&&(G=i4(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 t2(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?t2(Object(n),!0).forEach(function(r){Lte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t2(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"},n2="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(n2);i||(i=document.createElement("span"),i.setAttribute("id",n2),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 r2(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 r2(e,t)}}function r2(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 s2(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&&s2(e.prototype,t),n&&s2(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 a2=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,i2=/(-?\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%]+)?/,o4={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(o4),kc="NaN";function nne(e,t){return e*o4[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 l4(e){if(e.includes(kc))return kc;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=a2.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(a2,h.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var p,v=(p=i2.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(i2,_.toString())}return t}var o2=/\(([^()]*)\)/;function rne(e){for(var t=e;t.includes("(");){var n=o2.exec(t),r=xm(n,2),a=r[1];t=t.replace(o2,l4(a))}return t}function sne(e){var t=e.replace(/\s+/g,"");return t=rne(t),t=l4(t),t}function ane(e){try{return sne(e)}catch{return kc}}function nj(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 l2(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 c2(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 u2(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 u2(e,t)}}function u2(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 c4=/[ \f\n\r\t\v\u2028\u2029]+/,u4=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(c4));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,Z=I[I.length-1];if(Z&&(a==null||i||Z.width+O+r<Number(a)))Z.words.push(W),Z.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=u4({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=c2(P,2),M=R[0],D=R[1],U=y(k),F=c2(U,1),G=F[0];if(!M&&!G&&(S=k+1),M&&G&&(N=k-1),!M&&G){A=D;break}_++}return A||x},d2=function(t){var n=Ht(t)?[]:t.toString().split(c4);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=u4({breakAll:o,children:a,style:i});if(h){var p=h.wordsWithComputedWidth,v=h.spaceWidth;d=p,f=v}else return d2(a);return pne({breakAll:o,children:a,maxLines:c,style:i},d,f,n,r)}return d2(a)},f2="#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?f2:y,N=l2(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=l2(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=nj("calc(".concat(f,")"));break;case"middle":F=nj("calc(".concat((_.length-1)/2," * -").concat(c," + (").concat(f," / 2))"));break;default:F=nj("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")?f2: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 d4(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(d4).center;class p2 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(h2(this,t))}has(t){return super.has(h2(this,t))}set(t,n){return super.set(yne(this,t),n)}delete(t){return super.delete(bne(this,t))}}function h2({_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 f4;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 f4(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 m2(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function g2(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function p4(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?f4: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));p4(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 g2(e);if(t>=1)return m2(e);var r,a=(r-1)*t,i=Math.floor(a),o=m2(p4(e,i).subarray(0,i+1)),c=g2(e.subarray(i+1));return o+(c-o)*(a-i)}}function Ane(e,t,n=d4){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 p2,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 p2;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 h4(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return h4(t())},e}function Bd(){return h4(of.apply(null,arguments).paddingInner(1))}function $C(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function m4(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*",Da="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ene=/^#([0-9a-f]{3,8})$/,Pne=new RegExp(`^rgb\\(${Lc},${Lc},${Lc}\\)$`),Tne=new RegExp(`^rgb\\(${Da},${Da},${Da}\\)$`),Rne=new RegExp(`^rgba\\(${Lc},${Lc},${Lc},${cf}\\)$`),One=new RegExp(`^rgba\\(${Da},${Da},${Da},${cf}\\)$`),Mne=new RegExp(`^hsl\\(${cf},${Da},${Da}\\)$`),Ine=new RegExp(`^hsla\\(${cf},${Da},${Da},${cf}\\)$`),v2={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:x2,formatHex:x2,formatHex8:$ne,formatHsl:Dne,formatRgb:y2,toString:y2});function x2(){return this.rgb().formatHex()}function $ne(){return this.rgb().formatHex8()}function Dne(){return g4(this).formatHsl()}function y2(){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?b2(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))?S2(t[1],t[2]/100,t[3]/100,1):(t=Ine.exec(e))?S2(t[1],t[2]/100,t[3]/100,t[4]):v2.hasOwnProperty(e)?b2(v2[e]):e==="transparent"?new rs(NaN,NaN,NaN,0):null}function b2(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,m4(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:w2,formatHex:w2,formatHex8:Fne,formatRgb:j2,toString:j2}));function w2(){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 j2(){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 S2(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 g4(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?g4(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,m4(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(rj(e>=240?e-240:e+120,a,r),rj(e,a,r),rj(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new ha(N2(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("}${N2(this.h)}, ${Ph(this.s)*100}%, ${Ph(this.l)*100}%${e===1?")":`, ${e})`}`}}));function N2(e){return e=(e||0)%360,e<0?e+360:e}function Ph(e){return Math.max(0,Math.min(1,e||0))}function rj(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?v4:function(t,n){return n-t?qne(t,n,e):DC(isNaN(t)?n:t)}}function v4(e,t){var n=t-e;return n?Bne(e,n):DC(isNaN(e)?t:e)}const C2=(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=v4(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,sj=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=sj.lastIndex=0,r,a,i,o=-1,c=[],d=[];for(e=e+"",t=t+"";(r=g1.exec(e))&&(a=sj.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=sj.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,C2):Qne:t instanceof uf?C2: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 _2=[0,1];function Dr(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=_2,t=_2,n=Ru,r,a,i,o=Dr,c,d,f;function h(){var v=Math.min(e.length,t.length);return o!==Dr&&(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:Dr,h()):o!==Dr},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()(Dr,Dr)}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 A2(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 k2={"%":(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)=>A2(e*100,t),r:A2,s:lre,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function E2(e){return e}var P2=Array.prototype.map,T2=["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?E2:sre(P2.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?E2:are(P2.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"):k2[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=k2[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?T2[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,Z=O<N?new Array(N-O+1).join(x):"";switch(_&&S&&(F=t(Z+F,Z.length?N-H.length:1/0),Z=""),j){case"<":F=G+F+H+Z;break;case"=":F=G+Z+F+H;break;case"^":F=Z.slice(0,O=Z.length>>1)+G+F+H+Z.slice(O);break;default:F=Z+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:T2[8+x/3]});return function(y){return b(j*y)}}return{format:f,formatPrefix:h}}var Th,BC,x4;ure({thousands:",",grouping:[3],currency:["$",""]});function ure(e){return Th=cre(e),BC=Th.format,x4=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 y4(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),x4(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 y4(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 b4(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 b4(e).unknown(t)},e=arguments.length?Array.from(e,Sm):[0,1],Co(n)}function w4(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 R2(e){return Math.log(e)}function O2(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 M2(e){return(t,n)=>-e(-t,n)}function qC(e){const t=e(R2,O2),n=t.domain;let r=10,a,i;function o(){return a=xre(r),i=vre(r),n()[0]<0?(a=M2(a),i=M2(i),e(hre,mre)):e(R2,O2),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(w4(n(),{floor:c=>i(Math.floor(a(c))),ceil:c=>i(Math.ceil(a(c)))})),t}function j4(){const e=qC(rv()).domain([1,10]);return e.copy=()=>tp(e,j4()).base(e.base()),Qs.apply(e,arguments),e}function I2(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function $2(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function UC(e){var t=1,n=e(I2(t),$2(t));return n.constant=function(r){return arguments.length?e(I2(t=+r),$2(t)):t},Co(n)}function S4(){var e=UC(rv());return e.copy=function(){return tp(e,S4()).constant(e.constant())},Qs.apply(e,arguments)}function D2(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(Dr,Dr),n=1;function r(){return n===1?e(Dr,Dr):n===.5?e(yre,bre):e(D2(n),D2(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 L2(e){return Math.sign(e)*e*e}function jre(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function N4(){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(L2(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(L2)),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 N4(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Qs.apply(a,arguments),Co(a)}function C4(){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 C4().domain(e).range(t).unknown(r)},Qs.apply(i,arguments)}function _4(){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 _4().domain([e,t]).range(a).unknown(i)},Qs.apply(Co(o),arguments)}function A4(){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 A4().domain(e).range(t).unknown(n)},Qs.apply(a,arguments)}const aj=new Date,ij=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)=>(aj.setTime(+i),ij.setTime(+o),e(aj),e(ij),Math.floor(n(aj,ij))),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 ui=1e3,Ds=ui*60,di=Ds*60,Ci=di*24,HC=Ci*7,F2=Ci*30,oj=Ci*365,sl=or(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ui)},(e,t)=>(t-e)/ui,e=>e.getUTCSeconds());sl.range;const KC=or(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ui)},(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()*ui-e.getMinutes()*Ds)},(e,t)=>{e.setTime(+e+t*di)},(e,t)=>(t-e)/di,e=>e.getHours());YC.range;const XC=or(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*di)},(e,t)=>(t-e)/di,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 k4=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));k4.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 E4(e,t,n,r,a,i){const o=[[sl,1,ui],[sl,5,5*ui],[sl,15,15*ui],[sl,30,30*ui],[i,1,Ds],[i,5,5*Ds],[i,15,15*Ds],[i,30,30*Ds],[a,1,di],[a,3,3*di],[a,6,6*di],[a,12,12*di],[r,1,Ci],[r,2,2*Ci],[n,1,HC],[t,1,F2],[t,3,3*F2],[e,1,oj]];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/oj,h/oj,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]=E4(Ai,ZC,iv,k4,XC,GC),[Ore,Mre]=E4(_i,QC,av,np,YC,KC);function lj(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 cj(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:Z,c:null,d:V2,e:V2,f:sse,g:hse,G:gse,H:tse,I:nse,j:rse,L:P4,m:ase,M:ise,p:q,q:z,Q:G2,s:Y2,S:ose,u:lse,U:cse,V:use,w:dse,W:fse,x:null,X:null,y:pse,Y:mse,Z:vse,"%":K2},A={a:K,A:J,b:re,B:he,c:null,d:H2,e:H2,f:wse,g:Tse,G:Ose,H:xse,I:yse,j:bse,L:R4,m:jse,M:Sse,p:oe,q:me,Q:G2,s:Y2,S:Nse,u:Cse,U:_se,V:Ase,w:kse,W:Ese,x:null,X:null,y:Pse,Y:Rse,Z:Mse,"%":K2},k={a:D,A:U,b:F,B:G,c:H,d:U2,e:U2,f:Qre,g:q2,G:B2,H:W2,I:W2,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:q2,Y:B2,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(ie,ge){return function(Re){var Q=[],Ne=-1,Fe=0,pt=ie.length,ot,bt,wt;for(Re instanceof Date||(Re=new Date(+Re));++Ne<pt;)ie.charCodeAt(Ne)===37&&(Q.push(ie.slice(Fe,Ne)),(bt=z2[ot=ie.charAt(++Ne)])!=null?ot=ie.charAt(++Ne):bt=ot==="e"?" ":"0",(wt=ge[ot])&&(ot=wt(Re,bt)),Q.push(ot),Fe=Ne+1);return Q.push(ie.slice(Fe,Ne)),Q.join("")}}function P(ie,ge){return function(Re){var Q=jd(1900,void 0,1),Ne=R(Q,ie,Re+="",0),Fe,pt;if(Ne!=Re.length)return null;if("Q"in Q)return new Date(Q.Q);if("s"in Q)return new Date(Q.s*1e3+("L"in Q?Q.L:0));if(ge&&!("Z"in Q)&&(Q.Z=0),"p"in Q&&(Q.H=Q.H%12+Q.p*12),Q.m===void 0&&(Q.m="q"in Q?Q.q:0),"V"in Q){if(Q.V<1||Q.V>53)return null;"w"in Q||(Q.w=1),"Z"in Q?(Fe=cj(jd(Q.y,0,1)),pt=Fe.getUTCDay(),Fe=pt>4||pt===0?Em.ceil(Fe):Em(Fe),Fe=sv.offset(Fe,(Q.V-1)*7),Q.y=Fe.getUTCFullYear(),Q.m=Fe.getUTCMonth(),Q.d=Fe.getUTCDate()+(Q.w+6)%7):(Fe=lj(jd(Q.y,0,1)),pt=Fe.getDay(),Fe=pt>4||pt===0?km.ceil(Fe):km(Fe),Fe=np.offset(Fe,(Q.V-1)*7),Q.y=Fe.getFullYear(),Q.m=Fe.getMonth(),Q.d=Fe.getDate()+(Q.w+6)%7)}else("W"in Q||"U"in Q)&&("w"in Q||(Q.w="u"in Q?Q.u%7:"W"in Q?1:0),pt="Z"in Q?cj(jd(Q.y,0,1)).getUTCDay():lj(jd(Q.y,0,1)).getDay(),Q.m=0,Q.d="W"in Q?(Q.w+6)%7+Q.W*7-(pt+5)%7:Q.w+Q.U*7-(pt+6)%7);return"Z"in Q?(Q.H+=Q.Z/100|0,Q.M+=Q.Z%100,cj(Q)):lj(Q)}}function R(ie,ge,Re,Q){for(var Ne=0,Fe=ge.length,pt=Re.length,ot,bt;Ne<Fe;){if(Q>=pt)return-1;if(ot=ge.charCodeAt(Ne++),ot===37){if(ot=ge.charAt(Ne++),bt=k[ot in z2?ge.charAt(Ne++):ot],!bt||(Q=bt(ie,Re,Q))<0)return-1}else if(ot!=Re.charCodeAt(Q++))return-1}return Q}function M(ie,ge,Re){var Q=f.exec(ge.slice(Re));return Q?(ie.p=h.get(Q[0].toLowerCase()),Re+Q[0].length):-1}function D(ie,ge,Re){var Q=x.exec(ge.slice(Re));return Q?(ie.w=j.get(Q[0].toLowerCase()),Re+Q[0].length):-1}function U(ie,ge,Re){var Q=p.exec(ge.slice(Re));return Q?(ie.w=v.get(Q[0].toLowerCase()),Re+Q[0].length):-1}function F(ie,ge,Re){var Q=S.exec(ge.slice(Re));return Q?(ie.m=N.get(Q[0].toLowerCase()),Re+Q[0].length):-1}function G(ie,ge,Re){var Q=b.exec(ge.slice(Re));return Q?(ie.m=y.get(Q[0].toLowerCase()),Re+Q[0].length):-1}function H(ie,ge,Re){return R(ie,t,ge,Re)}function L(ie,ge,Re){return R(ie,n,ge,Re)}function I(ie,ge,Re){return R(ie,r,ge,Re)}function Y(ie){return o[ie.getDay()]}function W(ie){return i[ie.getDay()]}function O(ie){return d[ie.getMonth()]}function Z(ie){return c[ie.getMonth()]}function q(ie){return a[+(ie.getHours()>=12)]}function z(ie){return 1+~~(ie.getMonth()/3)}function K(ie){return o[ie.getUTCDay()]}function J(ie){return i[ie.getUTCDay()]}function re(ie){return d[ie.getUTCMonth()]}function he(ie){return c[ie.getUTCMonth()]}function oe(ie){return a[+(ie.getUTCHours()>=12)]}function me(ie){return 1+~~(ie.getUTCMonth()/3)}return{format:function(ie){var ge=E(ie+="",_);return ge.toString=function(){return ie},ge},parse:function(ie){var ge=P(ie+="",!1);return ge.toString=function(){return ie},ge},utcFormat:function(ie){var ge=E(ie+="",A);return ge.toString=function(){return ie},ge},utcParse:function(ie){var ge=P(ie+="",!0);return ge.toString=function(){return ie},ge}}}var z2={"-":"",_:" ",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 B2(e,t,n){var r=mr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function q2(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 U2(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 W2(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 V2(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 P4(e,t){return un(e.getMilliseconds(),t,3)}function sse(e,t){return P4(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 T4(e){var t=e.getDay();return t>=4||t===0?Jc(e):Jc.ceil(e)}function use(e,t){return e=T4(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=T4(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 H2(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 R4(e,t){return un(e.getUTCMilliseconds(),t,3)}function wse(e,t){return R4(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 O4(e){var t=e.getUTCDay();return t>=4||t===0?eu(e):eu.ceil(e)}function Ase(e,t){return e=O4(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=O4(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 K2(){return"%"}function G2(e){return+e}function Y2(e){return Math.floor(+e/1e3)}var vc,M4,I4;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),M4=vc.format,vc.parse,I4=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(w4(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,M4).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,I4).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function ov(){var e=0,t=1,n,r,a,i,o=Dr,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 $4(){var e=Co(ov()(Dr));return e.copy=function(){return _o(e,$4())},Oi.apply(e,arguments)}function D4(){var e=qC(ov()).domain([1,10]);return e.copy=function(){return _o(e,D4()).base(e.base())},Oi.apply(e,arguments)}function L4(){var e=UC(ov());return e.copy=function(){return _o(e,L4()).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 F4(){var e=[],t=Dr;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 F4(t).domain(e)},Oi.apply(n,arguments)}function lv(){var e=0,t=.5,n=1,r=1,a,i,o,c,d,f=Dr,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 z4(){var e=Co(lv()(Dr));return e.copy=function(){return _o(e,z4())},Oi.apply(e,arguments)}function B4(){var e=qC(lv()).domain([.1,1,10]);return e.copy=function(){return _o(e,B4()).base(e.base())},Oi.apply(e,arguments)}function q4(){var e=UC(lv());return e.copy=function(){return _o(e,q4()).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 X2=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:of,scaleDiverging:z4,scaleDivergingLog:B4,scaleDivergingPow:t_,scaleDivergingSqrt:Bse,scaleDivergingSymlog:q4,scaleIdentity:b4,scaleImplicit:h1,scaleLinear:_m,scaleLog:j4,scaleOrdinal:IC,scalePoint:Bd,scalePow:VC,scaleQuantile:C4,scaleQuantize:_4,scaleRadial:N4,scaleSequential:$4,scaleSequentialLog:D4,scaleSequentialPow:e_,scaleSequentialQuantile:F4,scaleSequentialSqrt:zse,scaleSequentialSymlog:L4,scaleSqrt:wre,scaleSymlog:S4,scaleThreshold:A4,scaleTime:Lse,scaleUtc:Fse,tickFormat:y4},Symbol.toStringTag,{value:"Module"}));var uj,Q2;function cv(){if(Q2)return uj;Q2=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 uj=t,uj}var dj,Z2;function U4(){if(Z2)return dj;Z2=1;function e(t,n){return t>n}return dj=e,dj}var fj,J2;function qse(){if(J2)return fj;J2=1;var e=cv(),t=U4(),n=Tu();function r(a){return a&&a.length?e(a,n,t):void 0}return fj=r,fj}var Use=qse();const uv=vn(Use);var pj,eM;function W4(){if(eM)return pj;eM=1;function e(t,n){return t<n}return pj=e,pj}var hj,tM;function Wse(){if(tM)return hj;tM=1;var e=cv(),t=W4(),n=Tu();function r(a){return a&&a.length?e(a,n,t):void 0}return hj=r,hj}var Vse=Wse();const dv=vn(Vse);var mj,nM;function Hse(){if(nM)return mj;nM=1;var e=vC(),t=Ka(),n=JL(),r=as();function a(i,o){var c=r(i)?e:n;return c(i,t(o,3))}return mj=a,mj}var gj,rM;function Kse(){if(rM)return gj;rM=1;var e=QL(),t=Hse();function n(r,a){return e(t(r,a),1)}return gj=n,gj}var Gse=Kse();const Yse=vn(Gse);var vj,sM;function Xse(){if(sM)return vj;sM=1;var e=PC();function t(n,r){return e(n,r)}return vj=t,vj}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,V4=9007199254740991,Pm=Mu(V4/Pn),xt={};xt.absoluteValue=xt.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};xt.comparedTo=xt.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};xt.decimalPlaces=xt.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};xt.dividedBy=xt.div=function(e){return mi(this,new this.constructor(e))};xt.dividedToIntegerBy=xt.idiv=function(e){var t=this,n=t.constructor;return wn(mi(t,new n(e),0,1),n.precision)};xt.equals=xt.eq=function(e){return!this.cmp(e)};xt.exponent=function(){return Qn(this)};xt.greaterThan=xt.gt=function(e){return this.cmp(e)>0};xt.greaterThanOrEqualTo=xt.gte=function(e){return this.cmp(e)>=0};xt.isInteger=xt.isint=function(){return this.e>this.d.length-2};xt.isNegative=xt.isneg=function(){return this.s<0};xt.isPositive=xt.ispos=function(){return this.s>0};xt.isZero=function(){return this.s===0};xt.lessThan=xt.lt=function(e){return this.cmp(e)<0};xt.lessThanOrEqualTo=xt.lte=function(e){return this.cmp(e)<1};xt.logarithm=xt.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))};xt.minus=xt.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?G4(t,e):H4(t,(e.s=-e.s,e))};xt.modulo=xt.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)};xt.naturalExponential=xt.exp=function(){return K4(this)};xt.naturalLogarithm=xt.ln=function(){return ff(this)};xt.negated=xt.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};xt.plus=xt.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?H4(t,e):G4(t,(e.s=-e.s,e))};xt.precision=xt.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};xt.squareRoot=xt.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=Ia(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),Ia(i.d).slice(0,o)===(t=Ia(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)};xt.times=xt.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};xt.toDecimalPlaces=xt.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(qa(e,0,Ou),t===void 0?t=r.rounding:qa(t,0,8),wn(n,e+Qn(n)+1,t))};xt.toExponential=function(e,t){var n,r=this,a=r.constructor;return e===void 0?n=bl(r,!0):(qa(e,0,Ou),t===void 0?t=a.rounding:qa(t,0,8),r=wn(new a(r),e+1,t),n=bl(r,!0,e+1)),n};xt.toFixed=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?bl(a):(qa(e,0,Ou),t===void 0?t=i.rounding:qa(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)};xt.toInteger=xt.toint=function(){var e=this,t=e.constructor;return wn(new t(e),Qn(e)+1,t.rounding)};xt.toNumber=function(){return+this};xt.toPower=xt.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)<=V4){for(a=new d(vs),t=Math.ceil(r/Pn+4),Dn=!1;n%2&&(a=a.times(c),iM(a.d,t)),n=Mu(n/2),n!==0;)c=c.times(c),iM(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=K4(a),a.s=i,a};xt.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)):(qa(e,1,Ou),t===void 0?t=i.rounding:qa(t,0,8),a=wn(new i(a),e,t),n=Qn(a),r=bl(a,e<=n||n<=i.toExpNeg,e)),r};xt.toSignificantDigits=xt.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(qa(e,1,Ou),t===void 0?t=r.rounding:qa(t,0,8)),wn(new r(n),e,t)};xt.toString=xt.valueOf=xt.val=xt.toJSON=xt[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 H4(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 qa(e,t,n){if(e!==~~e||e<t||e>n)throw Error(dl+e)}function Ia(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 K4(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)),Ia(o.d).slice(0,c)===Ia(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 xj(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),xj(b,f);if(f+=v,b.precision=f,n=Ia(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=Ia(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=xj(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)),Ia(d.d).slice(0,f)===Ia(c.d).slice(0,f))return c=c.times(2),i!==0&&(c=c.plus(xj(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 aM(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 G4(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=Ia(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 iM(e,t){if(e.length>t)return e.length=t,!0}function Y4(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 aM(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))aM(o,i);else throw Error(dl+i)}if(a.prototype=xt,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=Y4,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_=Y4(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},X4={},Q4=function(t){return t===X4},oM=function(t){return function n(){return arguments.length===0||arguments.length===1&&Q4(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},oae=function e(t,n){return t===1?n:oM(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!==X4}).length;return o>=t?n.apply(void 0,a):e(t-o,oM(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 Q4(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("")},Z4=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)||J4(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)||J4(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 J4(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 eF(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 tF(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 nF(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=tF(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?nF(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=eF([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=nF(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=eF([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=tF(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=Z4(jae),Cae=Z4(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 lM(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 lM(e,t)}}function lM(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,aF(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,rF()?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 rF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(rF=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 sF(e,t,n){return t=aF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aF(e){var t=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),Z=L(_+P);k.push({x1:Y,y1:Z,x2:W,y2:Z}),k.push({x1:I,y1:O,x2:I,y2:Z}),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);sF(sp,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});sF(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 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 Ho(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){Uae(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 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 iF=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 uM(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 dM(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?dM(Object(n),!0).forEach(function(r){Fc(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dM(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(Ir(p-h)!==Ir(v-p)){var j=[];if(Ir(v-p)===Ir(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:$r(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=$r(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(uM(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=$r(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(uM(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=iF({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},oF=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 oF(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},lF=function(t,n,r,a,i){var o=n.map(function(d){var f=d.props.dataKey;return r==="number"&&f&&oF(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},[])},cF=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?Ir(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}})},yj=new WeakMap,Rh=function(t,n){if(typeof n!="function")return t;yj.has(t)||yj.set(t,new WeakMap);var r=yj.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},uF=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:(X2[d]||Bd)(),realScaleType:X2[d]?d:"point"}}return Vt(a)?{scale:a}:{scale:Bd(),realScaleType:"point"}},fM=1e-4,dF=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])-fM,o=Math.max(a[0],a[1])+fM,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)},fF=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 pM(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 hM=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])},pF=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})},mM=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,gM=/^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(mM.test(t[0])){var i=+mM.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(gM.test(t[1])){var o=+gM.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},vM=function(t,n,r){return!t||!t.length||rp(t,bs(r,"type.defaultProps.domain"))?n:t},hF=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 xM(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?xM(Object(n),!0).forEach(function(r){mF(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mF(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 yM(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 yM(e,t)}}function yM(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}},gF=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=$r(t.cx,o,o/2),p=$r(t.cy,c,c/2),v=gF(o,c,r),x=$r(t.innerRadius,v,0),j=$r(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=uF(N,i),M=R.realScaleType,D=R.scale;D.domain(_).range(k),dF(D);var U=fF(D,oi(oi({},N),{},{realScaleType:M})),F=oi(oi(oi({},N),U),{},{range:k,radius:j,realScaleType:M,scale:D,cx:h,cy:p,innerRadius:x,outerRadius:j,startAngle:d,endAngle:f});return oi(oi({},y),{},mF({},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},bM=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?oi(oi({},n),{},{radius:o,angle:_ie(x,n)}):null},vF=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 wM(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?wM(Object(n),!0).forEach(function(r){Iie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function 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=Ir(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+$r(i.x,f),y:d+$r(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 xF=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=xF(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=xF;hr.renderCallByParent=Vie;var bj,jM;function Hie(){if(jM)return bj;jM=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return bj=e,bj}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 SM(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 NM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SM(Object(n),!0).forEach(function(r){noe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function 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 CM(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=CM(e,Yie),a=r.data,i=r.dataKey,o=r.clockWise,c=r.id,d=r.textBreakAll,f=CM(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:NM(NM({},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 _M(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 AM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_M(Object(n),!0).forEach(function(r){coe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_M(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=Ir(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}},yF=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=Ir(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
|
-
`):yF({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},bF=function(t){var n=AM(AM({},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=$r(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=yF({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 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 EM(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){moe(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 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 PM={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?PM["".concat(r).concat(n==="vertical"?"Y":"X")]:PM[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 EM(EM({},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=bL().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}))},wj={exports:{}},jj,TM;function boe(){if(TM)return jj;TM=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return jj=e,jj}var Sj,RM;function woe(){if(RM)return Sj;RM=1;var e=boe();function t(){}function n(){}return n.resetWarningCache=t,Sj=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},Sj}var OM;function joe(){return OM||(OM=1,wj.exports=woe()()),wj.exports}var Soe=joe();const hn=vn(Soe),{getOwnPropertyNames:Noe,getOwnPropertySymbols:Coe}=Object,{hasOwnProperty:_oe}=Object.prototype;function Nj(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 MM(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:IM,keys:$M}=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 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.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=$M(e);let a=r.length;if($M(t).length!==a)return!1;for(;a-- >0;)if(!wF(e,t,n,r[a]))return!1;return!0}function Ad(e,t,n){const r=MM(e);let a=r.length;if(MM(t).length!==a)return!1;let i,o,c;for(;a-- >0;)if(i=r[a],!wF(e,t,n,i)||(o=IM(e,i),c=IM(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 LM(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 wF(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?Nj(DM,Ad):DM,areNumbersEqual:Loe,areObjectsEqual:n?Ad:Foe,arePrimitiveWrappersEqual:zoe,areRegExpsEqual:Boe,areSetsEqual:n?Nj(LM,Ad):LM,areTypedArraysEqual:n?Nj(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 FM(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 zM(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 zM(e,t)}}function zM(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"){FM(a.bind(null,f),d);return}a(d),FM(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 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 qM(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){jF(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 jF(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 qM(qM({},r),{},jF({},a,t(a,n[a])))},{})},UM=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)||SF(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)||SF(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 SF(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,NF=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},CF=function(t,n){return t.map(function(r,a){return r*Math.pow(n,a)}).reduce(function(r,a){return r+a})},WM=function(t,n){return function(r){var a=NF(t,n);return CF(a,r)}},Ele=function(t,n){return function(r){var a=NF(t,n),i=[].concat(Cle(a.map(function(o,c){return o*c}).slice(1)),[0]);return CF(i,r)}},VM=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=WM(a,o),v=WM(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 VM(a);case"spring":return Ple();default:if(a.split("(")[0]==="cubic-bezier")return VM(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 HM(e){return Mle(e)||Ole(e)||_F(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 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 br(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){R1(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 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)||_F(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 _F(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,HM(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,HM(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 Cj(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 GM(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?GM(Object(n),!0).forEach(function(r){Md(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Md(e,t,n){return t=AF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function 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,AF(r.key),r)}}function Zle(e,t,n){return t&&Qle(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function AF(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 Ua=(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(Cj(b),[i.runJSAnimation.bind(i,{from:R.style,to:k,duration:N,easing:A}),N]);var D=UM(M,N,A),U=ia(ia(ia({},R.style),k),{},{transition:D});return[].concat(Cj(b),[U,N,P]).filter(yle)};return this.manager.start([d].concat(Cj(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=UM(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);Ua.displayName="Animate";Ua.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Ua.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 YM(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 YM(e,t)}}function YM(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 XM(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 QM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?XM(Object(n),!0).forEach(function(r){lce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function 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 ZM=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=QM(QM({},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(Ua,{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(Ua,{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:ZM(P,R,k,E,v),ref:r})))}):X.createElement("path",Bm({},It(n,!0),{className:_,d:ZM(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 JM(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 eI=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){eI(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),eI(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(JM(i),JM(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 tI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Nce(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tI(Object(n),!0).forEach(function(r){Cce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function 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)}))},_j,nI;function Rce(){if(nI)return _j;nI=1;var e=cv(),t=U4(),n=Ka();function r(a,i){return a&&a.length?e(a,n(i,2),t):void 0}return _j=r,_j}var Oce=Rce();const Mce=vn(Oce);var Aj,rI;function Ice(){if(rI)return Aj;rI=1;var e=cv(),t=Ka(),n=W4();function r(a,i){return a&&a.length?e(a,t(i,2),n):void 0}return Aj=r,Aj}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 sI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ko(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sI(Object(n),!0).forEach(function(r){mv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aI(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 iI(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,EF(r.key),r)}}function qce(e,t,n){return t&&iI(e.prototype,t),n&&iI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Uce(e,t,n){return t=qm(t),Wce(e,kF()?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 kF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(kF=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=EF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EF(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=aI(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=aI(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",vF(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 oI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Go(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oI(Object(n),!0).forEach(function(r){vv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Gce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lI(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,TF(r.key),r)}}function Yce(e,t,n){return t&&lI(e.prototype,t),n&&lI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Xce(e,t,n){return t=Um(t),Qce(e,PF()?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 PF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(PF=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=TF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TF(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,cI=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>cI?o=a==="outer"?"start":"end":i<-cI?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",vF(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 kj,uI;function nue(){if(uI)return kj;uI=1;var e=UL(),t=e(Object.getPrototypeOf,Object);return kj=t,kj}var Ej,dI;function rue(){if(dI)return Ej;dI=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 Ej=f,Ej}var sue=rue();const aue=vn(sue);var Pj,fI;function iue(){if(fI)return Pj;fI=1;var e=Ti(),t=Ri(),n="[object Boolean]";function r(a){return a===!0||a===!1||t(a)&&e(a)==n}return Pj=r,Pj}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 pI(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 pI(e,t)}}function pI(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 hI(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 mI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hI(Object(n),!0).forEach(function(r){hue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function 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 gI=function(t,n,r,a,i){var o=r-a,c;return c="M ".concat(t,",").concat(n),c+="L ".concat(t+r,",").concat(n),c+="L ".concat(t+r-o/2,",").concat(n+i),c+="L ".concat(t+r-o/2-a,",").concat(n+i),c+="L ".concat(t,",").concat(n," Z"),c},vue={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},xue=function(t){var n=mI(mI({},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(Ua,{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(Ua,{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:gI(P,R,A,k,E),ref:r})))}):X.createElement("g",null,X.createElement("path",Wm({},It(n,!0),{className:N,d:gI(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 vI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Vm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vI(Object(n),!0).forEach(function(r){jue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function 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 xI(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(bF,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 RF(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(xI,{shapeType:n,elementProps:h})}else{var p=d;f=X.createElement(xI,{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 yI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Sn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yI(Object(n),!0).forEach(function(r){$s(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Iue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,MF(r.key),r)}}function $ue(e,t,n){return t&&bI(e.prototype,t),n&&bI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Due(e,t,n){return t=Hm(t),Lue(e,OF()?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 OF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(OF=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=MF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MF(e){var t=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(RF,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(Ua,{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=Ir(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=gF(a,i),c=r+$r(e.cx,a,a/2),d=n+$r(e.cy,i,i/2),f=$r(e.innerRadius,o,0),h=$r(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+Ir(b)*d*(D!==0?1:0):G=o;var H=G+Ir(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:Ir(b)*d}),P})}return Sn(Sn({},j),{},{sectors:E,data:a})});var Tj,wI;function que(){if(wI)return Tj;wI=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 Tj=n,Tj}var Rj,jI;function IF(){if(jI)return Rj;jI=1;var e=a4(),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 Rj=r,Rj}var Oj,SI;function Uue(){if(SI)return Oj;SI=1;var e=que(),t=tv(),n=IF();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 Oj=r,Oj}var Mj,NI;function Wue(){if(NI)return Mj;NI=1;var e=Uue(),t=e();return Mj=t,Mj}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 CI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function _I(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CI(Object(n),!0).forEach(function(r){$F(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $F(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 _I(_I({},i),{},$F({},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 AI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ij(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AI(Object(n),!0).forEach(function(r){ps(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,LF(r.key),r)}}function Que(e,t,n){return t&&kI(e.prototype,t),n&&kI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Zue(e,t,n){return t=Ym(t),Jue(e,DF()?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 DF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(DF=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=LF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LF(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}},EI=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=EI(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=EI(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=Ij(Ij({},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 Ij({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 $j,PI;function sde(){if(PI)return $j;PI=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 $j=t,$j}var Dj,TI;function ade(){if(TI)return Dj;TI=1;var e=$L(),t=Ka(),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 Dj=i,Dj}var ide=ade();const ode=vn(ide);var La=function(t,n){var r=t.alwaysShow,a=t.ifOverflow;return r&&(a="extendDomain"),a===n},Lj,RI;function lde(){if(RI)return Lj;RI=1;var e=e4();function t(n,r,a){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):n[r]=a}return Lj=t,Lj}var Fj,OI;function cde(){if(OI)return Fj;OI=1;var e=lde(),t=ZL(),n=Ka();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 Fj=r,Fj}var ude=cde();const dde=vn(ude);var zj,MI;function fde(){if(MI)return zj;MI=1;function e(t,n){for(var r=-1,a=t==null?0:t.length;++r<a;)if(!n(t[r],r,t))return!1;return!0}return zj=e,zj}var Bj,II;function pde(){if(II)return Bj;II=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 Bj=t,Bj}var qj,$I;function hde(){if($I)return qj;$I=1;var e=fde(),t=pde(),n=Ka(),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 qj=i,qj}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 DI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function kd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DI(Object(n),!0).forEach(function(r){xde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function 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 LI(e){return X.createElement(RF,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"],FF;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 FI(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?FI(Object(n),!0).forEach(function(r){co(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kde(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 Ede(e,t,n){return t&&zI(e.prototype,t),n&&zI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pde(e,t,n){return t=Qm(t),Tde(e,zF()?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 zF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(zF=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=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=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(LI,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(Ua,{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(LI,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);FF=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(_,FF.defaultProps.minPointSize)(U[1],D);if(j==="horizontal"){var W,O=[o.scale(U[0]),o.scale(U[1])],Z=O[0],q=O[1];F=hM({axis:i,ticks:c,bandSize:a,offset:x.offset,entry:M,index:D}),G=(W=q??Z)!==null&&W!==void 0?W:void 0,H=x.size;var z=Z-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=Ir(L||Y)*(Math.abs(Y)-Math.abs(L));G-=K,L+=K}}else{var J=[i.scale(U[0]),i.scale(U[1])],re=J[0],he=J[1];if(F=re,G=hM({axis:o,ticks:d,bandSize:a,offset:x.offset,entry:M,index:D}),H=he-re,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 oe=Ir(H||Y)*(Math.abs(Y)-Math.abs(H));H+=oe}}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:[hF(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 BI(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,qF(r.key),r)}}function $de(e,t,n){return t&&BI(e.prototype,t),n&&BI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function qI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ca(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qI(Object(n),!0).forEach(function(r){wv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wv(e,t,n){return t=qF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qF(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 UF=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,re){re>0&&(G=Math.min((J||0)-(H[re-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=$r(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=uF(b,i,v),Z=O.scale,q=O.realScaleType;Z.domain(S).range(R),dF(Z);var z=fF(Z,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:Z,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))},{})},WF=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 WF({x:n,y:r},{x:a,y:i})},VF=(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(VF,"EPS",1e-4);var i_=function(t){var n=Object.keys(t).reduce(function(r,a){return ca(ca({},r),{},wv({},a,VF.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)},Uj,UI;function Bde(){if(UI)return Uj;UI=1;var e=Ka(),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 Uj=r,Uj}var Wj,WI;function qde(){if(WI)return Wj;WI=1;var e=IF();function t(n){var r=e(n),a=r%1;return r===r?a?r-a:r:0}return Wj=t,Wj}var Vj,VI;function Ude(){if(VI)return Vj;VI=1;var e=KL(),t=Ka(),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 Vj=a,Vj}var Hj,HI;function Wde(){if(HI)return Hj;HI=1;var e=Bde(),t=Ude(),n=e(t);return Hj=n,Hj}Wde();var Vde=cL();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("")}),HF=m.createContext(void 0),KF=m.createContext(void 0),GF=m.createContext(void 0),Gde=m.createContext({}),YF=m.createContext(void 0),XF=m.createContext(0),QF=m.createContext(0),KI=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(HF.Provider,{value:r},X.createElement(KF.Provider,{value:a},X.createElement(Gde.Provider,{value:i},X.createElement(GF.Provider,{value:h},X.createElement(YF.Provider,{value:o},X.createElement(XF.Provider,{value:f},X.createElement(QF.Provider,{value:d},c)))))))},Yde=function(){return m.useContext(YF)},ZF=function(t){var n=m.useContext(HF);n==null&&wl();var r=n[t];return r==null&&wl(),r},JF=function(t){var n=m.useContext(KF);n==null&&wl();var r=n[t];return r==null&&wl(),r},Xde=function(){var t=m.useContext(GF);return t},ez=function(){return m.useContext(QF)},tz=function(){return m.useContext(XF)};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,rz(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,nz()?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 nz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nz=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 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 YI(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){o_(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 o_(e,t,n){return t=rz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rz(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 XI(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 XI(e,t)}}function XI(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(La(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(La(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 La(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=ZF(a),p=JF(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=La(e,"hidden")?"url(#".concat(f,")"):void 0,D=YI(YI({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 QI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ZI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QI(Object(n),!0).forEach(function(r){jv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function 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,az(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,sz()?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 sz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(sz=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=az(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function az(e){var t=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 La(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=La(this.props,"hidden")?"url(#".concat(d,")"):void 0,N=ZI(ZI({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 JI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function e$(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JI(Object(n),!0).forEach(function(r){Nv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function 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,oz(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,iz()?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 iz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(iz=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=oz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oz(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 La(i,"discard")&&(!v.isInRange(x)||!v.isInRange(j))?null:WF(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=La(this.props,"hidden")?"url(#".concat(h,")"):void 0;return X.createElement(cn,{className:Yt("recharts-reference-area",d)},t.renderRect(b,e$(e$({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 lz(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 lz(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:lz(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 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 Ar(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){Ife(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 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=Ar(Ar({},x),{},{tickCoord:y>0?x.coordinate-y*e:x.coordinate})}else i[v]=x=Ar(Ar({},x),{},{tickCoord:x.coordinate});var S=tg(e,x.tickCoord,b,c,d);S&&(d=x.tickCoord-e*(b()/2+a),i[v]=Ar(Ar({},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=Ar(Ar({},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]=Ar(Ar({},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]=_=Ar(Ar({},_),{},{tickCoord:E<0?_.coordinate-E*e:_.coordinate})}else o[N]=_=Ar(Ar({},_),{},{tickCoord:_.coordinate});var P=tg(e,_.tickCoord,k,d,f);P&&(d=_.tickCoord+e*(k()/2+a),o[N]=Ar(Ar({},_),{},{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?Ir(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 n$(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?n$(Object(n),!0).forEach(function(r){c_(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):n$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kj(e,t){if(e==null)return{};var n=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 r$(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,uz(r.key),r)}}function Hfe(e,t,n){return t&&r$(e.prototype,t),n&&r$(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Kfe(e,t,n){return t=ng(t),Gfe(e,cz()?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 cz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(cz=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=uz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uz(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=Kj(r,Bfe),c=this.props,d=c.viewBox,f=Kj(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=Kj(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 s$(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 a$(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?a$(Object(n),!0).forEach(function(r){ua(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a$(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 i$(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,fz(r.key),r)}}function ipe(e,t,n){return t&&i$(e.prototype,t),n&&i$(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ope(e,t,n){return t=rg(t),lpe(e,dz()?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 dz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(dz=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=fz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fz(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=s$(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(Ua,{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=s$(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:pM({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:pM({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,mz(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,pz()?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 pz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(pz=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 hz(e,t,n){return t=mz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mz(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=ez(),r=tz(),a=ZF(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);hz(yo,"displayName","XAxis");hz(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,xz(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,gz()?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 gz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(gz=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 vz(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=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=ez(),a=tz(),i=JF(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);vz(bo,"displayName","YAxis");vz(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 o$(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(o$(o),o$(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&&La(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&&La(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},Gj={exports:{}},l$;function Mpe(){return l$||(l$=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})(Gj)),Gj.exports}var Ipe=Mpe();const $pe=vn(Ipe);var Yj=new $pe,Xj="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,yz(r.key),r)}}function Fpe(e,t,n){return t&&Lpe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Qj(e,t,n){return t=yz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yz(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),Qj(this,"activeIndex",0),Qj(this,"coordinateList",[]),Qj(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 bz(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 bz(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 c$(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?c$(Object(n),!0).forEach(function(r){Vpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c$(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=bz(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=bF}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 u$(e,t){return Jpe(e)||Zpe(e,t)||jz(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 d$(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,Sz(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,wz()?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 wz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(wz=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)||jz(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 jz(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 f$(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 Pe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?f$(Object(n),!0).forEach(function(r){$t(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $t(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=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%"},Nz={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 Pe(Pe(Pe({},a),Cn(a.cx,a.cy,c,o)),{},{angle:o,radius:c})}var d=i.coordinate,f=a.angle;return Pe(Pe(Pe({},a),Cn(a.cx,a.cy,d,f)),{},{angle:f,radius:d})}return Nz},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 Cz(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),[hF(f,v)]):d},[])},p$=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=cF(h,i);return r.reduce(function(j,b){var y,S=b.type.defaultProps!==void 0?Pe(Pe({},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=Cz(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=vM(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=vM(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,re=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 re===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]:pF(c[M].stackGroups,d,f):F=lF(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 Z=Y,q=F.every(function(z){return Z.indexOf(z)>=0});q&&(F=Z)}}return Pe(Pe({},j),{},$t({},M,Pe(Pe({},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=cF(h,i),b=-1;return r.reduce(function(y,S){var N=S.type.defaultProps!==void 0?Pe(Pe({},S.type.defaultProps),S.props):S.props,_=N[o],A=Cz("number");if(!y[_]){b++;var k;return j?k=Km(0,x):c&&c[_]&&c[_].hasStack?(k=pF(c[_].stackGroups,d,f),k=lN(p,k,_,i)):(k=C1(A,lF(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)),Pe(Pe({},y),{},$t({},_,Pe(Pe({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)}},h$=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})},m$=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?Pe(Pe({},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?Pe(Pe({},k),{},$t({},R,bs(k,"".concat(R))+P.height)):k},{top:v.top||0,bottom:v.bottom||0}),S=Pe(Pe({},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 Pe(Pe({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=m$(D),L=H.numericAxisName,I=H.cateAxisName,Y=bhe(_),W=[];return _.forEach(function(O,Z){var q=Av(S.data,{graphicalItems:[O],dataStartIndex:P,dataEndIndex:R}),z=O.type.defaultProps!==void 0?Pe(Pe({},O.type.defaultProps),O.props):O.props,K=z.dataKey,J=z.maxBarSize,re=z["".concat(L,"Id")],he=z["".concat(I,"Id")],oe={},me=d.reduce(function(Ee,tt){var ct=N["".concat(tt.axisType,"Map")],Pt=z["".concat(tt.axisType,"Id")];ct&&ct[Pt]||tt.axisType==="zAxis"||wl();var Xt=ct[Pt];return Pe(Pe({},Ee),{},$t($t({},tt.axisType,Xt),"".concat(tt.axisType,"Ticks"),al(Xt)))},oe),ie=me[I],ge=me["".concat(I,"Ticks")],Re=A&&A[re]&&A[re].hasStack&&fie(O,A[re].stackGroups),Q=pi(O.type).indexOf("Bar")>=0,Ne=Om(ie,ge),Fe=[],pt=Y&&Jae({barSize:M,stackGroups:A,totalSize:jhe(me,I)});if(Q){var ot,bt,wt=Ht(J)?G:J,et=(ot=(bt=Om(ie,ge,!0))!==null&&bt!==void 0?bt:wt)!==null&&ot!==void 0?ot:0;Fe=eie({barGap:U,barCategoryGap:F,bandSize:et!==Ne?et:Ne,sizeList:pt[he],maxBarSize:wt}),et!==Ne&&(Fe=Fe.map(function(Ee){return Pe(Pe({},Ee),{},{position:Pe(Pe({},Ee.position),{},{offset:Ee.position.offset-et/2})})}))}var _e=O&&O.type&&O.type.getComposedData;_e&&W.push({props:Pe(Pe({},_e(Pe(Pe({},me),{},{displayedData:q,props:S,dataKey:K,item:O,bandSize:Ne,barPosition:Fe,offset:k,stackedData:Re,layout:D,dataStartIndex:P,dataEndIndex:R}))),{},$t($t($t({key:O.key||"item-".concat(Z)},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(!TT({props:_}))return null;var P=_.children,R=_.layout,M=_.stackOffset,D=_.data,U=_.reverseStackOrder,F=m$(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 Pe(Pe({},z),{},$t({},J,xhe(_,Pe(Pe({},K),{},{graphicalItems:L,stackGroups:K.axisType===G&&I,dataStartIndex:A,dataEndIndex:k}))))},{}),W=whe(Pe(Pe({},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")],Z=yhe(O),q=v(_,Pe(Pe({},Y),{},{dataStartIndex:A,dataEndIndex:k,updateId:E,graphicalItems:L,stackGroups:I,offset:W}));return Pe(Pe({formattedGraphicalItems:q,graphicalItems:L,offset:W,stackGroups:I},Z),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(Pe({legendBBox:E},x({props:k.props,dataStartIndex:R,dataEndIndex:M,updateId:D},Pe(Pe({},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 Pe({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=Pe(Pe({},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?Pe(Pe({},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=Pe(Pe({},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&&Yj.emit(Xj,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(Pe({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 Z=Pe(Pe({},Y),{},{x:Y.left,y:Y.top}),q=Math.min(G,Z.x+Z.width),z=Math.min(H,Z.y+Z.height),K=W[L]&&W[L].value,J=dN(k.state,k.props.data,L),re=W[L]?{x:R==="horizontal"?W[L].coordinate:q,y:R==="horizontal"?z:W[L].coordinate}:Nz;k.setState(Pe(Pe({},E),{},{activeLabel:K,activeCoordinate:re,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?Pe(Pe({},U),E.props):E.props,G=D&&D[F["".concat(M,"Id")]];return m.cloneElement(E,Pe(Pe({},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(Z){return Z.coordinate}),polarRadius:Array.isArray(D)?D:al(H,!0).map(function(Z){return Z.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=iF({children:R,formattedGraphicalItems:E,legendWidth:F,legendContent:f});if(!G)return null;var H=G.item,L=d$(G,Ype);return m.cloneElement(H,Pe(Pe({},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:Pe(Pe({},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,Z=O===void 0?L.yAxisId:O;return m.cloneElement(E,{key:E.key||"".concat(P,"-").concat(R),xAxis:F[W],yAxis:G[Z],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?Pe(Pe({},P.item.type.defaultProps),P.item.props):P.item.props,L=H.activeDot,I=H.dataKey,Y=Pe(Pe({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,Pe(Pe({},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,Z=W.isRange,q=W.baseLine,z=M.item.type.defaultProps!==void 0?Pe(Pe({},M.item.type.defaultProps),M.item.props):M.item.props,K=z.activeDot,J=z.hide,re=z.activeBar,he=z.activeShape,oe=!!(!J&&F&&Y&&(K||re||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 ie=m.cloneElement(E,Pe(Pe({},M.props),me));function ge(tt){return typeof G.dataKey=="function"?G.dataKey(tt.payload):null}if(oe)if(H>=0){var Re,Q;if(G.dataKey&&!G.allowDuplicatedCategory){var Ne=typeof G.dataKey=="function"?ge:"payload.".concat(G.dataKey.toString());Re=im(O,Ne,L),Q=Z&&q&&im(q,Ne,L)}else Re=O?.[H],Q=Z&&q&&q[H];if(he||re){var Fe=E.props.activeIndex!==void 0?E.props.activeIndex:H;return[m.cloneElement(E,Pe(Pe(Pe({},M.props),me),{},{activeIndex:Fe})),null,null]}if(!Ht(Re))return[ie].concat(vu(k.renderActivePoints({item:M,activePoint:Re,basePoint:Q,childIndex:H,isRange:Z})))}else{var pt,ot=(pt=k.getItemByXY(k.state.activeCoordinate))!==null&&pt!==void 0?pt:{graphicalItem:ie},bt=ot.graphicalItem,wt=bt.item,et=wt===void 0?E:wt,_e=bt.childIndex,Ee=Pe(Pe(Pe({},M.props),me),{},{activeIndex:_e});return[m.cloneElement(et,Ee),null,null]}return Z?[ie,null,null]:[ie,null]}),$t(k,"renderCustomized",function(E,P,R){return m.cloneElement(E,Pe(Pe({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=i4(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=Pe(Pe({},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=p$(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 Pe(Pe({},P),{},{xValue:Y,yValue:W},H)}return H?Pe(Pe({},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 bM({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 Pe(Pe({},P),E)}},{key:"addListener",value:function(){Yj.on(Xj,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Yj.removeListener(Xj,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=u$(k,2),P=E[0],R=E[1];return Pe(Pe({},A),{},$t({},P,R.scale))},{}):null}},{key:"getYScales",value:function(){var _=this.state.yAxisMap;return _?Object.entries(_).reduce(function(A,k){var E=u$(k,2),P=E[0],R=E[1];return Pe(Pe({},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?Pe(Pe({},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 bM(_,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:Pe(Pe({},M),{},{childIndex:Y}),payload:kf(M,E)?F.data[I]:M.props.data[I]}}}return null}},{key:"render",value:function(){var _=this;if(!TT(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=d$(A,Xpe),H=It(G,!1);if(D)return X.createElement(KI,{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(),OT(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(KI,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},X.createElement("div",Rc({className:Yt("recharts-wrapper",E),style:Pe({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(),OT(k,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(m.Component);$t(j,"displayName",n),$t(j,"defaultProps",Pe({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=h$(y);return Pe(Pe(Pe({},F),{},{updateId:0},x(Pe(Pe({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=h$(y),H={chartX:S.chartX,chartY:S.chartY,isTooltipActive:S.isTooltipActive},L=Pe(Pe({},p$(S,_,P)),{},{updateId:S.updateId+1}),I=Pe(Pe(Pe({},G),H),L);return Pe(Pe(Pe({},I),x(Pe({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,Z,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=(Z=q.props)===null||Z===void 0?void 0:Z.endIndex)!==null&&O!==void 0?O:U,J=z!==D||K!==U,re=!Ht(_),he=re&&!J?S.updateId:S.updateId+1;return Pe(Pe({updateId:he},x(Pe(Pe({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:UF}),She=u_({chartName:"BarChart",GraphicalChild:zl,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:yo},{axisType:"yAxis",AxisComp:bo}],formatAxisMap:UF}),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 g$=10080*60*1e3;function v$(e){return e.length===0?0:e.reduce((t,n)=>t+n,0)/e.length}function x$(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-g$,Z=O-g$,q=new Date(W).toISOString(),z=new Date(O).toISOString(),K=new Date(Z).toISOString(),J=new Date(O-1).toISOString(),re=new Date(Y).toISOString(),he=async(oe,me)=>t.listRunSummaries?(await t.listRunSummaries({since:oe,until:me})).map(il):t.listResults({since:oe,until:me});return Promise.all([t.listResults({since:q,until:re}),he(z,re),he(K,J)]).then(([oe,me,ie])=>{I&&(i(oe),c(me),f(ie))}).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),_=v$(d.map(I=>I.overallPassRate)),A=v$(d.map(I=>I.avgLatency)),k=(S-_)*100,E=N-A,P=d.length>0,R=P?`${x$(k,1)}% from last week`:"No prior-week baseline",M=P?`${x$(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(qD,{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(ee,{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(ee,{variant:"outline",asChild:!0,children:s.jsxs(Tt,{to:"/run",children:[s.jsx(ga,{className:"mr-2 h-4 w-4"}),"Run Evaluation"]})}),s.jsx(ee,{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:ID,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:VD,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(ft,{children:"Run ID"}),s.jsx(ft,{children:"Evaluated"}),s.jsx(ft,{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(ft,{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(ft,{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(ft,{className:"text-right",children:"Avg Tool Calls"}),s.jsx(ft,{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(va,{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(Oa,{rate:I.overallPassRate}),s.jsx(iL,{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(ee,{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:Te("relative",r),children:[s.jsx(Et,{value:e,onChange:o=>t(o.target.value),placeholder:n,className:Te("h-9 w-[240px] pr-8",a)}),e&&s.jsx(ee,{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 Zj="rovingFocusGroup.onEntryFocus",Ahe={bubbles:!1,cancelable:!0},ap="RovingFocusGroup",[pN,_z,khe]=Ff(ap),[Ehe,kv]=jr(ap,[khe]),[Phe,The]=Ehe(ap),Az=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})})}));Az.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=_z(n),k=m.useRef(!1),[E,P]=m.useState(0);return m.useEffect(()=>{const R=v.current;if(R)return R.addEventListener(Zj,_),()=>R.removeEventListener(Zj,_)},[_]),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(ut.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(Zj,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);Pz(L,h)}}k.current=!1}),onBlur:qe(e.onBlur,()=>N(!1))})})}),kz="RovingFocusGroupItem",Ez=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(kz,n),p=h.currentTabStopId===f,v=_z(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(ut.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(()=>Pz(_))}}),children:typeof o=="function"?o({isCurrentTabStop:p,hasTabStop:b!=null}):o})})});Ez.displayName=kz;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 Pz(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 Tz=Az,Rz=Ez;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"],Oz=["ArrowUp","PageDown","End"],Whe=[...Uhe,...Oz],Vhe={ltr:[...hN,"ArrowRight"],rtl:[...hN,"ArrowLeft"]},Hhe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ip="Menu",[If,Khe,Ghe]=Ff(ip),[Bl,Mz]=jr(ip,[Ghe,jo,kv]),Ev=jo(),Iz=kv(),[Yhe,ql]=Bl(ip),[Xhe,op]=Bl(ip),$z=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})})})};$z.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,Dz]=Bl(h_,{forceMount:void 0}),Lz=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})})})};Lz.displayName=h_;var Ls="MenuContent",[Jhe,m_]=Bl(Ls),Fz=m.forwardRef((e,t)=>{const n=Dz(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),_=Iz(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 Z=D.current+O,q=A().filter(oe=>!oe.disabled),z=document.activeElement,K=q.find(oe=>oe.ref.current===z)?.textValue,J=q.map(oe=>oe.textValue),re=hme(J,Z,K),he=q.find(oe=>oe.textValue===re)?.ref.current;(function oe(me){D.current=me,window.clearTimeout(M.current),me!==""&&(M.current=window.setTimeout(()=>oe(""),1e3))})(Z),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(Tz,{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":tB(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(oe=>!oe.disabled).map(oe=>oe.ref.current);Oz.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 Z=O.target,q=H.current!==O.clientX;if(O.currentTarget.contains(Z)&&q){const z=O.clientX>H.current?"right":"left";G.current=z,H.current=O.clientX}}))})})})})})})});Fz.displayName=Ls;var rme="MenuGroup",v_=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(ut.div,{role:"group",...r,ref:t})});v_.displayName=rme;var sme="MenuLabel",zz=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(ut.div,{...r,ref:t})});zz.displayName=sme;var og="MenuItem",y$="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(y$,{bubbles:!0,cancelable:!0});p.addEventListener(y$,x=>r?.(x),{once:!0}),$N(p,v),v.defaultPrevented?f.current=!1:o.onClose()}};return s.jsx(Bz,{...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 Bz=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:a,...i}=e,o=m_(og,n),c=Iz(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(Rz,{asChild:!0,...c,focusable:!r,children:s.jsx(ut.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",qz=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...a}=e;return s.jsx(Kz,{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})})})});qz.displayName=ame;var Uz="MenuRadioGroup",[ime,ome]=Bl(Uz,{value:void 0,onValueChange:()=>{}}),Wz=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})})});Wz.displayName=Uz;var Vz="MenuRadioItem",Hz=m.forwardRef((e,t)=>{const{value:n,...r}=e,a=ome(Vz,e.__scopeMenu),i=n===a.value;return s.jsx(Kz,{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})})})});Hz.displayName=Vz;var x_="MenuItemIndicator",[Kz,lme]=Bl(x_,{checked:!1}),Gz=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(ut.span,{...a,ref:t,"data-state":y_(i.checked)})})});Gz.displayName=x_;var cme="MenuSeparator",Yz=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(ut.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Yz.displayName=cme;var ume="MenuArrow",Xz=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=Ev(n);return s.jsx(Eg,{...a,...r,ref:t})});Xz.displayName=ume;var dme="MenuSub",[Xbe,Qz]=Bl(dme),Id="MenuSubTrigger",Zz=m.forwardRef((e,t)=>{const n=ql(Id,e.__scopeMenu),r=op(Id,e.__scopeMenu),a=Qz(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(Bz,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":tB(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())})})})});Zz.displayName=Id;var Jz="MenuSubContent",eB=m.forwardRef((e,t)=>{const n=Dz(Ls,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=ql(Ls,e.__scopeMenu),o=op(Ls,e.__scopeMenu),c=Qz(Jz,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())})})})})})});eB.displayName=Jz;function tB(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=$z,xme=p_,yme=Lz,bme=Fz,wme=v_,jme=zz,Sme=Pv,Nme=qz,Cme=Wz,_me=Hz,Ame=Gz,kme=Yz,Eme=Xz,Pme=Zz,Tme=eB,Tv="DropdownMenu",[Rme]=jr(Tv,[Mz]),Br=Mz(),[Ome,nB]=Rme(Tv),rB=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})})};rB.displayName=Tv;var sB="DropdownMenuTrigger",aB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...a}=e,i=nB(sB,n),o=Br(n);return s.jsx(xme,{asChild:!0,...o,children:s.jsx(ut.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())})})})});aB.displayName=sB;var Mme="DropdownMenuPortal",iB=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Br(t);return s.jsx(yme,{...r,...n})};iB.displayName=Mme;var oB="DropdownMenuContent",lB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=nB(oB,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)"}})});lB.displayName=oB;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",cB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Br(n);return s.jsx(jme,{...a,...r,ref:t})});cB.displayName=Dme;var Lme="DropdownMenuItem",uB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Br(n);return s.jsx(Sme,{...a,...r,ref:t})});uB.displayName=Lme;var Fme="DropdownMenuCheckboxItem",dB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Br(n);return s.jsx(Nme,{...a,...r,ref:t})});dB.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",fB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Br(n);return s.jsx(_me,{...a,...r,ref:t})});fB.displayName=qme;var Ume="DropdownMenuItemIndicator",pB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Br(n);return s.jsx(Ame,{...a,...r,ref:t})});pB.displayName=Ume;var Wme="DropdownMenuSeparator",hB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Br(n);return s.jsx(kme,{...a,...r,ref:t})});hB.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",mB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Br(n);return s.jsx(Pme,{...a,...r,ref:t})});mB.displayName=Kme;var Gme="DropdownMenuSubContent",gB=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)"}})});gB.displayName=Gme;var Yme=rB,Xme=aB,Qme=iB,vB=lB,xB=cB,yB=uB,bB=dB,wB=fB,jB=pB,SB=hB,NB=mB,CB=gB;const lp=Yme,cp=Xme,Zme=m.forwardRef(({className:e,inset:t,children:n,...r},a)=>s.jsxs(NB,{ref:a,className:Te("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=NB.displayName;const Jme=m.forwardRef(({className:e,...t},n)=>s.jsx(CB,{ref:n,className:Te("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=CB.displayName;const $u=m.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(Qme,{children:s.jsx(vB,{ref:r,sideOffset:t,className:Te("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=vB.displayName;const Or=m.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(yB,{ref:r,className:Te("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}));Or.displayName=yB.displayName;const ege=m.forwardRef(({className:e,children:t,checked:n,...r},a)=>s.jsxs(bB,{ref:a,className:Te("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(jB,{children:s.jsx(qc,{className:"h-4 w-4"})})}),t]}));ege.displayName=bB.displayName;const tge=m.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(wB,{ref:r,className:Te("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(jB,{children:s.jsx(C9,{className:"h-2 w-2 fill-current"})})}),t]}));tge.displayName=wB.displayName;const _B=m.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(xB,{ref:r,className:Te("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));_B.displayName=xB.displayName;const AB=m.forwardRef(({className:e,...t},n)=>s.jsx(SB,{ref:n,className:Te("-mx-1 my-1 h-px bg-muted",e),...t}));AB.displayName=SB.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]=jr(Sl,[uge,jo]),Iv=jo(),[dge,ko]=Du(Sl),[fge,pge]=Du(Sl),kB=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(ZB,{"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]})})};kB.displayName=Sl;var EB="SelectTrigger",PB=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,i=Iv(n),o=ko(EB,n),c=o.disabled||r,d=Mt(t,o.onTriggerChange),f=Mv(n),h=m.useRef("touch"),[p,v,x]=e6(b=>{const y=f().filter(_=>!_.disabled),S=y.find(_=>_.value===o.value),N=t6(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(ut.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":JB(o.value)?"":void 0,...a,ref:d,onClick: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())})})})});PB.displayName=EB;var TB="SelectValue",RB=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:i,placeholder:o="",...c}=e,d=ko(TB,n),{onValueNodeHasChildrenChange:f}=d,h=i!==void 0,p=Mt(t,d.onValueNodeChange);return ir(()=>{f(h)},[f,h]),s.jsx(ut.span,{...c,ref:p,style:{pointerEvents:"none"},children:JB(d.value)?s.jsx(s.Fragment,{children:o}):i})});RB.displayName=TB;var hge="SelectIcon",OB=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return s.jsx(ut.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});OB.displayName=hge;var mge="SelectPortal",MB=e=>s.jsx(Rl,{asChild:!0,...e});MB.displayName=mge;var Nl="SelectContent",IB=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($B,{scope:e.__scopeSelect,children:s.jsx(Ov.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),i):null}return s.jsx(DB,{...e,ref:t})});IB.displayName=Nl;var oa=10,[$B,Eo]=Du(Nl),gge="SelectContentImpl",vge=nge("SelectContent.RemoveScroll"),DB=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,oe=>A(oe)),[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(oe=>{const[me,...ie]=F().map(Q=>Q.ref.current),[ge]=ie.slice(-1),Re=document.activeElement;for(const Q of oe)if(Q===Re||(Q?.scrollIntoView({block:"nearest"}),Q===me&&k&&(k.scrollTop=0),Q===ge&&k&&(k.scrollTop=k.scrollHeight),Q?.focus(),document.activeElement!==Re))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 oe={x:0,y:0};const me=ge=>{oe={x:Math.abs(Math.round(ge.pageX)-(O.current?.x??0)),y:Math.abs(Math.round(ge.pageY)-(O.current?.y??0))}},ie=ge=>{oe.x<=10&&oe.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",ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",me),document.removeEventListener("pointerup",ie,{capture:!0})}}},[_,W,O]),m.useEffect(()=>{const oe=()=>W(!1);return window.addEventListener("blur",oe),window.addEventListener("resize",oe),()=>{window.removeEventListener("blur",oe),window.removeEventListener("resize",oe)}},[W]);const[Z,q]=e6(oe=>{const me=F().filter(Re=>!Re.disabled),ie=me.find(Re=>Re.ref.current===document.activeElement),ge=t6(me,oe,ie);ge&&setTimeout(()=>ge.ref.current.focus())}),z=m.useCallback((oe,me,ie)=>{const ge=!L.current&&!ie;(N.value!==void 0&&N.value===me||ge)&&(M(oe),ge&&(L.current=!0))},[N.value]),K=m.useCallback(()=>_?.focus(),[_]),J=m.useCallback((oe,me,ie)=>{const ge=!L.current&&!ie;(N.value!==void 0&&N.value===me||ge)&&U(oe)},[N.value]),re=r==="popper"?mN:LB,he=re===mN?{side:c,sideOffset:d,align:f,alignOffset:h,arrowPadding:p,collisionBoundary:v,collisionPadding:x,sticky:j,hideWhenDetached:b,avoidCollisions:y}:{};return s.jsx($B,{scope:n,content:_,viewport:k,onViewportChange:E,itemRefCallback:z,selectedItem:R,onItemLeave:K,itemTextRefCallback:J,focusSelectedItem:Y,selectedItemText:D,position:r,isPositioned:G,searchRef:Z,children:s.jsx(Vf,{as:vge,allowPinchZoom:!0,children:s.jsx(Wf,{asChild:!0,trapped:N.open,onMountAutoFocus:oe=>{oe.preventDefault()},onUnmountAutoFocus:qe(a,oe=>{N.trigger?.focus({preventScroll:!0}),oe.preventDefault()}),children:s.jsx(Tl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:oe=>oe.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:s.jsx(re,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:oe=>oe.preventDefault(),...S,...he,onPlaced:()=>H(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:qe(S.onKeyDown,oe=>{const me=oe.ctrlKey||oe.altKey||oe.metaKey;if(oe.key==="Tab"&&oe.preventDefault(),!me&&oe.key.length===1&&q(oe.key),["ArrowUp","ArrowDown","Home","End"].includes(oe.key)){let ge=F().filter(Re=>!Re.disabled).map(Re=>Re.ref.current);if(["ArrowUp","End"].includes(oe.key)&&(ge=ge.slice().reverse()),["ArrowUp","ArrowDown"].includes(oe.key)){const Re=oe.target,Q=ge.indexOf(Re);ge=ge.slice(Q+1)}setTimeout(()=>I(ge)),oe.preventDefault()}})})})})})})});DB.displayName=gge;var xge="SelectItemAlignedPosition",LB=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 Re=D.left-R.left,Q=M.left-Re,Ne=P.left-Q,Fe=P.width+Ne,pt=Math.max(Fe,R.width),ot=window.innerWidth-oa,bt=Df(Q,[oa,Math.max(oa,ot-pt)]);c.style.minWidth=Fe+"px",c.style.left=bt+"px"}else{const Re=R.right-D.right,Q=window.innerWidth-M.right-Re,Ne=window.innerWidth-P.right-Q,Fe=P.width+Ne,pt=Math.max(Fe,R.width),ot=window.innerWidth-oa,bt=Df(Q,[oa,Math.max(oa,ot-pt)]);c.style.minWidth=Fe+"px",c.style.right=bt+"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,Z=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,re=F-J,he=y.offsetHeight/2,oe=y.offsetTop+he,me=L+I+oe,ie=O-me;if(me<=J){const Re=U.length>0&&y===U[U.length-1].ref.current;c.style.bottom="0px";const Q=f.clientHeight-b.offsetTop-b.offsetHeight,Ne=Math.max(re,he+(Re?K:0)+Q+Y),Fe=me+Ne;c.style.height=Fe+"px"}else{const Re=U.length>0&&y===U[0].ref.current;c.style.top="0px";const Ne=Math.max(J,L+b.offsetTop+(Re?z:0)+he)+ie;c.style.height=Ne+"px",b.scrollTop=me-J+b.offsetTop}c.style.margin=`${oa}px 0`,c.style.minHeight=Z+"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(ut.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});LB.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",FB=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(ut.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})})})]})});FB.displayName=gN;var zB="SelectGroup",[wge,jge]=Du(zB),Sge=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=ar();return s.jsx(wge,{scope:n,id:a,children:s.jsx(ut.div,{role:"group","aria-labelledby":a,...r,ref:t})})});Sge.displayName=zB;var BB="SelectLabel",qB=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=jge(BB,n);return s.jsx(ut.div,{id:a.id,...r,ref:t})});qB.displayName=BB;var cg="SelectItem",[Nge,UB]=Du(cg),WB=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(ut.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())})})})})});WB.displayName=cg;var $d="SelectItemText",VB=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...i}=e,o=ko($d,n),c=Eo($d,n),d=UB($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(ut.span,{id:d.textId,...i,ref:v}),d.isSelected&&o.valueNode&&!o.valueNodeHasChildren?bu.createPortal(i.children,o.valueNode):null]})});VB.displayName=$d;var HB="SelectItemIndicator",KB=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return UB(HB,n).isSelected?s.jsx(ut.span,{"aria-hidden":!0,...r,ref:t}):null});KB.displayName=HB;var vN="SelectScrollUpButton",GB=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(XB,{...e,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop-d.offsetHeight)}}):null});GB.displayName=vN;var xN="SelectScrollDownButton",YB=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(XB,{...e,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop+d.offsetHeight)}}):null});YB.displayName=xN;var XB=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(ut.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",QB=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx(ut.div,{"aria-hidden":!0,...r,ref:t})});QB.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",ZB=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(ut.select,{...n,style:{...pD,...n.style},ref:i,defaultValue:t})});ZB.displayName=Age;function JB(e){return e===""||e===void 0}function e6(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 t6(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=kB,n6=PB,Pge=RB,Tge=OB,Rge=MB,r6=IB,Oge=FB,s6=qB,a6=WB,Mge=VB,Ige=KB,i6=GB,o6=YB,l6=QB;const In=Ege,$n=Pge,Tn=m.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(n6,{ref:r,className:Te("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=n6.displayName;const c6=m.forwardRef(({className:e,...t},n)=>s.jsx(i6,{ref:n,className:Te("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(ma,{className:"h-4 w-4"})}));c6.displayName=i6.displayName;const u6=m.forwardRef(({className:e,...t},n)=>s.jsx(o6,{ref:n,className:Te("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(tn,{className:"h-4 w-4"})}));u6.displayName=o6.displayName;const Rn=m.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>s.jsx(Rge,{children:s.jsxs(r6,{ref:a,className:Te("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(c6,{}),s.jsx(Oge,{className:Te("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(u6,{})]})}));Rn.displayName=r6.displayName;const $ge=m.forwardRef(({className:e,...t},n)=>s.jsx(s6,{ref:n,className:Te("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));$ge.displayName=s6.displayName;const mt=m.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(a6,{ref:r,className:Te("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})]}));mt.displayName=a6.displayName;const Dge=m.forwardRef(({className:e,...t},n)=>s.jsx(l6,{ref:n,className:Te("-mx-1 my-1 h-px bg-muted",e),...t}));Dge.displayName=l6.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)",d6="__ROOT__",b$="mcplab.configurations.collapsedSuites",Jj=e=>e.suitePath&&e.suitePath.trim().length>0?e.suitePath.trim():null,Yo=e=>e??Lge,eS=e=>e===null?d6:`suite:${e}`,Fge=e=>e===d6?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"}},w$=["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))%w$.length,0);return w$[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(b$);if(!K)return new Set;const J=JSON.parse(K);return Array.isArray(J)?new Set(J.filter(re=>typeof re=="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 re=await i.getLatestPassRatesByConfigIds({lastDays:365,configs:e.map(he=>({id:he.id,sourcePath:he.sourcePath,relativePath:he.relativePath,configHash:he.configHash}))});K||R(re);return}R({})}catch{K||R({})}})(),()=>{K=!0}},[e,i]);const U=async(K,J)=>{await t(K),Ie({title:"Deleted",description:`"${J}" has been removed.`})},F=async K=>{const J=await n(K);Ie({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 re=Jj(J);if(K.add(re),!re)continue;const he=re.split("/").filter(Boolean);for(let oe=1;oe<he.length;oe+=1)K.add(he.slice(0,oe).join("/"))}return Array.from(K).sort((J,re)=>Yo(J).localeCompare(Yo(re)))},[e]),I=m.useMemo(()=>e.filter(K=>{const J=Jj(K),re=x==="all"?void 0:Fge(x),he=Yo(J);return re!==void 0&&!zge(J,re)?!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,re)=>{let he=0;return c==="name"&&(he=ao(J).localeCompare(ao(re))),c==="scenarios"&&(he=H(J)-H(re)),c==="agents"&&(he=G(J)-G(re)),c==="updatedAt"&&(he=new Date(J.updatedAt).getTime()-new Date(re.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 re=new Set(J);return re.has(K)?re.delete(K):re.add(K),re})},Z=async(K,J,re)=>{if(_.has(K))return;const he=e.find(me=>me.id===K),oe=he?bN(he):[];A(me=>new Set(me).add(K));try{await i.startRun({configPath:J,runsPerScenario:1,...oe.length>0?{agents:oe}:{}}),N(me=>new Set(me).add(K)),window.setTimeout(()=>{N(me=>{const ie=new Set(me);return ie.delete(K),ie})},2e3),Ie({title:"Queued",description:`"${re}" added to run queue.`})}catch(me){Ie({title:"Could not queue evaluation",description:me instanceof Error?me.message:String(me),variant:"destructive"})}finally{A(me=>{const ie=new Set(me);return ie.delete(K),ie})}};m.useEffect(()=>{try{window.localStorage.setItem(b$,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,re)=>{if(!k.has(K)){E(he=>new Set(he).add(K));try{const he=re.filter(Q=>typeof Q.sourcePath=="string"&&Q.sourcePath.trim().length>0);if(he.length===0){Ie({title:"No runnable evaluations",description:`Suite "${J}" has no evaluation files with a source path.`,variant:"destructive"});return}const oe=await Promise.allSettled(he.map(Q=>{const Ne=bN(Q);return i.startRun({configPath:String(Q.sourcePath),runsPerScenario:1,...Ne.length>0?{agents:Ne}:{}})})),me=oe.filter(Q=>Q.status==="fulfilled").length,ie=oe.length-me,ge=oe.find(Q=>Q.status==="rejected"),Re=ge?ge.reason instanceof Error?ge.reason.message:String(ge.reason):void 0;Ie({title:ie===0?"Suite queued":"Suite queued with errors",description:ie===0?`Queued ${me} evaluation${me===1?"":"s"} for suite "${J}".`:`Queued ${me}/${he.length} evaluations for suite "${J}" (${ie} failed${Re?`: ${Re}`:""}).`,variant:ie===0?"default":"destructive"})}catch(he){Ie({title:"Could not queue suite",description:he instanceof Error?he.message:String(he),variant:"destructive"})}finally{E(he=>{const oe=new Set(he);return oe.delete(K),oe})}}},z=m.useMemo(()=>{const K=new Map;for(const J of Y){const re=Jj(J),he=K.get(re);he?he.push(J):K.set(re,[J])}return Array.from(K.entries()).sort((J,re)=>Yo(J[0]).localeCompare(Yo(re[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(zD,{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(mt,{value:"all",children:"All suites"}),L.map(K=>s.jsx(mt,{value:eS(K),children:Yo(K)},eS(K)))]})]}),s.jsxs(ee,{variant:"outline",size:"sm",onClick:()=>{a()},children:[s.jsx(zs,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(ee,{variant:"outline",size:"sm",children:[s.jsx(F9,{className:"mr-2 h-4 w-4"}),"Import YAML"]}),s.jsx(ee,{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(ft,{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(ft,{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(ft,{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(ft,{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(ft,{className:"text-right",children:"Last Run"}),s.jsx(ft,{className:"w-[220px] text-right"})]})}),s.jsxs(ts,{children:[z.map(([K,J])=>{const re=Yo(K),he=eS(K),oe=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":!oe,"aria-label":`${oe?"Expand":"Collapse"} suite ${re}`,children:[s.jsx(zN,{className:`h-3.5 w-3.5 text-muted-foreground transition-transform ${oe?"":"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:re}),s.jsxs("span",{className:"text-muted-foreground",children:["(",J.length,")"]})]}),s.jsxs(ee,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:me,onClick:()=>{q(he,re,J)},children:[s.jsx(ga,{className:"mr-1 h-3.5 w-3.5"}),me?"Queueing...":"Run Suite"]})]})})},`suite-${he}`),!oe&&J.map(ie=>{const ge=Uge(ie);return s.jsxs(Gt,{children:[s.jsx(He,{children:s.jsxs("div",{children:[s.jsx(Tt,{to:`/mcp-evaluations/${ie.id}`,className:"font-medium text-sm hover:text-primary",children:ao(ie)}),ie.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"]}),ie.relativePath&&s.jsx("div",{className:"mt-0.5",children:s.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:ie.relativePath})}),ie.loadError&&s.jsx("p",{className:"text-xs text-destructive mt-0.5 break-all",children:ie.loadError})]})}),s.jsx(He,{className:"text-right font-mono text-sm",children:H(ie)}),s.jsx(He,{className:"text-right font-mono text-sm",children:G(ie)}),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(va,{className:"h-3 w-3"}),new Date(ie.updatedAt).toLocaleDateString()]})}),s.jsx(He,{className:"text-right",children:typeof P[ie.id]=="number"?s.jsx("div",{className:"inline-flex justify-end",children:s.jsx(Oa,{rate:P[ie.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(ee,{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(Or,{onClick:()=>o(`/mcp-evaluations/${ie.id}`),children:[s.jsx(wg,{className:"mr-2 h-3.5 w-3.5"}),"Edit"]}),s.jsxs(Or,{onClick:()=>{F(ie.id)},children:[s.jsx(ss,{className:"mr-2 h-3.5 w-3.5"}),"Clone"]}),s.jsxs(Or,{className:"text-destructive",onClick:()=>{U(ie.id,ao(ie))},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(ee,{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(Ba,{children:ge.tooltipLabel})]})}),s.jsx(ji,{children:s.jsxs(Si,{children:[s.jsx(Ni,{asChild:!0,children:s.jsx(ee,{size:"sm",variant:"outline",className:`h-8 px-2 text-xs ${S.has(ie.id)?"border-green-600 bg-green-600 text-white hover:bg-green-700 hover:text-white":""}`,disabled:_.has(ie.id)||!ie.sourcePath,onClick:()=>ie.sourcePath&&void Z(ie.id,ie.sourcePath,ao(ie)),"aria-label":`Queue ${ao(ie)}`,children:S.has(ie.id)?"Queued":_.has(ie.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(Ba,{children:"Queue evaluation run"})]})}),s.jsx(ee,{size:"sm",variant:"outline",asChild:!0,children:s.jsxs(Tt,{to:`/run?configId=${encodeURIComponent(ie.id)}`,children:[s.jsx(ga,{className:"h-3.5 w-3.5"}),"Run"]})})]})})]},ie.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",f6=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())}}));f6.displayName=Gge;var p6=f6;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(p6,{ref:n,className:Te(Yge(),e),...t}));Ve.displayName=p6.displayName;const ba=m.forwardRef(({className:e,...t},n)=>s.jsx("textarea",{className:Te("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}));ba.displayName="Textarea";var $v="Tabs",[Xge]=jr($v,[kv]),h6=kv(),[Qge,w_]=Xge($v),m6=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(ut.div,{dir:h,"data-orientation":o,...f,ref:t})})});m6.displayName=$v;var g6="TabsList",v6=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,i=w_(g6,n),o=h6(n);return s.jsx(Tz,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:r,children:s.jsx(ut.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});v6.displayName=g6;var x6="TabsTrigger",y6=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...i}=e,o=w_(x6,n),c=h6(n),d=j6(o.baseId,r),f=S6(o.baseId,r),h=r===o.value;return s.jsx(Rz,{asChild:!0,...c,focusable:!a,active:h,children:s.jsx(ut.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)})})})});y6.displayName=x6;var b6="TabsContent",w6=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:i,...o}=e,c=w_(b6,n),d=j6(c.baseId,r),f=S6(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(ut.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})})});w6.displayName=b6;function j6(e,t){return`${e}-trigger-${t}`}function S6(e,t){return`${e}-content-${t}`}var Zge=m6,N6=v6,C6=y6,_6=w6;const Dv=Zge,up=m.forwardRef(({className:e,...t},n)=>s.jsx(N6,{ref:n,className:Te("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));up.displayName=N6.displayName;const Fa=m.forwardRef(({className:e,...t},n)=>s.jsx(C6,{ref:n,className:Te("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}));Fa.displayName=C6.displayName;const Lf=m.forwardRef(({className:e,...t},n)=>s.jsx(_6,{ref:n,className:Te("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=_6.displayName;const Jge={openai:"OpenAI",anthropic:"Anthropic",azure:"Azure OpenAI",azure_openai:"Azure OpenAI",google:"Google"};function ug(e){return Jge[e]??e}const j$={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 A6({provider:e}){return s.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${j$[e]??j$.custom}`,children:ug(e)})}var Lv="Checkbox",[eve]=jr(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 k6="CheckboxTrigger",E6=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_(k6,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(ut.button,{type:"button",role:"checkbox","aria-checked":po(d)?"mixed":d,"aria-required":f,"data-state":M6(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())})})});E6.displayName=k6;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(E6,{...p,ref:t,__scopeCheckbox:n}),v&&s.jsx(O6,{__scopeCheckbox:n})]})})});S_.displayName=Lv;var P6="CheckboxIndicator",T6=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,i=j_(P6,n);return s.jsx(Zn,{present:r||po(i.checked)||i.checked===!0,children:s.jsx(ut.span,{"data-state":M6(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});T6.displayName=P6;var R6="CheckboxBubbleInput",O6=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_(R6,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(ut.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%)"}})});O6.displayName=R6;function rve(e){return typeof e=="function"}function po(e){return e==="indeterminate"}function M6(e){return po(e)?"indeterminate":e?"checked":"unchecked"}const Lr=m.forwardRef(({className:e,...t},n)=>s.jsx(S_,{ref:n,className:Te("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(T6,{className:Te("flex items-center justify-center text-current"),children:s.jsx(qc,{className:"h-4 w-4"})})}));Lr.displayName=S_.displayName;var Fv="Collapsible",[sve]=jr(Fv),[ave,N_]=sve(Fv),I6=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(ut.div,{"data-state":__(d),"data-disabled":i?"":void 0,...c,ref:t})})});I6.displayName=Fv;var $6="CollapsibleTrigger",D6=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,a=N_($6,n);return s.jsx(ut.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)})});D6.displayName=$6;var C_="CollapsibleContent",L6=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})})});L6.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(ut.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=I6;const da=ove,Ms=D6,fa=L6;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 je{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+je.version}static addUnaryOp(t){return je.max_unop_len=Math.max(t.length,je.max_unop_len),je.unary_ops[t]=1,je}static addBinaryOp(t,n,r){return je.max_binop_len=Math.max(t.length,je.max_binop_len),je.binary_ops[t]=n,r?je.right_associative.add(t):je.right_associative.delete(t),je}static addIdentifierChar(t){return je.additional_identifier_chars.add(t),je}static addLiteral(t,n){return je.literals[t]=n,je}static removeUnaryOp(t){return delete je.unary_ops[t],t.length===je.max_unop_len&&(je.max_unop_len=je.getMaxKeyLen(je.unary_ops)),je}static removeAllUnaryOps(){return je.unary_ops={},je.max_unop_len=0,je}static removeIdentifierChar(t){return je.additional_identifier_chars.delete(t),je}static removeBinaryOp(t){return delete je.binary_ops[t],t.length===je.max_binop_len&&(je.max_binop_len=je.getMaxKeyLen(je.binary_ops)),je.right_associative.delete(t),je}static removeAllBinaryOps(){return je.binary_ops={},je.max_binop_len=0,je}static removeLiteral(t){return delete je.literals[t],je}static removeAllLiterals(){return je.literals={},je}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 je(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 je.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!je.binary_ops[String.fromCharCode(t)]||je.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return je.isIdentifierStart(t)||je.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(je.hooks[t]){const r={context:this,node:n};return je.hooks.run(t,r),r.node}return n}searchHook(t){if(je.hooks[t]){const n={context:this};return je.hooks[t].find(function(r){return r.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===je.SPACE_CODE||t===je.TAB_CODE||t===je.LF_CODE||t===je.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:je.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===je.SEMCOL_CODE||r===je.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,je.max_binop_len),n=t.length;for(;n>0;){if(je.binary_ops.hasOwnProperty(t)&&(!je.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!je.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:je.binaryPrecedence(n),right_a:je.right_associative.has(n)},c=this.gobbleToken(),c||this.throwError("Expected expression after "+n),a=[o,i,c];n=this.gobbleBinaryOp();){if(r=je.binaryPrecedence(n),r===0){this.index-=n.length;break}i={value:n,prec:r,right_a:je.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:je.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:je.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,je.isDecimalDigit(t)||t===je.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===je.SQUOTE_CODE||t===je.DQUOTE_CODE)a=this.gobbleStringLiteral();else if(t===je.OBRACK_CODE)a=this.gobbleArray();else{for(n=this.expr.substr(this.index,je.max_unop_len),r=n.length;r>0;){if(je.unary_ops.hasOwnProperty(n)&&(!je.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!je.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:je.UNARY_EXP,operator:n,argument:i,prefix:!0})}n=n.substr(0,--r)}je.isIdentifierStart(t)?(a=this.gobbleIdentifier(),je.literals.hasOwnProperty(a.name)?a={type:je.LITERAL,value:je.literals[a.name],raw:a.name}:a.name===je.this_str&&(a={type:je.THIS_EXP})):t===je.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===je.PERIOD_CODE||n===je.OBRACK_CODE||n===je.OPAREN_CODE||n===je.QUMARK_CODE;){let r;if(n===je.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==je.PERIOD_CODE)break;r=!0,this.index+=2,this.gobbleSpaces(),n=this.code}this.index++,n===je.OBRACK_CODE?(t={type:je.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},t.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),n=this.code,n!==je.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):n===je.OPAREN_CODE?t={type:je.CALL_EXP,arguments:this.gobbleArguments(je.CPAREN_CODE),callee:t}:(n===je.PERIOD_CODE||r)&&(r&&this.index--,this.gobbleSpaces(),t={type:je.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(;je.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===je.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);je.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++));je.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);je.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return r=this.code,je.isIdentifierStart(r)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(r===je.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===je.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:je.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:je.LITERAL,value:t,raw:this.expr.substring(n,this.index)}}gobbleIdentifier(){let t=this.code,n=this.index;for(je.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,je.isIdentifierPart(t));)this.index++;return{type:je.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===je.CPAREN_CODE&&a&&a>=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(i===je.COMMA_CODE){if(this.index++,a++,a!==n.length){if(t===je.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===je.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===je.COMPOUND)&&this.throwError("Expected comma"),n.push(o)}}return r||this.throwError("Expected "+String.fromCharCode(t)),n}gobbleGroup(){this.index++;let t=this.gobbleExpressions(je.CPAREN_CODE);if(this.code===je.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:je.SEQUENCE_EXP,expressions:t}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:je.ARRAY_EXP,elements:this.gobbleArguments(je.CBRACK_CODE)}}}const uve=new lve;Object.assign(je,{hooks:uve,plugins:new cve(je),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"});je.max_unop_len=je.getMaxKeyLen(je.unary_ops);je.max_binop_len=je.getMaxKeyLen(je.binary_ops);const ki=e=>new je(e).parse(),dve=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(je).filter(e=>!dve.includes(e)&&ki[e]===void 0).forEach(e=>{ki[e]=je[e]});ki.Jsep=je;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 S$=47,hve=92;var mve={name:"regex",init(e){e.hooks.add("gobble-token",function(n){if(this.code===S$){const r=++this.index;let a=!1;for(;this.index<this.expr.length;){if(this.code===S$&&!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 tS=43,gve=45,Nc={name:"assignment",assignmentOperators:new Set(["=","*=","**=","/=","%=","+=","-=","<<=",">>=",">>>=","&=","^=","|=","||=","&&=","??="]),updateOperators:[tS,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===tS?"++":"--",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===tS?"++":"--",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:Te("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(N$(t,r)){const v=C$(t[r]);r+=2;const x=[];for(;r<t.length&&t[r].includes("|")&&!a(t[r]);)x.push(C$(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(">")||N$(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 N$(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 C$(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:Te("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:Te("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 F6({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:Te("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:Te("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:Te(`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:Te("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(ee,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:t,onClick:()=>r?.(e.id),children:"Deny"}),s.jsx(ee,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:t,onClick:()=>n?.(e.id),children:"Approve"})]})]})]})}function z6(){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(wr,{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(ee,{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(_B,{children:t}),s.jsx(AB,{}),e.map(i=>s.jsx(Or,{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 B6({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(ba,{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(ee,{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(ee,{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(wr,{className:"h-4 w-4 animate-spin"})}):s.jsx(ee,{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,q6=m.forwardRef(({className:e,...t},n)=>s.jsx(_u,{ref:n,className:Te("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}));q6.displayName=_u.displayName;const U6=m.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(wve,{children:[s.jsx(q6,{}),s.jsxs(Au,{ref:r,className:Te("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"})]})]})]}));U6.displayName=Au.displayName;const W6=({className:e,...t})=>s.jsx("div",{className:Te("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});W6.displayName="DialogHeader";const V6=m.forwardRef(({className:e,...t},n)=>s.jsx(Hf,{ref:n,className:Te("text-lg font-semibold leading-none tracking-tight",e),...t}));V6.displayName=Hf.displayName;const H6=m.forwardRef(({className:e,...t},n)=>s.jsx(Kf,{ref:n,className:Te("text-sm text-muted-foreground",e),...t}));H6.displayName=Kf.displayName;function jve(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var k_="ScrollArea",[K6]=jr(k_),[Sve,Zs]=K6(k_),G6=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(ut.div,{dir:D,...o,ref:M,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})})});G6.displayName=k_;var Y6="ScrollAreaViewport",X6=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:a,...i}=e,o=Zs(Y6,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(ut.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})})]})});X6.displayName=Y6;var Ga="ScrollAreaScrollbar",E_=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Zs(Ga,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(Q6,{...r,ref:t,forceMount:n}):a.type==="always"?s.jsx(P_,{...r,ref:t}):null});E_.displayName=Ga;var Nve=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Zs(Ga,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(Q6,{"data-state":i?"visible":"hidden",...r,ref:t})})}),Cve=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Zs(Ga,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"))})})}),Q6=m.forwardRef((e,t)=>{const n=Zs(Ga,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(Ga,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=n8(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=_$(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=_$(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(Ga,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(J6,{"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),s8(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(Ga,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(J6,{"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),s8(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,Z6]=K6(Ga),J6=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(Ga,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(ut.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",e8=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Z6(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=Z6(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(ut.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)})});e8.displayName=dg;var T_="ScrollAreaCorner",t8=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});t8.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(ut.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 n8(e,t){const n=e/t;return isNaN(n)?0:n}function zv(e){const t=n8(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 r8([d,f],p)(e)}function _$(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 r8([0,o],[0,c])(f)}function r8(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 s8(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 a8=G6,Ove=X6,Mve=t8;const R_=m.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(a8,{ref:r,className:Te("relative overflow-hidden",e),...n,children:[s.jsx(Ove,{className:"h-full w-full rounded-[inherit]",children:t}),s.jsx(i8,{}),s.jsx(Mve,{})]}));R_.displayName=a8.displayName;const i8=m.forwardRef(({className:e,orientation:t="vertical",...n},r)=>s.jsx(E_,{ref:r,orientation:t,className:Te("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(e8,{className:"relative flex-1 rounded-full bg-border"})}));i8.displayName=E_.displayName;function jN(e){return e instanceof Error&&e.name==="AbortError"||typeof e=="object"&&e!==null&&"name"in e&&e.name==="AbortError"}async function Ive(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 $ve=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 Ive({sessionId:x,source:n,serverName:v.serverName,onLaunchUrl:j,timeoutMs:Math.max(1e4,c-Date.now())})}await new Promise(v=>{window.setTimeout(v,$ve)})}throw new Error("OAuth login timed out before all required servers were authorized.")}const Dve=[{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 Lve({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 Q=D.current;Q&&Q.controller.abort()},[]);m.useEffect(()=>{if(!e||!L||p)return;let Q=!1;return N(!0),(async()=>{const Fe=Array.from(new Set(a.serverIds.filter(ot=>o.find(wt=>wt.id===ot)?.authType==="oauth2")));await vi({serverNames:Fe,source:h});const pt=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(ot=>({name:ot.name||ot.id,url:ot.url})),availableAgents:i.map(ot=>({name:ot.name||ot.id,provider:ot.provider,model:ot.model}))}});Q||(v(pt.sessionId),W(pt.session),N(!1))})().catch(Fe=>{Q||Ie({title:"Could not start Scenario Assistant",description:Fe instanceof Error?Fe.message:String(Fe),variant:"destructive"})}).finally(()=>{Q||N(!1)}),()=>{Q=!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(Q=>{j(Ne=>Ne&&Ne.messages.length>Q.messages.length?Ne:Q)},[]),O=m.useCallback(()=>{const Q=D.current;Q&&(I(),y(Q.prompt),N(!1),A(!1))},[I]),Z=Q=>{Y(),h.closeScenarioAssistantSession(Q).catch(()=>{})};m.useEffect(()=>{e||p&&(H.current||F||Z(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 Q=window.setTimeout(()=>{P.current?.scrollIntoView({behavior:"smooth",block:"end"})},0);return()=>window.clearTimeout(Q)},[e,S,x?.messages.length,x?.pendingToolCalls.length,x?.warnings.length]),m.useEffect(()=>{const Q=R.current;if(!Q)return;Q.style.height="0px";const Ne=Math.min(Q.scrollHeight,160);Q.style.height=`${Math.max(40,Ne)}px`},[b,e]);const q=i.length>0&&a.serverIds.length>0&&!!L,z=async Q=>{if(!p)return;const Ne=Q.trim();if(!Ne)return;const Fe=++U.current,pt=new AbortController,ot=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,bt={id:ot,role:"user",text:Ne,createdAt:new Date().toISOString()};D.current={id:Fe,controller:pt,prompt:Ne},A(!0),j(wt=>wt&&{...wt,messages:[...wt.messages,bt]}),y(""),N(!0);try{const wt=await h.sendScenarioAssistantMessage(p,Ne,pt.signal);if(pt.signal.aborted||D.current?.id!==Fe)return;W(wt.session)}catch(wt){if(jN(wt)||pt.signal.aborted||D.current?.id!==Fe)return;j(et=>et&&{...et,messages:et.messages.filter(_e=>_e.id!==ot)}),y(et=>et.trim()?et:Ne),Ie({title:"Scenario Assistant error",description:wt instanceof Error?wt.message:String(wt),variant:"destructive"})}finally{D.current?.id===Fe&&(D.current=null,N(!1),A(!1))}},K=Q=>{y(Q),requestAnimationFrame(()=>R.current?.focus())};m.useEffect(()=>{if(!e||!p||!x||!q||D.current)return;const Q=String(d??"").trim();Q&&M.current!==Q&&(M.current=Q,z(Q))},[e,p,x,q,d]),m.useEffect(()=>{if(!(!e||!p||!x))return h.subscribeScenarioAssistantSessionEvents(p,Q=>{W(Q.payload.session)})},[e,p,h,W]);const J=async Q=>{if(p){N(!0);try{const Ne=await h.approveScenarioAssistantToolCall(p,Q);W(Ne.session)}catch(Ne){Ie({title:"Tool call failed",description:Ne instanceof Error?Ne.message:String(Ne),variant:"destructive"})}finally{N(!1)}}},re=async Q=>{if(p){N(!0);try{const Ne=await h.denyScenarioAssistantToolCall(p,Q);W(Ne.session)}catch(Ne){Ie({title:"Could not deny tool call",description:Ne instanceof Error?Ne.message:String(Ne),variant:"destructive"})}finally{N(!1)}}},he=async()=>{if(p){N(!0);try{const Q=await h.approveAllScenarioAssistantToolCalls(p);W(Q.session)}catch(Q){Ie({title:"Could not approve all tool calls",description:Q instanceof Error?Q.message:String(Q),variant:"destructive"})}finally{N(!1)}}},oe=(Q,Ne,Fe)=>{if(!Ne)return;if(Fe==="prompt"&&Ne.prompt&&f({prompt:Ne.prompt.replacement}),Fe==="evalRules"&&Ne.evalRules&&f({evalRules:Ne.evalRules.replacement}),Fe==="extractRules"&&Ne.extractRules&&f({extractRules:Ne.extractRules.replacement}),Q){const ot=`${Q}:${Fe}`;E(bt=>new Set([...bt,ot]))}Ie({title:"Applied suggestion",description:`Updated ${{prompt:"Prompt",evalRules:"Checks",extractRules:"Value Capture Rules"}[Fe]}`})},me=()=>{const Q=document.activeElement;Q instanceof HTMLElement&&Q.blur()},ie=Q=>{Q||(me(),G(!1),H.current=!1),t(Q)},ge=()=>{me(),H.current=!0,G(!0),t(!1)},Re=()=>{me(),H.current=!1,G(!1),p&&Z(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(ee,{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(ee,{type:"button",size:"sm",variant:"ghost",className:"h-8 px-2 text-muted-foreground",onClick:Re,"aria-label":"Discard assistant session",title:"Discard assistant session",children:s.jsx(ns,{className:"h-4 w-4"})})]})]}),s.jsx(bve,{open:e,onOpenChange:ie,children:s.jsxs(U6,{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:ge,"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(W6,{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(V6,{className:"flex items-center gap-2",children:[s.jsx(Zr,{className:"h-4 w-4"}),"Scenario Assistant"]}),s.jsx(H6,{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((Q,Ne)=>s.jsx("div",{className:"rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-900",children:Q},`${Q}-${Ne}`)),x?.messages.map(Q=>s.jsxs(m.Fragment,{children:[(()=>{const Ne=Q.pendingToolCallIds??(Q.pendingToolCallId?[Q.pendingToolCallId]:[]),Fe=Ne.map(et=>(x?.pendingToolCalls??[]).find(_e=>_e.id===et)).filter(et=>!!et),pt=Ne.map(et=>x.pendingToolCalls.find(_e=>_e.id===et)??x.pendingToolCalls.find(_e=>_e.id===et)).filter(Boolean);if(!(Q.role==="assistant"&&Ne.length>0))return s.jsx("div",{className:"space-y-2",children:s.jsx(Fve,{message:Q})});const bt=Fe.length,wt=pt.length-bt;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:[pt.length>1&&bt>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:[wt," of ",pt.length," tool calls resolved"]}),s.jsxs(ee,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:bt===0,onClick:()=>{he()},children:["Approve All (",bt,")"]})]}),pt.map((et,_e)=>s.jsx(wN,{call:et,loading:S,description:_e===0?Q.text:void 0,onApprove:Ee=>{J(Ee)},onDeny:Ee=>{re(Ee)}},et.id))]})]})})(),Q.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"]}),Q.suggestions.prompt&&s.jsx(nS,{title:"Prompt",rationale:Q.suggestions.prompt.rationale,preview:Q.suggestions.prompt.replacement,applied:k.has(`${Q.id}:prompt`),onApply:()=>oe(Q.id,Q.suggestions,"prompt")}),Q.suggestions.evalRules&&s.jsx(nS,{title:"Checks",rationale:Q.suggestions.evalRules.rationale,preview:JSON.stringify(Q.suggestions.evalRules.replacement,null,2),applied:k.has(`${Q.id}:evalRules`),onApply:()=>oe(Q.id,Q.suggestions,"evalRules")}),Q.suggestions.extractRules&&s.jsx(nS,{title:"Value Capture Rules",rationale:Q.suggestions.extractRules.rationale,preview:JSON.stringify(Q.suggestions.extractRules.replacement,null,2),applied:k.has(`${Q.id}:extractRules`),onApply:()=>oe(Q.id,Q.suggestions,"extractRules")}),(()=>{const Ne=Q.suggestions?.notes,Fe=Array.isArray(Ne)?Ne:typeof Ne=="string"?[Ne]:[];return Fe.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:Fe.map((pt,ot)=>s.jsx("li",{children:pt},`${Q.id}-note-${ot}`))})]})})()]})]},Q.id)),(x?.pendingToolCalls??[]).filter(Q=>!(x?.messages??[]).some(Ne=>Ne.pendingToolCallId===Q.id||Ne.pendingToolCallIds?.includes(Q.id))).map(Q=>s.jsx(wN,{call:Q,loading:S,onApprove:Ne=>{J(Ne)},onDeny:Ne=>{re(Ne)}},Q.id)),!x&&S&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(wr,{className:"h-4 w-4 animate-spin"}),"Starting assistant session..."]}),x&&S&&s.jsx(z6,{}),s.jsx("div",{ref:P})]})}),s.jsx(B6,{input:b,onInputChange:y,onSend:()=>{z(b)},onCancel:p&&_?O:void 0,inputPlaceholder:"Get assistance with creating or refining this scenario ...",snippets:Dve,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 nS({title:e,rationale:t,preview:n,applied:r=!1,onApply:a}){return s.jsxs("div",{className:`space-y-2 rounded-md border p-3 ${r?"border-emerald-300 bg-emerald-50/40":""}`,children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("h5",{className:"text-sm font-medium",children:e}),s.jsx(ee,{type:"button",size:"sm",variant:r?"secondary":"outline",onClick:a,disabled:r,children:r?s.jsxs(s.Fragment,{children:[s.jsx(fi,{className:"mr-1.5 h-3.5 w-3.5"}),"Applied"]}):"Apply"})]}),t&&s.jsx("p",{className:"text-xs text-muted-foreground",children:t}),s.jsx("pre",{className:"max-h-56 overflow-auto rounded bg-muted p-2 text-xs whitespace-pre-wrap",children:n})]})}function Fve({message:e}){const t=async a=>{try{await navigator.clipboard.writeText(a),Ie({title:"Copied"})}catch(i){Ie({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(F6,{message:e,assistantLabel:e.role==="assistant"?"Assistant":void 0,renderActions:n?s.jsx(ee,{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 zve({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(Bve,{item:o,fallbackUserPrompt:t},o.id))})})]})})]})}function Bve({item:e,fallbackUserPrompt:t}){if(e.kind==="tool_call"){const d=A$(e,"input");return s.jsx(E$,{variant:"call",title:`Tool call · ${e.toolName||"unknown"}${d}`,text:e.text})}if(e.kind==="tool_result"){const d=A$(e,"output"),f=e.ok?s.jsx(fi,{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(E$,{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=k$(e.text,e.kind),a=t?k$(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 A$(e,t){const n=t==="input"?e.estimatedTokens?.inputTokens:e.estimatedTokens?.outputTokens;return typeof n!="number"?"":` · estimated ${Yr(n)} tokens`}function k$(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 E$({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 o8=["image/jpeg","image/png","image/gif","image/webp"],l8=["application/pdf","text/plain","text/markdown","text/csv"];function qve(e){return o8.includes(e)||l8.includes(e)}function Uve(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 c8({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=Uve(i,r,O_);return{rule:i,status:o?.status??"not_evaluated",failureReason:o?.reason}}):e.map(i=>{const o=Vve(i,t);return{rule:i,status:o?"failed":"passed",failureReason:o}})}function O_(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 Wve(e){return A_(e).replace(/^Tool sequence · /,"")}function Vve(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: ${Wve(e.sequence??[])}`)||a.startsWith("Required tool in sequence not used:")):t.find(a=>a.startsWith(n)))}function P$({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(mt,{value:"required_tool",children:"Required Tool"}),s.jsx(mt,{value:"forbidden_tool",children:"Forbidden Tool"}),!r&&s.jsx(mt,{value:"tool_sequence",children:"Tool Sequence"}),s.jsx(mt,{value:"agent_check",children:"Judge Agent"}),s.jsx(mt,{value:"response_contains",children:"Text contains"}),s.jsx(mt,{value:"response_not_contains",children:"Text does not contain"}),s.jsx(mt,{value:"response_starts_with",children:"Text starts with"}),s.jsx(mt,{value:"response_ends_with",children:"Text ends with"}),s.jsx(mt,{value:"response_equals",children:"Text equals"}),s.jsx(mt,{value:"response_regex",children:"Text matches regex"}),s.jsx(mt,{value:"response_jsonpath",children:"JSONPath (optional equals)"}),s.jsx(mt,{value:"response_jsonpath_exists",children:"JSONPath exists"}),s.jsx(mt,{value:"response_jsonpath_not_exists",children:"JSONPath not exists"})]})]})}const Hve=()=>({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,Hve()]),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(ee,{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(Kve,{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 Kve({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([]),[Z,q]=m.useState(!1),[z,K]=m.useState(null),[J,re]=m.useState(null),[he,oe]=m.useState(!1),[me,ie]=m.useState(null),[ge,Re]=m.useState(""),[Q,Ne]=m.useState(null),[Fe,pt]=m.useState(!1),[ot,bt]=m.useState(null),[wt,et]=m.useState(""),[_e,Ee]=m.useState(""),[tt,ct]=m.useState(!1),[Pt,Xt]=m.useState(f||i[0]?.id||""),[kt,nn]=m.useState(!1),[Jt,zt]=m.useState(null),[Se,Xe]=m.useState(""),Qe=m.useRef(null);function At(ce){if(!ce)return;const it=Array.from(ce),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&&Ie({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&&Ie({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",""),ke=ae.startsWith("image/");qve(ae)?Wt[os]={type:ke?"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(ce){x({attachments:(e.attachments??[]).filter((it,Wt)=>Wt!==ce)})}const[de,Ke]=m.useState(null),[$e,se]=m.useState(!S),we=ce=>{const it=ce.target;it&&(it.closest("button, a, input, select, textarea, [role='button']")||se(Wt=>!Wt))},Ue=ce=>ce?e.evalRules.findIndex(it=>it===ce):-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(""),re(null),oe(!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 ce=[...e.evalRules],it={type:A,value:E.trim()},Wt=Ue(me);Wt>=0?ce[Wt]=it:ce.push(it),x({evalRules:ce}),P(""),Re(""),ie(null),k("required_tool")},le=()=>{const ce=I.trim();ce&&(O(it=>[...it,ce]),Y(""))},fe=(ce,it)=>{const Wt=ce+it;O(Dt=>{if(Wt<0||Wt>=Dt.length)return Dt;const qt=[...Dt],[dn]=qt.splice(ce,1);return qt.splice(Wt,0,dn),qt})},De=ce=>{O(it=>it.filter((Wt,Dt)=>Dt!==ce))},Me=e.evalRules.findIndex(ce=>ce.type==="tool_sequence"),Ge=Me>=0?e.evalRules[Me]:void 0,Oe=Ge?.type==="tool_sequence"?Ge.sequence??[]:[],V=Me>=0,ve=ce=>{const it=[...e.evalRules],Wt=ce.length>0?{type:"tool_sequence",sequence:ce}:null,Dt=Ue(z),qt=Dt>=0?Dt:Me;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(()=>{Z&&O(Oe)},[Z,Me,Oe.join("|")]),m.useEffect(()=>{q(A==="tool_sequence")},[A]),m.useEffect(()=>{oe(A==="agent_check")},[A]),m.useEffect(()=>{z&&Ue(z)<0&&K(null),J&&Ue(J)<0&&re(null),me&&Ue(me)<0&&ie(null)},[e.evalRules,z,J,me]),m.useEffect(()=>{z&&A!=="tool_sequence"&&K(null),J&&A!=="agent_check"&&re(null),me&&me.type!==A&&ie(null)},[A,z,J,me]);const Ae=ce=>{const it=e.evalRules.filter((Dt,qt)=>qt!==ce),Wt=it.some(Dt=>Dt.type==="agent_check");x({evalRules:it,agentContext:Wt?e.agentContext:void 0})},Je=["response_contains","response_not_contains","response_starts_with","response_ends_with","response_equals","response_regex"],ne=()=>{!wt.trim()||!_e.trim()||(x({extractRules:[...e.extractRules,{name:wt.trim(),pattern:_e.trim()}]}),et(""),Ee(""))},Le=ce=>{x({extractRules:e.extractRules.filter((it,Wt)=>Wt!==ce)})},ht=ce=>{const it=e.serverIds.includes(ce)?e.serverIds.filter(Wt=>Wt!==ce):[...e.serverIds,ce];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"},Ce={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",_t=A==="response_jsonpath"||A==="response_jsonpath_exists"||A==="response_jsonpath_not_exists",Kt=A==="tool_sequence"&&Z,Hn=A==="agent_check"&&he,_n=e.serverIds.filter(ce=>o.some(it=>it.id===ce)),Ya=i.map(ce=>ce.id).filter(Boolean),Xa=_n.length>0,[$i,To]=m.useState(""),[Di,Ul]=m.useState(0);m.useEffect(()=>{const ce=(h??"").trim();ce&&$i!==ce&&(ct(!0),To(ce))},[h,$i]),m.useEffect(()=>{p&&p!==Di&&(ct(!0),Ul(p))},[p,Di]),m.useEffect(()=>{Ne(null),bt(null),Re("")},[e.serverIds.join("|")]),m.useEffect(()=>{Re(""),M(""),U(""),Y("")},[A]),m.useEffect(()=>{Pt&&Ya.includes(Pt)||Xt(f||i[0]?.id||"")},[Pt,f,i,Ya]);const qn=async()=>{if(Pt){nn(!0),zt(null);try{const ce=e.serverIds.filter(Wt=>o.find(qt=>qt.id===Wt)?.authType==="oauth2");await vi({serverNames:ce,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(ce){zt(ce instanceof Error?ce.message:String(ce))}finally{nn(!1)}}},Fu=()=>{if(!de)return;const ce=T$(e.evalRules,de.run.failureReasons,de.run.checkResults),it=ce.length?ce.map(dn=>`${dn.status.toUpperCase()} - ${Gve(dn.rule)}${dn.failureReason?` (${dn.failureReason})`:""}`).join(`
|
|
128
|
-
`):"No checks configured.",Wt=Object.keys(de.run.extractedValues).length>0?Object.entries(de.run.extractedValues).map(([dn,lr])=>`${dn}: ${String(lr)}`).join(`
|
|
129
|
-
`):"No extracted values.",Dt=de.run.toolCalls.length>0?de.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: ${de.runId}`,`Agent: ${de.agentName}`,`Outcome: ${de.run.passed?"passed":"failed"}`,`Duration: ${de.run.duration}ms`,"","Current check outcomes:",it,"","Tool sequence:",Dt,"","Extracted values:",Wt,"","Final answer:",de.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
|
-
`);Xe(qt),ct(!0)},_a=async()=>{if(!(!Xa||S)){pt(!0),bt(null);try{const ce=_n.filter(Wt=>o.find(qt=>qt.id===Wt)?.authType==="oauth2");await vi({serverNames:ce,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)}Ne(Array.from(it).sort((Wt,Dt)=>Wt.localeCompare(Dt)))}catch(ce){bt(ce instanceof Error?ce.message:"Failed to load tools")}finally{pt(!1)}}};return s.jsx(da,{open:$e,onOpenChange:se,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:we,children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[!S&&s.jsx(Ms,{asChild:!0,children:s.jsx(ee,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",children:s.jsx(tn,{className:`h-3.5 w-3.5 transition-transform ${$e?"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(ee,{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(ee,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8","aria-label":$e?"Collapse scenario details":"Expand scenario details",children:s.jsx(tn,{className:`h-4 w-4 transition-transform ${$e?"rotate-180":""}`})})})]}):N&&s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsxs(ee,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>ct(!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(ee,{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(ee,{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(ee,{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(Lve,{open:tt,onOpenChange:ce=>{ct(ce),ce||Xe("")},configId:c,configPath:d,scenario:e,agents:i,servers:o,defaultAssistantAgentName:f,initialUserMessage:Se||h,onApplyPatch:ce=>x({...ce.prompt!==void 0?{prompt:ce.prompt}:{},...ce.evalRules!==void 0?{evalRules:ce.evalRules}:{},...ce.extractRules!==void 0?{extractRules:ce.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:ce=>x({name:ce.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(ce=>s.jsx(st,{variant:e.serverIds.includes(ce.id)?"default":"outline",className:`cursor-pointer text-xs ${e.serverIds.includes(ce.id)?"":"opacity-50"}`,onClick:()=>!S&&ht(ce.id),children:ce.name||ce.id},ce.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(ba,{value:e.prompt,onChange:ce=>x({prompt:ce.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:Qe,type:"file",accept:[...o8,...l8,".md"].join(","),multiple:!0,className:"hidden",onChange:ce=>At(ce.target.files)}),(e.attachments?.length??0)>0?s.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.attachments?.map((ce,it)=>s.jsxs("div",{className:"group relative",title:`${ce.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:ce.type==="image"?s.jsx("img",{src:`data:${ce.media_type};base64,${ce.data}`,alt:ce.name??`attachment ${it+1}`,className:"h-full w-full object-cover"}):s.jsx(SS,{className:"h-6 w-6 text-muted-foreground"})}),ce.name&&s.jsx("p",{className:"mt-0.5 max-w-[64px] truncate text-center text-xs text-muted-foreground",children:ce.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:()=>Qe.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(_E,{className:"h-4 w-4"})})]}):!S&&s.jsxs("button",{type:"button",onClick:()=>Qe.current?.click(),className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground",children:[s.jsx(_E,{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(ce=>s.jsx(mt,{value:ce.id,children:ce.name||ce.id},ce.id))})]})]}),s.jsx("div",{className:"flex items-end",children:s.jsx(ee,{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(wr,{className:"h-3.5 w-3.5 animate-spin"}),"Running..."]}):s.jsxs(s.Fragment,{children:[s.jsx(ga,{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}),de&&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:de.run.passed?"default":"destructive",children:de.run.passed?"Passed":"Failed"}),s.jsxs(st,{variant:"outline",children:[de.run.duration,"ms"]}),s.jsxs(st,{variant:"outline",children:[de.run.toolCalls.length," tool calls"]}),s.jsx(st,{variant:"outline",className:"font-mono",children:de.agentName}),s.jsxs(ee,{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 ce=T$(e.evalRules,de.run.failureReasons,de.run.checkResults),it=ce.filter(Dt=>Dt.status==="passed"),Wt=ce.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:ce.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(fi,{className:"h-3.5 w-3.5 shrink-0 text-success"}),s.jsx("span",{className:"font-medium",children:Yve(Dt.rule)})]}),Dt.failureReason&&s.jsx("p",{className:"mt-1 pl-5 text-[11px] text-muted-foreground",children:Xve(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}`))})]})})(),de.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:de.run.failureReasons.map((ce,it)=>s.jsx("li",{children:ce},`${de.runId}-failure-${it}`))})]}),Object.keys(de.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(de.run.extractedValues).map(([ce,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:ce}),s.jsx("div",{className:"break-all",children:String(it)})]},ce))})]}),s.jsx(zve,{run:de.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(ee,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>ct(!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((ce,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 ${Ce[ce.type]}`,children:Qt[ce.type]}),ce.type==="agent_check"?s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"font-medium leading-tight",children:ce.label||"Unnamed check"}),ce.prompt&&s.jsx("div",{className:"mt-0.5 break-words text-[11px] leading-snug text-muted-foreground",children:ce.prompt})]}):ce.type==="tool_sequence"?s.jsx("span",{className:"font-mono break-all",children:u8(ce.sequence??[])}):s.jsx("span",{className:"font-mono break-all",children:ce.path?ce.equals!==void 0?`${ce.path} == ${String(ce.equals)}`:ce.path:ce.value})]})}),!S&&s.jsxs("div",{className:"flex items-center gap-1",children:[(ce.type==="tool_sequence"||ce.type==="agent_check"||Je.includes(ce.type))&&s.jsx(ee,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 text-[11px]",onClick:()=>{if(ce.type==="tool_sequence"){k("tool_sequence"),O(ce.sequence??[]),K(ce),q(!0);return}if(ce.type==="agent_check"){k("agent_check"),re(ce),G(ce.label??""),L(ce.prompt??""),oe(!0);return}k(ce.type),ie(ce),P(ce.value??"")},"aria-label":`Edit check ${it+1}`,children:s.jsx(L9,{className:"h-3.5 w-3.5"})}),s.jsx(ee,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>Ae(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(P$,{value:A,onValueChange:k,className:"h-8 w-[14.5rem] shrink-0 text-xs"}),s.jsx(Et,{value:F,onChange:ce=>G(ce.target.value),placeholder:"Prompt name",className:"h-8 text-xs"}),s.jsx(ee,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:B,children:J!==null?"Update check":"Add check"})]}),s.jsx(ba,{value:H,onChange:ce=>L(ce.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(P$,{value:A,onValueChange:k,className:"h-8 w-[14.5rem] shrink-0 text-xs",hideToolSequence:V&&A!=="tool_sequence"}),_t?s.jsxs(s.Fragment,{children:[s.jsx(Et,{value:R,onChange:ce=>M(ce.target.value),placeholder:"JSONPath (e.g. $.status)",className:"h-8 text-xs font-mono",onKeyDown:ce=>ce.key==="Enter"&&(ce.preventDefault(),B())}),A==="response_jsonpath"&&s.jsx(Et,{value:D,onChange:ce=>U(ce.target.value),placeholder:"Equals (optional)",className:"h-8 w-[12rem] text-xs font-mono",onKeyDown:ce=>ce.key==="Enter"&&(ce.preventDefault(),B())})]}):Kt?s.jsxs("div",{className:"min-w-0 flex-1 flex items-end gap-2",children:[s.jsx(Et,{value:I,onChange:ce=>Y(ce.target.value),placeholder:"Tool name",className:"h-8 text-xs font-mono",onKeyDown:ce=>ce.key==="Enter"&&(ce.preventDefault(),le())}),s.jsx(ee,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:le,children:"Add step"})]}):s.jsx(Et,{value:E,onChange:ce=>P(ce.target.value),placeholder:"Value",className:"h-8 text-xs font-mono",onKeyDown:ce=>ce.key==="Enter"&&(ce.preventDefault(),B())}),s.jsx(ee,{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(ee,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2 text-[11px]",onClick:()=>O([]),children:"Clear"}),s.jsx(ee,{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((ce,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:ce}),!S&&s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(ee,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>fe(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(ee,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>fe(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(ee,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>De(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:ce=>{Re(ce),P(ce)},disabled:Fe||!Q||Q.length===0,children:[s.jsx(Tn,{className:"h-8 text-xs",children:s.jsx($n,{placeholder:Fe?"Loading tools...":Q&&Q.length>0?"Select tool to insert in value field":"Load tools first"})}),s.jsx(Rn,{children:(Q??[]).map(ce=>s.jsx(mt,{value:ce,children:ce},ce))})]})]}),s.jsx(ee,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:_a,disabled:!Xa||Fe,children:Fe?"Loading...":Q?"Refresh tools":"Load tools"})]}),!Xa&&s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Select at least one server in this scenario to load tool names."}),ot&&s.jsxs("p",{className:"text-[11px] text-destructive",children:["Could not load tools: ",ot]})]})]})]})})]}),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(ee,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>ct(!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((ce,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:ce.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:ce.pattern})]})}),!S&&s.jsx(ee,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>Le(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:wt,onChange:ce=>et(ce.target.value),placeholder:"Field name",className:"h-8 text-xs w-36"}),s.jsx(Et,{value:_e,onChange:ce=>Ee(ce.target.value),placeholder:"Regex pattern",className:"h-8 text-xs font-mono",onKeyDown:ce=>ce.key==="Enter"&&(ce.preventDefault(),ne())}),s.jsx(ee,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:ne,children:"Add"})]})]})})]})]}),e.evalRules.some(ce=>ce.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(Lr,{id:`judge-ctx-prompt-${e.id}`,checked:e.agentContext?.include_prompt??!1,disabled:S,className:"mt-0.5",onCheckedChange:ce=>{x({agentContext:{...e.agentContext,include_prompt:ce===!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(Lr,{id:`judge-ctx-tools-${e.id}`,checked:e.agentContext?.include_tool_sequence??!1,disabled:S,className:"mt-0.5",onCheckedChange:ce=>{x({agentContext:{...e.agentContext,include_tool_sequence:ce===!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 T$(e,t,n){return c8({evalRules:e,failureReasons:t,checkResults:n})}function Gve(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 Yve=O_;function Xve(e){const t=String(e??"").trim(),n=t.match(/^Regex assertion failed:\s*(.+)$/i);return n?`Text match failed: ${n[1]}`:t}function 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 Qve=()=>({id:`cfg-${Date.now()}`,name:"",configName:"",description:"",servers:[],serverEntries:[],agents:[],agentEntries:[],scenarios:[],scenarioEntries:[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),R$=()=>{const{id:e,tab:t}=Ml(),n=ja(),r=Xs(),[a,i]=Pi(),{getConfig:o,addConfig:c,updateConfig:d,loading:f}=Yf(),{source:h}=On(),{servers:p,agents:v,scenarios:x}=Na(),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):Qve()),[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]),Z=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??[],re=async()=>{if(!_.name.trim()){Ie({title:"Validation Error",description:"Config ID is required.",variant:"destructive"});return}const V=W.map(Ce=>Ce.kind==="referenced"?{kind:"referenced",ref:p.find(_t=>_t.id===Ce.ref)?.id||Ce.ref}:Ce),ve=q.map(Ce=>Ce.kind==="referenced"?{kind:"referenced",ref:v.find(_t=>_t.id===Ce.ref)?.id||Ce.ref}:Ce),Ae=O.map(Ce=>{if(Ce.kind==="referenced"){const en=x.find(Kt=>Kt.id===Ce.ref),_t=(Ce.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||Ce.ref,...Ce.mcpServers!==void 0?{mcpServers:_t}:{}}}return Ce}),Je=V.filter(Ce=>Ce.kind==="inline").map(Ce=>({server:Ce.server,error:d8(Ce.server)})).find(Ce=>!!Ce.error);if(Je?.error){Ie({title:"Validation Error",description:Je.error,variant:"destructive"});return}if(Ae.filter(Ce=>Ce.kind==="inline").some(Ce=>!Ce.scenario.name?.trim())){Ie({title:"Validation Error",description:"Inline scenarios must have a name before saving.",variant:"destructive"});return}const Le=new Set(ve.map(Ce=>Ce.kind==="inline"?Ce.agent.id:Ce.ref)),ht=(_.runDefaults?.selectedAgentNames??[]).filter(Ce=>Le.has(Ce)),Qt={..._,serverEntries:V,servers:V.filter(Ce=>Ce.kind==="inline").map(Ce=>Ce.server),agentEntries:ve,agents:ve.filter(Ce=>Ce.kind==="inline").map(Ce=>Ce.agent),scenarioEntries:Ae,scenarios:Ae.filter(Ce=>Ce.kind==="inline").map(Ce=>Ce.scenario),runDefaults:ht.length>0?{..._.runDefaults??{},selectedAgentNames:ht}:void 0,updatedAt:new Date().toISOString()};if(j){const Ce=await c(Qt);A(Ce);const en=zn(Ce.configName,zn(Ce.name,Ce.id));Ie({title:"MCP Evaluation Created",description:`"${en}" has been saved.`}),r(`/mcp-evaluations/${Ce.id}`)}else{const Ce=await d(_.id,Qt);A(Ce);const en=zn(Ce.configName,zn(Ce.name,Ce.id));Ie({title:"MCP Evaluation Updated",description:`"${en}" has been updated.`}),N(!1),r(`/mcp-evaluations/${Ce.id}`,{replace:!0})}},he=zn(_.configName,zn(_.name,_.id)),oe=j?"New MCP Evaluation":S?`Editing: ${he}`:he,me=j?"/mcp-evaluations/new":`/mcp-evaluations/${encodeURIComponent(_.id||e||"")}`,ie=!!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]),Re=(V,ve)=>{const Ae=ve?Array.from(new Set([...J,V])):J.filter(Je=>Je!==V);Y({runDefaults:{..._.runDefaults??{},selectedAgentNames:Ae}})},Q=V=>{const ve=new Set([...q.filter(Le=>Le.kind==="inline").map(Le=>zn(Le.agent.name,Le.agent.id)),...v.map(Le=>zn(Le.name,Le.id))]),Ae=`${V}-custom`;let Je=Ae,ne=2;for(;ve.has(Je);)Je=`${Ae}-${ne}`,ne+=1;return Je},Ne=()=>{const ve={id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096};z([{kind:"inline",agent:ve},...q]),D(Ae=>({...Ae,[ve.id]:!0}))},Fe=()=>{const V=v.find(Je=>Je.id===P);if(!V)return;const ve=V.id;new Set(q.filter(Je=>Je.kind==="referenced").map(Je=>Je.ref)).has(ve)||z([...q,{kind:"referenced",ref:ve}]),R("")},pt=()=>{const V=new Set(q.filter(Ae=>Ae.kind==="referenced").map(Ae=>Ae.ref)),ve=v.filter(Ae=>!V.has(Ae.id)).map(Ae=>({kind:"referenced",ref:Ae.id}));ve.length>0&&z([...q,...ve])},ot=()=>{const V=v.find(ne=>ne.id===P);if(!V)return;const ve=zn(V.name,V.id),Ae=Q(ve),Je={...structuredClone(V),id:`agt-${Date.now()}`,name:Ae};z([...q,{kind:"inline",agent:Je}]),D(ne=>({...ne,[Je.id]:!0})),R(""),Ie({title:"Imported agent as inline",description:Ae})},bt=V=>{const ve=q[V];if(!ve)return;const Ae=ve.kind==="inline"?ve.agent.id:ve.ref,Je=J.filter(ne=>ne!==Ae);Y({runDefaults:{..._.runDefaults??{},selectedAgentNames:Je}}),ve.kind==="inline"&&D(ne=>{const Le={...ne};return delete Le[ve.agent.id],Le}),z(q.filter((ne,Le)=>Le!==V))},wt=(V,ve)=>{const Ae=V+ve;if(Ae<0||Ae>=q.length)return;const Je=[...q],[ne]=Je.splice(V,1);Je.splice(Ae,0,ne),z(Je)},et=V=>{const ve=q[V];if(!ve||ve.kind!=="referenced")return;const Ae=nn(ve.ref);if(!Ae){Ie({title:"Referenced agent not found",variant:"destructive"});return}const Je=zn(Ae.name,Ae.id),ne=Q(Je),Le={...structuredClone(Ae),id:`agt-${Date.now()}`,name:ne},ht=[...q];if(ht[V]={kind:"inline",agent:Le},z(ht),J.includes(ve.ref)){const Qt=J.map(Ce=>Ce===ve.ref?Le.id:Ce);Y({runDefaults:{..._.runDefaults??{},selectedAgentNames:Array.from(new Set(Qt))}})}D(Qt=>({...Qt,[Le.id]:!0})),Ie({title:"Referenced agent converted to inline",description:ne})},_e=()=>{const V=x.find(Ae=>Ae.id===k);if(!V)return;const ve={...structuredClone(V),id:`scn-${Date.now()}`,serverIds:[...V.serverIds]};Z([...O,{kind:"inline",scenario:ve}]),H(Ae=>({...Ae,[ve.id]:!0})),E("")},Ee=()=>{const ve={id:`scn-${Date.now()}`,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};Z([{kind:"inline",scenario:ve},...O]),H(Ae=>({...Ae,[ve.id]:!0}))},tt=()=>{const V=x.find(Je=>Je.id===k);if(!V)return;const ve=V.id;new Set(O.filter(Je=>Je.kind==="referenced").map(Je=>Je.ref)).has(ve)||Z([...O,{kind:"referenced",ref:ve}]),E("")},ct=V=>{const ve=O[V];ve?.kind==="inline"&&H(Ae=>{const Je={...Ae};return delete Je[ve.scenario.id],Je}),Z(O.filter((Ae,Je)=>Je!==V))},Pt=(V,ve)=>{const Ae=V+ve;if(Ae<0||Ae>=O.length)return;const Je=[...O],[ne]=Je.splice(V,1);Je.splice(Ae,0,ne),Z(Je)},Xt=V=>{const ve=O[V];if(!ve||ve.kind!=="referenced")return;const Ae=Jt(ve.ref);if(!Ae){Ie({title:"Referenced scenario not found",variant:"destructive"});return}const Je=new Set(O.filter(_t=>_t.kind==="inline").map(_t=>_t.scenario.name?.trim().toLowerCase()).filter(Boolean)),ne=`${zn(Ae.name,Ae.id)}-custom`;let Le=ne,ht=2;for(;Je.has(Le.toLowerCase());)Le=`${ne}-${ht}`,ht+=1;const Qt=Date.now(),Ce={...structuredClone(Ae),id:`scn-${Qt}`,name:Le,serverIds:ve.mcpServers&&ve.mcpServers.length>0?ve.mcpServers.map(_t=>_t.kind==="referenced"?_t.ref:_t.server.id):[...Ae.serverIds]},en=[...O];en[V]={kind:"inline",scenario:Ce},Z(en),H(_t=>({..._t,[Ce.id]:!0})),Ie({title:"Referenced scenario converted to inline",description:Le})},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),Se=zt.map(kt).filter(V=>!!V),Xe=q.filter(V=>V.kind==="referenced").map(V=>V.ref),Qe=Xe.map(nn).filter(V=>!!V);q.filter(V=>V.kind==="inline");const At=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),de=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 Ae=V.mcpServers.flatMap(Je=>Je.kind==="referenced"?[Je.ref]:[Je.server.id]);return[{scenario:{...ve,serverIds:Ae},origin:"referenced",hasMcpServerOverride:!0}]}return[{scenario:V.scenario,origin:"inline",hasMcpServerOverride:!1}]}),Ke=Array.from(new Map([...v,..._.agents,...Qe].map(V=>[V.id,V])).values()),$e=Array.from(new Map([...p,..._.servers??[],...Se].map(V=>[V.id,V])).values()),se=O.filter(V=>V.kind==="referenced").flatMap(V=>(V.mcpServers??[]).filter(ve=>ve.kind==="referenced").map(ve=>ve.ref)),we=Array.from(new Set([...zt,...se].filter(V=>!kt(V)))),Ue=Xe.filter(V=>!nn(V)),B=Bt.filter(V=>!Jt(V));new Set(we);const le=new Set(B),fe=q.length,De=O.length,Me=[...p],Ge=(V,ve)=>{const Ae=O[V];if(!Ae||Ae.kind!=="referenced")return;const Je=[...O];Je[V]={kind:"referenced",ref:Ae.ref,mcpServers:ve.map(ne=>({kind:"referenced",ref:ne}))},Z(Je)},Oe=V=>{const ve=O[V];if(!ve||ve.kind!=="referenced")return;const Ae=[...O];Ae[V]={kind:"referenced",ref:ve.ref},Z(Ae)};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(ee,{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:oe}),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(ee,{size:"sm",onClick:()=>{N(!0),r(`${me}/edit`)},children:"Edit"}),b&&!S&&y&&!ie&&s.jsx(ee,{size:"sm",variant:"outline",asChild:!0,children:s.jsxs(Tt,{to:`/run?configId=${encodeURIComponent(y.id)}`,children:[s.jsx(ga,{className:"h-3.5 w-3.5"}),"Run Evaluation"]})}),b&&!S&&ie&&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(ee,{variant:"outline",size:"sm",onClick:()=>{A(structuredClone(y)),N(!1),r(me)},children:"Cancel"}),s.jsxs(ee,{size:"sm",onClick:()=>{re()},children:[s.jsx(I9,{className:"mr-1.5 h-3.5 w-3.5"}),"Save"]})]})]})]}),ie&&!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})]}),(we.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"}),we.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Servers:"," ",s.jsx("span",{className:"text-destructive",children:we.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."})]})}),!ie&&(_.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"}),De," scenario",De!==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"}),fe," agent",fe!==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(Fa,{value:"scenarios",className:"gap-1.5",children:[s.jsx(SS,{className:"h-3.5 w-3.5"}),"Scenarios"]}),s.jsxs(Fa,{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(mt,{value:V.id,children:V.label},V.id))})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ee,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!P,onClick:Fe,children:"Add Ref"}),s.jsx(ee,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!P,onClick:ot,children:"Import Inline"}),s.jsx(ee,{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:pt,children:"Add All Refs"}),s.jsx(ee,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:Ne,children:"Add agent"})]})]}),s.jsxs("div",{className:"space-y-2",children:[q.map((V,ve)=>{const Ae=V.kind==="referenced"?nn(V.ref):null,Je=V.kind==="inline"?zn(V.agent.name,V.agent.id):zn(Ae?.name,V.ref),ne=V.kind==="inline"?V.agent.model:Ae?.model||"unknown",Le=V.kind==="inline"?V.agent.id:V.ref,ht=V.kind==="referenced"&&!Ae,Qt=V.kind==="inline"?V.agent.id:V.ref,Ce=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(ee,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>wt(ve,-1),disabled:ve===0,"aria-label":"Move agent up",children:s.jsx(ma,{className:"h-3 w-3"})}),s.jsx(ee,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>wt(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:Je}),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:ne}),Ce&&s.jsx(st,{variant:"outline",className:"text-xs border-emerald-300 text-emerald-700 bg-emerald-50",children:"Default"}),ht&&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:Ce,onChange:_t=>Re(Qt,_t.target.checked)}),s.jsx("span",{children:"Default"})]}),V.kind==="inline"&&s.jsx(ee,{type:"button",size:"sm",variant:"outline",onClick:()=>D(_t=>({..._t,[V.agent.id]:!_t[V.agent.id]})),children:en?"Collapse":"Expand"}),V.kind==="referenced"&&s.jsx(s.Fragment,{children:s.jsx(ee,{type:"button",size:"sm",variant:"outline",onClick:()=>et(ve),disabled:ht,children:"Convert to inline"})}),s.jsx(ee,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>bt(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:_t=>{const Kt=[...q];Kt[ve]={kind:"inline",agent:{...V.agent,name:_t.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:_t=>{const Kt=[...q];Kt[ve]={kind:"inline",agent:{...V.agent,provider:_t}},z(Kt)},children:[s.jsx(Tn,{children:s.jsx($n,{})}),s.jsxs(Rn,{children:[s.jsx(mt,{value:"openai",children:"OpenAI"}),s.jsx(mt,{value:"anthropic",children:"Anthropic"}),s.jsx(mt,{value:"azure",children:"Azure OpenAI"}),s.jsx(mt,{value:"google",children:"Google"}),s.jsx(mt,{value:"custom",children:"Custom"})]})]})]})]}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Ve,{className:"text-xs",children:"Model"}),s.jsx(Et,{value:V.agent.model,onChange:_t=>{const Kt=[...q];Kt[ve]={kind:"inline",agent:{...V.agent,model:_t.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:_t=>{const Kt=[...q];Kt[ve]={kind:"inline",agent:{...V.agent,maxTokens:parseInt(_t.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:_t=>{const Kt=[...q];Kt[ve]={kind:"inline",agent:{...V.agent,temperature:Number(_t.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(ba,{value:V.agent.systemPrompt||"",onChange:_t=>{const Kt=[...q];Kt[ve]={kind:"inline",agent:{...V.agent,systemPrompt:_t.target.value}},z(Kt)},rows:3,className:"text-xs"})]})]})]},`agent-entry-${ve}-${Le}`)}),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:[At.map((V,ve)=>{const Ae=zn(V.agent.name,V.agent.id),Je=J.includes(V.origin==="inline"?V.agent.id:V.ref||V.agent.id),ne=V.ref??V.agent.id,Le=!!U[ne];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:Ae})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[Je&&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(ee,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8",onClick:()=>F(ht=>({...ht,[ne]:!ht[ne]})),"aria-label":Le?"Collapse agent details":"Expand agent details",children:s.jsx(tn,{className:`h-4 w-4 transition-transform ${Le?"rotate-180":""}`})})]})]}),Le&&s.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 border-t pt-2",children:[s.jsx(A6,{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}`)}),At.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(mt,{value:V.id,children:zn(V.name,V.id)},V.id))})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ee,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!k,onClick:tt,children:"Add Ref"}),s.jsx(ee,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!k,onClick:_e,children:"Import Inline"}),s.jsx(ee,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:Ee,children:"Add scenario"})]})]}),s.jsxs("div",{className:"space-y-2",children:[O.map((V,ve)=>{const Ae=V.kind==="referenced"?Jt(V.ref):null,Je=V.kind==="inline"?zn(V.scenario.name,V.scenario.id):zn(Ae?.name,V.ref),ne=V.kind==="inline"&&zn(V.scenario.name).length===0,Le=V.kind==="referenced"&&le.has(V.ref),ht=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(ee,{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(ee,{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:Je}),s.jsx(st,{variant:V.kind==="inline"?"secondary":"outline",children:V.kind==="inline"?"Inline":"Referenced"}),ht&&s.jsx(st,{variant:"secondary",children:"Override"}),ne&&s.jsx(st,{variant:"destructive",children:"Name required"}),Le&&s.jsx(st,{variant:"destructive",children:"Missing"})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[V.kind==="inline"&&s.jsx(ee,{type:"button",size:"icon",variant:"outline",className:"h-7 w-7",onClick:()=>H(Ce=>({...Ce,[V.scenario.id]:!Ce[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(ee,{type:"button",size:"sm",variant:"outline",onClick:()=>Xt(ve),disabled:Le,children:"Convert to inline"})}),s.jsx(ee,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>ct(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,...Qe],servers:[..._.servers??[],...Se],configId:_.id,configPath:_.sourcePath,defaultAssistantAgentName:_.runDefaults?.selectedAgentNames?.[0],onChange:Ce=>{const en=Ce[0];if(!en)return;const _t=[...O];_t[ve]={kind:"inline",scenario:en},Z(_t)},readOnly:!1,allowAdd:!1,allowStructureEdits:!1})}),V.kind==="referenced"&&!Le&&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:Me.map(Ce=>{const en=(V.mcpServers??[]).some(_t=>_t.kind==="referenced"&&_t.ref===Ce.id);return s.jsx(ee,{type:"button",size:"sm",variant:en?"default":"outline",className:`h-7 text-xs ${en?"":"opacity-70"}`,onClick:()=>{const _t=(V.mcpServers??[]).filter(Hn=>Hn.kind==="referenced").map(Hn=>Hn.ref),Kt=_t.includes(Ce.id)?_t.filter(Hn=>Hn!==Ce.id):[..._t,Ce.id];Ge(ve,Kt)},children:zn(Ce.name,Ce.id)},`${V.ref}-override-server-${Ce.id}`)})}),ht&&s.jsx(ee,{type:"button",size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>Oe(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:de.map(V=>V.scenario),scenarioOrigins:de.map(V=>V.origin),scenarioOverrides:de.map(V=>V.hasMcpServerOverride),agents:Ke,servers:$e,configId:_.id,configPath:_.sourcePath,defaultAssistantAgentName:_.runDefaults?.selectedAgentNames?.[0],testCaseReturnToPath:I,onChange:()=>{},readOnly:!0})})}):null]})]})]})};var Zve=Symbol("radix.slottable");function Jve(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Zve,t}var f8="AlertDialog",[exe]=jr(f8,[f3]),Ii=f3(),p8=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ii(t);return s.jsx(Bg,{...r,...n,modal:!0})};p8.displayName=f8;var txe="AlertDialogTrigger",nxe=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=Ii(n);return s.jsx(GY,{...a,...r,ref:t})});nxe.displayName=txe;var rxe="AlertDialogPortal",h8=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ii(t);return s.jsx(qg,{...r,...n})};h8.displayName=rxe;var sxe="AlertDialogOverlay",m8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=Ii(n);return s.jsx(_u,{...a,...r,ref:t})});m8.displayName=sxe;var zc="AlertDialogContent",[axe,ixe]=exe(zc),oxe=Jve("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(axe,{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(oxe,{children:r}),s.jsx(cxe,{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 lxe="AlertDialogAction",w8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=Ii(n);return s.jsx(Ug,{...a,...r,ref:t})});w8.displayName=lxe;var j8="AlertDialogCancel",S8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=ixe(j8,n),i=Ii(n),o=Mt(t,a);return s.jsx(Ug,{...i,...r,ref:o})});S8.displayName=j8;var cxe=({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},uxe=p8,dxe=h8,N8=m8,C8=g8,_8=w8,A8=S8,k8=x8,E8=b8;const wa=uxe,fxe=dxe,P8=m.forwardRef(({className:e,...t},n)=>s.jsx(N8,{className:Te("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(fxe,{children:[s.jsx(P8,{}),s.jsx(C8,{ref:n,className:Te("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:Te("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:Te("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:Te("text-lg font-semibold",e),...t}));Hs.displayName=k8.displayName;const Ks=m.forwardRef(({className:e,...t},n)=>s.jsx(E8,{ref:n,className:Te("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:Te(iC(),e),...t}));Gs.displayName=_8.displayName;const Ys=m.forwardRef(({className:e,...t},n)=>s.jsx(A8,{ref:n,className:Te(iC({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Ys.displayName=A8.displayName;const pxe=()=>{const{servers:e,setServers:t,reload:n,loading:r}=Na(),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,_]),Ie({title:"Server duplicated",description:`Created ${S}.`})},v=async b=>{await t(e.filter(y=>y.id!==b.id)),Ie({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(LD,{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(ee,{type:"button",size:"sm",variant:"outline",onClick:()=>{n()},disabled:r,children:[s.jsx(zs,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(ee,{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(ee,{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(ft,{children:"Name"}),s.jsx(ft,{children:"Transport"}),s.jsx(ft,{children:"Endpoint"}),s.jsx(ft,{children:"Auth"}),s.jsx(ft,{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(ee,{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(ee,{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(ee,{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(wa,{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"})]})]})})]})},O$={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"},M$=()=>({id:`srv-${Date.now()}`,name:"",transport:"stdio",authType:"none"}),hxe=()=>{const{serverId:e}=Ml(),t=Xs(),{servers:n,setServers:r}=Na(),{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??M$()),[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(M$()),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()){Ie({title:"Name is required",variant:"destructive"});return}const L=d8(f);if(L){Ie({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]),Ie({title:"Server created"}),t(`/libraries/servers/${encodeURIComponent(I.id)}`);else{const Y=n.map(W=>W.id===c?.id?I:W);await r(Y),Ie({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),Ie({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(ee,{type:"button",onClick:()=>{U()},disabled:b.status==="loading"||_,children:[s.jsx(HD,{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(wr,{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]}),O$[f.transport]&&s.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:["Hint: ",O$[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(mt,{value:"stdio",children:"stdio"}),s.jsx(mt,{value:"sse",children:"SSE"}),s.jsx(mt,{value:"streamable-http",children:"Streamable HTTP"})]})]})]})]}),f.transport==="stdio"?s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(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(mt,{value:"none",children:"None"}),s.jsx(mt,{value:"bearer",children:"Bearer Token"}),s.jsx(mt,{value:"api-key",children:"API Key"}),s.jsx(mt,{value:"oauth2",children:"OAuth 2.0"})]})]})]}),f.authType==="bearer"&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(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(ee,{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(ee,{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(ee,{type:"button",variant:"destructive",size:"sm",onClick:()=>v(!0),children:"Delete"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ee,{type:"button",variant:"outline",size:"sm",onClick:()=>t("/libraries/servers"),children:"Cancel"}),s.jsxs(ee,{type:"button",size:"sm",onClick:()=>{F()},disabled:x,children:[x&&s.jsx(wr,{className:"mr-2 h-4 w-4 animate-spin"}),i?"Create Server":"Save"]})]})]})]})]}),s.jsx(wa,{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"})]})]})})]})},mxe=()=>{const{agents:e,setAgents:t,reload:n,loading:r}=Na(),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]),Ie({title:"Agent duplicated",description:`Created ${b}.`})},v=async x=>{await t(e.filter(j=>j.id!==x.id)),Ie({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(ee,{type:"button",size:"sm",variant:"outline",onClick:()=>{n()},disabled:r,children:[s.jsx(zs,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(ee,{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(ee,{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(ft,{children:"Name"}),s.jsx(ft,{children:"Provider"}),s.jsx(ft,{children:"Model"}),s.jsx(ft,{children:"Max Tokens"}),s.jsx(ft,{children:"Temperature"}),s.jsx(ft,{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(A6,{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(ee,{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(ee,{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(ee,{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(wa,{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,gxe,vxe]=Ff(Lu),[M8]=jr(Lu,[vxe]),[xxe,qv]=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"?yxe:bxe,[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=Cxe(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=Exe(i),L=Pxe(Math.round((U-r)/i)*i+r,H),I=Df(L,[r,a]);k((Y=[])=>{const W=Sxe(Y,I,F);if(kxe(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(xxe,{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}),yxe=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=M_(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})}})})}),bxe=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],_=M_(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=qv(Lu,n);return s.jsx(ut.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=qv(F8,n);return s.jsx(ut.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=qv(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(ut.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=gxe(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(wxe,{...e,ref:i,index:o})}),wxe=m.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:a,...i}=e,o=qv(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=Nxe(r,o.values.length),y=v?.[c.size],S=y?_xe(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(ut.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 jxe="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(ut.input,{style:{display:"none"},...n,ref:i,defaultValue:t})});U8.displayName=jxe;function Sxe(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 Nxe(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Cxe(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 _xe(e,t,n){const r=e/2,i=M_([0,50],[0,r]);return(r-i(t)*n)*n}function Axe(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function kxe(e,t){if(t>0){const n=Axe(e);return Math.min(...n)>=t}return!0}function M_(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 Exe(e){return(String(e).split(".")[1]||"").length}function Pxe(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var V8=I8,Txe=z8,Rxe=B8,Oxe=q8;const H8=m.forwardRef(({className:e,...t},n)=>s.jsxs(V8,{ref:n,className:Te("relative flex w-full touch-none select-none items-center",e),...t,children:[s.jsx(Txe,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:s.jsx(Rxe,{className:"absolute h-full bg-primary"})}),s.jsx(Oxe,{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 Mxe(e){const t=Ixe(e),n=m.forwardRef((r,a)=>{const{children:i,...o}=r,c=m.Children.toArray(i),d=c.find(Dxe);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 Ixe(e){const t=m.forwardRef((n,r)=>{const{children:a,...i}=n;if(m.isValidElement(a)){const o=Fxe(a),c=Lxe(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 $xe=Symbol("radix.slottable");function Dxe(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$xe}function Lxe(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 Fxe(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 Uv="Popover",[K8]=jr(Uv,[jo]),dp=jo(),[zxe,Po]=K8(Uv),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:Uv});return s.jsx(Ag,{...c,children:s.jsx(zxe,{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=Uv;var Y8="PopoverAnchor",Bxe=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})});Bxe.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(ut.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 I_="PopoverPortal",[qxe,Uxe]=K8(I_,{forceMount:void 0}),Z8=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=Po(I_,t);return s.jsx(qxe,{scope:t,forceMount:n,children:s.jsx(Zn,{present:n||i.open,children:s.jsx(Rl,{asChild:!0,container:a,children:r})})})};Z8.displayName=I_;var yu="PopoverContent",J8=m.forwardRef((e,t)=>{const n=Uxe(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(Vxe,{...a,ref:t}):s.jsx(Hxe,{...a,ref:t})})});J8.displayName=yu;var Wxe=Mxe("PopoverContent.RemoveScroll"),Vxe=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:Wxe,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})})})}),Hxe=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",Kxe=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Po(tq,n);return s.jsx(ut.button,{type:"button",...r,ref:t,onClick:qe(e.onClick,()=>a.onOpenChange(!1))})});Kxe.displayName=tq;var Gxe="PopoverArrow",Yxe=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=dp(n);return s.jsx(Eg,{...a,...r,ref:t})});Yxe.displayName=Gxe;function nq(e){return e?"open":"closed"}var Xxe=G8,Qxe=Q8,Zxe=Z8,rq=J8;const ho=Xxe,mo=Qxe,xi=m.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>s.jsx(Zxe,{children:s.jsx(rq,{ref:a,align:t,sideOffset:n,className:Te("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 I$=1,Jxe=.9,eye=.8,tye=.17,rS=.1,sS=.999,nye=.9999,rye=.99,sye=/[\\\/_+.#"@\[\(\{&]/,aye=/[\\\/_+.#"@\[\(\{&]/g,iye=/[\s-]/,sq=/[\s-]/g;function EN(e,t,n,r,a,i,o){if(i===t.length)return a===e.length?I$:rye;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*=I$:sye.test(e.charAt(f-1))?(p*=eye,x=e.slice(a,f-1).match(aye),x&&a>0&&(p*=Math.pow(sS,x.length))):iye.test(e.charAt(f-1))?(p*=Jxe,j=e.slice(a,f-1).match(sq),j&&a>0&&(p*=Math.pow(sS,j.length))):(p*=tye,a>0&&(p*=Math.pow(sS,f-a))),e.charAt(f)!==t.charAt(i)&&(p*=nye)),(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 $$(e){return e.toLowerCase().replace(sq," ")}function oye(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,EN(e,t,$$(e),$$(t),0,0,{})}var Ed='[cmdk-group=""]',aS='[cmdk-group-items=""]',lye='[cmdk-group-heading=""]',aq='[cmdk-item=""]',D$=`${aq}:not([aria-disabled="true"])`,PN="cmdk-item-select",Cc="data-value",cye=(e,t,n)=>oye(e,t,n),iq=m.createContext(void 0),fp=()=>m.useContext(iq),oq=m.createContext(void 0),$_=()=>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=bye();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 re,he,oe,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 ie=document.getElementById(A);ie?ie.focus():(re=document.getElementById(N))==null||re.focus()}if(E(7,()=>{var ie;n.current.selectedItemId=(ie=H())==null?void 0:ie.id,P.emit()}),J||E(5,G),((he=c.current)==null?void 0:he.value)!==void 0){let ie=K??"";(me=(oe=c.current).onValueChange)==null||me.call(oe,ie);return}}P.emit()}},emit:()=>{o.current.forEach(z=>z())}}),[]),R=m.useMemo(()=>({value:(z,K,J)=>{var re;K!==((re=i.current.get(z))==null?void 0:re.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,re;let he=(re=(J=c.current)==null?void 0:J.filter)!=null?re:cye;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(re=>{let he=a.current.get(re),oe=0;he.forEach(me=>{let ie=z.get(me);oe=Math.max(ie,oe)}),K.push([re,oe])});let J=k.current;L().sort((re,he)=>{var oe,me;let ie=re.getAttribute("id"),ge=he.getAttribute("id");return((oe=z.get(ge))!=null?oe:0)-((me=z.get(ie))!=null?me:0)}).forEach(re=>{let he=re.closest(aS);he?he.appendChild(re.parentElement===he?re:re.closest(`${aS} > *`)):J.appendChild(re.parentElement===J?re:re.closest(`${aS} > *`))}),K.sort((re,he)=>he[1]-re[1]).forEach(re=>{var he;let oe=(he=k.current)==null?void 0:he.querySelector(`${Ed}[${Cc}="${encodeURIComponent(re[0])}"]`);oe?.parentElement.appendChild(oe)})}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,re;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 oe of r.current){let me=(K=(z=i.current.get(oe))==null?void 0:z.value)!=null?K:"",ie=(re=(J=i.current.get(oe))==null?void 0:J.keywords)!=null?re:[],ge=M(me,ie);n.current.filtered.items.set(oe,ge),ge>0&&he++}for(let[oe,me]of a.current)for(let ie of me)if(n.current.filtered.items.get(ie)>0){n.current.filtered.groups.add(oe);break}n.current.filtered.count=he}function G(){var z,K,J;let re=H();re&&(((z=re.parentElement)==null?void 0:z.firstChild)===re&&((J=(K=re.closest(Ed))==null?void 0:K.querySelector(lye))==null||J.scrollIntoView({block:"nearest"})),re.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(D$))||[])}function I(z){let K=L()[z];K&&P.setState("value",K.getAttribute(Cc))}function Y(z){var K;let J=H(),re=L(),he=re.findIndex(me=>me===J),oe=re[he+z];(K=c.current)!=null&&K.loop&&(oe=he+z<0?re[re.length-1]:he+z===re.length?re[0]:re[he+z]),oe&&P.setState("value",oe.getAttribute(Cc))}function W(z){let K=H(),J=K?.closest(Ed),re;for(;J&&!re;)J=z>0?xye(J,Ed):yye(J,Ed),re=J?.querySelector(D$);re?P.setState("value",re.getAttribute(Cc)):Y(z)}let O=()=>I(L().length-1),Z=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(ut.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&&Z(z);break}case"ArrowDown":{Z(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 re=H();if(re){let he=new Event(PN);re.dispatchEvent(he)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:R.inputId,id:R.labelId,style:jye},d),Wv(e,z=>m.createElement(oq.Provider,{value:P},m.createElement(iq.Provider,{value:R},z))))}),uye=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=$_(),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(ut.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)}),dye=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(ut.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),Wv(e,x=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},m.createElement(lq.Provider,{value:v},x))))}),fye=m.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=m.useRef(null),i=wo(o=>!o.search);return!n&&!i?null:m.createElement(ut.div,{ref:zr(a,t),...r,"cmdk-separator":"",role:"separator"})}),pye=m.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,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(ut.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)}})}),hye=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(ut.div,{ref:zr(i,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:d.listId},Wv(e,f=>m.createElement("div",{ref:zr(o,d.listInnerRef),"cmdk-list-sizer":""},f)))}),mye=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}))))}),gye=m.forwardRef((e,t)=>wo(n=>n.filtered.count===0)?m.createElement(ut.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),vye=m.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...i}=e;return m.createElement(ut.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Wv(e,o=>m.createElement("div",{"aria-hidden":!0},o)))}),is=Object.assign(cq,{List:hye,Item:uye,Input:pye,Group:dye,Separator:fye,Dialog:mye,Empty:gye,Loading:vye});function xye(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function yye(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=$_(),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 bye=()=>{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 wye(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Wv({asChild:e,children:t},n){return e&&m.isValidElement(t)?m.cloneElement(wye(t),{ref:t.ref},n(t.props.children)):n(t)}var jye={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:Te("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:Te("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:Te("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:Te("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 Sye=m.forwardRef(({className:e,...t},n)=>s.jsx(is.Separator,{ref:n,className:Te("-mx-1 h-px bg-border",e),...t}));Sye.displayName=is.Separator.displayName;const xs=m.forwardRef(({className:e,...t},n)=>s.jsx(is.Item,{ref:n,className:Te("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 L$={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:[]},F$={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"},z$=()=>({id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096}),Nye=()=>{const{agentName:e}=Ml(),t=Xs(),{agents:n,setAgents:r}=Na(),{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??z$()),[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(z$()),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([...L$[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){Ie({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),Ie({title:O.kind==="deployments"?"Deployments loaded":"Models loaded",description:`${O.items.length} ${O.kind} from ${O.source}`})}catch(O){Ie({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()){Ie({title:"Name is required",variant:"destructive"});return}x(!0);try{if(i)await r([...n,d]),Ie({title:"Agent created"}),t(`/libraries/agents/${encodeURIComponent(d.id)}`);else{const O=n.map(Z=>Z.id===c?.id?d:Z);await r(O),Ie({title:"Agent saved"}),d.id!==o&&t(`/libraries/agents/${encodeURIComponent(d.id)}`,{replace:!0})}}finally{x(!1)}},W=async()=>{const O=n.filter(Z=>Z.id!==c?.id);await r(O),Ie({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(ee,{type:"button",onClick:()=>{L()},children:[s.jsx(HD,{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(wr,{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]}),F$[d.provider]&&s.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:["Hint: ",F$[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(Z=>({...Z,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(Z=>({...Z,provider:O,model:L$[O]?.[0]||""})),children:[s.jsx(Tn,{children:s.jsx($n,{})}),s.jsxs(Rn,{children:[s.jsx(mt,{value:"openai",children:"OpenAI"}),s.jsx(mt,{value:"anthropic",children:"Anthropic"}),s.jsx(mt,{value:"azure",children:"Azure OpenAI"}),s.jsx(mt,{value:"google",children:"Google"}),s.jsx(mt,{value:"custom",children:"Custom"})]})]})]})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(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(ee,{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:Z=>{f(q=>({...q,model:Z})),M(!1),P(!1)},children:[s.jsx(qc,{className:Te("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(ee,{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(wr,{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(Z=>({...Z,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(Z=>({...Z,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 Z=O.target.value.trim();f(q=>({...q,maxTurns:Z&&parseInt(Z)||void 0}))},placeholder:"30 (default)",className:"font-mono text-xs"}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Maximum number of LLM round-trips (tool calls + final answer) per eval run."})]})}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(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(Z=>({...Z,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(ba,{value:d.systemPrompt||"",onChange:O=>f(Z=>({...Z,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(ee,{type:"button",variant:"destructive",size:"sm",onClick:()=>p(!0),children:"Delete"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ee,{type:"button",variant:"outline",size:"sm",onClick:()=>t("/libraries/agents"),children:"Cancel"}),s.jsxs(ee,{type:"button",size:"sm",onClick:()=>{Y()},disabled:v,children:[v&&s.jsx(wr,{className:"mr-2 h-4 w-4 animate-spin"}),i?"Create Agent":"Save"]})]})]})]})]}),s.jsx(wa,{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"})]})]})})]})},B$="mcplab.resultAssistantScenarioHandoff",q$=()=>{const{testCaseId:e}=Ml(),[t,n]=Pi(),r=Xs(),{source:a}=On(),{scenarios:i,setScenarios:o,agents:c,servers:d,reload:f,loading:h}=Na(),[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),Z=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,re=t.get("returnTo")?.trim()||"",he=re.startsWith("/")?re:"",oe=J?i.findIndex(_e=>_e.id===J):-1,me=oe>=0?i[oe]:void 0,ie=async _e=>{if(!me||oe<0||!_e)return;const Ee=[...i];Ee[oe]=_e,await o(Ee)},ge=async()=>{const _e=Z.current;if(!_e||!me)return;if(W.current){O.current=!0;return}W.current=!0,O.current=!1;const Ee=++q.current;R("saving"),D("");try{await ie(_e),Ee===q.current&&R("saved")}catch(tt){const ct=tt instanceof Error?tt.message:String(tt);Ee===q.current&&(R("error"),D(ct)),Ie({title:"Could not save scenario",description:ct,variant:"destructive"})}finally{W.current=!1,O.current&&(O.current=!1,ge())}},Re=_e=>{Z.current=_e,R("dirty"),D(""),Y.current&&window.clearTimeout(Y.current),Y.current=window.setTimeout(()=>{Y.current=null,ge()},700)},Q=async()=>{const _e=`scn-${Date.now()}`;let Ee=_e,tt=1;for(;i.some(Pt=>Pt.id===Ee);)Ee=`${_e}-${tt}`,tt+=1;const ct={id:Ee,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};await o([...i,ct]),r(`/libraries/test-cases/${encodeURIComponent(Ee)}`),Ie({title:"Test case created",description:`Opened ${Ee} for editing.`})},Ne=_e=>{const Ee=(_e||`scn-${Date.now()}`).trim().replace(/\s+/g,"-").replace(/[^a-zA-Z0-9_-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")||`scn-${Date.now()}`;let tt=Ee,ct=1;for(;i.some(Pt=>Pt.id===tt);)tt=`${Ee}-${ct}`,ct+=1;return tt},Fe=async(_e,Ee=!1)=>{const tt=Ne(`${_e.id}-copy`),ct={...structuredClone(_e),id:tt,name:_e.name?`${_e.name} (Copy)`:""};await o([...i,ct]),Ie({title:"Test case duplicated",description:`Created ${ct.id}.`}),Ee&&r(`/libraries/test-cases/${encodeURIComponent(ct.id)}`)},pt=async _e=>{Y.current&&(window.clearTimeout(Y.current),Y.current=null);const Ee=i.filter(tt=>tt.id!==_e.id);await o(Ee),Ie({title:"Test case deleted",description:`${_e.id} was removed.`}),me?.id===_e.id&&(E(null),Z.current=null,R("idle"),D(""),r("/libraries/test-cases"))},ot=_e=>_e.map(Ee=>d.find(tt=>tt.id===Ee)).filter(Boolean).map(Ee=>Ee?.name||Ee?.id).filter(Boolean),bt=m.useMemo(()=>{const _e=new Set;for(const Ee of i)for(const tt of ot(Ee.serverIds))_e.add(tt);return Array.from(_e).sort((Ee,tt)=>Ee.localeCompare(tt))},[i,d]),wt=m.useMemo(()=>{const _e=p.trim().toLowerCase(),Ee=i.filter(tt=>{const ct=(tt.name||"").toLowerCase(),Pt=tt.id.toLowerCase(),Xt=(tt.prompt||"").toLowerCase(),kt=ot(tt.serverIds);return x!=="all"&&!kt.includes(x)?!1:_e?ct.includes(_e)||Pt.includes(_e)||Xt.includes(_e)||kt.some(nn=>nn.toLowerCase().includes(_e)):!0});return Ee.sort((tt,ct)=>{const Pt=ot(tt.serverIds),Xt=ot(ct.serverIds);let kt=0;switch(b){case"id":kt=tt.id.localeCompare(ct.id);break;case"servers":kt=Pt.length-Xt.length;break;case"evalRules":kt=tt.evalRules.length-ct.evalRules.length;break;case"extractRules":kt=tt.extractRules.length-ct.extractRules.length;break;default:kt=(tt.name||tt.id).localeCompare(ct.name||ct.id);break}return kt===0&&(kt=tt.id.localeCompare(ct.id)),S==="asc"?kt:-kt}),Ee},[i,p,x,b,S,d]);m.useEffect(()=>{let _e=!0;return a.getWorkspaceSettings().then(Ee=>{!_e||!Ee||A(Ee.scenarioAssistantAgentName??"")}).catch(()=>{_e&&A("")}),()=>{_e=!1}},[a]),m.useEffect(()=>{if(J&&t.get("assistantHandoff")==="1")try{const _e=window.sessionStorage.getItem(B$);if(!_e)return;const Ee=JSON.parse(_e);if(!Ee||Ee.scenarioId!==J||!Ee.prompt)return;F(String(Ee.prompt)),H(Date.now()),window.sessionStorage.removeItem(B$);const tt=new URLSearchParams(t);tt.delete("assistantHandoff"),n(tt,{replace:!0}),Ie({title:"Suggestion sent to Scenario Assistant",description:"Review the suggestion and apply changes in the scenario editor."})}catch{}},[J,t,n]),m.useEffect(()=>{const _e=Y.current!==null||W.current,Ee=Z.current;if(me&&Ee?.id===me.id&&_e)return;if(!!Ee&&Ee.id!==me?.id&&(Y.current!==null||O.current)){Y.current!==null&&(window.clearTimeout(Y.current),Y.current=null),O.current=!1;const ct=z.current,Pt=ct.findIndex(Xt=>Xt.id===Ee.id);if(Pt>=0){const Xt=[...ct];Xt[Pt]=Ee,K.current(Xt)}}Y.current&&(window.clearTimeout(Y.current),Y.current=null),W.current=!1,O.current=!1,me?(E(structuredClone(me)),Z.current=structuredClone(me),R("idle"),D("")):(E(null),Z.current=null,R("idle"),D(""))},[me]),m.useEffect(()=>()=>{Y.current&&window.clearTimeout(Y.current)},[]);const et=_||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(FD,{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(ee,{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(ee,{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(ee,{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(ee,{type:"button",size:"sm",onClick:()=>{Q()},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:_e=>v(_e.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(mt,{value:"all",children:"All servers"}),bt.map(_e=>s.jsx(mt,{value:_e,children:_e},_e))]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Ve,{className:"text-xs",children:"Sort By"}),s.jsxs(In,{value:b,onValueChange:_e=>y(_e),children:[s.jsx(Tn,{className:"h-8 text-xs",children:s.jsx($n,{})}),s.jsxs(Rn,{children:[s.jsx(mt,{value:"name",children:"Name"}),s.jsx(mt,{value:"id",children:"ID"}),s.jsx(mt,{value:"servers",children:"# Servers"}),s.jsx(mt,{value:"evalRules",children:"# Eval Rules"}),s.jsx(mt,{value:"extractRules",children:"# Extract Rules"})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Ve,{className:"text-xs",children:"Direction"}),s.jsxs(In,{value:S,onValueChange:_e=>N(_e),children:[s.jsx(Tn,{className:"h-8 w-28 text-xs",children:s.jsx($n,{})}),s.jsxs(Rn,{children:[s.jsx(mt,{value:"asc",children:"Ascending"}),s.jsx(mt,{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 ",wt.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."}):wt.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:wt.map(_e=>{const Ee=J===_e.id,tt=`/libraries/test-cases/${encodeURIComponent(_e.id)}`,ct=ot(_e.serverIds);return s.jsx("div",{className:`rounded-lg border p-3 ${Ee?"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:tt,className:"font-medium truncate hover:underline",children:_e.name||_e.id}),s.jsx(st,{variant:"outline",className:"font-mono text-[10px]",children:_e.id}),Ee&&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:[ct.length," server",ct.length!==1?"s":""]}),s.jsxs("span",{children:[_e.evalRules.length," eval rule",_e.evalRules.length!==1?"s":""]}),s.jsxs("span",{children:[_e.extractRules.length," extract rule",_e.extractRules.length!==1?"s":""]})]}),ct.length>0&&s.jsx("div",{className:"flex flex-wrap gap-1",children:ct.map(Pt=>s.jsx(st,{variant:"secondary",className:"text-[10px]",children:Pt},`${_e.id}-${Pt}`))})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(ee,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>I(_e),children:[s.jsx(Bs,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(ee,{type:"button",size:"sm",variant:"outline",onClick:()=>{Fe(_e)},children:[s.jsx(ss,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsx(ee,{type:"button",size:"sm",variant:Ee?"default":"outline",asChild:!0,children:s.jsxs(Tt,{to:tt,children:[s.jsx(wg,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})})]})]})},_e.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(ee,{type:"button",size:"sm",variant:"outline",onClick:()=>{Fe(k,!0)},children:[s.jsx(ss,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsxs(ee,{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:et,assistantInitialPromptByScenarioId:U&&k?.id?{[k.id]:U}:void 0,assistantAutoOpenNonceByScenarioId:k?.id&&G?{[k.id]:G}:void 0,onChange:_e=>{const Ee=_e[0];Ee&&(E(Ee),Re(Ee))},allowAdd:!1})})]}):null,s.jsx(wa,{open:!!L,onOpenChange:_e=>!_e&&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&&(pt(L),I(null))},children:"Delete Test Case"})]})]})})]})},Cye=()=>{const{source:e}=On(),{agents:t,reload:n,loading:r}=Na(),[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"),Ie({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}),Ie({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),Ie({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)}),Ie({title:"Settings updated",description:`Evaluation workers set to ${A}.`})}catch(E){x(k),Ie({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}),Ie({title:"Settings updated",description:A?`Default evaluation judge set to ${A}.`:"Default evaluation judge cleared."})}catch(E){p(k),Ie({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(ee,{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(kr,{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(mt,{value:"__none__",children:"None (use first agent)"}),t.map(A=>s.jsxs(mt,{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(kr,{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(mt,{value:"__none__",children:"None"}),t.map(A=>s.jsxs(mt,{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(kr,{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(mt,{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"})]})]})]})},_ye=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:Te(_ye({variant:t}),e),...n}));fl.displayName="Alert";const pl=m.forwardRef(({className:e,...t},n)=>s.jsx("h5",{ref:n,className:Te("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:Te("text-sm [&_p]:leading-relaxed",e),...t}));hl.displayName="AlertDescription";const Aye="127.0.0.1",kye=3011,Eye="/mcp",Pye=`http://${Aye}:${kye}${Eye}`;function Tye(e){return navigator.clipboard.writeText(e)}function fq({text:e,label:t}){const[n,r]=m.useState(!1),a=async()=>{try{await Tye(e),r(!0),Ie({title:"Copied",description:`${t} copied to clipboard.`}),window.setTimeout(()=>r(!1),1500)}catch(i){Ie({title:"Copy failed",description:i instanceof Error?i.message:String(i),variant:"destructive"})}};return s.jsxs(ee,{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 U$({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(kr,{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 Rye=()=>{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),Ie({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??Pye,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(ee,{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(kr,{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(U$,{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(U$,{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 Oye(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,Mye(a,...t)]}function Mye(...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 Iye=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],pq=Iye.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}},{}),D_="Progress",L_=100,[$ye]=Oye(D_),[Dye,Lye]=$ye(D_),hq=m.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:a,getValueLabel:i=Fye,...o}=e;(a||a===0)&&!W$(a)&&console.error(zye(`${a}`,"Progress"));const c=W$(a)?a:L_;r!==null&&!V$(r,c)&&console.error(Bye(`${r}`,"Progress"));const d=V$(r,c)?r:null,f=pg(d)?i(d,c):void 0;return s.jsx(Dye,{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=D_;var mq="ProgressIndicator",gq=m.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,a=Lye(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 Fye(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 W$(e){return pg(e)&&!isNaN(e)&&e>0}function V$(e,t){return pg(e)&&!isNaN(e)&&e<=t&&e>=0}function zye(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${L_}\`.`}function Bye(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 ${L_} if no \`max\` prop is set)
|
|
140
|
-
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
141
|
-
|
|
142
|
-
Defaulting to \`null\`.`}var xq=hq,qye=gq;const Vv=m.forwardRef(({className:e,value:t,...n},r)=>s.jsx(xq,{ref:r,className:Te("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:s.jsx(qye,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Vv.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 H$(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 Uye(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 K$(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),Ie({title:`${e} copied`})}catch(r){Ie({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 Wye({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(Ba,{className:"max-w-sm text-xs",children:s.jsx("p",{children:t})})]})})}function F_(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-${K$(`${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(kr,{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):Uye(R)} ${M?"ring-1 ring-current":"opacity-70"}`,children:[R,": ",e.summary.issueCounts[R]]})},R)}),s.jsx(ee,{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(Fa,{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(Fa,{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(ee,{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(ee,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:E,children:"Expand all"}),s.jsx(ee,{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(ee,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>A(!0),children:"Expand all"}),s.jsx(ee,{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(kr,{children:[M.length," finding(s)"]})]}),s.jsx("div",{className:"flex gap-2",children:s.jsx(ee,{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(ee,{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(kr,{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-${K$(`${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(Wye,{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(ee,{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(ee,{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(ee,{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:H$(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:H$(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 Vye(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 G$(e){return e.trim().toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}function Hye(e,t){const n=["tool-info",G$(e)],r=t?.trim();return r&&n.push(`v${G$(r)}`),`${n.filter(Boolean).join("-")}.json`}function Kye(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 Gye(e,t){try{await navigator.clipboard.writeText(t),Ie({title:`${e} copied`})}catch(n){Ie({title:`Could not copy ${e.toLowerCase()}`,description:n instanceof Error?n.message:String(n),variant:"destructive"})}}function Y$({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(Ba,{className:"max-w-xs text-xs",children:s.jsx("p",{children:e})})]})}function Yye(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 Xye({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(Ba,{className:"max-w-sm text-xs",children:s.jsx("p",{children:t})})]})})}const Qye=()=>{const e=Se=>`tool-analysis-${Date.now()}.${Se}`,{source:t}=On(),{servers:n,agents:r,loading:a,reload:i}=Na(),[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),[Z,q]=m.useState(!1),[z,K]=m.useState("configure"),[J,re]=m.useState("idle"),[he,oe]=m.useState(!1),me=m.useRef(null),ie=m.useRef(null),ge=o||r[0]?.name||"",Re=m.useMemo(()=>Kye(H),[H]);m.useEffect(()=>{let Se=!0;return t.getWorkspaceSettings().then(Xe=>{!Se||!Xe||c(Xe.scenarioAssistantAgentName??"")}).catch(()=>{Se&&c("")}),()=>{Se=!1}},[t]),m.useEffect(()=>()=>{me.current?.()},[]),m.useEffect(()=>{const Se=ie.current;Se&&requestAnimationFrame(()=>{Se.scrollTop=Se.scrollHeight})},[H.length]);const Q=()=>{try{sessionStorage.removeItem(cS)}catch{}},Ne=Se=>{try{sessionStorage.setItem(cS,Se)}catch{}},Fe=Se=>{me.current?.(),me.current=t.subscribeToolAnalysisJob(Se,Xe=>{if(L(Qe=>[...Qe,Xe]),Xe.type==="completed")t.getToolAnalysisResult(Se).then(Qe=>{Y(Qe.report),O(Qe.savedReportId??null)}).catch(Qe=>Ie({title:"Could not load analysis report",description:Qe instanceof Error?Qe.message:String(Qe),variant:"destructive"})).finally(()=>{Q(),G(null),q(!1),re("idle"),K("run")});else if(Xe.type==="error"){const Qe=String(Xe.payload?.message??"");Q(),re(Qe.toLowerCase().includes("abort")?"stopped":"error"),G(null),q(!1)}})};m.useEffect(()=>{if(F||I)return;let Se="";try{Se=sessionStorage.getItem(cS)??""}catch{Se=""}if(Se)return K("run"),re("running"),q(!0),G(Se),L([]),Fe(Se),()=>{}},[t,F,I]);const pt=async()=>{if(d.length===0){x([]),b({});return}const Se=d.filter(Xe=>n.find(At=>At.id===Xe)?.authType==="oauth2");try{Se.length>0&&(oe(!0),await vi({serverNames:Se,source:t,onServerAuthStart:Xe=>{Ie({title:`OAuth login required for ${Xe}`,description:"Complete login in the opened browser tab. Discovery will continue automatically."})}}))}catch(Xe){Ie({title:"OAuth login failed",description:Xe instanceof Error?Xe.message:String(Xe),variant:"destructive"}),oe(!1);return}finally{oe(!1)}p(!0);try{const Xe=await t.discoverToolsForAnalysis({serverNames:d});x(Xe.servers),b(Qe=>{const At={};for(const Bt of Xe.servers){const de=Qe[Bt.serverName]??[],Ke=Bt.tools.map(se=>se.name),$e=de.filter(se=>Ke.includes(se));At[Bt.serverName]=$e.length>0?$e:Ke}return At})}catch(Xe){Ie({title:"Could not discover MCP tools",description:Xe instanceof Error?Xe.message:String(Xe),variant:"destructive"})}finally{p(!1)}};m.useEffect(()=>{pt()},[d.join("|")]);const ot=m.useMemo(()=>{const Se=y.trim().toLowerCase();return Se?v.map(Xe=>({...Xe,tools:Xe.tools.filter(Qe=>Qe.name.toLowerCase().includes(Se)||(Qe.description||"").toLowerCase().includes(Se))})).filter(Xe=>Xe.tools.length>0):v},[v,y]),bt=m.useMemo(()=>Object.values(j).reduce((Se,Xe)=>Se+Xe.length,0),[j]),wt=d[0]??"",et=async()=>{if(!N&&!A){Ie({title:"Select at least one mode",variant:"destructive"});return}if(d.length!==1){Ie({title:"Select exactly one server",variant:"destructive"});return}if(bt===0){Ie({title:"Select at least one tool",variant:"destructive"});return}q(!0),L([]),Y(null),O(null),K("run"),re("running");try{const Se=d[0];n.find(At=>At.id===Se)?.authType==="oauth2"&&(oe(!0),await vi({serverNames:[Se],source:t,onServerAuthStart:At=>{Ie({title:`OAuth login required for ${At}`,description:"Complete login in the opened browser tab. Analysis will continue automatically."})}}));const{jobId:Qe}=await t.startToolAnalysis({serverNames:d,selectedToolsByServer:j,maxParallelTools:E,modes:{metadataReview:N,deeperAnalysis:A},deeperAnalysisOptions:{autoRunPolicy:"read_only_allowlist",sampleCallsPerTool:R,toolCallTimeoutMs:D}});G(Qe),Ne(Qe),Fe(Qe)}catch(Se){q(!1),re("error"),K("run"),Ie({title:"Could not start tool analysis",description:Se instanceof Error?Se.message:String(Se),variant:"destructive"})}finally{oe(!1)}},_e=()=>{const Se=d[0],Xe=v.find(At=>At.serverName===Se);if(!Se||!Xe){Ie({title:"No discovered tool info available",description:"Select a server and discover tools before downloading tool info.",variant:"destructive"});return}const Qe=Vye({serverName:Xe.serverName,tools:Xe.tools,selectedToolNames:j[Xe.serverName]});uS(Hye(Xe.serverName,Xe.mcpServerVersion),`${JSON.stringify(Qe,null,2)}
|
|
145
|
-
`,"application/json")},Ee=async()=>{if(!F)return;const Se=F;try{const Xe=await t.stopToolAnalysis(Se);if(Xe.status==="completed"){me.current?.(),me.current=null;const Qe=await t.getToolAnalysisResult(Se);Y(Qe.report),O(Qe.savedReportId??null),Q(),G(null),q(!1),re("idle"),K("run"),Ie({title:"Analysis already finished",description:"Showing the result overview."});return}if(Xe.status==="stopped"){me.current?.(),me.current=null,Q(),G(null),q(!1),re("stopped"),Ie({title:"Analysis stopped"});return}if(Xe.status==="error"){me.current?.(),me.current=null,Q(),G(null),q(!1),re("error"),Ie({title:"Analysis already ended with an error",description:"Review the progress log and return to Configure Analysis."});return}Ie({title:"Stopping analysis..."})}catch(Xe){Ie({title:"Could not stop analysis",description:Xe instanceof Error?Xe.message:String(Xe),variant:"destructive"})}},tt=()=>{K("configure"),re("idle"),G(null)},ct=(Se,Xe)=>{f(Qe=>Xe?[Se]:Qe.filter(At=>At!==Se))},Pt=(Se,Xe,Qe)=>{b(At=>{const Bt=new Set(At[Se]??[]);return Qe?Bt.add(Xe):Bt.delete(Xe),{...At,[Se]:Array.from(Bt)}})},Xt=(Se,Xe)=>{b(Qe=>({...Qe,[Se]:Xe}))},kt=!0,nn=F!==null||H.length>0||J==="stopped"||J==="error",Jt=!!I,zt=Se=>{if(Se==="configure"&&kt){K("configure");return}if(Se==="run"&&nn){K("run");return}Se==="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(UD,{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(kr,{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(ee,{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(Se=>{const Xe=d.includes(Se.id);return s.jsxs("label",{className:"flex items-start gap-2 rounded-md border p-2 text-sm",children:[s.jsx(Lr,{checked:Xe,onCheckedChange:Qe=>ct(Se.id,!!Qe)}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"font-medium",children:Se.name||Se.id}),Se.url&&s.jsx("div",{className:"truncate text-xs text-muted-foreground",children:Se.url})]})]},Se.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:Se=>S(Se.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:wt?`Tools for ${wt}`:"Tools"}),s.jsxs("div",{className:"ml-auto flex flex-wrap items-center gap-2",children:[s.jsxs(ee,{type:"button",size:"sm",variant:"outline",onClick:_e,disabled:h||he||d.length===0||v.length===0,children:[s.jsx(Mr,{className:"mr-2 h-4 w-4"}),"Download Tool Info"]}),s.jsxs(ee,{type:"button",size:"sm",variant:"outline",onClick:()=>{pt()},disabled:h||he||d.length===0,children:[h&&s.jsx(wr,{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..."}):ot.length===0&&!h?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No discovered tools match the current filters."}):ot.map(Se=>{const Xe=new Set(j[Se.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:Se.serverName}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(ee,{type:"button",size:"sm",variant:"ghost",onClick:()=>{Gye("Tool list",`${JSON.stringify({server:Se.serverName,tools:Se.tools.map(Qe=>({name:Qe.name,title:Qe.title,description:Qe.description}))},null,2)}
|
|
146
|
-
`)},children:[s.jsx(ss,{className:"mr-1.5 h-3.5 w-3.5"}),"Copy"]}),s.jsx(ee,{type:"button",size:"sm",variant:"ghost",onClick:()=>Xt(Se.serverName,Se.tools.map(Qe=>Qe.name)),children:"Select all"}),s.jsx(ee,{type:"button",size:"sm",variant:"ghost",onClick:()=>Xt(Se.serverName,[]),children:"Clear"})]})]}),Se.warnings.length>0&&s.jsx("div",{className:"mb-2 space-y-1",children:Se.warnings.map(Qe=>s.jsx("div",{className:"text-xs text-amber-700",children:Yye(Se.serverName,Qe)},`${Se.serverName}-${Qe}`))}),s.jsx("div",{className:"grid gap-2",children:Se.tools.map(Qe=>{const At=yq(Qe.classificationReason),Bt=Qe.safetyClassification==="read_only"?"read-only":At?"write/delete":"unsafe/unknown",de=Qe.safetyClassification==="read_only"?"border-emerald-200 bg-emerald-50 text-emerald-700":At?"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(Lr,{checked:Xe.has(Qe.name),onCheckedChange:Ke=>Pt(Se.serverName,Qe.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:Qe.name}),Qe.title&&s.jsx("span",{className:"text-xs text-muted-foreground",children:Qe.title}),s.jsx(Xye,{label:Bt,reason:Qe.classificationReason,variantClassName:de}),Qe.inputSchema&&s.jsx(st,{variant:"outline",className:"border-border text-[10px] text-muted-foreground",children:"schema: input"}),Qe.outputSchema&&s.jsx(st,{variant:"outline",className:"border-border text-[10px] text-muted-foreground",children:"schema: output"})]}),Qe.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:Qe.description})]})]},`${Se.serverName}-${Qe.name}`)})})]},Se.serverName)})}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Selected tools: ",bt]})]}),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(Lr,{checked:N,onCheckedChange:Se=>_(!!Se)}),s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Metadata / schema review",s.jsx(Y$,{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(Lr,{checked:A,onCheckedChange:Se=>k(!!Se)}),s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Deeper analysis",s.jsx(Y$,{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:Se=>P(Math.max(1,Math.min(8,Number(Se.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:Se=>M(Math.max(1,Math.min(5,Number(Se.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:Se=>U(Math.max(1e3,Math.min(6e4,Number(Se.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(ee,{type:"button",onClick:()=>{et()},disabled:Z||he||!!F,children:[(Z||!!F)&&s.jsx(wr,{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(kr,{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(ee,{type:"button",size:"sm",variant:"outline",onClick:()=>{Ee()},children:"Stop Analysis"}):s.jsx(ee,{type:"button",size:"sm",variant:"outline",onClick:tt,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(wr,{className:"h-3.5 w-3.5 animate-spin"}),"Analysis is still running..."]}),(Re.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:Re.totalTools>0?`${Re.finishedTools}/${Re.totalTools} tools finished`:"Preparing analysis..."}),s.jsx("span",{children:Re.totalTools>0?`${Re.percent}%`:"0%"})]}),s.jsx(Vv,{value:Re.totalTools>0?Re.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:ie,className:"max-h-64 space-y-1 overflow-auto rounded border bg-muted/20 p-2",children:H.map((Se,Xe)=>s.jsxs("div",{className:"text-xs",children:[s.jsx("span",{className:"mr-2 font-mono text-muted-foreground",children:new Date(Se.ts).toLocaleTimeString()}),s.jsx(st,{variant:"outline",className:"mr-2 text-[10px]",children:Se.type}),s.jsx("span",{className:"break-all",children:typeof Se.payload.message=="string"?Se.payload.message:JSON.stringify(Se.payload)})]},`${Se.ts}-${Xe}`))}),!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(ee,{asChild:!0,size:"sm",children:s.jsx(Tt,{to:`/tool-analysis-results/${W}`,children:"Open result details"})}),s.jsx(ee,{asChild:!0,size:"sm",variant:"outline",children:s.jsx(Tt,{to:"/tool-analysis-results",children:"View all results"})}),s.jsx(ee,{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(Se=>Se===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(ee,{type:"button",size:"sm",variant:"outline",onClick:tt,children:"Back to Configure Analysis"}),W&&s.jsxs(s.Fragment,{children:[s.jsx(ee,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx(Tt,{to:`/tool-analysis-results/${W}`,children:"Open saved report"})}),s.jsx(ee,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx(Tt,{to:"/tool-analysis-results",children:"View all reports"})})]}),s.jsxs(ee,{type:"button",size:"sm",variant:"outline",onClick:()=>uS(e("json"),`${JSON.stringify(I,null,2)}
|
|
147
|
-
`,"application/json"),children:[s.jsx(Mr,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(ee,{type:"button",size:"sm",variant:"outline",onClick:()=>uS(e("md"),F_(I),"text/markdown"),children:[s.jsx(Mr,{className:"mr-2 h-4 w-4"}),"Export Markdown"]})]})]}),s.jsx(bq,{report:I})]})]})};function Hv(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 Zye(){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=Hv(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){Ie({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)),Ie({title:"Tool analysis report deleted"}),o(null)}catch(P){Ie({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`,F_(M.report),"text/markdown")}catch(M){Ie({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(WD,{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(ee,{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(ee,{variant:"outline",onClick:()=>{_()},disabled:r,children:r?"Refreshing...":"Refresh"}),s.jsx(ee,{variant:"outline",onClick:y.prev,disabled:r||S===0,children:"Prev"}),s.jsx(ee,{variant:"outline",onClick:y.next,disabled:r||!N,children:"Next"}),s.jsx(ee,{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(ft,{children:"Report ID"}),s.jsx(ft,{children:"Evaluated"}),s.jsx(ft,{children:"Timestamp"}),s.jsx(ft,{children:"Issues"}),s.jsx(ft,{children:"Modes"}),s.jsx(ft,{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(va,{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(ee,{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(Or,{asChild:!0,children:s.jsx(Tt,{to:`/tool-analysis-results/${P.reportId}`,children:"View"})}),s.jsxs(Or,{onSelect:()=>{E(P.reportId,"json")},children:[s.jsx(Mr,{className:"mr-2 h-3.5 w-3.5"})," Export JSON"]}),s.jsxs(Or,{onSelect:()=>{E(P.reportId,"markdown")},children:[s.jsx(Mr,{className:"mr-2 h-3.5 w-3.5"})," Export Markdown"]}),s.jsxs(Or,{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(Or,{onSelect:()=>{E(P.reportId,"tool_schemas")},children:[s.jsx(Mr,{className:"mr-2 h-3.5 w-3.5"})," Export MCP Info"]})]})]})})]},P.reportId))})]})]})})}),s.jsx(wa,{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 Jye(){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}Ie({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),Ie({title:"Tool analysis report deleted"}),t("/tool-analysis-results")}catch(j){Ie({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(ee,{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(va,{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(ee,{asChild:!0,size:"sm",variant:"outline",children:s.jsx(Tt,{to:"/tool-analysis-results",children:"Back to results"})}),s.jsxs(ee,{type:"button",size:"sm",variant:"outline",onClick:()=>fS(`${r.reportId}.json`,`${JSON.stringify(r,null,2)}
|
|
150
|
-
`,"application/json"),children:[s.jsx(Mr,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(ee,{type:"button",size:"sm",variant:"outline",onClick:()=>fS(`${r.reportId}.md`,F_(r.report),"text/markdown"),children:[s.jsx(Mr,{className:"mr-2 h-4 w-4"}),"Export Markdown"]}),s.jsxs(ee,{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(Mr,{className:"mr-2 h-4 w-4"}),"Export MCP info"]}),s.jsxs(ee,{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(wa,{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 ebe=[{id:"configure",label:"Configure Debug Session"},{id:"run",label:"Run / Inspect Flow"},{id:"report",label:"Report / Export"}],tbe="resolve_target_metadata",nbe="token_exchange",rbe="resource_probe";function Tr({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(Ba,{className:"max-w-xs text-xs leading-relaxed",children:e})]})})}function X$(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 sbe(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 abe(){const{source:e}=On(),{servers:t,reload:n,loading:r}=Na(),[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(""),[Z,q]=m.useState(""),[z,K]=m.useState(""),[J,re]=m.useState(""),[he,oe]=m.useState(""),[me,ie]=m.useState(""),[ge,Re]=m.useState(null),[Q,Ne]=m.useState(null),[Fe,pt]=m.useState([]),[ot,bt]=m.useState(!1),[wt,et]=m.useState(!1),[_e,Ee]=m.useState(!1),[tt,ct]=m.useState("all"),[Pt,Xt]=m.useState("all"),[kt,nn]=m.useState("inspector"),Jt=m.useRef(null),zt=m.useRef(null),Se=m.useRef(!1),Xe=m.useRef(j);m.useEffect(()=>{Xe.current=j},[j]),m.useEffect(()=>()=>{Jt.current?.(),Jt.current=null},[]),m.useEffect(()=>{zt.current?.scrollIntoView({behavior:"smooth",block:"end"})},[Fe.length]);const Qe=m.useMemo(()=>t.filter(ne=>ne.authType==="oauth2").slice().sort((ne,Le)=>(ne.name||ne.id).localeCompare(Le.name||Le.id,void 0,{sensitivity:"base"})),[t]),At=Qe.find(ne=>ne.id===o);m.useEffect(()=>{o&&(Qe.some(ne=>ne.id===o)||c(""))},[Qe,o]),m.useEffect(()=>{At&&(At.oauthMode==="dcr"?(f("dcr"),P(""),M("")):(f("pre_registered"),P(At.oauthClientId??""),M(At.oauthClientSecret??"")),_(At.oauthScope??""),q(At.oauthAuthorizationUrl??""),K(At.oauthTokenEndpoint??""))},[At?.id]);const Bt=m.useMemo(()=>{const ne=ge?.stepStates.length??0,Le=ge?.stepStates.filter(Ce=>Ce.status==="completed"||Ce.status==="skipped").length??0,ht=ge?.stepStates.filter(Ce=>Ce.status==="failed").length??0,Qt=ne>0?Math.round((Le+ht)/ne*100):0;return{total:ne,completed:Le,failed:ht,percent:Qt}},[ge]),de=m.useMemo(()=>{const ne=ge?.network??[],Le=new Map,ht=[],Qt=Ce=>`${Ce.stepId}::${Ce.label}::${Ce.url}`;for(const Ce of ne){if(Ce.phase==="request"){const Hn=ht.length;ht.push({key:Ce.id,stepId:Ce.stepId,label:Ce.label,method:Ce.method,url:Ce.url,request:Ce});const _n=Qt(Ce),Ya=Le.get(_n)??[];Ya.push(Hn),Le.set(_n,Ya);continue}const en=Qt(Ce),_t=Le.get(en),Kt=_t?.shift();if(typeof Kt=="number"){ht[Kt]={...ht[Kt],response:Ce},_t&&_t.length>0?Le.set(en,_t):Le.delete(en);continue}ht.push({key:Ce.id,stepId:Ce.stepId,label:Ce.label,method:Ce.method,url:Ce.url,response:Ce})}return ht.filter(Ce=>tt!=="all"&&Ce.stepId!==tt?!1:Pt==="error"?typeof Ce.response?.status=="number"&&Ce.response.status>=400:Pt==="ok"?typeof Ce.response?.status=="number"&&Ce.response.status<400:!0)},[ge?.network,tt,Pt]),Ke=!!Q,$e=!!(ge&&(ge.status==="completed"||ge.status==="error"||ge.status==="stopped")),se=m.useMemo(()=>{const ne=new Map;return(ge?.stepStates??[]).forEach((Le,ht)=>{ne.set(Le.id,ht+1)}),ne},[ge?.stepStates]),we=m.useMemo(()=>{const ne=(ge?.network??[]).filter(Le=>Le.phase==="response");return{resourceMetadata:ne.find(Le=>Le.label==="Protected Resource Metadata"),authorizationServerMetadata:ne.find(Le=>Le.label==="Authorization Server Metadata")}},[ge?.network]),Ue=m.useMemo(()=>{const ne=new Map;for(const Le of ge?.network??[]){const ht=ne.get(Le.stepId)??{requests:[],responses:[]};Le.phase==="request"&&ht.requests.push(Le),Le.phase==="response"&&ht.responses.push(Le),ne.set(Le.stepId,ht)}return ne},[ge?.network]),B=ne=>{if(ne==="configure"||ne==="run"&&Ke||ne==="report"&&$e)return i(ne)},le=()=>{let ne;if(d==="dcr"&&F.trim())try{ne=JSON.parse(F)}catch{throw new Error("DCR metadata JSON is invalid")}if(!At)throw new Error("Select an MCP server");return{profile:"latest",target:{serverName:At.id,overrides:{authorizationServerMetadataUrl:W||void 0,authorizationEndpoint:Z||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:ne,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(Le=>Le.trim()).filter(Boolean),resource:A.trim()||void 0,usePkce:y,codeChallengeMethod:"S256"},display:{showSensitiveValues:v}}},fe=ne=>{Jt.current?.(),Jt.current=e.subscribeOAuthDebuggerSession(ne,Le=>{pt(Qt=>[...Qt,Le]),(Le.type==="completed"||Le.type==="error"||Le.type==="stopped")&&bt(!1),e.getOAuthDebuggerSession(ne).then(Qt=>{Re(Qt.session),Qt.session.uiHints.authorizationUrl&&De(`${pS()}/api/oauth-debugger/sessions/${ne}/authorize`),Qt.session.status==="completed"&&i("report")}).catch(()=>{})})},De=ne=>{!Xe.current||Se.current||!ne||(Se.current=!0,window.open(ne,"_blank","noopener,noreferrer"))},Me=async()=>{et(!0),Se.current=!1;try{const ne=le(),Le=await e.createOAuthDebuggerSession(ne);Ne(Le.sessionId),Re(Le.session),pt([]),i("run"),fe(Le.sessionId);const ht=await e.startOAuthDebuggerSession(Le.sessionId);Re(ht.session),bt(!0),(ht.session.status==="waiting_for_user"||ht.session.status==="waiting_for_browser_callback")&&(bt(!1),ht.session.uiHints.authorizationUrl&&De(`${pS()}/api/oauth-debugger/sessions/${Le.sessionId}/authorize`))}catch(ne){Ie({title:"Could not start OAuth Debugger session",description:ne instanceof Error?ne.message:String(ne),variant:"destructive"})}finally{et(!1)}},Ge=async()=>{if(Q)try{et(!0);const ne=await e.submitOAuthDebuggerManualCallback(Q,{redirectUrl:me.trim()||void 0});Re(ne.session),ie(""),bt(!0)}catch(ne){Ie({title:"Could not submit callback",description:ne instanceof Error?ne.message:String(ne),variant:"destructive"})}finally{et(!1)}},Oe=async()=>{if(Q){Ee(!0);try{const ne=await e.stopOAuthDebuggerSession(Q);if(bt(!1),ne.status!=="running"){const Le=await e.getOAuthDebuggerSession(Q);Re(Le.session),Le.session.status==="completed"?i("report"):i("run")}}catch(ne){Ie({title:"Could not stop session",description:ne instanceof Error?ne.message:String(ne),variant:"destructive"})}finally{Ee(!1)}}},V=async()=>{Jt.current?.(),Jt.current=null,Re(null),Ne(null),pt([]),bt(!1),Ee(!1),et(!1),ie(""),ct("all"),Xt("all"),nn("inspector"),i("run"),await Me()},ve=async ne=>{if(!(!Q||!ge))try{const Le=await e.exportOAuthDebuggerSession(Q,ne);let ht="";const Qt=ne==="json"?"json":ne==="raw"?"txt":"md";typeof Le=="string"?ht=Le:ht=`${JSON.stringify(Le,null,2)}
|
|
155
|
-
`;const Ce=new Blob([ht],{type:"text/plain;charset=utf-8"}),en=URL.createObjectURL(Ce),_t=document.createElement("a");_t.href=en,_t.download=`oauth-debugger-${Q}.${Qt}`,_t.click(),URL.revokeObjectURL(en)}catch(Le){if(ne==="markdown"){const ht=sbe(ge,Fe),Qt=new Blob([ht],{type:"text/markdown;charset=utf-8"}),Ce=URL.createObjectURL(Qt),en=document.createElement("a");en.href=Ce,en.download=`oauth-debugger-${ge.id}.md`,en.click(),URL.revokeObjectURL(Ce);return}Ie({title:"Export failed",description:Le instanceof Error?Le.message:String(Le),variant:"destructive"})}},Ae=Q?`${pS()}/api/oauth-debugger/sessions/${Q}/authorize`:void 0,Je=ne=>ne==="error"?"destructive":ne==="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:ebe.map(ne=>{const Le=a===ne.id,ht=ne.id==="configure"||ne.id==="run"&&Ke||ne.id==="report"&&$e;return s.jsx("button",{type:"button",onClick:()=>ht&&B(ne.id),disabled:!ht,className:"rounded-full",children:s.jsx(st,{variant:Le?"default":"outline",className:ht?"":"opacity-50",children:ne.label})},ne.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(kr,{children:"Select one MCP server from Libraries and optionally override endpoints."})]}),s.jsxs(ee,{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:Qe.map(ne=>s.jsx(mt,{value:ne.id,children:ne.name||ne.id},ne.id))})]}),Qe.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"}),"."]}),At&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:[At.transport," ·"," ",At.url||At.command||"No URL/command"," · ",s.jsxs("span",{className:"text-primary",children:[At.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(kr,{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(ne=>s.jsxs("button",{type:"button",onClick:()=>f(ne.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===ne.id?"bg-primary":"bg-muted-foreground/30"}`}),s.jsx("span",{className:"text-sm font-medium",children:ne.label})]}),s.jsx("p",{className:"mt-1 pl-5 text-xs text-muted-foreground",children:ne.hint})]},ne.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(Tr,{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:ne=>p(ne),children:[s.jsx(Tn,{children:s.jsx($n,{})}),s.jsxs(Rn,{children:[s.jsx(mt,{value:"local_callback",children:"Local callback (recommended)"}),s.jsx(mt,{value:"manual",children:"Manual paste redirect URL"})]})]})]})}),d==="pre_registered"&&s.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsxs(Ve,{className:"text-xs flex items-center gap-1",children:["client_id",s.jsx(Tr,{text:"The unique identifier for your application, issued by the authorization server when you registered the client."})]}),s.jsx(Et,{value:E,onChange:ne=>P(ne.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(Tr,{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:ne=>M(ne.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(Tr,{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:ne=>L(ne.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(kr,{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:ne=>_(ne.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(Lr,{checked:y,onCheckedChange:ne=>S(!!ne)}),s.jsxs(Ve,{className:"flex items-center gap-1",children:["Use PKCE (S256)",s.jsx(Tr,{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(Lr,{checked:j,onCheckedChange:ne=>b(!!ne)}),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(Tr,{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(mt,{value:"__default__",children:"Server default (let the server decide)"}),s.jsx(mt,{value:"client_secret_basic",children:"client_secret_basic — credentials in Authorization header"}),s.jsx(mt,{value:"client_secret_post",children:"client_secret_post — credentials in request body"}),s.jsx(mt,{value:"none",children:"none — public client, no secret"}),s.jsx(mt,{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(Tr,{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:ne=>k(ne.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(Tr,{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(ba,{value:F,onChange:ne=>G(ne.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(Tr,{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:ne=>Y(ne.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(Tr,{text:"The /.well-known/oauth-authorization-server URL. Override if the server uses a non-standard path."})]}),s.jsx(Et,{value:W,onChange:ne=>O(ne.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(Tr,{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:ne=>oe(ne.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(Tr,{text:"The URL where users are redirected to log in and grant consent. Normally discovered automatically from the server metadata."})]}),s.jsx(Et,{value:Z,onChange:ne=>q(ne.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(Tr,{text:"The URL your app calls to exchange the authorization code for an access token. Normally discovered automatically."})]}),s.jsx(Et,{value:z,onChange:ne=>K(ne.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(Tr,{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:ne=>re(ne.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(Tr,{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:ne=>L(ne.target.value),placeholder:"https://.../client-metadata.json"})]})]})]}),s.jsxs(fl,{children:[s.jsx(Oy,{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(Lr,{checked:!v,onCheckedChange:ne=>x(ne===!1)}),s.jsx(Ve,{children:"Hide sensitive values in inspector"})]})]})]})]})]}),s.jsx("div",{className:"flex justify-end",children:s.jsxs(ee,{type:"button",onClick:()=>{Me()},disabled:wt,children:[wt&&s.jsx(wr,{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(kr,{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&&Ae&&s.jsx(ee,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsxs("a",{href:Ae,target:"_blank",rel:"noopener noreferrer",children:[s.jsx(Xh,{className:"mr-2 h-4 w-4"}),"Open Authorization URL"]})}),s.jsxs(ee,{type:"button",size:"sm",variant:"outline",onClick:()=>{V()},disabled:wt,children:[s.jsx(zs,{className:"mr-2 h-4 w-4"}),"Restart"]}),Q&&s.jsxs(ee,{type:"button",size:"sm",variant:"outline",onClick:()=>{Oe()},disabled:_e||!Q,children:[(_e||ot)&&_e&&s.jsx(wr,{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(Vv,{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(ba,{value:me,onChange:ne=>ie(ne.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(ee,{type:"button",size:"sm",onClick:()=>{Ge()},disabled:wt||!me.trim(),children:[wt&&s.jsx(wr,{className:"mr-2 h-4 w-4 animate-spin"}),"Continue"]}),ge.uiHints.authorizationUrl&&Ae&&s.jsx(ee,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx("a",{href:Ae,target:"_blank",rel:"noopener noreferrer",children:"Open Authorization URL"})})]})]})}),ge?.status==="waiting_for_browser_callback"&&s.jsxs(fl,{children:[s.jsx(Oy,{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&&Ae&&s.jsx("div",{className:"pt-2",children:s.jsx(ee,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsxs("a",{href:Ae,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(ne=>{const Le=se.get(ne.id),ht=Ue.get(ne.id),Qt=ne.id===nbe||ne.id===rbe,Ce=!!(ht&&(ht.requests.length>0||ht.responses.length>0)),en=Qt&&ne.status!=="pending"&&Ce;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:Le}),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:ne.title}),ne.status==="completed"&&s.jsx(fi,{className:"h-4 w-4 shrink-0 text-emerald-600","aria-hidden":"true"})]}),s.jsx("div",{className:"text-xs text-muted-foreground",children:ne.description})]})]}),s.jsx(st,{variant:ne.status==="failed"?"destructive":ne.status==="completed"?"outline":ne.status==="active"?"secondary":"outline",className:ne.status==="completed"?"border-emerald-300 bg-emerald-50 text-emerald-700":void 0,children:ne.status})]}),ne.outcomeSummary&&s.jsx("p",{className:"mt-2 text-xs text-muted-foreground break-all whitespace-pre-line",children:ne.outcomeSummary}),ne.id===tbe&&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 ",we.resourceMetadata?.url??"not captured"]}),s.jsx("pre",{className:"max-h-56 overflow-x-auto rounded-md bg-muted p-2 text-xs",children:hS(we.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"," ",we.authorizationServerMetadata?.url??"not captured"]}),s.jsx("pre",{className:"max-h-56 overflow-x-auto rounded-md bg-muted p-2 text-xs",children:hS(we.authorizationServerMetadata?.bodyText)})]})]})]}),en&&ht&&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(ht.requests.length,ht.responses.length)}).map((_t,Kt)=>{const Hn=ht.requests[Kt],_n=ht.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)})]},`${ne.id}-exchange-${Kt}`)})})]})]},ne.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(kr,{children:"Live events and network requests/responses for the OAuth flow."})]}),s.jsxs(ee,{type:"button",size:"sm",variant:"outline",onClick:()=>{ve("raw")},disabled:!Q||!ge,children:[s.jsx(Mr,{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:ne=>nn(ne),className:"min-w-0",children:[s.jsxs(up,{className:"grid grid-cols-2",children:[s.jsx(Fa,{value:"inspector",children:"Network Inspector"}),s.jsx(Fa,{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:[Fe.length===0?s.jsx("p",{className:"text-muted-foreground",children:"No events yet."}):Fe.map((ne,Le)=>s.jsxs("div",{className:"break-all",children:[s.jsx("span",{className:"mr-2 font-mono text-muted-foreground",children:new Date(ne.ts).toLocaleTimeString()}),s.jsx(st,{variant:"outline",className:"mr-2 text-[10px]",children:ne.type}),typeof ne.payload.message=="string"?ne.payload.message:JSON.stringify(ne.payload)]},`${ne.ts}-${Le}`)),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:tt,onValueChange:ct,children:[s.jsx(Tn,{className:"h-8",children:s.jsx($n,{})}),s.jsxs(Rn,{children:[s.jsx(mt,{value:"all",children:"All steps"}),(ge?.stepStates??[]).map(ne=>s.jsxs(mt,{value:ne.id,children:[se.get(ne.id),". ",ne.title]},ne.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(mt,{value:"all",children:"All"}),s.jsx(mt,{value:"ok",children:"Successful responses"}),s.jsx(mt,{value:"error",children:"Error responses"})]})]})]})]}),s.jsx("div",{className:"max-h-[34rem] min-w-0 space-y-2 overflow-auto",children:de.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No network exchanges captured yet."}):de.map(ne=>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:se.get(ne.stepId)}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium",children:ne.label}),s.jsxs("div",{className:"text-xs text-muted-foreground break-all",children:[ne.method?`${ne.method} `:"",ne.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 ne.response?.status=="number"&&s.jsx(st,{variant:ne.response.status>=400?"destructive":"secondary",children:ne.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(ne.request?.headers??{},null,2)})]}),ne.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:ne.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(ne.response?.headers??{},null,2)})]}),ne.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:ne.response.bodyText})]}),s.jsx("div",{className:"flex gap-2",children:s.jsxs(ee,{type:"button",size:"sm",variant:"outline",onClick:()=>{X$(JSON.stringify(ne,null,2))},children:[s.jsx(ss,{className:"mr-2 h-4 w-4"}),"Copy JSON"]})})]})]},ne.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(ee,{type:"button",size:"sm",variant:"outline",onClick:()=>i("configure"),children:"Back to Configure"}),s.jsxs(ee,{type:"button",size:"sm",variant:"outline",onClick:()=>{ve("json")},children:[s.jsx(Mr,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(ee,{type:"button",size:"sm",variant:"outline",onClick:()=>{ve("markdown")},children:[s.jsx(Mr,{className:"mr-2 h-4 w-4"}),"Export Markdown"]}),s.jsxs(ee,{type:"button",size:"sm",variant:"outline",onClick:()=>{ve("raw")},children:[s.jsx(Mr,{className:"mr-2 h-4 w-4"}),"Copy/Export Raw Trace"]})]})]}),s.jsxs(fl,{children:[s.jsx(Oy,{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(ee,{type:"button",size:"sm",variant:"outline",className:"shrink-0 h-7 px-2 text-xs",onClick:()=>{X$(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((ne,Le)=>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:Le+1}),s.jsx("span",{className:"font-bold",children:ne.title})]}),s.jsx(st,{variant:Je(ne.severity),children:ne.severity})]}),s.jsxs("p",{className:"text-sm",children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",ne.detail]}),ne.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:ne.recommendation})]}),s.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Step: ",ne.stepId,ne.specReference&&s.jsxs(s.Fragment,{children:[" · ",s.jsx("a",{href:ne.specReference,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"Spec reference"})]})]})]},ne.id))})]})]})]})}var Kv="Switch",[ibe]=jr(Kv),[obe,lbe]=ibe(Kv),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:Kv});return s.jsxs(obe,{scope:n,checked:S,disabled:c,children:[s.jsx(ut.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=Kv;var Sq="SwitchThumb",Nq=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,a=lbe(Sq,n);return s.jsx(ut.span,{"data-state":_q(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});Nq.displayName=Sq;var cbe="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=cbe;function _q(e){return e?"checked":"unchecked"}var Aq=jq,ube=Nq;const hg=m.forwardRef(({className:e,...t},n)=>s.jsx(Aq,{className:Te("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(ube,{className:Te("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 dbe(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 fbe(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 pbe(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 hbe(e){return e.configName?.trim()||e.name}function mbe(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 gbe=()=>{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,Z]=m.useState([]),[q,z]=m.useState([]),[K,J]=m.useState(!1),[re,he]=m.useState(null),oe=m.useRef(null),me=m.useRef(null),ie=m.useRef(!1),{configs:ge,reload:Re}=Yf(),{source:Q}=On(),{agents:Ne,scenarios:Fe,servers:pt,reload:ot}=Na(),bt=b.trim(),wt=bt?`/results/${encodeURIComponent(bt)}${t?`?configId=${encodeURIComponent(t)}`:""}`:"/results",et=ge.find(se=>se.id===t),_e=m.useMemo(()=>dbe(ge),[ge]),Ee=m.useMemo(()=>fbe(ge),[ge]),tt=m.useMemo(()=>pbe(ge,Fe),[ge,Fe]),ct=O[0]??null,Pt=e.get("configId"),Xt=m.useMemo(()=>{if(!et)return[];const se=new Map,we=et.agentEntries&&et.agentEntries.length>0?et.agentEntries:et.agents.map(Ue=>({kind:"inline",agent:Ue}));for(const Ue of we){if(Ue.kind==="inline"){const le=Ue.agent.id;se.has(le)||se.set(le,Ue.agent);continue}const B=Ne.find(le=>le.id===Ue.ref);B&&!se.has(B.id)&&se.set(B.id,B)}for(const Ue of Ne)se.has(Ue.id)||se.set(Ue.id,Ue);return Array.from(se.values())},[et,Ne]),kt=m.useMemo(()=>{if(!et)return[];const se=new Map,we=et.scenarioEntries&&et.scenarioEntries.length>0?et.scenarioEntries:et.scenarios.map(Ue=>({kind:"inline",scenario:Ue}));for(const Ue of we){if(Ue.kind==="inline"){se.has(Ue.scenario.id)||se.set(Ue.scenario.id,Ue.scenario);continue}const B=Fe.find(le=>le.id===Ue.ref);B&&!se.has(B.id)&&se.set(B.id,B)}return Array.from(se.values())},[et,Fe]),nn=m.useMemo(()=>{const se=new Map;for(const we of pt)se.has(we.id)||se.set(we.id,{id:we.id,name:we.name});for(const we of et?.servers??[])se.set(we.id,{id:we.id,name:we.name});return Array.from(se.values()).sort((we,Ue)=>we.id.localeCompare(Ue.id))},[et?.servers,pt]);m.useEffect(()=>{Pt&&ge.some(se=>se.id===Pt)&&n(Pt)},[Pt,ge]);const Jt=m.useRef("");m.useEffect(()=>{const se=et?`${et.id}::${et.sourcePath??""}`:"";if(se===Jt.current)return;if(Jt.current=se,!et){A([]),E([]),R(!1),D([]),F({}),H({});return}const we=bN(et);A(we.length>0?we:Xt.map(Ue=>Ue.id)),E(kt.map(Ue=>Ue.id)),R(!1),D([]),F({}),H({})},[et?.id,et?.sourcePath,Xt,kt]);const zt=async()=>{if(!et?.sourcePath){h(Oe=>[...Oe,`[${Wn()}] Missing source path for selected config.`]);return}const se=Xt.filter(Oe=>_.includes(Oe.id));if(se.length===0){h(Oe=>[...Oe,`[${Wn()}] Select at least one agent.`]);return}const we=kt.filter(Oe=>k.includes(Oe.id)),Ue=new Set(we.map(Oe=>Oe.id)),B=P||Object.values(U).some(Boolean),le=Object.fromEntries(Object.entries(G).filter(([Oe])=>Ue.has(Oe)&&U[Oe])),fe=we.map(Oe=>{const V=le[Oe.id]??(P?M:Oe.serverIds||[]);return`${Oe.id}=[${V.join(", ")}]`}).join("; ");if(we.length===0){h(Oe=>[...Oe,`[${Wn()}] Select at least one test.`]);return}if(P&&M.length===0){h(Oe=>[...Oe,`[${Wn()}] Select at least one server for "Override MCP Servers for Selected Tests", or turn that override off.`]);return}const De=Object.entries(le).filter(([,Oe])=>!Array.isArray(Oe)||Oe.length===0).map(([Oe])=>Oe);if(De.length>0){h(Oe=>[...Oe,`[${Wn()}] Select at least one server for per-scenario overrides on: ${De.join(", ")}, or turn those overrides off.`]);return}const Me=Array.from(new Set(we.flatMap(Oe=>B?le[Oe.id]?le[Oe.id]??[]:P?M:Oe.serverIds||[]:Oe.serverIds||[]).filter(Oe=>{const V=(et.servers??[]).find(Ae=>Ae.id===Oe),ve=pt.find(Ae=>Ae.id===Oe);return(V||ve)?.authType==="oauth2"})));try{Me.length>0&&(J(!0),await vi({serverNames:Me,source:Q,onServerAuthStart:Oe=>{h(V=>[...V,`[${Wn()}] OAuth login required for '${Oe}'. Complete the browser sign-in flow...`])}}),h(Oe=>[...Oe,`[${Wn()}] OAuth login completed for required server(s): ${Me.join(", ")}.`]))}catch(Oe){const V=Oe instanceof Error?Oe.message:String(Oe);h(ve=>[...ve,`[${Wn()}] OAuth error: ${V}`]),J(!1);return}finally{J(!1)}o(!0),v(!1),j(!1),y("");const Ge=(et.serverEntries??[]).some(Oe=>Oe.kind==="referenced")||(et.agentEntries??[]).some(Oe=>Oe.kind==="referenced")||(et.scenarioEntries??[]).some(Oe=>Oe.kind==="referenced")?"refs-composed":"single-file/inline";h([`[${Wn()}] Starting evaluation run...`,`[${Wn()}] Config=${et.name} mode=${Ge} agents=${se.map(Oe=>Oe.name||Oe.id).join(", ")} tests=${we.map(Oe=>Oe.id).join(", ")} runs=${Number(r)}${L.trim()?` note=${L.trim()}`:""}`,`[${Wn()}] Effective MCP servers per selected test: ${fe||"(none)"}`]),d(10);try{const{jobId:Oe}=await Q.startRun({configPath:et.sourcePath,runsPerScenario:Number(r),agents:se.map(V=>V.id),scenarioIds:we.map(V=>V.id),...B&&P?{serverOverrideAll:M}:{},...B&&Object.keys(le).length>0?{scenarioServerOverrides:le}:{},runNote:L.trim()?L.trim():void 0});N(Oe),At(Oe),$e(Oe),Bt()}catch(Oe){const V=Oe instanceof Error?Oe.message:String(Oe),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(Ae=>[...Ae,`[${Wn()}] Error: ${V}${ve}`]),o(!1),d(0),N(null),J(!1)}},Se=()=>{zt()},Xe=()=>{S&&Q.stopRun(S),me.current?.(),me.current=null,Qe(),N(null),o(!1),v(!1),j(!0),h(se=>[...se,`[${Wn()}] Run aborted by user.`]),Bt()};m.useEffect(()=>{oe.current&&(oe.current.scrollTop=oe.current.scrollHeight)},[f]),m.useEffect(()=>()=>{me.current?.()},[]),m.useEffect(()=>{if(S||p)return;let se="";try{se=sessionStorage.getItem(vS)??""}catch{se=""}if(se)return N(se),o(!0),v(!1),j(!1),h(we=>we.length>0?we:[`[${Wn()}] Reattached to in-progress evaluation run...`]),$e(se),()=>{}},[S,p]);const Qe=()=>{try{sessionStorage.removeItem(vS)}catch{}},At=se=>{try{sessionStorage.setItem(vS,se)}catch{}},Bt=async()=>{try{const se=await Q.getRunQueue();W(se.queued),Z(se.active_jobs??(se.active?[se.active]:[])),z(se.admitting_jobs??[]);const we=S==null?void 0:se.queued.find(Ue=>Ue.jobId===S&&Ue.status==="blocked_auth"&&Ue.blockedReason==="oauth_required");we&&(we.requiredServers??[]).length>0?he(Ue=>Ue?.jobId===we.jobId?Ue:{jobId:we.jobId,servers:we.requiredServers}):(re?.jobId&&re.jobId!==S||S!=null&&!se.queued.some(Ue=>Ue.jobId===S&&Ue.status==="blocked_auth"&&Ue.blockedReason==="oauth_required"))&&he(null)}catch{}},de=()=>{Re(),ot()};m.useEffect(()=>{de(),Bt();const se=()=>{de(),Bt()};return window.addEventListener("focus",se),()=>{window.removeEventListener("focus",se)}},[Re,ot]);const Ke=async se=>{try{await Q.removeQueuedRun(se),W(we=>we.filter(Ue=>Ue.jobId!==se))}catch(we){const Ue=we instanceof Error?we.message:String(we);if(Ue.includes("Use the /stop endpoint"))try{await Q.stopRun(se)}catch{}else Ie({title:"Could not remove queued run",description:Ue,variant:"destructive"})}Bt()},$e=se=>{S===se&&me.current||(me.current?.(),me.current=Q.subscribeRunJob(se,we=>{const Ue=new Date(we.ts).toLocaleTimeString();if(we.type==="queued"){h(B=>{const le=we.payload.position?` (position ${we.payload.position})`:"",fe=`[${Ue}] Run queued${le}. Waiting for active run to finish...`;return B.includes(fe)?B:[...B,fe]}),d(5);return}if(we.type==="oauth_required"){const B=Array.isArray(we.payload.servers)?we.payload.servers:[],le=String(we.payload.jobId??"");he({jobId:le,servers:B}),h(fe=>{const De=`[${Ue}] OAuth required for server(s): ${B.join(", ")}. Click "Connect & Resume" to authenticate.`;return fe.includes(De)?fe:[...fe,De]});return}if(we.type==="started"&&(he(null),ie.current=!1,o(!0),v(!1),j(!1),h(B=>{const le=`[${Ue}] Run started.`;return B.includes(le)?B:[...B,le]}),d(B=>Math.max(B,30)),Bt()),we.type==="log"){const B=String(we.payload.message??"").trim();B&&(h(le=>{const fe=`[${Ue}] ${B}`;return le.includes(fe)?le:[...le,fe]}),d(le=>{const fe=B.toLowerCase();if(fe.startsWith("loading mcp evaluation config"))return Math.max(le,15);if(fe.startsWith("loaded config"))return Math.max(le,20);if(fe.startsWith("selected "))return Math.max(le,30);if(fe.startsWith("using requested agents")||fe.startsWith("using run default agents")||fe.startsWith("using config-declared agents"))return Math.max(le,35);if(fe.startsWith("expanded to "))return Math.max(le,45);if(fe.startsWith("running evaluation"))return Math.max(le,50);const De=fe.match(/^scenario (\d+)\/(\d+) finished:/);if(De){const Me=Number(De[1]),Ge=Number(De[2]);return Math.max(le,50+Math.round(Me/Ge*25))}return fe.startsWith("evaluation execution finished")?Math.max(le,78):fe.startsWith("writing results to ")?Math.max(le,94):fe.startsWith("run finished:")?Math.max(le,98):le}))}if(we.type==="completed"){const B=String(we.payload.runId??"").trim();he(null),ie.current=!1,h(le=>{const fe=`[${Ue}] Run completed.`;return le.includes(fe)?le:[...le,fe]}),d(100),o(!1),v(!0),j(!1),y(B),Qe(),N(null),me.current?.(),me.current=null,Bt()}if(we.type==="error"){const B=String(we.payload.message??"Unknown error"),le=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),ie.current=!1,h(fe=>[...fe,`[${Ue}] Error: ${B}${le}`]),o(!1),v(!1),j(!1),d(0),Qe(),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(ga,{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(se=>{const we=mbe(se);return s.jsxs(mt,{value:se.id,children:[s.jsx("span",{children:hbe(se)}),we&&s.jsxs("span",{className:"ml-2 text-muted-foreground",children:["(",we,")"]})]},se.id)})})]}),s.jsx(ee,{type:"button",variant:"outline",size:"icon",className:"h-10 w-10 shrink-0",onClick:de,"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:se=>a(se.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(ba,{id:"run-note",value:L,onChange:se=>I(se.target.value.slice(0,500)),placeholder:"Optional context for this run (for example: mcp-server v1.8.2 #staging)",rows:2})]}),et&&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(se=>se.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(se=>{const we=_.includes(se.id);return s.jsxs("label",{className:"flex items-center gap-2 text-sm rounded-md border p-2",children:[s.jsx(Lr,{checked:we,onCheckedChange:Ue=>{const B=Ue===!0;A(le=>B?[...le,se.id]:le.filter(fe=>fe!==se.id))}}),s.jsx("span",{children:se.name||se.id})]},se.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."})]}),et&&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(se=>se.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(se=>{const we=k.includes(se.id),Ue=G[se.id],B=!!U[se.id],le=B&&Array.isArray(Ue),fe=new Set(se.serverIds||[]);return s.jsxs("div",{className:"flex flex-col gap-2 text-sm rounded-md border p-2 cursor-pointer",onClick:De=>{const Me=De.target;Me&&(Me.closest("button, a, input, select, textarea, [role='button']")||E(Ge=>we?Ge.filter(Oe=>Oe!==se.id):[...Ge,se.id]))},children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(Lr,{checked:we,onCheckedChange:De=>{const Me=De===!0;E(Ge=>Me?[...Ge,se.id]:Ge.filter(Oe=>Oe!==se.id))}}),s.jsxs("span",{className:"min-w-0",children:[s.jsxs("span",{className:"block font-medium",children:[se.name||se.id," ",le&&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:se.id})]})]}),we&&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:De=>{if(F(Me=>({...Me,[se.id]:De})),!De)H(Me=>{const Ge={...Me};return delete Ge[se.id],Ge});else if(!G[se.id]){const Me=P&&M.length>0?[...M]:[...se.serverIds||[]];H(Ge=>({...Ge,[se.id]:Me}))}}})]}),B&&s.jsx("div",{className:"mt-1 flex flex-wrap gap-1.5",children:nn.map(De=>{const Me=De.id,Ge=(Ue??[]).includes(Me),Oe=fe.has(Me);return s.jsx(st,{variant:Ge?"default":"outline",className:`cursor-pointer text-xs ${Ge?"":"opacity-60 hover:opacity-100"}`,style:!Ge&&Oe?{borderColor:"hsl(var(--primary))"}:void 0,onClick:V=>{V.stopPropagation(),H(ve=>{const Ae=ve[se.id]??[],Je=Ae.includes(Me)?Ae.filter(ne=>ne!==Me):[...Ae,Me];return{...ve,[se.id]:Je}})},children:De.name?.trim()?De.name:Me},Me)})})]})]},se.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(se=>{const we=se.id,Ue=M.includes(we);return s.jsx(st,{variant:Ue?"default":"outline",className:`cursor-pointer text-xs ${Ue?"":"opacity-60 hover:opacity-100"}`,onClick:()=>D(B=>B.includes(we)?B.filter(le=>le!==we):[...B,we]),children:se.name?.trim()?se.name:we},we)})})]})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(ee,{onClick:Se,disabled:!t||K||Xt.length>0&&_.length===0||kt.length>0&&k.length===0,children:[s.jsx(ga,{className:"mr-2 h-4 w-4"}),ct?"Queue Run":"Run"]}),i&&s.jsxs(ee,{variant:"destructive",onClick:Xe,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(Vv,{value:c,className:"h-2"}),re&&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:re.servers.join(", ")})]}),s.jsx(ee,{size:"sm",variant:"outline",disabled:K,onClick:()=>{ie.current||(ie.current=!0,J(!0),vi({serverNames:re.servers,source:Q,onServerAuthStart:se=>{h(we=>[...we,`[${Wn()}] OAuth sign-in opened for '${se}'...`])}}).then(()=>Q.resumeQueue()).then(()=>{const se=re?.jobId;h(we=>[...we,`[${Wn()}] OAuth complete. Resuming run...`]),se&&(N(se),At(se),o(!0),v(!1),$e(se))}).catch(se=>{const we=se instanceof Error?se.message:String(se);h(Ue=>[...Ue,`[${Wn()}] OAuth error: ${we}`]),ie.current=!1}).finally(()=>{J(!1)}))},children:K?"Connecting...":"Connect & Resume"})]}),s.jsx("div",{ref:oe,className:"h-64 overflow-auto rounded-md border bg-muted/30 p-3 font-mono text-xs space-y-0.5",children:f.map((se,we)=>s.jsx("div",{className:se.includes("✓")?"text-success":se.includes("aborted")?"text-destructive":"text-foreground",children:se},we))})]})]}),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(va,{className:"h-4 w-4"}),"Run Queue"]}),s.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>{Bt()},children:s.jsx(zs,{className:"h-3 w-3"})})]})}),s.jsx(rt,{children:!ct&&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(se=>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===se.jobId?"ring-2 ring-primary/40":""}`,onClick:()=>{S!==se.jobId&&(N(se.jobId),At(se.jobId),o(!0),v(!1),j(!1),h([`[${Wn()}] Attached to running job ${se.jobId}...`]),d(10),$e(se.jobId))},onKeyDown:we=>{we.key!=="Enter"&&we.key!==" "||S!==se.jobId&&(we.preventDefault(),N(se.jobId),At(se.jobId),o(!0),v(!1),j(!1),h([`[${Wn()}] Attached to running job ${se.jobId}...`]),d(10),$e(se.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:Ee.get(se.runParams.configPath)||gS(se.runParams.scenarioIds,tt,se.runParams.configPath)}),s.jsx("span",{className:"font-mono text-xs",children:mS(se.runParams.configPath,_e)}),se.runParams.agents&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:["agents: ",se.runParams.agents.join(", ")]}),se.runParams.runNote&&s.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["note: ",se.runParams.runNote]})]}),s.jsxs(ee,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-destructive hover:text-destructive hover:bg-destructive/10",onClick:we=>{we.stopPropagation(),Q.stopRun(se.jobId),Bt()},title:"Stop running job",children:[s.jsx(Ld,{className:"mr-1 h-3 w-3"}),"Stop"]})]},se.jobId)),q.map(se=>{const we=mS(se.runParams.configPath,_e),Ue=gS(se.runParams.scenarioIds,tt,se.runParams.configPath),B=Ee.get(se.runParams.configPath)||Ue,le=se.status==="blocked_auth";return s.jsx("div",{className:`flex items-center justify-between rounded-md border p-2 text-sm ${le?"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 ${le?"bg-yellow-500/15 text-yellow-700 dark:text-yellow-400":"bg-primary/10 text-primary"}`,children:le?"Retrying OAuth":"Starting"}),s.jsx("span",{className:"text-xs font-bold",children:B}),s.jsx("span",{className:"font-mono text-xs",children:we}),le&&(se.requiredServers??[]).length>0&&s.jsxs("span",{className:"text-xs text-yellow-700 dark:text-yellow-400",children:["OAuth: ",se.requiredServers.join(", ")]})]})},se.jobId)}),Y.map((se,we)=>{const Ue=mS(se.runParams.configPath,_e),B=gS(se.runParams.scenarioIds,tt,se.runParams.configPath),le=Ee.get(se.runParams.configPath)||B,fe=se.status==="blocked_auth";return s.jsxs("div",{className:`flex items-center justify-between rounded-md border p-2 text-sm ${fe?"border-yellow-500/40 bg-yellow-500/5":""}`,children:[s.jsxs("div",{className:"min-w-0 flex items-center gap-2 flex-wrap",children:[fe?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:["#",we+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:["#",we+1," Queued"]}),s.jsx("span",{className:"text-xs font-bold",children:le}),s.jsx("span",{className:"font-mono text-xs",children:Ue}),fe&&(se.requiredServers??[]).length>0&&s.jsxs("span",{className:"text-xs text-yellow-700 dark:text-yellow-400",children:["OAuth: ",se.requiredServers.join(", ")]}),!fe&&se.runParams.agents&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:["agents: ",se.runParams.agents.join(", ")]}),se.runParams.runNote&&s.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["note: ",se.runParams.runNote]})]}),s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[fe&&s.jsx(ee,{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(ie.current)return;const De=se.requiredServers??[];De.length!==0&&(ie.current=!0,he({jobId:se.jobId,servers:De}),J(!0),vi({serverNames:De,source:Q,onServerAuthStart:Me=>{h(Ge=>[...Ge,`[${Wn()}] OAuth sign-in opened for '${Me}'...`])}}).then(()=>Q.resumeQueue()).then(()=>{h(Me=>[...Me,`[${Wn()}] OAuth complete. Resuming run...`]),N(se.jobId),At(se.jobId),o(!0),v(!1),$e(se.jobId)}).catch(Me=>{const Ge=Me instanceof Error?Me.message:String(Me);h(Oe=>[...Oe,`[${Wn()}] OAuth error: ${Ge}`]),ie.current=!1}).finally(()=>{J(!1)}))},children:K&&re?.jobId===se.jobId?"Connecting...":"Connect & Resume"}),s.jsx(ee,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:()=>{Ke(se.jobId)},title:"Remove from queue",children:s.jsx(ns,{className:"h-4 w-4"})})]})]},se.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(ee,{type:"button",variant:"outline",onClick:()=>{h([]),d(0),j(!1)},children:"Clear Progress"}),s.jsxs(ee,{type:"button",onClick:Se,disabled:!t,children:[s.jsx(ga,{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(fi,{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(ee,{asChild:!0,className:"ml-auto",children:s.jsx(Tt,{to:wt,children:bt?"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(ee,{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(ee,{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(F6,{message:R},R.id??`${R.role}-${M}`)}),k,c&&s.jsx(z6,{}),s.jsx("div",{ref:N})]})}),s.jsx("div",{className:"border-t bg-background px-4 py-3",children:s.jsx(B6,{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,Z)=>{c(Z??O.id),f(q=>q.length>O.messages.length?q:O.messages),p(O.pendingToolCalls),E.current?.(O)},[]),U=m.useCallback(async(O,Z)=>{const q=Z.session.id||O;D(Z.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 Z=++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:Z,controller:q,prompt:O},S(!0),x(""),f(J=>[...J,K]),b(!0);try{let J=o;if(!J){const re=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!==Z)return;J=re.sessionId||re.session.id,D(re.session,J),f(he=>he.some(me=>me.id===z)?[...re.session.messages,K]:re.session.messages)}try{const re=await t.sendResultAssistantMessage(J,O,q.signal);if(q.signal.aborted||_.current?.id!==Z)return;await U(J,re)}catch(re){if(jN(re)||q.signal.aborted||_.current?.id!==Z)return;if(!Pd(re))throw re;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!==Z)return;const oe=he.sessionId||he.session.id;if(D(he.session,oe),f(ie=>ie.some(Re=>Re.id===z)?[...he.session.messages,K]:he.session.messages),q.signal.aborted||_.current?.id!==Z)return;const me=await t.sendResultAssistantMessage(oe,O,q.signal);if(q.signal.aborted||_.current?.id!==Z)return;await U(oe,me)}}catch(J){if(jN(J)||q.signal.aborted||_.current?.id!==Z)return;f(re=>re.filter(he=>he.id!==z)),Ie({title:"MCP Lab Assistant error",description:J instanceof Error?J.message:String(J),variant:"destructive"})}finally{_.current?.id===Z&&(_.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 Z=await t.approveResultAssistantToolCall(o,O);await U(o,Z)}catch(Z){Pd(Z)&&(c(null),p([])),Ie({title:"Could not approve assistant action",description:Pd(Z)?"Assistant session expired. Ask a new question to start a fresh session.":Z instanceof Error?Z.message:String(Z),variant:"destructive"})}finally{b(!1)}}},[o,t,U]),L=m.useCallback(async O=>{if(o){S(!1),b(!0);try{const Z=await t.denyResultAssistantToolCall(o,O);await U(o,Z)}catch(Z){Pd(Z)&&(c(null),p([])),Ie({title:"Could not deny assistant action",description:Pd(Z)?"Assistant session expired. Ask a new question to start a fresh session.":Z instanceof Error?Z.message:String(Z),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(Z=>Z.length>0?Z:[{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 Z=Math.min(O.scrollHeight,160);O.style.height=`${Math.max(40,Z)}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 Q$=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 vbe(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 xbe(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 Z$(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 ybe(e){return e.has("time_filter")||e.has("time_preset")||e.has("time_start")||e.has("time_end")}function bbe(){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 wbe=[{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,jbe=()=>{const[e,t]=Pi(),{source:n}=On(),[r]=m.useState(()=>ybe(e)?Z$(e):bbe()??Z$(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=Hv(Td),{offset:O,totalCount:Z,hasMore:q}=W,[z,K]=m.useState(null),J=y==="all"?void 0:y,re=m.useMemo(()=>{if(A==="all")return{};if(A==="last"){const $e=bc.find(Ue=>Ue.value===E)??bc[0],se=new Date;return{since:new Date(se.getTime()-$e.durationMs).toISOString(),until:se.toISOString()}}const de=ol(R),Ke=ol(D);return de&&Ke?de.getTime()<=Ke.getTime()?{since:de.toISOString(),until:Ke.toISOString()}:{since:Ke.toISOString(),until:de.toISOString()}:de?{since:de.toISOString()}:Ke?{until:Ke.toISOString()}:{}},[D,A,E,R]),he=de=>{if(v===de){b(Ke=>Ke==="asc"?"desc":"asc");return}x(de),b(de==="timestamp"?"desc":"asc")},oe=async()=>{c(!0);try{if(n.listRunSummariesPage){const de=await n.listRunSummariesPage({...re,scenario:J,limit:Td,offset:O});W.updateMeta(de),i(de.data.map(il))}else if(n.listRunSummaries){const de=await n.listRunSummaries({...re,scenario:J,limit:Td,offset:O});W.setTotalCount(de.length),W.setHasMore(!1),i(de.map(il))}else W.setTotalCount(0),W.setHasMore(!1),i(await n.listResults())}catch(de){Ie({title:"Could not load results",description:de instanceof Error?de.message:String(de),variant:"destructive"})}finally{c(!1)}};m.useEffect(()=>{let de=!0;return c(!0),(n.listRunSummariesPage?n.listRunSummariesPage({...re,scenario:J,limit:Td,offset:O}).then($e=>(de&&W.updateMeta($e),$e.data.map(il))):n.listRunSummaries?n.listRunSummaries({...re,scenario:J,limit:Td,offset:O}).then($e=>(de&&(W.setTotalCount($e.length),W.setHasMore(!1)),$e.map(il))):n.listResults()).then($e=>{de&&i($e)}).catch($e=>{de&&Ie({title:"Could not load results",description:$e instanceof Error?$e.message:String($e),variant:"destructive"})}).finally(()=>{de&&c(!1)}),()=>{de=!1}},[J,re,O,n]);const{assistantMessages:me,assistantPendingToolCalls:ie,assistantInput:ge,assistantLoading:Re,assistantTurnCancelable:Q,cancelAssistantTurn:Ne,assistantChatEndRef:Fe,assistantInputRef:pt,setAssistantInput:ot,askAssistant:bt,approveResultAssistantToolCall:wt,denyResultAssistantToolCall:et,applyResultAssistantSnippet:_e,ensureIntroMessage:Ee}=Eq({source:n,open:H,scope:"all_runs"}),tt=m.useMemo(()=>{const de=new Map;return a.forEach(Ke=>{Ke.scenarios.forEach($e=>{const se=String($e.scenarioName??"").trim(),we=String($e.scenarioId??"").trim();if(we){de.set(we,se||we);return}se&&de.set(se,se)})}),Array.from(de.entries()).map(([Ke,$e])=>({value:Ke,label:$e})).sort((Ke,$e)=>Ke.label.localeCompare($e.label))},[a]);m.useEffect(()=>{const de=(e.get("scenario")??"").trim();if(de){if(tt.some(Ke=>Ke.value===de||Ke.label===de)){S(de);return}a.length>0&&S("all")}},[e,tt,a.length]),m.useEffect(()=>{const de=new URLSearchParams(e);A==="all"?(de.delete("time_filter"),de.delete("time_preset"),de.delete("time_start"),de.delete("time_end")):A==="last"?(de.set("time_filter","last"),de.set("time_preset",E),de.delete("time_start"),de.delete("time_end")):(de.set("time_filter","custom"),de.delete("time_preset"),R.trim()?de.set("time_start",R.trim()):de.delete("time_start"),D.trim()?de.set("time_end",D.trim()):de.delete("time_end")),de.toString()!==e.toString()&&t(de,{replace:!0})},[e,t,D,A,E,R]),m.useEffect(()=>{try{if(A==="all"){localStorage.removeItem(ON);return}const de={mode:A,preset:E,start:R,end:D};localStorage.setItem(ON,JSON.stringify(de))}catch{}},[D,A,E,R]);const ct=m.useMemo(()=>{if(n.listRunSummariesPage)return a;const de=y==="all"?a:a.filter(B=>B.scenarios.some(le=>{const fe=String(le.scenarioName??"").trim(),De=String(le.scenarioId??"").trim();return fe===y||De===y}));if(A==="all")return de;const Ke=Date.now();if(A==="last"){const B=bc.find(fe=>fe.value===E)??bc[0],le=Ke-B.durationMs;return de.filter(fe=>{const De=new Date(fe.timestamp).getTime();return De>=le&&De<=Ke})}const $e=ol(R)?.getTime()??null,se=ol(D)?.getTime()??null,we=$e!==null&&se!==null?Math.min($e,se):$e??null,Ue=$e!==null&&se!==null?Math.max($e,se):se??null;return de.filter(B=>{const le=new Date(B.timestamp).getTime();return!(Number.isNaN(le)||we!==null&&le<we||Ue!==null&&le>Ue)})},[a,y,n.listRunSummariesPage,D,A,E,R]);m.useEffect(()=>{W.reset()},[J,re,W.reset]);const Pt=m.useMemo(()=>y==="all"?"All scenarios":tt.find(Ke=>Ke.value===y||Ke.label===y)?.label??y,[y,tt]),Xt=m.useMemo(()=>{if(A==="all")return"All time";if(A==="last")return bc.find($e=>$e.value===E)?.label??"Last range";const de=!!R.trim(),Ke=!!D.trim();return!de&&!Ke?"Custom range":de&&Ke?`${Fh(R)} - ${Fh(D)}`:de?`From ${Fh(R)}`:`Until ${Fh(D)}`},[D,A,E,R]),kt=m.useMemo(()=>{const de=($e,se)=>$e===null&&se===null?0:$e===null?1:se===null?-1:j==="asc"?$e-se:se-$e;return[...ct].sort(($e,se)=>{if(v==="toolTokens")return de($e.toolTokenUsage?.totalTokens??null,se.toolTokenUsage?.totalTokens??null);let we=0;return v==="id"&&(we=$e.id.localeCompare(se.id)),v==="timestamp"&&(we=new Date($e.timestamp).getTime()-new Date(se.timestamp).getTime()),v==="passRate"&&(we=$e.overallPassRate-se.overallPassRate),v==="scenarios"&&(we=$e.totalScenarios-se.totalScenarios),v==="avgToolCalls"&&(we=$e.avgToolCalls-se.avgToolCalls),j==="asc"?we:-we})},[ct,v,j]),nn=m.useMemo(()=>{const de=[];let Ke=null;for(const $e of kt){const se=vbe($e.timestamp);se!==Ke&&(de.push({type:"day-separator",dayKey:se,dayLabel:xbe($e.timestamp)}),Ke=se),de.push({type:"run",run:$e})}return de},[kt]),Jt=de=>v!==de?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=de=>{const Ke=de.toolTokenUsage?.totalTokens;return typeof Ke=="number"?Ke.toLocaleString():"n/a"},Se=()=>{k("all"),P("15min"),M(""),U("")},Xe=m.useMemo(()=>{const de=new Map;for(const Ke of kt){if(Ke.scenarios.length>0){de.set(Ke.id,d_(Ke));continue}const $e=Ke.configName?.trim()||"",se=Ke.configPath?.trim()||"",we=$e&&se?`${$e} · ${se}`:$e||se;de.set(Ke.id,{scenarioCount:Ke.totalScenarios,agentCount:0,scopePreview:we||"n/a",modelSummary:""})}return de},[kt]),Qe=()=>{L(!0),Ee("Ask me to compare runs, explain regressions over time, or summarize historical drift patterns.")},At=async de=>{p(!0);try{await n.deleteResult(de),i(Ke=>Ke.filter($e=>$e.id!==de)),Ie({title:"Run deleted",description:de}),f(null)}catch(Ke){Ie({title:"Could not delete run",description:Ke instanceof Error?Ke.message:String(Ke),variant:"destructive"})}finally{p(!1)}},Bt=async de=>{if(!de.configPath?.trim()){Ie({title:"Cannot rerun",description:"This run has no config path in metadata.",variant:"destructive"});return}K(de.id);try{await Pq(n,de),Ie({title:"Rerun queued",description:`${de.id} queued with previous run settings.`})}catch($e){Ie({title:"Could not rerun",description:$e instanceof Error?$e.message:String($e),variant:"destructive"})}finally{K($e=>$e===de.id?null:$e)}};return s.jsxs("div",{className:"space-y-6",children:[s.jsx(wa,{open:d!==null,onOpenChange:de=>{!de&&!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:de=>{de.preventDefault(),d&&At(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(ee,{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"}),tt.map(de=>s.jsx(xs,{value:`${de.label} ${de.value}`,onSelect:()=>{S(de.value),_(!1)},children:de.label},de.value))]})]})]})})]}),s.jsxs(ho,{open:F,onOpenChange:G,children:[s.jsx(mo,{asChild:!0,children:s.jsxs(ee,{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(DD,{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(ee,{type:"button",variant:A==="all"?"secondary":"ghost",className:"justify-start",onClick:()=>{Se(),G(!1)},children:"All time"}),bc.map(de=>s.jsx(ee,{type:"button",variant:A==="last"&&E===de.value?"secondary":"ghost",className:"justify-start",onClick:()=>{k("last"),P(de.value),G(!1)},children:de.label},de.value)),s.jsx(ee,{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:de=>M(de.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:de=>U(de.target.value)})]}),s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs(ee,{type:"button",variant:"ghost",size:"sm",className:"px-2",onClick:Se,children:[s.jsx(ns,{className:"mr-1.5 h-3.5 w-3.5"}),"Clear"]}),s.jsx(ee,{type:"button",size:"sm",onClick:()=>G(!1),children:"Done"})]})]})]})]}),s.jsx(ee,{variant:"outline",onClick:()=>{oe()},disabled:o,children:o?"Refreshing...":"Refresh"}),s.jsx(ee,{variant:"outline",onClick:W.prev,disabled:o||O===0,children:"Prev"}),s.jsx(ee,{variant:"outline",onClick:W.next,disabled:o||!q,children:"Next"}),s.jsxs(ee,{type:"button",variant:"outline",className:"gap-1.5",onClick:Qe,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(ft,{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(ft,{children:"Evaluated"}),s.jsx(ft,{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(ft,{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(ft,{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(ft,{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(ft,{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(ft,{className:"w-10"})]})}),s.jsx(ts,{children:nn.length===0?s.jsx(Gt,{children:s.jsx(He,{colSpan:Q$,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((de,Ke)=>de.type==="day-separator"?s.jsx(Gt,{className:"bg-muted/30 hover:bg-muted/30",children:s.jsx(He,{colSpan:Q$,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:de.dayLabel}),s.jsx("div",{className:"h-px flex-1 bg-border/70"})]})})},`day-${de.dayKey}-${Ke}`):s.jsxs(Gt,{children:[s.jsx(He,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(Tt,{to:`/results/${de.run.id}`,className:"font-mono text-xs text-primary hover:underline",children:de.run.id}),de.run.runNote?s.jsxs("div",{className:"text-[11px] text-muted-foreground break-words",children:["Note: ",de.run.runNote]}):null]})}),s.jsx(He,{className:"text-[11px] text-muted-foreground",children:(()=>{const $e=Xe.get(de.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: ",$e.scenarioCount," scenario",$e.scenarioCount===1?"":"s"," · ",$e.agentCount," agent",$e.agentCount===1?"":"s",$e.modelSummary?` · ${$e.modelSummary}`:""]}),s.jsx("div",{className:"font-mono text-xs text-foreground/80",children:$e.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(va,{className:"h-3 w-3"}),new Date(de.run.timestamp).toLocaleString()]}),(()=>{const $e=mg(de.run);return $e===null?null:s.jsxs("div",{className:"font-mono text-[11px] text-muted-foreground/90",children:["Total time: ",Is($e)]})})()]})}),s.jsx(He,{className:"text-right",children:s.jsxs("div",{className:"flex flex-col items-end gap-1",children:[s.jsx(Oa,{rate:de.run.overallPassRate}),s.jsx(iL,{run:de.run})]})}),s.jsx(He,{className:"text-right font-mono text-sm",children:de.run.totalScenarios}),s.jsx(He,{className:"text-right font-mono text-sm",children:de.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(de.run)}),(()=>{const $e=gg(de.run);return $e===null?null:s.jsxs("div",{className:"font-mono text-[11px] text-muted-foreground/90",children:["Tool time: ",Is($e)]})})()]})}),s.jsx(He,{children:s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsxs(ee,{size:"sm",variant:"outline",disabled:z===de.run.id,onClick:()=>{Bt(de.run)},children:[s.jsx(ga,{className:"mr-1.5 h-3.5 w-3.5"}),z===de.run.id?"Queueing...":"Rerun"]}),s.jsxs(lp,{children:[s.jsx(cp,{asChild:!0,children:s.jsx(ee,{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(Or,{asChild:!0,children:s.jsxs(Tt,{to:`/results/${de.run.id}`,children:[s.jsx(_9,{className:"mr-2 h-3.5 w-3.5"}),"View"]})}),s.jsxs(Or,{children:[s.jsx(Mr,{className:"mr-2 h-3.5 w-3.5"}),"Export JSON"]}),s.jsxs(Or,{className:"text-destructive",onSelect:$e=>{$e.preventDefault();const se=document.activeElement;se instanceof HTMLElement&&se.blur(),f(de.run.id)},children:[s.jsx(Bs,{className:"mr-2 h-3.5 w-3.5"}),"Delete"]})]})]})]})})]},de.run.id))})]})})}),H&&s.jsx(kq,{title:"MCP Lab Assistant",description:"Analyze historical differences and trends across all result runs.",expanded:I,onToggleExpanded:()=>Y(de=>!de),onHide:()=>L(!1),messages:me,pendingToolCalls:ie,loading:Re,onCancel:Q?Ne:void 0,input:ge,onInputChange:ot,onSend:()=>{bt()},inputPlaceholder:"Ask about historical run differences...",snippets:wbe,onSnippetSelect:de=>{L(!0),_e(de)},onApproveToolCall:de=>{wt(de)},onDenyToolCall:de=>{et(de)},chatEndRef:Fe,inputRef:pt,className:"min-w-0 overflow-hidden xl:flex xl:h-[calc(100vh-14rem)] xl:min-h-0 xl:flex-col",renderMessage:({message:de,index:Ke,linkedPendingToolCall:$e,isUser:se,isAssistant:we,isSystem:Ue,isTool:B})=>{const le=we&&!!de.pendingToolCallId;if(B&&/^(Approved|Denied) tool call\b/i.test(String(de.text??"").trim()))return null;if(le){const fe=Yh($e?.tool??de.toolRequestName??$e?.publicToolName??de.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:!!$e,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 ${fe}`}),s.jsx("span",{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${$e?"bg-amber-100 text-amber-900":"bg-muted text-muted-foreground"}`,children:$e?"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:de.text,className:"text-sm"})})]})]},`${de.id??`${de.role}-${Ke}`}:tool`)}return s.jsxs("div",{className:`flex items-start gap-2 ${se?"justify-end":"justify-start"}`,children:[!se&&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 ${se?"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:se?s.jsx("p",{className:"whitespace-pre-wrap",children:de.text}):s.jsx(Fs,{text:de.text,className:"text-sm"})}),se&&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"})})]},de.id??`${de.role}-${Ke}`)}})]})]})};function Sbe(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 Nbe="mcplab.resultAssistantScenarioHandoff",Cbe=[{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 J$(e){const t=new Date().toISOString().replace(/[:]/g,"-").replace(/\..+/,"");return`mcplab/reports/result-assistant/${e}-${t}.md`}function eD(e){const t=e.toFixed(1);return t.endsWith(".0")?t.slice(0,-2):t}const _be=()=>{const{id:e}=Ml(),t=Xs(),[n]=Pi(),{source:r}=On(),a=n.get("embed")==="1",{configs:i}=Yf(),{scenarios:o}=Na(),[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,Z]=m.useState(""),[q,z]=m.useState(!1),[K,J]=m.useState(!1),[re,he]=m.useState(!1),[oe,me]=m.useState([]),[ie,ge]=m.useState(!1),[Re,Q]=m.useState(""),[Ne,Fe]=m.useState(null),[pt,ot]=m.useState(!1),[bt,wt]=m.useState(null),[et,_e]=m.useState(!1),[Ee,tt]=m.useState(!1),[ct,Pt]=m.useState(!1),Xt=m.useRef(null),[kt,nn]=m.useState(!1),{assistantMessages:Jt,assistantPendingToolCalls:zt,assistantInput:Se,assistantLoading:Xe,assistantTurnCancelable:Qe,cancelAssistantTurn:At,assistantChatEndRef:Bt,assistantInputRef:de,setAssistantInput:Ke,askAssistant:$e,approveResultAssistantToolCall:se,denyResultAssistantToolCall:we,applyResultAssistantSnippet:Ue,ensureIntroMessage:B,resetAssistantSession:le}=Eq({source:r,open:P,scope:"run",runId:e,onSessionSync:void 0}),fe=m.useCallback(async(ae,ke)=>{ge(!0);try{const Ze=(await r.listMarkdownReports()).filter(sn=>{const on=String(sn.relativePath??""),xn=String(sn.name??"");return on.includes(ae)||xn.includes(ae)});if(me(Ze),ke&&Ze.length>0){const sn=Ze.find(on=>on.relativePath===ke||on.path===ke||on.relativePath.endsWith(ke)||on.path.endsWith(ke));sn&&Q(sn.relativePath)}return Ze}catch{return me([]),[]}finally{ge(!1)}},[r]);m.useEffect(()=>{if(!e)return;let ae=!0;return le(),h(!0),r.getResult(e).then(ke=>{ae&&(d(ke),j(ke?.runNote??""),v(!1),h(!1))}),()=>{ae=!1}},[e,r,le]),m.useEffect(()=>{const ae=Xt.current;if(!ae)return;const ke=()=>{nn(ae.clientWidth<800)};if(ke(),typeof ResizeObserver<"u"){const St=new ResizeObserver(()=>ke());return St.observe(ae),()=>St.disconnect()}return window.addEventListener("resize",ke),()=>window.removeEventListener("resize",ke)},[f]),m.useEffect(()=>{if(!c?.id){me([]);return}let ae=!0;return(async()=>{const ke=await fe(c.id)})(),()=>{ae=!1}},[c?.id,fe]),m.useEffect(()=>{if(oe.length===0){Q(""),Fe(null),wt(null);return}(!Re||!oe.some(ae=>ae.relativePath===Re))&&Q(oe[0].relativePath)},[oe,Re]),m.useEffect(()=>{if(!P||U!=="reports")return;if(!Re){Fe(null),wt(null);return}let ae=!0;return ot(!0),wt(null),r.getMarkdownReport(Re).then(ke=>{ae&&Fe(ke)}).catch(ke=>{ae&&(Fe(null),wt(ke instanceof Error?ke.message:String(ke)))}).finally(()=>{ae&&ot(!1)}),()=>{ae=!1}},[P,U,Re,r]);const De=n.get("configId")??"",Me=(n.get("agent")??"").trim(),Ge=m.useMemo(()=>{const ae=De?i.find(ke=>ke.id===De):void 0;return ae||(c?i.find(ke=>ke.id===c.configId):void 0)},[i,De,c]),Oe=m.useMemo(()=>{const ae=c?.configName?.trim();if(ae)return ae;const ke=c?.configPath?.trim();if(ke)return ke;const St=Ge?.relativePath?.trim()||Ge?.name?.trim();return St||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]),Ae=m.useMemo(()=>{const ae=new Map;if(Ge){for(const ke of Ge.scenarios)ae.set(ke.id,ke),ke.name&&!ae.has(ke.name)&&ae.set(ke.name,ke);for(const ke of Ge.scenarioEntries??[]){if(ke.kind!=="referenced")continue;const St=o.find(Ze=>Ze.id===ke.ref);St&&(ae.set(St.id,St),St.name&&ae.set(St.name,St),ae.has(ke.ref)||ae.set(ke.ref,St))}}for(const ke of o)ae.has(ke.id)||ae.set(ke.id,ke),ke.name&&!ae.has(ke.name)&&ae.set(ke.name,ke);return ae},[Ge,o]),Je=m.useMemo(()=>"",[]);m.useEffect(()=>{if(De&&i.some(ae=>ae.id===De)){E(De);return}Je&&E(ae=>ae||Je)},[De,i,Je]);const{filteredScenarios:ne,filteredTotalRuns:Le,filteredPassCount:ht,displayPassRate:Qt,displayAvgToolCalls:Ce,displayAvgLatency:en,displayDurationMs:_t,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=Me?c.scenarios.filter(xn=>xn.agentId===Me||xn.agentName===Me):c.scenarios,ke=ae.reduce((xn,cr)=>xn+cr.runs.length,0),St=ae.reduce((xn,cr)=>xn+cr.runs.filter(qr=>qr.passed).length,0),Ze=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:ke,filteredPassCount:St,displayPassRate:ke===0?0:St/ke,displayAvgToolCalls:ke===0?0:Ze/ke,displayAvgLatency:ke===0||sn===null?0:Math.round(sn/ke),displayDurationMs:sn,displayToolTimeMs:on,displayToolTokenUsage:xX(ae.map(xn=>xn.toolTokenUsage))}},[c,Me]),_n=m.useMemo(()=>{const ae={};return ne.forEach(ke=>ke.runs.forEach(St=>St.toolCalls.forEach(Ze=>{ae[Ze.name]=(ae[Ze.name]||0)+1}))),Object.entries(ae).map(([ke,St])=>({name:ke,count:St})).sort((ke,St)=>St.count-ke.count)},[ne]);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 Xa=Object.entries(c.mcpServerVersions??{}).map(([ae,ke])=>`${ae}: ${ke??"unknown"}`).join(", "),$i=ht,To=Math.max(0,Le-$i),Di=[{name:"Pass",value:$i,color:"hsl(152, 69%, 40%)"},{name:"Fail",value:To,color:"hsl(0, 72%, 51%)"}],Ul=ae=>{N(ke=>{const St=new Set(ke);return St.has(ae)?St.delete(ae):St.add(ae),St})},qn=(ae,ke,St,Ze)=>`${ae}:${ke}:${St}:${Ze}`,Fu=(ae,ke)=>`${ae}::${ke}`,_a=ae=>{A(ke=>{const St=new Set(ke);return St.has(ae)?St.delete(ae):St.add(ae),St})},ce=ae=>{const ke=!ae.endsWith(":conversation");return _.has(ae)?!ke:ke},it=(ae,ke)=>{F("assistant"),R(!0),H(ke?.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(ke=>ke.pendingToolCallId===ae.id)),Dt=ae=>{F("reports"),R(!0)},qt=()=>{F("note"),R(!0)},dn=ae=>{if(!c)return;if(!G){Ie({title:"No scenario context",description:"Ask about a specific scenario or run first, then send the suggestion.",variant:"destructive"});return}const ke=o.find(Ze=>Ze.id===G)??o.find(Ze=>Ze.name===G);if(!ke){Ie({title:"Scenario not found in library",description:`Could not find library scenario '${G}' to open in Scenario Assistant.`,variant:"destructive"});return}const St=[`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(Nbe,JSON.stringify({type:"result-assistant-handoff-v1",runId:c.id,configId:De||c.configId||"",scenarioId:ke.id,prompt:St,sourceReply:ae})),t(`/libraries/test-cases/${encodeURIComponent(ke.id)}?assistantHandoff=1`)}catch(Ze){Ie({title:"Could not create handoff",description:Ze instanceof Error?Ze.message:String(Ze),variant:"destructive"})}},lr=ae=>{c&&(he(!1),W(ae),Z(J$(c.id)),z(!1),I(!0))},os=()=>{c&&(he(!0),W(""),Z(J$(c.id)),z(!1),I(!0))},gr=async()=>{if(!c)return;if(!Y.trim()){Ie({title:"No markdown to write",description:"The selected assistant response is empty.",variant:"destructive"});return}J(!0);try{const ke=await r.applyResultAssistantReport({runId:c.id,markdown:Y,outputPath:O.trim()||void 0,overwrite:q});Ie({title:"Markdown report written",description:typeof ke.path=="string"&&ke.path?ke.path:ke.outputPath}),await fe(c.id,typeof ke.path=="string"&&ke.path||ke.outputPath||void 0),P&&F("reports"),I(!1)}catch(ke){Ie({title:"Could not write markdown report",description:ke instanceof Error?ke.message:String(ke),variant:"destructive"})}finally{J(!1)}},Ro=async ae=>{try{await navigator.clipboard.writeText(ae),Ie({title:"Copied"})}catch(ke){Ie({title:"Could not copy",description:ke instanceof Error?ke.message:String(ke),variant:"destructive"})}},vr=async()=>{if(c){y(!0);try{const ae=x.trim();await r.updateRunNote(c.id,ae||void 0),d(ke=>ke&&{...ke,runNote:ae||void 0}),j(ae),v(!1),Ie({title:"Run note saved"})}catch(ae){Ie({title:"Could not save run note",description:ae instanceof Error?ae.message:String(ae),variant:"destructive"})}finally{y(!1)}}},Wl=async()=>{if(c?.id){tt(!0);try{await r.deleteResult(c.id),Ie({title:"Run deleted",description:c.id}),t("/results")}catch(ae){Ie({title:"Could not delete run",description:ae instanceof Error?ae.message:String(ae),variant:"destructive"})}finally{tt(!1),_e(!1)}}},pp=async()=>{if(!c?.id)return;if(!ve.trim()){Ie({title:"Cannot rerun",description:"This run has no config path in metadata.",variant:"destructive"});return}Pt(!0);try{await Pq(r,c),Ie({title:"Rerun queued",description:`${c.id} queued with previous run settings.`})}catch(ke){Ie({title:"Could not rerun",description:ke instanceof Error?ke.message:String(ke),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(ee,{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(Oa,{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(CE,{className:"h-3 w-3 shrink-0"}),new Date(c.timestamp).toLocaleString()]}),s.jsx("span",{className:"mx-1",children:"·"}),Me?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"inline-flex items-center align-middle",children:["Agent: ",Me]}),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&&Oe?s.jsxs("span",{className:"inline-flex items-center align-middle",children:["Config: ",s.jsx("span",{className:"ml-1 font-mono",children:Oe})]}):null]})]})]}),s.jsxs("div",{className:"flex w-full min-w-0 items-center justify-between gap-2 sm:ml-auto sm:w-auto",children:[Xa?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:Xa})]}):null,s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center justify-end gap-2",children:[s.jsxs(ee,{variant:"outline",size:"sm",className:`max-w-full gap-1.5 ${a?"px-2":""}`,onClick:()=>{const ae=Sbe(c),ke=new Blob([ae],{type:"text/html"}),St=URL.createObjectURL(ke),Ze=document.createElement("a");Ze.href=St,Ze.download=`mcplab-report-${c.id}.html`,Ze.click(),URL.revokeObjectURL(St)},"aria-label":"Download Report",title:"Download Report",children:[s.jsx(Mr,{className:"h-3.5 w-3.5"}),!a&&"Download Report"]}),s.jsxs(ee,{type:"button",variant:"outline",size:"sm",className:"max-w-full gap-1.5",onClick:()=>Dt(),disabled:ie,children:[s.jsx(Ac,{className:"h-3.5 w-3.5"}),ie?"Reports...":`Reports${oe.length?` (${oe.length})`:""}`]}),s.jsxs(ee,{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(ee,{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(ee,{type:"button",variant:"outline",size:"sm",className:"max-w-full gap-1.5",onClick:()=>{pp()},disabled:ct||!ve.trim(),children:[s.jsx(ga,{className:"h-3.5 w-3.5"}),ct?"Queueing...":"Rerun"]}),s.jsxs(ee,{type:"button",variant:"outline",size:"sm",className:"max-w-full gap-1.5 text-destructive",onClick:()=>_e(!0),disabled:Ee,"aria-label":Ee?"Deleting run":"Delete run",children:[Ee?s.jsx(wr,{className:"h-4 w-4 animate-spin"}):s.jsx(tl,{className:"h-4 w-4"}),kt?null:Ee?"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:ne.length,icon:NS}),s.jsx(Os,{title:"Total Runs",value:Le,icon:ID}),s.jsx(Os,{title:"Pass Rate",value:`${Math.round(Qt*100)}%`,icon:Bc}),s.jsx(Os,{title:"Avg Tool Calls",value:eD(Ce),icon:fi}),s.jsx(Os,{title:"Avg Latency",value:`${en}ms`,icon:VD}),_t!==null?s.jsx(Os,{title:"Total Time",value:Is(_t),icon:va}):null,Kt!==null?s.jsx(Os,{title:"Tool Duration",value:Is(Kt),icon:va}):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,ke)=>s.jsx(nv,{fill:ae.color},ke))}),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(ee,{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(ft,{className:"w-8"}),s.jsx(ft,{children:"Scenario"}),s.jsx(ft,{children:"Agent"}),s.jsx(ft,{children:"Runs"}),s.jsx(ft,{children:"Pass Rate"}),s.jsx(ft,{children:"Total Time"}),s.jsx(ft,{children:"Tool Calls"}),s.jsx(ft,{children:"Tool Tokens"}),s.jsx(ft,{children:"Tool Duration"})]})}),s.jsx(ts,{children:ne.map(ae=>{const ke=Fu(ae.scenarioId,ae.agentName),St=ae.scenarioName||ae.scenarioId;return s.jsx(da,{open:S.has(ke),onOpenChange:()=>Ul(ke),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(ke)?"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(Oa,{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:eD(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:[St," · ",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(ee,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>it(`Explain why scenario '${St}' 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(Ze=>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:Ze.passed?s.jsx(fi,{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=Ae.get(ae.scenarioId),on=sn?Ebe(sn.evalRules,Ze.failureReasons,Ze.error,Ze.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 #",Ze.runIndex+1]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[Ze.duration,"ms"]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[Yr(Ze.toolTokenUsage?.totalTokens)," ","tool tokens"]}),!Ze.passed&&s.jsx(st,{variant:"outline",className:"h-5 border-destructive/30 bg-destructive/10 text-destructive text-[10px]",children:"Failed"})]}),Ze.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:Ze.failureReasons.map((mn,Ss)=>s.jsxs("li",{children:["• ",sD(mn)]},Ss))})]}),on.length>0&&s.jsx(da,{open:ce(qn(ae.scenarioId,ae.agentName,Ze.runIndex,"checks")),onOpenChange:()=>_a(qn(ae.scenarioId,ae.agentName,Ze.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 ${ce(qn(ae.scenarioId,ae.agentName,Ze.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(CE,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):s.jsx(fi,{className:"h-3.5 w-3.5 shrink-0 text-success"}),s.jsx("span",{className:"font-medium",children:O_(mn.rule)})]}),mn.failureReason&&s.jsx("p",{className:"mt-1 pl-5 text-[11px] text-muted-foreground",children:sD(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:ce(qn(ae.scenarioId,ae.agentName,Ze.runIndex,"extracts")),onOpenChange:()=>_a(qn(ae.scenarioId,ae.agentName,Ze.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 ${ce(qn(ae.scenarioId,ae.agentName,Ze.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(Ze.extractedValues??{}).length," ","total"]})]})}),s.jsx(fa,{children:Object.keys(Ze.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(Ze.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:ce(qn(ae.scenarioId,ae.agentName,Ze.runIndex,"tools")),onOpenChange:()=>_a(qn(ae.scenarioId,ae.agentName,Ze.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 ${ce(qn(ae.scenarioId,ae.agentName,Ze.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:[Ze.toolCalls.length," total"]})]})}),s.jsx(fa,{children:Ze.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:Ze.toolCalls.map((sn,on)=>{const xn=Ze.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(Ba,{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(Ze.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(Ze.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:ce(qn(ae.scenarioId,ae.agentName,Ze.runIndex,"final")),onOpenChange:()=>_a(qn(ae.scenarioId,ae.agentName,Ze.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 ${ce(qn(ae.scenarioId,ae.agentName,Ze.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:Ze.finalAnswer||"No final answer captured.",maxLength:1200,className:"text-xs text-foreground"})})]})}),s.jsx(da,{open:ce(qn(ae.scenarioId,ae.agentName,Ze.runIndex,"conversation")),onOpenChange:()=>_a(qn(ae.scenarioId,ae.agentName,Ze.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 ${ce(qn(ae.scenarioId,ae.agentName,Ze.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(ee,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>it(`Explain Run #${Ze.runIndex+1} for scenario '${St}'. It ${Ze.passed?"passed":"failed"} in ${Ze.duration}ms. Focus on the tool sequence and ${Ze.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:Ze.conversation.length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No conversation trace captured."}):Ze.conversation.map(sn=>s.jsx(Abe,{item:sn,fallbackUserPrompt:Ae.get(ae.scenarioId)?.prompt},sn.id))})}),!ce(qn(ae.scenarioId,ae.agentName,Ze.runIndex,"conversation"))&&s.jsx("button",{type:"button",className:"text-xs text-muted-foreground underline decoration-dotted underline-offset-2 hover:text-foreground",onClick:()=>_a(qn(ae.scenarioId,ae.agentName,Ze.runIndex,"conversation")),children:"Expand to inspect user/assistant/tool messages for this run."})]})})]})]},Ze.runIndex))]})})})})]})},ke)})})]})})]})]}),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(Fa,{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(Fa,{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(Fa,{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:Xe,onCancel:Qe?At:void 0,input:Se,onInputChange:Ke,onSend:()=>{$e()},inputPlaceholder:"Ask about this result...",snippets:Cbe,onSnippetSelect:Ue,onApproveToolCall:ae=>{se(ae)},onDenyToolCall:ae=>{we(ae)},chatEndRef:Bt,inputRef:de,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:ke,linkedPendingToolCall:St,isUser:Ze,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=St?.tool??ae.toolRequestName,mn=St?.publicToolName??ae.toolRequestPublicName,Ss=sn&&!cr&&kbe(ae.text,!!G);if(cr){const Oo=St?.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:!!St,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&&St&&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(St.arguments??{},null,2)})}),s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx(ee,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:Xe,onClick:()=>{we(St.id)},children:"Deny"}),s.jsx(ee,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:Xe,onClick:()=>{se(St.id)},children:"Approve"})]})]})]})]})]},`${ae.id??`${ae.role}-${ke}`}:${St?"pending":"completed"}`)}const Gv=Ze||sn&&!xn&&!on;return s.jsxs("div",{className:`flex items-start gap-2 ${Ze?"justify-end":"justify-start"}`,children:[!Ze&&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 ${Ze?"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:[!(Ze||on)&&s.jsx("p",{className:`mb-2 text-[11px] font-semibold text-muted-foreground ${Ze?"text-right":""}`,children:xn?"Tool":"Assistant"}),Ze?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(ee,{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(ee,{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(ee,{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"]})})]}),Gv&&s.jsx(ee,{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"})})]}),Ze&&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}-${ke}`)},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(ee,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:Xe,onClick:()=>{we(ae.id)},children:"Deny"}),s.jsx(ee,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:Xe,onClick:()=>{se(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(ee,{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(ee,{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:[(ie||oe.length===0||oe.length>1)&&s.jsx("div",{className:"border-b px-4 py-3",children:ie?s.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading reference reports..."}):oe.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(ee,{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:oe.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:Re,onValueChange:Q,children:[s.jsx(Tn,{className:"h-8",children:s.jsx($n,{placeholder:"Select a report"})}),s.jsx(Rn,{children:oe.map(ae=>s.jsx(mt,{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:oe.length===0?s.jsx("div",{className:"text-sm text-muted-foreground",children:"No report selected."}):pt?s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(wr,{className:"h-4 w-4 animate-spin"}),"Loading report..."]}):bt?s.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive",children:["Could not load report: ",bt]}):Ne?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:Ne.name}),s.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:Ne.relativePath}),s.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:new Date(Ne.mtime).toLocaleString()})]}),s.jsx("div",{className:"rounded-md border bg-background p-3",children:s.jsx(Fs,{text:Ne.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(ee,{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(ee,{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(ba,{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(ee,{size:"sm",onClick:()=>{vr()},disabled:b,children:b?"Saving...":"Save note"}),s.jsx(ee,{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(ee,{size:"sm",variant:"ghost",className:"ml-auto h-6 px-2 text-xs",onClick:()=>v(!0),children:c.runNote?"Edit":"Add note"})]})})]})]}),s.jsx(wa,{open:L,onOpenChange:ae=>!K&&I(ae),children:s.jsxs(Us,{className:"max-w-2xl",children:[s.jsxs(Ws,{children:[s.jsx(Hs,{children:re?"Create markdown report":"Approve MCP action: write markdown report"}),s.jsx(Ks,{children:re?"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:[!re&&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=>Z(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(Lr,{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:re?"Markdown content":"Markdown preview (to be written)"}),s.jsx(ba,{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...":re?"Save Report":"Approve & Write"})]})]})}),s.jsx(wa,{open:et,onOpenChange:_e,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:Ee,children:"Cancel"}),s.jsx(Gs,{disabled:Ee||!c?.id,onClick:ae=>{ae.preventDefault(),Wl()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ee?"Deleting...":"Delete"})]})]})})]})]})};function Abe({item:e,fallbackUserPrompt:t}){if(e.kind==="tool_call"){const d=tD(e,"input");return s.jsx(rD,{variant:"call",title:`Tool call · ${e.toolName||"unknown"}${d}`,text:e.text})}if(e.kind==="tool_result"){const d=tD(e,"output"),f=e.ok?s.jsx(fi,{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(rD,{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=nD(e.text,e.kind),a=t?nD(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 tD(e,t){const n=t==="input"?e.estimatedTokens?.inputTokens:e.estimatedTokens?.outputTokens;return typeof n!="number"?"":` · ${Yr(n)} tokens`}function nD(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 kbe(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 rD({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 Ebe(e,t,n,r){return c8({evalRules:e,failureReasons:t,runError:n,checkResults:r})}function sD(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%)"],Pbe=9,aD="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 Tbe(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 Rbe(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 Obe(e){const t=ll(e);return t?t.toLocaleDateString(void 0,{weekday:"long",month:"short",day:"numeric",year:"numeric",timeZone:"UTC"}):"Unknown day"}function Mbe(e){return e==="all"||e==="last"||e==="custom"}function Ibe(e){return e==="15min"||e==="30min"||e==="1h"||e==="24h"||e==="7d"||e==="14d"||e==="30d"}function $be(e){const t=e.get("time_filter"),n=e.get("time_preset");return{mode:Mbe(t)?t:"all",preset:Ibe(n)?n:"15min",start:e.get("time_start")??"",end:e.get("time_end")??""}}function Dbe(e,t){return e.length!==t.length?!1:e.every((n,r)=>n===t[r])}function Lbe(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 Fbe=()=>{const{source:e}=On(),[t,n]=Pi(),r=$be(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(aD)==="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=Hv(Y),{offset:O,hasMore:Z,totalCount:q}=W,z=t.get("runId")??"",K=(t.get("agents")??"").split(",").map(B=>B.trim()).filter(Boolean),J=t.get("scenario")??"all",[re,he]=m.useState(z),[oe,me]=m.useState(K),[ie,ge]=m.useState(J),[Re,Q]=m.useState(!1),Ne=m.useRef(0),Fe=m.useMemo(()=>{if(P==="all")return{};if(P==="last"){const fe=wc.find(Me=>Me.value===M)??wc[0],De=new Date;return{since:new Date(De.getTime()-fe.durationMs).toISOString(),until:De.toISOString()}}const B=ll(U)?.toISOString(),le=ll(G)?.toISOString();return{since:B,until:le}},[G,P,M,U]),pt=async()=>{const B=Ne.current+1;Ne.current=B,h(!0);try{if(e.listRunSummariesPage){const le={limit:Y,offset:O};S!=="all"&&(le.scenario=S),Fe.since&&(le.since=Fe.since),Fe.until&&(le.until=Fe.until);const fe=await e.listRunSummariesPage(le);if(Ne.current!==B)return;W.updateMeta(fe),o(fe.data.map(il))}else{const le=await e.listResults();if(Ne.current!==B)return;o(le)}}catch(le){Ie({title:"Could not load results",description:le instanceof Error?le.message:String(le),variant:"destructive"})}finally{Ne.current===B&&h(!1)}};m.useEffect(()=>{let B=!0;return Ne.current+=1,h(!0),(e.listRunSummariesPage?e.listRunSummariesPage({limit:Y,offset:O,scenario:S==="all"?void 0:S,since:Fe.since,until:Fe.until}).then(fe=>(B&&W.updateMeta(fe),fe.data.map(il))):e.listResults()).then(fe=>{B&&o(fe)}).catch(fe=>{B&&Ie({title:"Could not load results",description:fe instanceof Error?fe.message:String(fe),variant:"destructive"})}).finally(()=>{B&&h(!1)}),()=>{B=!1}},[O,S,e,Fe]);const ot=B=>{if(x===B){y(le=>le==="asc"?"desc":"asc");return}j(B),y(B==="timestamp"?"desc":"asc")},bt=B=>{v(le=>{const fe=new Set(le);return fe.has(B)?fe.delete(B):fe.add(B),fe})},wt=m.useMemo(()=>{const B=new Set;return i.forEach(le=>{le.scenarios.forEach(fe=>{const De=String(fe.scenarioName??"").trim(),Me=String(fe.scenarioId??"").trim(),Ge=De||Me;Ge&&B.add(Ge)})}),Array.from(B).sort((le,fe)=>le.localeCompare(fe))},[i]),et=m.useMemo(()=>{const B=S==="all"?i:i.filter(Oe=>Oe.scenarios.some(V=>{const ve=String(V.scenarioName??"").trim(),Ae=String(V.scenarioId??"").trim();return(ve||Ae)===S}));if(a!=="runs"||P==="all")return B;const le=Date.now();if(P==="last"){const Oe=wc.find(ve=>ve.value===M)??wc[0],V=le-Oe.durationMs;return B.filter(ve=>{const Ae=new Date(ve.timestamp).getTime();return Ae>=V&&Ae<=le})}const fe=ll(U)?.getTime()??null,De=ll(G)?.getTime()??null,Me=fe!==null&&De!==null?Math.min(fe,De):fe??null,Ge=fe!==null&&De!==null?Math.max(fe,De):De??null;return B.filter(Oe=>{const V=new Date(Oe.timestamp).getTime();return!(Number.isNaN(V)||Me!==null&&V<Me||Ge!==null&&V>Ge)})},[a,i,S,G,P,M,U]),_e=m.useMemo(()=>[...et].sort((B,le)=>{let fe=0;return x==="id"&&(fe=B.id.localeCompare(le.id)),x==="timestamp"&&(fe=new Date(B.timestamp).getTime()-new Date(le.timestamp).getTime()),x==="passRate"&&(fe=B.overallPassRate-le.overallPassRate),x==="scenarios"&&(fe=B.totalScenarios-le.totalScenarios),b==="asc"?fe:-fe}),[et,x,b]),Ee=m.useMemo(()=>_e.filter(B=>p.has(B.id)).map(B=>c[B.id]??B),[c,_e,p]),tt=m.useMemo(()=>{if(!k)return _e.map(fe=>({type:"run",run:fe}));const B=[];let le=null;for(const fe of _e){const De=Tbe(fe.timestamp);De!==le&&(B.push({type:"day-separator",dayKey:De,dayLabel:Obe(fe.timestamp)}),le=De),B.push({type:"run",run:fe})}return B},[k,_e]);m.useEffect(()=>{if(!(typeof window>"u"))try{window.localStorage.setItem(aD,k?"1":"0")}catch{}},[k]);const ct=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 le of _e)B.set(le.id,d_(le));return B},[_e]),Xt=B=>{const le=Array.from(new Set(B.scenarios.map(fe=>fe.agentId).filter(Boolean)));return le.slice(0,Math.min(2,le.length))},kt=B=>{const le=Xt(B);he(B.id),me(le),ge("all");const fe=new URLSearchParams(t);fe.set("mode","within-run"),fe.set("runId",B.id),le.length>0?fe.set("agents",le.join(",")):fe.delete("agents"),fe.delete("scenario"),n(fe,{replace:!0})},nn=m.useMemo(()=>[...new Set(Ee.flatMap(B=>B.scenarios.map(le=>le.scenarioId)))],[Ee]),Jt=m.useMemo(()=>{const B=new Map;for(const le of Ee)for(const fe of le.scenarios){const De=String(fe.scenarioId??"").trim();if(!De)continue;const Me=String(fe.scenarioName??"").trim();B.set(De,Me||De)}return B},[Ee]),zt=m.useMemo(()=>c[re]??i.find(B=>B.id===re),[c,i,re]);m.useEffect(()=>{if(typeof e.getResult!="function"||p.size===0&&!re)return;const B=new Set([...p]);re&&B.add(re);for(const le of B)c[le]||e.getResult(le).then(fe=>{fe&&d(De=>De[le]?De:{...De,[le]:fe})})},[c,p,e,re]),m.useEffect(()=>{W.reset()},[W.reset,S,P,M,U,G]);const Se=m.useMemo(()=>{if(!zt)return[];const B=new Map;for(const le of zt.scenarios)B.set(le.agentId,le.agentName||le.agentId);return Array.from(B.entries()).map(([le,fe])=>({id:le,name:fe})).sort((le,fe)=>le.name.localeCompare(fe.name))},[zt]),Xe=m.useMemo(()=>{if(!zt)return[];const B=new Set;for(const le of zt.scenarios){const fe=String(le.scenarioName??"").trim(),De=String(le.scenarioId??"").trim(),Me=fe||De;Me&&B.add(Me)}return Array.from(B).sort((le,fe)=>le.localeCompare(fe))},[zt]),Qe=m.useMemo(()=>oe.join(","),[oe]);m.useEffect(()=>{if(a==="within-run"){const B=t.get("runId")??"",le=(t.get("agents")??"").split(",").map(De=>De.trim()).filter(Boolean),fe=t.get("scenario")??"all";he(De=>De===B?De:B),me(De=>Dbe(De,le)?De:le),ge(De=>De===fe?De:fe)}},[a,t]),m.useEffect(()=>{if(a!=="within-run"||i.length===0)return;let B=re;(!B||!i.some(V=>V.id===B))&&(B=i[0].id);const le=i.find(V=>V.id===B),fe=(()=>{if(!le)return[];const V=new Map;for(const ve of le.scenarios)V.set(ve.agentId,ve.agentName||ve.agentId);return Array.from(V.keys())})(),De=new Set(fe);let Me=Qe.split(",").map(V=>V.trim()).filter(V=>!!V).filter(V=>De.has(V));Me.length===0&&fe.length>0&&(Me=fe.slice(0,Math.min(2,fe.length)));const Ge=(()=>{if(!le)return new Set;const V=new Set;for(const ve of le.scenarios){const Ae=String(ve.scenarioName??"").trim(),Je=String(ve.scenarioId??"").trim(),ne=Ae||Je;ne&&V.add(ne)}return new Set(V)})(),Oe=ie!=="all"&&!Ge.has(ie)?"all":ie;B!==re&&he(B),Me.join(",")!==Qe&&me(Me),Oe!==ie&&ge(Oe)},[a,i,re,Qe,ie]),m.useEffect(()=>{const B=new URLSearchParams(t);a==="within-run"?(B.set("mode","within-run"),re?B.set("runId",re):B.delete("runId"),oe.length>0?B.set("agents",oe.join(",")):B.delete("agents"),ie!=="all"?B.set("scenario",ie):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 le=t.toString(),fe=B.toString();le!==fe&&n(B,{replace:!0})},[a,G,P,M,U,re,oe,ie,t,n]);const At=m.useMemo(()=>{if(P==="all")return"All time";if(P==="last")return wc.find(fe=>fe.value===M)?.label??"Last range";const B=!!U.trim(),le=!!G.trim();return!B&&!le?"Custom range":B&&le?`${zh(U)} - ${zh(G)}`:B?`From ${zh(U)}`:`Until ${zh(G)}`},[G,P,M,U]),Bt=()=>{R("all"),D("15min"),F(""),H("")},de=m.useMemo(()=>{if(!zt)return[];const B=new Map;for(const fe of zt.scenarios){const De=String(fe.scenarioId??"").trim(),Me=String(fe.scenarioName??"").trim(),Ge=Me||De;if(!De&&!Ge)continue;const Oe=De||Ge,V=B.get(Oe);if(V){V.byAgent[fe.agentId]=fe;continue}B.set(Oe,{scenarioId:De||Ge,scenarioName:Me,displayLabel:Ge||De,byAgent:{[fe.agentId]:fe}})}const le=Array.from(B.values()).sort((fe,De)=>{const Me=(fe.displayLabel||fe.scenarioId).toLowerCase(),Ge=(De.displayLabel||De.scenarioId).toLowerCase();return Me.localeCompare(Ge)});return ie==="all"?le:le.filter(fe=>fe.displayLabel===ie)},[zt,ie]),Ke=m.useMemo(()=>{const B=new Map(Se.map(le=>[le.id,le]));return oe.map(le=>B.get(le)).filter(le=>!!le)},[oe,Se]),$e=m.useMemo(()=>{if(!zt||Ke.length!==2)return null;const[B,le]=Ke;return{left:B,right:le,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(le.id)}`}},[zt,Ke]),se=m.useMemo(()=>!zt||Ke.length===0?[]:Ke.map(B=>{const le=de.map(Ae=>Ae.byAgent[B.id]).filter(Ae=>!!Ae),fe=le.flatMap(Ae=>Ae.runs),De=fe.length,Me=fe.filter(Ae=>Ae.passed).length,Ge=fe.reduce((Ae,Je)=>Ae+Je.toolCalls.length,0),Oe=fe.reduce((Ae,Je)=>Ae+Je.duration,0),{provider:V,model:ve}=Lbe(le);return{agentId:B.id,agentName:B.name,provider:V,model:ve,passRate:De===0?0:Me/De,totalRuns:De,avgToolCalls:De===0?0:Ge/De,avgLatency:De===0?0:Oe/De}}),[zt,Ke,de]),we=B=>{me(le=>le.includes(B)?le.filter(fe=>fe!==B):[...le,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(BD,{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(ee,{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($D,{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(ee,{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"}),wt.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(ee,{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(DD,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"truncate",children:At})]}),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(ee,{type:"button",variant:P==="all"?"secondary":"ghost",className:"justify-start",onClick:()=>{Bt(),I(!1)},children:"All time"}),wc.map(B=>s.jsx(ee,{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(ee,{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(ee,{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(ee,{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(ee,{variant:"outline",onClick:()=>{pt()},disabled:f,children:f?"Refreshing...":"Refresh"}),s.jsx(ee,{variant:"outline",onClick:W.prev,disabled:f||O===0,children:"Prev"}),s.jsx(ee,{variant:"outline",onClick:W.next,disabled:f||!Z,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:re,onValueChange:he,children:[s.jsx(Tn,{children:s.jsx($n,{placeholder:"Select run"})}),s.jsx(Rn,{children:i.map(B=>s.jsx(mt,{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:Re,onOpenChange:Q,children:[s.jsx(mo,{asChild:!0,children:s.jsxs(ee,{type:"button",variant:"outline",role:"combobox","aria-expanded":Re,"aria-controls":"compare-within-run-scenario-command-list",className:"w-full justify-between font-normal",children:[s.jsx("span",{className:"truncate text-left",children:ie==="all"?"All scenarios":ie}),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"),Q(!1)},children:"All scenarios"}),Xe.map(B=>s.jsx(xs,{value:B,onSelect:()=>{ge(B),Q(!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:[Se.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents available for selected run."}),Se.map(B=>s.jsxs("label",{className:"inline-flex items-center gap-2 text-sm",children:[s.jsx(Lr,{checked:oe.includes(B.id),onCheckedChange:()=>we(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(ft,{className:"w-10"}),s.jsx(ft,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>ot("id"),children:["Run ID",ct("id")]})}),s.jsx(ft,{children:"Evaluated"}),s.jsx(ft,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>ot("timestamp"),children:["Timestamp",ct("timestamp")]})}),s.jsx(ft,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex w-full items-center justify-end gap-1 hover:text-foreground",onClick:()=>ot("passRate"),children:["Pass Rate",ct("passRate")]})}),s.jsx(ft,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>ot("scenarios"),children:["Scenarios",ct("scenarios")]})}),s.jsx(ft,{className:"text-right",children:"Tool Tokens"}),s.jsx(ft,{className:"text-right",children:"Agents"}),s.jsx(ft,{className:"w-[140px] text-right",children:"Action"})]})}),s.jsx(ts,{children:tt.map((B,le)=>B.type==="day-separator"?s.jsx(Gt,{className:"bg-muted/30 hover:bg-muted/30",children:s.jsx(He,{colSpan:Pbe,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}-${le}`):s.jsxs(Gt,{children:[s.jsx(He,{children:s.jsx(Lr,{checked:p.has(B.run.id),onCheckedChange:()=>bt(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 fe=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: ",fe.scenarioCount," scenario",fe.scenarioCount===1?"":"s"," · ",fe.agentCount," agent",fe.agentCount===1?"":"s",fe.modelSummary?` · ${fe.modelSummary}`:""]}),s.jsx("div",{className:"font-mono text-xs text-foreground/80",children:fe.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(va,{className:"h-3 w-3"}),new Date(B.run.timestamp).toLocaleString()]}),(()=>{const fe=mg(B.run);return fe===null?null:s.jsxs("div",{className:"font-mono text-[11px] text-muted-foreground/90",children:["Total time: ",Is(fe)]})})()]})}),s.jsx(He,{className:"text-right",children:s.jsx(Oa,{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 fe=gg(B.run);return fe===null?null:s.jsxs("div",{className:"font-mono text-[11px] text-muted-foreground/90",children:["Tool time: ",Is(fe)]})})()]})}),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(ee,{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"&&Ee.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"&&Ee.length>=2&&s.jsxs(s.Fragment,{children:[Ee.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(ee,{asChild:!0,size:"sm",children:s.jsx(Tt,{to:`/compare/results?left=${encodeURIComponent(Ee[0].id)}&right=${encodeURIComponent(Ee[1].id)}&leftConfig=${encodeURIComponent(Ee[0].configId)}&rightConfig=${encodeURIComponent(Ee[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(ft,{className:"w-[220px]",children:"Metric"}),Ee.map((B,le)=>s.jsxs(ft,{style:{color:xS[le]},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"}),Ee.map(B=>s.jsx(He,{children:s.jsx(Oa,{rate:B.overallPassRate})},B.id))]}),s.jsxs(Gt,{children:[s.jsx(He,{className:"font-medium",children:"Total Runs"}),Ee.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"}),Ee.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"}),Ee.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"}),Ee.map(B=>s.jsx(He,{className:"font-mono",children:(()=>{const le=mg(B);return le===null?"—":Is(le)})()},B.id))]}),s.jsxs(Gt,{children:[s.jsx(He,{className:"font-medium",children:"Tool Time"}),Ee.map(B=>s.jsx(He,{className:"font-mono",children:(()=>{const le=gg(B);return le===null?"—":Is(le)})()},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(ft,{className:"w-[220px]",children:"Scenario"}),Ee.map((B,le)=>s.jsxs(ft,{style:{color:xS[le]},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: ",Rbe(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}),Ee.map(le=>{const fe=le.scenarios.find(De=>De.scenarioId===B);return s.jsx(He,{children:fe?s.jsx(Oa,{rate:fe.passRate}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})},le.id)})]},B))})]})})]})]}),a==="runs"&&Ee.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:Ee.map((B,le)=>({idx:le+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:$e?"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(ee,{asChild:!0,size:"sm",children:$e?s.jsx(Tt,{to:$e.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(ft,{children:"Metric"}),se.map(B=>s.jsxs(ft,{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"}),se.map(B=>s.jsx(He,{children:s.jsx(Oa,{rate:B.passRate})},B.agentId))]}),s.jsxs(Gt,{children:[s.jsx(He,{className:"font-medium",children:"Total Runs"}),se.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"}),se.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"}),se.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(ft,{className:"w-[260px]",children:"Scenario"}),Ke.map(B=>{const le=se.find(fe=>fe.agentId===B.id);return s.jsxs(ft,{children:[s.jsx("div",{className:"font-medium text-sm",children:B.name}),(le?.provider||le?.model)&&s.jsx("div",{className:"font-mono text-xs font-normal text-muted-foreground",children:[le.provider?ug(le.provider):null,le.model].filter(Boolean).join(" · ")})]},B.id)})]})}),s.jsx(ts,{children:de.map(B=>s.jsxs(Gt,{children:[s.jsx(He,{className:"font-medium text-sm",children:B.displayLabel}),Ke.map(le=>{const fe=B.byAgent[le.id];return fe?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(Oa,{rate:fe.passRate})," ",s.jsxs("span",{className:"ml-2",children:["runs: ",fe.runs.length]})," · calls:"," ",fe.avgToolCalls.toFixed(1)," · latency:"," ",Math.round(fe.avgDuration),"ms"]}),fe.runs.length>0?s.jsx("div",{className:"space-y-1.5",children:fe.runs.map(De=>Ue(De))}):s.jsx("div",{className:"text-xs text-muted-foreground",children:"No runs captured."})]})},le.id):s.jsx(He,{children:s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})},le.id)})]},B.scenarioId))})]})})]})]})]})},iD=(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()}`},oD=(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}`:""}`},zbe=()=>{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(ee,{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(ee,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs(Tt,{to:"/compare",children:[s.jsx($D,{className:"mr-1.5 h-4 w-4"}),"Back to Compare"]})}),s.jsx(ee,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs("a",{href:oD(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(ee,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs("a",{href:oD(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:iD(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:iD(r,i,c),className:"h-[calc(100vh-12rem)] w-full border-0"})})]})]})]})};function Bbe(e){return e.match(/(?:^|\/)(?:result-assistant|results?)\/([0-9]{8}-[0-9]{6})(?:-|\/)/i)?.[1]??null}function qbe(){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=Hv(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){Ie({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)),Ie({title:"Markdown report deleted"}),o(null)}catch(S){Ie({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(ee,{variant:"outline",onClick:()=>{x()},children:"Refresh"}),j?s.jsx(ee,{asChild:!0,variant:"outline",children:s.jsx(Tt,{to:`/markdown-reports/view?id=${encodeURIComponent(j.reportId)}`,children:"Open latest"})}):null,s.jsx(ee,{variant:"outline",onClick:h.prev,disabled:r||p===0,children:"Prev"}),s.jsx(ee,{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(ft,{children:"Report"}),s.jsx(ft,{children:"Result"}),s.jsx(ft,{children:"Folder"}),s.jsx(ft,{children:"Timestamp"}),s.jsx(ft,{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=Bbe(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(va,{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(ee,{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(Or,{asChild:!0,children:s.jsx(Tt,{to:`/markdown-reports/view?id=${encodeURIComponent(S.reportId)}`,children:"View"})}),s.jsxs(Or,{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(wa,{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 Ube(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Wbe(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 Vbe(){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}Ie({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(ee,{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(ee,{asChild:!0,variant:"outline",children:s.jsx(Tt,{to:"/markdown-reports",children:"Back to Markdown Reports"})})]});const v=Wbe(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(va,{className:"h-3 w-3 shrink-0"}),new Date(a.mtime).toLocaleString()]}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:Ube(a.sizeBytes)})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[v?s.jsxs(s.Fragment,{children:[s.jsx(ee,{variant:"outline",size:"sm",onClick:()=>p(!0),children:"Open Result Panel"}),s.jsx(ee,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(Tt,{to:`/results/${encodeURIComponent(v)}`,children:"Open Result"})})]}):null,s.jsx(ee,{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(k3,{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(P3,{className:"border-b px-4 py-3 pr-12",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs(T3,{className:"text-base",children:["Result ",v]}),s.jsx(ee,{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 Hbe=()=>{const e=ja();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"})]})})},Kbe=new vK;function Gbe(){const{scenarioId:e}=Ml();return s.jsx(X5,{to:e?`/libraries/test-cases/${encodeURIComponent(e)}`:"/libraries/test-cases",replace:!0})}const Ybe=()=>s.jsx(yK,{client:Kbe,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(R$,{})}),s.jsx(yn,{path:"/mcp-evaluations/:id/:tab",element:s.jsx(R$,{})}),s.jsx(yn,{path:"/tool-analysis",element:s.jsx(Qye,{})}),s.jsx(yn,{path:"/tool-analysis-results",element:s.jsx(Zye,{})}),s.jsx(yn,{path:"/tool-analysis-results/:id",element:s.jsx(Jye,{})}),s.jsx(yn,{path:"/oauth-debugger",element:s.jsx(abe,{})}),s.jsx(yn,{path:"/libraries/servers",element:s.jsx(pxe,{})}),s.jsx(yn,{path:"/libraries/servers/:serverId",element:s.jsx(hxe,{})}),s.jsx(yn,{path:"/libraries/agents",element:s.jsx(mxe,{})}),s.jsx(yn,{path:"/libraries/agents/:agentName",element:s.jsx(Nye,{})}),s.jsx(yn,{path:"/libraries/test-cases",element:s.jsx(q$,{})}),s.jsx(yn,{path:"/libraries/test-cases/:testCaseId",element:s.jsx(q$,{})}),s.jsx(yn,{path:"/libraries/scenarios",element:s.jsx(X5,{to:"/libraries/test-cases",replace:!0})}),s.jsx(yn,{path:"/libraries/scenarios/:scenarioId",element:s.jsx(Gbe,{})}),s.jsx(yn,{path:"/settings",element:s.jsx(Cye,{})}),s.jsx(yn,{path:"/settings/mcp",element:s.jsx(Rye,{})}),s.jsx(yn,{path:"/run",element:s.jsx(gbe,{})}),s.jsx(yn,{path:"/results",element:s.jsx(jbe,{})}),s.jsx(yn,{path:"/results/:id",element:s.jsx(_be,{})}),s.jsx(yn,{path:"/markdown-reports",element:s.jsx(qbe,{})}),s.jsx(yn,{path:"/markdown-reports/view",element:s.jsx(Vbe,{})}),s.jsx(yn,{path:"/compare",element:s.jsx(Fbe,{})}),s.jsx(yn,{path:"/compare/results",element:s.jsx(zbe,{})})]}),s.jsx(yn,{path:"*",element:s.jsx(Hbe,{})})]})})]})})})})});y7.createRoot(document.getElementById("root")).render(s.jsx(Ybe,{}));
|