@mastra/deployer-cloud 1.31.0-alpha.1 → 1.31.0-alpha.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/CHANGELOG.md +8 -0
- package/dist/studio/assets/{index-HQvvYJTC.js → index-70ReIlsb.js} +1 -1
- package/dist/studio/assets/{index-D9kCHXTq.js → index-B3n697wk.js} +1 -1
- package/dist/studio/assets/{index-Dny6Ytz5.js → index-B5c685UB.js} +1 -1
- package/dist/studio/assets/{index-D9D9503k.js → index-B9T9kS5a.js} +1 -1
- package/dist/studio/assets/{index-CUH-L0Eu.js → index-BO2xrfI9.js} +1 -1
- package/dist/studio/assets/{index-CiNbRhWy.js → index-BRfWvzT8.js} +1 -1
- package/dist/studio/assets/{index-PowZIEy3.js → index-BmztCkjM.js} +1 -1
- package/dist/studio/assets/{index-CVTnI1Sz.js → index-BtYPKXmx.js} +1 -1
- package/dist/studio/assets/{index-DL_YojVu.js → index-CAPvaTvr.js} +1 -1
- package/dist/studio/assets/{index-CevTwOaD.js → index-CPUVmBka.js} +1 -1
- package/dist/studio/assets/{index-DKd5Gyxb.js → index-CSsr-c3k.js} +1 -1
- package/dist/studio/assets/{index-D13Lh-MO.js → index-CY5M8S18.js} +1 -1
- package/dist/studio/assets/{index-DzBebta_.js → index-CsrD2Q_4.js} +1 -1
- package/dist/studio/assets/{index-DGhGhEx1.js → index-DP0yknD2.js} +1 -1
- package/dist/studio/assets/{index-CkywT5MA.js → index-DVLpUcz6.js} +1 -1
- package/dist/studio/assets/{index-DySsw88u.js → index-DVlITRAn.js} +1 -1
- package/dist/studio/assets/{index-6_8_LPfz.js → index-E3AFdTkM.js} +1 -1
- package/dist/studio/assets/{index-gPdbZq-y.js → index-Ia0WWYiZ.js} +1 -1
- package/dist/studio/assets/{main-D8_QELva.js → main-CHmwUXMI.js} +6 -6
- package/dist/studio/index.html +1 -1
- package/package.json +5 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-
|
|
2
|
-
import{_ as Ke}from"./index-DGhGhEx1.js";function e7e(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(n,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Y$=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Uo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oU={exports:{}},vj={};var hwe;function p_t(){if(hwe)return vj;hwe=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,s,a){var i=null;if(a!==void 0&&(i=""+a),s.key!==void 0&&(i=""+s.key),"key"in s){a={};for(var l in s)l!=="key"&&(a[l]=s[l])}else a=s;return s=a.ref,{$$typeof:e,type:n,key:i,ref:s!==void 0?s:null,props:a}}return vj.Fragment=t,vj.jsx=r,vj.jsxs=r,vj}var pwe;function m_t(){return pwe||(pwe=1,oU.exports=p_t()),oU.exports}var o=m_t(),lU={exports:{}},gn={},mwe;function g_t(){if(mwe)return gn;mwe=1;var e={env:{}};var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),p=Symbol.iterator;function m(V){return V===null||typeof V!="object"?null:(V=p&&V[p]||V["@@iterator"],typeof V=="function"?V:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,x={};function w(V,M,W){this.props=V,this.context=M,this.refs=x,this.updater=W||g}w.prototype.isReactComponent={},w.prototype.setState=function(V,M){if(typeof V!="object"&&typeof V!="function"&&V!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,V,M,"setState")},w.prototype.forceUpdate=function(V){this.updater.enqueueForceUpdate(this,V,"forceUpdate")};function S(){}S.prototype=w.prototype;function k(V,M,W){this.props=V,this.context=M,this.refs=x,this.updater=W||g}var _=k.prototype=new S;_.constructor=k,y(_,w.prototype),_.isPureReactComponent=!0;var E=Array.isArray;function T(){}var j={H:null,A:null,T:null,S:null},N=Object.prototype.hasOwnProperty;function I(V,M,W){var G=W.ref;return{$$typeof:t,type:V,key:M,ref:G!==void 0?G:null,props:W}}function P(V,M){return I(V.type,M,V.props)}function R(V){return typeof V=="object"&&V!==null&&V.$$typeof===t}function B(V){var M={"=":"=0",":":"=2"};return"$"+V.replace(/[=:]/g,function(W){return M[W]})}var D=/\/+/g;function $(V,M){return typeof V=="object"&&V!==null&&V.key!=null?B(""+V.key):M.toString(36)}function U(V){switch(V.status){case"fulfilled":return V.value;case"rejected":throw V.reason;default:switch(typeof V.status=="string"?V.then(T,T):(V.status="pending",V.then(function(M){V.status==="pending"&&(V.status="fulfilled",V.value=M)},function(M){V.status==="pending"&&(V.status="rejected",V.reason=M)})),V.status){case"fulfilled":return V.value;case"rejected":throw V.reason}}throw V}function z(V,M,W,G,J){var ae=typeof V;(ae==="undefined"||ae==="boolean")&&(V=null);var te=!1;if(V===null)te=!0;else switch(ae){case"bigint":case"string":case"number":te=!0;break;case"object":switch(V.$$typeof){case t:case r:te=!0;break;case f:return te=V._init,z(te(V._payload),M,W,G,J)}}if(te)return J=J(V),te=G===""?"."+$(V,0):G,E(J)?(W="",te!=null&&(W=te.replace(D,"$&/")+"/"),z(J,M,W,"",function(he){return he})):J!=null&&(R(J)&&(J=P(J,W+(J.key==null||V&&V.key===J.key?"":(""+J.key).replace(D,"$&/")+"/")+te)),M.push(J)),1;te=0;var re=G===""?".":G+":";if(E(V))for(var ie=0;ie<V.length;ie++)G=V[ie],ae=re+$(G,ie),te+=z(G,M,W,ae,J);else if(ie=m(V),typeof ie=="function")for(V=ie.call(V),ie=0;!(G=V.next()).done;)G=G.value,ae=re+$(G,ie++),te+=z(G,M,W,ae,J);else if(ae==="object"){if(typeof V.then=="function")return z(U(V),M,W,G,J);throw M=String(V),Error("Objects are not valid as a React child (found: "+(M==="[object Object]"?"object with keys {"+Object.keys(V).join(", ")+"}":M)+"). If you meant to render a collection of children, use an array instead.")}return te}function H(V,M,W){if(V==null)return V;var G=[],J=0;return z(V,G,"","",function(ae){return M.call(W,ae,J++)}),G}function Q(V){if(V._status===-1){var M=V._result;M=M(),M.then(function(W){(V._status===0||V._status===-1)&&(V._status=1,V._result=W)},function(W){(V._status===0||V._status===-1)&&(V._status=2,V._result=W)}),V._status===-1&&(V._status=0,V._result=M)}if(V._status===1)return V._result.default;throw V._result}var L=typeof reportError=="function"?reportError:function(V){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var M=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof V=="object"&&V!==null&&typeof V.message=="string"?String(V.message):String(V),error:V});if(!window.dispatchEvent(M))return}else if(typeof e=="object"&&typeof e.emit=="function"){e.emit("uncaughtException",V);return}console.error(V)},Z={map:H,forEach:function(V,M,W){H(V,function(){M.apply(this,arguments)},W)},count:function(V){var M=0;return H(V,function(){M++}),M},toArray:function(V){return H(V,function(M){return M})||[]},only:function(V){if(!R(V))throw Error("React.Children.only expected to receive a single React element child.");return V}};return gn.Activity=h,gn.Children=Z,gn.Component=w,gn.Fragment=n,gn.Profiler=a,gn.PureComponent=k,gn.StrictMode=s,gn.Suspense=u,gn.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,gn.__COMPILER_RUNTIME={__proto__:null,c:function(V){return j.H.useMemoCache(V)}},gn.cache=function(V){return function(){return V.apply(null,arguments)}},gn.cacheSignal=function(){return null},gn.cloneElement=function(V,M,W){if(V==null)throw Error("The argument must be a React element, but you passed "+V+".");var G=y({},V.props),J=V.key;if(M!=null)for(ae in M.key!==void 0&&(J=""+M.key),M)!N.call(M,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&M.ref===void 0||(G[ae]=M[ae]);var ae=arguments.length-2;if(ae===1)G.children=W;else if(1<ae){for(var te=Array(ae),re=0;re<ae;re++)te[re]=arguments[re+2];G.children=te}return I(V.type,J,G)},gn.createContext=function(V){return V={$$typeof:l,_currentValue:V,_currentValue2:V,_threadCount:0,Provider:null,Consumer:null},V.Provider=V,V.Consumer={$$typeof:i,_context:V},V},gn.createElement=function(V,M,W){var G,J={},ae=null;if(M!=null)for(G in M.key!==void 0&&(ae=""+M.key),M)N.call(M,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(J[G]=M[G]);var te=arguments.length-2;if(te===1)J.children=W;else if(1<te){for(var re=Array(te),ie=0;ie<te;ie++)re[ie]=arguments[ie+2];J.children=re}if(V&&V.defaultProps)for(G in te=V.defaultProps,te)J[G]===void 0&&(J[G]=te[G]);return I(V,ae,J)},gn.createRef=function(){return{current:null}},gn.forwardRef=function(V){return{$$typeof:c,render:V}},gn.isValidElement=R,gn.lazy=function(V){return{$$typeof:f,_payload:{_status:-1,_result:V},_init:Q}},gn.memo=function(V,M){return{$$typeof:d,type:V,compare:M===void 0?null:M}},gn.startTransition=function(V){var M=j.T,W={};j.T=W;try{var G=V(),J=j.S;J!==null&&J(W,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(T,L)}catch(ae){L(ae)}finally{M!==null&&W.types!==null&&(M.types=W.types),j.T=M}},gn.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},gn.use=function(V){return j.H.use(V)},gn.useActionState=function(V,M,W){return j.H.useActionState(V,M,W)},gn.useCallback=function(V,M){return j.H.useCallback(V,M)},gn.useContext=function(V){return j.H.useContext(V)},gn.useDebugValue=function(){},gn.useDeferredValue=function(V,M){return j.H.useDeferredValue(V,M)},gn.useEffect=function(V,M){return j.H.useEffect(V,M)},gn.useEffectEvent=function(V){return j.H.useEffectEvent(V)},gn.useId=function(){return j.H.useId()},gn.useImperativeHandle=function(V,M,W){return j.H.useImperativeHandle(V,M,W)},gn.useInsertionEffect=function(V,M){return j.H.useInsertionEffect(V,M)},gn.useLayoutEffect=function(V,M){return j.H.useLayoutEffect(V,M)},gn.useMemo=function(V,M){return j.H.useMemo(V,M)},gn.useOptimistic=function(V,M){return j.H.useOptimistic(V,M)},gn.useReducer=function(V,M,W){return j.H.useReducer(V,M,W)},gn.useRef=function(V){return j.H.useRef(V)},gn.useState=function(V){return j.H.useState(V)},gn.useSyncExternalStore=function(V,M,W){return j.H.useSyncExternalStore(V,M,W)},gn.useTransition=function(){return j.H.useTransition()},gn.version="19.2.5",gn}var gwe;function kE(){return gwe||(gwe=1,lU.exports=g_t()),lU.exports}var b=kE();const je=Uo(b),ZS=e7e({__proto__:null,default:je},[b]);var cU={exports:{}},bj={},uU={exports:{}},dU={};var ywe;function y_t(){return ywe||(ywe=1,(function(e){function t(U,z){var H=U.length;U.push(z);e:for(;0<H;){var Q=H-1>>>1,L=U[Q];if(0<s(L,z))U[Q]=z,U[H]=L,H=Q;else break e}}function r(U){return U.length===0?null:U[0]}function n(U){if(U.length===0)return null;var z=U[0],H=U.pop();if(H!==z){U[0]=H;e:for(var Q=0,L=U.length,Z=L>>>1;Q<Z;){var V=2*(Q+1)-1,M=U[V],W=V+1,G=U[W];if(0>s(M,H))W<L&&0>s(G,M)?(U[Q]=G,U[W]=H,Q=W):(U[Q]=M,U[V]=H,Q=V);else if(W<L&&0>s(G,H))U[Q]=G,U[W]=H,Q=W;else break e}}return z}function s(U,z){var H=U.sortIndex-z.sortIndex;return H!==0?H:U.id-z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var c=[],u=[],d=1,f=null,h=3,p=!1,m=!1,g=!1,y=!1,x=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function k(U){for(var z=r(u);z!==null;){if(z.callback===null)n(u);else if(z.startTime<=U)n(u),z.sortIndex=z.expirationTime,t(c,z);else break;z=r(u)}}function _(U){if(g=!1,k(U),!m)if(r(c)!==null)m=!0,E||(E=!0,R());else{var z=r(u);z!==null&&$(_,z.startTime-U)}}var E=!1,T=-1,j=5,N=-1;function I(){return y?!0:!(e.unstable_now()-N<j)}function P(){if(y=!1,E){var U=e.unstable_now();N=U;var z=!0;try{e:{m=!1,g&&(g=!1,w(T),T=-1),p=!0;var H=h;try{t:{for(k(U),f=r(c);f!==null&&!(f.expirationTime>U&&I());){var Q=f.callback;if(typeof Q=="function"){f.callback=null,h=f.priorityLevel;var L=Q(f.expirationTime<=U);if(U=e.unstable_now(),typeof L=="function"){f.callback=L,k(U),z=!0;break t}f===r(c)&&n(c),k(U)}else n(c);f=r(c)}if(f!==null)z=!0;else{var Z=r(u);Z!==null&&$(_,Z.startTime-U),z=!1}}break e}finally{f=null,h=H,p=!1}z=void 0}}finally{z?R():E=!1}}}var R;if(typeof S=="function")R=function(){S(P)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,D=B.port2;B.port1.onmessage=P,R=function(){D.postMessage(null)}}else R=function(){x(P,0)};function $(U,z){T=x(function(){U(e.unstable_now())},z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(U){U.callback=null},e.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<U?Math.floor(1e3/U):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_next=function(U){switch(h){case 1:case 2:case 3:var z=3;break;default:z=h}var H=h;h=z;try{return U()}finally{h=H}},e.unstable_requestPaint=function(){y=!0},e.unstable_runWithPriority=function(U,z){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var H=h;h=U;try{return z()}finally{h=H}},e.unstable_scheduleCallback=function(U,z,H){var Q=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?Q+H:Q):H=Q,U){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=H+L,U={id:d++,callback:z,priorityLevel:U,startTime:H,expirationTime:L,sortIndex:-1},H>Q?(U.sortIndex=H,t(u,U),r(c)===null&&U===r(u)&&(g?(w(T),T=-1):g=!0,$(_,H-Q))):(U.sortIndex=L,t(c,U),m||p||(m=!0,E||(E=!0,R()))),U},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(U){var z=h;return function(){var H=h;h=z;try{return U.apply(this,arguments)}finally{h=H}}}})(dU)),dU}var vwe;function v_t(){return vwe||(vwe=1,uU.exports=y_t()),uU.exports}var fU={exports:{}},Kl={};var bwe;function b_t(){if(bwe)return Kl;bwe=1;var e=kE();function t(c){var u="https://react.dev/errors/"+c;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)u+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+c+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var n={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},s=Symbol.for("react.portal");function a(c,u,d){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:f==null?null:""+f,children:c,containerInfo:u,implementation:d}}var i=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(c,u){if(c==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return Kl.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,Kl.createPortal=function(c,u){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(t(299));return a(c,u,null,d)},Kl.flushSync=function(c){var u=i.T,d=n.p;try{if(i.T=null,n.p=2,c)return c()}finally{i.T=u,n.p=d,n.d.f()}},Kl.preconnect=function(c,u){typeof c=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,n.d.C(c,u))},Kl.prefetchDNS=function(c){typeof c=="string"&&n.d.D(c)},Kl.preinit=function(c,u){if(typeof c=="string"&&u&&typeof u.as=="string"){var d=u.as,f=l(d,u.crossOrigin),h=typeof u.integrity=="string"?u.integrity:void 0,p=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;d==="style"?n.d.S(c,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:f,integrity:h,fetchPriority:p}):d==="script"&&n.d.X(c,{crossOrigin:f,integrity:h,fetchPriority:p,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},Kl.preinitModule=function(c,u){if(typeof c=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var d=l(u.as,u.crossOrigin);n.d.M(c,{crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&n.d.M(c)},Kl.preload=function(c,u){if(typeof c=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var d=u.as,f=l(d,u.crossOrigin);n.d.L(c,d,{crossOrigin:f,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},Kl.preloadModule=function(c,u){if(typeof c=="string")if(u){var d=l(u.as,u.crossOrigin);n.d.m(c,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else n.d.m(c)},Kl.requestFormReset=function(c){n.d.r(c)},Kl.unstable_batchedUpdates=function(c,u){return c(u)},Kl.useFormState=function(c,u,d){return i.H.useFormState(c,u,d)},Kl.useFormStatus=function(){return i.H.useHostTransitionStatus()},Kl.version="19.2.5",Kl}var xwe;function t7e(){if(xwe)return fU.exports;xwe=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(),fU.exports=b_t(),fU.exports}var wwe;function x_t(){if(wwe)return bj;wwe=1;var e={env:{}};var t=v_t(),r=kE(),n=t7e();function s(v){var O="https://react.dev/errors/"+v;if(1<arguments.length){O+="?args[]="+encodeURIComponent(arguments[1]);for(var C=2;C<arguments.length;C++)O+="&args[]="+encodeURIComponent(arguments[C])}return"Minified React error #"+v+"; visit "+O+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(v){return!(!v||v.nodeType!==1&&v.nodeType!==9&&v.nodeType!==11)}function i(v){var O=v,C=v;if(v.alternate)for(;O.return;)O=O.return;else{v=O;do O=v,(O.flags&4098)!==0&&(C=O.return),v=O.return;while(v)}return O.tag===3?C:null}function l(v){if(v.tag===13){var O=v.memoizedState;if(O===null&&(v=v.alternate,v!==null&&(O=v.memoizedState)),O!==null)return O.dehydrated}return null}function c(v){if(v.tag===31){var O=v.memoizedState;if(O===null&&(v=v.alternate,v!==null&&(O=v.memoizedState)),O!==null)return O.dehydrated}return null}function u(v){if(i(v)!==v)throw Error(s(188))}function d(v){var O=v.alternate;if(!O){if(O=i(v),O===null)throw Error(s(188));return O!==v?null:v}for(var C=v,A=O;;){var F=C.return;if(F===null)break;var q=F.alternate;if(q===null){if(A=F.return,A!==null){C=A;continue}break}if(F.child===q.child){for(q=F.child;q;){if(q===C)return u(F),v;if(q===A)return u(F),O;q=q.sibling}throw Error(s(188))}if(C.return!==A.return)C=F,A=q;else{for(var ee=!1,fe=F.child;fe;){if(fe===C){ee=!0,C=F,A=q;break}if(fe===A){ee=!0,A=F,C=q;break}fe=fe.sibling}if(!ee){for(fe=q.child;fe;){if(fe===C){ee=!0,C=q,A=F;break}if(fe===A){ee=!0,A=q,C=F;break}fe=fe.sibling}if(!ee)throw Error(s(189))}}if(C.alternate!==A)throw Error(s(190))}if(C.tag!==3)throw Error(s(188));return C.stateNode.current===C?v:O}function f(v){var O=v.tag;if(O===5||O===26||O===27||O===6)return v;for(v=v.child;v!==null;){if(O=f(v),O!==null)return O;v=v.sibling}return null}var h=Object.assign,p=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),S=Symbol.for("react.consumer"),k=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),R=Symbol.iterator;function B(v){return v===null||typeof v!="object"?null:(v=R&&v[R]||v["@@iterator"],typeof v=="function"?v:null)}var D=Symbol.for("react.client.reference");function $(v){if(v==null)return null;if(typeof v=="function")return v.$$typeof===D?null:v.displayName||v.name||null;if(typeof v=="string")return v;switch(v){case y:return"Fragment";case w:return"Profiler";case x:return"StrictMode";case E:return"Suspense";case T:return"SuspenseList";case I:return"Activity"}if(typeof v=="object")switch(v.$$typeof){case g:return"Portal";case k:return v.displayName||"Context";case S:return(v._context.displayName||"Context")+".Consumer";case _:var O=v.render;return v=v.displayName,v||(v=O.displayName||O.name||"",v=v!==""?"ForwardRef("+v+")":"ForwardRef"),v;case j:return O=v.displayName||null,O!==null?O:$(v.type)||"Memo";case N:O=v._payload,v=v._init;try{return $(v(O))}catch{}}return null}var U=Array.isArray,z=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q={pending:!1,data:null,method:null,action:null},L=[],Z=-1;function V(v){return{current:v}}function M(v){0>Z||(v.current=L[Z],L[Z]=null,Z--)}function W(v,O){Z++,L[Z]=v.current,v.current=O}var G=V(null),J=V(null),ae=V(null),te=V(null);function re(v,O){switch(W(ae,O),W(J,v),W(G,null),O.nodeType){case 9:case 11:v=(v=O.documentElement)&&(v=v.namespaceURI)?D0e(v):0;break;default:if(v=O.tagName,O=O.namespaceURI)O=D0e(O),v=L0e(O,v);else switch(v){case"svg":v=1;break;case"math":v=2;break;default:v=0}}M(G),W(G,v)}function ie(){M(G),M(J),M(ae)}function he(v){v.memoizedState!==null&&W(te,v);var O=G.current,C=L0e(O,v.type);O!==C&&(W(J,v),W(G,C))}function X(v){J.current===v&&(M(G),M(J)),te.current===v&&(M(te),pj._currentValue=Q)}var se,le;function xe(v){if(se===void 0)try{throw Error()}catch(C){var O=C.stack.trim().match(/\n( *(at )?)/);se=O&&O[1]||"",le=-1<C.stack.indexOf(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-CY5M8S18.js","./index-DP0yknD2.js","./index-B5c685UB.js","./index-DVlITRAn.js","./index-CSsr-c3k.js","./index-DVLpUcz6.js","./index-70ReIlsb.js","./index-B3n697wk.js","./index-CPUVmBka.js","./index-BtYPKXmx.js","./index-BO2xrfI9.js","./index-CsrD2Q_4.js","./index-Ia0WWYiZ.js","./index-E3AFdTkM.js","./index-B9T9kS5a.js","./dockerfile-BKs6k2Af.js","./simple-mode-GW_nhZxv.js","./factor-kuTfRLto.js","./nsis-LdVXkNf5.js","./pug-DeIclll2.js","./javascript-iXu5QeM3.js","./index-BmztCkjM.js","./index-CAPvaTvr.js","./index-BRfWvzT8.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as Ke}from"./index-DP0yknD2.js";function e7e(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(n,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Y$=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Uo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oU={exports:{}},vj={};var hwe;function p_t(){if(hwe)return vj;hwe=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,s,a){var i=null;if(a!==void 0&&(i=""+a),s.key!==void 0&&(i=""+s.key),"key"in s){a={};for(var l in s)l!=="key"&&(a[l]=s[l])}else a=s;return s=a.ref,{$$typeof:e,type:n,key:i,ref:s!==void 0?s:null,props:a}}return vj.Fragment=t,vj.jsx=r,vj.jsxs=r,vj}var pwe;function m_t(){return pwe||(pwe=1,oU.exports=p_t()),oU.exports}var o=m_t(),lU={exports:{}},gn={},mwe;function g_t(){if(mwe)return gn;mwe=1;var e={env:{}};var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),p=Symbol.iterator;function m(V){return V===null||typeof V!="object"?null:(V=p&&V[p]||V["@@iterator"],typeof V=="function"?V:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,x={};function w(V,M,W){this.props=V,this.context=M,this.refs=x,this.updater=W||g}w.prototype.isReactComponent={},w.prototype.setState=function(V,M){if(typeof V!="object"&&typeof V!="function"&&V!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,V,M,"setState")},w.prototype.forceUpdate=function(V){this.updater.enqueueForceUpdate(this,V,"forceUpdate")};function S(){}S.prototype=w.prototype;function k(V,M,W){this.props=V,this.context=M,this.refs=x,this.updater=W||g}var _=k.prototype=new S;_.constructor=k,y(_,w.prototype),_.isPureReactComponent=!0;var E=Array.isArray;function T(){}var j={H:null,A:null,T:null,S:null},N=Object.prototype.hasOwnProperty;function I(V,M,W){var G=W.ref;return{$$typeof:t,type:V,key:M,ref:G!==void 0?G:null,props:W}}function P(V,M){return I(V.type,M,V.props)}function R(V){return typeof V=="object"&&V!==null&&V.$$typeof===t}function B(V){var M={"=":"=0",":":"=2"};return"$"+V.replace(/[=:]/g,function(W){return M[W]})}var D=/\/+/g;function $(V,M){return typeof V=="object"&&V!==null&&V.key!=null?B(""+V.key):M.toString(36)}function U(V){switch(V.status){case"fulfilled":return V.value;case"rejected":throw V.reason;default:switch(typeof V.status=="string"?V.then(T,T):(V.status="pending",V.then(function(M){V.status==="pending"&&(V.status="fulfilled",V.value=M)},function(M){V.status==="pending"&&(V.status="rejected",V.reason=M)})),V.status){case"fulfilled":return V.value;case"rejected":throw V.reason}}throw V}function z(V,M,W,G,J){var ae=typeof V;(ae==="undefined"||ae==="boolean")&&(V=null);var te=!1;if(V===null)te=!0;else switch(ae){case"bigint":case"string":case"number":te=!0;break;case"object":switch(V.$$typeof){case t:case r:te=!0;break;case f:return te=V._init,z(te(V._payload),M,W,G,J)}}if(te)return J=J(V),te=G===""?"."+$(V,0):G,E(J)?(W="",te!=null&&(W=te.replace(D,"$&/")+"/"),z(J,M,W,"",function(he){return he})):J!=null&&(R(J)&&(J=P(J,W+(J.key==null||V&&V.key===J.key?"":(""+J.key).replace(D,"$&/")+"/")+te)),M.push(J)),1;te=0;var re=G===""?".":G+":";if(E(V))for(var ie=0;ie<V.length;ie++)G=V[ie],ae=re+$(G,ie),te+=z(G,M,W,ae,J);else if(ie=m(V),typeof ie=="function")for(V=ie.call(V),ie=0;!(G=V.next()).done;)G=G.value,ae=re+$(G,ie++),te+=z(G,M,W,ae,J);else if(ae==="object"){if(typeof V.then=="function")return z(U(V),M,W,G,J);throw M=String(V),Error("Objects are not valid as a React child (found: "+(M==="[object Object]"?"object with keys {"+Object.keys(V).join(", ")+"}":M)+"). If you meant to render a collection of children, use an array instead.")}return te}function H(V,M,W){if(V==null)return V;var G=[],J=0;return z(V,G,"","",function(ae){return M.call(W,ae,J++)}),G}function Q(V){if(V._status===-1){var M=V._result;M=M(),M.then(function(W){(V._status===0||V._status===-1)&&(V._status=1,V._result=W)},function(W){(V._status===0||V._status===-1)&&(V._status=2,V._result=W)}),V._status===-1&&(V._status=0,V._result=M)}if(V._status===1)return V._result.default;throw V._result}var L=typeof reportError=="function"?reportError:function(V){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var M=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof V=="object"&&V!==null&&typeof V.message=="string"?String(V.message):String(V),error:V});if(!window.dispatchEvent(M))return}else if(typeof e=="object"&&typeof e.emit=="function"){e.emit("uncaughtException",V);return}console.error(V)},Z={map:H,forEach:function(V,M,W){H(V,function(){M.apply(this,arguments)},W)},count:function(V){var M=0;return H(V,function(){M++}),M},toArray:function(V){return H(V,function(M){return M})||[]},only:function(V){if(!R(V))throw Error("React.Children.only expected to receive a single React element child.");return V}};return gn.Activity=h,gn.Children=Z,gn.Component=w,gn.Fragment=n,gn.Profiler=a,gn.PureComponent=k,gn.StrictMode=s,gn.Suspense=u,gn.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,gn.__COMPILER_RUNTIME={__proto__:null,c:function(V){return j.H.useMemoCache(V)}},gn.cache=function(V){return function(){return V.apply(null,arguments)}},gn.cacheSignal=function(){return null},gn.cloneElement=function(V,M,W){if(V==null)throw Error("The argument must be a React element, but you passed "+V+".");var G=y({},V.props),J=V.key;if(M!=null)for(ae in M.key!==void 0&&(J=""+M.key),M)!N.call(M,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&M.ref===void 0||(G[ae]=M[ae]);var ae=arguments.length-2;if(ae===1)G.children=W;else if(1<ae){for(var te=Array(ae),re=0;re<ae;re++)te[re]=arguments[re+2];G.children=te}return I(V.type,J,G)},gn.createContext=function(V){return V={$$typeof:l,_currentValue:V,_currentValue2:V,_threadCount:0,Provider:null,Consumer:null},V.Provider=V,V.Consumer={$$typeof:i,_context:V},V},gn.createElement=function(V,M,W){var G,J={},ae=null;if(M!=null)for(G in M.key!==void 0&&(ae=""+M.key),M)N.call(M,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(J[G]=M[G]);var te=arguments.length-2;if(te===1)J.children=W;else if(1<te){for(var re=Array(te),ie=0;ie<te;ie++)re[ie]=arguments[ie+2];J.children=re}if(V&&V.defaultProps)for(G in te=V.defaultProps,te)J[G]===void 0&&(J[G]=te[G]);return I(V,ae,J)},gn.createRef=function(){return{current:null}},gn.forwardRef=function(V){return{$$typeof:c,render:V}},gn.isValidElement=R,gn.lazy=function(V){return{$$typeof:f,_payload:{_status:-1,_result:V},_init:Q}},gn.memo=function(V,M){return{$$typeof:d,type:V,compare:M===void 0?null:M}},gn.startTransition=function(V){var M=j.T,W={};j.T=W;try{var G=V(),J=j.S;J!==null&&J(W,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(T,L)}catch(ae){L(ae)}finally{M!==null&&W.types!==null&&(M.types=W.types),j.T=M}},gn.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},gn.use=function(V){return j.H.use(V)},gn.useActionState=function(V,M,W){return j.H.useActionState(V,M,W)},gn.useCallback=function(V,M){return j.H.useCallback(V,M)},gn.useContext=function(V){return j.H.useContext(V)},gn.useDebugValue=function(){},gn.useDeferredValue=function(V,M){return j.H.useDeferredValue(V,M)},gn.useEffect=function(V,M){return j.H.useEffect(V,M)},gn.useEffectEvent=function(V){return j.H.useEffectEvent(V)},gn.useId=function(){return j.H.useId()},gn.useImperativeHandle=function(V,M,W){return j.H.useImperativeHandle(V,M,W)},gn.useInsertionEffect=function(V,M){return j.H.useInsertionEffect(V,M)},gn.useLayoutEffect=function(V,M){return j.H.useLayoutEffect(V,M)},gn.useMemo=function(V,M){return j.H.useMemo(V,M)},gn.useOptimistic=function(V,M){return j.H.useOptimistic(V,M)},gn.useReducer=function(V,M,W){return j.H.useReducer(V,M,W)},gn.useRef=function(V){return j.H.useRef(V)},gn.useState=function(V){return j.H.useState(V)},gn.useSyncExternalStore=function(V,M,W){return j.H.useSyncExternalStore(V,M,W)},gn.useTransition=function(){return j.H.useTransition()},gn.version="19.2.5",gn}var gwe;function kE(){return gwe||(gwe=1,lU.exports=g_t()),lU.exports}var b=kE();const je=Uo(b),ZS=e7e({__proto__:null,default:je},[b]);var cU={exports:{}},bj={},uU={exports:{}},dU={};var ywe;function y_t(){return ywe||(ywe=1,(function(e){function t(U,z){var H=U.length;U.push(z);e:for(;0<H;){var Q=H-1>>>1,L=U[Q];if(0<s(L,z))U[Q]=z,U[H]=L,H=Q;else break e}}function r(U){return U.length===0?null:U[0]}function n(U){if(U.length===0)return null;var z=U[0],H=U.pop();if(H!==z){U[0]=H;e:for(var Q=0,L=U.length,Z=L>>>1;Q<Z;){var V=2*(Q+1)-1,M=U[V],W=V+1,G=U[W];if(0>s(M,H))W<L&&0>s(G,M)?(U[Q]=G,U[W]=H,Q=W):(U[Q]=M,U[V]=H,Q=V);else if(W<L&&0>s(G,H))U[Q]=G,U[W]=H,Q=W;else break e}}return z}function s(U,z){var H=U.sortIndex-z.sortIndex;return H!==0?H:U.id-z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var c=[],u=[],d=1,f=null,h=3,p=!1,m=!1,g=!1,y=!1,x=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function k(U){for(var z=r(u);z!==null;){if(z.callback===null)n(u);else if(z.startTime<=U)n(u),z.sortIndex=z.expirationTime,t(c,z);else break;z=r(u)}}function _(U){if(g=!1,k(U),!m)if(r(c)!==null)m=!0,E||(E=!0,R());else{var z=r(u);z!==null&&$(_,z.startTime-U)}}var E=!1,T=-1,j=5,N=-1;function I(){return y?!0:!(e.unstable_now()-N<j)}function P(){if(y=!1,E){var U=e.unstable_now();N=U;var z=!0;try{e:{m=!1,g&&(g=!1,w(T),T=-1),p=!0;var H=h;try{t:{for(k(U),f=r(c);f!==null&&!(f.expirationTime>U&&I());){var Q=f.callback;if(typeof Q=="function"){f.callback=null,h=f.priorityLevel;var L=Q(f.expirationTime<=U);if(U=e.unstable_now(),typeof L=="function"){f.callback=L,k(U),z=!0;break t}f===r(c)&&n(c),k(U)}else n(c);f=r(c)}if(f!==null)z=!0;else{var Z=r(u);Z!==null&&$(_,Z.startTime-U),z=!1}}break e}finally{f=null,h=H,p=!1}z=void 0}}finally{z?R():E=!1}}}var R;if(typeof S=="function")R=function(){S(P)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,D=B.port2;B.port1.onmessage=P,R=function(){D.postMessage(null)}}else R=function(){x(P,0)};function $(U,z){T=x(function(){U(e.unstable_now())},z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(U){U.callback=null},e.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<U?Math.floor(1e3/U):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_next=function(U){switch(h){case 1:case 2:case 3:var z=3;break;default:z=h}var H=h;h=z;try{return U()}finally{h=H}},e.unstable_requestPaint=function(){y=!0},e.unstable_runWithPriority=function(U,z){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var H=h;h=U;try{return z()}finally{h=H}},e.unstable_scheduleCallback=function(U,z,H){var Q=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?Q+H:Q):H=Q,U){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=H+L,U={id:d++,callback:z,priorityLevel:U,startTime:H,expirationTime:L,sortIndex:-1},H>Q?(U.sortIndex=H,t(u,U),r(c)===null&&U===r(u)&&(g?(w(T),T=-1):g=!0,$(_,H-Q))):(U.sortIndex=L,t(c,U),m||p||(m=!0,E||(E=!0,R()))),U},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(U){var z=h;return function(){var H=h;h=z;try{return U.apply(this,arguments)}finally{h=H}}}})(dU)),dU}var vwe;function v_t(){return vwe||(vwe=1,uU.exports=y_t()),uU.exports}var fU={exports:{}},Kl={};var bwe;function b_t(){if(bwe)return Kl;bwe=1;var e=kE();function t(c){var u="https://react.dev/errors/"+c;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)u+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+c+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var n={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},s=Symbol.for("react.portal");function a(c,u,d){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:f==null?null:""+f,children:c,containerInfo:u,implementation:d}}var i=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(c,u){if(c==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return Kl.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,Kl.createPortal=function(c,u){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(t(299));return a(c,u,null,d)},Kl.flushSync=function(c){var u=i.T,d=n.p;try{if(i.T=null,n.p=2,c)return c()}finally{i.T=u,n.p=d,n.d.f()}},Kl.preconnect=function(c,u){typeof c=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,n.d.C(c,u))},Kl.prefetchDNS=function(c){typeof c=="string"&&n.d.D(c)},Kl.preinit=function(c,u){if(typeof c=="string"&&u&&typeof u.as=="string"){var d=u.as,f=l(d,u.crossOrigin),h=typeof u.integrity=="string"?u.integrity:void 0,p=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;d==="style"?n.d.S(c,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:f,integrity:h,fetchPriority:p}):d==="script"&&n.d.X(c,{crossOrigin:f,integrity:h,fetchPriority:p,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},Kl.preinitModule=function(c,u){if(typeof c=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var d=l(u.as,u.crossOrigin);n.d.M(c,{crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&n.d.M(c)},Kl.preload=function(c,u){if(typeof c=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var d=u.as,f=l(d,u.crossOrigin);n.d.L(c,d,{crossOrigin:f,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},Kl.preloadModule=function(c,u){if(typeof c=="string")if(u){var d=l(u.as,u.crossOrigin);n.d.m(c,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else n.d.m(c)},Kl.requestFormReset=function(c){n.d.r(c)},Kl.unstable_batchedUpdates=function(c,u){return c(u)},Kl.useFormState=function(c,u,d){return i.H.useFormState(c,u,d)},Kl.useFormStatus=function(){return i.H.useHostTransitionStatus()},Kl.version="19.2.5",Kl}var xwe;function t7e(){if(xwe)return fU.exports;xwe=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(),fU.exports=b_t(),fU.exports}var wwe;function x_t(){if(wwe)return bj;wwe=1;var e={env:{}};var t=v_t(),r=kE(),n=t7e();function s(v){var O="https://react.dev/errors/"+v;if(1<arguments.length){O+="?args[]="+encodeURIComponent(arguments[1]);for(var C=2;C<arguments.length;C++)O+="&args[]="+encodeURIComponent(arguments[C])}return"Minified React error #"+v+"; visit "+O+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(v){return!(!v||v.nodeType!==1&&v.nodeType!==9&&v.nodeType!==11)}function i(v){var O=v,C=v;if(v.alternate)for(;O.return;)O=O.return;else{v=O;do O=v,(O.flags&4098)!==0&&(C=O.return),v=O.return;while(v)}return O.tag===3?C:null}function l(v){if(v.tag===13){var O=v.memoizedState;if(O===null&&(v=v.alternate,v!==null&&(O=v.memoizedState)),O!==null)return O.dehydrated}return null}function c(v){if(v.tag===31){var O=v.memoizedState;if(O===null&&(v=v.alternate,v!==null&&(O=v.memoizedState)),O!==null)return O.dehydrated}return null}function u(v){if(i(v)!==v)throw Error(s(188))}function d(v){var O=v.alternate;if(!O){if(O=i(v),O===null)throw Error(s(188));return O!==v?null:v}for(var C=v,A=O;;){var F=C.return;if(F===null)break;var q=F.alternate;if(q===null){if(A=F.return,A!==null){C=A;continue}break}if(F.child===q.child){for(q=F.child;q;){if(q===C)return u(F),v;if(q===A)return u(F),O;q=q.sibling}throw Error(s(188))}if(C.return!==A.return)C=F,A=q;else{for(var ee=!1,fe=F.child;fe;){if(fe===C){ee=!0,C=F,A=q;break}if(fe===A){ee=!0,A=F,C=q;break}fe=fe.sibling}if(!ee){for(fe=q.child;fe;){if(fe===C){ee=!0,C=q,A=F;break}if(fe===A){ee=!0,A=q,C=F;break}fe=fe.sibling}if(!ee)throw Error(s(189))}}if(C.alternate!==A)throw Error(s(190))}if(C.tag!==3)throw Error(s(188));return C.stateNode.current===C?v:O}function f(v){var O=v.tag;if(O===5||O===26||O===27||O===6)return v;for(v=v.child;v!==null;){if(O=f(v),O!==null)return O;v=v.sibling}return null}var h=Object.assign,p=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),S=Symbol.for("react.consumer"),k=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),R=Symbol.iterator;function B(v){return v===null||typeof v!="object"?null:(v=R&&v[R]||v["@@iterator"],typeof v=="function"?v:null)}var D=Symbol.for("react.client.reference");function $(v){if(v==null)return null;if(typeof v=="function")return v.$$typeof===D?null:v.displayName||v.name||null;if(typeof v=="string")return v;switch(v){case y:return"Fragment";case w:return"Profiler";case x:return"StrictMode";case E:return"Suspense";case T:return"SuspenseList";case I:return"Activity"}if(typeof v=="object")switch(v.$$typeof){case g:return"Portal";case k:return v.displayName||"Context";case S:return(v._context.displayName||"Context")+".Consumer";case _:var O=v.render;return v=v.displayName,v||(v=O.displayName||O.name||"",v=v!==""?"ForwardRef("+v+")":"ForwardRef"),v;case j:return O=v.displayName||null,O!==null?O:$(v.type)||"Memo";case N:O=v._payload,v=v._init;try{return $(v(O))}catch{}}return null}var U=Array.isArray,z=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q={pending:!1,data:null,method:null,action:null},L=[],Z=-1;function V(v){return{current:v}}function M(v){0>Z||(v.current=L[Z],L[Z]=null,Z--)}function W(v,O){Z++,L[Z]=v.current,v.current=O}var G=V(null),J=V(null),ae=V(null),te=V(null);function re(v,O){switch(W(ae,O),W(J,v),W(G,null),O.nodeType){case 9:case 11:v=(v=O.documentElement)&&(v=v.namespaceURI)?D0e(v):0;break;default:if(v=O.tagName,O=O.namespaceURI)O=D0e(O),v=L0e(O,v);else switch(v){case"svg":v=1;break;case"math":v=2;break;default:v=0}}M(G),W(G,v)}function ie(){M(G),M(J),M(ae)}function he(v){v.memoizedState!==null&&W(te,v);var O=G.current,C=L0e(O,v.type);O!==C&&(W(J,v),W(G,C))}function X(v){J.current===v&&(M(G),M(J)),te.current===v&&(M(te),pj._currentValue=Q)}var se,le;function xe(v){if(se===void 0)try{throw Error()}catch(C){var O=C.stack.trim().match(/\n( *(at )?)/);se=O&&O[1]||"",le=-1<C.stack.indexOf(`
|
|
3
3
|
at`)?" (<anonymous>)":-1<C.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
4
|
`+se+v+le}var de=!1;function ue(v,O){if(!v||de)return"";de=!0;var C=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var A={DetermineComponentFrameRoot:function(){try{if(O){var ut=function(){throw Error()};if(Object.defineProperty(ut.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ut,[])}catch(et){var Ze=et}Reflect.construct(v,[],ut)}else{try{ut.call()}catch(et){Ze=et}v.call(ut.prototype)}}else{try{throw Error()}catch(et){Ze=et}(ut=v())&&typeof ut.catch=="function"&&ut.catch(function(){})}}catch(et){if(et&&Ze&&typeof et.stack=="string")return[et.stack,Ze.stack]}return[null,null]}};A.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var F=Object.getOwnPropertyDescriptor(A.DetermineComponentFrameRoot,"name");F&&F.configurable&&Object.defineProperty(A.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var q=A.DetermineComponentFrameRoot(),ee=q[0],fe=q[1];if(ee&&fe){var Te=ee.split(`
|
|
5
5
|
`),We=fe.split(`
|
|
@@ -112,7 +112,7 @@ Please change the parent <Route path="${y}"> to <Route path="${y==="/"?"*":`${y}
|
|
|
112
112
|
constructor(\${params}) {
|
|
113
113
|
\${}
|
|
114
114
|
}
|
|
115
|
-
}`,{label:"class",detail:"definition",type:"keyword"}),ku('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),ku('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],zGe=$ue.concat([ku("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),ku("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),ku("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),Ake=new zHe,BGe=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Rj(e){return(t,r)=>{let n=t.node.getChild("VariableDefinition");return n&&r(n,e),!0}}const KQt=["FunctionDeclaration"],JQt={FunctionDeclaration:Rj("function"),ClassDeclaration:Rj("class"),ClassExpression:()=>!0,EnumDeclaration:Rj("constant"),TypeAliasDeclaration:Rj("type"),NamespaceDeclaration:Rj("namespace"),VariableDefinition(e,t){e.matchContext(KQt)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function UGe(e,t){let r=Ake.get(t);if(r)return r;let n=[],s=!0;function a(i,l){let c=e.sliceString(i.from,i.to);n.push({label:c,type:l})}return t.cursor(Js.IncludeAnonymous).iterate(i=>{if(s)s=!1;else if(i.name){let l=JQt[i.name];if(l&&l(i,a)||BGe.has(i.name))return!1}else if(i.to-i.from>8192){for(let l of UGe(e,i.node))n.push(l);return!1}}),Ake.set(t,n),n}const G3=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Fue=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function VGe(e){let t=Ra(e.state).resolveInner(e.pos,-1);if(Fue.indexOf(t.name)>-1)return null;let r=t.name=="VariableName"||t.to-t.from<20&&G3.test(e.state.sliceDoc(t.from,t.to));if(!r&&!e.explicit)return null;let n=[];for(let s=t;s;s=s.parent)BGe.has(s.name)&&(n=n.concat(UGe(e.state.doc,s)));return{options:n,from:r?t.from:e.pos,validFor:G3}}function pV(e,t,r){var n;let s=[];for(;;){let a=t.firstChild,i;if(a?.name=="VariableName")return s.push(e(a)),{path:s.reverse(),name:r};if(a?.name=="MemberExpression"&&((n=i=a.lastChild)===null||n===void 0?void 0:n.name)=="PropertyName")s.push(e(i)),t=a;else return null}}function qGe(e){let t=n=>e.state.doc.sliceString(n.from,n.to),r=Ra(e.state).resolveInner(e.pos,-1);return r.name=="PropertyName"?pV(t,r.parent,t(r)):(r.name=="."||r.name=="?.")&&r.parent.name=="MemberExpression"?pV(t,r.parent,""):Fue.indexOf(r.name)>-1?null:r.name=="VariableName"||r.to-r.from<20&&G3.test(t(r))?{path:[],name:t(r)}:r.name=="MemberExpression"?pV(t,r,""):e.explicit?{path:[],name:""}:null}function eWt(e,t){let r=e,n=[],s=new Set;for(let a=0;;a++){for(let l of(Object.getOwnPropertyNames||Object.keys)(e)){if(!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(l)||s.has(l))continue;s.add(l);let c;try{c=r[l]}catch{continue}n.push({label:l,type:typeof c=="function"?/^[A-Z]/.test(l)?"class":t?"function":"method":t?"variable":"property",boost:-a})}let i=Object.getPrototypeOf(e);if(!i)return n;e=i}}function tWt(e){let t=new Map;return r=>{let n=qGe(r);if(!n)return null;let s=e;for(let i of n.path)if(s=s[i],!s)return null;let a=t.get(s);return a||t.set(s,a=eWt(s,!n.path.length)),{from:r.pos-n.name.length,options:a,validFor:G3}}}const ph=iS.define({name:"javascript",parser:XQt.configure({props:[a1.add({IfStatement:Fk({except:/^\s*({|else\b)/}),TryStatement:Fk({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:XUt,SwitchBody:e=>{let t=e.textAfter,r=/^\s*\}/.test(t),n=/^\s*(case|default)\b/.test(t);return e.baseIndent+(r?0:n?1:2)*e.unit},Block:YUt({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":Fk({except:/^\s*{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),i1.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":vue,BlockComment(e){return{from:e.from+2,to:e.to-2}},JSXElement(e){let t=e.firstChild;if(!t||t.name=="JSXSelfClosingTag")return null;let r=e.lastChild;return{from:t.to,to:r.type.isError?e.to:r.from}},"JSXSelfClosingTag JSXOpenTag"(e){var t;let r=(t=e.firstChild)===null||t===void 0?void 0:t.nextSibling,n=e.lastChild;return!r||r.type.isError?null:{from:r.to,to:n.type.isError?e.to:n.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),HGe={test:e=>/^JSX/.test(e.name),facet:LF({commentTokens:{block:{open:"{/*",close:"*/}"}}})},zue=ph.configure({dialect:"ts"},"typescript"),Bue=ph.configure({dialect:"jsx",props:[mue.add(e=>e.isTop?[HGe]:void 0)]}),Uue=ph.configure({dialect:"jsx ts",props:[mue.add(e=>e.isTop?[HGe]:void 0)]},"typescript");let QGe=e=>({label:e,type:"keyword"});const WGe="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(QGe),rWt=WGe.concat(["declare","implements","private","protected","public"].map(QGe));function Z3(e={}){let t=e.jsx?e.typescript?Uue:Bue:e.typescript?zue:ph,r=e.typescript?zGe.concat(rWt):$ue.concat(WGe);return new lS(t,[ph.data.of({autocomplete:DVt(Fue,UWe(r))}),ph.data.of({autocomplete:VGe}),e.jsx?GGe:[]])}function nWt(e){for(;;){if(e.name=="JSXOpenTag"||e.name=="JSXSelfClosingTag"||e.name=="JSXFragmentTag")return e;if(e.name=="JSXEscape"||!e.parent)return null;e=e.parent}}function Ike(e,t,r=e.length){for(let n=t?.firstChild;n;n=n.nextSibling)if(n.name=="JSXIdentifier"||n.name=="JSXBuiltin"||n.name=="JSXNamespacedName"||n.name=="JSXMemberExpression")return e.sliceString(n.from,Math.min(n.to,r));return""}const sWt=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),GGe=ft.inputHandler.of((e,t,r,n,s)=>{if((sWt?e.composing:e.compositionStarted)||e.state.readOnly||t!=r||n!=">"&&n!="/"||!ph.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:i}=a,l=i.changeByRange(c=>{var u;let{head:d}=c,f=Ra(i).resolveInner(d-1,-1),h;if(f.name=="JSXStartTag"&&(f=f.parent),!(i.doc.sliceString(d-1,d)!=n||f.name=="JSXAttributeValue"&&f.to>d)){if(n==">"&&f.name=="JSXFragmentTag")return{range:c,changes:{from:d,insert:"</>"}};if(n=="/"&&f.name=="JSXStartCloseTag"){let p=f.parent,m=p.parent;if(m&&p.from==d-2&&((h=Ike(i.doc,m.firstChild,d))||((u=m.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let g=`${h}>`;return{range:nt.cursor(d+g.length,-1),changes:{from:d,insert:g}}}}else if(n==">"){let p=nWt(f);if(p&&p.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(i.doc.sliceString(d,d+2))&&(h=Ike(i.doc,p,d)))return{range:c,changes:{from:d,insert:`</${h}>`}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([a,i.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function aWt(e,t){return t||(t={parserOptions:{ecmaVersion:2019,sourceType:"module"},env:{browser:!0,node:!0,es6:!0,es2015:!0,es2017:!0,es2020:!0},rules:{}},e.getRules().forEach((r,n)=>{var s;!((s=r.meta.docs)===null||s===void 0)&&s.recommended&&(t.rules[n]=2)})),r=>{let{state:n}=r,s=[];for(let{from:a,to:i}of ph.findRegions(n)){let l=n.doc.lineAt(a),c={line:l.number-1,col:a-l.from,pos:a};for(let u of e.verify(n.sliceDoc(a,i),t))s.push(iWt(u,n.doc,c))}return s}}function Rke(e,t,r,n){return r.line(e+n.line).from+t+(e==1?n.col-1:-1)}function iWt(e,t,r){let n=Rke(e.line,e.column,t,r),s={from:n,to:e.endLine!=null&&e.endColumn!=1?Rke(e.endLine,e.endColumn,t,r):n,message:e.message,source:e.ruleId?"eslint:"+e.ruleId:"eslint",severity:e.severity==1?"warning":"error"};if(e.fix){let{range:a,text:i}=e.fix,l=a[0]+r.pos-n,c=a[1]+r.pos-n;s.actions=[{name:"fix",apply(u,d){u.dispatch({changes:{from:d+l,to:d+c,insert:i},scrollIntoView:!0})}}]}return s}const rD=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:GGe,completionPath:qGe,esLint:aWt,javascript:Z3,javascriptLanguage:ph,jsxLanguage:Bue,localCompletionSource:VGe,scopeCompletionSource:tWt,snippets:$ue,tsxLanguage:Uue,typescriptLanguage:zue,typescriptSnippets:zGe},Symbol.toStringTag,{value:"Module"})),Pj=["_blank","_self","_top","_parent"],mV=["ascii","utf-8","utf-16","latin1","latin1"],gV=["get","post","put","delete"],yV=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],bd=["true","false"],Dr={},oWt={a:{attrs:{href:null,ping:null,type:null,media:null,target:Pj,hreflang:null}},abbr:Dr,address:Dr,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Dr,aside:Dr,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Dr,base:{attrs:{href:null,target:Pj}},bdi:Dr,bdo:Dr,blockquote:{attrs:{cite:null}},body:Dr,br:Dr,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:yV,formmethod:gV,formnovalidate:["novalidate"],formtarget:Pj,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Dr,center:Dr,cite:Dr,code:Dr,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Dr,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Dr,div:Dr,dl:Dr,dt:Dr,em:Dr,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Dr,figure:Dr,footer:Dr,form:{attrs:{action:null,name:null,"accept-charset":mV,autocomplete:["on","off"],enctype:yV,method:gV,novalidate:["novalidate"],target:Pj}},h1:Dr,h2:Dr,h3:Dr,h4:Dr,h5:Dr,h6:Dr,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Dr,hgroup:Dr,hr:Dr,html:{attrs:{manifest:null}},i:Dr,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:yV,formmethod:gV,formnovalidate:["novalidate"],formtarget:Pj,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Dr,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Dr,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Dr,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:mV,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Dr,noscript:Dr,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Dr,param:{attrs:{name:null,value:null}},pre:Dr,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Dr,rt:Dr,ruby:Dr,samp:Dr,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:mV}},section:Dr,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Dr,source:{attrs:{src:null,type:null,media:null}},span:Dr,strong:Dr,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Dr,summary:Dr,sup:Dr,table:Dr,tbody:Dr,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Dr,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Dr,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Dr,time:{attrs:{datetime:null}},title:Dr,tr:Dr,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Dr,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Dr},ZGe={accesskey:null,class:null,contenteditable:bd,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:bd,autocorrect:bd,autocapitalize:bd,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":bd,"aria-autocomplete":["inline","list","both","none"],"aria-busy":bd,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":bd,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":bd,"aria-hidden":bd,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":bd,"aria-multiselectable":bd,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":bd,"aria-relevant":null,"aria-required":bd,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},YGe="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of YGe)ZGe[e]=null;let TA=class{constructor(t,r){this.tags={...oWt,...t},this.globalAttrs={...ZGe,...r},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};TA.default=new TA;function T_(e,t,r=e.length){if(!t)return"";let n=t.firstChild,s=n&&n.getChild("TagName");return s?e.sliceString(s.from,Math.min(s.to,r)):""}function N_(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function XGe(e,t,r){let n=r.tags[T_(e,N_(t))];return n?.children||r.allTags}function Vue(e,t){let r=[];for(let n=N_(t);n&&!n.type.isTop;n=N_(n.parent)){let s=T_(e,n);if(s&&n.lastChild.name=="CloseTag")break;s&&r.indexOf(s)<0&&(t.name=="EndTag"||t.from>=n.firstChild.to)&&r.push(s)}return r}const KGe=/^[:\-\.\w\u00b7-\uffff]*$/;function Pke(e,t,r,n,s){let a=/\s*>/.test(e.sliceDoc(s,s+5))?"":">",i=N_(r,r.name=="StartTag"||r.name=="TagName");return{from:n,to:s,options:XGe(e.doc,i,t).map(l=>({label:l,type:"type"})).concat(Vue(e.doc,r).map((l,c)=>({label:"/"+l,apply:"/"+l+a,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function Mke(e,t,r,n){let s=/\s*>/.test(e.sliceDoc(n,n+5))?"":">";return{from:r,to:n,options:Vue(e.doc,t).map((a,i)=>({label:a,apply:a+s,type:"type",boost:99-i})),validFor:KGe}}function lWt(e,t,r,n){let s=[],a=0;for(let i of XGe(e.doc,r,t))s.push({label:"<"+i,type:"type"});for(let i of Vue(e.doc,r))s.push({label:"</"+i+">",type:"type",boost:99-a++});return{from:n,to:n,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function cWt(e,t,r,n,s){let a=N_(r),i=a?t.tags[T_(e.doc,a)]:null,l=i&&i.attrs?Object.keys(i.attrs):[],c=i&&i.globalAttrs===!1?l:l.length?l.concat(t.globalAttrNames):t.globalAttrNames;return{from:n,to:s,options:c.map(u=>({label:u,type:"property"})),validFor:KGe}}function uWt(e,t,r,n,s){var a;let i=(a=r.parent)===null||a===void 0?void 0:a.getChild("AttributeName"),l=[],c;if(i){let u=e.sliceDoc(i.from,i.to),d=t.globalAttrs[u];if(!d){let f=N_(r),h=f?t.tags[T_(e.doc,f)]:null;d=h?.attrs&&h.attrs[u]}if(d){let f=e.sliceDoc(n,s).toLowerCase(),h='"',p='"';/^['"]/.test(f)?(c=f[0]=='"'?/^[^"]*$/:/^[^']*$/,h="",p=e.sliceDoc(s,s+1)==f[0]?"":f[0],f=f.slice(1),n++):c=/^[^\s<>='"]*$/;for(let m of d)l.push({label:m,apply:h+m+p,type:"constant"})}}return{from:n,to:s,options:l,validFor:c}}function JGe(e,t){let{state:r,pos:n}=t,s=Ra(r).resolveInner(n,-1),a=s.resolve(n);for(let i=n,l;a==s&&(l=s.childBefore(i));){let c=l.lastChild;if(!c||!c.type.isError||c.from<c.to)break;a=s=l,i=c.from}return s.name=="TagName"?s.parent&&/CloseTag$/.test(s.parent.name)?Mke(r,s,s.from,n):Pke(r,e,s,s.from,n):s.name=="StartTag"||s.name=="IncompleteTag"?Pke(r,e,s,n,n):s.name=="StartCloseTag"||s.name=="IncompleteCloseTag"?Mke(r,s,n,n):s.name=="OpenTag"||s.name=="SelfClosingTag"||s.name=="AttributeName"?cWt(r,e,s,s.name=="AttributeName"?s.from:n,n):s.name=="Is"||s.name=="AttributeValue"||s.name=="UnquotedAttributeValue"?uWt(r,e,s,s.name=="Is"?n:s.from,n):t.explicit&&(a.name=="Element"||a.name=="Text"||a.name=="Document")?lWt(r,e,s,n):null}function eZe(e){return JGe(TA.default,e)}function tZe(e){let{extraTags:t,extraGlobalAttributes:r}=e,n=r||t?new TA(t,r):TA.default;return s=>JGe(n,s)}const dWt=ph.parser.configure({top:"SingleExpression"}),rZe=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:zue.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:Bue.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:Uue.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:dWt},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:ph.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:jA.parser}],nZe=[{name:"style",parser:jA.parser.configure({top:"Styles"})}].concat(YGe.map(e=>({name:e,parser:ph.parser}))),sZe=iS.define({name:"html",parser:zHt.configure({props:[a1.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let t=null,r;for(let n=e.node;;){let s=n.lastChild;if(!s||s.name!="Element"||s.to!=n.to)break;t=n=s}return t&&!((r=t.lastChild)&&(r.name=="CloseTag"||r.name=="SelfClosingTag"))?e.lineIndent(t.from)+e.unit:null}}),i1.add({Element(e){let t=e.firstChild,r=e.lastChild;return!t||t.name!="OpenTag"?null:{from:t.to,to:r.name=="CloseTag"?r.from:e.to}}}),MWe.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),bN=sZe.configure({wrap:NGe(rZe,nZe)});function aZe(e={}){let t="",r;e.matchClosingTags===!1&&(t="noMatch"),e.selfClosingTags===!0&&(t=(t?t+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(r=NGe((e.nestedLanguages||[]).concat(rZe),(e.nestedAttributes||[]).concat(nZe)));let n=r?sZe.configure({wrap:r,dialect:t}):t?bN.configure({dialect:t}):bN;return new lS(n,[bN.data.of({autocomplete:tZe(e)}),e.autoCloseTags!==!1?iZe:[],Z3().support,$Ge().support])}const Dke=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),iZe=ft.inputHandler.of((e,t,r,n,s)=>{if(e.composing||e.state.readOnly||t!=r||n!=">"&&n!="/"||!bN.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:i}=a,l=i.changeByRange(c=>{var u,d,f;let h=i.doc.sliceString(c.from-1,c.to)==n,{head:p}=c,m=Ra(i).resolveInner(p,-1),g;if(h&&n==">"&&m.name=="EndTag"){let y=m.parent;if(((d=(u=y.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(g=T_(i.doc,y.parent,p))&&!Dke.has(g)){let x=p+(i.doc.sliceString(p,p+1)===">"?1:0),w=`</${g}>`;return{range:c,changes:{from:p,to:x,insert:w}}}}else if(h&&n=="/"&&m.name=="IncompleteCloseTag"){let y=m.parent;if(m.from==p-2&&((f=y.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(g=T_(i.doc,y,p))&&!Dke.has(g)){let x=p+(i.doc.sliceString(p,p+1)===">"?1:0),w=`${g}>`;return{range:nt.cursor(p+w.length,-1),changes:{from:p,to:x,insert:w}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([a,i.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),fWt=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:iZe,html:aZe,htmlCompletionSource:eZe,htmlCompletionSourceWith:tZe,htmlLanguage:bN},Symbol.toStringTag,{value:"Module"})),oZe=LF({commentTokens:{block:{open:"<!--",close:"-->"}}}),lZe=new pn,cZe=Uqt.configure({props:[i1.add(e=>!e.is("Block")||e.is("Document")||nse(e)!=null||hWt(e)?void 0:(t,r)=>({from:r.doc.lineAt(t.from).to,to:t.to})),lZe.add(nse),a1.add({Document:()=>null}),Pb.add({Document:oZe})]});function nse(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function hWt(e){return e.name=="OrderedList"||e.name=="BulletList"}function pWt(e,t){let r=e;for(;;){let n=r.nextSibling,s;if(!n||(s=nse(n.type))!=null&&s<=t)break;r=n}return r.to}const mWt=OWe.of((e,t,r)=>{for(let n=Ra(e).resolveInner(r,-1);n&&!(n.from<t);n=n.parent){let s=n.type.prop(lZe);if(s==null)continue;let a=pWt(n,s);if(a>r)return{from:r,to:a}}return null});function que(e){return new Bd(oZe,e,[],"markdown")}const uZe=que(cZe),gWt=cZe.configure([Jqt,tHt,eHt,rHt,{props:[i1.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),dS=que(gWt);function yWt(e,t){return r=>{if(r&&e){let n=null;if(r=/\S*/.exec(r)[0],typeof e=="function"?n=e(r):n=Ye.matchLanguageName(e,r,!0),n instanceof Ye)return n.support?n.support.language.parser:oS.getSkippingParser(n.load());if(n)return n.parser}return t?t.parser:null}}class vV{constructor(t,r,n,s,a,i,l){this.node=t,this.from=r,this.to=n,this.spaceBefore=s,this.spaceAfter=a,this.type=i,this.item=l}blank(t,r=!0){let n=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(t!=null){for(;n.length<t;)n+=" ";return n}else{for(let s=this.to-this.from-n.length-this.spaceAfter.length;s>0;s--)n+=" ";return n+(r?this.spaceAfter:"")}}marker(t,r){let n=this.node.name=="OrderedList"?String(+fZe(this.item,t)[2]+r):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function dZe(e,t){let r=[],n=[];for(let s=e;s;s=s.parent){if(s.name=="FencedCode")return n;(s.name=="ListItem"||s.name=="Blockquote")&&r.push(s)}for(let s=r.length-1;s>=0;s--){let a=r[s],i,l=t.lineAt(a.from),c=a.from-l.from;if(a.name=="Blockquote"&&(i=/^ *>( ?)/.exec(l.text.slice(c))))n.push(new vV(a,c,c+i[0].length,"",i[1],">",null));else if(a.name=="ListItem"&&a.parent.name=="OrderedList"&&(i=/^( *)\d+([.)])( *)/.exec(l.text.slice(c)))){let u=i[3],d=i[0].length;u.length>=4&&(u=u.slice(0,u.length-4),d-=4),n.push(new vV(a.parent,c,c+d,i[1],u,i[2],a))}else if(a.name=="ListItem"&&a.parent.name=="BulletList"&&(i=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(l.text.slice(c)))){let u=i[4],d=i[0].length;u.length>4&&(u=u.slice(0,u.length-4),d-=4);let f=i[2];i[3]&&(f+=i[3].replace(/[xX]/," ")),n.push(new vV(a.parent,c,c+d,i[1],u,f,a))}}return n}function fZe(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function bV(e,t,r,n=0){for(let s=-1,a=e;;){if(a.name=="ListItem"){let l=fZe(a,t),c=+l[2];if(s>=0){if(c!=s+1)return;r.push({from:a.from+l[1].length,to:a.from+l[0].length,insert:String(s+2+n)})}s=c}let i=a.nextSibling;if(!i)break;a=i}}function Hue(e,t){let r=/^[ \t]*/.exec(e)[0].length;if(!r||t.facet(BE)!=" ")return e;let n=Sp(e,4,r),s="";for(let a=n;a>0;)a>=4?(s+=" ",a-=4):(s+=" ",a--);return s+e.slice(r)}const hZe=(e={})=>({state:t,dispatch:r})=>{let n=Ra(t),{doc:s}=t,a=null,i=t.changeByRange(l=>{if(!l.empty||!dS.isActiveAt(t,l.from,-1)&&!dS.isActiveAt(t,l.from,1))return a={range:l};let c=l.from,u=s.lineAt(c),d=dZe(n.resolveInner(c,-1),s);for(;d.length&&d[d.length-1].from>c-u.from;)d.pop();if(!d.length)return a={range:l};let f=d[d.length-1];if(f.to-f.spaceAfter.length>c-u.from)return a={range:l};let h=c>=f.to-f.spaceAfter.length&&!/\S/.test(u.text.slice(f.to));if(f.item&&h){let x=f.node.firstChild,w=f.node.getChild("ListItem","ListItem");if(x.to>=c||w&&w.to<c||u.from>0&&!/[^\s>]/.test(s.lineAt(u.from-1).text)||e.nonTightLists===!1){let S=d.length>1?d[d.length-2]:null,k,_="";S&&S.item?(k=u.from+S.from,_=S.marker(s,1)):k=u.from+(S?S.to:0);let E=[{from:k,to:c,insert:_}];return f.node.name=="OrderedList"&&bV(f.item,s,E,-2),S&&S.node.name=="OrderedList"&&bV(S.item,s,E),{range:nt.cursor(k+_.length),changes:E}}else{let S=$ke(d,t,u);return{range:nt.cursor(c+S.length+1),changes:{from:u.from,insert:S+t.lineBreak}}}}if(f.node.name=="Blockquote"&&h&&u.from){let x=s.lineAt(u.from-1),w=/>\s*$/.exec(x.text);if(w&&w.index==f.from){let S=t.changes([{from:x.from+w.index,to:x.to},{from:u.from+f.from,to:u.to}]);return{range:l.map(S),changes:S}}}let p=[];f.node.name=="OrderedList"&&bV(f.item,s,p);let m=f.item&&f.item.from<u.from,g="";if(!m||/^[\s\d.)\-+*>]*/.exec(u.text)[0].length>=f.to)for(let x=0,w=d.length-1;x<=w;x++)g+=x==w&&!m?d[x].marker(s,1):d[x].blank(x<w?Sp(u.text,4,d[x+1].from)-g.length:null);let y=c;for(;y>u.from&&/\s/.test(u.text.charAt(y-u.from-1));)y--;return g=Hue(g,t),vWt(f.node,t.doc)&&(g=$ke(d,t,u)+t.lineBreak+g),p.push({from:y,to:c,insert:t.lineBreak+g}),{range:nt.cursor(y+g.length+1),changes:p}});return a?!1:(r(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0)},pZe=hZe();function Lke(e){return e.name=="QuoteMark"||e.name=="ListMark"}function vWt(e,t){if(e.name!="OrderedList"&&e.name!="BulletList")return!1;let r=e.firstChild,n=e.getChild("ListItem","ListItem");if(!n)return!1;let s=t.lineAt(r.to),a=t.lineAt(n.from),i=/^[\s>]*$/.test(s.text);return s.number+(i?0:1)<a.number}function $ke(e,t,r){let n="";for(let s=0,a=e.length-2;s<=a;s++)n+=e[s].blank(s<a?Sp(r.text,4,e[s+1].from)-n.length:null,s<a);return Hue(n,t)}function bWt(e,t){let r=e.resolveInner(t,-1),n=t;Lke(r)&&(n=r.from,r=r.parent);for(let s;s=r.childBefore(n);)if(Lke(s))n=s.from;else if(s.name=="OrderedList"||s.name=="BulletList")r=s.lastChild,n=r.to;else break;return r}const mZe=({state:e,dispatch:t})=>{let r=Ra(e),n=null,s=e.changeByRange(a=>{let i=a.from,{doc:l}=e;if(a.empty&&dS.isActiveAt(e,a.from)){let c=l.lineAt(i),u=dZe(bWt(r,i),l);if(u.length){let d=u[u.length-1],f=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(i-c.from>f&&!/\S/.test(c.text.slice(f,i-c.from)))return{range:nt.cursor(c.from+f),changes:{from:c.from+f,to:i}};if(i-c.from==f&&(!d.item||c.from<=d.item.from||!/\S/.test(c.text.slice(0,d.to)))){let h=c.from+d.from;if(d.item&&d.node.from<d.item.from&&/\S/.test(c.text.slice(d.from,d.to))){let p=d.blank(Sp(c.text,4,d.to)-Sp(c.text,4,d.from));return h==c.from&&(p=Hue(p,e)),{range:nt.cursor(h+p.length),changes:{from:h,to:c.from+d.to,insert:p}}}if(h<i)return{range:nt.cursor(h),changes:{from:h,to:i}}}}}return n={range:a}});return n?!1:(t(e.update(s,{scrollIntoView:!0,userEvent:"delete"})),!0)},gZe=[{key:"Enter",run:pZe},{key:"Backspace",run:mZe}],yZe=aZe({matchClosingTags:!1});function Que(e={}){let{codeLanguages:t,defaultCodeLanguage:r,addKeymap:n=!0,base:{parser:s}=uZe,completeHTMLTags:a=!0,pasteURLAsLink:i=!0,htmlTagLanguage:l=yZe}=e;if(!(s instanceof BF))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],u=[l.support,mWt],d;i&&u.push(vZe),r instanceof lS?(u.push(r.support),d=r.language):r&&(d=r);let f=t||d?yWt(t,d):void 0;c.push(qqt({codeParser:f,htmlParser:l.language.parser})),n&&u.push(Rp.high(zE.of(gZe)));let h=que(s.configure(c));return a&&u.push(h.data.of({autocomplete:xWt})),new lS(h,u)}function xWt(e){let{state:t,pos:r}=e,n=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(r-25,r));if(!n)return null;let s=Ra(t).resolveInner(r,-1);for(;s&&!s.type.isTop;){if(s.name=="CodeBlock"||s.name=="FencedCode"||s.name=="ProcessingInstructionBlock"||s.name=="CommentBlock"||s.name=="Link"||s.name=="Image")return null;s=s.parent}return{from:r-n[0].length,to:r,options:wWt(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let xV=null;function wWt(){if(xV)return xV;let e=eZe(new Sue(zn.create({extensions:yZe}),0,!0));return xV=e?e.options:[]}const SWt=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,vZe=ft.domEventHandlers({paste:(e,t)=>{var r;let{main:n}=t.state.selection;if(n.empty)return!1;let s=(r=e.clipboardData)===null||r===void 0?void 0:r.getData("text/plain");if(!s||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(s)||(/^www\./.test(s)&&(s="https://"+s),!dS.isActiveAt(t.state,n.from,1)))return!1;let a=Ra(t.state),i=!1;return a.iterate({from:n.from,to:n.to,enter:l=>{(l.from>n.from||SWt.test(l.name))&&(i=!0)},leave:l=>{l.to<n.to&&(i=!0)}}),i?!1:(t.dispatch({changes:[{from:n.from,insert:"["},{from:n.to,insert:`](${s})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),OWt=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:uZe,deleteMarkupBackward:mZe,insertNewlineContinueMarkup:pZe,insertNewlineContinueMarkupCommand:hZe,markdown:Que,markdownKeymap:gZe,markdownLanguage:dS,pasteURLAsLink:vZe},Symbol.toStringTag,{value:"Module"}));function pt(e){return new lS(bue.define(e))}function Jv(e){return Ke(()=>import("./index-D13Lh-MO.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.sql({dialect:t[e]}))}const bZe=[Ye.of({name:"C",extensions:["c","h","ino"],load(){return Ke(()=>import("./index-Dny6Ytz5.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),Ye.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return Ke(()=>import("./index-Dny6Ytz5.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),Ye.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return Jv("Cassandra")}}),Ye.of({name:"CSS",extensions:["css"],load(){return Ke(()=>Promise.resolve().then(()=>xQt),void 0,import.meta.url).then(e=>e.css())}}),Ye.of({name:"Go",extensions:["go"],load(){return Ke(()=>import("./index-DySsw88u.js"),__vite__mapDeps([3,1]),import.meta.url).then(e=>e.go())}}),Ye.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return Ke(()=>Promise.resolve().then(()=>fWt),void 0,import.meta.url).then(e=>e.html())}}),Ye.of({name:"Java",extensions:["java"],load(){return Ke(()=>import("./index-DKd5Gyxb.js"),__vite__mapDeps([4,1]),import.meta.url).then(e=>e.java())}}),Ye.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return Ke(()=>Promise.resolve().then(()=>rD),void 0,import.meta.url).then(e=>e.javascript())}}),Ye.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return Ke(()=>import("./index-CkywT5MA.js"),__vite__mapDeps([5,1]),import.meta.url).then(e=>e.jinja())}}),Ye.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return Ke(()=>Promise.resolve().then(()=>PVt),void 0,import.meta.url).then(e=>e.json())}}),Ye.of({name:"JSX",extensions:["jsx"],load(){return Ke(()=>Promise.resolve().then(()=>rD),void 0,import.meta.url).then(e=>e.javascript({jsx:!0}))}}),Ye.of({name:"LESS",extensions:["less"],load(){return Ke(()=>import("./index-HQvvYJTC.js"),__vite__mapDeps([6,1]),import.meta.url).then(e=>e.less())}}),Ye.of({name:"Liquid",extensions:["liquid"],load(){return Ke(()=>import("./index-D9kCHXTq.js"),__vite__mapDeps([7,1]),import.meta.url).then(e=>e.liquid())}}),Ye.of({name:"MariaDB SQL",load(){return Jv("MariaSQL")}}),Ye.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return Ke(()=>Promise.resolve().then(()=>OWt),void 0,import.meta.url).then(e=>e.markdown())}}),Ye.of({name:"MS SQL",load(){return Jv("MSSQL")}}),Ye.of({name:"MySQL",load(){return Jv("MySQL")}}),Ye.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return Ke(()=>import("./index-CevTwOaD.js"),__vite__mapDeps([8,1]),import.meta.url).then(e=>e.php())}}),Ye.of({name:"PLSQL",extensions:["pls"],load(){return Jv("PLSQL")}}),Ye.of({name:"PostgreSQL",load(){return Jv("PostgreSQL")}}),Ye.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return Ke(()=>import("./index-CVTnI1Sz.js"),__vite__mapDeps([9,1]),import.meta.url).then(e=>e.python())}}),Ye.of({name:"Rust",extensions:["rs"],load(){return Ke(()=>import("./index-CUH-L0Eu.js"),__vite__mapDeps([10,1]),import.meta.url).then(e=>e.rust())}}),Ye.of({name:"Sass",extensions:["sass"],load(){return Ke(()=>import("./index-DzBebta_.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass({indented:!0}))}}),Ye.of({name:"SCSS",extensions:["scss"],load(){return Ke(()=>import("./index-DzBebta_.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass())}}),Ye.of({name:"SQL",extensions:["sql"],load(){return Jv("StandardSQL")}}),Ye.of({name:"SQLite",load(){return Jv("SQLite")}}),Ye.of({name:"TSX",extensions:["tsx"],load(){return Ke(()=>Promise.resolve().then(()=>rD),void 0,import.meta.url).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),Ye.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return Ke(()=>Promise.resolve().then(()=>rD),void 0,import.meta.url).then(e=>e.javascript({typescript:!0}))}}),Ye.of({name:"WebAssembly",extensions:["wat","wast"],load(){return Ke(()=>import("./index-gPdbZq-y.js"),__vite__mapDeps([12,1]),import.meta.url).then(e=>e.wast())}}),Ye.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return Ke(()=>import("./index-6_8_LPfz.js"),__vite__mapDeps([13,1]),import.meta.url).then(e=>e.xml())}}),Ye.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return Ke(()=>import("./index-D9D9503k.js"),__vite__mapDeps([14,1]),import.meta.url).then(e=>e.yaml())}}),Ye.of({name:"APL",extensions:["dyalog","apl"],load(){return Ke(()=>import("./apl-B4CMkyY2.js"),[],import.meta.url).then(e=>pt(e.apl))}}),Ye.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return Ke(()=>import("./asciiarmor-Df11BRmG.js"),[],import.meta.url).then(e=>pt(e.asciiArmor))}}),Ye.of({name:"ASN.1",extensions:["asn","asn1"],load(){return Ke(()=>import("./asn1-EdZsLKOL.js"),[],import.meta.url).then(e=>pt(e.asn1({})))}}),Ye.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return Ke(()=>import("./asterisk-B-8jnY81.js"),[],import.meta.url).then(e=>pt(e.asterisk))}}),Ye.of({name:"Brainfuck",extensions:["b","bf"],load(){return Ke(()=>import("./brainfuck-C4LP7Hcl.js"),[],import.meta.url).then(e=>pt(e.brainfuck))}}),Ye.of({name:"Cobol",extensions:["cob","cpy"],load(){return Ke(()=>import("./cobol-CWcv1MsR.js"),[],import.meta.url).then(e=>pt(e.cobol))}}),Ye.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.csharp))}}),Ye.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return Ke(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>pt(e.clojure))}}),Ye.of({name:"ClojureScript",extensions:["cljs"],load(){return Ke(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>pt(e.clojure))}}),Ye.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return Ke(()=>import("./css-BnMrqG3P.js"),[],import.meta.url).then(e=>pt(e.gss))}}),Ye.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return Ke(()=>import("./cmake-BQqOBYOt.js"),[],import.meta.url).then(e=>pt(e.cmake))}}),Ye.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return Ke(()=>import("./coffeescript-S37ZYGWr.js"),[],import.meta.url).then(e=>pt(e.coffeeScript))}}),Ye.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return Ke(()=>import("./commonlisp-DBKNyK5s.js"),[],import.meta.url).then(e=>pt(e.commonLisp))}}),Ye.of({name:"Cypher",extensions:["cyp","cypher"],load(){return Ke(()=>import("./cypher-C_CwsFkJ.js"),[],import.meta.url).then(e=>pt(e.cypher))}}),Ye.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return Ke(()=>import("./python-BuPzkPfP.js"),[],import.meta.url).then(e=>pt(e.cython))}}),Ye.of({name:"Crystal",extensions:["cr"],load(){return Ke(()=>import("./crystal-SjHAIU92.js"),[],import.meta.url).then(e=>pt(e.crystal))}}),Ye.of({name:"D",extensions:["d"],load(){return Ke(()=>import("./d-pRatUO7H.js"),[],import.meta.url).then(e=>pt(e.d))}}),Ye.of({name:"Dart",extensions:["dart"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.dart))}}),Ye.of({name:"diff",extensions:["diff","patch"],load(){return Ke(()=>import("./diff-DbItnlRl.js"),[],import.meta.url).then(e=>pt(e.diff))}}),Ye.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return Ke(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([15,16]),import.meta.url).then(e=>pt(e.dockerFile))}}),Ye.of({name:"DTD",extensions:["dtd"],load(){return Ke(()=>import("./dtd-DF_7sFjM.js"),[],import.meta.url).then(e=>pt(e.dtd))}}),Ye.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return Ke(()=>import("./dylan-DwRh75JA.js"),[],import.meta.url).then(e=>pt(e.dylan))}}),Ye.of({name:"EBNF",load(){return Ke(()=>import("./ebnf-CDyGwa7X.js"),[],import.meta.url).then(e=>pt(e.ebnf))}}),Ye.of({name:"ECL",extensions:["ecl"],load(){return Ke(()=>import("./ecl-Cabwm37j.js"),[],import.meta.url).then(e=>pt(e.ecl))}}),Ye.of({name:"edn",extensions:["edn"],load(){return Ke(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>pt(e.clojure))}}),Ye.of({name:"Eiffel",extensions:["e"],load(){return Ke(()=>import("./eiffel-CnydiIhH.js"),[],import.meta.url).then(e=>pt(e.eiffel))}}),Ye.of({name:"Elm",extensions:["elm"],load(){return Ke(()=>import("./elm-vLlmbW-K.js"),[],import.meta.url).then(e=>pt(e.elm))}}),Ye.of({name:"Erlang",extensions:["erl"],load(){return Ke(()=>import("./erlang-BNw1qcRV.js"),[],import.meta.url).then(e=>pt(e.erlang))}}),Ye.of({name:"Esper",load(){return Ke(()=>import("./sql-D0XecflT.js"),[],import.meta.url).then(e=>pt(e.esper))}}),Ye.of({name:"Factor",extensions:["factor"],load(){return Ke(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([17,16]),import.meta.url).then(e=>pt(e.factor))}}),Ye.of({name:"FCL",load(){return Ke(()=>import("./fcl-Kvtd6kyn.js"),[],import.meta.url).then(e=>pt(e.fcl))}}),Ye.of({name:"Forth",extensions:["forth","fth","4th"],load(){return Ke(()=>import("./forth-Ffai-XNe.js"),[],import.meta.url).then(e=>pt(e.forth))}}),Ye.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return Ke(()=>import("./fortran-DYz_wnZ1.js"),[],import.meta.url).then(e=>pt(e.fortran))}}),Ye.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return Ke(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>pt(e.fSharp))}}),Ye.of({name:"Gas",extensions:["s"],load(){return Ke(()=>import("./gas-Bneqetm1.js"),[],import.meta.url).then(e=>pt(e.gas))}}),Ye.of({name:"Gherkin",extensions:["feature"],load(){return Ke(()=>import("./gherkin-heZmZLOM.js"),[],import.meta.url).then(e=>pt(e.gherkin))}}),Ye.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return Ke(()=>import("./groovy-D9Dt4D0W.js"),[],import.meta.url).then(e=>pt(e.groovy))}}),Ye.of({name:"Haskell",extensions:["hs"],load(){return Ke(()=>import("./haskell-Cw1EW3IL.js"),[],import.meta.url).then(e=>pt(e.haskell))}}),Ye.of({name:"Haxe",extensions:["hx"],load(){return Ke(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>pt(e.haxe))}}),Ye.of({name:"HXML",extensions:["hxml"],load(){return Ke(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>pt(e.hxml))}}),Ye.of({name:"HTTP",load(){return Ke(()=>import("./http-DBlCnlav.js"),[],import.meta.url).then(e=>pt(e.http))}}),Ye.of({name:"IDL",extensions:["pro"],load(){return Ke(()=>import("./idl-BEugSyMb.js"),[],import.meta.url).then(e=>pt(e.idl))}}),Ye.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return Ke(()=>import("./javascript-iXu5QeM3.js"),[],import.meta.url).then(e=>pt(e.jsonld))}}),Ye.of({name:"Julia",extensions:["jl"],load(){return Ke(()=>import("./julia-DuME0IfC.js"),[],import.meta.url).then(e=>pt(e.julia))}}),Ye.of({name:"Kotlin",extensions:["kt","kts"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.kotlin))}}),Ye.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return Ke(()=>import("./livescript-BwQOo05w.js"),[],import.meta.url).then(e=>pt(e.liveScript))}}),Ye.of({name:"Lua",extensions:["lua"],load(){return Ke(()=>import("./lua-BgMRiT3U.js"),[],import.meta.url).then(e=>pt(e.lua))}}),Ye.of({name:"mIRC",extensions:["mrc"],load(){return Ke(()=>import("./mirc-CjQqDB4T.js"),[],import.meta.url).then(e=>pt(e.mirc))}}),Ye.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return Ke(()=>import("./mathematica-DTrFuWx2.js"),[],import.meta.url).then(e=>pt(e.mathematica))}}),Ye.of({name:"Modelica",extensions:["mo"],load(){return Ke(()=>import("./modelica-Dc1JOy9r.js"),[],import.meta.url).then(e=>pt(e.modelica))}}),Ye.of({name:"MUMPS",extensions:["mps"],load(){return Ke(()=>import("./mumps-BT43cFF4.js"),[],import.meta.url).then(e=>pt(e.mumps))}}),Ye.of({name:"Mbox",extensions:["mbox"],load(){return Ke(()=>import("./mbox-CNhZ1qSd.js"),[],import.meta.url).then(e=>pt(e.mbox))}}),Ye.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return Ke(()=>import("./nginx-DdIZxoE0.js"),[],import.meta.url).then(e=>pt(e.nginx))}}),Ye.of({name:"NSIS",extensions:["nsh","nsi"],load(){return Ke(()=>import("./nsis-LdVXkNf5.js"),__vite__mapDeps([18,16]),import.meta.url).then(e=>pt(e.nsis))}}),Ye.of({name:"NTriples",extensions:["nt","nq"],load(){return Ke(()=>import("./ntriples-BfvgReVJ.js"),[],import.meta.url).then(e=>pt(e.ntriples))}}),Ye.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.objectiveC))}}),Ye.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.objectiveCpp))}}),Ye.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return Ke(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>pt(e.oCaml))}}),Ye.of({name:"Octave",extensions:["m"],load(){return Ke(()=>import("./octave-Ck1zUtKM.js"),[],import.meta.url).then(e=>pt(e.octave))}}),Ye.of({name:"Oz",extensions:["oz"],load(){return Ke(()=>import("./oz-BzwKVEFT.js"),[],import.meta.url).then(e=>pt(e.oz))}}),Ye.of({name:"Pascal",extensions:["p","pas"],load(){return Ke(()=>import("./pascal--L3eBynH.js"),[],import.meta.url).then(e=>pt(e.pascal))}}),Ye.of({name:"Perl",extensions:["pl","pm"],load(){return Ke(()=>import("./perl-CdXCOZ3F.js"),[],import.meta.url).then(e=>pt(e.perl))}}),Ye.of({name:"Pig",extensions:["pig"],load(){return Ke(()=>import("./pig-CevX1Tat.js"),[],import.meta.url).then(e=>pt(e.pig))}}),Ye.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return Ke(()=>import("./powershell-CaxLzxiJ.js"),[],import.meta.url).then(e=>pt(e.powerShell))}}),Ye.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return Ke(()=>import("./properties-C78fOPTZ.js"),[],import.meta.url).then(e=>pt(e.properties))}}),Ye.of({name:"ProtoBuf",extensions:["proto"],load(){return Ke(()=>import("./protobuf-ChK-085T.js"),[],import.meta.url).then(e=>pt(e.protobuf))}}),Ye.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return Ke(()=>import("./pug-DeIclll2.js"),__vite__mapDeps([19,20]),import.meta.url).then(e=>pt(e.pug))}}),Ye.of({name:"Puppet",extensions:["pp"],load(){return Ke(()=>import("./puppet-DMA9R1ak.js"),[],import.meta.url).then(e=>pt(e.puppet))}}),Ye.of({name:"Q",extensions:["q"],load(){return Ke(()=>import("./q-pXgVlZs6.js"),[],import.meta.url).then(e=>pt(e.q))}}),Ye.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return Ke(()=>import("./r-B6wPVr8A.js"),[],import.meta.url).then(e=>pt(e.r))}}),Ye.of({name:"RPM Changes",load(){return Ke(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>pt(e.rpmChanges))}}),Ye.of({name:"RPM Spec",extensions:["spec"],load(){return Ke(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>pt(e.rpmSpec))}}),Ye.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return Ke(()=>import("./ruby-B2Rjki9n.js"),[],import.meta.url).then(e=>pt(e.ruby))}}),Ye.of({name:"SAS",extensions:["sas"],load(){return Ke(()=>import("./sas-B4kiWyti.js"),[],import.meta.url).then(e=>pt(e.sas))}}),Ye.of({name:"Scala",extensions:["scala"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.scala))}}),Ye.of({name:"Scheme",extensions:["scm","ss"],load(){return Ke(()=>import("./scheme-C41bIUwD.js"),[],import.meta.url).then(e=>pt(e.scheme))}}),Ye.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return Ke(()=>import("./shell-CjFT_Tl9.js"),[],import.meta.url).then(e=>pt(e.shell))}}),Ye.of({name:"Sieve",extensions:["siv","sieve"],load(){return Ke(()=>import("./sieve-C3Gn_uJK.js"),[],import.meta.url).then(e=>pt(e.sieve))}}),Ye.of({name:"Smalltalk",extensions:["st"],load(){return Ke(()=>import("./smalltalk-CnHTOXQT.js"),[],import.meta.url).then(e=>pt(e.smalltalk))}}),Ye.of({name:"Solr",load(){return Ke(()=>import("./solr-DehyRSwq.js"),[],import.meta.url).then(e=>pt(e.solr))}}),Ye.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return Ke(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>pt(e.sml))}}),Ye.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return Ke(()=>import("./sparql-DkYu6x3z.js"),[],import.meta.url).then(e=>pt(e.sparql))}}),Ye.of({name:"Spreadsheet",alias:["excel","formula"],load(){return Ke(()=>import("./spreadsheet-BCZA_wO0.js"),[],import.meta.url).then(e=>pt(e.spreadsheet))}}),Ye.of({name:"Squirrel",extensions:["nut"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.squirrel))}}),Ye.of({name:"Stylus",extensions:["styl"],load(){return Ke(()=>import("./stylus-B533Al4x.js"),[],import.meta.url).then(e=>pt(e.stylus))}}),Ye.of({name:"Swift",extensions:["swift"],load(){return Ke(()=>import("./swift-BzpIVaGY.js"),[],import.meta.url).then(e=>pt(e.swift))}}),Ye.of({name:"sTeX",load(){return Ke(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>pt(e.stex))}}),Ye.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return Ke(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>pt(e.stex))}}),Ye.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return Ke(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>pt(e.verilog))}}),Ye.of({name:"Tcl",extensions:["tcl"],load(){return Ke(()=>import("./tcl-DVfN8rqt.js"),[],import.meta.url).then(e=>pt(e.tcl))}}),Ye.of({name:"Textile",extensions:["textile"],load(){return Ke(()=>import("./textile-CnDTJFAw.js"),[],import.meta.url).then(e=>pt(e.textile))}}),Ye.of({name:"TiddlyWiki",load(){return Ke(()=>import("./tiddlywiki-DO-Gjzrf.js"),[],import.meta.url).then(e=>pt(e.tiddlyWiki))}}),Ye.of({name:"Tiki wiki",load(){return Ke(()=>import("./tiki-DGYXhP31.js"),[],import.meta.url).then(e=>pt(e.tiki))}}),Ye.of({name:"TOML",extensions:["toml"],load(){return Ke(()=>import("./toml-Bm5Em-hy.js"),[],import.meta.url).then(e=>pt(e.toml))}}),Ye.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return Ke(()=>import("./troff-wAsdV37c.js"),[],import.meta.url).then(e=>pt(e.troff))}}),Ye.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return Ke(()=>import("./ttcn-CfJYG6tj.js"),[],import.meta.url).then(e=>pt(e.ttcn))}}),Ye.of({name:"TTCN_CFG",extensions:["cfg"],load(){return Ke(()=>import("./ttcn-cfg-B9xdYoR4.js"),[],import.meta.url).then(e=>pt(e.ttcnCfg))}}),Ye.of({name:"Turtle",extensions:["ttl"],load(){return Ke(()=>import("./turtle-B1tBg_DP.js"),[],import.meta.url).then(e=>pt(e.turtle))}}),Ye.of({name:"Web IDL",extensions:["webidl"],load(){return Ke(()=>import("./webidl-ZXfAyPTL.js"),[],import.meta.url).then(e=>pt(e.webIDL))}}),Ye.of({name:"VB.NET",extensions:["vb"],load(){return Ke(()=>import("./vb-CmGdzxic.js"),[],import.meta.url).then(e=>pt(e.vb))}}),Ye.of({name:"VBScript",extensions:["vbs"],load(){return Ke(()=>import("./vbscript-BuJXcnF6.js"),[],import.meta.url).then(e=>pt(e.vbScript))}}),Ye.of({name:"Velocity",extensions:["vtl"],load(){return Ke(()=>import("./velocity-D8B20fx6.js"),[],import.meta.url).then(e=>pt(e.velocity))}}),Ye.of({name:"Verilog",extensions:["v"],load(){return Ke(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>pt(e.verilog))}}),Ye.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return Ke(()=>import("./vhdl-lSbBsy5d.js"),[],import.meta.url).then(e=>pt(e.vhdl))}}),Ye.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return Ke(()=>import("./xquery-DzFWVndE.js"),[],import.meta.url).then(e=>pt(e.xQuery))}}),Ye.of({name:"Yacas",extensions:["ys"],load(){return Ke(()=>import("./yacas-BJ4BC0dw.js"),[],import.meta.url).then(e=>pt(e.yacas))}}),Ye.of({name:"Z80",extensions:["z80"],load(){return Ke(()=>import("./z80-Hz9HOZM7.js"),[],import.meta.url).then(e=>pt(e.z80))}}),Ye.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return Ke(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>pt(e.mscgen))}}),Ye.of({name:"Xù",extensions:["xu"],load(){return Ke(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>pt(e.xu))}}),Ye.of({name:"MsGenny",extensions:["msgenny"],load(){return Ke(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>pt(e.msgenny))}}),Ye.of({name:"Vue",extensions:["vue"],load(){return Ke(()=>import("./index-PowZIEy3.js"),__vite__mapDeps([21,1]),import.meta.url).then(e=>e.vue())}}),Ye.of({name:"Angular Template",load(){return Ke(()=>import("./index-DL_YojVu.js"),__vite__mapDeps([22,1]),import.meta.url).then(e=>e.angular())}})];function vx(){return vx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vx.apply(null,arguments)}var kWt=e=>{var{theme:t,settings:r={},styles:n=[]}=e,s={".cm-gutters":{}},a={};r.background&&(a.backgroundColor=r.background),r.backgroundImage&&(a.backgroundImage=r.backgroundImage),r.foreground&&(a.color=r.foreground),r.fontSize&&(a.fontSize=r.fontSize),(r.background||r.foreground)&&(s["&"]=a),r.fontFamily&&(s["&.cm-editor .cm-scroller"]={fontFamily:r.fontFamily}),r.gutterBackground&&(s[".cm-gutters"].backgroundColor=r.gutterBackground),r.gutterForeground&&(s[".cm-gutters"].color=r.gutterForeground),r.gutterBorder&&(s[".cm-gutters"].borderRightColor=r.gutterBorder),r.caret&&(s[".cm-content"]={caretColor:r.caret},s[".cm-cursor, .cm-dropCursor"]={borderLeftColor:r.caret});var i={};r.gutterActiveForeground&&(i.color=r.gutterActiveForeground),r.lineHighlight&&(s[".cm-activeLine"]={backgroundColor:r.lineHighlight},i.backgroundColor=r.lineHighlight),s[".cm-activeLineGutter"]=i,r.selection&&(s["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:r.selection+" !important"}),r.selectionMatch&&(s["& .cm-selectionMatch"]={backgroundColor:r.selectionMatch});var l=ft.theme(s,{dark:t==="dark"}),c=Pp.define(n),u=[l,Wx(c)];return u},_Wt={background:"#282a36",foreground:"#f8f8f2",caret:"#f8f8f0",selection:"rgba(255, 255, 255, 0.1)",selectionMatch:"rgba(255, 255, 255, 0.2)",gutterBackground:"#282a36",gutterForeground:"#6D8A88",gutterBorder:"transparent",lineHighlight:"rgba(255, 255, 255, 0.1)"},EWt=[{tag:ne.comment,color:"#6272a4"},{tag:ne.string,color:"#f1fa8c"},{tag:ne.atom,color:"#bd93f9"},{tag:ne.meta,color:"#f8f8f2"},{tag:[ne.keyword,ne.operator,ne.tagName],color:"#ff79c6"},{tag:[ne.function(ne.propertyName),ne.propertyName],color:"#66d9ef"},{tag:[ne.definition(ne.variableName),ne.function(ne.variableName),ne.className,ne.attributeName],color:"#50fa7b"},{tag:ne.atom,color:"#bd93f9"}],VE=e=>{var{theme:t="dark",settings:r={},styles:n=[]}=e||{};return kWt({theme:t,settings:vx({},_Wt,r),styles:[...EWt,...n]})};VE();function Wue(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}const CWt=e=>{let{state:t}=e,r=t.doc.lineAt(t.selection.main.from),n=Zue(e.state,r.from);return n.line?jWt(e):n.block?NWt(e):!1};function Gue(e,t){return({state:r,dispatch:n})=>{if(r.readOnly)return!1;let s=e(t,r);return s?(n(r.update(s)),!0):!1}}const jWt=Gue(RWt,0),TWt=Gue(xZe,0),NWt=Gue((e,t)=>xZe(e,t,IWt(t)),0);function Zue(e,t){let r=e.languageDataAt("commentTokens",t,1);return r.length?r[0]:{}}const Mj=50;function AWt(e,{open:t,close:r},n,s){let a=e.sliceDoc(n-Mj,n),i=e.sliceDoc(s,s+Mj),l=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(i)[0].length,u=a.length-l;if(a.slice(u-t.length,u)==t&&i.slice(c,c+r.length)==r)return{open:{pos:n-l,margin:l&&1},close:{pos:s+c,margin:c&&1}};let d,f;s-n<=2*Mj?d=f=e.sliceDoc(n,s):(d=e.sliceDoc(n,n+Mj),f=e.sliceDoc(s-Mj,s));let h=/^\s*/.exec(d)[0].length,p=/\s*$/.exec(f)[0].length,m=f.length-p-r.length;return d.slice(h,h+t.length)==t&&f.slice(m,m+r.length)==r?{open:{pos:n+h+t.length,margin:/\s/.test(d.charAt(h+t.length))?1:0},close:{pos:s-p-r.length,margin:/\s/.test(f.charAt(m-1))?1:0}}:null}function IWt(e){let t=[];for(let r of e.selection.ranges){let n=e.doc.lineAt(r.from),s=r.to<=n.to?n:e.doc.lineAt(r.to);s.from>n.from&&s.from==r.to&&(s=r.to==n.to+1?n:e.doc.lineAt(r.to-1));let a=t.length-1;a>=0&&t[a].to>n.from?t[a].to=s.to:t.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:s.to})}return t}function xZe(e,t,r=t.selection.ranges){let n=r.map(a=>Zue(t,a.from).block);if(!n.every(a=>a))return null;let s=r.map((a,i)=>AWt(t,n[i],a.from,a.to));if(e!=2&&!s.every(a=>a))return{changes:t.changes(r.map((a,i)=>s[i]?[]:[{from:a.from,insert:n[i].open+" "},{from:a.to,insert:" "+n[i].close}]))};if(e!=1&&s.some(a=>a)){let a=[];for(let i=0,l;i<s.length;i++)if(l=s[i]){let c=n[i],{open:u,close:d}=l;a.push({from:u.pos-c.open.length,to:u.pos+u.margin},{from:d.pos-d.margin,to:d.pos+c.close.length})}return{changes:a}}return null}function RWt(e,t,r=t.selection.ranges){let n=[],s=-1;e:for(let{from:a,to:i}of r){let l=n.length,c=1e9,u;for(let d=a;d<=i;){let f=t.doc.lineAt(d);if(u==null&&(u=Zue(t,f.from).line,!u))continue e;if(f.from>s&&(a==i||i>f.from)){s=f.from;let h=/^\s*/.exec(f.text)[0].length,p=h==f.length,m=f.text.slice(h,h+u.length)==u?h:-1;h<f.text.length&&h<c&&(c=h),n.push({line:f,comment:m,token:u,indent:h,empty:p,single:!1})}d=f.to+1}if(c<1e9)for(let d=l;d<n.length;d++)n[d].indent<n[d].line.text.length&&(n[d].indent=c);n.length==l+1&&(n[l].single=!0)}if(e!=2&&n.some(a=>a.comment<0&&(!a.empty||a.single))){let a=[];for(let{line:l,token:c,indent:u,empty:d,single:f}of n)(f||!d)&&a.push({from:l.from+u,insert:c+" "});let i=t.changes(a);return{changes:i,selection:t.selection.map(i,1)}}else if(e!=1&&n.some(a=>a.comment>=0)){let a=[];for(let{line:i,comment:l,token:c}of n)if(l>=0){let u=i.from+l,d=u+c.length;i.text[d-i.from]==" "&&d++,a.push({from:u,to:d})}return{changes:a}}return null}const sse=pg.define(),PWt=pg.define(),MWt=Kt.define(),wZe=Kt.define({combine(e){return mg(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,r)=>r},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,r)=>(n,s)=>t(n,s)||r(n,s)})}}),SZe=Oo.define({create(){return Nm.empty},update(e,t){let r=t.state.facet(wZe),n=t.annotation(sse);if(n){let c=Lu.fromTransaction(t,n.selection),u=n.side,d=u==0?e.undone:e.done;return c?d=Y3(d,d.length,r.minDepth,c):d=_Ze(d,t.startState.selection),new Nm(u==0?n.rest:d,u==0?d:n.rest)}let s=t.annotation(PWt);if((s=="full"||s=="before")&&(e=e.isolate()),t.annotation(Mo.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=Lu.fromTransaction(t),i=t.annotation(Mo.time),l=t.annotation(Mo.userEvent);return a?e=e.addChanges(a,i,l,r,t):t.selection&&(e=e.addSelection(t.startState.selection,i,l,r.newGroupDelay)),(s=="full"||s=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new Nm(e.done.map(Lu.fromJSON),e.undone.map(Lu.fromJSON))}});function DWt(e={}){return[SZe,wZe.of(e),ft.domEventHandlers({beforeinput(t,r){let n=t.inputType=="historyUndo"?OZe:t.inputType=="historyRedo"?ase:null;return n?(t.preventDefault(),n(r)):!1}})]}function UF(e,t){return function({state:r,dispatch:n}){if(!t&&r.readOnly)return!1;let s=r.field(SZe,!1);if(!s)return!1;let a=s.pop(e,r,t);return a?(n(a),!0):!1}}const OZe=UF(0,!1),ase=UF(1,!1),LWt=UF(0,!0),$Wt=UF(1,!0);class Lu{constructor(t,r,n,s,a){this.changes=t,this.effects=r,this.mapped=n,this.startSelection=s,this.selectionsAfter=a}setSelAfter(t){return new Lu(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,r,n;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(r=this.mapped)===null||r===void 0?void 0:r.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(t){return new Lu(t.changes&&Io.fromJSON(t.changes),[],t.mapped&&Vm.fromJSON(t.mapped),t.startSelection&&nt.fromJSON(t.startSelection),t.selectionsAfter.map(nt.fromJSON))}static fromTransaction(t,r){let n=oh;for(let s of t.startState.facet(MWt)){let a=s(t);a.length&&(n=n.concat(a))}return!n.length&&t.changes.empty?null:new Lu(t.changes.invert(t.startState.doc),n,void 0,r||t.startState.selection,oh)}static selection(t){return new Lu(void 0,oh,void 0,void 0,t)}}function Y3(e,t,r,n){let s=t+1>r+20?t-r-1:0,a=e.slice(s,t);return a.push(n),a}function FWt(e,t){let r=[],n=!1;return e.iterChangedRanges((s,a)=>r.push(s,a)),t.iterChangedRanges((s,a,i,l)=>{for(let c=0;c<r.length;){let u=r[c++],d=r[c++];l>=u&&i<=d&&(n=!0)}}),n}function zWt(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((r,n)=>r.empty!=t.ranges[n].empty).length===0}function kZe(e,t){return e.length?t.length?e.concat(t):e:t}const oh=[],BWt=200;function _Ze(e,t){if(e.length){let r=e[e.length-1],n=r.selectionsAfter.slice(Math.max(0,r.selectionsAfter.length-BWt));return n.length&&n[n.length-1].eq(t)?e:(n.push(t),Y3(e,e.length-1,1e9,r.setSelAfter(n)))}else return[Lu.selection([t])]}function UWt(e){let t=e[e.length-1],r=e.slice();return r[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),r}function wV(e,t){if(!e.length)return e;let r=e.length,n=oh;for(;r;){let s=VWt(e[r-1],t,n);if(s.changes&&!s.changes.empty||s.effects.length){let a=e.slice(0,r);return a[r-1]=s,a}else t=s.mapped,r--,n=s.selectionsAfter}return n.length?[Lu.selection(n)]:oh}function VWt(e,t,r){let n=kZe(e.selectionsAfter.length?e.selectionsAfter.map(l=>l.map(t)):oh,r);if(!e.changes)return Lu.selection(n);let s=e.changes.map(t),a=t.mapDesc(e.changes,!0),i=e.mapped?e.mapped.composeDesc(a):a;return new Lu(s,rn.mapEffects(e.effects,t),i,e.startSelection.map(a),n)}const qWt=/^(input\.type|delete)($|\.)/;class Nm{constructor(t,r,n=0,s=void 0){this.done=t,this.undone=r,this.prevTime=n,this.prevUserEvent=s}isolate(){return this.prevTime?new Nm(this.done,this.undone):this}addChanges(t,r,n,s,a){let i=this.done,l=i[i.length-1];return l&&l.changes&&!l.changes.empty&&t.changes&&(!n||qWt.test(n))&&(!l.selectionsAfter.length&&r-this.prevTime<s.newGroupDelay&&s.joinToEvent(a,FWt(l.changes,t.changes))||n=="input.type.compose")?i=Y3(i,i.length-1,s.minDepth,new Lu(t.changes.compose(l.changes),kZe(rn.mapEffects(t.effects,l.changes),l.effects),l.mapped,l.startSelection,oh)):i=Y3(i,i.length,s.minDepth,t),new Nm(i,oh,r,n)}addSelection(t,r,n,s){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:oh;return a.length>0&&r-this.prevTime<s&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&zWt(a[a.length-1],t)?this:new Nm(_Ze(this.done,t),this.undone,r,n)}addMapping(t){return new Nm(wV(this.done,t),wV(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,r,n){let s=t==0?this.done:this.undone;if(s.length==0)return null;let a=s[s.length-1],i=a.selectionsAfter[0]||(a.startSelection?a.startSelection.map(a.changes.invertedDesc,1):r.selection);if(n&&a.selectionsAfter.length)return r.update({selection:a.selectionsAfter[a.selectionsAfter.length-1],annotations:sse.of({side:t,rest:UWt(s),selection:i}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(a.changes){let l=s.length==1?oh:s.slice(0,s.length-1);return a.mapped&&(l=wV(l,a.mapped)),r.update({changes:a.changes,selection:a.startSelection,effects:a.effects,annotations:sse.of({side:t,rest:l,selection:i}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}Nm.empty=new Nm(oh,oh);const HWt=[{key:"Mod-z",run:OZe,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:ase,preventDefault:!0},{linux:"Ctrl-Shift-z",run:ase,preventDefault:!0},{key:"Mod-u",run:LWt,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:$Wt,preventDefault:!0}];function qE(e,t){return nt.create(e.ranges.map(t),e.mainIndex)}function Mp(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function Dp({state:e,dispatch:t},r){let n=qE(e.selection,r);return n.eq(e.selection,!0)?!1:(t(Mp(e,n)),!0)}function VF(e,t){return nt.cursor(t?e.to:e.from)}function EZe(e,t){return Dp(e,r=>r.empty?e.moveByChar(r,t):VF(r,t))}function kc(e){return e.textDirectionAt(e.state.selection.main.head)==$a.LTR}const CZe=e=>EZe(e,!kc(e)),jZe=e=>EZe(e,kc(e));function TZe(e,t){return Dp(e,r=>r.empty?e.moveByGroup(r,t):VF(r,t))}const QWt=e=>TZe(e,!kc(e)),WWt=e=>TZe(e,kc(e));function GWt(e,t,r){if(t.type.prop(r))return!0;let n=t.to-t.from;return n&&(n>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function qF(e,t,r){let n=Ra(e).resolveInner(t.head),s=r?pn.closedBy:pn.openedBy;for(let c=t.head;;){let u=r?n.childAfter(c):n.childBefore(c);if(!u)break;GWt(e,u,s)?n=u:c=r?u.to:u.from}let a=n.type.prop(s),i,l;return a&&(i=r?Tm(e,n.from,1):Tm(e,n.to,-1))&&i.matched?l=r?i.end.to:i.end.from:l=r?n.to:n.from,nt.cursor(l,r?-1:1)}const ZWt=e=>Dp(e,t=>qF(e.state,t,!kc(e))),YWt=e=>Dp(e,t=>qF(e.state,t,kc(e)));function NZe(e,t){return Dp(e,r=>{if(!r.empty)return VF(r,t);let n=e.moveVertically(r,t);return n.head!=r.head?n:e.moveToLineBoundary(r,t)})}const AZe=e=>NZe(e,!1),IZe=e=>NZe(e,!0);function RZe(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,r=0,n=0,s;if(t){for(let a of e.state.facet(ft.scrollMargins)){let i=a(e);i?.top&&(r=Math.max(i?.top,r)),i?.bottom&&(n=Math.max(i?.bottom,n))}s=e.scrollDOM.clientHeight-r-n}else s=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:r,marginBottom:n,selfScroll:t,height:Math.max(e.defaultLineHeight,s-5)}}function PZe(e,t){let r=RZe(e),{state:n}=e,s=qE(n.selection,i=>i.empty?e.moveVertically(i,t,r.height):VF(i,t));if(s.eq(n.selection))return!1;let a;if(r.selfScroll){let i=e.coordsAtPos(n.selection.main.head),l=e.scrollDOM.getBoundingClientRect(),c=l.top+r.marginTop,u=l.bottom-r.marginBottom;i&&i.top>c&&i.bottom<u&&(a=ft.scrollIntoView(s.main.head,{y:"start",yMargin:i.top-c}))}return e.dispatch(Mp(n,s),{effects:a}),!0}const Fke=e=>PZe(e,!1),ise=e=>PZe(e,!0);function Gx(e,t,r){let n=e.lineBlockAt(t.head),s=e.moveToLineBoundary(t,r);if(s.head==t.head&&s.head!=(r?n.to:n.from)&&(s=e.moveToLineBoundary(t,r,!1)),!r&&s.head==n.from&&n.length){let a=/^\s*/.exec(e.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;a&&t.head!=n.from+a&&(s=nt.cursor(n.from+a))}return s}const XWt=e=>Dp(e,t=>Gx(e,t,!0)),KWt=e=>Dp(e,t=>Gx(e,t,!1)),JWt=e=>Dp(e,t=>Gx(e,t,!kc(e))),eGt=e=>Dp(e,t=>Gx(e,t,kc(e))),tGt=e=>Dp(e,t=>nt.cursor(e.lineBlockAt(t.head).from,1)),rGt=e=>Dp(e,t=>nt.cursor(e.lineBlockAt(t.head).to,-1));function nGt(e,t,r){let n=!1,s=qE(e.selection,a=>{let i=Tm(e,a.head,-1)||Tm(e,a.head,1)||a.head>0&&Tm(e,a.head-1,1)||a.head<e.doc.length&&Tm(e,a.head+1,-1);if(!i||!i.end)return a;n=!0;let l=i.start.from==a.head?i.end.to:i.end.from;return nt.cursor(l)});return n?(t(Mp(e,s)),!0):!1}const sGt=({state:e,dispatch:t})=>nGt(e,t);function Ph(e,t){let r=qE(e.state.selection,n=>{let s=t(n);return nt.range(n.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return r.eq(e.state.selection)?!1:(e.dispatch(Mp(e.state,r)),!0)}function MZe(e,t){return Ph(e,r=>e.moveByChar(r,t))}const DZe=e=>MZe(e,!kc(e)),LZe=e=>MZe(e,kc(e));function $Ze(e,t){return Ph(e,r=>e.moveByGroup(r,t))}const aGt=e=>$Ze(e,!kc(e)),iGt=e=>$Ze(e,kc(e)),oGt=e=>Ph(e,t=>qF(e.state,t,!kc(e))),lGt=e=>Ph(e,t=>qF(e.state,t,kc(e)));function FZe(e,t){return Ph(e,r=>e.moveVertically(r,t))}const zZe=e=>FZe(e,!1),BZe=e=>FZe(e,!0);function UZe(e,t){return Ph(e,r=>e.moveVertically(r,t,RZe(e).height))}const zke=e=>UZe(e,!1),Bke=e=>UZe(e,!0),cGt=e=>Ph(e,t=>Gx(e,t,!0)),uGt=e=>Ph(e,t=>Gx(e,t,!1)),dGt=e=>Ph(e,t=>Gx(e,t,!kc(e))),fGt=e=>Ph(e,t=>Gx(e,t,kc(e))),hGt=e=>Ph(e,t=>nt.cursor(e.lineBlockAt(t.head).from)),pGt=e=>Ph(e,t=>nt.cursor(e.lineBlockAt(t.head).to)),Uke=({state:e,dispatch:t})=>(t(Mp(e,{anchor:0})),!0),Vke=({state:e,dispatch:t})=>(t(Mp(e,{anchor:e.doc.length})),!0),qke=({state:e,dispatch:t})=>(t(Mp(e,{anchor:e.selection.main.anchor,head:0})),!0),Hke=({state:e,dispatch:t})=>(t(Mp(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),mGt=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),gGt=({state:e,dispatch:t})=>{let r=HF(e).map(({from:n,to:s})=>nt.range(n,Math.min(s+1,e.doc.length)));return t(e.update({selection:nt.create(r),userEvent:"select"})),!0},yGt=({state:e,dispatch:t})=>{let r=qE(e.selection,n=>{let s=Ra(e),a=s.resolveStack(n.from,1);if(n.empty){let i=s.resolveStack(n.from,-1);i.node.from>=a.node.from&&i.node.to<=a.node.to&&(a=i)}for(let i=a;i;i=i.next){let{node:l}=i;if((l.from<n.from&&l.to>=n.to||l.to>n.to&&l.from<=n.from)&&i.next)return nt.range(l.to,l.from)}return n});return r.eq(e.selection)?!1:(t(Mp(e,r)),!0)};function VZe(e,t){let{state:r}=e,n=r.selection,s=r.selection.ranges.slice();for(let a of r.selection.ranges){let i=r.doc.lineAt(a.head);if(t?i.to<e.state.doc.length:i.from>0)for(let l=a;;){let c=e.moveVertically(l,t);if(c.head<i.from||c.head>i.to){s.some(u=>u.head==c.head)||s.push(c);break}else{if(c.head==l.head)break;l=c}}}return s.length==n.ranges.length?!1:(e.dispatch(Mp(r,nt.create(s,s.length-1))),!0)}const vGt=e=>VZe(e,!1),bGt=e=>VZe(e,!0),xGt=({state:e,dispatch:t})=>{let r=e.selection,n=null;return r.ranges.length>1?n=nt.create([r.main]):r.main.empty||(n=nt.create([nt.cursor(r.main.head)])),n?(t(Mp(e,n)),!0):!1};function qR(e,t){if(e.state.readOnly)return!1;let r="delete.selection",{state:n}=e,s=n.changeByRange(a=>{let{from:i,to:l}=a;if(i==l){let c=t(a);c<i?(r="delete.backward",c=nD(e,c,!1)):c>i&&(r="delete.forward",c=nD(e,c,!0)),i=Math.min(i,c),l=Math.max(l,c)}else i=nD(e,i,!1),l=nD(e,l,!0);return i==l?{range:a}:{changes:{from:i,to:l},range:nt.cursor(i,i<a.head?-1:1)}});return s.changes.empty?!1:(e.dispatch(n.update(s,{scrollIntoView:!0,userEvent:r,effects:r=="delete.selection"?ft.announce.of(n.phrase("Selection deleted")):void 0})),!0)}function nD(e,t,r){if(e instanceof ft)for(let n of e.state.facet(ft.atomicRanges).map(s=>s(e)))n.between(t,t,(s,a)=>{s<t&&a>t&&(t=r?a:s)});return t}const qZe=(e,t,r)=>qR(e,n=>{let s=n.from,{state:a}=e,i=a.doc.lineAt(s),l,c;if(r&&!t&&s>i.from&&s<i.from+200&&!/[^ \t]/.test(l=i.text.slice(0,s-i.from))){if(l[l.length-1]==" ")return s-1;let u=Sp(l,a.tabSize),d=u%cS(a)||cS(a);for(let f=0;f<d&&l[l.length-1-f]==" ";f++)s--;c=s}else c=yl(i.text,s-i.from,t,t)+i.from,c==s&&i.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(i.text.slice(c-i.from,s-i.from))&&(c=yl(i.text,c-i.from,!1,!1)+i.from);return c}),ose=e=>qZe(e,!1,!0),HZe=e=>qZe(e,!0,!1),QZe=(e,t)=>qR(e,r=>{let n=r.head,{state:s}=e,a=s.doc.lineAt(n),i=s.charCategorizer(n);for(let l=null;;){if(n==(t?a.to:a.from)){n==r.head&&a.number!=(t?s.doc.lines:1)&&(n+=t?1:-1);break}let c=yl(a.text,n-a.from,t)+a.from,u=a.text.slice(Math.min(n,c)-a.from,Math.max(n,c)-a.from),d=i(u);if(l!=null&&d!=l)break;(u!=" "||n!=r.head)&&(l=d),n=c}return n}),WZe=e=>QZe(e,!1),wGt=e=>QZe(e,!0),SGt=e=>qR(e,t=>{let r=e.lineBlockAt(t.head).to;return t.head<r?r:Math.min(e.state.doc.length,t.head+1)}),OGt=e=>qR(e,t=>{let r=e.moveToLineBoundary(t,!1).head;return t.head>r?r:Math.max(0,t.head-1)}),kGt=e=>qR(e,t=>{let r=e.moveToLineBoundary(t,!0).head;return t.head<r?r:Math.min(e.state.doc.length,t.head+1)}),_Gt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:Fs.of(["",""])},range:nt.cursor(n.from)}));return t(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0},EGt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(n=>{if(!n.empty||n.from==0||n.from==e.doc.length)return{range:n};let s=n.from,a=e.doc.lineAt(s),i=s==a.from?s-1:yl(a.text,s-a.from,!1)+a.from,l=s==a.to?s+1:yl(a.text,s-a.from,!0)+a.from;return{changes:{from:i,to:l,insert:e.doc.slice(s,l).append(e.doc.slice(i,s))},range:nt.cursor(l)}});return r.changes.empty?!1:(t(e.update(r,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function HF(e){let t=[],r=-1;for(let n of e.selection.ranges){let s=e.doc.lineAt(n.from),a=e.doc.lineAt(n.to);if(!n.empty&&n.to==a.from&&(a=e.doc.lineAt(n.to-1)),r>=s.number){let i=t[t.length-1];i.to=a.to,i.ranges.push(n)}else t.push({from:s.from,to:a.to,ranges:[n]});r=a.number+1}return t}function GZe(e,t,r){if(e.readOnly)return!1;let n=[],s=[];for(let a of HF(e)){if(r?a.to==e.doc.length:a.from==0)continue;let i=e.doc.lineAt(r?a.to+1:a.from-1),l=i.length+1;if(r){n.push({from:a.to,to:i.to},{from:a.from,insert:i.text+e.lineBreak});for(let c of a.ranges)s.push(nt.range(Math.min(e.doc.length,c.anchor+l),Math.min(e.doc.length,c.head+l)))}else{n.push({from:i.from,to:a.from},{from:a.to,insert:e.lineBreak+i.text});for(let c of a.ranges)s.push(nt.range(c.anchor-l,c.head-l))}}return n.length?(t(e.update({changes:n,scrollIntoView:!0,selection:nt.create(s,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const CGt=({state:e,dispatch:t})=>GZe(e,t,!1),jGt=({state:e,dispatch:t})=>GZe(e,t,!0);function ZZe(e,t,r){if(e.readOnly)return!1;let n=[];for(let a of HF(e))r?n.push({from:a.from,insert:e.doc.slice(a.from,a.to)+e.lineBreak}):n.push({from:a.to,insert:e.lineBreak+e.doc.slice(a.from,a.to)});let s=e.changes(n);return t(e.update({changes:s,selection:e.selection.map(s,r?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const TGt=({state:e,dispatch:t})=>ZZe(e,t,!1),NGt=({state:e,dispatch:t})=>ZZe(e,t,!0),AGt=e=>{if(e.state.readOnly)return!1;let{state:t}=e,r=t.changes(HF(t).map(({from:s,to:a})=>(s>0?s--:a<t.doc.length&&a++,{from:s,to:a}))),n=qE(t.selection,s=>{let a;if(e.lineWrapping){let i=e.lineBlockAt(s.head),l=e.coordsAtPos(s.head,s.assoc||1);l&&(a=i.bottom+e.documentTop-l.bottom+e.defaultLineHeight/2)}return e.moveVertically(s,!0,a)}).map(r);return e.dispatch({changes:r,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function IGt(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let r=Ra(e).resolveInner(t),n=r.childBefore(t),s=r.childAfter(t),a;return n&&s&&n.to<=t&&s.from>=t&&(a=n.type.prop(pn.closedBy))&&a.indexOf(s.name)>-1&&e.doc.lineAt(n.to).from==e.doc.lineAt(s.from).from&&!/\S/.test(e.sliceDoc(n.to,s.from))?{from:n.to,to:s.from}:null}const Qke=YZe(!1),RGt=YZe(!0);function YZe(e){return({state:t,dispatch:r})=>{if(t.readOnly)return!1;let n=t.changeByRange(s=>{let{from:a,to:i}=s,l=t.doc.lineAt(a),c=!e&&a==i&&IGt(t,a);e&&(a=i=(i<=l.to?l:t.doc.lineAt(i)).to);let u=new $F(t,{simulateBreak:a,simulateDoubleBreak:!!c}),d=gue(u,a);for(d==null&&(d=Sp(/^\s*/.exec(t.doc.lineAt(a).text)[0],t.tabSize));i<l.to&&/\s/.test(l.text[i-l.from]);)i++;c?{from:a,to:i}=c:a>l.from&&a<l.from+100&&!/\S/.test(l.text.slice(0,a))&&(a=l.from);let f=["",xA(t,d)];return c&&f.push(xA(t,u.lineIndent(l.from,-1))),{changes:{from:a,to:i,insert:Fs.of(f)},range:nt.cursor(a+1+f[1].length)}});return r(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}}function Yue(e,t){let r=-1;return e.changeByRange(n=>{let s=[];for(let i=n.from;i<=n.to;){let l=e.doc.lineAt(i);l.number>r&&(n.empty||n.to>l.from)&&(t(l,s,n),r=l.number),i=l.to+1}let a=e.changes(s);return{changes:s,range:nt.range(a.mapPos(n.anchor,1),a.mapPos(n.head,1))}})}const PGt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=Object.create(null),n=new $F(e,{overrideIndentation:a=>{let i=r[a];return i??-1}}),s=Yue(e,(a,i,l)=>{let c=gue(n,a.from);if(c==null)return;/\S/.test(a.text)||(c=0);let u=/^\s*/.exec(a.text)[0],d=xA(e,c);(u!=d||l.from<a.from+u.length)&&(r[a.from]=c,i.push({from:a.from,to:a.from+u.length,insert:d}))});return s.changes.empty||t(e.update(s,{userEvent:"indent"})),!0},XZe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Yue(e,(r,n)=>{n.push({from:r.from,insert:e.facet(BE)})}),{userEvent:"input.indent"})),!0),KZe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Yue(e,(r,n)=>{let s=/^\s*/.exec(r.text)[0];if(!s)return;let a=Sp(s,e.tabSize),i=0,l=xA(e,Math.max(0,a-cS(e)));for(;i<s.length&&i<l.length&&s.charCodeAt(i)==l.charCodeAt(i);)i++;n.push({from:r.from+i,to:r.from+s.length,insert:l.slice(i)})}),{userEvent:"delete.dedent"})),!0),MGt=e=>(e.setTabFocusMode(),!0),DGt=[{key:"Ctrl-b",run:CZe,shift:DZe,preventDefault:!0},{key:"Ctrl-f",run:jZe,shift:LZe},{key:"Ctrl-p",run:AZe,shift:zZe},{key:"Ctrl-n",run:IZe,shift:BZe},{key:"Ctrl-a",run:tGt,shift:hGt},{key:"Ctrl-e",run:rGt,shift:pGt},{key:"Ctrl-d",run:HZe},{key:"Ctrl-h",run:ose},{key:"Ctrl-k",run:SGt},{key:"Ctrl-Alt-h",run:WZe},{key:"Ctrl-o",run:_Gt},{key:"Ctrl-t",run:EGt},{key:"Ctrl-v",run:ise}],LGt=[{key:"ArrowLeft",run:CZe,shift:DZe,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:QWt,shift:aGt,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:JWt,shift:dGt,preventDefault:!0},{key:"ArrowRight",run:jZe,shift:LZe,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:WWt,shift:iGt,preventDefault:!0},{mac:"Cmd-ArrowRight",run:eGt,shift:fGt,preventDefault:!0},{key:"ArrowUp",run:AZe,shift:zZe,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Uke,shift:qke},{mac:"Ctrl-ArrowUp",run:Fke,shift:zke},{key:"ArrowDown",run:IZe,shift:BZe,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Vke,shift:Hke},{mac:"Ctrl-ArrowDown",run:ise,shift:Bke},{key:"PageUp",run:Fke,shift:zke},{key:"PageDown",run:ise,shift:Bke},{key:"Home",run:KWt,shift:uGt,preventDefault:!0},{key:"Mod-Home",run:Uke,shift:qke},{key:"End",run:XWt,shift:cGt,preventDefault:!0},{key:"Mod-End",run:Vke,shift:Hke},{key:"Enter",run:Qke,shift:Qke},{key:"Mod-a",run:mGt},{key:"Backspace",run:ose,shift:ose,preventDefault:!0},{key:"Delete",run:HZe,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:WZe,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:wGt,preventDefault:!0},{mac:"Mod-Backspace",run:OGt,preventDefault:!0},{mac:"Mod-Delete",run:kGt,preventDefault:!0}].concat(DGt.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),$Gt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:ZWt,shift:oGt},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:YWt,shift:lGt},{key:"Alt-ArrowUp",run:CGt},{key:"Shift-Alt-ArrowUp",run:TGt},{key:"Alt-ArrowDown",run:jGt},{key:"Shift-Alt-ArrowDown",run:NGt},{key:"Mod-Alt-ArrowUp",run:vGt},{key:"Mod-Alt-ArrowDown",run:bGt},{key:"Escape",run:xGt},{key:"Mod-Enter",run:RGt},{key:"Alt-l",mac:"Ctrl-l",run:gGt},{key:"Mod-i",run:yGt,preventDefault:!0},{key:"Mod-[",run:KZe},{key:"Mod-]",run:XZe},{key:"Mod-Alt-\\",run:PGt},{key:"Shift-Mod-k",run:AGt},{key:"Shift-Mod-\\",run:sGt},{key:"Mod-/",run:CWt},{key:"Alt-A",run:TWt},{key:"Ctrl-m",mac:"Shift-Alt-m",run:MGt}].concat(LGt),FGt={key:"Tab",run:XZe,shift:KZe},Wke=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class qy{constructor(t,r,n=0,s=t.length,a,i){this.test=i,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(n,s),this.bufferStart=n,this.normalize=a?l=>a(Wke(l)):Wke,this.query=this.normalize(r)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Nu(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let r=Xce(t),n=this.bufferStart+this.bufferPos;this.bufferPos+=vm(t);let s=this.normalize(r);if(s.length)for(let a=0,i=n;;a++){let l=s.charCodeAt(a),c=this.match(l,i,this.bufferPos+this.bufferStart);if(a==s.length-1){if(c)return this.value=c,this;break}i==n&&a<r.length&&r.charCodeAt(a)==l&&i++}}}match(t,r,n){let s=null;for(let a=0;a<this.matches.length;a+=2){let i=this.matches[a],l=!1;this.query.charCodeAt(i)==t&&(i==this.query.length-1?s={from:this.matches[a+1],to:n}:(this.matches[a]++,l=!0)),l||(this.matches.splice(a,2),a-=2)}return this.query.charCodeAt(0)==t&&(this.query.length==1?s={from:r,to:n}:this.matches.push(1,r)),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s}}typeof Symbol<"u"&&(qy.prototype[Symbol.iterator]=function(){return this});const JZe={from:-1,to:-1,match:/.*/.exec("")},Xue="gm"+(/x/.unicode==null?"":"u");class eYe{constructor(t,r,n,s=0,a=t.length){if(this.text=t,this.to=a,this.curLine="",this.done=!1,this.value=JZe,/\\[sWDnr]|\n|\r|\[\^/.test(r))return new tYe(t,r,n,s,a);this.re=new RegExp(r,Xue+(n?.ignoreCase?"i":"")),this.test=n?.test,this.iter=t.iter();let i=t.lineAt(s);this.curLineStart=i.from,this.matchPos=X3(t,s),this.getLine(this.curLineStart)}getLine(t){this.iter.next(t),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let r=this.matchPos<=this.to&&this.re.exec(this.curLine);if(r){let n=this.curLineStart+r.index,s=n+r[0].length;if(this.matchPos=X3(this.text,s+(n==s?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<s||n>this.value.to)&&(!this.test||this.test(n,s,r)))return this.value={from:n,to:s,match:r},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),t=0;else return this.done=!0,this}}}const SV=new WeakMap;class Bk{constructor(t,r){this.from=t,this.text=r}get to(){return this.from+this.text.length}static get(t,r,n){let s=SV.get(t);if(!s||s.from>=n||s.to<=r){let l=new Bk(r,t.sliceString(r,n));return SV.set(t,l),l}if(s.from==r&&s.to==n)return s;let{text:a,from:i}=s;return i>r&&(a=t.sliceString(r,i)+a,i=r),s.to<n&&(a+=t.sliceString(s.to,n)),SV.set(t,new Bk(i,a)),new Bk(r,a.slice(r-i,n-i))}}class tYe{constructor(t,r,n,s,a){this.text=t,this.to=a,this.done=!1,this.value=JZe,this.matchPos=X3(t,s),this.re=new RegExp(r,Xue+(n?.ignoreCase?"i":"")),this.test=n?.test,this.flat=Bk.get(t,s,this.chunkEnd(s+5e3))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,r=this.re.exec(this.flat.text);if(r&&!r[0]&&r.index==t&&(this.re.lastIndex=t+1,r=this.re.exec(this.flat.text)),r){let n=this.flat.from+r.index,s=n+r[0].length;if((this.flat.to>=this.to||r.index+r[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,s,r)))return this.value={from:n,to:s,match:r},this.matchPos=X3(this.text,s+(n==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Bk.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(eYe.prototype[Symbol.iterator]=tYe.prototype[Symbol.iterator]=function(){return this});function zGt(e){try{return new RegExp(e,Xue),!0}catch{return!1}}function X3(e,t){if(t>=e.length)return t;let r=e.lineAt(t),n;for(;t<r.to&&(n=r.text.charCodeAt(t-r.from))>=56320&&n<57344;)t++;return t}const BGt=e=>{let{state:t}=e,r=String(t.doc.lineAt(e.state.selection.main.head).number),{close:n,result:s}=CUt(e,{label:t.phrase("Go to line"),input:{type:"text",name:"line",value:r},focus:!0,submitLabel:t.phrase("go")});return s.then(a=>{let i=a&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(a.elements.line.value);if(!i){e.dispatch({effects:n});return}let l=t.doc.lineAt(t.selection.main.head),[,c,u,d,f]=i,h=d?+d.slice(1):0,p=u?+u:l.number;if(u&&f){let y=p/100;c&&(y=y*(c=="-"?-1:1)+l.number/t.doc.lines),p=Math.round(t.doc.lines*y)}else u&&c&&(p=p*(c=="-"?-1:1)+l.number);let m=t.doc.line(Math.max(1,Math.min(t.doc.lines,p))),g=nt.cursor(m.from+Math.max(0,Math.min(h,m.length)));e.dispatch({effects:[n,ft.scrollIntoView(g.from,{y:"center"})],selection:g})}),!0},UGt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},VGt=Kt.define({combine(e){return mg(e,UGt,{highlightWordAroundCursor:(t,r)=>t||r,minSelectionLength:Math.min,maxMatches:Math.min})}});function qGt(e){return[ZGt,GGt]}const HGt=er.mark({class:"cm-selectionMatch"}),QGt=er.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Gke(e,t,r,n){return(r==0||e(t.sliceDoc(r-1,r))!=xi.Word)&&(n==t.doc.length||e(t.sliceDoc(n,n+1))!=xi.Word)}function WGt(e,t,r,n){return e(t.sliceDoc(r,r+1))==xi.Word&&e(t.sliceDoc(n-1,n))==xi.Word}const GGt=Oi.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(VGt),{state:r}=e,n=r.selection;if(n.ranges.length>1)return er.none;let s=n.main,a,i=null;if(s.empty){if(!t.highlightWordAroundCursor)return er.none;let c=r.wordAt(s.head);if(!c)return er.none;i=r.charCategorizer(s.head),a=r.sliceDoc(c.from,c.to)}else{let c=s.to-s.from;if(c<t.minSelectionLength||c>200)return er.none;if(t.wholeWords){if(a=r.sliceDoc(s.from,s.to),i=r.charCategorizer(s.head),!(Gke(i,r,s.from,s.to)&&WGt(i,r,s.from,s.to)))return er.none}else if(a=r.sliceDoc(s.from,s.to),!a)return er.none}let l=[];for(let c of e.visibleRanges){let u=new qy(r.doc,a,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!i||Gke(i,r,d,f))&&(s.empty&&d<=s.from&&f>=s.to?l.push(QGt.range(d,f)):(d>=s.to||f<=s.from)&&l.push(HGt.range(d,f)),l.length>t.maxMatches))return er.none}}return er.set(l)}},{decorations:e=>e.decorations}),ZGt=ft.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),YGt=({state:e,dispatch:t})=>{let{selection:r}=e,n=nt.create(r.ranges.map(s=>e.wordAt(s.head)||nt.cursor(s.head)),r.mainIndex);return n.eq(r)?!1:(t(e.update({selection:n})),!0)};function XGt(e,t){let{main:r,ranges:n}=e.selection,s=e.wordAt(r.head),a=s&&s.from==r.from&&s.to==r.to;for(let i=!1,l=new qy(e.doc,t,n[n.length-1].to);;)if(l.next(),l.done){if(i)return null;l=new qy(e.doc,t,0,Math.max(0,n[n.length-1].from-1)),i=!0}else{if(i&&n.some(c=>c.from==l.value.from))continue;if(a){let c=e.wordAt(l.value.from);if(!c||c.from!=l.value.from||c.to!=l.value.to)continue}return l.value}}const KGt=({state:e,dispatch:t})=>{let{ranges:r}=e.selection;if(r.some(a=>a.from===a.to))return YGt({state:e,dispatch:t});let n=e.sliceDoc(r[0].from,r[0].to);if(e.selection.ranges.some(a=>e.sliceDoc(a.from,a.to)!=n))return!1;let s=XGt(e,n);return s?(t(e.update({selection:e.selection.addRange(nt.range(s.from,s.to),!1),effects:ft.scrollIntoView(s.to)})),!0):!1},HE=Kt.define({combine(e){return mg(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new fZt(t),scrollToMatch:t=>ft.scrollIntoView(t)})}});class rYe{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||zGt(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord,this.test=t.test}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(r,n)=>n=="n"?`
|
|
115
|
+
}`,{label:"class",detail:"definition",type:"keyword"}),ku('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),ku('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],zGe=$ue.concat([ku("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),ku("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),ku("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),Ake=new zHe,BGe=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Rj(e){return(t,r)=>{let n=t.node.getChild("VariableDefinition");return n&&r(n,e),!0}}const KQt=["FunctionDeclaration"],JQt={FunctionDeclaration:Rj("function"),ClassDeclaration:Rj("class"),ClassExpression:()=>!0,EnumDeclaration:Rj("constant"),TypeAliasDeclaration:Rj("type"),NamespaceDeclaration:Rj("namespace"),VariableDefinition(e,t){e.matchContext(KQt)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function UGe(e,t){let r=Ake.get(t);if(r)return r;let n=[],s=!0;function a(i,l){let c=e.sliceString(i.from,i.to);n.push({label:c,type:l})}return t.cursor(Js.IncludeAnonymous).iterate(i=>{if(s)s=!1;else if(i.name){let l=JQt[i.name];if(l&&l(i,a)||BGe.has(i.name))return!1}else if(i.to-i.from>8192){for(let l of UGe(e,i.node))n.push(l);return!1}}),Ake.set(t,n),n}const G3=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Fue=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function VGe(e){let t=Ra(e.state).resolveInner(e.pos,-1);if(Fue.indexOf(t.name)>-1)return null;let r=t.name=="VariableName"||t.to-t.from<20&&G3.test(e.state.sliceDoc(t.from,t.to));if(!r&&!e.explicit)return null;let n=[];for(let s=t;s;s=s.parent)BGe.has(s.name)&&(n=n.concat(UGe(e.state.doc,s)));return{options:n,from:r?t.from:e.pos,validFor:G3}}function pV(e,t,r){var n;let s=[];for(;;){let a=t.firstChild,i;if(a?.name=="VariableName")return s.push(e(a)),{path:s.reverse(),name:r};if(a?.name=="MemberExpression"&&((n=i=a.lastChild)===null||n===void 0?void 0:n.name)=="PropertyName")s.push(e(i)),t=a;else return null}}function qGe(e){let t=n=>e.state.doc.sliceString(n.from,n.to),r=Ra(e.state).resolveInner(e.pos,-1);return r.name=="PropertyName"?pV(t,r.parent,t(r)):(r.name=="."||r.name=="?.")&&r.parent.name=="MemberExpression"?pV(t,r.parent,""):Fue.indexOf(r.name)>-1?null:r.name=="VariableName"||r.to-r.from<20&&G3.test(t(r))?{path:[],name:t(r)}:r.name=="MemberExpression"?pV(t,r,""):e.explicit?{path:[],name:""}:null}function eWt(e,t){let r=e,n=[],s=new Set;for(let a=0;;a++){for(let l of(Object.getOwnPropertyNames||Object.keys)(e)){if(!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(l)||s.has(l))continue;s.add(l);let c;try{c=r[l]}catch{continue}n.push({label:l,type:typeof c=="function"?/^[A-Z]/.test(l)?"class":t?"function":"method":t?"variable":"property",boost:-a})}let i=Object.getPrototypeOf(e);if(!i)return n;e=i}}function tWt(e){let t=new Map;return r=>{let n=qGe(r);if(!n)return null;let s=e;for(let i of n.path)if(s=s[i],!s)return null;let a=t.get(s);return a||t.set(s,a=eWt(s,!n.path.length)),{from:r.pos-n.name.length,options:a,validFor:G3}}}const ph=iS.define({name:"javascript",parser:XQt.configure({props:[a1.add({IfStatement:Fk({except:/^\s*({|else\b)/}),TryStatement:Fk({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:XUt,SwitchBody:e=>{let t=e.textAfter,r=/^\s*\}/.test(t),n=/^\s*(case|default)\b/.test(t);return e.baseIndent+(r?0:n?1:2)*e.unit},Block:YUt({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":Fk({except:/^\s*{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),i1.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":vue,BlockComment(e){return{from:e.from+2,to:e.to-2}},JSXElement(e){let t=e.firstChild;if(!t||t.name=="JSXSelfClosingTag")return null;let r=e.lastChild;return{from:t.to,to:r.type.isError?e.to:r.from}},"JSXSelfClosingTag JSXOpenTag"(e){var t;let r=(t=e.firstChild)===null||t===void 0?void 0:t.nextSibling,n=e.lastChild;return!r||r.type.isError?null:{from:r.to,to:n.type.isError?e.to:n.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),HGe={test:e=>/^JSX/.test(e.name),facet:LF({commentTokens:{block:{open:"{/*",close:"*/}"}}})},zue=ph.configure({dialect:"ts"},"typescript"),Bue=ph.configure({dialect:"jsx",props:[mue.add(e=>e.isTop?[HGe]:void 0)]}),Uue=ph.configure({dialect:"jsx ts",props:[mue.add(e=>e.isTop?[HGe]:void 0)]},"typescript");let QGe=e=>({label:e,type:"keyword"});const WGe="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(QGe),rWt=WGe.concat(["declare","implements","private","protected","public"].map(QGe));function Z3(e={}){let t=e.jsx?e.typescript?Uue:Bue:e.typescript?zue:ph,r=e.typescript?zGe.concat(rWt):$ue.concat(WGe);return new lS(t,[ph.data.of({autocomplete:DVt(Fue,UWe(r))}),ph.data.of({autocomplete:VGe}),e.jsx?GGe:[]])}function nWt(e){for(;;){if(e.name=="JSXOpenTag"||e.name=="JSXSelfClosingTag"||e.name=="JSXFragmentTag")return e;if(e.name=="JSXEscape"||!e.parent)return null;e=e.parent}}function Ike(e,t,r=e.length){for(let n=t?.firstChild;n;n=n.nextSibling)if(n.name=="JSXIdentifier"||n.name=="JSXBuiltin"||n.name=="JSXNamespacedName"||n.name=="JSXMemberExpression")return e.sliceString(n.from,Math.min(n.to,r));return""}const sWt=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),GGe=ft.inputHandler.of((e,t,r,n,s)=>{if((sWt?e.composing:e.compositionStarted)||e.state.readOnly||t!=r||n!=">"&&n!="/"||!ph.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:i}=a,l=i.changeByRange(c=>{var u;let{head:d}=c,f=Ra(i).resolveInner(d-1,-1),h;if(f.name=="JSXStartTag"&&(f=f.parent),!(i.doc.sliceString(d-1,d)!=n||f.name=="JSXAttributeValue"&&f.to>d)){if(n==">"&&f.name=="JSXFragmentTag")return{range:c,changes:{from:d,insert:"</>"}};if(n=="/"&&f.name=="JSXStartCloseTag"){let p=f.parent,m=p.parent;if(m&&p.from==d-2&&((h=Ike(i.doc,m.firstChild,d))||((u=m.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let g=`${h}>`;return{range:nt.cursor(d+g.length,-1),changes:{from:d,insert:g}}}}else if(n==">"){let p=nWt(f);if(p&&p.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(i.doc.sliceString(d,d+2))&&(h=Ike(i.doc,p,d)))return{range:c,changes:{from:d,insert:`</${h}>`}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([a,i.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function aWt(e,t){return t||(t={parserOptions:{ecmaVersion:2019,sourceType:"module"},env:{browser:!0,node:!0,es6:!0,es2015:!0,es2017:!0,es2020:!0},rules:{}},e.getRules().forEach((r,n)=>{var s;!((s=r.meta.docs)===null||s===void 0)&&s.recommended&&(t.rules[n]=2)})),r=>{let{state:n}=r,s=[];for(let{from:a,to:i}of ph.findRegions(n)){let l=n.doc.lineAt(a),c={line:l.number-1,col:a-l.from,pos:a};for(let u of e.verify(n.sliceDoc(a,i),t))s.push(iWt(u,n.doc,c))}return s}}function Rke(e,t,r,n){return r.line(e+n.line).from+t+(e==1?n.col-1:-1)}function iWt(e,t,r){let n=Rke(e.line,e.column,t,r),s={from:n,to:e.endLine!=null&&e.endColumn!=1?Rke(e.endLine,e.endColumn,t,r):n,message:e.message,source:e.ruleId?"eslint:"+e.ruleId:"eslint",severity:e.severity==1?"warning":"error"};if(e.fix){let{range:a,text:i}=e.fix,l=a[0]+r.pos-n,c=a[1]+r.pos-n;s.actions=[{name:"fix",apply(u,d){u.dispatch({changes:{from:d+l,to:d+c,insert:i},scrollIntoView:!0})}}]}return s}const rD=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:GGe,completionPath:qGe,esLint:aWt,javascript:Z3,javascriptLanguage:ph,jsxLanguage:Bue,localCompletionSource:VGe,scopeCompletionSource:tWt,snippets:$ue,tsxLanguage:Uue,typescriptLanguage:zue,typescriptSnippets:zGe},Symbol.toStringTag,{value:"Module"})),Pj=["_blank","_self","_top","_parent"],mV=["ascii","utf-8","utf-16","latin1","latin1"],gV=["get","post","put","delete"],yV=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],bd=["true","false"],Dr={},oWt={a:{attrs:{href:null,ping:null,type:null,media:null,target:Pj,hreflang:null}},abbr:Dr,address:Dr,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Dr,aside:Dr,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Dr,base:{attrs:{href:null,target:Pj}},bdi:Dr,bdo:Dr,blockquote:{attrs:{cite:null}},body:Dr,br:Dr,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:yV,formmethod:gV,formnovalidate:["novalidate"],formtarget:Pj,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Dr,center:Dr,cite:Dr,code:Dr,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Dr,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Dr,div:Dr,dl:Dr,dt:Dr,em:Dr,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Dr,figure:Dr,footer:Dr,form:{attrs:{action:null,name:null,"accept-charset":mV,autocomplete:["on","off"],enctype:yV,method:gV,novalidate:["novalidate"],target:Pj}},h1:Dr,h2:Dr,h3:Dr,h4:Dr,h5:Dr,h6:Dr,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Dr,hgroup:Dr,hr:Dr,html:{attrs:{manifest:null}},i:Dr,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:yV,formmethod:gV,formnovalidate:["novalidate"],formtarget:Pj,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Dr,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Dr,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Dr,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:mV,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Dr,noscript:Dr,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Dr,param:{attrs:{name:null,value:null}},pre:Dr,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Dr,rt:Dr,ruby:Dr,samp:Dr,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:mV}},section:Dr,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Dr,source:{attrs:{src:null,type:null,media:null}},span:Dr,strong:Dr,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Dr,summary:Dr,sup:Dr,table:Dr,tbody:Dr,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Dr,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Dr,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Dr,time:{attrs:{datetime:null}},title:Dr,tr:Dr,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Dr,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Dr},ZGe={accesskey:null,class:null,contenteditable:bd,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:bd,autocorrect:bd,autocapitalize:bd,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":bd,"aria-autocomplete":["inline","list","both","none"],"aria-busy":bd,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":bd,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":bd,"aria-hidden":bd,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":bd,"aria-multiselectable":bd,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":bd,"aria-relevant":null,"aria-required":bd,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},YGe="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of YGe)ZGe[e]=null;let TA=class{constructor(t,r){this.tags={...oWt,...t},this.globalAttrs={...ZGe,...r},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};TA.default=new TA;function T_(e,t,r=e.length){if(!t)return"";let n=t.firstChild,s=n&&n.getChild("TagName");return s?e.sliceString(s.from,Math.min(s.to,r)):""}function N_(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function XGe(e,t,r){let n=r.tags[T_(e,N_(t))];return n?.children||r.allTags}function Vue(e,t){let r=[];for(let n=N_(t);n&&!n.type.isTop;n=N_(n.parent)){let s=T_(e,n);if(s&&n.lastChild.name=="CloseTag")break;s&&r.indexOf(s)<0&&(t.name=="EndTag"||t.from>=n.firstChild.to)&&r.push(s)}return r}const KGe=/^[:\-\.\w\u00b7-\uffff]*$/;function Pke(e,t,r,n,s){let a=/\s*>/.test(e.sliceDoc(s,s+5))?"":">",i=N_(r,r.name=="StartTag"||r.name=="TagName");return{from:n,to:s,options:XGe(e.doc,i,t).map(l=>({label:l,type:"type"})).concat(Vue(e.doc,r).map((l,c)=>({label:"/"+l,apply:"/"+l+a,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function Mke(e,t,r,n){let s=/\s*>/.test(e.sliceDoc(n,n+5))?"":">";return{from:r,to:n,options:Vue(e.doc,t).map((a,i)=>({label:a,apply:a+s,type:"type",boost:99-i})),validFor:KGe}}function lWt(e,t,r,n){let s=[],a=0;for(let i of XGe(e.doc,r,t))s.push({label:"<"+i,type:"type"});for(let i of Vue(e.doc,r))s.push({label:"</"+i+">",type:"type",boost:99-a++});return{from:n,to:n,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function cWt(e,t,r,n,s){let a=N_(r),i=a?t.tags[T_(e.doc,a)]:null,l=i&&i.attrs?Object.keys(i.attrs):[],c=i&&i.globalAttrs===!1?l:l.length?l.concat(t.globalAttrNames):t.globalAttrNames;return{from:n,to:s,options:c.map(u=>({label:u,type:"property"})),validFor:KGe}}function uWt(e,t,r,n,s){var a;let i=(a=r.parent)===null||a===void 0?void 0:a.getChild("AttributeName"),l=[],c;if(i){let u=e.sliceDoc(i.from,i.to),d=t.globalAttrs[u];if(!d){let f=N_(r),h=f?t.tags[T_(e.doc,f)]:null;d=h?.attrs&&h.attrs[u]}if(d){let f=e.sliceDoc(n,s).toLowerCase(),h='"',p='"';/^['"]/.test(f)?(c=f[0]=='"'?/^[^"]*$/:/^[^']*$/,h="",p=e.sliceDoc(s,s+1)==f[0]?"":f[0],f=f.slice(1),n++):c=/^[^\s<>='"]*$/;for(let m of d)l.push({label:m,apply:h+m+p,type:"constant"})}}return{from:n,to:s,options:l,validFor:c}}function JGe(e,t){let{state:r,pos:n}=t,s=Ra(r).resolveInner(n,-1),a=s.resolve(n);for(let i=n,l;a==s&&(l=s.childBefore(i));){let c=l.lastChild;if(!c||!c.type.isError||c.from<c.to)break;a=s=l,i=c.from}return s.name=="TagName"?s.parent&&/CloseTag$/.test(s.parent.name)?Mke(r,s,s.from,n):Pke(r,e,s,s.from,n):s.name=="StartTag"||s.name=="IncompleteTag"?Pke(r,e,s,n,n):s.name=="StartCloseTag"||s.name=="IncompleteCloseTag"?Mke(r,s,n,n):s.name=="OpenTag"||s.name=="SelfClosingTag"||s.name=="AttributeName"?cWt(r,e,s,s.name=="AttributeName"?s.from:n,n):s.name=="Is"||s.name=="AttributeValue"||s.name=="UnquotedAttributeValue"?uWt(r,e,s,s.name=="Is"?n:s.from,n):t.explicit&&(a.name=="Element"||a.name=="Text"||a.name=="Document")?lWt(r,e,s,n):null}function eZe(e){return JGe(TA.default,e)}function tZe(e){let{extraTags:t,extraGlobalAttributes:r}=e,n=r||t?new TA(t,r):TA.default;return s=>JGe(n,s)}const dWt=ph.parser.configure({top:"SingleExpression"}),rZe=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:zue.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:Bue.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:Uue.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:dWt},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:ph.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:jA.parser}],nZe=[{name:"style",parser:jA.parser.configure({top:"Styles"})}].concat(YGe.map(e=>({name:e,parser:ph.parser}))),sZe=iS.define({name:"html",parser:zHt.configure({props:[a1.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let t=null,r;for(let n=e.node;;){let s=n.lastChild;if(!s||s.name!="Element"||s.to!=n.to)break;t=n=s}return t&&!((r=t.lastChild)&&(r.name=="CloseTag"||r.name=="SelfClosingTag"))?e.lineIndent(t.from)+e.unit:null}}),i1.add({Element(e){let t=e.firstChild,r=e.lastChild;return!t||t.name!="OpenTag"?null:{from:t.to,to:r.name=="CloseTag"?r.from:e.to}}}),MWe.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),bN=sZe.configure({wrap:NGe(rZe,nZe)});function aZe(e={}){let t="",r;e.matchClosingTags===!1&&(t="noMatch"),e.selfClosingTags===!0&&(t=(t?t+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(r=NGe((e.nestedLanguages||[]).concat(rZe),(e.nestedAttributes||[]).concat(nZe)));let n=r?sZe.configure({wrap:r,dialect:t}):t?bN.configure({dialect:t}):bN;return new lS(n,[bN.data.of({autocomplete:tZe(e)}),e.autoCloseTags!==!1?iZe:[],Z3().support,$Ge().support])}const Dke=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),iZe=ft.inputHandler.of((e,t,r,n,s)=>{if(e.composing||e.state.readOnly||t!=r||n!=">"&&n!="/"||!bN.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:i}=a,l=i.changeByRange(c=>{var u,d,f;let h=i.doc.sliceString(c.from-1,c.to)==n,{head:p}=c,m=Ra(i).resolveInner(p,-1),g;if(h&&n==">"&&m.name=="EndTag"){let y=m.parent;if(((d=(u=y.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(g=T_(i.doc,y.parent,p))&&!Dke.has(g)){let x=p+(i.doc.sliceString(p,p+1)===">"?1:0),w=`</${g}>`;return{range:c,changes:{from:p,to:x,insert:w}}}}else if(h&&n=="/"&&m.name=="IncompleteCloseTag"){let y=m.parent;if(m.from==p-2&&((f=y.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(g=T_(i.doc,y,p))&&!Dke.has(g)){let x=p+(i.doc.sliceString(p,p+1)===">"?1:0),w=`${g}>`;return{range:nt.cursor(p+w.length,-1),changes:{from:p,to:x,insert:w}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([a,i.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),fWt=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:iZe,html:aZe,htmlCompletionSource:eZe,htmlCompletionSourceWith:tZe,htmlLanguage:bN},Symbol.toStringTag,{value:"Module"})),oZe=LF({commentTokens:{block:{open:"<!--",close:"-->"}}}),lZe=new pn,cZe=Uqt.configure({props:[i1.add(e=>!e.is("Block")||e.is("Document")||nse(e)!=null||hWt(e)?void 0:(t,r)=>({from:r.doc.lineAt(t.from).to,to:t.to})),lZe.add(nse),a1.add({Document:()=>null}),Pb.add({Document:oZe})]});function nse(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function hWt(e){return e.name=="OrderedList"||e.name=="BulletList"}function pWt(e,t){let r=e;for(;;){let n=r.nextSibling,s;if(!n||(s=nse(n.type))!=null&&s<=t)break;r=n}return r.to}const mWt=OWe.of((e,t,r)=>{for(let n=Ra(e).resolveInner(r,-1);n&&!(n.from<t);n=n.parent){let s=n.type.prop(lZe);if(s==null)continue;let a=pWt(n,s);if(a>r)return{from:r,to:a}}return null});function que(e){return new Bd(oZe,e,[],"markdown")}const uZe=que(cZe),gWt=cZe.configure([Jqt,tHt,eHt,rHt,{props:[i1.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),dS=que(gWt);function yWt(e,t){return r=>{if(r&&e){let n=null;if(r=/\S*/.exec(r)[0],typeof e=="function"?n=e(r):n=Ye.matchLanguageName(e,r,!0),n instanceof Ye)return n.support?n.support.language.parser:oS.getSkippingParser(n.load());if(n)return n.parser}return t?t.parser:null}}class vV{constructor(t,r,n,s,a,i,l){this.node=t,this.from=r,this.to=n,this.spaceBefore=s,this.spaceAfter=a,this.type=i,this.item=l}blank(t,r=!0){let n=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(t!=null){for(;n.length<t;)n+=" ";return n}else{for(let s=this.to-this.from-n.length-this.spaceAfter.length;s>0;s--)n+=" ";return n+(r?this.spaceAfter:"")}}marker(t,r){let n=this.node.name=="OrderedList"?String(+fZe(this.item,t)[2]+r):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function dZe(e,t){let r=[],n=[];for(let s=e;s;s=s.parent){if(s.name=="FencedCode")return n;(s.name=="ListItem"||s.name=="Blockquote")&&r.push(s)}for(let s=r.length-1;s>=0;s--){let a=r[s],i,l=t.lineAt(a.from),c=a.from-l.from;if(a.name=="Blockquote"&&(i=/^ *>( ?)/.exec(l.text.slice(c))))n.push(new vV(a,c,c+i[0].length,"",i[1],">",null));else if(a.name=="ListItem"&&a.parent.name=="OrderedList"&&(i=/^( *)\d+([.)])( *)/.exec(l.text.slice(c)))){let u=i[3],d=i[0].length;u.length>=4&&(u=u.slice(0,u.length-4),d-=4),n.push(new vV(a.parent,c,c+d,i[1],u,i[2],a))}else if(a.name=="ListItem"&&a.parent.name=="BulletList"&&(i=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(l.text.slice(c)))){let u=i[4],d=i[0].length;u.length>4&&(u=u.slice(0,u.length-4),d-=4);let f=i[2];i[3]&&(f+=i[3].replace(/[xX]/," ")),n.push(new vV(a.parent,c,c+d,i[1],u,f,a))}}return n}function fZe(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function bV(e,t,r,n=0){for(let s=-1,a=e;;){if(a.name=="ListItem"){let l=fZe(a,t),c=+l[2];if(s>=0){if(c!=s+1)return;r.push({from:a.from+l[1].length,to:a.from+l[0].length,insert:String(s+2+n)})}s=c}let i=a.nextSibling;if(!i)break;a=i}}function Hue(e,t){let r=/^[ \t]*/.exec(e)[0].length;if(!r||t.facet(BE)!=" ")return e;let n=Sp(e,4,r),s="";for(let a=n;a>0;)a>=4?(s+=" ",a-=4):(s+=" ",a--);return s+e.slice(r)}const hZe=(e={})=>({state:t,dispatch:r})=>{let n=Ra(t),{doc:s}=t,a=null,i=t.changeByRange(l=>{if(!l.empty||!dS.isActiveAt(t,l.from,-1)&&!dS.isActiveAt(t,l.from,1))return a={range:l};let c=l.from,u=s.lineAt(c),d=dZe(n.resolveInner(c,-1),s);for(;d.length&&d[d.length-1].from>c-u.from;)d.pop();if(!d.length)return a={range:l};let f=d[d.length-1];if(f.to-f.spaceAfter.length>c-u.from)return a={range:l};let h=c>=f.to-f.spaceAfter.length&&!/\S/.test(u.text.slice(f.to));if(f.item&&h){let x=f.node.firstChild,w=f.node.getChild("ListItem","ListItem");if(x.to>=c||w&&w.to<c||u.from>0&&!/[^\s>]/.test(s.lineAt(u.from-1).text)||e.nonTightLists===!1){let S=d.length>1?d[d.length-2]:null,k,_="";S&&S.item?(k=u.from+S.from,_=S.marker(s,1)):k=u.from+(S?S.to:0);let E=[{from:k,to:c,insert:_}];return f.node.name=="OrderedList"&&bV(f.item,s,E,-2),S&&S.node.name=="OrderedList"&&bV(S.item,s,E),{range:nt.cursor(k+_.length),changes:E}}else{let S=$ke(d,t,u);return{range:nt.cursor(c+S.length+1),changes:{from:u.from,insert:S+t.lineBreak}}}}if(f.node.name=="Blockquote"&&h&&u.from){let x=s.lineAt(u.from-1),w=/>\s*$/.exec(x.text);if(w&&w.index==f.from){let S=t.changes([{from:x.from+w.index,to:x.to},{from:u.from+f.from,to:u.to}]);return{range:l.map(S),changes:S}}}let p=[];f.node.name=="OrderedList"&&bV(f.item,s,p);let m=f.item&&f.item.from<u.from,g="";if(!m||/^[\s\d.)\-+*>]*/.exec(u.text)[0].length>=f.to)for(let x=0,w=d.length-1;x<=w;x++)g+=x==w&&!m?d[x].marker(s,1):d[x].blank(x<w?Sp(u.text,4,d[x+1].from)-g.length:null);let y=c;for(;y>u.from&&/\s/.test(u.text.charAt(y-u.from-1));)y--;return g=Hue(g,t),vWt(f.node,t.doc)&&(g=$ke(d,t,u)+t.lineBreak+g),p.push({from:y,to:c,insert:t.lineBreak+g}),{range:nt.cursor(y+g.length+1),changes:p}});return a?!1:(r(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0)},pZe=hZe();function Lke(e){return e.name=="QuoteMark"||e.name=="ListMark"}function vWt(e,t){if(e.name!="OrderedList"&&e.name!="BulletList")return!1;let r=e.firstChild,n=e.getChild("ListItem","ListItem");if(!n)return!1;let s=t.lineAt(r.to),a=t.lineAt(n.from),i=/^[\s>]*$/.test(s.text);return s.number+(i?0:1)<a.number}function $ke(e,t,r){let n="";for(let s=0,a=e.length-2;s<=a;s++)n+=e[s].blank(s<a?Sp(r.text,4,e[s+1].from)-n.length:null,s<a);return Hue(n,t)}function bWt(e,t){let r=e.resolveInner(t,-1),n=t;Lke(r)&&(n=r.from,r=r.parent);for(let s;s=r.childBefore(n);)if(Lke(s))n=s.from;else if(s.name=="OrderedList"||s.name=="BulletList")r=s.lastChild,n=r.to;else break;return r}const mZe=({state:e,dispatch:t})=>{let r=Ra(e),n=null,s=e.changeByRange(a=>{let i=a.from,{doc:l}=e;if(a.empty&&dS.isActiveAt(e,a.from)){let c=l.lineAt(i),u=dZe(bWt(r,i),l);if(u.length){let d=u[u.length-1],f=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(i-c.from>f&&!/\S/.test(c.text.slice(f,i-c.from)))return{range:nt.cursor(c.from+f),changes:{from:c.from+f,to:i}};if(i-c.from==f&&(!d.item||c.from<=d.item.from||!/\S/.test(c.text.slice(0,d.to)))){let h=c.from+d.from;if(d.item&&d.node.from<d.item.from&&/\S/.test(c.text.slice(d.from,d.to))){let p=d.blank(Sp(c.text,4,d.to)-Sp(c.text,4,d.from));return h==c.from&&(p=Hue(p,e)),{range:nt.cursor(h+p.length),changes:{from:h,to:c.from+d.to,insert:p}}}if(h<i)return{range:nt.cursor(h),changes:{from:h,to:i}}}}}return n={range:a}});return n?!1:(t(e.update(s,{scrollIntoView:!0,userEvent:"delete"})),!0)},gZe=[{key:"Enter",run:pZe},{key:"Backspace",run:mZe}],yZe=aZe({matchClosingTags:!1});function Que(e={}){let{codeLanguages:t,defaultCodeLanguage:r,addKeymap:n=!0,base:{parser:s}=uZe,completeHTMLTags:a=!0,pasteURLAsLink:i=!0,htmlTagLanguage:l=yZe}=e;if(!(s instanceof BF))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],u=[l.support,mWt],d;i&&u.push(vZe),r instanceof lS?(u.push(r.support),d=r.language):r&&(d=r);let f=t||d?yWt(t,d):void 0;c.push(qqt({codeParser:f,htmlParser:l.language.parser})),n&&u.push(Rp.high(zE.of(gZe)));let h=que(s.configure(c));return a&&u.push(h.data.of({autocomplete:xWt})),new lS(h,u)}function xWt(e){let{state:t,pos:r}=e,n=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(r-25,r));if(!n)return null;let s=Ra(t).resolveInner(r,-1);for(;s&&!s.type.isTop;){if(s.name=="CodeBlock"||s.name=="FencedCode"||s.name=="ProcessingInstructionBlock"||s.name=="CommentBlock"||s.name=="Link"||s.name=="Image")return null;s=s.parent}return{from:r-n[0].length,to:r,options:wWt(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let xV=null;function wWt(){if(xV)return xV;let e=eZe(new Sue(zn.create({extensions:yZe}),0,!0));return xV=e?e.options:[]}const SWt=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,vZe=ft.domEventHandlers({paste:(e,t)=>{var r;let{main:n}=t.state.selection;if(n.empty)return!1;let s=(r=e.clipboardData)===null||r===void 0?void 0:r.getData("text/plain");if(!s||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(s)||(/^www\./.test(s)&&(s="https://"+s),!dS.isActiveAt(t.state,n.from,1)))return!1;let a=Ra(t.state),i=!1;return a.iterate({from:n.from,to:n.to,enter:l=>{(l.from>n.from||SWt.test(l.name))&&(i=!0)},leave:l=>{l.to<n.to&&(i=!0)}}),i?!1:(t.dispatch({changes:[{from:n.from,insert:"["},{from:n.to,insert:`](${s})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),OWt=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:uZe,deleteMarkupBackward:mZe,insertNewlineContinueMarkup:pZe,insertNewlineContinueMarkupCommand:hZe,markdown:Que,markdownKeymap:gZe,markdownLanguage:dS,pasteURLAsLink:vZe},Symbol.toStringTag,{value:"Module"}));function pt(e){return new lS(bue.define(e))}function Jv(e){return Ke(()=>import("./index-CY5M8S18.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.sql({dialect:t[e]}))}const bZe=[Ye.of({name:"C",extensions:["c","h","ino"],load(){return Ke(()=>import("./index-B5c685UB.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),Ye.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return Ke(()=>import("./index-B5c685UB.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),Ye.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return Jv("Cassandra")}}),Ye.of({name:"CSS",extensions:["css"],load(){return Ke(()=>Promise.resolve().then(()=>xQt),void 0,import.meta.url).then(e=>e.css())}}),Ye.of({name:"Go",extensions:["go"],load(){return Ke(()=>import("./index-DVlITRAn.js"),__vite__mapDeps([3,1]),import.meta.url).then(e=>e.go())}}),Ye.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return Ke(()=>Promise.resolve().then(()=>fWt),void 0,import.meta.url).then(e=>e.html())}}),Ye.of({name:"Java",extensions:["java"],load(){return Ke(()=>import("./index-CSsr-c3k.js"),__vite__mapDeps([4,1]),import.meta.url).then(e=>e.java())}}),Ye.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return Ke(()=>Promise.resolve().then(()=>rD),void 0,import.meta.url).then(e=>e.javascript())}}),Ye.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return Ke(()=>import("./index-DVLpUcz6.js"),__vite__mapDeps([5,1]),import.meta.url).then(e=>e.jinja())}}),Ye.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return Ke(()=>Promise.resolve().then(()=>PVt),void 0,import.meta.url).then(e=>e.json())}}),Ye.of({name:"JSX",extensions:["jsx"],load(){return Ke(()=>Promise.resolve().then(()=>rD),void 0,import.meta.url).then(e=>e.javascript({jsx:!0}))}}),Ye.of({name:"LESS",extensions:["less"],load(){return Ke(()=>import("./index-70ReIlsb.js"),__vite__mapDeps([6,1]),import.meta.url).then(e=>e.less())}}),Ye.of({name:"Liquid",extensions:["liquid"],load(){return Ke(()=>import("./index-B3n697wk.js"),__vite__mapDeps([7,1]),import.meta.url).then(e=>e.liquid())}}),Ye.of({name:"MariaDB SQL",load(){return Jv("MariaSQL")}}),Ye.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return Ke(()=>Promise.resolve().then(()=>OWt),void 0,import.meta.url).then(e=>e.markdown())}}),Ye.of({name:"MS SQL",load(){return Jv("MSSQL")}}),Ye.of({name:"MySQL",load(){return Jv("MySQL")}}),Ye.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return Ke(()=>import("./index-CPUVmBka.js"),__vite__mapDeps([8,1]),import.meta.url).then(e=>e.php())}}),Ye.of({name:"PLSQL",extensions:["pls"],load(){return Jv("PLSQL")}}),Ye.of({name:"PostgreSQL",load(){return Jv("PostgreSQL")}}),Ye.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return Ke(()=>import("./index-BtYPKXmx.js"),__vite__mapDeps([9,1]),import.meta.url).then(e=>e.python())}}),Ye.of({name:"Rust",extensions:["rs"],load(){return Ke(()=>import("./index-BO2xrfI9.js"),__vite__mapDeps([10,1]),import.meta.url).then(e=>e.rust())}}),Ye.of({name:"Sass",extensions:["sass"],load(){return Ke(()=>import("./index-CsrD2Q_4.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass({indented:!0}))}}),Ye.of({name:"SCSS",extensions:["scss"],load(){return Ke(()=>import("./index-CsrD2Q_4.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass())}}),Ye.of({name:"SQL",extensions:["sql"],load(){return Jv("StandardSQL")}}),Ye.of({name:"SQLite",load(){return Jv("SQLite")}}),Ye.of({name:"TSX",extensions:["tsx"],load(){return Ke(()=>Promise.resolve().then(()=>rD),void 0,import.meta.url).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),Ye.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return Ke(()=>Promise.resolve().then(()=>rD),void 0,import.meta.url).then(e=>e.javascript({typescript:!0}))}}),Ye.of({name:"WebAssembly",extensions:["wat","wast"],load(){return Ke(()=>import("./index-Ia0WWYiZ.js"),__vite__mapDeps([12,1]),import.meta.url).then(e=>e.wast())}}),Ye.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return Ke(()=>import("./index-E3AFdTkM.js"),__vite__mapDeps([13,1]),import.meta.url).then(e=>e.xml())}}),Ye.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return Ke(()=>import("./index-B9T9kS5a.js"),__vite__mapDeps([14,1]),import.meta.url).then(e=>e.yaml())}}),Ye.of({name:"APL",extensions:["dyalog","apl"],load(){return Ke(()=>import("./apl-B4CMkyY2.js"),[],import.meta.url).then(e=>pt(e.apl))}}),Ye.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return Ke(()=>import("./asciiarmor-Df11BRmG.js"),[],import.meta.url).then(e=>pt(e.asciiArmor))}}),Ye.of({name:"ASN.1",extensions:["asn","asn1"],load(){return Ke(()=>import("./asn1-EdZsLKOL.js"),[],import.meta.url).then(e=>pt(e.asn1({})))}}),Ye.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return Ke(()=>import("./asterisk-B-8jnY81.js"),[],import.meta.url).then(e=>pt(e.asterisk))}}),Ye.of({name:"Brainfuck",extensions:["b","bf"],load(){return Ke(()=>import("./brainfuck-C4LP7Hcl.js"),[],import.meta.url).then(e=>pt(e.brainfuck))}}),Ye.of({name:"Cobol",extensions:["cob","cpy"],load(){return Ke(()=>import("./cobol-CWcv1MsR.js"),[],import.meta.url).then(e=>pt(e.cobol))}}),Ye.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.csharp))}}),Ye.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return Ke(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>pt(e.clojure))}}),Ye.of({name:"ClojureScript",extensions:["cljs"],load(){return Ke(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>pt(e.clojure))}}),Ye.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return Ke(()=>import("./css-BnMrqG3P.js"),[],import.meta.url).then(e=>pt(e.gss))}}),Ye.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return Ke(()=>import("./cmake-BQqOBYOt.js"),[],import.meta.url).then(e=>pt(e.cmake))}}),Ye.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return Ke(()=>import("./coffeescript-S37ZYGWr.js"),[],import.meta.url).then(e=>pt(e.coffeeScript))}}),Ye.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return Ke(()=>import("./commonlisp-DBKNyK5s.js"),[],import.meta.url).then(e=>pt(e.commonLisp))}}),Ye.of({name:"Cypher",extensions:["cyp","cypher"],load(){return Ke(()=>import("./cypher-C_CwsFkJ.js"),[],import.meta.url).then(e=>pt(e.cypher))}}),Ye.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return Ke(()=>import("./python-BuPzkPfP.js"),[],import.meta.url).then(e=>pt(e.cython))}}),Ye.of({name:"Crystal",extensions:["cr"],load(){return Ke(()=>import("./crystal-SjHAIU92.js"),[],import.meta.url).then(e=>pt(e.crystal))}}),Ye.of({name:"D",extensions:["d"],load(){return Ke(()=>import("./d-pRatUO7H.js"),[],import.meta.url).then(e=>pt(e.d))}}),Ye.of({name:"Dart",extensions:["dart"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.dart))}}),Ye.of({name:"diff",extensions:["diff","patch"],load(){return Ke(()=>import("./diff-DbItnlRl.js"),[],import.meta.url).then(e=>pt(e.diff))}}),Ye.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return Ke(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([15,16]),import.meta.url).then(e=>pt(e.dockerFile))}}),Ye.of({name:"DTD",extensions:["dtd"],load(){return Ke(()=>import("./dtd-DF_7sFjM.js"),[],import.meta.url).then(e=>pt(e.dtd))}}),Ye.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return Ke(()=>import("./dylan-DwRh75JA.js"),[],import.meta.url).then(e=>pt(e.dylan))}}),Ye.of({name:"EBNF",load(){return Ke(()=>import("./ebnf-CDyGwa7X.js"),[],import.meta.url).then(e=>pt(e.ebnf))}}),Ye.of({name:"ECL",extensions:["ecl"],load(){return Ke(()=>import("./ecl-Cabwm37j.js"),[],import.meta.url).then(e=>pt(e.ecl))}}),Ye.of({name:"edn",extensions:["edn"],load(){return Ke(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>pt(e.clojure))}}),Ye.of({name:"Eiffel",extensions:["e"],load(){return Ke(()=>import("./eiffel-CnydiIhH.js"),[],import.meta.url).then(e=>pt(e.eiffel))}}),Ye.of({name:"Elm",extensions:["elm"],load(){return Ke(()=>import("./elm-vLlmbW-K.js"),[],import.meta.url).then(e=>pt(e.elm))}}),Ye.of({name:"Erlang",extensions:["erl"],load(){return Ke(()=>import("./erlang-BNw1qcRV.js"),[],import.meta.url).then(e=>pt(e.erlang))}}),Ye.of({name:"Esper",load(){return Ke(()=>import("./sql-D0XecflT.js"),[],import.meta.url).then(e=>pt(e.esper))}}),Ye.of({name:"Factor",extensions:["factor"],load(){return Ke(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([17,16]),import.meta.url).then(e=>pt(e.factor))}}),Ye.of({name:"FCL",load(){return Ke(()=>import("./fcl-Kvtd6kyn.js"),[],import.meta.url).then(e=>pt(e.fcl))}}),Ye.of({name:"Forth",extensions:["forth","fth","4th"],load(){return Ke(()=>import("./forth-Ffai-XNe.js"),[],import.meta.url).then(e=>pt(e.forth))}}),Ye.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return Ke(()=>import("./fortran-DYz_wnZ1.js"),[],import.meta.url).then(e=>pt(e.fortran))}}),Ye.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return Ke(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>pt(e.fSharp))}}),Ye.of({name:"Gas",extensions:["s"],load(){return Ke(()=>import("./gas-Bneqetm1.js"),[],import.meta.url).then(e=>pt(e.gas))}}),Ye.of({name:"Gherkin",extensions:["feature"],load(){return Ke(()=>import("./gherkin-heZmZLOM.js"),[],import.meta.url).then(e=>pt(e.gherkin))}}),Ye.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return Ke(()=>import("./groovy-D9Dt4D0W.js"),[],import.meta.url).then(e=>pt(e.groovy))}}),Ye.of({name:"Haskell",extensions:["hs"],load(){return Ke(()=>import("./haskell-Cw1EW3IL.js"),[],import.meta.url).then(e=>pt(e.haskell))}}),Ye.of({name:"Haxe",extensions:["hx"],load(){return Ke(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>pt(e.haxe))}}),Ye.of({name:"HXML",extensions:["hxml"],load(){return Ke(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>pt(e.hxml))}}),Ye.of({name:"HTTP",load(){return Ke(()=>import("./http-DBlCnlav.js"),[],import.meta.url).then(e=>pt(e.http))}}),Ye.of({name:"IDL",extensions:["pro"],load(){return Ke(()=>import("./idl-BEugSyMb.js"),[],import.meta.url).then(e=>pt(e.idl))}}),Ye.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return Ke(()=>import("./javascript-iXu5QeM3.js"),[],import.meta.url).then(e=>pt(e.jsonld))}}),Ye.of({name:"Julia",extensions:["jl"],load(){return Ke(()=>import("./julia-DuME0IfC.js"),[],import.meta.url).then(e=>pt(e.julia))}}),Ye.of({name:"Kotlin",extensions:["kt","kts"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.kotlin))}}),Ye.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return Ke(()=>import("./livescript-BwQOo05w.js"),[],import.meta.url).then(e=>pt(e.liveScript))}}),Ye.of({name:"Lua",extensions:["lua"],load(){return Ke(()=>import("./lua-BgMRiT3U.js"),[],import.meta.url).then(e=>pt(e.lua))}}),Ye.of({name:"mIRC",extensions:["mrc"],load(){return Ke(()=>import("./mirc-CjQqDB4T.js"),[],import.meta.url).then(e=>pt(e.mirc))}}),Ye.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return Ke(()=>import("./mathematica-DTrFuWx2.js"),[],import.meta.url).then(e=>pt(e.mathematica))}}),Ye.of({name:"Modelica",extensions:["mo"],load(){return Ke(()=>import("./modelica-Dc1JOy9r.js"),[],import.meta.url).then(e=>pt(e.modelica))}}),Ye.of({name:"MUMPS",extensions:["mps"],load(){return Ke(()=>import("./mumps-BT43cFF4.js"),[],import.meta.url).then(e=>pt(e.mumps))}}),Ye.of({name:"Mbox",extensions:["mbox"],load(){return Ke(()=>import("./mbox-CNhZ1qSd.js"),[],import.meta.url).then(e=>pt(e.mbox))}}),Ye.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return Ke(()=>import("./nginx-DdIZxoE0.js"),[],import.meta.url).then(e=>pt(e.nginx))}}),Ye.of({name:"NSIS",extensions:["nsh","nsi"],load(){return Ke(()=>import("./nsis-LdVXkNf5.js"),__vite__mapDeps([18,16]),import.meta.url).then(e=>pt(e.nsis))}}),Ye.of({name:"NTriples",extensions:["nt","nq"],load(){return Ke(()=>import("./ntriples-BfvgReVJ.js"),[],import.meta.url).then(e=>pt(e.ntriples))}}),Ye.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.objectiveC))}}),Ye.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.objectiveCpp))}}),Ye.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return Ke(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>pt(e.oCaml))}}),Ye.of({name:"Octave",extensions:["m"],load(){return Ke(()=>import("./octave-Ck1zUtKM.js"),[],import.meta.url).then(e=>pt(e.octave))}}),Ye.of({name:"Oz",extensions:["oz"],load(){return Ke(()=>import("./oz-BzwKVEFT.js"),[],import.meta.url).then(e=>pt(e.oz))}}),Ye.of({name:"Pascal",extensions:["p","pas"],load(){return Ke(()=>import("./pascal--L3eBynH.js"),[],import.meta.url).then(e=>pt(e.pascal))}}),Ye.of({name:"Perl",extensions:["pl","pm"],load(){return Ke(()=>import("./perl-CdXCOZ3F.js"),[],import.meta.url).then(e=>pt(e.perl))}}),Ye.of({name:"Pig",extensions:["pig"],load(){return Ke(()=>import("./pig-CevX1Tat.js"),[],import.meta.url).then(e=>pt(e.pig))}}),Ye.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return Ke(()=>import("./powershell-CaxLzxiJ.js"),[],import.meta.url).then(e=>pt(e.powerShell))}}),Ye.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return Ke(()=>import("./properties-C78fOPTZ.js"),[],import.meta.url).then(e=>pt(e.properties))}}),Ye.of({name:"ProtoBuf",extensions:["proto"],load(){return Ke(()=>import("./protobuf-ChK-085T.js"),[],import.meta.url).then(e=>pt(e.protobuf))}}),Ye.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return Ke(()=>import("./pug-DeIclll2.js"),__vite__mapDeps([19,20]),import.meta.url).then(e=>pt(e.pug))}}),Ye.of({name:"Puppet",extensions:["pp"],load(){return Ke(()=>import("./puppet-DMA9R1ak.js"),[],import.meta.url).then(e=>pt(e.puppet))}}),Ye.of({name:"Q",extensions:["q"],load(){return Ke(()=>import("./q-pXgVlZs6.js"),[],import.meta.url).then(e=>pt(e.q))}}),Ye.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return Ke(()=>import("./r-B6wPVr8A.js"),[],import.meta.url).then(e=>pt(e.r))}}),Ye.of({name:"RPM Changes",load(){return Ke(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>pt(e.rpmChanges))}}),Ye.of({name:"RPM Spec",extensions:["spec"],load(){return Ke(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>pt(e.rpmSpec))}}),Ye.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return Ke(()=>import("./ruby-B2Rjki9n.js"),[],import.meta.url).then(e=>pt(e.ruby))}}),Ye.of({name:"SAS",extensions:["sas"],load(){return Ke(()=>import("./sas-B4kiWyti.js"),[],import.meta.url).then(e=>pt(e.sas))}}),Ye.of({name:"Scala",extensions:["scala"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.scala))}}),Ye.of({name:"Scheme",extensions:["scm","ss"],load(){return Ke(()=>import("./scheme-C41bIUwD.js"),[],import.meta.url).then(e=>pt(e.scheme))}}),Ye.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return Ke(()=>import("./shell-CjFT_Tl9.js"),[],import.meta.url).then(e=>pt(e.shell))}}),Ye.of({name:"Sieve",extensions:["siv","sieve"],load(){return Ke(()=>import("./sieve-C3Gn_uJK.js"),[],import.meta.url).then(e=>pt(e.sieve))}}),Ye.of({name:"Smalltalk",extensions:["st"],load(){return Ke(()=>import("./smalltalk-CnHTOXQT.js"),[],import.meta.url).then(e=>pt(e.smalltalk))}}),Ye.of({name:"Solr",load(){return Ke(()=>import("./solr-DehyRSwq.js"),[],import.meta.url).then(e=>pt(e.solr))}}),Ye.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return Ke(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>pt(e.sml))}}),Ye.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return Ke(()=>import("./sparql-DkYu6x3z.js"),[],import.meta.url).then(e=>pt(e.sparql))}}),Ye.of({name:"Spreadsheet",alias:["excel","formula"],load(){return Ke(()=>import("./spreadsheet-BCZA_wO0.js"),[],import.meta.url).then(e=>pt(e.spreadsheet))}}),Ye.of({name:"Squirrel",extensions:["nut"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.squirrel))}}),Ye.of({name:"Stylus",extensions:["styl"],load(){return Ke(()=>import("./stylus-B533Al4x.js"),[],import.meta.url).then(e=>pt(e.stylus))}}),Ye.of({name:"Swift",extensions:["swift"],load(){return Ke(()=>import("./swift-BzpIVaGY.js"),[],import.meta.url).then(e=>pt(e.swift))}}),Ye.of({name:"sTeX",load(){return Ke(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>pt(e.stex))}}),Ye.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return Ke(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>pt(e.stex))}}),Ye.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return Ke(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>pt(e.verilog))}}),Ye.of({name:"Tcl",extensions:["tcl"],load(){return Ke(()=>import("./tcl-DVfN8rqt.js"),[],import.meta.url).then(e=>pt(e.tcl))}}),Ye.of({name:"Textile",extensions:["textile"],load(){return Ke(()=>import("./textile-CnDTJFAw.js"),[],import.meta.url).then(e=>pt(e.textile))}}),Ye.of({name:"TiddlyWiki",load(){return Ke(()=>import("./tiddlywiki-DO-Gjzrf.js"),[],import.meta.url).then(e=>pt(e.tiddlyWiki))}}),Ye.of({name:"Tiki wiki",load(){return Ke(()=>import("./tiki-DGYXhP31.js"),[],import.meta.url).then(e=>pt(e.tiki))}}),Ye.of({name:"TOML",extensions:["toml"],load(){return Ke(()=>import("./toml-Bm5Em-hy.js"),[],import.meta.url).then(e=>pt(e.toml))}}),Ye.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return Ke(()=>import("./troff-wAsdV37c.js"),[],import.meta.url).then(e=>pt(e.troff))}}),Ye.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return Ke(()=>import("./ttcn-CfJYG6tj.js"),[],import.meta.url).then(e=>pt(e.ttcn))}}),Ye.of({name:"TTCN_CFG",extensions:["cfg"],load(){return Ke(()=>import("./ttcn-cfg-B9xdYoR4.js"),[],import.meta.url).then(e=>pt(e.ttcnCfg))}}),Ye.of({name:"Turtle",extensions:["ttl"],load(){return Ke(()=>import("./turtle-B1tBg_DP.js"),[],import.meta.url).then(e=>pt(e.turtle))}}),Ye.of({name:"Web IDL",extensions:["webidl"],load(){return Ke(()=>import("./webidl-ZXfAyPTL.js"),[],import.meta.url).then(e=>pt(e.webIDL))}}),Ye.of({name:"VB.NET",extensions:["vb"],load(){return Ke(()=>import("./vb-CmGdzxic.js"),[],import.meta.url).then(e=>pt(e.vb))}}),Ye.of({name:"VBScript",extensions:["vbs"],load(){return Ke(()=>import("./vbscript-BuJXcnF6.js"),[],import.meta.url).then(e=>pt(e.vbScript))}}),Ye.of({name:"Velocity",extensions:["vtl"],load(){return Ke(()=>import("./velocity-D8B20fx6.js"),[],import.meta.url).then(e=>pt(e.velocity))}}),Ye.of({name:"Verilog",extensions:["v"],load(){return Ke(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>pt(e.verilog))}}),Ye.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return Ke(()=>import("./vhdl-lSbBsy5d.js"),[],import.meta.url).then(e=>pt(e.vhdl))}}),Ye.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return Ke(()=>import("./xquery-DzFWVndE.js"),[],import.meta.url).then(e=>pt(e.xQuery))}}),Ye.of({name:"Yacas",extensions:["ys"],load(){return Ke(()=>import("./yacas-BJ4BC0dw.js"),[],import.meta.url).then(e=>pt(e.yacas))}}),Ye.of({name:"Z80",extensions:["z80"],load(){return Ke(()=>import("./z80-Hz9HOZM7.js"),[],import.meta.url).then(e=>pt(e.z80))}}),Ye.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return Ke(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>pt(e.mscgen))}}),Ye.of({name:"Xù",extensions:["xu"],load(){return Ke(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>pt(e.xu))}}),Ye.of({name:"MsGenny",extensions:["msgenny"],load(){return Ke(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>pt(e.msgenny))}}),Ye.of({name:"Vue",extensions:["vue"],load(){return Ke(()=>import("./index-BmztCkjM.js"),__vite__mapDeps([21,1]),import.meta.url).then(e=>e.vue())}}),Ye.of({name:"Angular Template",load(){return Ke(()=>import("./index-CAPvaTvr.js"),__vite__mapDeps([22,1]),import.meta.url).then(e=>e.angular())}})];function vx(){return vx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vx.apply(null,arguments)}var kWt=e=>{var{theme:t,settings:r={},styles:n=[]}=e,s={".cm-gutters":{}},a={};r.background&&(a.backgroundColor=r.background),r.backgroundImage&&(a.backgroundImage=r.backgroundImage),r.foreground&&(a.color=r.foreground),r.fontSize&&(a.fontSize=r.fontSize),(r.background||r.foreground)&&(s["&"]=a),r.fontFamily&&(s["&.cm-editor .cm-scroller"]={fontFamily:r.fontFamily}),r.gutterBackground&&(s[".cm-gutters"].backgroundColor=r.gutterBackground),r.gutterForeground&&(s[".cm-gutters"].color=r.gutterForeground),r.gutterBorder&&(s[".cm-gutters"].borderRightColor=r.gutterBorder),r.caret&&(s[".cm-content"]={caretColor:r.caret},s[".cm-cursor, .cm-dropCursor"]={borderLeftColor:r.caret});var i={};r.gutterActiveForeground&&(i.color=r.gutterActiveForeground),r.lineHighlight&&(s[".cm-activeLine"]={backgroundColor:r.lineHighlight},i.backgroundColor=r.lineHighlight),s[".cm-activeLineGutter"]=i,r.selection&&(s["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:r.selection+" !important"}),r.selectionMatch&&(s["& .cm-selectionMatch"]={backgroundColor:r.selectionMatch});var l=ft.theme(s,{dark:t==="dark"}),c=Pp.define(n),u=[l,Wx(c)];return u},_Wt={background:"#282a36",foreground:"#f8f8f2",caret:"#f8f8f0",selection:"rgba(255, 255, 255, 0.1)",selectionMatch:"rgba(255, 255, 255, 0.2)",gutterBackground:"#282a36",gutterForeground:"#6D8A88",gutterBorder:"transparent",lineHighlight:"rgba(255, 255, 255, 0.1)"},EWt=[{tag:ne.comment,color:"#6272a4"},{tag:ne.string,color:"#f1fa8c"},{tag:ne.atom,color:"#bd93f9"},{tag:ne.meta,color:"#f8f8f2"},{tag:[ne.keyword,ne.operator,ne.tagName],color:"#ff79c6"},{tag:[ne.function(ne.propertyName),ne.propertyName],color:"#66d9ef"},{tag:[ne.definition(ne.variableName),ne.function(ne.variableName),ne.className,ne.attributeName],color:"#50fa7b"},{tag:ne.atom,color:"#bd93f9"}],VE=e=>{var{theme:t="dark",settings:r={},styles:n=[]}=e||{};return kWt({theme:t,settings:vx({},_Wt,r),styles:[...EWt,...n]})};VE();function Wue(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}const CWt=e=>{let{state:t}=e,r=t.doc.lineAt(t.selection.main.from),n=Zue(e.state,r.from);return n.line?jWt(e):n.block?NWt(e):!1};function Gue(e,t){return({state:r,dispatch:n})=>{if(r.readOnly)return!1;let s=e(t,r);return s?(n(r.update(s)),!0):!1}}const jWt=Gue(RWt,0),TWt=Gue(xZe,0),NWt=Gue((e,t)=>xZe(e,t,IWt(t)),0);function Zue(e,t){let r=e.languageDataAt("commentTokens",t,1);return r.length?r[0]:{}}const Mj=50;function AWt(e,{open:t,close:r},n,s){let a=e.sliceDoc(n-Mj,n),i=e.sliceDoc(s,s+Mj),l=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(i)[0].length,u=a.length-l;if(a.slice(u-t.length,u)==t&&i.slice(c,c+r.length)==r)return{open:{pos:n-l,margin:l&&1},close:{pos:s+c,margin:c&&1}};let d,f;s-n<=2*Mj?d=f=e.sliceDoc(n,s):(d=e.sliceDoc(n,n+Mj),f=e.sliceDoc(s-Mj,s));let h=/^\s*/.exec(d)[0].length,p=/\s*$/.exec(f)[0].length,m=f.length-p-r.length;return d.slice(h,h+t.length)==t&&f.slice(m,m+r.length)==r?{open:{pos:n+h+t.length,margin:/\s/.test(d.charAt(h+t.length))?1:0},close:{pos:s-p-r.length,margin:/\s/.test(f.charAt(m-1))?1:0}}:null}function IWt(e){let t=[];for(let r of e.selection.ranges){let n=e.doc.lineAt(r.from),s=r.to<=n.to?n:e.doc.lineAt(r.to);s.from>n.from&&s.from==r.to&&(s=r.to==n.to+1?n:e.doc.lineAt(r.to-1));let a=t.length-1;a>=0&&t[a].to>n.from?t[a].to=s.to:t.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:s.to})}return t}function xZe(e,t,r=t.selection.ranges){let n=r.map(a=>Zue(t,a.from).block);if(!n.every(a=>a))return null;let s=r.map((a,i)=>AWt(t,n[i],a.from,a.to));if(e!=2&&!s.every(a=>a))return{changes:t.changes(r.map((a,i)=>s[i]?[]:[{from:a.from,insert:n[i].open+" "},{from:a.to,insert:" "+n[i].close}]))};if(e!=1&&s.some(a=>a)){let a=[];for(let i=0,l;i<s.length;i++)if(l=s[i]){let c=n[i],{open:u,close:d}=l;a.push({from:u.pos-c.open.length,to:u.pos+u.margin},{from:d.pos-d.margin,to:d.pos+c.close.length})}return{changes:a}}return null}function RWt(e,t,r=t.selection.ranges){let n=[],s=-1;e:for(let{from:a,to:i}of r){let l=n.length,c=1e9,u;for(let d=a;d<=i;){let f=t.doc.lineAt(d);if(u==null&&(u=Zue(t,f.from).line,!u))continue e;if(f.from>s&&(a==i||i>f.from)){s=f.from;let h=/^\s*/.exec(f.text)[0].length,p=h==f.length,m=f.text.slice(h,h+u.length)==u?h:-1;h<f.text.length&&h<c&&(c=h),n.push({line:f,comment:m,token:u,indent:h,empty:p,single:!1})}d=f.to+1}if(c<1e9)for(let d=l;d<n.length;d++)n[d].indent<n[d].line.text.length&&(n[d].indent=c);n.length==l+1&&(n[l].single=!0)}if(e!=2&&n.some(a=>a.comment<0&&(!a.empty||a.single))){let a=[];for(let{line:l,token:c,indent:u,empty:d,single:f}of n)(f||!d)&&a.push({from:l.from+u,insert:c+" "});let i=t.changes(a);return{changes:i,selection:t.selection.map(i,1)}}else if(e!=1&&n.some(a=>a.comment>=0)){let a=[];for(let{line:i,comment:l,token:c}of n)if(l>=0){let u=i.from+l,d=u+c.length;i.text[d-i.from]==" "&&d++,a.push({from:u,to:d})}return{changes:a}}return null}const sse=pg.define(),PWt=pg.define(),MWt=Kt.define(),wZe=Kt.define({combine(e){return mg(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,r)=>r},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,r)=>(n,s)=>t(n,s)||r(n,s)})}}),SZe=Oo.define({create(){return Nm.empty},update(e,t){let r=t.state.facet(wZe),n=t.annotation(sse);if(n){let c=Lu.fromTransaction(t,n.selection),u=n.side,d=u==0?e.undone:e.done;return c?d=Y3(d,d.length,r.minDepth,c):d=_Ze(d,t.startState.selection),new Nm(u==0?n.rest:d,u==0?d:n.rest)}let s=t.annotation(PWt);if((s=="full"||s=="before")&&(e=e.isolate()),t.annotation(Mo.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=Lu.fromTransaction(t),i=t.annotation(Mo.time),l=t.annotation(Mo.userEvent);return a?e=e.addChanges(a,i,l,r,t):t.selection&&(e=e.addSelection(t.startState.selection,i,l,r.newGroupDelay)),(s=="full"||s=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new Nm(e.done.map(Lu.fromJSON),e.undone.map(Lu.fromJSON))}});function DWt(e={}){return[SZe,wZe.of(e),ft.domEventHandlers({beforeinput(t,r){let n=t.inputType=="historyUndo"?OZe:t.inputType=="historyRedo"?ase:null;return n?(t.preventDefault(),n(r)):!1}})]}function UF(e,t){return function({state:r,dispatch:n}){if(!t&&r.readOnly)return!1;let s=r.field(SZe,!1);if(!s)return!1;let a=s.pop(e,r,t);return a?(n(a),!0):!1}}const OZe=UF(0,!1),ase=UF(1,!1),LWt=UF(0,!0),$Wt=UF(1,!0);class Lu{constructor(t,r,n,s,a){this.changes=t,this.effects=r,this.mapped=n,this.startSelection=s,this.selectionsAfter=a}setSelAfter(t){return new Lu(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,r,n;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(r=this.mapped)===null||r===void 0?void 0:r.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(t){return new Lu(t.changes&&Io.fromJSON(t.changes),[],t.mapped&&Vm.fromJSON(t.mapped),t.startSelection&&nt.fromJSON(t.startSelection),t.selectionsAfter.map(nt.fromJSON))}static fromTransaction(t,r){let n=oh;for(let s of t.startState.facet(MWt)){let a=s(t);a.length&&(n=n.concat(a))}return!n.length&&t.changes.empty?null:new Lu(t.changes.invert(t.startState.doc),n,void 0,r||t.startState.selection,oh)}static selection(t){return new Lu(void 0,oh,void 0,void 0,t)}}function Y3(e,t,r,n){let s=t+1>r+20?t-r-1:0,a=e.slice(s,t);return a.push(n),a}function FWt(e,t){let r=[],n=!1;return e.iterChangedRanges((s,a)=>r.push(s,a)),t.iterChangedRanges((s,a,i,l)=>{for(let c=0;c<r.length;){let u=r[c++],d=r[c++];l>=u&&i<=d&&(n=!0)}}),n}function zWt(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((r,n)=>r.empty!=t.ranges[n].empty).length===0}function kZe(e,t){return e.length?t.length?e.concat(t):e:t}const oh=[],BWt=200;function _Ze(e,t){if(e.length){let r=e[e.length-1],n=r.selectionsAfter.slice(Math.max(0,r.selectionsAfter.length-BWt));return n.length&&n[n.length-1].eq(t)?e:(n.push(t),Y3(e,e.length-1,1e9,r.setSelAfter(n)))}else return[Lu.selection([t])]}function UWt(e){let t=e[e.length-1],r=e.slice();return r[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),r}function wV(e,t){if(!e.length)return e;let r=e.length,n=oh;for(;r;){let s=VWt(e[r-1],t,n);if(s.changes&&!s.changes.empty||s.effects.length){let a=e.slice(0,r);return a[r-1]=s,a}else t=s.mapped,r--,n=s.selectionsAfter}return n.length?[Lu.selection(n)]:oh}function VWt(e,t,r){let n=kZe(e.selectionsAfter.length?e.selectionsAfter.map(l=>l.map(t)):oh,r);if(!e.changes)return Lu.selection(n);let s=e.changes.map(t),a=t.mapDesc(e.changes,!0),i=e.mapped?e.mapped.composeDesc(a):a;return new Lu(s,rn.mapEffects(e.effects,t),i,e.startSelection.map(a),n)}const qWt=/^(input\.type|delete)($|\.)/;class Nm{constructor(t,r,n=0,s=void 0){this.done=t,this.undone=r,this.prevTime=n,this.prevUserEvent=s}isolate(){return this.prevTime?new Nm(this.done,this.undone):this}addChanges(t,r,n,s,a){let i=this.done,l=i[i.length-1];return l&&l.changes&&!l.changes.empty&&t.changes&&(!n||qWt.test(n))&&(!l.selectionsAfter.length&&r-this.prevTime<s.newGroupDelay&&s.joinToEvent(a,FWt(l.changes,t.changes))||n=="input.type.compose")?i=Y3(i,i.length-1,s.minDepth,new Lu(t.changes.compose(l.changes),kZe(rn.mapEffects(t.effects,l.changes),l.effects),l.mapped,l.startSelection,oh)):i=Y3(i,i.length,s.minDepth,t),new Nm(i,oh,r,n)}addSelection(t,r,n,s){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:oh;return a.length>0&&r-this.prevTime<s&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&zWt(a[a.length-1],t)?this:new Nm(_Ze(this.done,t),this.undone,r,n)}addMapping(t){return new Nm(wV(this.done,t),wV(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,r,n){let s=t==0?this.done:this.undone;if(s.length==0)return null;let a=s[s.length-1],i=a.selectionsAfter[0]||(a.startSelection?a.startSelection.map(a.changes.invertedDesc,1):r.selection);if(n&&a.selectionsAfter.length)return r.update({selection:a.selectionsAfter[a.selectionsAfter.length-1],annotations:sse.of({side:t,rest:UWt(s),selection:i}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(a.changes){let l=s.length==1?oh:s.slice(0,s.length-1);return a.mapped&&(l=wV(l,a.mapped)),r.update({changes:a.changes,selection:a.startSelection,effects:a.effects,annotations:sse.of({side:t,rest:l,selection:i}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}Nm.empty=new Nm(oh,oh);const HWt=[{key:"Mod-z",run:OZe,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:ase,preventDefault:!0},{linux:"Ctrl-Shift-z",run:ase,preventDefault:!0},{key:"Mod-u",run:LWt,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:$Wt,preventDefault:!0}];function qE(e,t){return nt.create(e.ranges.map(t),e.mainIndex)}function Mp(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function Dp({state:e,dispatch:t},r){let n=qE(e.selection,r);return n.eq(e.selection,!0)?!1:(t(Mp(e,n)),!0)}function VF(e,t){return nt.cursor(t?e.to:e.from)}function EZe(e,t){return Dp(e,r=>r.empty?e.moveByChar(r,t):VF(r,t))}function kc(e){return e.textDirectionAt(e.state.selection.main.head)==$a.LTR}const CZe=e=>EZe(e,!kc(e)),jZe=e=>EZe(e,kc(e));function TZe(e,t){return Dp(e,r=>r.empty?e.moveByGroup(r,t):VF(r,t))}const QWt=e=>TZe(e,!kc(e)),WWt=e=>TZe(e,kc(e));function GWt(e,t,r){if(t.type.prop(r))return!0;let n=t.to-t.from;return n&&(n>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function qF(e,t,r){let n=Ra(e).resolveInner(t.head),s=r?pn.closedBy:pn.openedBy;for(let c=t.head;;){let u=r?n.childAfter(c):n.childBefore(c);if(!u)break;GWt(e,u,s)?n=u:c=r?u.to:u.from}let a=n.type.prop(s),i,l;return a&&(i=r?Tm(e,n.from,1):Tm(e,n.to,-1))&&i.matched?l=r?i.end.to:i.end.from:l=r?n.to:n.from,nt.cursor(l,r?-1:1)}const ZWt=e=>Dp(e,t=>qF(e.state,t,!kc(e))),YWt=e=>Dp(e,t=>qF(e.state,t,kc(e)));function NZe(e,t){return Dp(e,r=>{if(!r.empty)return VF(r,t);let n=e.moveVertically(r,t);return n.head!=r.head?n:e.moveToLineBoundary(r,t)})}const AZe=e=>NZe(e,!1),IZe=e=>NZe(e,!0);function RZe(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,r=0,n=0,s;if(t){for(let a of e.state.facet(ft.scrollMargins)){let i=a(e);i?.top&&(r=Math.max(i?.top,r)),i?.bottom&&(n=Math.max(i?.bottom,n))}s=e.scrollDOM.clientHeight-r-n}else s=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:r,marginBottom:n,selfScroll:t,height:Math.max(e.defaultLineHeight,s-5)}}function PZe(e,t){let r=RZe(e),{state:n}=e,s=qE(n.selection,i=>i.empty?e.moveVertically(i,t,r.height):VF(i,t));if(s.eq(n.selection))return!1;let a;if(r.selfScroll){let i=e.coordsAtPos(n.selection.main.head),l=e.scrollDOM.getBoundingClientRect(),c=l.top+r.marginTop,u=l.bottom-r.marginBottom;i&&i.top>c&&i.bottom<u&&(a=ft.scrollIntoView(s.main.head,{y:"start",yMargin:i.top-c}))}return e.dispatch(Mp(n,s),{effects:a}),!0}const Fke=e=>PZe(e,!1),ise=e=>PZe(e,!0);function Gx(e,t,r){let n=e.lineBlockAt(t.head),s=e.moveToLineBoundary(t,r);if(s.head==t.head&&s.head!=(r?n.to:n.from)&&(s=e.moveToLineBoundary(t,r,!1)),!r&&s.head==n.from&&n.length){let a=/^\s*/.exec(e.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;a&&t.head!=n.from+a&&(s=nt.cursor(n.from+a))}return s}const XWt=e=>Dp(e,t=>Gx(e,t,!0)),KWt=e=>Dp(e,t=>Gx(e,t,!1)),JWt=e=>Dp(e,t=>Gx(e,t,!kc(e))),eGt=e=>Dp(e,t=>Gx(e,t,kc(e))),tGt=e=>Dp(e,t=>nt.cursor(e.lineBlockAt(t.head).from,1)),rGt=e=>Dp(e,t=>nt.cursor(e.lineBlockAt(t.head).to,-1));function nGt(e,t,r){let n=!1,s=qE(e.selection,a=>{let i=Tm(e,a.head,-1)||Tm(e,a.head,1)||a.head>0&&Tm(e,a.head-1,1)||a.head<e.doc.length&&Tm(e,a.head+1,-1);if(!i||!i.end)return a;n=!0;let l=i.start.from==a.head?i.end.to:i.end.from;return nt.cursor(l)});return n?(t(Mp(e,s)),!0):!1}const sGt=({state:e,dispatch:t})=>nGt(e,t);function Ph(e,t){let r=qE(e.state.selection,n=>{let s=t(n);return nt.range(n.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return r.eq(e.state.selection)?!1:(e.dispatch(Mp(e.state,r)),!0)}function MZe(e,t){return Ph(e,r=>e.moveByChar(r,t))}const DZe=e=>MZe(e,!kc(e)),LZe=e=>MZe(e,kc(e));function $Ze(e,t){return Ph(e,r=>e.moveByGroup(r,t))}const aGt=e=>$Ze(e,!kc(e)),iGt=e=>$Ze(e,kc(e)),oGt=e=>Ph(e,t=>qF(e.state,t,!kc(e))),lGt=e=>Ph(e,t=>qF(e.state,t,kc(e)));function FZe(e,t){return Ph(e,r=>e.moveVertically(r,t))}const zZe=e=>FZe(e,!1),BZe=e=>FZe(e,!0);function UZe(e,t){return Ph(e,r=>e.moveVertically(r,t,RZe(e).height))}const zke=e=>UZe(e,!1),Bke=e=>UZe(e,!0),cGt=e=>Ph(e,t=>Gx(e,t,!0)),uGt=e=>Ph(e,t=>Gx(e,t,!1)),dGt=e=>Ph(e,t=>Gx(e,t,!kc(e))),fGt=e=>Ph(e,t=>Gx(e,t,kc(e))),hGt=e=>Ph(e,t=>nt.cursor(e.lineBlockAt(t.head).from)),pGt=e=>Ph(e,t=>nt.cursor(e.lineBlockAt(t.head).to)),Uke=({state:e,dispatch:t})=>(t(Mp(e,{anchor:0})),!0),Vke=({state:e,dispatch:t})=>(t(Mp(e,{anchor:e.doc.length})),!0),qke=({state:e,dispatch:t})=>(t(Mp(e,{anchor:e.selection.main.anchor,head:0})),!0),Hke=({state:e,dispatch:t})=>(t(Mp(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),mGt=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),gGt=({state:e,dispatch:t})=>{let r=HF(e).map(({from:n,to:s})=>nt.range(n,Math.min(s+1,e.doc.length)));return t(e.update({selection:nt.create(r),userEvent:"select"})),!0},yGt=({state:e,dispatch:t})=>{let r=qE(e.selection,n=>{let s=Ra(e),a=s.resolveStack(n.from,1);if(n.empty){let i=s.resolveStack(n.from,-1);i.node.from>=a.node.from&&i.node.to<=a.node.to&&(a=i)}for(let i=a;i;i=i.next){let{node:l}=i;if((l.from<n.from&&l.to>=n.to||l.to>n.to&&l.from<=n.from)&&i.next)return nt.range(l.to,l.from)}return n});return r.eq(e.selection)?!1:(t(Mp(e,r)),!0)};function VZe(e,t){let{state:r}=e,n=r.selection,s=r.selection.ranges.slice();for(let a of r.selection.ranges){let i=r.doc.lineAt(a.head);if(t?i.to<e.state.doc.length:i.from>0)for(let l=a;;){let c=e.moveVertically(l,t);if(c.head<i.from||c.head>i.to){s.some(u=>u.head==c.head)||s.push(c);break}else{if(c.head==l.head)break;l=c}}}return s.length==n.ranges.length?!1:(e.dispatch(Mp(r,nt.create(s,s.length-1))),!0)}const vGt=e=>VZe(e,!1),bGt=e=>VZe(e,!0),xGt=({state:e,dispatch:t})=>{let r=e.selection,n=null;return r.ranges.length>1?n=nt.create([r.main]):r.main.empty||(n=nt.create([nt.cursor(r.main.head)])),n?(t(Mp(e,n)),!0):!1};function qR(e,t){if(e.state.readOnly)return!1;let r="delete.selection",{state:n}=e,s=n.changeByRange(a=>{let{from:i,to:l}=a;if(i==l){let c=t(a);c<i?(r="delete.backward",c=nD(e,c,!1)):c>i&&(r="delete.forward",c=nD(e,c,!0)),i=Math.min(i,c),l=Math.max(l,c)}else i=nD(e,i,!1),l=nD(e,l,!0);return i==l?{range:a}:{changes:{from:i,to:l},range:nt.cursor(i,i<a.head?-1:1)}});return s.changes.empty?!1:(e.dispatch(n.update(s,{scrollIntoView:!0,userEvent:r,effects:r=="delete.selection"?ft.announce.of(n.phrase("Selection deleted")):void 0})),!0)}function nD(e,t,r){if(e instanceof ft)for(let n of e.state.facet(ft.atomicRanges).map(s=>s(e)))n.between(t,t,(s,a)=>{s<t&&a>t&&(t=r?a:s)});return t}const qZe=(e,t,r)=>qR(e,n=>{let s=n.from,{state:a}=e,i=a.doc.lineAt(s),l,c;if(r&&!t&&s>i.from&&s<i.from+200&&!/[^ \t]/.test(l=i.text.slice(0,s-i.from))){if(l[l.length-1]==" ")return s-1;let u=Sp(l,a.tabSize),d=u%cS(a)||cS(a);for(let f=0;f<d&&l[l.length-1-f]==" ";f++)s--;c=s}else c=yl(i.text,s-i.from,t,t)+i.from,c==s&&i.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(i.text.slice(c-i.from,s-i.from))&&(c=yl(i.text,c-i.from,!1,!1)+i.from);return c}),ose=e=>qZe(e,!1,!0),HZe=e=>qZe(e,!0,!1),QZe=(e,t)=>qR(e,r=>{let n=r.head,{state:s}=e,a=s.doc.lineAt(n),i=s.charCategorizer(n);for(let l=null;;){if(n==(t?a.to:a.from)){n==r.head&&a.number!=(t?s.doc.lines:1)&&(n+=t?1:-1);break}let c=yl(a.text,n-a.from,t)+a.from,u=a.text.slice(Math.min(n,c)-a.from,Math.max(n,c)-a.from),d=i(u);if(l!=null&&d!=l)break;(u!=" "||n!=r.head)&&(l=d),n=c}return n}),WZe=e=>QZe(e,!1),wGt=e=>QZe(e,!0),SGt=e=>qR(e,t=>{let r=e.lineBlockAt(t.head).to;return t.head<r?r:Math.min(e.state.doc.length,t.head+1)}),OGt=e=>qR(e,t=>{let r=e.moveToLineBoundary(t,!1).head;return t.head>r?r:Math.max(0,t.head-1)}),kGt=e=>qR(e,t=>{let r=e.moveToLineBoundary(t,!0).head;return t.head<r?r:Math.min(e.state.doc.length,t.head+1)}),_Gt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:Fs.of(["",""])},range:nt.cursor(n.from)}));return t(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0},EGt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(n=>{if(!n.empty||n.from==0||n.from==e.doc.length)return{range:n};let s=n.from,a=e.doc.lineAt(s),i=s==a.from?s-1:yl(a.text,s-a.from,!1)+a.from,l=s==a.to?s+1:yl(a.text,s-a.from,!0)+a.from;return{changes:{from:i,to:l,insert:e.doc.slice(s,l).append(e.doc.slice(i,s))},range:nt.cursor(l)}});return r.changes.empty?!1:(t(e.update(r,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function HF(e){let t=[],r=-1;for(let n of e.selection.ranges){let s=e.doc.lineAt(n.from),a=e.doc.lineAt(n.to);if(!n.empty&&n.to==a.from&&(a=e.doc.lineAt(n.to-1)),r>=s.number){let i=t[t.length-1];i.to=a.to,i.ranges.push(n)}else t.push({from:s.from,to:a.to,ranges:[n]});r=a.number+1}return t}function GZe(e,t,r){if(e.readOnly)return!1;let n=[],s=[];for(let a of HF(e)){if(r?a.to==e.doc.length:a.from==0)continue;let i=e.doc.lineAt(r?a.to+1:a.from-1),l=i.length+1;if(r){n.push({from:a.to,to:i.to},{from:a.from,insert:i.text+e.lineBreak});for(let c of a.ranges)s.push(nt.range(Math.min(e.doc.length,c.anchor+l),Math.min(e.doc.length,c.head+l)))}else{n.push({from:i.from,to:a.from},{from:a.to,insert:e.lineBreak+i.text});for(let c of a.ranges)s.push(nt.range(c.anchor-l,c.head-l))}}return n.length?(t(e.update({changes:n,scrollIntoView:!0,selection:nt.create(s,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const CGt=({state:e,dispatch:t})=>GZe(e,t,!1),jGt=({state:e,dispatch:t})=>GZe(e,t,!0);function ZZe(e,t,r){if(e.readOnly)return!1;let n=[];for(let a of HF(e))r?n.push({from:a.from,insert:e.doc.slice(a.from,a.to)+e.lineBreak}):n.push({from:a.to,insert:e.lineBreak+e.doc.slice(a.from,a.to)});let s=e.changes(n);return t(e.update({changes:s,selection:e.selection.map(s,r?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const TGt=({state:e,dispatch:t})=>ZZe(e,t,!1),NGt=({state:e,dispatch:t})=>ZZe(e,t,!0),AGt=e=>{if(e.state.readOnly)return!1;let{state:t}=e,r=t.changes(HF(t).map(({from:s,to:a})=>(s>0?s--:a<t.doc.length&&a++,{from:s,to:a}))),n=qE(t.selection,s=>{let a;if(e.lineWrapping){let i=e.lineBlockAt(s.head),l=e.coordsAtPos(s.head,s.assoc||1);l&&(a=i.bottom+e.documentTop-l.bottom+e.defaultLineHeight/2)}return e.moveVertically(s,!0,a)}).map(r);return e.dispatch({changes:r,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function IGt(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let r=Ra(e).resolveInner(t),n=r.childBefore(t),s=r.childAfter(t),a;return n&&s&&n.to<=t&&s.from>=t&&(a=n.type.prop(pn.closedBy))&&a.indexOf(s.name)>-1&&e.doc.lineAt(n.to).from==e.doc.lineAt(s.from).from&&!/\S/.test(e.sliceDoc(n.to,s.from))?{from:n.to,to:s.from}:null}const Qke=YZe(!1),RGt=YZe(!0);function YZe(e){return({state:t,dispatch:r})=>{if(t.readOnly)return!1;let n=t.changeByRange(s=>{let{from:a,to:i}=s,l=t.doc.lineAt(a),c=!e&&a==i&&IGt(t,a);e&&(a=i=(i<=l.to?l:t.doc.lineAt(i)).to);let u=new $F(t,{simulateBreak:a,simulateDoubleBreak:!!c}),d=gue(u,a);for(d==null&&(d=Sp(/^\s*/.exec(t.doc.lineAt(a).text)[0],t.tabSize));i<l.to&&/\s/.test(l.text[i-l.from]);)i++;c?{from:a,to:i}=c:a>l.from&&a<l.from+100&&!/\S/.test(l.text.slice(0,a))&&(a=l.from);let f=["",xA(t,d)];return c&&f.push(xA(t,u.lineIndent(l.from,-1))),{changes:{from:a,to:i,insert:Fs.of(f)},range:nt.cursor(a+1+f[1].length)}});return r(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}}function Yue(e,t){let r=-1;return e.changeByRange(n=>{let s=[];for(let i=n.from;i<=n.to;){let l=e.doc.lineAt(i);l.number>r&&(n.empty||n.to>l.from)&&(t(l,s,n),r=l.number),i=l.to+1}let a=e.changes(s);return{changes:s,range:nt.range(a.mapPos(n.anchor,1),a.mapPos(n.head,1))}})}const PGt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=Object.create(null),n=new $F(e,{overrideIndentation:a=>{let i=r[a];return i??-1}}),s=Yue(e,(a,i,l)=>{let c=gue(n,a.from);if(c==null)return;/\S/.test(a.text)||(c=0);let u=/^\s*/.exec(a.text)[0],d=xA(e,c);(u!=d||l.from<a.from+u.length)&&(r[a.from]=c,i.push({from:a.from,to:a.from+u.length,insert:d}))});return s.changes.empty||t(e.update(s,{userEvent:"indent"})),!0},XZe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Yue(e,(r,n)=>{n.push({from:r.from,insert:e.facet(BE)})}),{userEvent:"input.indent"})),!0),KZe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Yue(e,(r,n)=>{let s=/^\s*/.exec(r.text)[0];if(!s)return;let a=Sp(s,e.tabSize),i=0,l=xA(e,Math.max(0,a-cS(e)));for(;i<s.length&&i<l.length&&s.charCodeAt(i)==l.charCodeAt(i);)i++;n.push({from:r.from+i,to:r.from+s.length,insert:l.slice(i)})}),{userEvent:"delete.dedent"})),!0),MGt=e=>(e.setTabFocusMode(),!0),DGt=[{key:"Ctrl-b",run:CZe,shift:DZe,preventDefault:!0},{key:"Ctrl-f",run:jZe,shift:LZe},{key:"Ctrl-p",run:AZe,shift:zZe},{key:"Ctrl-n",run:IZe,shift:BZe},{key:"Ctrl-a",run:tGt,shift:hGt},{key:"Ctrl-e",run:rGt,shift:pGt},{key:"Ctrl-d",run:HZe},{key:"Ctrl-h",run:ose},{key:"Ctrl-k",run:SGt},{key:"Ctrl-Alt-h",run:WZe},{key:"Ctrl-o",run:_Gt},{key:"Ctrl-t",run:EGt},{key:"Ctrl-v",run:ise}],LGt=[{key:"ArrowLeft",run:CZe,shift:DZe,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:QWt,shift:aGt,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:JWt,shift:dGt,preventDefault:!0},{key:"ArrowRight",run:jZe,shift:LZe,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:WWt,shift:iGt,preventDefault:!0},{mac:"Cmd-ArrowRight",run:eGt,shift:fGt,preventDefault:!0},{key:"ArrowUp",run:AZe,shift:zZe,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Uke,shift:qke},{mac:"Ctrl-ArrowUp",run:Fke,shift:zke},{key:"ArrowDown",run:IZe,shift:BZe,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Vke,shift:Hke},{mac:"Ctrl-ArrowDown",run:ise,shift:Bke},{key:"PageUp",run:Fke,shift:zke},{key:"PageDown",run:ise,shift:Bke},{key:"Home",run:KWt,shift:uGt,preventDefault:!0},{key:"Mod-Home",run:Uke,shift:qke},{key:"End",run:XWt,shift:cGt,preventDefault:!0},{key:"Mod-End",run:Vke,shift:Hke},{key:"Enter",run:Qke,shift:Qke},{key:"Mod-a",run:mGt},{key:"Backspace",run:ose,shift:ose,preventDefault:!0},{key:"Delete",run:HZe,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:WZe,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:wGt,preventDefault:!0},{mac:"Mod-Backspace",run:OGt,preventDefault:!0},{mac:"Mod-Delete",run:kGt,preventDefault:!0}].concat(DGt.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),$Gt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:ZWt,shift:oGt},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:YWt,shift:lGt},{key:"Alt-ArrowUp",run:CGt},{key:"Shift-Alt-ArrowUp",run:TGt},{key:"Alt-ArrowDown",run:jGt},{key:"Shift-Alt-ArrowDown",run:NGt},{key:"Mod-Alt-ArrowUp",run:vGt},{key:"Mod-Alt-ArrowDown",run:bGt},{key:"Escape",run:xGt},{key:"Mod-Enter",run:RGt},{key:"Alt-l",mac:"Ctrl-l",run:gGt},{key:"Mod-i",run:yGt,preventDefault:!0},{key:"Mod-[",run:KZe},{key:"Mod-]",run:XZe},{key:"Mod-Alt-\\",run:PGt},{key:"Shift-Mod-k",run:AGt},{key:"Shift-Mod-\\",run:sGt},{key:"Mod-/",run:CWt},{key:"Alt-A",run:TWt},{key:"Ctrl-m",mac:"Shift-Alt-m",run:MGt}].concat(LGt),FGt={key:"Tab",run:XZe,shift:KZe},Wke=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class qy{constructor(t,r,n=0,s=t.length,a,i){this.test=i,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(n,s),this.bufferStart=n,this.normalize=a?l=>a(Wke(l)):Wke,this.query=this.normalize(r)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Nu(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let r=Xce(t),n=this.bufferStart+this.bufferPos;this.bufferPos+=vm(t);let s=this.normalize(r);if(s.length)for(let a=0,i=n;;a++){let l=s.charCodeAt(a),c=this.match(l,i,this.bufferPos+this.bufferStart);if(a==s.length-1){if(c)return this.value=c,this;break}i==n&&a<r.length&&r.charCodeAt(a)==l&&i++}}}match(t,r,n){let s=null;for(let a=0;a<this.matches.length;a+=2){let i=this.matches[a],l=!1;this.query.charCodeAt(i)==t&&(i==this.query.length-1?s={from:this.matches[a+1],to:n}:(this.matches[a]++,l=!0)),l||(this.matches.splice(a,2),a-=2)}return this.query.charCodeAt(0)==t&&(this.query.length==1?s={from:r,to:n}:this.matches.push(1,r)),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s}}typeof Symbol<"u"&&(qy.prototype[Symbol.iterator]=function(){return this});const JZe={from:-1,to:-1,match:/.*/.exec("")},Xue="gm"+(/x/.unicode==null?"":"u");class eYe{constructor(t,r,n,s=0,a=t.length){if(this.text=t,this.to=a,this.curLine="",this.done=!1,this.value=JZe,/\\[sWDnr]|\n|\r|\[\^/.test(r))return new tYe(t,r,n,s,a);this.re=new RegExp(r,Xue+(n?.ignoreCase?"i":"")),this.test=n?.test,this.iter=t.iter();let i=t.lineAt(s);this.curLineStart=i.from,this.matchPos=X3(t,s),this.getLine(this.curLineStart)}getLine(t){this.iter.next(t),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let r=this.matchPos<=this.to&&this.re.exec(this.curLine);if(r){let n=this.curLineStart+r.index,s=n+r[0].length;if(this.matchPos=X3(this.text,s+(n==s?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<s||n>this.value.to)&&(!this.test||this.test(n,s,r)))return this.value={from:n,to:s,match:r},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),t=0;else return this.done=!0,this}}}const SV=new WeakMap;class Bk{constructor(t,r){this.from=t,this.text=r}get to(){return this.from+this.text.length}static get(t,r,n){let s=SV.get(t);if(!s||s.from>=n||s.to<=r){let l=new Bk(r,t.sliceString(r,n));return SV.set(t,l),l}if(s.from==r&&s.to==n)return s;let{text:a,from:i}=s;return i>r&&(a=t.sliceString(r,i)+a,i=r),s.to<n&&(a+=t.sliceString(s.to,n)),SV.set(t,new Bk(i,a)),new Bk(r,a.slice(r-i,n-i))}}class tYe{constructor(t,r,n,s,a){this.text=t,this.to=a,this.done=!1,this.value=JZe,this.matchPos=X3(t,s),this.re=new RegExp(r,Xue+(n?.ignoreCase?"i":"")),this.test=n?.test,this.flat=Bk.get(t,s,this.chunkEnd(s+5e3))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,r=this.re.exec(this.flat.text);if(r&&!r[0]&&r.index==t&&(this.re.lastIndex=t+1,r=this.re.exec(this.flat.text)),r){let n=this.flat.from+r.index,s=n+r[0].length;if((this.flat.to>=this.to||r.index+r[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,s,r)))return this.value={from:n,to:s,match:r},this.matchPos=X3(this.text,s+(n==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Bk.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(eYe.prototype[Symbol.iterator]=tYe.prototype[Symbol.iterator]=function(){return this});function zGt(e){try{return new RegExp(e,Xue),!0}catch{return!1}}function X3(e,t){if(t>=e.length)return t;let r=e.lineAt(t),n;for(;t<r.to&&(n=r.text.charCodeAt(t-r.from))>=56320&&n<57344;)t++;return t}const BGt=e=>{let{state:t}=e,r=String(t.doc.lineAt(e.state.selection.main.head).number),{close:n,result:s}=CUt(e,{label:t.phrase("Go to line"),input:{type:"text",name:"line",value:r},focus:!0,submitLabel:t.phrase("go")});return s.then(a=>{let i=a&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(a.elements.line.value);if(!i){e.dispatch({effects:n});return}let l=t.doc.lineAt(t.selection.main.head),[,c,u,d,f]=i,h=d?+d.slice(1):0,p=u?+u:l.number;if(u&&f){let y=p/100;c&&(y=y*(c=="-"?-1:1)+l.number/t.doc.lines),p=Math.round(t.doc.lines*y)}else u&&c&&(p=p*(c=="-"?-1:1)+l.number);let m=t.doc.line(Math.max(1,Math.min(t.doc.lines,p))),g=nt.cursor(m.from+Math.max(0,Math.min(h,m.length)));e.dispatch({effects:[n,ft.scrollIntoView(g.from,{y:"center"})],selection:g})}),!0},UGt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},VGt=Kt.define({combine(e){return mg(e,UGt,{highlightWordAroundCursor:(t,r)=>t||r,minSelectionLength:Math.min,maxMatches:Math.min})}});function qGt(e){return[ZGt,GGt]}const HGt=er.mark({class:"cm-selectionMatch"}),QGt=er.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Gke(e,t,r,n){return(r==0||e(t.sliceDoc(r-1,r))!=xi.Word)&&(n==t.doc.length||e(t.sliceDoc(n,n+1))!=xi.Word)}function WGt(e,t,r,n){return e(t.sliceDoc(r,r+1))==xi.Word&&e(t.sliceDoc(n-1,n))==xi.Word}const GGt=Oi.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(VGt),{state:r}=e,n=r.selection;if(n.ranges.length>1)return er.none;let s=n.main,a,i=null;if(s.empty){if(!t.highlightWordAroundCursor)return er.none;let c=r.wordAt(s.head);if(!c)return er.none;i=r.charCategorizer(s.head),a=r.sliceDoc(c.from,c.to)}else{let c=s.to-s.from;if(c<t.minSelectionLength||c>200)return er.none;if(t.wholeWords){if(a=r.sliceDoc(s.from,s.to),i=r.charCategorizer(s.head),!(Gke(i,r,s.from,s.to)&&WGt(i,r,s.from,s.to)))return er.none}else if(a=r.sliceDoc(s.from,s.to),!a)return er.none}let l=[];for(let c of e.visibleRanges){let u=new qy(r.doc,a,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!i||Gke(i,r,d,f))&&(s.empty&&d<=s.from&&f>=s.to?l.push(QGt.range(d,f)):(d>=s.to||f<=s.from)&&l.push(HGt.range(d,f)),l.length>t.maxMatches))return er.none}}return er.set(l)}},{decorations:e=>e.decorations}),ZGt=ft.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),YGt=({state:e,dispatch:t})=>{let{selection:r}=e,n=nt.create(r.ranges.map(s=>e.wordAt(s.head)||nt.cursor(s.head)),r.mainIndex);return n.eq(r)?!1:(t(e.update({selection:n})),!0)};function XGt(e,t){let{main:r,ranges:n}=e.selection,s=e.wordAt(r.head),a=s&&s.from==r.from&&s.to==r.to;for(let i=!1,l=new qy(e.doc,t,n[n.length-1].to);;)if(l.next(),l.done){if(i)return null;l=new qy(e.doc,t,0,Math.max(0,n[n.length-1].from-1)),i=!0}else{if(i&&n.some(c=>c.from==l.value.from))continue;if(a){let c=e.wordAt(l.value.from);if(!c||c.from!=l.value.from||c.to!=l.value.to)continue}return l.value}}const KGt=({state:e,dispatch:t})=>{let{ranges:r}=e.selection;if(r.some(a=>a.from===a.to))return YGt({state:e,dispatch:t});let n=e.sliceDoc(r[0].from,r[0].to);if(e.selection.ranges.some(a=>e.sliceDoc(a.from,a.to)!=n))return!1;let s=XGt(e,n);return s?(t(e.update({selection:e.selection.addRange(nt.range(s.from,s.to),!1),effects:ft.scrollIntoView(s.to)})),!0):!1},HE=Kt.define({combine(e){return mg(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new fZt(t),scrollToMatch:t=>ft.scrollIntoView(t)})}});class rYe{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||zGt(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord,this.test=t.test}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(r,n)=>n=="n"?`
|
|
116
116
|
`:n=="r"?"\r":n=="t"?" ":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord&&this.test==t.test}create(){return this.regexp?new sZt(this):new tZt(this)}getCursor(t,r=0,n){let s=t.doc?t:zn.create({doc:t});return n==null&&(n=s.doc.length),this.regexp?BO(this,s,r,n):zO(this,s,r,n)}}class nYe{constructor(t){this.spec=t}}function JGt(e,t,r){return(n,s,a,i)=>{if(r&&!r(n,s,a,i))return!1;let l=n>=i&&s<=i+a.length?a.slice(n-i,s-i):t.doc.sliceString(n,s);return e(l,t,n,s)}}function zO(e,t,r,n){let s;return e.wholeWord&&(s=eZt(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(s=JGt(e.test,t,s)),new qy(t.doc,e.unquoted,r,n,e.caseSensitive?void 0:a=>a.toLowerCase(),s)}function eZt(e,t){return(r,n,s,a)=>((a>r||a+s.length<n)&&(a=Math.max(0,r-2),s=e.sliceString(a,Math.min(e.length,n+2))),(t(K3(s,r-a))!=xi.Word||t(J3(s,r-a))!=xi.Word)&&(t(J3(s,n-a))!=xi.Word||t(K3(s,n-a))!=xi.Word))}class tZt extends nYe{constructor(t){super(t)}nextMatch(t,r,n){let s=zO(this.spec,t,n,t.doc.length).nextOverlapping();if(s.done){let a=Math.min(t.doc.length,r+this.spec.unquoted.length);s=zO(this.spec,t,0,a).nextOverlapping()}return s.done||s.value.from==r&&s.value.to==n?null:s.value}prevMatchInRange(t,r,n){for(let s=n;;){let a=Math.max(r,s-1e4-this.spec.unquoted.length),i=zO(this.spec,t,a,s),l=null;for(;!i.nextOverlapping().done;)l=i.value;if(l)return l;if(a==r)return null;s-=1e4}}prevMatch(t,r,n){let s=this.prevMatchInRange(t,0,r);return s||(s=this.prevMatchInRange(t,Math.max(0,n-this.spec.unquoted.length),t.doc.length)),s&&(s.from!=r||s.to!=n)?s:null}getReplacement(t){return this.spec.unquote(this.spec.replace)}matchAll(t,r){let n=zO(this.spec,t,0,t.doc.length),s=[];for(;!n.next().done;){if(s.length>=r)return null;s.push(n.value)}return s}highlight(t,r,n,s){let a=zO(this.spec,t,Math.max(0,r-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,t.doc.length));for(;!a.next().done;)s(a.value.from,a.value.to)}}function rZt(e,t,r){return(n,s,a)=>(!r||r(n,s,a))&&e(a[0],t,n,s)}function BO(e,t,r,n){let s;return e.wholeWord&&(s=nZt(t.charCategorizer(t.selection.main.head))),e.test&&(s=rZt(e.test,t,s)),new eYe(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:s},r,n)}function K3(e,t){return e.slice(yl(e,t,!1),t)}function J3(e,t){return e.slice(t,yl(e,t))}function nZt(e){return(t,r,n)=>!n[0].length||(e(K3(n.input,n.index))!=xi.Word||e(J3(n.input,n.index))!=xi.Word)&&(e(J3(n.input,n.index+n[0].length))!=xi.Word||e(K3(n.input,n.index+n[0].length))!=xi.Word)}class sZt extends nYe{nextMatch(t,r,n){let s=BO(this.spec,t,n,t.doc.length).next();return s.done&&(s=BO(this.spec,t,0,r).next()),s.done?null:s.value}prevMatchInRange(t,r,n){for(let s=1;;s++){let a=Math.max(r,n-s*1e4),i=BO(this.spec,t,a,n),l=null;for(;!i.next().done;)l=i.value;if(l&&(a==r||l.from>a+10))return l;if(a==r)return null}}prevMatch(t,r,n){return this.prevMatchInRange(t,0,r)||this.prevMatchInRange(t,n,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(r,n)=>{if(n=="&")return t.match[0];if(n=="$")return"$";for(let s=n.length;s>0;s--){let a=+n.slice(0,s);if(a>0&&a<t.match.length)return t.match[a]+n.slice(s)}return r})}matchAll(t,r){let n=BO(this.spec,t,0,t.doc.length),s=[];for(;!n.next().done;){if(s.length>=r)return null;s.push(n.value)}return s}highlight(t,r,n,s){let a=BO(this.spec,t,Math.max(0,r-250),Math.min(n+250,t.doc.length));for(;!a.next().done;)s(a.value.from,a.value.to)}}const NA=rn.define(),Kue=rn.define(),zb=Oo.define({create(e){return new OV(lse(e).create(),null)},update(e,t){for(let r of t.effects)r.is(NA)?e=new OV(r.value.create(),e.panel):r.is(Kue)&&(e=new OV(e.query,r.value?Jue:null));return e},provide:e=>bA.from(e,t=>t.panel)});class OV{constructor(t,r){this.query=t,this.panel=r}}const aZt=er.mark({class:"cm-searchMatch"}),iZt=er.mark({class:"cm-searchMatch cm-searchMatch-selected"}),oZt=Oi.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(zb))}update(e){let t=e.state.field(zb);(t!=e.startState.field(zb)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return er.none;let{view:r}=this,n=new nu;for(let s=0,a=r.visibleRanges,i=a.length;s<i;s++){let{from:l,to:c}=a[s];for(;s<i-1&&c>a[s+1].from-500;)c=a[++s].to;e.highlight(r.state,l,c,(u,d)=>{let f=r.state.selection.ranges.some(h=>h.from==u&&h.to==d);n.add(u,d,f?iZt:aZt)})}return n.finish()}},{decorations:e=>e.decorations});function HR(e){return t=>{let r=t.state.field(zb,!1);return r&&r.query.spec.valid?e(t,r):iYe(t)}}const e4=HR((e,{query:t})=>{let{to:r}=e.state.selection.main,n=t.nextMatch(e.state,r,r);if(!n)return!1;let s=nt.single(n.from,n.to),a=e.state.facet(HE);return e.dispatch({selection:s,effects:[ede(e,n),a.scrollToMatch(s.main,e)],userEvent:"select.search"}),aYe(e),!0}),t4=HR((e,{query:t})=>{let{state:r}=e,{from:n}=r.selection.main,s=t.prevMatch(r,n,n);if(!s)return!1;let a=nt.single(s.from,s.to),i=e.state.facet(HE);return e.dispatch({selection:a,effects:[ede(e,s),i.scrollToMatch(a.main,e)],userEvent:"select.search"}),aYe(e),!0}),lZt=HR((e,{query:t})=>{let r=t.matchAll(e.state,1e3);return!r||!r.length?!1:(e.dispatch({selection:nt.create(r.map(n=>nt.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),cZt=({state:e,dispatch:t})=>{let r=e.selection;if(r.ranges.length>1||r.main.empty)return!1;let{from:n,to:s}=r.main,a=[],i=0;for(let l=new qy(e.doc,e.sliceDoc(n,s));!l.next().done;){if(a.length>1e3)return!1;l.value.from==n&&(i=a.length),a.push(nt.range(l.value.from,l.value.to))}return t(e.update({selection:nt.create(a,i),userEvent:"select.search.matches"})),!0},Zke=HR((e,{query:t})=>{let{state:r}=e,{from:n,to:s}=r.selection.main;if(r.readOnly)return!1;let a=t.nextMatch(r,n,n);if(!a)return!1;let i=a,l=[],c,u,d=[];i.from==n&&i.to==s&&(u=r.toText(t.getReplacement(i)),l.push({from:i.from,to:i.to,insert:u}),i=t.nextMatch(r,i.from,i.to),d.push(ft.announce.of(r.phrase("replaced match on line $",r.doc.lineAt(n).number)+".")));let f=e.state.changes(l);return i&&(c=nt.single(i.from,i.to).map(f),d.push(ede(e,i)),d.push(r.facet(HE).scrollToMatch(c.main,e))),e.dispatch({changes:f,selection:c,effects:d,userEvent:"input.replace"}),!0}),uZt=HR((e,{query:t})=>{if(e.state.readOnly)return!1;let r=t.matchAll(e.state,1e9).map(s=>{let{from:a,to:i}=s;return{from:a,to:i,insert:t.getReplacement(s)}});if(!r.length)return!1;let n=e.state.phrase("replaced $ matches",r.length)+".";return e.dispatch({changes:r,effects:ft.announce.of(n),userEvent:"input.replace.all"}),!0});function Jue(e){return e.state.facet(HE).createPanel(e)}function lse(e,t){var r,n,s,a,i;let l=e.selection.main,c=l.empty||l.to>l.from+100?"":e.sliceDoc(l.from,l.to);if(t&&!c)return t;let u=e.facet(HE);return new rYe({search:((r=t?.literal)!==null&&r!==void 0?r:u.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(n=t?.caseSensitive)!==null&&n!==void 0?n:u.caseSensitive,literal:(s=t?.literal)!==null&&s!==void 0?s:u.literal,regexp:(a=t?.regexp)!==null&&a!==void 0?a:u.regexp,wholeWord:(i=t?.wholeWord)!==null&&i!==void 0?i:u.wholeWord})}function sYe(e){let t=pue(e,Jue);return t&&t.dom.querySelector("[main-field]")}function aYe(e){let t=sYe(e);t&&t==e.root.activeElement&&t.select()}const iYe=e=>{let t=e.state.field(zb,!1);if(t&&t.panel){let r=sYe(e);if(r&&r!=e.root.activeElement){let n=lse(e.state,t.query.spec);n.valid&&e.dispatch({effects:NA.of(n)}),r.focus(),r.select()}}else e.dispatch({effects:[Kue.of(!0),t?NA.of(lse(e.state,t.query.spec)):rn.appendConfig.of(pZt)]});return!0},oYe=e=>{let t=e.state.field(zb,!1);if(!t||!t.panel)return!1;let r=pue(e,Jue);return r&&r.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:Kue.of(!1)}),!0},dZt=[{key:"Mod-f",run:iYe,scope:"editor search-panel"},{key:"F3",run:e4,shift:t4,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:e4,shift:t4,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:oYe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:cZt},{key:"Mod-Alt-g",run:BGt},{key:"Mod-d",run:KGt,preventDefault:!0}];class fZt{constructor(t){this.view=t;let r=this.query=t.state.field(zb).query.spec;this.commit=this.commit.bind(this),this.searchField=Ca("input",{value:r.search,placeholder:xd(t,"Find"),"aria-label":xd(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Ca("input",{value:r.replace,placeholder:xd(t,"Replace"),"aria-label":xd(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Ca("input",{type:"checkbox",name:"case",form:"",checked:r.caseSensitive,onchange:this.commit}),this.reField=Ca("input",{type:"checkbox",name:"re",form:"",checked:r.regexp,onchange:this.commit}),this.wordField=Ca("input",{type:"checkbox",name:"word",form:"",checked:r.wholeWord,onchange:this.commit});function n(s,a,i){return Ca("button",{class:"cm-button",name:s,onclick:a,type:"button"},i)}this.dom=Ca("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,n("next",()=>e4(t),[xd(t,"next")]),n("prev",()=>t4(t),[xd(t,"previous")]),n("select",()=>lZt(t),[xd(t,"all")]),Ca("label",null,[this.caseField,xd(t,"match case")]),Ca("label",null,[this.reField,xd(t,"regexp")]),Ca("label",null,[this.wordField,xd(t,"by word")]),...t.state.readOnly?[]:[Ca("br"),this.replaceField,n("replace",()=>Zke(t),[xd(t,"replace")]),n("replaceAll",()=>uZt(t),[xd(t,"replace all")])],Ca("button",{name:"close",onclick:()=>oYe(t),"aria-label":xd(t,"close"),type:"button"},["×"])])}commit(){let t=new rYe({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:NA.of(t)}))}keydown(t){$7t(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?t4:e4)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),Zke(this.view))}update(t){for(let r of t.transactions)for(let n of r.effects)n.is(NA)&&!n.value.eq(this.query)&&this.setQuery(n.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(HE).top}}function xd(e,t){return e.state.phrase(t)}const sD=30,aD=/[\s\.,:;?!]/;function ede(e,{from:t,to:r}){let n=e.state.doc.lineAt(t),s=e.state.doc.lineAt(r).to,a=Math.max(n.from,t-sD),i=Math.min(s,r+sD),l=e.state.sliceDoc(a,i);if(a!=n.from){for(let c=0;c<sD;c++)if(!aD.test(l[c+1])&&aD.test(l[c])){l=l.slice(c);break}}if(i!=s){for(let c=l.length-1;c>l.length-sD;c--)if(!aD.test(l[c-1])&&aD.test(l[c])){l=l.slice(0,c);break}}return ft.announce.of(`${e.state.phrase("current match")}. ${l} ${e.state.phrase("on line")} ${n.number}.`)}const hZt=ft.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),pZt=[zb,Rp.low(oZt),hZt];class Yke{constructor(t,r,n){this.from=t,this.to=r,this.diagnostic=n}}class pw{constructor(t,r,n){this.diagnostics=t,this.panel=r,this.selected=n}static init(t,r,n){let s=n.facet(AA).markerFilter;s&&(t=s(t,n));let a=t.slice().sort((d,f)=>d.from-f.from||d.to-f.to),i=new nu,l=[],c=0;for(let d=0;;){let f=d==a.length?null:a[d];if(!f&&!l.length)break;let h,p;for(l.length?(h=c,p=l.reduce((g,y)=>Math.min(g,y.to),f&&f.from>h?f.from:1e8)):(h=f.from,p=f.to,l.push(f),d++);d<a.length;){let g=a[d];if(g.from==h&&(g.to>g.from||g.to==h))l.push(g),d++,p=Math.min(g.to,p);else{p=Math.min(g.from,p);break}}let m=CZt(l);if(l.some(g=>g.from==g.to||g.from==g.to-1&&n.doc.lineAt(g.from).to==g.from))i.add(h,h,er.widget({widget:new OZt(m),diagnostics:l.slice()}));else{let g=l.reduce((y,x)=>x.markClass?y+" "+x.markClass:y,"");i.add(h,p,er.mark({class:"cm-lintRange cm-lintRange-"+m+g,diagnostics:l.slice(),inclusiveEnd:l.some(y=>y.to>p)}))}c=p;for(let g=0;g<l.length;g++)l[g].to<=c&&l.splice(g--,1)}let u=i.finish();return new pw(u,r,A_(u))}}function A_(e,t=null,r=0){let n=null;return e.between(r,1e9,(s,a,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0))if(!n)n=new Yke(s,a,t||i.diagnostics[0]);else{if(i.diagnostics.indexOf(n.diagnostic)<0)return!1;n=new Yke(n.from,a,n.diagnostic)}}),n}function mZt(e,t){let r=t.pos,n=t.end||r,s=e.state.facet(AA).hideOn(e,r,n);if(s!=null)return s;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(i=>i.is(lYe))||e.changes.touchesRange(a.from,Math.max(a.to,n)))}function gZt(e,t){return e.field(Ud,!1)?t:t.concat(rn.appendConfig.of(jZt))}const lYe=rn.define(),tde=rn.define(),cYe=rn.define(),Ud=Oo.define({create(){return new pw(er.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let r=e.diagnostics.map(t.changes),n=null,s=e.panel;if(e.selected){let a=t.changes.mapPos(e.selected.from,1);n=A_(r,e.selected.diagnostic,a)||A_(r,null,a)}!r.size&&s&&t.state.facet(AA).autoPanel&&(s=null),e=new pw(r,s,n)}for(let r of t.effects)if(r.is(lYe)){let n=t.state.facet(AA).autoPanel?r.value.length?IA.open:null:e.panel;e=pw.init(r.value,n,t.state)}else r.is(tde)?e=new pw(e.diagnostics,r.value?IA.open:null,e.selected):r.is(cYe)&&(e=new pw(e.diagnostics,e.panel,r.value));return e},provide:e=>[bA.from(e,t=>t.panel),ft.decorations.from(e,t=>t.diagnostics)]}),yZt=er.mark({class:"cm-lintRange cm-lintRange-active"});function vZt(e,t,r){let{diagnostics:n}=e.state.field(Ud),s,a=-1,i=-1;n.between(t-(r<0?1:0),t+(r>0?1:0),(c,u,{spec:d})=>{if(t>=c&&t<=u&&(c==u||(t>c||r>0)&&(t<u||r<0)))return s=d.diagnostics,a=c,i=u,!1});let l=e.state.facet(AA).tooltipFilter;return s&&l&&(s=l(s,e.state)),s?{pos:a,end:i,above:e.state.doc.lineAt(a).to<i,create(){return{dom:bZt(e,s)}}}:null}function bZt(e,t){return Ca("ul",{class:"cm-tooltip-lint"},t.map(r=>dYe(e,r,!1)))}const xZt=e=>{let t=e.state.field(Ud,!1);(!t||!t.panel)&&e.dispatch({effects:gZt(e.state,[tde.of(!0)])});let r=pue(e,IA.open);return r&&r.dom.querySelector(".cm-panel-lint ul").focus(),!0},Xke=e=>{let t=e.state.field(Ud,!1);return!t||!t.panel?!1:(e.dispatch({effects:tde.of(!1)}),!0)},wZt=e=>{let t=e.state.field(Ud,!1);if(!t)return!1;let r=e.state.selection.main,n=t.diagnostics.iter(r.to+1);return!n.value&&(n=t.diagnostics.iter(0),!n.value||n.from==r.from&&n.to==r.to)?!1:(e.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0}),!0)},SZt=[{key:"Mod-Shift-m",run:xZt,preventDefault:!0},{key:"F8",run:wZt}],AA=Kt.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...mg(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:Kke,tooltipFilter:Kke,needsRefresh:(t,r)=>t?r?n=>t(n)||r(n):t:r,hideOn:(t,r)=>t?r?(n,s,a)=>t(n,s,a)||r(n,s,a):t:r,autoPanel:(t,r)=>t||r})}}});function Kke(e,t){return e?t?(r,n)=>t(e(r,n),n):e:t}function uYe(e){let t=[];if(e)e:for(let{name:r}of e){for(let n=0;n<r.length;n++){let s=r[n];if(/[a-zA-Z]/.test(s)&&!t.some(a=>a.toLowerCase()==s.toLowerCase())){t.push(s);continue e}}t.push("")}return t}function dYe(e,t,r){var n;let s=r?uYe(t.actions):[];return Ca("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Ca("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),(n=t.actions)===null||n===void 0?void 0:n.map((a,i)=>{let l=!1,c=p=>{if(p.preventDefault(),l)return;l=!0;let m=A_(e.state.field(Ud).diagnostics,t);m&&a.apply(e,m.from,m.to)},{name:u}=a,d=s[i]?u.indexOf(s[i]):-1,f=d<0?u:[u.slice(0,d),Ca("u",u.slice(d,d+1)),u.slice(d+1)],h=a.markClass?" "+a.markClass:"";return Ca("button",{type:"button",class:"cm-diagnosticAction"+h,onclick:c,onmousedown:c,"aria-label":` Action: ${u}${d<0?"":` (access key "${s[i]})"`}.`},f)}),t.source&&Ca("div",{class:"cm-diagnosticSource"},t.source))}class OZt extends xf{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return Ca("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class Jke{constructor(t,r){this.diagnostic=r,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=dYe(t,r,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class IA{constructor(t){this.view=t,this.items=[];let r=s=>{if(s.keyCode==27)Xke(this.view),this.view.focus();else if(s.keyCode==38||s.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(s.keyCode==40||s.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(s.keyCode==36)this.moveSelection(0);else if(s.keyCode==35)this.moveSelection(this.items.length-1);else if(s.keyCode==13)this.view.focus();else if(s.keyCode>=65&&s.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:a}=this.items[this.selectedIndex],i=uYe(a.actions);for(let l=0;l<i.length;l++)if(i[l].toUpperCase().charCodeAt(0)==s.keyCode){let c=A_(this.view.state.field(Ud).diagnostics,a);c&&a.actions[l].apply(t,c.from,c.to)}}else return;s.preventDefault()},n=s=>{for(let a=0;a<this.items.length;a++)this.items[a].dom.contains(s.target)&&this.moveSelection(a)};this.list=Ca("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:r,onclick:n}),this.dom=Ca("div",{class:"cm-panel-lint"},this.list,Ca("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>Xke(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(Ud).selected;if(!t)return-1;for(let r=0;r<this.items.length;r++)if(this.items[r].diagnostic==t.diagnostic)return r;return-1}update(){let{diagnostics:t,selected:r}=this.view.state.field(Ud),n=0,s=!1,a=null,i=new Set;for(t.between(0,this.view.state.doc.length,(l,c,{spec:u})=>{for(let d of u.diagnostics){if(i.has(d))continue;i.add(d);let f=-1,h;for(let p=n;p<this.items.length;p++)if(this.items[p].diagnostic==d){f=p;break}f<0?(h=new Jke(this.view,d),this.items.splice(n,0,h),s=!0):(h=this.items[f],f>n&&(this.items.splice(n,f-n),s=!0)),r&&h.diagnostic==r.diagnostic?h.dom.hasAttribute("aria-selected")||(h.dom.setAttribute("aria-selected","true"),a=h):h.dom.hasAttribute("aria-selected")&&h.dom.removeAttribute("aria-selected"),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)s=!0,this.items.pop();this.items.length==0&&(this.items.push(new Jke(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),s=!0),a?(this.list.setAttribute("aria-activedescendant",a.id),this.view.requestMeasure({key:this,read:()=>({sel:a.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:c})=>{let u=c.height/this.list.offsetHeight;l.top<c.top?this.list.scrollTop-=(c.top-l.top)/u:l.bottom>c.bottom&&(this.list.scrollTop+=(l.bottom-c.bottom)/u)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&this.sync()}sync(){let t=this.list.firstChild;function r(){let n=t;t=n.nextSibling,n.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;t!=n.dom;)r();t=n.dom.nextSibling}else this.list.insertBefore(n.dom,t);for(;t;)r()}moveSelection(t){if(this.selectedIndex<0)return;let r=this.view.state.field(Ud),n=A_(r.diagnostics,this.items[t].diagnostic);n&&this.view.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0,effects:cYe.of(n)})}static open(t){return new IA(t)}}function kZt(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function iD(e){return kZt(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const _Zt=ft.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:iD("#d11")},".cm-lintRange-warning":{backgroundImage:iD("orange")},".cm-lintRange-info":{backgroundImage:iD("#999")},".cm-lintRange-hint":{backgroundImage:iD("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function EZt(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function CZt(e){let t="hint",r=1;for(let n of e){let s=EZt(n.severity);s>r&&(r=s,t=n.severity)}return t}const jZt=[Ud,ft.decorations.compute([Ud],e=>{let{selected:t,panel:r}=e.field(Ud);return!t||!r||t.from==t.to?er.none:er.set([yZt.range(t.from,t.to)])}),_Ut(vZt,{hideOn:mZt}),_Zt];var e_e=function(t){t===void 0&&(t={});var{crosshairCursor:r=!1}=t,n=[];t.closeBracketsKeymap!==!1&&(n=n.concat(Sqt)),t.defaultKeymap!==!1&&(n=n.concat($Gt)),t.searchKeymap!==!1&&(n=n.concat(dZt)),t.historyKeymap!==!1&&(n=n.concat(HWt)),t.foldKeymap!==!1&&(n=n.concat(oVt)),t.completionKeymap!==!1&&(n=n.concat(KWe)),t.lintKeymap!==!1&&(n=n.concat(SZt));var s=[];return t.lineNumbers!==!1&&s.push(LUt()),t.highlightActiveLineGutter!==!1&&s.push(zUt()),t.highlightSpecialChars!==!1&&s.push(eUt()),t.history!==!1&&s.push(DWt()),t.foldGutter!==!1&&s.push(dVt()),t.drawSelection!==!1&&s.push(q7t()),t.dropCursor!==!1&&s.push(Z7t()),t.allowMultipleSelections!==!1&&s.push(zn.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&s.push(JUt()),t.syntaxHighlighting!==!1&&s.push(Wx(mVt,{fallback:!0})),t.bracketMatching!==!1&&s.push(SVt()),t.closeBrackets!==!1&&s.push(vqt()),t.autocompletion!==!1&&s.push(XWe()),t.rectangularSelection!==!1&&s.push(pUt()),r!==!1&&s.push(yUt()),t.highlightActiveLine!==!1&&s.push(iUt()),t.highlightSelectionMatches!==!1&&s.push(qGt()),t.tabSize&&typeof t.tabSize=="number"&&s.push(BE.of(" ".repeat(t.tabSize))),s.concat([zE.of(n.flat())]).filter(Boolean)};const TZt="#e5c07b",t_e="#e06c75",NZt="#56b6c2",AZt="#ffffff",d$="#abb2bf",cse="#7d8799",IZt="#61afef",RZt="#98c379",r_e="#d19a66",PZt="#c678dd",MZt="#21252b",n_e="#2c313a",s_e="#282c34",kV="#353a42",DZt="#3E4451",a_e="#528bff",LZt=ft.theme({"&":{color:d$,backgroundColor:s_e},".cm-content":{caretColor:a_e},".cm-cursor, .cm-dropCursor":{borderLeftColor:a_e},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:DZt},".cm-panels":{backgroundColor:MZt,color:d$},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:s_e,color:cse,border:"none"},".cm-activeLineGutter":{backgroundColor:n_e},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:kV},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:kV,borderBottomColor:kV},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:n_e,color:d$}}},{dark:!0}),$Zt=Pp.define([{tag:ne.keyword,color:PZt},{tag:[ne.name,ne.deleted,ne.character,ne.propertyName,ne.macroName],color:t_e},{tag:[ne.function(ne.variableName),ne.labelName],color:IZt},{tag:[ne.color,ne.constant(ne.name),ne.standard(ne.name)],color:r_e},{tag:[ne.definition(ne.name),ne.separator],color:d$},{tag:[ne.typeName,ne.className,ne.number,ne.changed,ne.annotation,ne.modifier,ne.self,ne.namespace],color:TZt},{tag:[ne.operator,ne.operatorKeyword,ne.url,ne.escape,ne.regexp,ne.link,ne.special(ne.string)],color:NZt},{tag:[ne.meta,ne.comment],color:cse},{tag:ne.strong,fontWeight:"bold"},{tag:ne.emphasis,fontStyle:"italic"},{tag:ne.strikethrough,textDecoration:"line-through"},{tag:ne.link,color:cse,textDecoration:"underline"},{tag:ne.heading,fontWeight:"bold",color:t_e},{tag:[ne.atom,ne.bool,ne.special(ne.variableName)],color:r_e},{tag:[ne.processingInstruction,ne.string,ne.inserted],color:RZt},{tag:ne.invalid,color:AZt}]),FZt=[LZt,Wx($Zt)];var zZt=ft.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),BZt=function(t){t===void 0&&(t={});var{indentWithTab:r=!0,editable:n=!0,readOnly:s=!1,theme:a="light",placeholder:i="",basicSetup:l=!0}=t,c=[];switch(r&&c.unshift(zE.of([FGt])),l&&(typeof l=="boolean"?c.unshift(e_e()):c.unshift(e_e(l))),i&&c.unshift(uUt(i)),a){case"light":c.push(zZt);break;case"dark":c.push(FZt);break;case"none":break;default:c.push(a);break}return n===!1&&c.push(ft.editable.of(!1)),s&&c.push(zn.readOnly.of(!0)),[...c]},UZt=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(t=>!t.empty)});class VZt{constructor(t,r){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=r,this.timeoutMS=r,this.callbacks.push(t)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var t=this.callbacks.slice();this.callbacks.length=0,t.forEach(r=>{try{r()}catch(n){console.error("TimeoutLatch callback error:",n)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}let i_e=class{constructor(){this.interval=null,this.latches=new Set}add(t){this.latches.add(t),this.start()}remove(t){this.latches.delete(t),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(t=>{t.tick(),t.isDone&&this.remove(t)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}};var _V=null,qZt=()=>typeof window>"u"?new i_e:(_V||(_V=new i_e),_V),o_e=pg.define(),HZt=200,QZt=[];function WZt(e){var{value:t,selection:r,onChange:n,onStatistics:s,onCreateEditor:a,onUpdate:i,extensions:l=QZt,autoFocus:c,theme:u="light",height:d=null,minHeight:f=null,maxHeight:h=null,width:p=null,minWidth:m=null,maxWidth:g=null,placeholder:y="",editable:x=!0,readOnly:w=!1,indentWithTab:S=!0,basicSetup:k=!0,root:_,initialState:E}=e,[T,j]=b.useState(),[N,I]=b.useState(),[P,R]=b.useState(),B=b.useState(()=>({current:null}))[0],D=b.useState(()=>({current:null}))[0],$=ft.theme({"&":{height:d,minHeight:f,maxHeight:h,width:p,minWidth:m,maxWidth:g},"& .cm-scroller":{height:"100% !important"}}),U=ft.updateListener.of(Q=>{if(Q.docChanged&&typeof n=="function"&&!Q.transactions.some(V=>V.annotation(o_e))){B.current?B.current.reset():(B.current=new VZt(()=>{if(D.current){var V=D.current;D.current=null,V()}B.current=null},HZt),qZt().add(B.current));var L=Q.state.doc,Z=L.toString();n(Z,Q)}s&&s(UZt(Q))}),z=BZt({theme:u,editable:x,readOnly:w,placeholder:y,indentWithTab:S,basicSetup:k}),H=[U,$,...z];return i&&typeof i=="function"&&H.push(ft.updateListener.of(i)),H=H.concat(l),b.useLayoutEffect(()=>{if(T&&!P){var Q={doc:t,selection:r,extensions:H},L=E?zn.fromJSON(E.json,Q,E.fields):zn.create(Q);if(R(L),!N){var Z=new ft({state:L,parent:T,root:_});I(Z),a&&a(Z,L)}}return()=>{N&&(R(void 0),I(void 0))}},[T,P]),b.useEffect(()=>{e.container&&j(e.container)},[e.container]),b.useEffect(()=>()=>{N&&(N.destroy(),I(void 0)),B.current&&(B.current.cancel(),B.current=null)},[N]),b.useEffect(()=>{c&&N&&N.focus()},[c,N]),b.useEffect(()=>{N&&N.dispatch({effects:rn.reconfigure.of(H)})},[u,l,d,f,h,p,m,g,y,x,w,S,k,n,i]),b.useEffect(()=>{if(t!==void 0){var Q=N?N.state.doc.toString():"";if(N&&t!==Q){var L=B.current&&!B.current.isDone,Z=()=>{N&&t!==N.state.doc.toString()&&N.dispatch({changes:{from:0,to:N.state.doc.toString().length,insert:t||""},annotations:[o_e.of(!0)]})};L?D.current=Z:Z()}}},[t,N]),{state:P,setState:R,view:N,setView:I,container:T,setContainer:j}}var GZt=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],vc=b.forwardRef((e,t)=>{var{className:r,value:n="",selection:s,extensions:a=[],onChange:i,onStatistics:l,onCreateEditor:c,onUpdate:u,autoFocus:d,theme:f="light",height:h,minHeight:p,maxHeight:m,width:g,minWidth:y,maxWidth:x,basicSetup:w,placeholder:S,indentWithTab:k,editable:_,readOnly:E,root:T,initialState:j}=e,N=Wue(e,GZt),I=b.useRef(null),{state:P,view:R,container:B,setContainer:D}=WZt({root:T,value:n,autoFocus:d,theme:f,height:h,minHeight:p,maxHeight:m,width:g,minWidth:y,maxWidth:x,basicSetup:w,placeholder:S,indentWithTab:k,editable:_,readOnly:E,selection:s,onChange:i,onStatistics:l,onCreateEditor:c,onUpdate:u,extensions:a,initialState:j});b.useImperativeHandle(t,()=>({editor:I.current,state:P,view:R}),[I,B,P,R]);var $=b.useCallback(z=>{I.current=z,D(z)},[D]);if(typeof n!="string")throw new Error("value must be typeof string but got "+typeof n);var U=typeof f=="string"?"cm-theme-"+f:"cm-theme";return o.jsx("div",vx({ref:$,className:""+U+(r?" "+r:"")},N))});vc.displayName="CodeMirror";function ZZt(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const YZt=e=>{switch(e){case"success":return JZt;case"info":return tYt;case"warning":return eYt;case"error":return rYt;default:return null}},XZt=Array(12).fill(0),KZt=({visible:e,className:t})=>je.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},je.createElement("div",{className:"sonner-spinner"},XZt.map((r,n)=>je.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),JZt=je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},je.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"})),eYt=je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},je.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"})),tYt=je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},je.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"})),rYt=je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},je.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"})),nYt=je.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"},je.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),je.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),sYt=()=>{const[e,t]=je.useState(document.hidden);return je.useEffect(()=>{const r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let use=1;class aYt{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;const{message:n,...s}=t,a=typeof t?.id=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:use++,i=this.toasts.find(c=>c.id===a),l=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(c=>c.id===a?(this.publish({...c,...t,id:a,title:n}),{...c,...t,id:a,dismissible:l,title:n}):c):this.addToast({title:n,...s,dismissible:l,id:a}),a},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:t,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let a=n!==void 0,i;const l=s.then(async u=>{if(i=["resolve",u],je.isValidElement(u))a=!1,this.create({id:n,type:"default",message:u});else if(oYt(u)&&!u.ok){a=!1;const f=typeof r.error=="function"?await r.error(`HTTP error! status: ${u.status}`):r.error,h=typeof r.description=="function"?await r.description(`HTTP error! status: ${u.status}`):r.description,m=typeof f=="object"&&!je.isValidElement(f)?f:{message:f};this.create({id:n,type:"error",description:h,...m})}else if(u instanceof Error){a=!1;const f=typeof r.error=="function"?await r.error(u):r.error,h=typeof r.description=="function"?await r.description(u):r.description,m=typeof f=="object"&&!je.isValidElement(f)?f:{message:f};this.create({id:n,type:"error",description:h,...m})}else if(r.success!==void 0){a=!1;const f=typeof r.success=="function"?await r.success(u):r.success,h=typeof r.description=="function"?await r.description(u):r.description,m=typeof f=="object"&&!je.isValidElement(f)?f:{message:f};this.create({id:n,type:"success",description:h,...m})}}).catch(async u=>{if(i=["reject",u],r.error!==void 0){a=!1;const d=typeof r.error=="function"?await r.error(u):r.error,f=typeof r.description=="function"?await r.description(u):r.description,p=typeof d=="object"&&!je.isValidElement(d)?d:{message:d};this.create({id:n,type:"error",description:f,...p})}}).finally(()=>{a&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),c=()=>new Promise((u,d)=>l.then(()=>i[0]==="reject"?d(i[1]):u(i[1])).catch(d));return typeof n!="string"&&typeof n!="number"?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(t,r)=>{const n=r?.id||use++;return this.create({jsx:t(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Eu=new aYt,iYt=(e,t)=>{const r=t?.id||use++;return Eu.addToast({title:e,...t,id:r}),r},oYt=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",lYt=iYt,cYt=()=>Eu.toasts,uYt=()=>Eu.getActiveToasts(),mc=Object.assign(lYt,{success:Eu.success,info:Eu.info,warning:Eu.warning,error:Eu.error,custom:Eu.custom,message:Eu.message,promise:Eu.promise,dismiss:Eu.dismiss,loading:Eu.loading},{getHistory:cYt,getToasts:uYt});ZZt("[data-sonner-toaster][dir=ltr],html[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%)}[data-sonner-toaster][dir=rtl],html[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%)}[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:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[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);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[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 rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [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)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [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;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [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);background:var(--normal-bg);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-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[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}[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}[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,0)) translateX(var(--swipe-amount-x,0));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{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{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{from{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-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--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-sonner-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-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-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, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--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-sonner-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-sonner-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]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[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]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[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]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[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]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[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:first-child{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)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{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%)}");function oD(e){return e.label!==void 0}const dYt=3,fYt="24px",hYt="16px",l_e=4e3,pYt=356,mYt=14,gYt=45,yYt=200;function em(...e){return e.filter(Boolean).join(" ")}function vYt(e){const[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}const bYt=e=>{var t,r,n,s,a,i,l,c,u;const{invert:d,toast:f,unstyled:h,interacting:p,setHeights:m,visibleToasts:g,heights:y,index:x,toasts:w,expanded:S,removeToast:k,defaultRichColors:_,closeButton:E,style:T,cancelButtonStyle:j,actionButtonStyle:N,className:I="",descriptionClassName:P="",duration:R,position:B,gap:D,expandByDefault:$,classNames:U,icons:z,closeButtonAriaLabel:H="Close toast"}=e,[Q,L]=je.useState(null),[Z,V]=je.useState(null),[M,W]=je.useState(!1),[G,J]=je.useState(!1),[ae,te]=je.useState(!1),[re,ie]=je.useState(!1),[he,X]=je.useState(!1),[se,le]=je.useState(0),[xe,de]=je.useState(0),ue=je.useRef(f.duration||R||l_e),ve=je.useRef(null),we=je.useRef(null),Ne=x===0,K=x+1<=g,oe=f.type,be=f.dismissible!==!1,Ae=f.className||"",$e=f.descriptionClassName||"",ye=je.useMemo(()=>y.findIndex(tt=>tt.toastId===f.id)||0,[y,f.id]),ke=je.useMemo(()=>{var tt;return(tt=f.closeButton)!=null?tt:E},[f.closeButton,E]),ge=je.useMemo(()=>f.duration||R||l_e,[f.duration,R]),Ee=je.useRef(0),Fe=je.useRef(0),ct=je.useRef(0),wt=je.useRef(null),[lr,Ve]=B.split("-"),qe=je.useMemo(()=>y.reduce((tt,Jt,Tr)=>Tr>=ye?tt:tt+Jt.height,0),[y,ye]),Ie=sYt(),Le=f.invert||d,Re=oe==="loading";Fe.current=je.useMemo(()=>ye*D+qe,[ye,qe]),je.useEffect(()=>{ue.current=ge},[ge]),je.useEffect(()=>{W(!0)},[]),je.useEffect(()=>{const tt=we.current;if(tt){const Jt=tt.getBoundingClientRect().height;return de(Jt),m(Tr=>[{toastId:f.id,height:Jt,position:f.position},...Tr]),()=>m(Tr=>Tr.filter(ir=>ir.toastId!==f.id))}},[m,f.id]),je.useLayoutEffect(()=>{if(!M)return;const tt=we.current,Jt=tt.style.height;tt.style.height="auto";const Tr=tt.getBoundingClientRect().height;tt.style.height=Jt,de(Tr),m(ir=>ir.find(Ur=>Ur.toastId===f.id)?ir.map(Ur=>Ur.toastId===f.id?{...Ur,height:Tr}:Ur):[{toastId:f.id,height:Tr,position:f.position},...ir])},[M,f.title,f.description,m,f.id,f.jsx,f.action,f.cancel]);const it=je.useCallback(()=>{J(!0),le(Fe.current),m(tt=>tt.filter(Jt=>Jt.toastId!==f.id)),setTimeout(()=>{k(f)},yYt)},[f,k,m,Fe]);je.useEffect(()=>{if(f.promise&&oe==="loading"||f.duration===1/0||f.type==="loading")return;let tt;return S||p||Ie?(()=>{if(ct.current<Ee.current){const ir=new Date().getTime()-Ee.current;ue.current=ue.current-ir}ct.current=new Date().getTime()})():ue.current!==1/0&&(Ee.current=new Date().getTime(),tt=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),it()},ue.current)),()=>clearTimeout(tt)},[S,p,f,oe,Ie,it]),je.useEffect(()=>{f.delete&&(it(),f.onDismiss==null||f.onDismiss.call(f,f))},[it,f.delete]);function rt(){var tt;if(z?.loading){var Jt;return je.createElement("div",{className:em(U?.loader,f==null||(Jt=f.classNames)==null?void 0:Jt.loader,"sonner-loader"),"data-visible":oe==="loading"},z.loading)}return je.createElement(KZt,{className:em(U?.loader,f==null||(tt=f.classNames)==null?void 0:tt.loader),visible:oe==="loading"})}const ht=f.icon||z?.[oe]||YZt(oe);var Ut,$r;return je.createElement("li",{tabIndex:0,ref:we,className:em(I,Ae,U?.toast,f==null||(t=f.classNames)==null?void 0:t.toast,U?.default,U?.[oe],f==null||(r=f.classNames)==null?void 0:r[oe]),"data-sonner-toast":"","data-rich-colors":(Ut=f.richColors)!=null?Ut:_,"data-styled":!(f.jsx||f.unstyled||h),"data-mounted":M,"data-promise":!!f.promise,"data-swiped":he,"data-removed":G,"data-visible":K,"data-y-position":lr,"data-x-position":Ve,"data-index":x,"data-front":Ne,"data-swiping":ae,"data-dismissible":be,"data-type":oe,"data-invert":Le,"data-swipe-out":re,"data-swipe-direction":Z,"data-expanded":!!(S||$&&M),"data-testid":f.testId,style:{"--index":x,"--toasts-before":x,"--z-index":w.length-x,"--offset":`${G?se:Fe.current}px`,"--initial-height":$?"auto":`${xe}px`,...T,...f.style},onDragEnd:()=>{te(!1),L(null),wt.current=null},onPointerDown:tt=>{tt.button!==2&&(Re||!be||(ve.current=new Date,le(Fe.current),tt.target.setPointerCapture(tt.pointerId),tt.target.tagName!=="BUTTON"&&(te(!0),wt.current={x:tt.clientX,y:tt.clientY})))},onPointerUp:()=>{var tt,Jt,Tr;if(re||!be)return;wt.current=null;const ir=Number(((tt=we.current)==null?void 0:tt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),$n=Number(((Jt=we.current)==null?void 0:Jt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ur=new Date().getTime()-((Tr=ve.current)==null?void 0:Tr.getTime()),It=Q==="x"?ir:$n,wn=Math.abs(It)/Ur;if(Math.abs(It)>=gYt||wn>.11){le(Fe.current),f.onDismiss==null||f.onDismiss.call(f,f),V(Q==="x"?ir>0?"right":"left":$n>0?"down":"up"),it(),ie(!0);return}else{var Er,Oe;(Er=we.current)==null||Er.style.setProperty("--swipe-amount-x","0px"),(Oe=we.current)==null||Oe.style.setProperty("--swipe-amount-y","0px")}X(!1),te(!1),L(null)},onPointerMove:tt=>{var Jt,Tr,ir;if(!wt.current||!be||((Jt=window.getSelection())==null?void 0:Jt.toString().length)>0)return;const Ur=tt.clientY-wt.current.y,It=tt.clientX-wt.current.x;var wn;const Er=(wn=e.swipeDirections)!=null?wn:vYt(B);!Q&&(Math.abs(It)>1||Math.abs(Ur)>1)&&L(Math.abs(It)>Math.abs(Ur)?"x":"y");let Oe={x:0,y:0};const Me=Ue=>1/(1.5+Math.abs(Ue)/20);if(Q==="y"){if(Er.includes("top")||Er.includes("bottom"))if(Er.includes("top")&&Ur<0||Er.includes("bottom")&&Ur>0)Oe.y=Ur;else{const Ue=Ur*Me(Ur);Oe.y=Math.abs(Ue)<Math.abs(Ur)?Ue:Ur}}else if(Q==="x"&&(Er.includes("left")||Er.includes("right")))if(Er.includes("left")&&It<0||Er.includes("right")&&It>0)Oe.x=It;else{const Ue=It*Me(It);Oe.x=Math.abs(Ue)<Math.abs(It)?Ue:It}(Math.abs(Oe.x)>0||Math.abs(Oe.y)>0)&&X(!0),(Tr=we.current)==null||Tr.style.setProperty("--swipe-amount-x",`${Oe.x}px`),(ir=we.current)==null||ir.style.setProperty("--swipe-amount-y",`${Oe.y}px`)}},ke&&!f.jsx&&oe!=="loading"?je.createElement("button",{"aria-label":H,"data-disabled":Re,"data-close-button":!0,onClick:Re||!be?()=>{}:()=>{it(),f.onDismiss==null||f.onDismiss.call(f,f)},className:em(U?.closeButton,f==null||(n=f.classNames)==null?void 0:n.closeButton)},($r=z?.close)!=null?$r:nYt):null,(oe||f.icon||f.promise)&&f.icon!==null&&(z?.[oe]!==null||f.icon)?je.createElement("div",{"data-icon":"",className:em(U?.icon,f==null||(s=f.classNames)==null?void 0:s.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||rt():null,f.type!=="loading"?ht:null):null,je.createElement("div",{"data-content":"",className:em(U?.content,f==null||(a=f.classNames)==null?void 0:a.content)},je.createElement("div",{"data-title":"",className:em(U?.title,f==null||(i=f.classNames)==null?void 0:i.title)},f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title),f.description?je.createElement("div",{"data-description":"",className:em(P,$e,U?.description,f==null||(l=f.classNames)==null?void 0:l.description)},typeof f.description=="function"?f.description():f.description):null),je.isValidElement(f.cancel)?f.cancel:f.cancel&&oD(f.cancel)?je.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||j,onClick:tt=>{oD(f.cancel)&&be&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,tt),it())},className:em(U?.cancelButton,f==null||(c=f.classNames)==null?void 0:c.cancelButton)},f.cancel.label):null,je.isValidElement(f.action)?f.action:f.action&&oD(f.action)?je.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||N,onClick:tt=>{oD(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,tt),!tt.defaultPrevented&&it())},className:em(U?.actionButton,f==null||(u=f.classNames)==null?void 0:u.actionButton)},f.action.label):null)};function c_e(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function xYt(e,t){const r={};return[e,t].forEach((n,s)=>{const a=s===1,i=a?"--mobile-offset":"--offset",l=a?hYt:fYt;function c(u){["top","right","bottom","left"].forEach(d=>{r[`${i}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?r[`${i}-${u}`]=l:r[`${i}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):c(l)}),r}const fYe=je.forwardRef(function(t,r){const{id:n,invert:s,position:a="bottom-right",hotkey:i=["altKey","KeyT"],expand:l,closeButton:c,className:u,offset:d,mobileOffset:f,theme:h="light",richColors:p,duration:m,style:g,visibleToasts:y=dYt,toastOptions:x,dir:w=c_e(),gap:S=mYt,icons:k,containerAriaLabel:_="Notifications"}=t,[E,T]=je.useState([]),j=je.useMemo(()=>n?E.filter(M=>M.toasterId===n):E.filter(M=>!M.toasterId),[E,n]),N=je.useMemo(()=>Array.from(new Set([a].concat(j.filter(M=>M.position).map(M=>M.position)))),[j,a]),[I,P]=je.useState([]),[R,B]=je.useState(!1),[D,$]=je.useState(!1),[U,z]=je.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=je.useRef(null),Q=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),L=je.useRef(null),Z=je.useRef(!1),V=je.useCallback(M=>{T(W=>{var G;return(G=W.find(J=>J.id===M.id))!=null&&G.delete||Eu.dismiss(M.id),W.filter(({id:J})=>J!==M.id)})},[]);return je.useEffect(()=>Eu.subscribe(M=>{if(M.dismiss){requestAnimationFrame(()=>{T(W=>W.map(G=>G.id===M.id?{...G,delete:!0}:G))});return}setTimeout(()=>{hce.flushSync(()=>{T(W=>{const G=W.findIndex(J=>J.id===M.id);return G!==-1?[...W.slice(0,G),{...W[G],...M},...W.slice(G+1)]:[M,...W]})})})}),[E]),je.useEffect(()=>{if(h!=="system"){z(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z("dark"):z("light")),typeof window>"u")return;const M=window.matchMedia("(prefers-color-scheme: dark)");try{M.addEventListener("change",({matches:W})=>{z(W?"dark":"light")})}catch{M.addListener(({matches:G})=>{try{z(G?"dark":"light")}catch(J){console.error(J)}})}},[h]),je.useEffect(()=>{E.length<=1&&B(!1)},[E]),je.useEffect(()=>{const M=W=>{var G;if(i.every(te=>W[te]||W.code===te)){var ae;B(!0),(ae=H.current)==null||ae.focus()}W.code==="Escape"&&(document.activeElement===H.current||(G=H.current)!=null&&G.contains(document.activeElement))&&B(!1)};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[i]),je.useEffect(()=>{if(H.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,Z.current=!1)}},[H.current]),je.createElement("section",{ref:r,"aria-label":`${_} ${Q}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},N.map((M,W)=>{var G;const[J,ae]=M.split("-");return j.length?je.createElement("ol",{key:M,dir:w==="auto"?c_e():w,tabIndex:-1,ref:H,className:u,"data-sonner-toaster":!0,"data-sonner-theme":U,"data-y-position":J,"data-x-position":ae,style:{"--front-toast-height":`${((G=I[0])==null?void 0:G.height)||0}px`,"--width":`${pYt}px`,"--gap":`${S}px`,...g,...xYt(d,f)},onBlur:te=>{Z.current&&!te.currentTarget.contains(te.relatedTarget)&&(Z.current=!1,L.current&&(L.current.focus({preventScroll:!0}),L.current=null))},onFocus:te=>{te.target instanceof HTMLElement&&te.target.dataset.dismissible==="false"||Z.current||(Z.current=!0,L.current=te.relatedTarget)},onMouseEnter:()=>B(!0),onMouseMove:()=>B(!0),onMouseLeave:()=>{D||B(!1)},onDragEnd:()=>B(!1),onPointerDown:te=>{te.target instanceof HTMLElement&&te.target.dataset.dismissible==="false"||$(!0)},onPointerUp:()=>$(!1)},j.filter(te=>!te.position&&W===0||te.position===M).map((te,re)=>{var ie,he;return je.createElement(bYt,{key:te.id,icons:k,index:re,toast:te,defaultRichColors:p,duration:(ie=x?.duration)!=null?ie:m,className:x?.className,descriptionClassName:x?.descriptionClassName,invert:s,visibleToasts:y,closeButton:(he=x?.closeButton)!=null?he:c,interacting:D,position:M,style:x?.style,unstyled:x?.unstyled,classNames:x?.classNames,cancelButtonStyle:x?.cancelButtonStyle,actionButtonStyle:x?.actionButtonStyle,closeButtonAriaLabel:x?.closeButtonAriaLabel,removeToast:V,toasts:j.filter(X=>X.position==te.position),heights:I.filter(X=>X.position==te.position),setHeights:P,expandByDefault:l,gap:S,expanded:R,swipeDirections:t.swipeDirections})})):null}))});var EV="focusScope.autoFocusOnMount",CV="focusScope.autoFocusOnUnmount",u_e={bubbles:!1,cancelable:!0},wYt="FocusScope",QR=b.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...i}=e,[l,c]=b.useState(null),u=bi(s),d=bi(a),f=b.useRef(null),h=Br(t,g=>c(g)),p=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(n){let g=function(S){if(p.paused||!l)return;const k=S.target;l.contains(k)?f.current=k:db(f.current,{select:!0})},y=function(S){if(p.paused||!l)return;const k=S.relatedTarget;k!==null&&(l.contains(k)||db(f.current,{select:!0}))},x=function(S){if(document.activeElement===document.body)for(const _ of S)_.removedNodes.length>0&&db(l)};document.addEventListener("focusin",g),document.addEventListener("focusout",y);const w=new MutationObserver(x);return l&&w.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",y),w.disconnect()}}},[n,l,p.paused]),b.useEffect(()=>{if(l){f_e.add(p);const g=document.activeElement;if(!l.contains(g)){const x=new CustomEvent(EV,u_e);l.addEventListener(EV,u),l.dispatchEvent(x),x.defaultPrevented||(SYt(CYt(hYe(l)),{select:!0}),document.activeElement===g&&db(l))}return()=>{l.removeEventListener(EV,u),setTimeout(()=>{const x=new CustomEvent(CV,u_e);l.addEventListener(CV,d),l.dispatchEvent(x),x.defaultPrevented||db(g??document.body,{select:!0}),l.removeEventListener(CV,d),f_e.remove(p)},0)}}},[l,u,d,p]);const m=b.useCallback(g=>{if(!r&&!n||p.paused)return;const y=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,x=document.activeElement;if(y&&x){const w=g.currentTarget,[S,k]=OYt(w);S&&k?!g.shiftKey&&x===k?(g.preventDefault(),r&&db(S,{select:!0})):g.shiftKey&&x===S&&(g.preventDefault(),r&&db(k,{select:!0})):x===w&&g.preventDefault()}},[r,n,p.paused]);return o.jsx(wr.div,{tabIndex:-1,...i,ref:h,onKeyDown:m})});QR.displayName=wYt;function SYt(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(db(n,{select:t}),document.activeElement!==r)return}function OYt(e){const t=hYe(e),r=d_e(t,e),n=d_e(t.reverse(),e);return[r,n]}function hYe(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function d_e(e,t){for(const r of e)if(!kYt(r,{upTo:t}))return r}function kYt(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 _Yt(e){return e instanceof HTMLInputElement&&"select"in e}function db(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&_Yt(e)&&t&&e.select()}}var f_e=EYt();function EYt(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=h_e(e,t),e.unshift(t)},remove(t){e=h_e(e,t),e[0]?.resume()}}}function h_e(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function CYt(e){return e.filter(t=>t.tagName!=="A")}var jV=0;function QF(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??p_e()),document.body.insertAdjacentElement("beforeend",e[1]??p_e()),jV++,()=>{jV===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),jV--}},[])}function p_e(){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 xm=function(){return xm=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},xm.apply(this,arguments)};function pYe(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function jYt(e,t,r){if(r||arguments.length===2)for(var n=0,s=t.length,a;n<s;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}var f$="right-scroll-bar-position",h$="width-before-scroll-bar",TYt="with-scroll-bars-hidden",NYt="--removed-body-scroll-bar-size";function TV(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function AYt(e,t){var r=b.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var s=r.value;s!==n&&(r.value=n,r.callback(n,s))}}}})[0];return r.callback=t,r.facade}var IYt=typeof window<"u"?b.useLayoutEffect:b.useEffect,m_e=new WeakMap;function RYt(e,t){var r=AYt(null,function(n){return e.forEach(function(s){return TV(s,n)})});return IYt(function(){var n=m_e.get(r);if(n){var s=new Set(n),a=new Set(e),i=r.current;s.forEach(function(l){a.has(l)||TV(l,null)}),a.forEach(function(l){s.has(l)||TV(l,i)})}m_e.set(r,e)},[e]),r}function PYt(e){return e}function MYt(e,t){t===void 0&&(t=PYt);var r=[],n=!1,s={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(a){var i=t(a,n);return r.push(i),function(){r=r.filter(function(l){return l!==i})}},assignSyncMedium:function(a){for(n=!0;r.length;){var i=r;r=[],i.forEach(a)}r={push:function(l){return a(l)},filter:function(){return r}}},assignMedium:function(a){n=!0;var i=[];if(r.length){var l=r;r=[],l.forEach(a),i=r}var c=function(){var d=i;i=[],d.forEach(a)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(d){i.push(d),u()},filter:function(d){return i=i.filter(d),r}}}};return s}function DYt(e){e===void 0&&(e={});var t=MYt(null);return t.options=xm({async:!0,ssr:!1},e),t}var mYe=function(e){var t=e.sideCar,r=pYe(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return b.createElement(n,xm({},r))};mYe.isSideCarExport=!0;function LYt(e,t){return e.useMedium(t),mYe}var gYe=DYt(),NV=function(){},WF=b.forwardRef(function(e,t){var r=b.useRef(null),n=b.useState({onScrollCapture:NV,onWheelCapture:NV,onTouchMoveCapture:NV}),s=n[0],a=n[1],i=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,p=e.noRelative,m=e.noIsolation,g=e.inert,y=e.allowPinchZoom,x=e.as,w=x===void 0?"div":x,S=e.gapMode,k=pYe(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=h,E=RYt([r,t]),T=xm(xm({},k),s);return b.createElement(b.Fragment,null,d&&b.createElement(_,{sideCar:gYe,removeScrollBar:u,shards:f,noRelative:p,noIsolation:m,inert:g,setCallbacks:a,allowPinchZoom:!!y,lockRef:r,gapMode:S}),i?b.cloneElement(b.Children.only(l),xm(xm({},T),{ref:E})):b.createElement(w,xm({},T,{className:c,ref:E}),l))});WF.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};WF.classNames={fullWidth:h$,zeroRight:f$};var $Yt=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function FYt(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=$Yt();return t&&e.setAttribute("nonce",t),e}function zYt(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function BYt(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var UYt=function(){var e=0,t=null;return{add:function(r){e==0&&(t=FYt())&&(zYt(t,r),BYt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},VYt=function(){var e=UYt();return function(t,r){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},yYe=function(){var e=VYt(),t=function(r){var n=r.styles,s=r.dynamic;return e(n,s),null};return t},qYt={left:0,top:0,right:0,gap:0},AV=function(e){return parseInt(e||"",10)||0},HYt=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[AV(r),AV(n),AV(s)]},QYt=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return qYt;var t=HYt(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},WYt=yYe(),Uk="data-scroll-locked",GYt=function(e,t,r,n){var s=e.left,a=e.top,i=e.right,l=e.gap;return r===void 0&&(r="margin"),`
|
|
117
117
|
.`.concat(TYt,` {
|
|
118
118
|
overflow: hidden `).concat(n,`;
|
|
@@ -290,7 +290,7 @@ ${J.current.stack}
|
|
|
290
290
|
A`,",",",0,",",",",",",",`
|
|
291
291
|
A`,",",",0,0,",",",",","Z"])),T.x,T.y,a,a,+(d<0),E.x,E.y,n,n,+(N>180),+(d>0),S.x,S.y,a,a,+(d<0),k.x,k.y)}else w+=Qi(aNe||(aNe=Ow(["L",",","Z"])),t,r);return w},xOr={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},xit=e=>{var t=nd(e,xOr),{cx:r,cy:n,innerRadius:s,outerRadius:a,cornerRadius:i,forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:d,className:f}=t;if(a<s||u===d)return null;var h=xa("recharts-sector",f),p=a-s,m=wx(i,p,0,!0),g;return m>0&&Math.abs(u-d)<360?g=bOr({cx:r,cy:n,innerRadius:s,outerRadius:a,cornerRadius:Math.min(m,p/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:d}):g=bit({cx:r,cy:n,innerRadius:s,outerRadius:a,startAngle:u,endAngle:d}),b.createElement("path",Iae({},su(t),{className:h,d:g}))};function wOr(e,t,r){if(e==="horizontal")return[{x:t.x,y:r.top},{x:t.x,y:r.top+r.height}];if(e==="vertical")return[{x:r.left,y:t.y},{x:r.left+r.width,y:t.y}];if(sat(t)){if(e==="centric"){var{cx:n,cy:s,innerRadius:a,outerRadius:i,angle:l}=t,c=Ul(n,s,a,l),u=Ul(n,s,i,l);return[{x:c.x,y:c.y},{x:u.x,y:u.y}]}return vit(t)}}var RH={},PH={},MH={},iNe;function SOr(){return iNe||(iNe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=pat();function r(n){return t.isSymbol(n)?NaN:Number(n)}e.toNumber=r})(MH)),MH}var oNe;function OOr(){return oNe||(oNe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=SOr();function r(n){return n?(n=t.toNumber(n),n===1/0||n===-1/0?(n<0?-1:1)*Number.MAX_VALUE:n===n?n:0):n===0?n:0}e.toFinite=r})(PH)),PH}var lNe;function kOr(){return lNe||(lNe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=mat(),r=OOr();function n(s,a,i){i&&typeof i!="number"&&t.isIterateeCall(s,a,i)&&(a=i=void 0),s=r.toFinite(s),a===void 0?(a=s,s=0):a=r.toFinite(a),i=i===void 0?s<a?1:-1:r.toFinite(i);const l=Math.max(Math.ceil((a-s)/(i||1)),0),c=new Array(l);for(let u=0;u<l;u++)c[u]=s,s+=i;return c}e.range=n})(RH)),RH}var DH,cNe;function _Or(){return cNe||(cNe=1,DH=kOr().range),DH}var EOr=_Or();const wit=Uo(EOr);var t0=e=>e.chartData,COr=Xe([t0],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),jhe=(e,t,r,n)=>n?COr(e):t0(e);function qm(e){if(Array.isArray(e)&&e.length===2){var[t,r]=e;if(zs(t)&&zs(r))return!0}return!1}function uNe(e,t,r){return r?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function Sit(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[r,n]=e,s,a;if(zs(r))s=r;else if(typeof r=="function")return;if(zs(n))a=n;else if(typeof n=="function")return;var i=[s,a];if(qm(i))return i}}function jOr(e,t,r){if(!(!r&&t==null)){if(typeof e=="function"&&t!=null)try{var n=e(t,r);if(qm(n))return uNe(n,t,r)}catch{}if(Array.isArray(e)&&e.length===2){var[s,a]=e,i,l;if(s==="auto")t!=null&&(i=Math.min(...t));else if(qr(s))i=s;else if(typeof s=="function")try{t!=null&&(i=s(t?.[0]))}catch{}else if(typeof s=="string"&&aTe.test(s)){var c=aTe.exec(s);if(c==null||c[1]==null||t==null)i=void 0;else{var u=+c[1];i=t[0]-u}}else i=t?.[0];if(a==="auto")t!=null&&(l=Math.max(...t));else if(qr(a))l=a;else if(typeof a=="function")try{t!=null&&(l=a(t?.[1]))}catch{}else if(typeof a=="string"&&iTe.test(a)){var d=iTe.exec(a);if(d==null||d[1]==null||t==null)l=void 0;else{var f=+d[1];l=t[1]+f}}else l=t?.[1];var h=[i,l];if(qm(h))return t==null?h:uNe(h,t,r)}}}var tC=1e9,TOr={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Nhe,wi=!0,kh="[DecimalError] ",Bw=kh+"Invalid argument: ",The=kh+"Exponent out of range: ",rC=Math.floor,aw=Math.pow,NOr=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,$d,fl=1e7,ci=7,Oit=9007199254740991,a5=rC(Oit/ci),hr={};hr.absoluteValue=hr.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};hr.comparedTo=hr.cmp=function(e){var t,r,n,s,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(n=a.d.length,s=e.d.length,t=0,r=n<s?n:s;t<r;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return n===s?0:n>s^a.s<0?1:-1};hr.decimalPlaces=hr.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*ci;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};hr.dividedBy=hr.div=function(e){return Py(this,new this.constructor(e))};hr.dividedToIntegerBy=hr.idiv=function(e){var t=this,r=t.constructor;return Fa(Py(t,new r(e),0,1),r.precision)};hr.equals=hr.eq=function(e){return!this.cmp(e)};hr.exponent=function(){return Lo(this)};hr.greaterThan=hr.gt=function(e){return this.cmp(e)>0};hr.greaterThanOrEqualTo=hr.gte=function(e){return this.cmp(e)>=0};hr.isInteger=hr.isint=function(){return this.e>this.d.length-2};hr.isNegative=hr.isneg=function(){return this.s<0};hr.isPositive=hr.ispos=function(){return this.s>0};hr.isZero=function(){return this.s===0};hr.lessThan=hr.lt=function(e){return this.cmp(e)<0};hr.lessThanOrEqualTo=hr.lte=function(e){return this.cmp(e)<1};hr.logarithm=hr.log=function(e){var t,r=this,n=r.constructor,s=n.precision,a=s+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq($d))throw Error(kh+"NaN");if(r.s<1)throw Error(kh+(r.s?"NaN":"-Infinity"));return r.eq($d)?new n(0):(wi=!1,t=Py(tI(r,a),tI(e,a),a),wi=!0,Fa(t,s))};hr.minus=hr.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Eit(t,e):kit(t,(e.s=-e.s,e))};hr.modulo=hr.mod=function(e){var t,r=this,n=r.constructor,s=n.precision;if(e=new n(e),!e.s)throw Error(kh+"NaN");return r.s?(wi=!1,t=Py(r,e,0,1).times(e),wi=!0,r.minus(t)):Fa(new n(r),s)};hr.naturalExponential=hr.exp=function(){return _it(this)};hr.naturalLogarithm=hr.ln=function(){return tI(this)};hr.negated=hr.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};hr.plus=hr.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?kit(t,e):Eit(t,(e.s=-e.s,e))};hr.precision=hr.sd=function(e){var t,r,n,s=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Bw+e);if(t=Lo(s)+1,n=s.d.length-1,r=n*ci+1,n=s.d[n],n){for(;n%10==0;n/=10)r--;for(n=s.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};hr.squareRoot=hr.sqrt=function(){var e,t,r,n,s,a,i,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(kh+"NaN")}for(e=Lo(l),wi=!1,s=Math.sqrt(+l),s==0||s==1/0?(t=Rm(l.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=rC((e+1)/2)-(e<0||e%2),s==1/0?t="5e"+e:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new c(t)):n=new c(s.toString()),r=c.precision,s=i=r+3;;)if(a=n,n=a.plus(Py(l,a,i+2)).times(.5),Rm(a.d).slice(0,i)===(t=Rm(n.d)).slice(0,i)){if(t=t.slice(i-3,i+1),s==i&&t=="4999"){if(Fa(a,r+1,0),a.times(a).eq(l)){n=a;break}}else if(t!="9999")break;i+=4}return wi=!0,Fa(n,r)};hr.times=hr.mul=function(e){var t,r,n,s,a,i,l,c,u,d=this,f=d.constructor,h=d.d,p=(e=new f(e)).d;if(!d.s||!e.s)return new f(0);for(e.s*=d.s,r=d.e+e.e,c=h.length,u=p.length,c<u&&(a=h,h=p,p=a,i=c,c=u,u=i),a=[],i=c+u,n=i;n--;)a.push(0);for(n=u;--n>=0;){for(t=0,s=c+n;s>n;)l=a[s]+p[n]*h[s-n-1]+t,a[s--]=l%fl|0,t=l/fl|0;a[s]=(a[s]+t)%fl|0}for(;!a[--i];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,wi?Fa(e,f.precision):e};hr.toDecimalPlaces=hr.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(rg(e,0,tC),t===void 0?t=n.rounding:rg(t,0,8),Fa(r,e+Lo(r)+1,t))};hr.toExponential=function(e,t){var r,n=this,s=n.constructor;return e===void 0?r=CS(n,!0):(rg(e,0,tC),t===void 0?t=s.rounding:rg(t,0,8),n=Fa(new s(n),e+1,t),r=CS(n,!0,e+1)),r};hr.toFixed=function(e,t){var r,n,s=this,a=s.constructor;return e===void 0?CS(s):(rg(e,0,tC),t===void 0?t=a.rounding:rg(t,0,8),n=Fa(new a(s),e+Lo(s)+1,t),r=CS(n.abs(),!1,e+Lo(n)+1),s.isneg()&&!s.isZero()?"-"+r:r)};hr.toInteger=hr.toint=function(){var e=this,t=e.constructor;return Fa(new t(e),Lo(e)+1,t.rounding)};hr.toNumber=function(){return+this};hr.toPower=hr.pow=function(e){var t,r,n,s,a,i,l=this,c=l.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c($d);if(l=new c(l),!l.s){if(e.s<1)throw Error(kh+"Infinity");return l}if(l.eq($d))return l;if(n=c.precision,e.eq($d))return Fa(l,n);if(t=e.e,r=e.d.length-1,i=t>=r,a=l.s,i){if((r=d<0?-d:d)<=Oit){for(s=new c($d),t=Math.ceil(n/ci+4),wi=!1;r%2&&(s=s.times(l),fNe(s.d,t)),r=rC(r/2),r!==0;)l=l.times(l),fNe(l.d,t);return wi=!0,e.s<0?new c($d).div(s):Fa(s,n)}}else if(a<0)throw Error(kh+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,l.s=1,wi=!1,s=e.times(tI(l,n+u)),wi=!0,s=_it(s),s.s=a,s};hr.toPrecision=function(e,t){var r,n,s=this,a=s.constructor;return e===void 0?(r=Lo(s),n=CS(s,r<=a.toExpNeg||r>=a.toExpPos)):(rg(e,1,tC),t===void 0?t=a.rounding:rg(t,0,8),s=Fa(new a(s),e,t),r=Lo(s),n=CS(s,e<=r||r<=a.toExpNeg,e)),n};hr.toSignificantDigits=hr.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(rg(e,1,tC),t===void 0?t=n.rounding:rg(t,0,8)),Fa(new n(r),e,t)};hr.toString=hr.valueOf=hr.val=hr.toJSON=hr[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Lo(e),r=e.constructor;return CS(e,t<=r.toExpNeg||t>=r.toExpPos)};function kit(e,t){var r,n,s,a,i,l,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),wi?Fa(t,f):t;if(c=e.d,u=t.d,i=e.e,s=t.e,c=c.slice(),a=i-s,a){for(a<0?(n=c,a=-a,l=u.length):(n=u,s=i,l=c.length),i=Math.ceil(f/ci),l=i>l?i+1:l+1,a>l&&(a=l,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(l=c.length,a=u.length,l-a<0&&(a=l,n=u,u=c,c=n),r=0;a;)r=(c[--a]=c[a]+u[a]+r)/fl|0,c[a]%=fl;for(r&&(c.unshift(r),++s),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=s,wi?Fa(t,f):t}function rg(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Bw+e)}function Rm(e){var t,r,n,s=e.length-1,a="",i=e[0];if(s>0){for(a+=i,t=1;t<s;t++)n=e[t]+"",r=ci-n.length,r&&(a+=vb(r)),a+=n;i=e[t],n=i+"",r=ci-n.length,r&&(a+=vb(r))}else if(i===0)return"0";for(;i%10===0;)i/=10;return a+i}var Py=(function(){function e(n,s){var a,i=0,l=n.length;for(n=n.slice();l--;)a=n[l]*s+i,n[l]=a%fl|0,i=a/fl|0;return i&&n.unshift(i),n}function t(n,s,a,i){var l,c;if(a!=i)c=a>i?1:-1;else for(l=c=0;l<a;l++)if(n[l]!=s[l]){c=n[l]>s[l]?1:-1;break}return c}function r(n,s,a){for(var i=0;a--;)n[a]-=i,i=n[a]<s[a]?1:0,n[a]=i*fl+n[a]-s[a];for(;!n[0]&&n.length>1;)n.shift()}return function(n,s,a,i){var l,c,u,d,f,h,p,m,g,y,x,w,S,k,_,E,T,j,N=n.constructor,I=n.s==s.s?1:-1,P=n.d,R=s.d;if(!n.s)return new N(n);if(!s.s)throw Error(kh+"Division by zero");for(c=n.e-s.e,T=R.length,_=P.length,p=new N(I),m=p.d=[],u=0;R[u]==(P[u]||0);)++u;if(R[u]>(P[u]||0)&&--c,a==null?w=a=N.precision:i?w=a+(Lo(n)-Lo(s))+1:w=a,w<0)return new N(0);if(w=w/ci+2|0,u=0,T==1)for(d=0,R=R[0],w++;(u<_||d)&&w--;u++)S=d*fl+(P[u]||0),m[u]=S/R|0,d=S%R|0;else{for(d=fl/(R[0]+1)|0,d>1&&(R=e(R,d),P=e(P,d),T=R.length,_=P.length),k=T,g=P.slice(0,T),y=g.length;y<T;)g[y++]=0;j=R.slice(),j.unshift(0),E=R[0],R[1]>=fl/2&&++E;do d=0,l=t(R,g,T,y),l<0?(x=g[0],T!=y&&(x=x*fl+(g[1]||0)),d=x/E|0,d>1?(d>=fl&&(d=fl-1),f=e(R,d),h=f.length,y=g.length,l=t(f,g,h,y),l==1&&(d--,r(f,T<h?j:R,h))):(d==0&&(l=d=1),f=R.slice()),h=f.length,h<y&&f.unshift(0),r(g,f,y),l==-1&&(y=g.length,l=t(R,g,T,y),l<1&&(d++,r(g,T<y?j:R,y))),y=g.length):l===0&&(d++,g=[0]),m[u++]=d,l&&g[0]?g[y++]=P[k]||0:(g=[P[k]],y=1);while((k++<_||g[0]!==void 0)&&w--)}return m[0]||m.shift(),p.e=c,Fa(p,i?a+Lo(p)+1:a)}})();function _it(e,t){var r,n,s,a,i,l,c=0,u=0,d=e.constructor,f=d.precision;if(Lo(e)>16)throw Error(The+Lo(e));if(!e.s)return new d($d);for(wi=!1,l=f,i=new d(.03125);e.abs().gte(.1);)e=e.times(i),u+=5;for(n=Math.log(aw(2,u))/Math.LN10*2+5|0,l+=n,r=s=a=new d($d),d.precision=l;;){if(s=Fa(s.times(e),l),r=r.times(++c),i=a.plus(Py(s,r,l)),Rm(i.d).slice(0,l)===Rm(a.d).slice(0,l)){for(;u--;)a=Fa(a.times(a),l);return d.precision=f,t==null?(wi=!0,Fa(a,f)):a}a=i}}function Lo(e){for(var t=e.e*ci,r=e.d[0];r>=10;r/=10)t++;return t}function LH(e,t,r){if(t>e.LN10.sd())throw wi=!0,r&&(e.precision=r),Error(kh+"LN10 precision limit exceeded");return Fa(new e(e.LN10),t)}function vb(e){for(var t="";e--;)t+="0";return t}function tI(e,t){var r,n,s,a,i,l,c,u,d,f=1,h=10,p=e,m=p.d,g=p.constructor,y=g.precision;if(p.s<1)throw Error(kh+(p.s?"NaN":"-Infinity"));if(p.eq($d))return new g(0);if(t==null?(wi=!1,u=y):u=t,p.eq(10))return t==null&&(wi=!0),LH(g,u);if(u+=h,g.precision=u,r=Rm(m),n=r.charAt(0),a=Lo(p),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)p=p.times(e),r=Rm(p.d),n=r.charAt(0),f++;a=Lo(p),n>1?(p=new g("0."+r),a++):p=new g(n+"."+r.slice(1))}else return c=LH(g,u+2,y).times(a+""),p=tI(new g(n+"."+r.slice(1)),u-h).plus(c),g.precision=y,t==null?(wi=!0,Fa(p,y)):p;for(l=i=p=Py(p.minus($d),p.plus($d),u),d=Fa(p.times(p),u),s=3;;){if(i=Fa(i.times(d),u),c=l.plus(Py(i,new g(s),u)),Rm(c.d).slice(0,u)===Rm(l.d).slice(0,u))return l=l.times(2),a!==0&&(l=l.plus(LH(g,u+2,y).times(a+""))),l=Py(l,new g(f),u),g.precision=y,t==null?(wi=!0,Fa(l,y)):l;l=c,s+=2}}function dNe(e,t){var r,n,s;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(s=t.length;t.charCodeAt(s-1)===48;)--s;if(t=t.slice(n,s),t){if(s-=n,r=r-n-1,e.e=rC(r/ci),e.d=[],n=(r+1)%ci,r<0&&(n+=ci),n<s){for(n&&e.d.push(+t.slice(0,n)),s-=ci;n<s;)e.d.push(+t.slice(n,n+=ci));t=t.slice(n),n=ci-t.length}else n-=s;for(;n--;)t+="0";if(e.d.push(+t),wi&&(e.e>a5||e.e<-a5))throw Error(The+r)}else e.s=0,e.e=0,e.d=[0];return e}function Fa(e,t,r){var n,s,a,i,l,c,u,d,f=e.d;for(i=1,a=f[0];a>=10;a/=10)i++;if(n=t-i,n<0)n+=ci,s=t,u=f[d=0];else{if(d=Math.ceil((n+1)/ci),a=f.length,d>=a)return e;for(u=a=f[d],i=1;a>=10;a/=10)i++;n%=ci,s=n-ci+i}if(r!==void 0&&(a=aw(10,i-s-1),l=u/a%10|0,c=t<0||f[d+1]!==void 0||u%a,c=r<4?(l||c)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||c||r==6&&(n>0?s>0?u/aw(10,i-s):0:f[d-1])%10&1||r==(e.s<0?8:7))),t<1||!f[0])return c?(a=Lo(e),f.length=1,t=t-a-1,f[0]=aw(10,(ci-t%ci)%ci),e.e=rC(-t/ci)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(n==0?(f.length=d,a=1,d--):(f.length=d+1,a=aw(10,ci-n),f[d]=s>0?(u/aw(10,i-s)%aw(10,s)|0)*a:0),c)for(;;)if(d==0){(f[0]+=a)==fl&&(f[0]=1,++e.e);break}else{if(f[d]+=a,f[d]!=fl)break;f[d--]=0,a=1}for(n=f.length;f[--n]===0;)f.pop();if(wi&&(e.e>a5||e.e<-a5))throw Error(The+Lo(e));return e}function Eit(e,t){var r,n,s,a,i,l,c,u,d,f,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),wi?Fa(t,p):t;if(c=e.d,f=t.d,n=t.e,u=e.e,c=c.slice(),i=u-n,i){for(d=i<0,d?(r=c,i=-i,l=f.length):(r=f,n=u,l=c.length),s=Math.max(Math.ceil(p/ci),l)+2,i>s&&(i=s,r.length=1),r.reverse(),s=i;s--;)r.push(0);r.reverse()}else{for(s=c.length,l=f.length,d=s<l,d&&(l=s),s=0;s<l;s++)if(c[s]!=f[s]){d=c[s]<f[s];break}i=0}for(d&&(r=c,c=f,f=r,t.s=-t.s),l=c.length,s=f.length-l;s>0;--s)c[l++]=0;for(s=f.length;s>i;){if(c[--s]<f[s]){for(a=s;a&&c[--a]===0;)c[a]=fl-1;--c[a],c[s]+=fl}c[s]-=f[s]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(t.d=c,t.e=n,wi?Fa(t,p):t):new h(0)}function CS(e,t,r){var n,s=Lo(e),a=Rm(e.d),i=a.length;return t?(r&&(n=r-i)>0?a=a.charAt(0)+"."+a.slice(1)+vb(n):i>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(s<0?"e":"e+")+s):s<0?(a="0."+vb(-s-1)+a,r&&(n=r-i)>0&&(a+=vb(n))):s>=i?(a+=vb(s+1-i),r&&(n=r-s-1)>0&&(a=a+"."+vb(n))):((n=s+1)<i&&(a=a.slice(0,n)+"."+a.slice(n)),r&&(n=r-i)>0&&(s+1===i&&(a+="."),a+=vb(n))),e.s<0?"-"+a:a}function fNe(e,t){if(e.length>t)return e.length=t,!0}function Cit(e){var t,r,n;function s(a){var i=this;if(!(i instanceof s))return new s(a);if(i.constructor=s,a instanceof s){i.s=a.s,i.e=a.e,i.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Bw+a);if(a>0)i.s=1;else if(a<0)a=-a,i.s=-1;else{i.s=0,i.e=0,i.d=[0];return}if(a===~~a&&a<1e7){i.e=0,i.d=[a];return}return dNe(i,a.toString())}else if(typeof a!="string")throw Error(Bw+a);if(a.charCodeAt(0)===45?(a=a.slice(1),i.s=-1):i.s=1,NOr.test(a))dNe(i,a);else throw Error(Bw+a)}if(s.prototype=hr,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.clone=Cit,s.config=s.set=AOr,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return s.config(e),s}function AOr(e){if(!e||typeof e!="object")throw Error(kh+"Object expected");var t,r,n,s=["precision",1,tC,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<s.length;t+=3)if((n=e[r=s[t]])!==void 0)if(rC(n)===n&&n>=s[t+1]&&n<=s[t+2])this[r]=n;else throw Error(Bw+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Bw+r+": "+n);return this}var Nhe=Cit(TOr);$d=new Nhe(1);const bs=Nhe;function jit(e){var t;return e===0?t=1:t=Math.floor(new bs(e).abs().log(10).toNumber())+1,t}function Tit(e,t,r){for(var n=new bs(e),s=0,a=[];n.lt(t)&&s<1e5;)a.push(n.toNumber()),n=n.add(r),s++;return a}var Nit=e=>{var[t,r]=e,[n,s]=[t,r];return t>r&&([n,s]=[r,t]),[n,s]},Ahe=(e,t,r)=>{if(e.lte(0))return new bs(0);var n=jit(e.toNumber()),s=new bs(10).pow(n),a=e.div(s),i=n!==1?.05:.1,l=new bs(Math.ceil(a.div(i).toNumber())).add(r).mul(i),c=l.mul(s);return t?new bs(c.toNumber()):new bs(Math.ceil(c.toNumber()))},Ait=(e,t,r)=>{var n;if(e.lte(0))return new bs(0);var s=[1,2,2.5,5],a=e.toNumber(),i=Math.floor(new bs(a).abs().log(10).toNumber()),l=new bs(10).pow(i),c=e.div(l).toNumber(),u=s.findIndex(p=>p>=c-1e-10);if(u===-1&&(l=l.mul(10),u=0),u+=r,u>=s.length){var d=Math.floor(u/s.length);u%=s.length,l=l.mul(new bs(10).pow(d))}var f=(n=s[u])!==null&&n!==void 0?n:1,h=new bs(f).mul(l);return t?h:new bs(Math.ceil(h.toNumber()))},IOr=(e,t,r)=>{var n=new bs(1),s=new bs(e);if(!s.isint()&&r){var a=Math.abs(e);a<1?(n=new bs(10).pow(jit(e)-1),s=new bs(Math.floor(s.div(n).toNumber())).mul(n)):a>1&&(s=new bs(Math.floor(e)))}else e===0?s=new bs(Math.floor((t-1)/2)):r||(s=new bs(Math.floor(e)));for(var i=Math.floor((t-1)/2),l=[],c=0;c<t;c++)l.push(s.add(new bs(c-i).mul(n)).toNumber());return l},Iit=function(t,r,n,s){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:Ahe;if(!Number.isFinite((r-t)/(n-1)))return{step:new bs(0),tickMin:new bs(0),tickMax:new bs(0)};var l=i(new bs(r).sub(t).div(n-1),s,a),c;t<=0&&r>=0?c=new bs(0):(c=new bs(t).add(r).div(2),c=c.sub(new bs(c).mod(l)));var u=Math.ceil(c.sub(t).div(l).toNumber()),d=Math.ceil(new bs(r).sub(c).div(l).toNumber()),f=u+d+1;return f>n?Iit(t,r,n,s,a+1,i):(f<n&&(d=r>0?d+(n-f):d,u=r>0?u:u+(n-f)),{step:l,tickMin:c.sub(new bs(u).mul(l)),tickMax:c.add(new bs(d).mul(l))})},hNe=function(t){var[r,n]=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",l=Math.max(s,2),[c,u]=Nit([r,n]);if(c===-1/0||u===1/0){var d=u===1/0?[c,...Array(s-1).fill(1/0)]:[...Array(s-1).fill(-1/0),u];return r>n?d.reverse():d}if(c===u)return IOr(c,s,a);var f=i==="snap125"?Ait:Ahe,{step:h,tickMin:p,tickMax:m}=Iit(c,u,l,a,0,f),g=Tit(p,m.add(new bs(.1).mul(h)),h);return r>n?g.reverse():g},pNe=function(t,r){var[n,s]=t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",[l,c]=Nit([n,s]);if(l===-1/0||c===1/0)return[n,s];if(l===c)return[l];var u=i==="snap125"?Ait:Ahe,d=Math.max(r,2),f=u(new bs(c).sub(l).div(d-1),a,0),h=[...Tit(new bs(l),new bs(c),f),c];return a===!1&&(h=h.map(p=>Math.round(p))),n>s?h.reverse():h},ROr=e=>e.rootProps.barCategoryGap,u9=e=>e.rootProps.stackOffset,Rit=e=>e.rootProps.reverseStackOrder,Ihe=e=>e.options.chartName,Rhe=e=>e.rootProps.syncId,Pit=e=>e.rootProps.syncMethod,Phe=e=>e.options.eventEmitter,Zc={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},$0={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},rm={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},d9=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function f9(e,t,r){if(r!=="auto")return r;if(e!=null)return hv(e,t)?"category":"number"}function mNe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function i5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mNe(Object(r),!0).forEach(function(n){POr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mNe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function POr(e,t,r){return(t=MOr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function MOr(e){var t=DOr(e,"string");return typeof t=="symbol"?t:t+""}function DOr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gNe={allowDataOverflow:$0.allowDataOverflow,allowDecimals:$0.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:$0.angleAxisId,includeHidden:!1,name:void 0,reversed:$0.reversed,scale:$0.scale,tick:$0.tick,tickCount:void 0,ticks:void 0,type:$0.type,unit:void 0,niceTicks:"auto"},yNe={allowDataOverflow:rm.allowDataOverflow,allowDecimals:rm.allowDecimals,allowDuplicatedCategory:rm.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:rm.radiusAxisId,includeHidden:rm.includeHidden,name:void 0,reversed:rm.reversed,scale:rm.scale,tick:rm.tick,tickCount:rm.tickCount,ticks:void 0,type:rm.type,unit:void 0,niceTicks:"auto"},LOr=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},Mhe=Xe([LOr,rit],(e,t)=>{var r;if(e!=null)return e;var n=(r=f9(t,"angleAxis",gNe.type))!==null&&r!==void 0?r:"category";return i5(i5({},gNe),{},{type:n})}),$Or=(e,t)=>e.polarAxis.radiusAxis[t],Dhe=Xe([$Or,rit],(e,t)=>{var r;if(e!=null)return e;var n=(r=f9(t,"radiusAxis",yNe.type))!==null&&r!==void 0?r:"category";return i5(i5({},yNe),{},{type:n})}),h9=e=>e.polarOptions,Lhe=Xe([pv,mv,Yl],fOr),Mit=Xe([h9,Lhe],(e,t)=>{if(e!=null)return wx(e.innerRadius,t,0)}),Dit=Xe([h9,Lhe],(e,t)=>{if(e!=null)return wx(e.outerRadius,t,t*.8)}),FOr=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:r}=e;return[t,r]},Lit=Xe([h9],FOr);Xe([Mhe,Lit],d9);var $it=Xe([Lhe,Mit,Dit],(e,t,r)=>{if(!(e==null||t==null||r==null))return[t,r]});Xe([Dhe,$it],d9);var Fit=Xe([Fi,h9,Mit,Dit,pv,mv],(e,t,r,n,s,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||r==null||n==null)){var{cx:i,cy:l,startAngle:c,endAngle:u}=t;return{cx:wx(i,s,s/2),cy:wx(l,a,a/2),innerRadius:r,outerRadius:n,startAngle:c,endAngle:u,clockWise:!1}}}),kl=(e,t)=>t,p9=(e,t,r)=>r;function zit(e){return e?.id}function Bit(e,t,r){var{chartData:n=[]}=t,{allowDuplicatedCategory:s,dataKey:a}=r,i=new Map;return e.forEach(l=>{var c,u=(c=l.data)!==null&&c!==void 0?c:n;if(!(u==null||u.length===0)){var d=zit(l);u.forEach((f,h)=>{var p=a==null||s?h:String(Ql(f,a,null)),m=Ql(f,l.dataKey,0),g;i.has(p)?g=i.get(p):g={},Object.assign(g,{[d]:m}),i.set(p,g)})}}),Array.from(i.values())}function $he(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var m9=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function g9(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function zOr(e,t){if(e.length===t.length){for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}return!1}var _l=e=>{var t=Fi(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},nC=e=>e.tooltip.settings.axisId;function Fhe(e){if(e!=null){var t=e.ticks,r=e.bandwidth,n=e.range(),s=[Math.min(...n),Math.max(...n)];return{domain:()=>e.domain(),range:(function(a){function i(){return a.apply(this,arguments)}return i.toString=function(){return a.toString()},i})(()=>s),rangeMin:()=>s[0],rangeMax:()=>s[1],isInRange(a){var i=s[0],l=s[1];return i<=l?a>=i&&a<=l:a>=l&&a<=i},bandwidth:r?()=>r.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,i)=>{var l=e(a);if(l!=null){if(e.bandwidth&&i!==null&&i!==void 0&&i.position){var c=e.bandwidth();switch(i.position){case"middle":l+=c/2;break;case"end":l+=c;break}}return l}}}}}var BOr=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!qm(t)){for(var r,n,s=0;s<t.length;s++){var a=t[s];zs(a)&&((r===void 0||a<r)&&(r=a),(n===void 0||a>n)&&(n=a))}return r!==void 0&&n!==void 0?[r,n]:void 0}return t}default:return t}};function Qb(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function UOr(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function zhe(e){let t,r,n;e.length!==2?(t=Qb,r=(l,c)=>Qb(e(l),c),n=(l,c)=>e(l)-c):(t=e===Qb||e===UOr?e:VOr,r=e,n=e);function s(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;r(l[f],c)<0?u=f+1:d=f}while(u<d)}return u}function a(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;r(l[f],c)<=0?u=f+1:d=f}while(u<d)}return u}function i(l,c,u=0,d=l.length){const f=s(l,c,u,d-1);return f>u&&n(l[f-1],c)>-n(l[f],c)?f-1:f}return{left:s,center:i,right:a}}function VOr(){return 0}function Uit(e){return e===null?NaN:+e}function*qOr(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const HOr=zhe(Qb),wP=HOr.right;zhe(Uit).center;class vNe extends Map{constructor(t,r=GOr){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,s]of t)this.set(n,s)}get(t){return super.get(bNe(this,t))}has(t){return super.has(bNe(this,t))}set(t,r){return super.set(QOr(this,t),r)}delete(t){return super.delete(WOr(this,t))}}function bNe({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function QOr({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function WOr({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function GOr(e){return e!==null&&typeof e=="object"?e.valueOf():e}function ZOr(e=Qb){if(e===Qb)return Vit;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function Vit(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const YOr=Math.sqrt(50),XOr=Math.sqrt(10),KOr=Math.sqrt(2);function o5(e,t,r){const n=(t-e)/Math.max(0,r),s=Math.floor(Math.log10(n)),a=n/Math.pow(10,s),i=a>=YOr?10:a>=XOr?5:a>=KOr?2:1;let l,c,u;return s<0?(u=Math.pow(10,-s)/i,l=Math.round(e*u),c=Math.round(t*u),l/u<e&&++l,c/u>t&&--c,u=-u):(u=Math.pow(10,s)*i,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=r&&r<2?o5(e,t,r*2):[l,c,u]}function Rae(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[s,a,i]=n?o5(t,e,r):o5(e,t,r);if(!(a>=s))return[];const l=a-s+1,c=new Array(l);if(n)if(i<0)for(let u=0;u<l;++u)c[u]=(a-u)/-i;else for(let u=0;u<l;++u)c[u]=(a-u)*i;else if(i<0)for(let u=0;u<l;++u)c[u]=(s+u)/-i;else for(let u=0;u<l;++u)c[u]=(s+u)*i;return c}function Pae(e,t,r){return t=+t,e=+e,r=+r,o5(e,t,r)[2]}function Mae(e,t,r){t=+t,e=+e,r=+r;const n=t<e,s=n?Pae(t,e,r):Pae(e,t,r);return(n?-1:1)*(s<0?1/-s:s)}function xNe(e,t){let r;for(const n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function wNe(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function qit(e,t,r=0,n=1/0,s){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(s=s===void 0?Vit:ZOr(s);n>r;){if(n-r>600){const c=n-r+1,u=t-r+1,d=Math.log(c),f=.5*Math.exp(2*d/3),h=.5*Math.sqrt(d*f*(c-f)/c)*(u-c/2<0?-1:1),p=Math.max(r,Math.floor(t-u*f/c+h)),m=Math.min(n,Math.floor(t+(c-u)*f/c+h));qit(e,t,p,m,s)}const a=e[t];let i=r,l=n;for(Kj(e,r,t),s(e[n],a)>0&&Kj(e,r,n);i<l;){for(Kj(e,i,l),++i,--l;s(e[i],a)<0;)++i;for(;s(e[l],a)>0;)--l}s(e[r],a)===0?Kj(e,r,l):(++l,Kj(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function Kj(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function JOr(e,t,r){if(e=Float64Array.from(qOr(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return wNe(e);if(t>=1)return xNe(e);var n,s=(n-1)*t,a=Math.floor(s),i=xNe(qit(e,a).subarray(0,a+1)),l=wNe(e.subarray(a+1));return i+(l-i)*(s-a)}}function ekr(e,t,r=Uit){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,s=(n-1)*t,a=Math.floor(s),i=+r(e[a],a,e),l=+r(e[a+1],a+1,e);return i+(l-i)*(s-a)}}function tkr(e,t,r){e=+e,t=+t,r=(s=arguments.length)<2?(t=e,e=0,1):s<3?1:+r;for(var n=-1,s=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(s);++n<s;)a[n]=e+n*r;return a}function Dh(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function gv(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 Dae=Symbol("implicit");function Bhe(){var e=new vNe,t=[],r=[],n=Dae;function s(a){let i=e.get(a);if(i===void 0){if(n!==Dae)return n;e.set(a,i=t.push(a)-1)}return r[i%r.length]}return s.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new vNe;for(const i of a)e.has(i)||e.set(i,t.push(i)-1);return s},s.range=function(a){return arguments.length?(r=Array.from(a),s):r.slice()},s.unknown=function(a){return arguments.length?(n=a,s):n},s.copy=function(){return Bhe(t,r).unknown(n)},Dh.apply(s,arguments),s}function Uhe(){var e=Bhe().unknown(void 0),t=e.domain,r=e.range,n=0,s=1,a,i,l=!1,c=0,u=0,d=.5;delete e.unknown;function f(){var h=t().length,p=s<n,m=p?s:n,g=p?n:s;a=(g-m)/Math.max(1,h-c+u*2),l&&(a=Math.floor(a)),m+=(g-m-a*(h-c))*d,i=a*(1-c),l&&(m=Math.round(m),i=Math.round(i));var y=tkr(h).map(function(x){return m+a*x});return r(p?y.reverse():y)}return e.domain=function(h){return arguments.length?(t(h),f()):t()},e.range=function(h){return arguments.length?([n,s]=h,n=+n,s=+s,f()):[n,s]},e.rangeRound=function(h){return[n,s]=h,n=+n,s=+s,l=!0,f()},e.bandwidth=function(){return i},e.step=function(){return a},e.round=function(h){return arguments.length?(l=!!h,f()):l},e.padding=function(h){return arguments.length?(c=Math.min(1,u=+h),f()):c},e.paddingInner=function(h){return arguments.length?(c=Math.min(1,h),f()):c},e.paddingOuter=function(h){return arguments.length?(u=+h,f()):u},e.align=function(h){return arguments.length?(d=Math.max(0,Math.min(1,h)),f()):d},e.copy=function(){return Uhe(t(),[n,s]).round(l).paddingInner(c).paddingOuter(u).align(d)},Dh.apply(f(),arguments)}function Hit(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return Hit(t())},e}function rkr(){return Hit(Uhe.apply(null,arguments).paddingInner(1))}function Vhe(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Qit(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function SP(){}var rI=.7,l5=1/rI,Zk="\\s*([+-]?\\d+)\\s*",nI="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Hm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",nkr=/^#([0-9a-f]{3,8})$/,skr=new RegExp(`^rgb\\(${Zk},${Zk},${Zk}\\)$`),akr=new RegExp(`^rgb\\(${Hm},${Hm},${Hm}\\)$`),ikr=new RegExp(`^rgba\\(${Zk},${Zk},${Zk},${nI}\\)$`),okr=new RegExp(`^rgba\\(${Hm},${Hm},${Hm},${nI}\\)$`),lkr=new RegExp(`^hsl\\(${nI},${Hm},${Hm}\\)$`),ckr=new RegExp(`^hsla\\(${nI},${Hm},${Hm},${nI}\\)$`),SNe={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};Vhe(SP,jS,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ONe,formatHex:ONe,formatHex8:ukr,formatHsl:dkr,formatRgb:kNe,toString:kNe});function ONe(){return this.rgb().formatHex()}function ukr(){return this.rgb().formatHex8()}function dkr(){return Wit(this).formatHsl()}function kNe(){return this.rgb().formatRgb()}function jS(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=nkr.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?_Ne(t):r===3?new Fu(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?zD(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?zD(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=skr.exec(e))?new Fu(t[1],t[2],t[3],1):(t=akr.exec(e))?new Fu(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=ikr.exec(e))?zD(t[1],t[2],t[3],t[4]):(t=okr.exec(e))?zD(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=lkr.exec(e))?jNe(t[1],t[2]/100,t[3]/100,1):(t=ckr.exec(e))?jNe(t[1],t[2]/100,t[3]/100,t[4]):SNe.hasOwnProperty(e)?_Ne(SNe[e]):e==="transparent"?new Fu(NaN,NaN,NaN,0):null}function _Ne(e){return new Fu(e>>16&255,e>>8&255,e&255,1)}function zD(e,t,r,n){return n<=0&&(e=t=r=NaN),new Fu(e,t,r,n)}function fkr(e){return e instanceof SP||(e=jS(e)),e?(e=e.rgb(),new Fu(e.r,e.g,e.b,e.opacity)):new Fu}function Lae(e,t,r,n){return arguments.length===1?fkr(e):new Fu(e,t,r,n??1)}function Fu(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Vhe(Fu,Lae,Qit(SP,{brighter(e){return e=e==null?l5:Math.pow(l5,e),new Fu(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?rI:Math.pow(rI,e),new Fu(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Fu(Uw(this.r),Uw(this.g),Uw(this.b),c5(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:ENe,formatHex:ENe,formatHex8:hkr,formatRgb:CNe,toString:CNe}));function ENe(){return`#${kw(this.r)}${kw(this.g)}${kw(this.b)}`}function hkr(){return`#${kw(this.r)}${kw(this.g)}${kw(this.b)}${kw((isNaN(this.opacity)?1:this.opacity)*255)}`}function CNe(){const e=c5(this.opacity);return`${e===1?"rgb(":"rgba("}${Uw(this.r)}, ${Uw(this.g)}, ${Uw(this.b)}${e===1?")":`, ${e})`}`}function c5(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Uw(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function kw(e){return e=Uw(e),(e<16?"0":"")+e.toString(16)}function jNe(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new op(e,t,r,n)}function Wit(e){if(e instanceof op)return new op(e.h,e.s,e.l,e.opacity);if(e instanceof SP||(e=jS(e)),!e)return new op;if(e instanceof op)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,s=Math.min(t,r,n),a=Math.max(t,r,n),i=NaN,l=a-s,c=(a+s)/2;return l?(t===a?i=(r-n)/l+(r<n)*6:r===a?i=(n-t)/l+2:i=(t-r)/l+4,l/=c<.5?a+s:2-a-s,i*=60):l=c>0&&c<1?0:i,new op(i,l,c,e.opacity)}function pkr(e,t,r,n){return arguments.length===1?Wit(e):new op(e,t,r,n??1)}function op(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Vhe(op,pkr,Qit(SP,{brighter(e){return e=e==null?l5:Math.pow(l5,e),new op(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?rI:Math.pow(rI,e),new op(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,r=this.l,n=r+(r<.5?r:1-r)*t,s=2*r-n;return new Fu($H(e>=240?e-240:e+120,s,n),$H(e,s,n),$H(e<120?e+240:e-120,s,n),this.opacity)},clamp(){return new op(TNe(this.h),BD(this.s),BD(this.l),c5(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=c5(this.opacity);return`${e===1?"hsl(":"hsla("}${TNe(this.h)}, ${BD(this.s)*100}%, ${BD(this.l)*100}%${e===1?")":`, ${e})`}`}}));function TNe(e){return e=(e||0)%360,e<0?e+360:e}function BD(e){return Math.max(0,Math.min(1,e||0))}function $H(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const qhe=e=>()=>e;function mkr(e,t){return function(r){return e+r*t}}function gkr(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function ykr(e){return(e=+e)==1?Git:function(t,r){return r-t?gkr(t,r,e):qhe(isNaN(t)?r:t)}}function Git(e,t){var r=t-e;return r?mkr(e,r):qhe(isNaN(e)?t:e)}const u5=(function e(t){var r=ykr(t);function n(s,a){var i=r((s=Lae(s)).r,(a=Lae(a)).r),l=r(s.g,a.g),c=r(s.b,a.b),u=Git(s.opacity,a.opacity);return function(d){return s.r=i(d),s.g=l(d),s.b=c(d),s.opacity=u(d),s+""}}return n.gamma=e,n})(1);function vkr(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),s;return function(a){for(s=0;s<r;++s)n[s]=e[s]*(1-a)+t[s]*a;return n}}function bkr(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function xkr(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,s=new Array(n),a=new Array(r),i;for(i=0;i<n;++i)s[i]=My(e[i],t[i]);for(;i<r;++i)a[i]=t[i];return function(l){for(i=0;i<n;++i)a[i]=s[i](l);return a}}function wkr(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function np(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function Skr(e,t){var r={},n={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?r[s]=My(e[s],t[s]):n[s]=t[s];return function(a){for(s in r)n[s]=r[s](a);return n}}var $ae=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,FH=new RegExp($ae.source,"g");function Okr(e){return function(){return e}}function kkr(e){return function(t){return e(t)+""}}function Zit(e,t){var r=$ae.lastIndex=FH.lastIndex=0,n,s,a,i=-1,l=[],c=[];for(e=e+"",t=t+"";(n=$ae.exec(e))&&(s=FH.exec(t));)(a=s.index)>r&&(a=t.slice(r,a),l[i]?l[i]+=a:l[++i]=a),(n=n[0])===(s=s[0])?l[i]?l[i]+=s:l[++i]=s:(l[++i]=null,c.push({i,x:np(n,s)})),r=FH.lastIndex;return r<t.length&&(a=t.slice(r),l[i]?l[i]+=a:l[++i]=a),l.length<2?c[0]?kkr(c[0].x):Okr(t):(t=c.length,function(u){for(var d=0,f;d<t;++d)l[(f=c[d]).i]=f.x(u);return l.join("")})}function My(e,t){var r=typeof t,n;return t==null||r==="boolean"?qhe(t):(r==="number"?np:r==="string"?(n=jS(t))?(t=n,u5):Zit:t instanceof jS?u5:t instanceof Date?wkr:bkr(t)?vkr:Array.isArray(t)?xkr:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Skr:np)(e,t)}function Hhe(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}var NNe=180/Math.PI,Fae={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Yit(e,t,r,n,s,a){var i,l,c;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(c=e*r+t*n)&&(r-=e*c,n-=t*c),(l=Math.sqrt(r*r+n*n))&&(r/=l,n/=l,c/=l),e*n<t*r&&(e=-e,t=-t,c=-c,i=-i),{translateX:s,translateY:a,rotate:Math.atan2(t,e)*NNe,skewX:Math.atan(c)*NNe,scaleX:i,scaleY:l}}var UD;function _kr(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Fae:Yit(t.a,t.b,t.c,t.d,t.e,t.f)}function Ekr(e){return e==null||(UD||(UD=document.createElementNS("http://www.w3.org/2000/svg","g")),UD.setAttribute("transform",e),!(e=UD.transform.baseVal.consolidate()))?Fae:(e=e.matrix,Yit(e.a,e.b,e.c,e.d,e.e,e.f))}function Xit(e,t,r,n){function s(u){return u.length?u.pop()+" ":""}function a(u,d,f,h,p,m){if(u!==f||d!==h){var g=p.push("translate(",null,t,null,r);m.push({i:g-4,x:np(u,f)},{i:g-2,x:np(d,h)})}else(f||h)&&p.push("translate("+f+t+h+r)}function i(u,d,f,h){u!==d?(u-d>180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(s(f)+"rotate(",null,n)-2,x:np(u,d)})):d&&f.push(s(f)+"rotate("+d+n)}function l(u,d,f,h){u!==d?h.push({i:f.push(s(f)+"skewX(",null,n)-2,x:np(u,d)}):d&&f.push(s(f)+"skewX("+d+n)}function c(u,d,f,h,p,m){if(u!==f||d!==h){var g=p.push(s(p)+"scale(",null,",",null,")");m.push({i:g-4,x:np(u,f)},{i:g-2,x:np(d,h)})}else(f!==1||h!==1)&&p.push(s(p)+"scale("+f+","+h+")")}return function(u,d){var f=[],h=[];return u=e(u),d=e(d),a(u.translateX,u.translateY,d.translateX,d.translateY,f,h),i(u.rotate,d.rotate,f,h),l(u.skewX,d.skewX,f,h),c(u.scaleX,u.scaleY,d.scaleX,d.scaleY,f,h),u=d=null,function(p){for(var m=-1,g=h.length,y;++m<g;)f[(y=h[m]).i]=y.x(p);return f.join("")}}}var Ckr=Xit(_kr,"px, ","px)","deg)"),jkr=Xit(Ekr,", ",")",")"),Tkr=1e-12;function ANe(e){return((e=Math.exp(e))+1/e)/2}function Nkr(e){return((e=Math.exp(e))-1/e)/2}function Akr(e){return((e=Math.exp(2*e))-1)/(e+1)}const k$=(function e(t,r,n){function s(a,i){var l=a[0],c=a[1],u=a[2],d=i[0],f=i[1],h=i[2],p=d-l,m=f-c,g=p*p+m*m,y,x;if(g<Tkr)x=Math.log(h/u)/t,y=function(T){return[l+T*p,c+T*m,u*Math.exp(t*T*x)]};else{var w=Math.sqrt(g),S=(h*h-u*u+n*g)/(2*u*r*w),k=(h*h-u*u-n*g)/(2*h*r*w),_=Math.log(Math.sqrt(S*S+1)-S),E=Math.log(Math.sqrt(k*k+1)-k);x=(E-_)/t,y=function(T){var j=T*x,N=ANe(_),I=u/(r*w)*(N*Akr(t*j+_)-Nkr(_));return[l+I*p,c+I*m,u*N/ANe(t*j+_)]}}return y.duration=x*1e3*t/Math.SQRT2,y}return s.rho=function(a){var i=Math.max(.001,+a),l=i*i,c=l*l;return e(i,l,c)},s})(Math.SQRT2,2,4);function Ikr(e,t){t===void 0&&(t=e,e=My);for(var r=0,n=t.length-1,s=t[0],a=new Array(n<0?0:n);r<n;)a[r]=e(s,s=t[++r]);return function(i){var l=Math.max(0,Math.min(n-1,Math.floor(i*=n)));return a[l](i-l)}}function Rkr(e){return function(){return e}}function d5(e){return+e}var INe=[0,1];function Yc(e){return e}function zae(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:Rkr(isNaN(t)?NaN:.5)}function Pkr(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function Mkr(e,t,r){var n=e[0],s=e[1],a=t[0],i=t[1];return s<n?(n=zae(s,n),a=r(i,a)):(n=zae(n,s),a=r(a,i)),function(l){return a(n(l))}}function Dkr(e,t,r){var n=Math.min(e.length,t.length)-1,s=new Array(n),a=new Array(n),i=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++i<n;)s[i]=zae(e[i],e[i+1]),a[i]=r(t[i],t[i+1]);return function(l){var c=wP(e,l,1,n)-1;return a[c](s[c](l))}}function OP(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function y9(){var e=INe,t=INe,r=My,n,s,a,i=Yc,l,c,u;function d(){var h=Math.min(e.length,t.length);return i!==Yc&&(i=Pkr(e[0],e[h-1])),l=h>2?Dkr:Mkr,c=u=null,f}function f(h){return h==null||isNaN(h=+h)?a:(c||(c=l(e.map(n),t,r)))(n(i(h)))}return f.invert=function(h){return i(s((u||(u=l(t,e.map(n),np)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,d5),d()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),d()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),r=Hhe,d()},f.clamp=function(h){return arguments.length?(i=h?!0:Yc,d()):i!==Yc},f.interpolate=function(h){return arguments.length?(r=h,d()):r},f.unknown=function(h){return arguments.length?(a=h,f):a},function(h,p){return n=h,s=p,d()}}function Qhe(){return y9()(Yc,Yc)}function Lkr(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function f5(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Q_(e){return e=f5(Math.abs(e)),e?e[1]:NaN}function $kr(e,t){return function(r,n){for(var s=r.length,a=[],i=0,l=e[0],c=0;s>0&&l>0&&(c+l+1>n&&(l=Math.max(1,n-c)),a.push(r.substring(s-=l,s+l)),!((c+=l+1)>n));)l=e[i=(i+1)%e.length];return a.reverse().join(t)}}function Fkr(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var zkr=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function sI(e){if(!(t=zkr.exec(e)))throw new Error("invalid format: "+e);var t;return new Whe({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]})}sI.prototype=Whe.prototype;function Whe(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+""}Whe.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 Bkr(e){e:for(var t=e.length,r=1,n=-1,s;r<t;++r)switch(e[r]){case".":n=s=r;break;case"0":n===0&&(n=r),s=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(s+1):e}var h5;function Ukr(e,t){var r=f5(e,t);if(!r)return h5=void 0,e.toPrecision(t);var n=r[0],s=r[1],a=s-(h5=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,i=n.length;return a===i?n:a>i?n+new Array(a-i+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+f5(e,Math.max(0,t+a-1))[0]}function RNe(e,t){var r=f5(e,t);if(!r)return e+"";var n=r[0],s=r[1];return s<0?"0."+new Array(-s).join("0")+n:n.length>s+1?n.slice(0,s+1)+"."+n.slice(s+1):n+new Array(s-n.length+2).join("0")}const PNe={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Lkr,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)=>RNe(e*100,t),r:RNe,s:Ukr,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function MNe(e){return e}var DNe=Array.prototype.map,LNe=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Vkr(e){var t=e.grouping===void 0||e.thousands===void 0?MNe:$kr(DNe.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",s=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?MNe:Fkr(DNe.call(e.numerals,String)),i=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(f,h){f=sI(f);var p=f.fill,m=f.align,g=f.sign,y=f.symbol,x=f.zero,w=f.width,S=f.comma,k=f.precision,_=f.trim,E=f.type;E==="n"?(S=!0,E="g"):PNe[E]||(k===void 0&&(k=12),_=!0,E="g"),(x||p==="0"&&m==="=")&&(x=!0,p="0",m="=");var T=(h&&h.prefix!==void 0?h.prefix:"")+(y==="$"?r:y==="#"&&/[boxX]/.test(E)?"0"+E.toLowerCase():""),j=(y==="$"?n:/[%p]/.test(E)?i:"")+(h&&h.suffix!==void 0?h.suffix:""),N=PNe[E],I=/[defgprs%]/.test(E);k=k===void 0?6:/[gprs]/.test(E)?Math.max(1,Math.min(21,k)):Math.max(0,Math.min(20,k));function P(R){var B=T,D=j,$,U,z;if(E==="c")D=N(R)+D,R="";else{R=+R;var H=R<0||1/R<0;if(R=isNaN(R)?c:N(Math.abs(R),k),_&&(R=Bkr(R)),H&&+R==0&&g!=="+"&&(H=!1),B=(H?g==="("?g:l:g==="-"||g==="("?"":g)+B,D=(E==="s"&&!isNaN(R)&&h5!==void 0?LNe[8+h5/3]:"")+D+(H&&g==="("?")":""),I){for($=-1,U=R.length;++$<U;)if(z=R.charCodeAt($),48>z||z>57){D=(z===46?s+R.slice($+1):R.slice($))+D,R=R.slice(0,$);break}}}S&&!x&&(R=t(R,1/0));var Q=B.length+R.length+D.length,L=Q<w?new Array(w-Q+1).join(p):"";switch(S&&x&&(R=t(L+R,L.length?w-D.length:1/0),L=""),m){case"<":R=B+R+D+L;break;case"=":R=B+L+R+D;break;case"^":R=L.slice(0,Q=L.length>>1)+B+R+D+L.slice(Q);break;default:R=L+B+R+D;break}return a(R)}return P.toString=function(){return f+""},P}function d(f,h){var p=Math.max(-8,Math.min(8,Math.floor(Q_(h)/3)))*3,m=Math.pow(10,-p),g=u((f=sI(f),f.type="f",f),{suffix:LNe[8+p/3]});return function(y){return g(m*y)}}return{format:u,formatPrefix:d}}var VD,Ghe,Kit;qkr({thousands:",",grouping:[3],currency:["$",""]});function qkr(e){return VD=Vkr(e),Ghe=VD.format,Kit=VD.formatPrefix,VD}function Hkr(e){return Math.max(0,-Q_(Math.abs(e)))}function Qkr(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Q_(t)/3)))*3-Q_(Math.abs(e)))}function Wkr(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Q_(t)-Q_(e))+1}function Jit(e,t,r,n){var s=Mae(e,t,r),a;switch(n=sI(n??",f"),n.type){case"s":{var i=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=Qkr(s,i))&&(n.precision=a),Kit(n,i)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=Wkr(s,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=Hkr(s))&&(n.precision=a-(n.type==="%")*2);break}}return Ghe(n)}function r0(e){var t=e.domain;return e.ticks=function(r){var n=t();return Rae(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var s=t();return Jit(s[0],s[s.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),s=0,a=n.length-1,i=n[s],l=n[a],c,u,d=10;for(l<i&&(u=i,i=l,l=u,u=s,s=a,a=u);d-- >0;){if(u=Pae(i,l,r),u===c)return n[s]=i,n[a]=l,t(n);if(u>0)i=Math.floor(i/u)*u,l=Math.ceil(l/u)*u;else if(u<0)i=Math.ceil(i*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function eot(){var e=Qhe();return e.copy=function(){return OP(e,eot())},Dh.apply(e,arguments),r0(e)}function tot(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,d5),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return tot(e).unknown(t)},e=arguments.length?Array.from(e,d5):[0,1],r0(r)}function rot(e,t){e=e.slice();var r=0,n=e.length-1,s=e[r],a=e[n],i;return a<s&&(i=r,r=n,n=i,i=s,s=a,a=i),e[r]=t.floor(s),e[n]=t.ceil(a),e}function $Ne(e){return Math.log(e)}function FNe(e){return Math.exp(e)}function Gkr(e){return-Math.log(-e)}function Zkr(e){return-Math.exp(-e)}function Ykr(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Xkr(e){return e===10?Ykr:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Kkr(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 zNe(e){return(t,r)=>-e(-t,r)}function Zhe(e){const t=e($Ne,FNe),r=t.domain;let n=10,s,a;function i(){return s=Kkr(n),a=Xkr(n),r()[0]<0?(s=zNe(s),a=zNe(a),e(Gkr,Zkr)):e($Ne,FNe),t}return t.base=function(l){return arguments.length?(n=+l,i()):n},t.domain=function(l){return arguments.length?(r(l),i()):r()},t.ticks=l=>{const c=r();let u=c[0],d=c[c.length-1];const f=d<u;f&&([u,d]=[d,u]);let h=s(u),p=s(d),m,g;const y=l==null?10:+l;let x=[];if(!(n%1)&&p-h<y){if(h=Math.floor(h),p=Math.ceil(p),u>0){for(;h<=p;++h)for(m=1;m<n;++m)if(g=h<0?m/a(-h):m*a(h),!(g<u)){if(g>d)break;x.push(g)}}else for(;h<=p;++h)for(m=n-1;m>=1;--m)if(g=h>0?m/a(-h):m*a(h),!(g<u)){if(g>d)break;x.push(g)}x.length*2<y&&(x=Rae(u,d,y))}else x=Rae(h,p,Math.min(p-h,y)).map(a);return f?x.reverse():x},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=sI(c)).precision==null&&(c.trim=!0),c=Ghe(c)),l===1/0)return c;const u=Math.max(1,n*l/t.ticks().length);return d=>{let f=d/a(Math.round(s(d)));return f*n<n-.5&&(f*=n),f<=u?c(d):""}},t.nice=()=>r(rot(r(),{floor:l=>a(Math.floor(s(l))),ceil:l=>a(Math.ceil(s(l)))})),t}function not(){const e=Zhe(y9()).domain([1,10]);return e.copy=()=>OP(e,not()).base(e.base()),Dh.apply(e,arguments),e}function BNe(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function UNe(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Yhe(e){var t=1,r=e(BNe(t),UNe(t));return r.constant=function(n){return arguments.length?e(BNe(t=+n),UNe(t)):t},r0(r)}function sot(){var e=Yhe(y9());return e.copy=function(){return OP(e,sot()).constant(e.constant())},Dh.apply(e,arguments)}function VNe(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Jkr(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function e_r(e){return e<0?-e*e:e*e}function Xhe(e){var t=e(Yc,Yc),r=1;function n(){return r===1?e(Yc,Yc):r===.5?e(Jkr,e_r):e(VNe(r),VNe(1/r))}return t.exponent=function(s){return arguments.length?(r=+s,n()):r},r0(t)}function Khe(){var e=Xhe(y9());return e.copy=function(){return OP(e,Khe()).exponent(e.exponent())},Dh.apply(e,arguments),e}function t_r(){return Khe.apply(null,arguments).exponent(.5)}function qNe(e){return Math.sign(e)*e*e}function r_r(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function aot(){var e=Qhe(),t=[0,1],r=!1,n;function s(a){var i=r_r(e(a));return isNaN(i)?n:r?Math.round(i):i}return s.invert=function(a){return e.invert(qNe(a))},s.domain=function(a){return arguments.length?(e.domain(a),s):e.domain()},s.range=function(a){return arguments.length?(e.range((t=Array.from(a,d5)).map(qNe)),s):t.slice()},s.rangeRound=function(a){return s.range(a).round(!0)},s.round=function(a){return arguments.length?(r=!!a,s):r},s.clamp=function(a){return arguments.length?(e.clamp(a),s):e.clamp()},s.unknown=function(a){return arguments.length?(n=a,s):n},s.copy=function(){return aot(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Dh.apply(s,arguments),r0(s)}function iot(){var e=[],t=[],r=[],n;function s(){var i=0,l=Math.max(1,t.length);for(r=new Array(l-1);++i<l;)r[i-1]=ekr(e,i/l);return a}function a(i){return i==null||isNaN(i=+i)?n:t[wP(r,i)]}return a.invertExtent=function(i){var l=t.indexOf(i);return l<0?[NaN,NaN]:[l>0?r[l-1]:e[0],l<r.length?r[l]:e[e.length-1]]},a.domain=function(i){if(!arguments.length)return e.slice();e=[];for(let l of i)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(Qb),s()},a.range=function(i){return arguments.length?(t=Array.from(i),s()):t.slice()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.quantiles=function(){return r.slice()},a.copy=function(){return iot().domain(e).range(t).unknown(n)},Dh.apply(a,arguments)}function oot(){var e=0,t=1,r=1,n=[.5],s=[0,1],a;function i(c){return c!=null&&c<=c?s[wP(n,c,0,r)]:a}function l(){var c=-1;for(n=new Array(r);++c<r;)n[c]=((c+1)*t-(c-r)*e)/(r+1);return i}return i.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},i.range=function(c){return arguments.length?(r=(s=Array.from(c)).length-1,l()):s.slice()},i.invertExtent=function(c){var u=s.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,n[0]]:u>=r?[n[r-1],t]:[n[u-1],n[u]]},i.unknown=function(c){return arguments.length&&(a=c),i},i.thresholds=function(){return n.slice()},i.copy=function(){return oot().domain([e,t]).range(s).unknown(a)},Dh.apply(r0(i),arguments)}function lot(){var e=[.5],t=[0,1],r,n=1;function s(a){return a!=null&&a<=a?t[wP(e,a,0,n)]:r}return s.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),s):e.slice()},s.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),s):t.slice()},s.invertExtent=function(a){var i=t.indexOf(a);return[e[i-1],e[i]]},s.unknown=function(a){return arguments.length?(r=a,s):r},s.copy=function(){return lot().domain(e).range(t).unknown(r)},Dh.apply(s,arguments)}const zH=new Date,BH=new Date;function sl(e,t,r,n){function s(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return s.floor=a=>(e(a=new Date(+a)),a),s.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),s.round=a=>{const i=s(a),l=s.ceil(a);return a-i<l-a?i:l},s.offset=(a,i)=>(t(a=new Date(+a),i==null?1:Math.floor(i)),a),s.range=(a,i,l)=>{const c=[];if(a=s.ceil(a),l=l==null?1:Math.floor(l),!(a<i)||!(l>0))return c;let u;do c.push(u=new Date(+a)),t(a,l),e(a);while(u<a&&a<i);return c},s.filter=a=>sl(i=>{if(i>=i)for(;e(i),!a(i);)i.setTime(i-1)},(i,l)=>{if(i>=i)if(l<0)for(;++l<=0;)for(;t(i,-1),!a(i););else for(;--l>=0;)for(;t(i,1),!a(i););}),r&&(s.count=(a,i)=>(zH.setTime(+a),BH.setTime(+i),e(zH),e(BH),Math.floor(r(zH,BH))),s.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?s.filter(n?i=>n(i)%a===0:i=>s.count(0,i)%a===0):s)),s}const p5=sl(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);p5.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?sl(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):p5);p5.range;const Ey=1e3,dh=Ey*60,Cy=dh*60,Zy=Cy*24,Jhe=Zy*7,HNe=Zy*30,UH=Zy*365,_w=sl(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ey)},(e,t)=>(t-e)/Ey,e=>e.getUTCSeconds());_w.range;const epe=sl(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ey)},(e,t)=>{e.setTime(+e+t*dh)},(e,t)=>(t-e)/dh,e=>e.getMinutes());epe.range;const tpe=sl(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*dh)},(e,t)=>(t-e)/dh,e=>e.getUTCMinutes());tpe.range;const rpe=sl(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ey-e.getMinutes()*dh)},(e,t)=>{e.setTime(+e+t*Cy)},(e,t)=>(t-e)/Cy,e=>e.getHours());rpe.range;const npe=sl(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Cy)},(e,t)=>(t-e)/Cy,e=>e.getUTCHours());npe.range;const kP=sl(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*dh)/Zy,e=>e.getDate()-1);kP.range;const v9=sl(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Zy,e=>e.getUTCDate()-1);v9.range;const cot=sl(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Zy,e=>Math.floor(e/Zy));cot.range;function h1(e){return sl(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*dh)/Jhe)}const b9=h1(0),m5=h1(1),n_r=h1(2),s_r=h1(3),W_=h1(4),a_r=h1(5),i_r=h1(6);b9.range;m5.range;n_r.range;s_r.range;W_.range;a_r.range;i_r.range;function p1(e){return sl(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/Jhe)}const x9=p1(0),g5=p1(1),o_r=p1(2),l_r=p1(3),G_=p1(4),c_r=p1(5),u_r=p1(6);x9.range;g5.range;o_r.range;l_r.range;G_.range;c_r.range;u_r.range;const spe=sl(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());spe.range;const ape=sl(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());ape.range;const Yy=sl(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());Yy.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:sl(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});Yy.range;const Xy=sl(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());Xy.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:sl(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});Xy.range;function uot(e,t,r,n,s,a){const i=[[_w,1,Ey],[_w,5,5*Ey],[_w,15,15*Ey],[_w,30,30*Ey],[a,1,dh],[a,5,5*dh],[a,15,15*dh],[a,30,30*dh],[s,1,Cy],[s,3,3*Cy],[s,6,6*Cy],[s,12,12*Cy],[n,1,Zy],[n,2,2*Zy],[r,1,Jhe],[t,1,HNe],[t,3,3*HNe],[e,1,UH]];function l(u,d,f){const h=d<u;h&&([u,d]=[d,u]);const p=f&&typeof f.range=="function"?f:c(u,d,f),m=p?p.range(u,+d+1):[];return h?m.reverse():m}function c(u,d,f){const h=Math.abs(d-u)/f,p=zhe(([,,y])=>y).right(i,h);if(p===i.length)return e.every(Mae(u/UH,d/UH,f));if(p===0)return p5.every(Math.max(Mae(u,d,f),1));const[m,g]=i[h/i[p-1][2]<i[p][2]/h?p-1:p];return m.every(g)}return[l,c]}const[d_r,f_r]=uot(Xy,ape,x9,cot,npe,tpe),[h_r,p_r]=uot(Yy,spe,b9,kP,rpe,epe);function VH(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 qH(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 Jj(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function m_r(e){var t=e.dateTime,r=e.date,n=e.time,s=e.periods,a=e.days,i=e.shortDays,l=e.months,c=e.shortMonths,u=eT(s),d=tT(s),f=eT(a),h=tT(a),p=eT(i),m=tT(i),g=eT(l),y=tT(l),x=eT(c),w=tT(c),S={a:z,A:H,b:Q,B:L,c:null,d:XNe,e:XNe,f:$_r,g:G_r,G:Y_r,H:M_r,I:D_r,j:L_r,L:dot,m:F_r,M:z_r,p:Z,q:V,Q:eAe,s:tAe,S:B_r,u:U_r,U:V_r,V:q_r,w:H_r,W:Q_r,x:null,X:null,y:W_r,Y:Z_r,Z:X_r,"%":JNe},k={a:M,A:W,b:G,B:J,c:null,d:KNe,e:KNe,f:tEr,g:dEr,G:hEr,H:K_r,I:J_r,j:eEr,L:hot,m:rEr,M:nEr,p:ae,q:te,Q:eAe,s:tAe,S:sEr,u:aEr,U:iEr,V:oEr,w:lEr,W:cEr,x:null,X:null,y:uEr,Y:fEr,Z:pEr,"%":JNe},_={a:I,A:P,b:R,B,c:D,d:ZNe,e:ZNe,f:A_r,g:GNe,G:WNe,H:YNe,I:YNe,j:C_r,L:N_r,m:E_r,M:j_r,p:N,q:__r,Q:R_r,s:P_r,S:T_r,u:x_r,U:w_r,V:S_r,w:b_r,W:O_r,x:$,X:U,y:GNe,Y:WNe,Z:k_r,"%":I_r};S.x=E(r,S),S.X=E(n,S),S.c=E(t,S),k.x=E(r,k),k.X=E(n,k),k.c=E(t,k);function E(re,ie){return function(he){var X=[],se=-1,le=0,xe=re.length,de,ue,ve;for(he instanceof Date||(he=new Date(+he));++se<xe;)re.charCodeAt(se)===37&&(X.push(re.slice(le,se)),(ue=QNe[de=re.charAt(++se)])!=null?de=re.charAt(++se):ue=de==="e"?" ":"0",(ve=ie[de])&&(de=ve(he,ue)),X.push(de),le=se+1);return X.push(re.slice(le,se)),X.join("")}}function T(re,ie){return function(he){var X=Jj(1900,void 0,1),se=j(X,re,he+="",0),le,xe;if(se!=he.length)return null;if("Q"in X)return new Date(X.Q);if("s"in X)return new Date(X.s*1e3+("L"in X?X.L:0));if(ie&&!("Z"in X)&&(X.Z=0),"p"in X&&(X.H=X.H%12+X.p*12),X.m===void 0&&(X.m="q"in X?X.q:0),"V"in X){if(X.V<1||X.V>53)return null;"w"in X||(X.w=1),"Z"in X?(le=qH(Jj(X.y,0,1)),xe=le.getUTCDay(),le=xe>4||xe===0?g5.ceil(le):g5(le),le=v9.offset(le,(X.V-1)*7),X.y=le.getUTCFullYear(),X.m=le.getUTCMonth(),X.d=le.getUTCDate()+(X.w+6)%7):(le=VH(Jj(X.y,0,1)),xe=le.getDay(),le=xe>4||xe===0?m5.ceil(le):m5(le),le=kP.offset(le,(X.V-1)*7),X.y=le.getFullYear(),X.m=le.getMonth(),X.d=le.getDate()+(X.w+6)%7)}else("W"in X||"U"in X)&&("w"in X||(X.w="u"in X?X.u%7:"W"in X?1:0),xe="Z"in X?qH(Jj(X.y,0,1)).getUTCDay():VH(Jj(X.y,0,1)).getDay(),X.m=0,X.d="W"in X?(X.w+6)%7+X.W*7-(xe+5)%7:X.w+X.U*7-(xe+6)%7);return"Z"in X?(X.H+=X.Z/100|0,X.M+=X.Z%100,qH(X)):VH(X)}}function j(re,ie,he,X){for(var se=0,le=ie.length,xe=he.length,de,ue;se<le;){if(X>=xe)return-1;if(de=ie.charCodeAt(se++),de===37){if(de=ie.charAt(se++),ue=_[de in QNe?ie.charAt(se++):de],!ue||(X=ue(re,he,X))<0)return-1}else if(de!=he.charCodeAt(X++))return-1}return X}function N(re,ie,he){var X=u.exec(ie.slice(he));return X?(re.p=d.get(X[0].toLowerCase()),he+X[0].length):-1}function I(re,ie,he){var X=p.exec(ie.slice(he));return X?(re.w=m.get(X[0].toLowerCase()),he+X[0].length):-1}function P(re,ie,he){var X=f.exec(ie.slice(he));return X?(re.w=h.get(X[0].toLowerCase()),he+X[0].length):-1}function R(re,ie,he){var X=x.exec(ie.slice(he));return X?(re.m=w.get(X[0].toLowerCase()),he+X[0].length):-1}function B(re,ie,he){var X=g.exec(ie.slice(he));return X?(re.m=y.get(X[0].toLowerCase()),he+X[0].length):-1}function D(re,ie,he){return j(re,t,ie,he)}function $(re,ie,he){return j(re,r,ie,he)}function U(re,ie,he){return j(re,n,ie,he)}function z(re){return i[re.getDay()]}function H(re){return a[re.getDay()]}function Q(re){return c[re.getMonth()]}function L(re){return l[re.getMonth()]}function Z(re){return s[+(re.getHours()>=12)]}function V(re){return 1+~~(re.getMonth()/3)}function M(re){return i[re.getUTCDay()]}function W(re){return a[re.getUTCDay()]}function G(re){return c[re.getUTCMonth()]}function J(re){return l[re.getUTCMonth()]}function ae(re){return s[+(re.getUTCHours()>=12)]}function te(re){return 1+~~(re.getUTCMonth()/3)}return{format:function(re){var ie=E(re+="",S);return ie.toString=function(){return re},ie},parse:function(re){var ie=T(re+="",!1);return ie.toString=function(){return re},ie},utcFormat:function(re){var ie=E(re+="",k);return ie.toString=function(){return re},ie},utcParse:function(re){var ie=T(re+="",!0);return ie.toString=function(){return re},ie}}}var QNe={"-":"",_:" ",0:"0"},El=/^\s*\d+/,g_r=/^%/,y_r=/[\\^$*+?|[\]().{}]/g;function Bs(e,t,r){var n=e<0?"-":"",s=(n?-e:e)+"",a=s.length;return n+(a<r?new Array(r-a+1).join(t)+s:s)}function v_r(e){return e.replace(y_r,"\\$&")}function eT(e){return new RegExp("^(?:"+e.map(v_r).join("|")+")","i")}function tT(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function b_r(e,t,r){var n=El.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function x_r(e,t,r){var n=El.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function w_r(e,t,r){var n=El.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function S_r(e,t,r){var n=El.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function O_r(e,t,r){var n=El.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function WNe(e,t,r){var n=El.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function GNe(e,t,r){var n=El.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function k_r(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function __r(e,t,r){var n=El.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function E_r(e,t,r){var n=El.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function ZNe(e,t,r){var n=El.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function C_r(e,t,r){var n=El.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function YNe(e,t,r){var n=El.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function j_r(e,t,r){var n=El.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function T_r(e,t,r){var n=El.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function N_r(e,t,r){var n=El.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function A_r(e,t,r){var n=El.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function I_r(e,t,r){var n=g_r.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function R_r(e,t,r){var n=El.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function P_r(e,t,r){var n=El.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function XNe(e,t){return Bs(e.getDate(),t,2)}function M_r(e,t){return Bs(e.getHours(),t,2)}function D_r(e,t){return Bs(e.getHours()%12||12,t,2)}function L_r(e,t){return Bs(1+kP.count(Yy(e),e),t,3)}function dot(e,t){return Bs(e.getMilliseconds(),t,3)}function $_r(e,t){return dot(e,t)+"000"}function F_r(e,t){return Bs(e.getMonth()+1,t,2)}function z_r(e,t){return Bs(e.getMinutes(),t,2)}function B_r(e,t){return Bs(e.getSeconds(),t,2)}function U_r(e){var t=e.getDay();return t===0?7:t}function V_r(e,t){return Bs(b9.count(Yy(e)-1,e),t,2)}function fot(e){var t=e.getDay();return t>=4||t===0?W_(e):W_.ceil(e)}function q_r(e,t){return e=fot(e),Bs(W_.count(Yy(e),e)+(Yy(e).getDay()===4),t,2)}function H_r(e){return e.getDay()}function Q_r(e,t){return Bs(m5.count(Yy(e)-1,e),t,2)}function W_r(e,t){return Bs(e.getFullYear()%100,t,2)}function G_r(e,t){return e=fot(e),Bs(e.getFullYear()%100,t,2)}function Z_r(e,t){return Bs(e.getFullYear()%1e4,t,4)}function Y_r(e,t){var r=e.getDay();return e=r>=4||r===0?W_(e):W_.ceil(e),Bs(e.getFullYear()%1e4,t,4)}function X_r(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Bs(t/60|0,"0",2)+Bs(t%60,"0",2)}function KNe(e,t){return Bs(e.getUTCDate(),t,2)}function K_r(e,t){return Bs(e.getUTCHours(),t,2)}function J_r(e,t){return Bs(e.getUTCHours()%12||12,t,2)}function eEr(e,t){return Bs(1+v9.count(Xy(e),e),t,3)}function hot(e,t){return Bs(e.getUTCMilliseconds(),t,3)}function tEr(e,t){return hot(e,t)+"000"}function rEr(e,t){return Bs(e.getUTCMonth()+1,t,2)}function nEr(e,t){return Bs(e.getUTCMinutes(),t,2)}function sEr(e,t){return Bs(e.getUTCSeconds(),t,2)}function aEr(e){var t=e.getUTCDay();return t===0?7:t}function iEr(e,t){return Bs(x9.count(Xy(e)-1,e),t,2)}function pot(e){var t=e.getUTCDay();return t>=4||t===0?G_(e):G_.ceil(e)}function oEr(e,t){return e=pot(e),Bs(G_.count(Xy(e),e)+(Xy(e).getUTCDay()===4),t,2)}function lEr(e){return e.getUTCDay()}function cEr(e,t){return Bs(g5.count(Xy(e)-1,e),t,2)}function uEr(e,t){return Bs(e.getUTCFullYear()%100,t,2)}function dEr(e,t){return e=pot(e),Bs(e.getUTCFullYear()%100,t,2)}function fEr(e,t){return Bs(e.getUTCFullYear()%1e4,t,4)}function hEr(e,t){var r=e.getUTCDay();return e=r>=4||r===0?G_(e):G_.ceil(e),Bs(e.getUTCFullYear()%1e4,t,4)}function pEr(){return"+0000"}function JNe(){return"%"}function eAe(e){return+e}function tAe(e){return Math.floor(+e/1e3)}var vO,mot,got;mEr({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 mEr(e){return vO=m_r(e),mot=vO.format,vO.parse,got=vO.utcFormat,vO.utcParse,vO}function gEr(e){return new Date(e)}function yEr(e){return e instanceof Date?+e:+new Date(+e)}function ipe(e,t,r,n,s,a,i,l,c,u){var d=Qhe(),f=d.invert,h=d.domain,p=u(".%L"),m=u(":%S"),g=u("%I:%M"),y=u("%I %p"),x=u("%a %d"),w=u("%b %d"),S=u("%B"),k=u("%Y");function _(E){return(c(E)<E?p:l(E)<E?m:i(E)<E?g:a(E)<E?y:n(E)<E?s(E)<E?x:w:r(E)<E?S:k)(E)}return d.invert=function(E){return new Date(f(E))},d.domain=function(E){return arguments.length?h(Array.from(E,yEr)):h().map(gEr)},d.ticks=function(E){var T=h();return e(T[0],T[T.length-1],E??10)},d.tickFormat=function(E,T){return T==null?_:u(T)},d.nice=function(E){var T=h();return(!E||typeof E.range!="function")&&(E=t(T[0],T[T.length-1],E??10)),E?h(rot(T,E)):d},d.copy=function(){return OP(d,ipe(e,t,r,n,s,a,i,l,c,u))},d}function vEr(){return Dh.apply(ipe(h_r,p_r,Yy,spe,b9,kP,rpe,epe,_w,mot).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function bEr(){return Dh.apply(ipe(d_r,f_r,Xy,ape,x9,v9,npe,tpe,_w,got).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function w9(){var e=0,t=1,r,n,s,a,i=Yc,l=!1,c;function u(f){return f==null||isNaN(f=+f)?c:i(s===0?.5:(f=(a(f)-r)*s,l?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([e,t]=f,r=a(e=+e),n=a(t=+t),s=r===n?0:1/(n-r),u):[e,t]},u.clamp=function(f){return arguments.length?(l=!!f,u):l},u.interpolator=function(f){return arguments.length?(i=f,u):i};function d(f){return function(h){var p,m;return arguments.length?([p,m]=h,i=f(p,m),u):[i(0),i(1)]}}return u.range=d(My),u.rangeRound=d(Hhe),u.unknown=function(f){return arguments.length?(c=f,u):c},function(f){return a=f,r=f(e),n=f(t),s=r===n?0:1/(n-r),u}}function n0(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function yot(){var e=r0(w9()(Yc));return e.copy=function(){return n0(e,yot())},gv.apply(e,arguments)}function vot(){var e=Zhe(w9()).domain([1,10]);return e.copy=function(){return n0(e,vot()).base(e.base())},gv.apply(e,arguments)}function bot(){var e=Yhe(w9());return e.copy=function(){return n0(e,bot()).constant(e.constant())},gv.apply(e,arguments)}function ope(){var e=Xhe(w9());return e.copy=function(){return n0(e,ope()).exponent(e.exponent())},gv.apply(e,arguments)}function xEr(){return ope.apply(null,arguments).exponent(.5)}function xot(){var e=[],t=Yc;function r(n){if(n!=null&&!isNaN(n=+n))return t((wP(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let s of n)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(Qb),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,s)=>t(s/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(s,a)=>JOr(e,a/n))},r.copy=function(){return xot(t).domain(e)},gv.apply(r,arguments)}function S9(){var e=0,t=.5,r=1,n=1,s,a,i,l,c,u=Yc,d,f=!1,h;function p(g){return isNaN(g=+g)?h:(g=.5+((g=+d(g))-a)*(n*g<n*a?l:c),u(f?Math.max(0,Math.min(1,g)):g))}p.domain=function(g){return arguments.length?([e,t,r]=g,s=d(e=+e),a=d(t=+t),i=d(r=+r),l=s===a?0:.5/(a-s),c=a===i?0:.5/(i-a),n=a<s?-1:1,p):[e,t,r]},p.clamp=function(g){return arguments.length?(f=!!g,p):f},p.interpolator=function(g){return arguments.length?(u=g,p):u};function m(g){return function(y){var x,w,S;return arguments.length?([x,w,S]=y,u=Ikr(g,[x,w,S]),p):[u(0),u(.5),u(1)]}}return p.range=m(My),p.rangeRound=m(Hhe),p.unknown=function(g){return arguments.length?(h=g,p):h},function(g){return d=g,s=g(e),a=g(t),i=g(r),l=s===a?0:.5/(a-s),c=a===i?0:.5/(i-a),n=a<s?-1:1,p}}function wot(){var e=r0(S9()(Yc));return e.copy=function(){return n0(e,wot())},gv.apply(e,arguments)}function Sot(){var e=Zhe(S9()).domain([.1,1,10]);return e.copy=function(){return n0(e,Sot()).base(e.base())},gv.apply(e,arguments)}function Oot(){var e=Yhe(S9());return e.copy=function(){return n0(e,Oot()).constant(e.constant())},gv.apply(e,arguments)}function lpe(){var e=Xhe(S9());return e.copy=function(){return n0(e,lpe()).exponent(e.exponent())},gv.apply(e,arguments)}function wEr(){return lpe.apply(null,arguments).exponent(.5)}const UT=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Uhe,scaleDiverging:wot,scaleDivergingLog:Sot,scaleDivergingPow:lpe,scaleDivergingSqrt:wEr,scaleDivergingSymlog:Oot,scaleIdentity:tot,scaleImplicit:Dae,scaleLinear:eot,scaleLog:not,scaleOrdinal:Bhe,scalePoint:rkr,scalePow:Khe,scaleQuantile:iot,scaleQuantize:oot,scaleRadial:aot,scaleSequential:yot,scaleSequentialLog:vot,scaleSequentialPow:ope,scaleSequentialQuantile:xot,scaleSequentialSqrt:xEr,scaleSequentialSymlog:bot,scaleSqrt:t_r,scaleSymlog:sot,scaleThreshold:lot,scaleTime:vEr,scaleUtc:bEr,tickFormat:Jit},Symbol.toStringTag,{value:"Module"}));function SEr(e){if(e in UT)return UT[e]();var t="scale".concat(pP(e));if(t in UT)return UT[t]()}function rAe(e,t,r){if(typeof e=="function")return e.copy().domain(t).range(r);if(e!=null){var n=SEr(e);if(n!=null)return n.domain(t).range(r),n}}function cpe(e,t,r,n){if(!(r==null||n==null))return typeof e.scale=="function"?rAe(e.scale,r,n):rAe(t,r,n)}function OEr(e){return"scale".concat(pP(e))}function kEr(e){return OEr(e)in UT}var kot=(e,t,r)=>{if(e!=null){var{scale:n,type:s}=e;if(n==="auto")return s==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!t)?"point":s==="category"?"band":"linear";if(typeof n=="string")return kEr(n)?n:"point"}};function _Er(e,t){for(var r=0,n=e.length,s=e[0]<e[e.length-1];r<n;){var a=Math.floor((r+n)/2);(s?e[a]<t:e[a]>t)?r=a+1:n=a}return r}function _ot(e,t){if(e){var r=t??e.domain(),n=r.map(a=>{var i;return(i=e(a))!==null&&i!==void 0?i:0}),s=e.range();if(!(r.length===0||s.length<2))return a=>{var i,l,c=_Er(n,a);if(c<=0)return r[0];if(c>=r.length)return r[r.length-1];var u=(i=n[c-1])!==null&&i!==void 0?i:0,d=(l=n[c])!==null&&l!==void 0?l:0;return Math.abs(a-u)<=Math.abs(a-d)?r[c-1]:r[c]}}}function EEr(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):_ot(e,void 0)}function nAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function y5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?nAe(Object(r),!0).forEach(function(n){CEr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function CEr(e,t,r){return(t=jEr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jEr(e){var t=TEr(e,"string");return typeof t=="symbol"?t:t+""}function TEr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Bae=[0,"auto"],Yo={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0,niceTicks:"auto"},Eot=(e,t)=>e.cartesianAxis.xAxis[t],yv=(e,t)=>{var r=Eot(e,t);return r??Yo},Xo={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:Bae,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,niceTicks:"auto",width:yP},Cot=(e,t)=>e.cartesianAxis.yAxis[t],vv=(e,t)=>{var r=Cot(e,t);return r??Xo},NEr={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},upe=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return r??NEr},du=(e,t,r)=>{switch(t){case"xAxis":return yv(e,r);case"yAxis":return vv(e,r);case"zAxis":return upe(e,r);case"angleAxis":return Mhe(e,r);case"radiusAxis":return Dhe(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},AEr=(e,t,r)=>{switch(t){case"xAxis":return yv(e,r);case"yAxis":return vv(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},_P=(e,t,r)=>{switch(t){case"xAxis":return yv(e,r);case"yAxis":return vv(e,r);case"angleAxis":return Mhe(e,r);case"radiusAxis":return Dhe(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},jot=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function Tot(e,t){return r=>{switch(e){case"xAxis":return"xAxisId"in r&&r.xAxisId===t;case"yAxis":return"yAxisId"in r&&r.yAxisId===t;case"zAxis":return"zAxisId"in r&&r.zAxisId===t;case"angleAxis":return"angleAxisId"in r&&r.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in r&&r.radiusAxisId===t;default:return!1}}}var Not=e=>e.graphicalItems.cartesianItems,IEr=Xe([kl,p9],Tot),Aot=(e,t,r)=>e.filter(r).filter(n=>t?.includeHidden===!0?!0:!n.hide),EP=Xe([Not,du,IEr],Aot,{memoizeOptions:{resultEqualityCheck:g9}}),Iot=Xe([EP],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter($he)),Rot=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),REr=Xe([EP],Rot),Pot=e=>e.map(t=>t.data).filter(Boolean).flat(1),PEr=Xe([EP],Pot,{memoizeOptions:{resultEqualityCheck:g9}}),Mot=(e,t)=>{var{chartData:r=[],dataStartIndex:n,dataEndIndex:s}=t;return e.length>0?e:r.slice(n,s+1)},dpe=Xe([PEr,jhe],Mot),Dot=(e,t,r)=>t?.dataKey!=null?e.map(n=>({value:Ql(n,t.dataKey)})):r.length>0?r.map(n=>n.dataKey).flatMap(n=>e.map(s=>({value:Ql(s,n)}))):e.map(n=>({value:n})),CP=Xe([dpe,du,EP],Dot);function Yk(e){if(eg(e)||e instanceof Date){var t=Number(e);if(zs(t))return t}}function sAe(e){if(Array.isArray(e)){var t=[Yk(e[0]),Yk(e[1])];return qm(t)?t:void 0}var r=Yk(e);if(r!=null)return[r,r]}function Ky(e){return e.map(Yk).filter($u)}function MEr(e,t){var r=Yk(e),n=Yk(t);return r==null&&n==null?0:r==null?-1:n==null?1:r-n}var DEr=Xe([CP],e=>e?.map(t=>t.value).sort(MEr));function Lot(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function LEr(e,t,r){return!r||typeof t!="number"||Wy(t)?[]:r.length?Ky(r.flatMap(n=>{var s=Ql(e,n.dataKey),a,i;if(Array.isArray(s)?[a,i]=s:a=i=s,!(!zs(a)||!zs(i)))return[t-a,t+i]})):[]}var al=e=>{var t=_l(e),r=nC(e);return _P(e,t,r)},jP=Xe([al],e=>e?.dataKey),$Er=Xe([Iot,jhe,al],Bit),$ot=(e,t,r,n)=>{var s={},a=t.reduce((i,l)=>{if(l.stackId==null)return i;var c=i[l.stackId];return c==null&&(c=[]),c.push(l),i[l.stackId]=c,i},s);return Object.fromEntries(Object.entries(a).map(i=>{var[l,c]=i,u=n?[...c].reverse():c,d=u.map(zit);return[l,{stackedData:Kwr(e,d,r),graphicalItems:u}]}))},FEr=Xe([$Er,Iot,u9,Rit],$ot),Fot=(e,t,r,n)=>{var{dataStartIndex:s,dataEndIndex:a}=t;if(n==null&&r!=="zAxis"){var i=tSr(e,s,a);if(!(i!=null&&i[0]===0&&i[1]===0))return i}},zEr=Xe([du],e=>e.allowDataOverflow),fpe=e=>{var t;if(e==null||!("domain"in e))return Bae;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var r=Ky(e.ticks);return[Math.min(...r),Math.max(...r)]}if(e.type==="category")return e.ticks.map(String)}return(t=e?.domain)!==null&&t!==void 0?t:Bae},zot=Xe([du],fpe),Bot=Xe([zot,zEr],Sit),BEr=Xe([FEr,t0,kl,Bot],Fot,{memoizeOptions:{resultEqualityCheck:m9}}),hpe=e=>e.errorBars,UEr=(e,t,r)=>e.flatMap(n=>t[n.id]).filter(Boolean).filter(n=>Lot(r,n)),v5=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var s=r.filter(Boolean);if(s.length!==0){var a=s.flat(),i=Math.min(...a),l=Math.max(...a);return[i,l]}},Uot=(e,t,r,n,s)=>{var a,i;if(r.length>0&&e.forEach(l=>{r.forEach(c=>{var u,d,f=(u=n[c.id])===null||u===void 0?void 0:u.filter(x=>Lot(s,x)),h=Ql(l,(d=t.dataKey)!==null&&d!==void 0?d:c.dataKey),p=LEr(l,h,f);if(p.length>=2){var m=Math.min(...p),g=Math.max(...p);(a==null||m<a)&&(a=m),(i==null||g>i)&&(i=g)}var y=sAe(h);y!=null&&(a=a==null?y[0]:Math.min(a,y[0]),i=i==null?y[1]:Math.max(i,y[1]))})}),t?.dataKey!=null&&e.forEach(l=>{var c=sAe(Ql(l,t.dataKey));c!=null&&(a=a==null?c[0]:Math.min(a,c[0]),i=i==null?c[1]:Math.max(i,c[1]))}),zs(a)&&zs(i))return[a,i]},VEr=Xe([dpe,du,REr,hpe,kl],Uot,{memoizeOptions:{resultEqualityCheck:m9}});function qEr(e){var{value:t}=e;if(eg(t)||t instanceof Date)return t}var HEr=(e,t,r)=>{var n=e.map(qEr).filter(s=>s!=null);return r&&(t.dataKey==null||t.allowDuplicatedCategory&&eat(n))?wit(0,e.length):t.allowDuplicatedCategory?n:Array.from(new Set(n))},Vot=e=>e.referenceElements.dots,sC=(e,t,r)=>e.filter(n=>n.ifOverflow==="extendDomain").filter(n=>t==="xAxis"?n.xAxisId===r:n.yAxisId===r),QEr=Xe([Vot,kl,p9],sC),qot=e=>e.referenceElements.areas,WEr=Xe([qot,kl,p9],sC),Hot=e=>e.referenceElements.lines,GEr=Xe([Hot,kl,p9],sC),Qot=(e,t)=>{if(e!=null){var r=Ky(e.map(n=>t==="xAxis"?n.x:n.y));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},ZEr=Xe(QEr,kl,Qot),Wot=(e,t)=>{if(e!=null){var r=Ky(e.flatMap(n=>[t==="xAxis"?n.x1:n.y1,t==="xAxis"?n.x2:n.y2]));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},YEr=Xe([WEr,kl],Wot);function XEr(e){var t;if(e.x!=null)return Ky([e.x]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.x);return r==null||r.length===0?[]:Ky(r)}function KEr(e){var t;if(e.y!=null)return Ky([e.y]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.y);return r==null||r.length===0?[]:Ky(r)}var Got=(e,t)=>{if(e!=null){var r=e.flatMap(n=>t==="xAxis"?XEr(n):KEr(n));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},JEr=Xe([GEr,kl],Got),eCr=Xe(ZEr,JEr,YEr,(e,t,r)=>v5(e,r,t)),Zot=(e,t,r,n,s,a,i,l)=>{if(r!=null)return r;var c=i==="vertical"&&l==="xAxis"||i==="horizontal"&&l==="yAxis",u=c?v5(n,a,s):v5(a,s);return jOr(t,u,e.allowDataOverflow)},tCr=Xe([du,zot,Bot,BEr,VEr,eCr,Fi,kl],Zot,{memoizeOptions:{resultEqualityCheck:m9}}),rCr=[0,1],Yot=(e,t,r,n,s,a,i)=>{if(!((e==null||r==null||r.length===0)&&i===void 0)){var{dataKey:l,type:c}=e,u=hv(t,a);if(u&&l==null){var d;return wit(0,(d=r?.length)!==null&&d!==void 0?d:0)}return c==="category"?HEr(n,e,u):s==="expand"?rCr:i}},ppe=Xe([du,Fi,dpe,CP,u9,kl,tCr],Yot),aC=Xe([du,jot,Ihe],kot),Xot=(e,t,r)=>{var{niceTicks:n}=t;if(n!=="none"){var s=fpe(t),a=Array.isArray(s)&&(s[0]==="auto"||s[1]==="auto");if((n==="snap125"||n==="adaptive")&&t!=null&&t.tickCount&&qm(e)){if(a)return hNe(e,t.tickCount,t.allowDecimals,n);if(t.type==="number")return pNe(e,t.tickCount,t.allowDecimals,n)}if(n==="auto"&&r==="linear"&&t!=null&&t.tickCount){if(a&&qm(e))return hNe(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&qm(e))return pNe(e,t.tickCount,t.allowDecimals,"adaptive")}}},mpe=Xe([ppe,_P,aC],Xot),Kot=(e,t,r,n)=>{if(n!=="angleAxis"&&e?.type==="number"&&qm(t)&&Array.isArray(r)&&r.length>0){var s,a,i=t[0],l=(s=r[0])!==null&&s!==void 0?s:0,c=t[1],u=(a=r[r.length-1])!==null&&a!==void 0?a:0;return[Math.min(i,l),Math.max(c,u)]}return t},nCr=Xe([du,ppe,mpe,kl],Kot),sCr=Xe(CP,du,(e,t)=>{if(!(!t||t.type!=="number")){var r=1/0,n=Array.from(Ky(e.map(f=>f.value))).sort((f,h)=>f-h),s=n[0],a=n[n.length-1];if(s==null||a==null)return 1/0;var i=a-s;if(i===0)return 1/0;for(var l=0;l<n.length-1;l++){var c=n[l],u=n[l+1];if(!(c==null||u==null)){var d=u-c;r=Math.min(r,d)}}return r/i}}),Jot=Xe(sCr,Fi,ROr,Yl,(e,t,r,n,s)=>s,(e,t,r,n,s)=>{if(!zs(e))return 0;var a=t==="vertical"?n.height:n.width;if(s==="gap")return e*a/2;if(s==="no-gap"){var i=wx(r,e*a),l=e*a/2;return l-i-(l-i)/a*i}return 0}),aCr=(e,t,r)=>{var n=yv(e,t);return n==null||typeof n.padding!="string"?0:Jot(e,"xAxis",t,r,n.padding)},iCr=(e,t,r)=>{var n=vv(e,t);return n==null||typeof n.padding!="string"?0:Jot(e,"yAxis",t,r,n.padding)},oCr=Xe(yv,aCr,(e,t)=>{var r,n;if(e==null)return{left:0,right:0};var{padding:s}=e;return typeof s=="string"?{left:t,right:t}:{left:((r=s.left)!==null&&r!==void 0?r:0)+t,right:((n=s.right)!==null&&n!==void 0?n:0)+t}}),lCr=Xe(vv,iCr,(e,t)=>{var r,n;if(e==null)return{top:0,bottom:0};var{padding:s}=e;return typeof s=="string"?{top:t,bottom:t}:{top:((r=s.top)!==null&&r!==void 0?r:0)+t,bottom:((n=s.bottom)!==null&&n!==void 0?n:0)+t}}),cCr=Xe([Yl,oCr,s9,n9,(e,t,r)=>r],(e,t,r,n,s)=>{var{padding:a}=n;return s?[a.left,r.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),uCr=Xe([Yl,Fi,lCr,s9,n9,(e,t,r)=>r],(e,t,r,n,s,a)=>{var{padding:i}=s;return a?[n.height-i.bottom,i.top]:t==="horizontal"?[e.top+e.height-r.bottom,e.top+r.top]:[e.top+r.top,e.top+e.height-r.bottom]}),TP=(e,t,r,n)=>{var s;switch(t){case"xAxis":return cCr(e,r,n);case"yAxis":return uCr(e,r,n);case"zAxis":return(s=upe(e,r))===null||s===void 0?void 0:s.range;case"angleAxis":return Lit(e);case"radiusAxis":return $it(e,r);default:return}},elt=Xe([du,TP],d9),dCr=Xe([aC,nCr],BOr),gpe=Xe([du,aC,dCr,elt],cpe),tlt=(e,t,r,n)=>{if(!(r==null||r.dataKey==null)){var{type:s,scale:a}=r,i=hv(e,n);if(i&&(s==="number"||a!=="auto"))return t.map(l=>l.value)}},ype=Xe([Fi,CP,_P,kl],tlt),O9=Xe([gpe],Fhe);Xe([gpe],EEr);Xe([gpe,DEr],_ot);Xe([EP,hpe,kl],UEr);function rlt(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var k9=(e,t)=>t,_9=(e,t,r)=>r,fCr=Xe(t9,k9,_9,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(rlt)),hCr=Xe(r9,k9,_9,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(rlt)),nlt=(e,t)=>({width:e.width,height:t.height}),pCr=(e,t)=>{var r=typeof t.width=="number"?t.width:yP;return{width:r,height:e.height}},mCr=Xe(Yl,yv,nlt),gCr=(e,t,r)=>{switch(t){case"top":return e.top;case"bottom":return r-e.bottom;default:return 0}},yCr=(e,t,r)=>{switch(t){case"left":return e.left;case"right":return r-e.right;default:return 0}},vCr=Xe(mv,Yl,fCr,k9,_9,(e,t,r,n,s)=>{var a={},i;return r.forEach(l=>{var c=nlt(t,l);i==null&&(i=gCr(t,n,e));var u=n==="top"&&!s||n==="bottom"&&s;a[l.id]=i-Number(u)*c.height,i+=(u?-1:1)*c.height}),a}),bCr=Xe(pv,Yl,hCr,k9,_9,(e,t,r,n,s)=>{var a={},i;return r.forEach(l=>{var c=pCr(t,l);i==null&&(i=yCr(t,n,e));var u=n==="left"&&!s||n==="right"&&s;a[l.id]=i-Number(u)*c.width,i+=(u?-1:1)*c.width}),a}),xCr=(e,t)=>{var r=yv(e,t);if(r!=null)return vCr(e,r.orientation,r.mirror)},wCr=Xe([Yl,yv,xCr,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var s=r?.[n];return s==null?{x:e.left,y:0}:{x:e.left,y:s}}}),SCr=(e,t)=>{var r=vv(e,t);if(r!=null)return bCr(e,r.orientation,r.mirror)},OCr=Xe([Yl,vv,SCr,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var s=r?.[n];return s==null?{x:0,y:e.top}:{x:s,y:e.top}}}),kCr=Xe(Yl,vv,(e,t)=>{var r=typeof t.width=="number"?t.width:yP;return{width:r,height:e.height}}),slt=(e,t,r,n)=>{if(r!=null){var{allowDuplicatedCategory:s,type:a,dataKey:i}=r,l=hv(e,n),c=t.map(u=>u.value);if(i&&l&&a==="category"&&s&&eat(c))return c}},vpe=Xe([Fi,CP,du,kl],slt),aAe=Xe([Fi,AEr,aC,O9,vpe,ype,TP,mpe,kl],(e,t,r,n,s,a,i,l,c)=>{if(t!=null){var u=hv(e,c);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:c,categoricalDomain:a,duplicateDomain:s,isCategorical:u,niceTicks:l,range:i,realScaleType:r,scale:n}}}),_Cr=(e,t,r,n,s,a,i,l,c)=>{if(!(t==null||n==null)){var u=hv(e,c),{type:d,ticks:f,tickCount:h}=t,p=r==="scaleBand"&&typeof n.bandwidth=="function"?n.bandwidth()/2:2,m=d==="category"&&n.bandwidth?n.bandwidth()/p:0;m=c==="angleAxis"&&a!=null&&a.length>=2?ch(a[0]-a[1])*2*m:m;var g=f||s;return g?g.map((y,x)=>{var w=i?i.indexOf(y):y,S=n.map(w);return zs(S)?{index:x,coordinate:S+m,value:y,offset:m}:null}).filter($u):u&&l?l.map((y,x)=>{var w=n.map(y);return zs(w)?{coordinate:w+m,value:y,index:x,offset:m}:null}).filter($u):n.ticks?n.ticks(h).map((y,x)=>{var w=n.map(y);return zs(w)?{coordinate:w+m,value:y,index:x,offset:m}:null}).filter($u):n.domain().map((y,x)=>{var w=n.map(y);return zs(w)?{coordinate:w+m,value:i?i[y]:y,index:x,offset:m}:null}).filter($u)}},alt=Xe([Fi,_P,aC,O9,mpe,TP,vpe,ype,kl],_Cr),ECr=(e,t,r,n,s,a,i)=>{if(!(t==null||r==null||n==null||n[0]===n[1])){var l=hv(e,i),{tickCount:c}=t,u=0;return u=i==="angleAxis"&&n?.length>=2?ch(n[0]-n[1])*2*u:u,l&&a?a.map((d,f)=>{var h=r.map(d);return zs(h)?{coordinate:h+u,value:d,index:f,offset:u}:null}).filter($u):r.ticks?r.ticks(c).map((d,f)=>{var h=r.map(d);return zs(h)?{coordinate:h+u,value:d,index:f,offset:u}:null}).filter($u):r.domain().map((d,f)=>{var h=r.map(d);return zs(h)?{coordinate:h+u,value:s?s[d]:d,index:f,offset:u}:null}).filter($u)}},ilt=Xe([Fi,_P,O9,TP,vpe,ype,kl],ECr),olt=Xe(du,O9,(e,t)=>{if(!(e==null||t==null))return y5(y5({},e),{},{scale:t})}),CCr=Xe([du,aC,ppe,elt],cpe),jCr=Xe([CCr],Fhe);Xe((e,t,r)=>upe(e,r),jCr,(e,t)=>{if(!(e==null||t==null))return y5(y5({},e),{},{scale:t})});var TCr=Xe([Fi,t9,r9],(e,t,r)=>{switch(e){case"horizontal":return t.some(n=>n.reversed)?"right-to-left":"left-to-right";case"vertical":return r.some(n=>n.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),NCr=(e,t,r)=>{var n;return(n=e.renderedTicks[t])===null||n===void 0?void 0:n[r]};Xe([NCr],e=>{if(!(!e||e.length===0))return t=>{var r,n=1/0,s=e[0];for(var a of e){var i=Math.abs(a.coordinate-t);i<n&&(n=i,s=a)}return(r=s)===null||r===void 0?void 0:r.value}});var llt=e=>e.options.defaultTooltipEventType,clt=e=>e.options.validateTooltipEventTypes;function ult(e,t,r){if(e==null)return t;var n=e?"axis":"item";return r==null?t:r.includes(n)?n:t}function bpe(e,t){var r=llt(e),n=clt(e);return ult(t,r,n)}function ACr(e){return en(t=>bpe(t,e))}var dlt=(e,t)=>{var r,n=Number(t);if(!(Wy(n)||t==null))return n>=0?e==null||(r=e[n])===null||r===void 0?void 0:r.value:void 0},ICr=e=>e.tooltip.settings,kb={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},RCr={itemInteraction:{click:kb,hover:kb},axisInteraction:{click:kb,hover:kb},keyboardInteraction:kb,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},flt=Ec({name:"tooltip",initialState:RCr,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:li()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:r,next:n}=t.payload,s=uh(e).tooltipItemPayloads.indexOf(r);s>-1&&(e.tooltipItemPayloads[s]=n)},prepare:li()},removeTooltipEntrySettings:{reducer(e,t){var r=uh(e).tooltipItemPayloads.indexOf(t.payload);r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:li()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:PCr,replaceTooltipEntrySettings:MCr,removeTooltipEntrySettings:DCr,setTooltipSettingsState:LCr,setActiveMouseOverItemIndex:$Cr,mouseLeaveItem:NPn,mouseLeaveChart:hlt,setActiveClickItemIndex:APn,setMouseOverAxisIndex:plt,setMouseClickAxisIndex:FCr,setSyncInteraction:Uae,setKeyboardInteraction:b5}=flt.actions,zCr=flt.reducer;function iAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function qD(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?iAe(Object(r),!0).forEach(function(n){BCr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):iAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function BCr(e,t,r){return(t=UCr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function UCr(e){var t=VCr(e,"string");return typeof t=="symbol"?t:t+""}function VCr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qCr(e,t,r){return t==="axis"?r==="click"?e.axisInteraction.click:e.axisInteraction.hover:r==="click"?e.itemInteraction.click:e.itemInteraction.hover}function HCr(e){return e.index!=null}var mlt=(e,t,r,n)=>{if(t==null)return kb;var s=qCr(e,t,r);if(s==null)return kb;if(s.active)return s;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(HCr(s)){if(a)return qD(qD({},s),{},{active:!0})}else if(n!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:n,graphicalItemId:void 0};return qD(qD({},kb),{},{coordinate:s.coordinate})};function QCr(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var r=Number(e);return Number.isFinite(r)?r:void 0}function WCr(e,t){var r=QCr(e),n=t[0],s=t[1];if(r===void 0)return!1;var a=Math.min(n,s),i=Math.max(n,s);return r>=a&&r<=i}function GCr(e,t,r){if(r==null||t==null)return!0;var n=Ql(e,t);return n==null||!qm(r)?!0:WCr(n,r)}var xpe=(e,t,r,n)=>{var s=e?.index;if(s==null)return null;var a=Number(s);if(!zs(a))return s;var i=0,l=1/0;t.length>0&&(l=t.length-1);var c=Math.max(i,Math.min(a,l)),u=t[c];return u==null||GCr(u,r,n)?String(c):null},glt=(e,t,r,n,s,a,i)=>{if(a!=null){var l=i[0],c=l?.getPosition(a);if(c!=null)return c;var u=s?.[Number(a)];if(u)return r==="horizontal"?{x:u.coordinate,y:(n.top+t)/2}:{x:(n.left+e)/2,y:u.coordinate}}},ylt=(e,t,r,n)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var s;if(r==="hover"?s=e.itemInteraction.hover.graphicalItemId:s=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&s==null)return e.tooltipItemPayloads;if(s==null&&n!=null){var a=e.tooltipItemPayloads[0];return a!=null?[a]:[]}return e.tooltipItemPayloads.filter(i=>{var l;return((l=i.settings)===null||l===void 0?void 0:l.graphicalItemId)===s})},vlt=e=>e.options.tooltipPayloadSearcher,iC=e=>e.tooltip;function oAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function lAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?oAe(Object(r),!0).forEach(function(n){ZCr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ZCr(e,t,r){return(t=YCr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function YCr(e){var t=XCr(e,"string");return typeof t=="symbol"?t:t+""}function XCr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function KCr(e){if(typeof e=="string"||typeof e=="number")return e}function JCr(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function ejr(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function cAe(e){if(typeof e=="string")return e}function tjr(e){if(!(e==null||typeof e!="object")){var t="name"in e?KCr(e.name):void 0,r="unit"in e?JCr(e.unit):void 0,n="dataKey"in e?ejr(e.dataKey):void 0,s="payload"in e?e.payload:void 0,a="color"in e?cAe(e.color):void 0,i="fill"in e?cAe(e.fill):void 0;return{name:t,unit:r,dataKey:n,payload:s,color:a,fill:i}}}function rjr(e,t){return e??t}var blt=(e,t,r,n,s,a,i)=>{if(!(t==null||a==null)){var{chartData:l,computedData:c,dataStartIndex:u,dataEndIndex:d}=r,f=[];return e.reduce((h,p)=>{var m,{dataDefinedOnItem:g,settings:y}=p,x=rjr(g,l),w=Array.isArray(x)?Vat(x,u,d):x,S=(m=y?.dataKey)!==null&&m!==void 0?m:n,k=y?.nameKey,_;if(n&&Array.isArray(w)&&!Array.isArray(w[0])&&i==="axis"?_=tat(w,n,s):_=a(w,t,c,k),Array.isArray(_))_.forEach(T=>{var j,N,I=tjr(T),P=I?.name,R=I?.dataKey,B=I?.payload,D=lAe(lAe({},y),{},{name:P,unit:I?.unit,color:(j=I?.color)!==null&&j!==void 0?j:y?.color,fill:(N=I?.fill)!==null&&N!==void 0?N:y?.fill});h.push(oTe({tooltipEntrySettings:D,dataKey:R,payload:B,value:Ql(B,R),name:P==null?void 0:String(P)}))});else{var E;h.push(oTe({tooltipEntrySettings:y,dataKey:S,payload:_,value:Ql(_,S),name:(E=Ql(_,k))!==null&&E!==void 0?E:y?.name}))}return h},f)}},wpe=Xe([al,jot,Ihe],kot),njr=Xe([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),sjr=Xe([_l,nC],Tot),oC=Xe([njr,al,sjr],Aot,{memoizeOptions:{resultEqualityCheck:g9}}),ajr=Xe([oC],e=>e.filter($he)),ijr=Xe([oC],Pot,{memoizeOptions:{resultEqualityCheck:g9}}),lC=Xe([ijr,t0],Mot),ojr=Xe([ajr,t0,al],Bit),Spe=Xe([lC,al,oC],Dot),xlt=Xe([al],fpe),ljr=Xe([al],e=>e.allowDataOverflow),wlt=Xe([xlt,ljr],Sit),cjr=Xe([oC],e=>e.filter($he)),ujr=Xe([ojr,cjr,u9,Rit],$ot),djr=Xe([ujr,t0,_l,wlt],Fot),fjr=Xe([oC],Rot),hjr=Xe([lC,al,fjr,hpe,_l],Uot,{memoizeOptions:{resultEqualityCheck:m9}}),pjr=Xe([Vot,_l,nC],sC),mjr=Xe([pjr,_l],Qot),gjr=Xe([qot,_l,nC],sC),yjr=Xe([gjr,_l],Wot),vjr=Xe([Hot,_l,nC],sC),bjr=Xe([vjr,_l],Got),xjr=Xe([mjr,bjr,yjr],v5),wjr=Xe([al,xlt,wlt,djr,hjr,xjr,Fi,_l],Zot),NP=Xe([al,Fi,lC,Spe,u9,_l,wjr],Yot),Sjr=Xe([NP,al,wpe],Xot),Ojr=Xe([al,NP,Sjr,_l],Kot),Slt=e=>{var t=_l(e),r=nC(e),n=!1;return TP(e,t,r,n)},Olt=Xe([al,Slt],d9),kjr=Xe([al,wpe,Ojr,Olt],cpe),klt=Xe([kjr],Fhe),_jr=Xe([Fi,Spe,al,_l],slt),Ejr=Xe([Fi,Spe,al,_l],tlt),Cjr=(e,t,r,n,s,a,i,l)=>{if(t){var{type:c}=t,u=hv(e,l);if(n){var d=r==="scaleBand"&&n.bandwidth?n.bandwidth()/2:2,f=c==="category"&&n.bandwidth?n.bandwidth()/d:0;return f=l==="angleAxis"&&s!=null&&s?.length>=2?ch(s[0]-s[1])*2*f:f,u&&i?i.map((h,p)=>{var m=n.map(h);return zs(m)?{coordinate:m+f,value:h,index:p,offset:f}:null}).filter($u):n.domain().map((h,p)=>{var m=n.map(h);return zs(m)?{coordinate:m+f,value:a?a[h]:h,index:p,offset:f}:null}).filter($u)}}},bv=Xe([Fi,al,wpe,klt,Slt,_jr,Ejr,_l],Cjr),Ope=Xe([llt,clt,ICr],(e,t,r)=>ult(r.shared,e,t)),_lt=e=>e.tooltip.settings.trigger,kpe=e=>e.tooltip.settings.defaultIndex,AP=Xe([iC,Ope,_lt,kpe],mlt),aI=Xe([AP,lC,jP,NP],xpe),Elt=Xe([bv,aI],dlt),jjr=Xe([AP],e=>{if(e)return e.dataKey}),Tjr=Xe([AP],e=>{if(e)return e.graphicalItemId}),Clt=Xe([iC,Ope,_lt,kpe],ylt),Njr=Xe([pv,mv,Fi,Yl,bv,kpe,Clt],glt),Ajr=Xe([AP,Njr],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),Ijr=Xe([AP],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),Rjr=Xe([Clt,aI,t0,jP,Elt,vlt,Ope],blt),Pjr=Xe([Rjr],e=>{if(e!=null){var t=e.map(r=>r.payload).filter(r=>r!=null);return Array.from(new Set(t))}});function uAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function dAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?uAe(Object(r),!0).forEach(function(n){Mjr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Mjr(e,t,r){return(t=Djr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Djr(e){var t=Ljr(e,"string");return typeof t=="symbol"?t:t+""}function Ljr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $jr=()=>en(al),Fjr=()=>{var e=$jr(),t=en(bv),r=en(klt);return Z4(!e||!r?void 0:dAe(dAe({},e),{},{scale:r}),t)};function fAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function bO(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?fAe(Object(r),!0).forEach(function(n){zjr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function zjr(e,t,r){return(t=Bjr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Bjr(e){var t=Ujr(e,"string");return typeof t=="symbol"?t:t+""}function Ujr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Vjr=(e,t,r,n)=>{var s=t.find(a=>a&&a.index===r);if(s){if(e==="horizontal")return{x:s.coordinate,y:n.relativeY};if(e==="vertical")return{x:n.relativeX,y:s.coordinate}}return{x:0,y:0}},qjr=(e,t,r,n)=>{var s=t.find(u=>u&&u.index===r);if(s){if(e==="centric"){var a=s.coordinate,{radius:i}=n;return bO(bO(bO({},n),Ul(n.cx,n.cy,i,a)),{},{angle:a,radius:i})}var l=s.coordinate,{angle:c}=n;return bO(bO(bO({},n),Ul(n.cx,n.cy,l,c)),{},{angle:c,radius:l})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function Hjr(e,t){var{relativeX:r,relativeY:n}=e;return r>=t.left&&r<=t.left+t.width&&n>=t.top&&n<=t.top+t.height}var jlt=(e,t,r,n,s)=>{var a,i=(a=t?.length)!==null&&a!==void 0?a:0;if(i<=1||e==null)return 0;if(n==="angleAxis"&&s!=null&&Math.abs(Math.abs(s[1]-s[0])-360)<=1e-6)for(var l=0;l<i;l++){var c,u,d,f,h,p=l>0?(c=r[l-1])===null||c===void 0?void 0:c.coordinate:(u=r[i-1])===null||u===void 0?void 0:u.coordinate,m=(d=r[l])===null||d===void 0?void 0:d.coordinate,g=l>=i-1?(f=r[0])===null||f===void 0?void 0:f.coordinate:(h=r[l+1])===null||h===void 0?void 0:h.coordinate,y=void 0;if(!(p==null||m==null||g==null))if(ch(m-p)!==ch(g-m)){var x=[];if(ch(g-m)===ch(s[1]-s[0])){y=g;var w=m+s[1]-s[0];x[0]=Math.min(w,(w+p)/2),x[1]=Math.max(w,(w+p)/2)}else{y=p;var S=g+s[1]-s[0];x[0]=Math.min(m,(S+m)/2),x[1]=Math.max(m,(S+m)/2)}var k=[Math.min(m,(y+m)/2),Math.max(m,(y+m)/2)];if(e>k[0]&&e<=k[1]||e>=x[0]&&e<=x[1]){var _;return(_=r[l])===null||_===void 0?void 0:_.index}}else{var E=Math.min(p,g),T=Math.max(p,g);if(e>(E+m)/2&&e<=(T+m)/2){var j;return(j=r[l])===null||j===void 0?void 0:j.index}}}else if(t)for(var N=0;N<i;N++){var I=t[N];if(I!=null){var P=t[N+1],R=t[N-1];if(N===0&&P!=null&&e<=(I.coordinate+P.coordinate)/2||N===i-1&&R!=null&&e>(I.coordinate+R.coordinate)/2||N>0&&N<i-1&&R!=null&&P!=null&&e>(I.coordinate+R.coordinate)/2&&e<=(I.coordinate+P.coordinate)/2)return I.index}}return-1},Qjr=()=>en(Ihe),_pe=(e,t)=>t,Tlt=(e,t,r)=>r,Epe=(e,t,r,n)=>n,Wjr=Xe(bv,e=>Hz(e,t=>t.coordinate)),Cpe=Xe([iC,_pe,Tlt,Epe],mlt),jpe=Xe([Cpe,lC,jP,NP],xpe),Gjr=(e,t,r)=>{if(t!=null){var n=iC(e);return t==="axis"?r==="hover"?n.axisInteraction.hover.dataKey:n.axisInteraction.click.dataKey:r==="hover"?n.itemInteraction.hover.dataKey:n.itemInteraction.click.dataKey}},Nlt=Xe([iC,_pe,Tlt,Epe],ylt),x5=Xe([pv,mv,Fi,Yl,bv,Epe,Nlt],glt),Zjr=Xe([Cpe,x5],(e,t)=>{var r;return(r=e.coordinate)!==null&&r!==void 0?r:t}),Alt=Xe([bv,jpe],dlt),Yjr=Xe([Nlt,jpe,t0,jP,Alt,vlt,_pe],blt),Xjr=Xe([Cpe,jpe],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),Kjr=(e,t,r,n,s,a,i)=>{if(!(!e||!r||!n||!s)&&Hjr(e,i)){var l=rSr(e,t),c=jlt(l,a,s,r,n),u=Vjr(t,s,c,e);return{activeIndex:String(c),activeCoordinate:u}}},Jjr=(e,t,r,n,s,a,i)=>{if(!(!e||!n||!s||!a||!r)){var l=yOr(e,r);if(l){var c=nSr(l,t),u=jlt(c,i,a,n,s),d=qjr(t,a,u,l);return{activeIndex:String(u),activeCoordinate:d}}}},eTr=(e,t,r,n,s,a,i,l)=>{if(!(!e||!t||!n||!s||!a))return t==="horizontal"||t==="vertical"?Kjr(e,t,n,s,a,i,l):Jjr(e,t,r,n,s,a,i)},tTr=Xe(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,r)=>r,(e,t,r)=>{if(t!=null){var n=e[t];if(n!=null)return r?n.panoramaElement:n.element}}),rTr=Xe(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(n=>parseInt(n,10)).concat(Object.values(Zc)),r=Array.from(new Set(t));return r.sort((n,s)=>n-s)},{memoizeOptions:{resultEqualityCheck:zOr}});function hAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function pAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?hAe(Object(r),!0).forEach(function(n){nTr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function nTr(e,t,r){return(t=sTr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sTr(e){var t=aTr(e,"string");return typeof t=="symbol"?t:t+""}function aTr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var iTr={},oTr={zIndexMap:Object.values(Zc).reduce((e,t)=>pAe(pAe({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),iTr)},lTr=new Set(Object.values(Zc));function cTr(e){return lTr.has(e)}var Ilt=Ec({name:"zIndex",initialState:oTr,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]?e.zIndexMap[r].consumers+=1:e.zIndexMap[r]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:li()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(e.zIndexMap[r].consumers-=1,e.zIndexMap[r].consumers<=0&&!cTr(r)&&delete e.zIndexMap[r])},prepare:li()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:r,element:n,isPanorama:s}=t.payload;e.zIndexMap[r]?s?e.zIndexMap[r].panoramaElement=n:e.zIndexMap[r].element=n:e.zIndexMap[r]={consumers:0,element:s?void 0:n,panoramaElement:s?n:void 0}},prepare:li()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(t.payload.isPanorama?e.zIndexMap[r].panoramaElement=void 0:e.zIndexMap[r].element=void 0)},prepare:li()}}}),{registerZIndexPortal:uTr,unregisterZIndexPortal:dTr,registerZIndexPortalElement:fTr,unregisterZIndexPortalElement:hTr}=Ilt.actions,pTr=Ilt.reducer;function xv(e){var{zIndex:t,children:r}=e,n=DSr(),s=n&&t!==void 0&&t!==0,a=sd(),i=Vo();b.useLayoutEffect(()=>s?(i(uTr({zIndex:t})),()=>{i(dTr({zIndex:t}))}):f1,[i,t,s]);var l=en(c=>tTr(c,t,a));return s?l?cu.createPortal(r,l):null:r}function Vae(){return Vae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vae.apply(null,arguments)}function mAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function HD(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mAe(Object(r),!0).forEach(function(n){mTr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function mTr(e,t,r){return(t=gTr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gTr(e){var t=yTr(e,"string");return typeof t=="symbol"?t:t+""}function yTr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vTr(e){var{cursor:t,cursorComp:r,cursorProps:n}=e;return b.isValidElement(t)?b.cloneElement(t,n):b.createElement(r,n)}function bTr(e){var t,{coordinate:r,payload:n,index:s,offset:a,tooltipAxisBandSize:i,layout:l,cursor:c,tooltipEventType:u,chartName:d}=e,f=r,h=n,p=s;if(!c||!f||d!=="ScatterChart"&&u!=="axis")return null;var m,g,y;if(d==="ScatterChart")m=f,g=A1r,y=Zc.cursorLine;else if(d==="BarChart")m=I1r(l,f,a,i),g=yit,y=Zc.cursorRectangle;else if(l==="radial"&&sat(f)){var{cx:x,cy:w,radius:S,startAngle:k,endAngle:_}=vit(f);m={cx:x,cy:w,startAngle:k,endAngle:_,innerRadius:S,outerRadius:S},g=xit,y=Zc.cursorLine}else m={points:wOr(l,f,a)},g=fit,y=Zc.cursorLine;var E=typeof c=="object"&&"className"in c?c.className:void 0,T=HD(HD(HD(HD({stroke:"#ccc",pointerEvents:"none"},a),m),zz(c)),{},{payload:h,payloadIndex:p,className:xa("recharts-tooltip-cursor",E)});return b.createElement(xv,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:y},b.createElement(vTr,{cursor:c,cursorComp:g,cursorProps:T}))}function xTr(e){var t=Fjr(),r=Kat(),n=eC(),s=Qjr();return t==null||r==null||n==null||s==null?null:b.createElement(bTr,Vae({},e,{offset:r,layout:n,tooltipAxisBandSize:t,chartName:s}))}var Rlt=b.createContext(null),wTr=()=>b.useContext(Rlt),HH={exports:{}},gAe;function STr(){return gAe||(gAe=1,(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function s(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function a(c,u,d,f,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var p=new s(d,f||c,h),m=r?r+u:u;return c._events[m]?c._events[m].fn?c._events[m]=[c._events[m],p]:c._events[m].push(p):(c._events[m]=p,c._eventsCount++),c}function i(c,u){--c._eventsCount===0?c._events=new n:delete c._events[u]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],d,f;if(this._eventsCount===0)return u;for(f in d=this._events)t.call(d,f)&&u.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},l.prototype.listeners=function(u){var d=r?r+u:u,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var h=0,p=f.length,m=new Array(p);h<p;h++)m[h]=f[h].fn;return m},l.prototype.listenerCount=function(u){var d=r?r+u:u,f=this._events[d];return f?f.fn?1:f.length:0},l.prototype.emit=function(u,d,f,h,p,m){var g=r?r+u:u;if(!this._events[g])return!1;var y=this._events[g],x=arguments.length,w,S;if(y.fn){switch(y.once&&this.removeListener(u,y.fn,void 0,!0),x){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,d),!0;case 3:return y.fn.call(y.context,d,f),!0;case 4:return y.fn.call(y.context,d,f,h),!0;case 5:return y.fn.call(y.context,d,f,h,p),!0;case 6:return y.fn.call(y.context,d,f,h,p,m),!0}for(S=1,w=new Array(x-1);S<x;S++)w[S-1]=arguments[S];y.fn.apply(y.context,w)}else{var k=y.length,_;for(S=0;S<k;S++)switch(y[S].once&&this.removeListener(u,y[S].fn,void 0,!0),x){case 1:y[S].fn.call(y[S].context);break;case 2:y[S].fn.call(y[S].context,d);break;case 3:y[S].fn.call(y[S].context,d,f);break;case 4:y[S].fn.call(y[S].context,d,f,h);break;default:if(!w)for(_=1,w=new Array(x-1);_<x;_++)w[_-1]=arguments[_];y[S].fn.apply(y[S].context,w)}}return!0},l.prototype.on=function(u,d,f){return a(this,u,d,f,!1)},l.prototype.once=function(u,d,f){return a(this,u,d,f,!0)},l.prototype.removeListener=function(u,d,f,h){var p=r?r+u:u;if(!this._events[p])return this;if(!d)return i(this,p),this;var m=this._events[p];if(m.fn)m.fn===d&&(!h||m.once)&&(!f||m.context===f)&&i(this,p);else{for(var g=0,y=[],x=m.length;g<x;g++)(m[g].fn!==d||h&&!m[g].once||f&&m[g].context!==f)&&y.push(m[g]);y.length?this._events[p]=y.length===1?y[0]:y:i(this,p)}return this},l.prototype.removeAllListeners=function(u){var d;return u?(d=r?r+u:u,this._events[d]&&i(this,d)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=r,l.EventEmitter=l,e.exports=l})(HH)),HH.exports}var OTr=STr();const kTr=Uo(OTr);var iI=new kTr,qae="recharts.syncEvent.tooltip",yAe="recharts.syncEvent.brush",_Tr=(e,t)=>{if(t&&Array.isArray(e)){var r=Number.parseInt(t,10);if(!Wy(r))return e[r]}},ETr={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},Plt=Ec({name:"options",initialState:ETr,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),CTr=Plt.reducer,{createEventEmitter:jTr}=Plt.actions;function TTr(e){return e.tooltip.syncInteraction}var NTr={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},Mlt=Ec({name:"chartData",initialState:NTr,reducers:{setChartData(e,t){if(e.chartData=t.payload,t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:r,endIndex:n}=t.payload;r!=null&&(e.dataStartIndex=r),n!=null&&(e.dataEndIndex=n)}}}),{setChartData:vAe,setDataStartEndIndexes:ATr,setComputedData:IPn}=Mlt.actions,ITr=Mlt.reducer,RTr=["x","y"];function bAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function xO(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bAe(Object(r),!0).forEach(function(n){PTr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function PTr(e,t,r){return(t=MTr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function MTr(e){var t=DTr(e,"string");return typeof t=="symbol"?t:t+""}function DTr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function LTr(e,t){if(e==null)return{};var r,n,s=$Tr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function $Tr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function FTr(){var e=en(Rhe),t=en(Phe),r=Vo(),n=en(Pit),s=en(bv),a=eC(),i=a9(),l=en(c=>c.rootProps.className);b.useEffect(()=>{if(e==null)return f1;var c=(u,d,f)=>{if(t!==f&&e===u){if(n==="index"){var h;if(i&&d!==null&&d!==void 0&&(h=d.payload)!==null&&h!==void 0&&h.coordinate&&d.payload.sourceViewBox){var p=d.payload.coordinate,{x:m,y:g}=p,y=LTr(p,RTr),{x,y:w,width:S,height:k}=d.payload.sourceViewBox,_=xO(xO({},y),{},{x:i.x+(S?(m-x)/S:0)*i.width,y:i.y+(k?(g-w)/k:0)*i.height});r(xO(xO({},d),{},{payload:xO(xO({},d.payload),{},{coordinate:_})}))}else r(d);return}if(s!=null){var E;if(typeof n=="function"){var T={activeTooltipIndex:d.payload.index==null?void 0:Number(d.payload.index),isTooltipActive:d.payload.active,activeIndex:d.payload.index==null?void 0:Number(d.payload.index),activeLabel:d.payload.label,activeDataKey:d.payload.dataKey,activeCoordinate:d.payload.coordinate},j=n(s,T);E=s[j]}else n==="value"&&(E=s.find(U=>String(U.value)===d.payload.label));var{coordinate:N}=d.payload;if(E==null||d.payload.active===!1||N==null||i==null){r(Uae({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:I,y:P}=N,R=Math.min(I,i.x+i.width),B=Math.min(P,i.y+i.height),D={x:a==="horizontal"?E.coordinate:R,y:a==="horizontal"?B:E.coordinate},$=Uae({active:d.payload.active,coordinate:D,dataKey:d.payload.dataKey,index:String(E.index),label:d.payload.label,sourceViewBox:d.payload.sourceViewBox,graphicalItemId:d.payload.graphicalItemId});r($)}}};return iI.on(qae,c),()=>{iI.off(qae,c)}},[l,r,t,e,n,s,a,i])}function zTr(){var e=en(Rhe),t=en(Phe),r=Vo();b.useEffect(()=>{if(e==null)return f1;var n=(s,a,i)=>{t!==i&&e===s&&r(ATr(a))};return iI.on(yAe,n),()=>{iI.off(yAe,n)}},[r,t,e])}function BTr(){var e=Vo();b.useEffect(()=>{e(jTr())},[e]),FTr(),zTr()}function UTr(e,t,r,n,s,a){var i=en(m=>Gjr(m,e,t)),l=en(Tjr),c=en(Phe),u=en(Rhe),d=en(Pit),f=en(TTr),h=f?.active,p=a9();b.useEffect(()=>{if(!h&&u!=null&&c!=null){var m=Uae({active:a,coordinate:r,dataKey:i,index:s,label:typeof n=="number"?String(n):n,sourceViewBox:p,graphicalItemId:l});iI.emit(qae,u,m,c)}},[h,r,i,l,s,n,c,u,d,a,p])}function xAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function wAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xAe(Object(r),!0).forEach(function(n){VTr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function VTr(e,t,r){return(t=qTr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qTr(e){var t=HTr(e,"string");return typeof t=="symbol"?t:t+""}function HTr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function QTr(e){return e.dataKey}function WTr(e,t){return b.isValidElement(e)?b.cloneElement(e,t):typeof e=="function"?b.createElement(e,t):b.createElement(i1r,t)}var SAe=[],GTr={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:"auto",itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function ZTr(e){var t,r,n=nd(e,GTr),{active:s,allowEscapeViewBox:a,animationDuration:i,animationEasing:l,content:c,filterNull:u,isAnimationActive:d,offset:f,payloadUniqBy:h,position:p,reverseDirection:m,useTranslate3d:g,wrapperStyle:y,cursor:x,shared:w,trigger:S,defaultIndex:k,portal:_,axisId:E}=n,T=Vo(),j=typeof k=="number"?String(k):k;b.useEffect(()=>{T(LCr({shared:w,trigger:S,axisId:E,active:s,defaultIndex:j}))},[T,w,S,E,s,j]);var N=a9(),I=dit(),P=ACr(w),{activeIndex:R,isActive:B}=(t=en(te=>Xjr(te,P,S,j)))!==null&&t!==void 0?t:{},D=en(te=>Yjr(te,P,S,j)),$=en(te=>Alt(te,P,S,j)),U=en(te=>Zjr(te,P,S,j)),z=D,H=wTr(),Q=(r=s??B)!==null&&r!==void 0?r:!1,[L,Z]=G0r([z,Q]),V=P==="axis"?$:void 0;UTr(P,S,U,V,R,Q);var M=_??H;if(M==null||N==null||P==null)return null;var W=z??SAe;Q||(W=SAe),u&&W.length&&(W=M0r(W.filter(te=>te.value!=null&&(te.hide!==!0||n.includeHidden)),h,QTr));var G=W.length>0,J=wAe(wAe({},n),{},{payload:W,label:V,active:Q,activeIndex:R,coordinate:U,accessibilityLayer:I}),ae=b.createElement(y1r,{allowEscapeViewBox:a,animationDuration:i,animationEasing:l,isAnimationActive:d,active:Q,coordinate:U,hasPayload:G,offset:f,position:p,reverseDirection:m,useTranslate3d:g,viewBox:N,wrapperStyle:y,lastBoundingBox:L,innerRef:Z,hasPortalFromProps:!!_},WTr(c,J));return b.createElement(b.Fragment,null,cu.createPortal(ae,M),Q&&b.createElement(xTr,{cursor:x,tooltipEventType:P,coordinate:U,payload:W,index:R}))}function YTr(e,t,r){return(t=XTr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function XTr(e){var t=KTr(e,"string");return typeof t=="symbol"?t:t+""}function KTr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class JTr{constructor(t){YTr(this,"cache",new Map),this.maxSize=t}get(t){var r=this.cache.get(t);return r!==void 0&&(this.cache.delete(t),this.cache.set(t,r)),r}set(t,r){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var n=this.cache.keys().next().value;n!=null&&this.cache.delete(n)}this.cache.set(t,r)}clear(){this.cache.clear()}size(){return this.cache.size}}function OAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function eNr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?OAe(Object(r),!0).forEach(function(n){tNr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):OAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function tNr(e,t,r){return(t=rNr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rNr(e){var t=nNr(e,"string");return typeof t=="symbol"?t:t+""}function nNr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var sNr={cacheSize:2e3,enableCache:!0},Dlt=eNr({},sNr),kAe=new JTr(Dlt.cacheSize),aNr={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},_Ae="recharts_measurement_span";function iNr(e,t){var r=t.fontSize||"",n=t.fontFamily||"",s=t.fontWeight||"",a=t.fontStyle||"",i=t.letterSpacing||"",l=t.textTransform||"";return"".concat(e,"|").concat(r,"|").concat(n,"|").concat(s,"|").concat(a,"|").concat(i,"|").concat(l)}var EAe=(e,t)=>{try{var r=document.getElementById(_Ae);r||(r=document.createElement("span"),r.setAttribute("id",_Ae),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,aNr,t),r.textContent="".concat(e);var n=r.getBoundingClientRect();return{width:n.width,height:n.height}}catch{return{width:0,height:0}}},CN=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||xP.isSsr)return{width:0,height:0};if(!Dlt.enableCache)return EAe(t,r);var n=iNr(t,r),s=kAe.get(n);if(s)return s;var a=EAe(t,r);return kAe.set(n,a),a},Llt;function oNr(e,t,r){return(t=lNr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lNr(e){var t=cNr(e,"string");return typeof t=="symbol"?t:t+""}function cNr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var CAe=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,jAe=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,uNr=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,dNr=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,fNr={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},hNr=["cm","mm","pt","pc","in","Q","px"];function pNr(e){return hNr.includes(e)}var fk="NaN";function mNr(e,t){return e*fNr[t]}class Ml{static parse(t){var r,[,n,s]=(r=dNr.exec(t))!==null&&r!==void 0?r:[];return n==null?Ml.NaN:new Ml(parseFloat(n),s??"")}constructor(t,r){this.num=t,this.unit=r,this.num=t,this.unit=r,Wy(t)&&(this.unit=""),r!==""&&!uNr.test(r)&&(this.num=NaN,this.unit=""),pNr(r)&&(this.num=mNr(t,r),this.unit="px")}add(t){return this.unit!==t.unit?new Ml(NaN,""):new Ml(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Ml(NaN,""):new Ml(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Ml(NaN,""):new Ml(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Ml(NaN,""):new Ml(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Wy(this.num)}}Llt=Ml;oNr(Ml,"NaN",new Llt(NaN,""));function $lt(e){if(e==null||e.includes(fk))return fk;for(var t=e;t.includes("*")||t.includes("/");){var r,[,n,s,a]=(r=CAe.exec(t))!==null&&r!==void 0?r:[],i=Ml.parse(n??""),l=Ml.parse(a??""),c=s==="*"?i.multiply(l):i.divide(l);if(c.isNaN())return fk;t=t.replace(CAe,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var u,[,d,f,h]=(u=jAe.exec(t))!==null&&u!==void 0?u:[],p=Ml.parse(d??""),m=Ml.parse(h??""),g=f==="+"?p.add(m):p.subtract(m);if(g.isNaN())return fk;t=t.replace(jAe,g.toString())}return t}var TAe=/\(([^()]*)\)/;function gNr(e){for(var t=e,r;(r=TAe.exec(t))!=null;){var[,n]=r;t=t.replace(TAe,$lt(n))}return t}function yNr(e){var t=e.replace(/\s+/g,"");return t=gNr(t),t=$lt(t),t}function vNr(e){try{return yNr(e)}catch{return fk}}function QH(e){var t=vNr(e.slice(5,-1));return t===fk?"":t}var bNr=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],xNr=["dx","dy","angle","className","breakAll"];function Hae(){return Hae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Hae.apply(null,arguments)}function NAe(e,t){if(e==null)return{};var r,n,s=wNr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function wNr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Flt=/[ \f\n\r\t\v\u2028\u2029]+/,zlt=e=>{var{children:t,breakAll:r,style:n}=e;try{var s=[];Sl(t)||(r?s=t.toString().split(""):s=t.toString().split(Flt));var a=s.map(l=>({word:l,width:CN(l,n).width})),i=r?0:CN(" ",n).width;return{wordsWithComputedWidth:a,spaceWidth:i}}catch{return null}};function Blt(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function SNr(e){return Sl(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var Ult=(e,t,r,n)=>e.reduce((s,a)=>{var{word:i,width:l}=a,c=s[s.length-1];if(c&&l!=null&&(t==null||n||c.width+l+r<Number(t)))c.words.push(i),c.width+=l+r;else{var u={words:[i],width:l};s.push(u)}return s},[]),Vlt=e=>e.reduce((t,r)=>t.width>r.width?t:r),ONr="…",AAe=(e,t,r,n,s,a,i,l)=>{var c=e.slice(0,t),u=zlt({breakAll:r,style:n,children:c+ONr});if(!u)return[!1,[]];var d=Ult(u.wordsWithComputedWidth,a,i,l),f=d.length>s||Vlt(d).width>Number(a);return[f,d]},kNr=(e,t,r,n,s)=>{var{maxLines:a,children:i,style:l,breakAll:c}=e,u=qr(a),d=String(i),f=Ult(t,n,r,s);if(!u||s)return f;var h=f.length>a||Vlt(f).width>Number(n);if(!h)return f;for(var p=0,m=d.length-1,g=0,y;p<=m&&g<=d.length-1;){var x=Math.floor((p+m)/2),w=x-1,[S,k]=AAe(d,w,c,l,a,n,r,s),[_]=AAe(d,x,c,l,a,n,r,s);if(!S&&!_&&(p=x+1),S&&_&&(m=x-1),!S&&_){y=k;break}g++}return y||f},IAe=e=>{var t=Sl(e)?[]:e.toString().split(Flt);return[{words:t,width:void 0}]},_Nr=e=>{var{width:t,scaleToFit:r,children:n,style:s,breakAll:a,maxLines:i}=e;if((t||r)&&!xP.isSsr){var l,c,u=zlt({breakAll:a,children:n,style:s});if(u){var{wordsWithComputedWidth:d,spaceWidth:f}=u;l=d,c=f}else return IAe(n);return kNr({breakAll:a,children:n,maxLines:i,style:s},l,c,t,!!r)}return IAe(n)},qlt="#808080",ENr={angle:0,breakAll:!1,capHeight:"0.71em",fill:qlt,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Tpe=b.forwardRef((e,t)=>{var r=nd(e,ENr),{x:n,y:s,lineHeight:a,capHeight:i,fill:l,scaleToFit:c,textAnchor:u,verticalAnchor:d}=r,f=NAe(r,bNr),h=b.useMemo(()=>_Nr({breakAll:f.breakAll,children:f.children,maxLines:f.maxLines,scaleToFit:c,style:f.style,width:f.width}),[f.breakAll,f.children,f.maxLines,c,f.style,f.width]),{dx:p,dy:m,angle:g,className:y,breakAll:x}=f,w=NAe(f,xNr);if(!eg(n)||!eg(s)||h.length===0)return null;var S=Number(n)+(qr(p)?p:0),k=Number(s)+(qr(m)?m:0);if(!zs(S)||!zs(k))return null;var _;switch(d){case"start":_=QH("calc(".concat(i,")"));break;case"middle":_=QH("calc(".concat((h.length-1)/2," * -").concat(a," + (").concat(i," / 2))"));break;default:_=QH("calc(".concat(h.length-1," * -").concat(a,")"));break}var E=[],T=h[0];if(c&&T!=null){var j=T.width,{width:N}=f;E.push("scale(".concat(qr(N)&&qr(j)?N/j:1,")"))}return g&&E.push("rotate(".concat(g,", ").concat(S,", ").concat(k,")")),E.length&&(w.transform=E.join(" ")),b.createElement("text",Hae({},su(w),{ref:t,x:S,y:k,className:xa("recharts-text",y),textAnchor:u,fill:l.includes("url")?qlt:l}),h.map((I,P)=>{var R=I.words.join(x?"":" ");return b.createElement("tspan",{x:S,dy:P===0?_:a,key:"".concat(R,"-").concat(P)},R)}))});Tpe.displayName="Text";function RAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function nm(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?RAe(Object(r),!0).forEach(function(n){CNr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):RAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function CNr(e,t,r){return(t=jNr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jNr(e){var t=TNr(e,"string");return typeof t=="symbol"?t:t+""}function TNr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var NNr=e=>{var{viewBox:t,position:r,offset:n=0,parentViewBox:s}=e,{x:a,y:i,height:l,upperWidth:c,lowerWidth:u}=Ohe(t),d=a,f=a+(c-u)/2,h=(d+f)/2,p=(c+u)/2,m=d+c/2,g=l>=0?1:-1,y=g*n,x=g>0?"end":"start",w=g>0?"start":"end",S=c>=0?1:-1,k=S*n,_=S>0?"end":"start",E=S>0?"start":"end",T=s;if(r==="top"){var j={x:d+c/2,y:i-y,horizontalAnchor:"middle",verticalAnchor:x};return T&&(j.height=Math.max(i-T.y,0),j.width=c),j}if(r==="bottom"){var N={x:f+u/2,y:i+l+y,horizontalAnchor:"middle",verticalAnchor:w};return T&&(N.height=Math.max(T.y+T.height-(i+l),0),N.width=u),N}if(r==="left"){var I={x:h-k,y:i+l/2,horizontalAnchor:_,verticalAnchor:"middle"};return T&&(I.width=Math.max(I.x-T.x,0),I.height=l),I}if(r==="right"){var P={x:h+p+k,y:i+l/2,horizontalAnchor:E,verticalAnchor:"middle"};return T&&(P.width=Math.max(T.x+T.width-P.x,0),P.height=l),P}var R=T?{width:p,height:l}:{};return r==="insideLeft"?nm({x:h+k,y:i+l/2,horizontalAnchor:E,verticalAnchor:"middle"},R):r==="insideRight"?nm({x:h+p-k,y:i+l/2,horizontalAnchor:_,verticalAnchor:"middle"},R):r==="insideTop"?nm({x:d+c/2,y:i+y,horizontalAnchor:"middle",verticalAnchor:w},R):r==="insideBottom"?nm({x:f+u/2,y:i+l-y,horizontalAnchor:"middle",verticalAnchor:x},R):r==="insideTopLeft"?nm({x:d+k,y:i+y,horizontalAnchor:E,verticalAnchor:w},R):r==="insideTopRight"?nm({x:d+c-k,y:i+y,horizontalAnchor:_,verticalAnchor:w},R):r==="insideBottomLeft"?nm({x:f+k,y:i+l-y,horizontalAnchor:E,verticalAnchor:x},R):r==="insideBottomRight"?nm({x:f+u-k,y:i+l-y,horizontalAnchor:_,verticalAnchor:x},R):r&&typeof r=="object"&&(qr(r.x)||OS(r.x))&&(qr(r.y)||OS(r.y))?nm({x:a+wx(r.x,p),y:i+wx(r.y,l),horizontalAnchor:"end",verticalAnchor:"end"},R):nm({x:m,y:i+l/2,horizontalAnchor:"middle",verticalAnchor:"middle"},R)},ANr=["labelRef"],INr=["content"];function PAe(e,t){if(e==null)return{};var r,n,s=RNr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function RNr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function MAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function VT(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?MAe(Object(r),!0).forEach(function(n){PNr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):MAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function PNr(e,t,r){return(t=MNr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function MNr(e){var t=DNr(e,"string");return typeof t=="symbol"?t:t+""}function DNr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wy(){return wy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wy.apply(null,arguments)}var Hlt=b.createContext(null),LNr=e=>{var{x:t,y:r,upperWidth:n,lowerWidth:s,width:a,height:i,children:l}=e,c=b.useMemo(()=>({x:t,y:r,upperWidth:n,lowerWidth:s,width:a,height:i}),[t,r,n,s,a,i]);return b.createElement(Hlt.Provider,{value:c},l)},Qlt=()=>{var e=b.useContext(Hlt),t=a9();return e||(t?Ohe(t):void 0)},$Nr=b.createContext(null),FNr=()=>{var e=b.useContext($Nr),t=en(Fit);return e||t},zNr=e=>{var{value:t,formatter:r}=e,n=Sl(e.children)?t:e.children;return typeof r=="function"?r(n):n},Npe=e=>e!=null&&typeof e=="function",BNr=(e,t)=>{var r=ch(t-e),n=Math.min(Math.abs(t-e),360);return r*n},UNr=(e,t,r,n,s)=>{var{offset:a,className:i}=e,{cx:l,cy:c,innerRadius:u,outerRadius:d,startAngle:f,endAngle:h,clockWise:p}=s,m=(u+d)/2,g=BNr(f,h),y=g>=0?1:-1,x,w;switch(t){case"insideStart":x=f+y*a,w=p;break;case"insideEnd":x=h-y*a,w=!p;break;case"end":x=h+y*a,w=p;break;default:throw new Error("Unsupported position ".concat(t))}w=g<=0?w:!w;var S=Ul(l,c,m,x),k=Ul(l,c,m,x+(w?1:-1)*359),_="M".concat(S.x,",").concat(S.y,`
|
|
292
292
|
A`).concat(m,",").concat(m,",0,1,").concat(w?0:1,`,
|
|
293
|
-
`).concat(k.x,",").concat(k.y),E=Sl(e.id)?WA("recharts-radial-line-"):e.id;return b.createElement("text",wy({},n,{dominantBaseline:"central",className:xa("recharts-radial-bar-label",i)}),b.createElement("defs",null,b.createElement("path",{id:E,d:_})),b.createElement("textPath",{xlinkHref:"#".concat(E)},r))},VNr=(e,t,r)=>{var{cx:n,cy:s,innerRadius:a,outerRadius:i,startAngle:l,endAngle:c}=e,u=(l+c)/2;if(r==="outside"){var{x:d,y:f}=Ul(n,s,i+t,u);return{x:d,y:f,textAnchor:d>=n?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:n,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:n,y:s,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:n,y:s,textAnchor:"middle",verticalAnchor:"end"};var h=(a+i)/2,{x:p,y:m}=Ul(n,s,h,u);return{x:p,y:m,textAnchor:"middle",verticalAnchor:"middle"}},_$=e=>e!=null&&"cx"in e&&qr(e.cx),qNr={angle:0,offset:5,zIndex:Zc.label,position:"middle",textBreakAll:!1};function HNr(e){if(!_$(e))return e;var{cx:t,cy:r,outerRadius:n}=e,s=n*2;return{x:t-n,y:r-n,width:s,upperWidth:s,lowerWidth:s,height:s}}function bb(e){var t=nd(e,qNr),{viewBox:r,parentViewBox:n,position:s,value:a,children:i,content:l,className:c="",textBreakAll:u,labelRef:d}=t,f=FNr(),h=Qlt(),p=s==="center"?h:f??h,m,g,y;r==null?m=p:_$(r)?m=r:m=Ohe(r);var x=HNr(m);if(!m||Sl(a)&&Sl(i)&&!b.isValidElement(l)&&typeof l!="function")return null;var w=VT(VT({},t),{},{viewBox:m});if(b.isValidElement(l)){var{labelRef:S}=w,k=PAe(w,ANr);return b.cloneElement(l,k)}if(typeof l=="function"){var{content:_}=w,E=PAe(w,INr);if(g=b.createElement(l,E),b.isValidElement(g))return g}else g=zNr(t);var T=su(t);if(_$(m)){if(s==="insideStart"||s==="insideEnd"||s==="end")return UNr(t,s,g,T,m);y=VNr(m,t.offset,t.position)}else{if(!x)return null;var j=NNr({viewBox:x,position:s,offset:t.offset,parentViewBox:_$(n)?void 0:n});y=VT(VT({x:j.x,y:j.y,textAnchor:j.horizontalAnchor,verticalAnchor:j.verticalAnchor},j.width!==void 0?{width:j.width}:{}),j.height!==void 0?{height:j.height}:{})}return b.createElement(xv,{zIndex:t.zIndex},b.createElement(Tpe,wy({ref:d,className:xa("recharts-label",c)},T,y,{textAnchor:Blt(T.textAnchor)?T.textAnchor:y.textAnchor,breakAll:u}),g))}bb.displayName="Label";var QNr=(e,t,r)=>{if(!e)return null;var n={viewBox:t,labelRef:r};return e===!0?b.createElement(bb,wy({key:"label-implicit"},n)):eg(e)?b.createElement(bb,wy({key:"label-implicit",value:e},n)):b.isValidElement(e)?e.type===bb?b.cloneElement(e,VT({key:"label-implicit"},n)):b.createElement(bb,wy({key:"label-implicit",content:e},n)):Npe(e)?b.createElement(bb,wy({key:"label-implicit",content:e},n)):e&&typeof e=="object"?b.createElement(bb,wy({},e,{key:"label-implicit"},n)):null};function WNr(e){var{label:t,labelRef:r}=e,n=Qlt();return QNr(t,n,r)||null}var GNr=["valueAccessor"],ZNr=["dataKey","clockWise","id","textBreakAll","zIndex"];function w5(){return w5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},w5.apply(null,arguments)}function DAe(e,t){if(e==null)return{};var r,n,s=YNr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function YNr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var XNr=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(SNr(t))return t},Wlt=b.createContext(void 0),KNr=Wlt.Provider,Glt=b.createContext(void 0);Glt.Provider;function JNr(){return b.useContext(Wlt)}function eAr(){return b.useContext(Glt)}function E$(e){var{valueAccessor:t=XNr}=e,r=DAe(e,GNr),{dataKey:n,clockWise:s,id:a,textBreakAll:i,zIndex:l}=r,c=DAe(r,ZNr),u=JNr(),d=eAr(),f=u||d;return!f||!f.length?null:b.createElement(xv,{zIndex:l??Zc.label},b.createElement(Qy,{className:"recharts-label-list"},f.map((h,p)=>{var m,g=Sl(n)?t(h,p):Ql(h.payload,n),y=Sl(a)?{}:{id:"".concat(a,"-").concat(p)};return b.createElement(bb,w5({key:"label-".concat(p)},su(h),c,y,{fill:(m=r.fill)!==null&&m!==void 0?m:h.fill,parentViewBox:h.parentViewBox,value:g,textBreakAll:i,viewBox:h.viewBox,index:p,zIndex:0}))})))}E$.displayName="LabelList";function tAr(e){var{label:t}=e;return t?t===!0?b.createElement(E$,{key:"labelList-implicit"}):b.isValidElement(t)||Npe(t)?b.createElement(E$,{key:"labelList-implicit",content:t}):typeof t=="object"?b.createElement(E$,w5({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function Qae(){return Qae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qae.apply(null,arguments)}var Zlt=e=>{var{cx:t,cy:r,r:n,className:s}=e,a=xa("recharts-dot",s);return qr(t)&&qr(r)&&qr(n)?b.createElement("circle",Qae({},Jm(e),phe(e),{className:a,cx:t,cy:r,r:n})):null},rAr={radiusAxis:{},angleAxis:{}},Ylt=Ec({name:"polarAxis",initialState:rAr,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:RPn,removeRadiusAxis:PPn,addAngleAxis:MPn,removeAngleAxis:DPn}=Ylt.actions,nAr=Ylt.reducer;function sAr(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var WH={exports:{}},Ks={};var LAe;function aAr(){if(LAe)return Ks;LAe=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),i=Symbol.for("react.context"),l=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),m;m=Symbol.for("react.module.reference");function g(y){if(typeof y=="object"&&y!==null){var x=y.$$typeof;switch(x){case e:switch(y=y.type,y){case r:case s:case n:case u:case d:return y;default:switch(y=y&&y.$$typeof,y){case l:case i:case c:case h:case f:case a:return y;default:return x}}case t:return x}}}return Ks.ContextConsumer=i,Ks.ContextProvider=a,Ks.Element=e,Ks.ForwardRef=c,Ks.Fragment=r,Ks.Lazy=h,Ks.Memo=f,Ks.Portal=t,Ks.Profiler=s,Ks.StrictMode=n,Ks.Suspense=u,Ks.SuspenseList=d,Ks.isAsyncMode=function(){return!1},Ks.isConcurrentMode=function(){return!1},Ks.isContextConsumer=function(y){return g(y)===i},Ks.isContextProvider=function(y){return g(y)===a},Ks.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===e},Ks.isForwardRef=function(y){return g(y)===c},Ks.isFragment=function(y){return g(y)===r},Ks.isLazy=function(y){return g(y)===h},Ks.isMemo=function(y){return g(y)===f},Ks.isPortal=function(y){return g(y)===t},Ks.isProfiler=function(y){return g(y)===s},Ks.isStrictMode=function(y){return g(y)===n},Ks.isSuspense=function(y){return g(y)===u},Ks.isSuspenseList=function(y){return g(y)===d},Ks.isValidElementType=function(y){return typeof y=="string"||typeof y=="function"||y===r||y===s||y===n||y===u||y===d||y===p||typeof y=="object"&&y!==null&&(y.$$typeof===h||y.$$typeof===f||y.$$typeof===a||y.$$typeof===i||y.$$typeof===c||y.$$typeof===m||y.getModuleId!==void 0)},Ks.typeOf=g,Ks}var $Ae;function iAr(){return $Ae||($Ae=1,WH.exports=aAr()),WH.exports}iAr();var Xlt=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,GH={},FAe;function oAr(){return FAe||(FAe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){if(typeof r!="object"||r==null)return!1;if(Object.getPrototypeOf(r)===null)return!0;if(Object.prototype.toString.call(r)!=="[object Object]"){const s=r[Symbol.toStringTag];return s==null||!Object.getOwnPropertyDescriptor(r,Symbol.toStringTag)?.writable?!1:r.toString()===`[object ${s}]`}let n=r;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(r)===n}e.isPlainObject=t})(GH)),GH}var ZH,zAe;function lAr(){return zAe||(zAe=1,ZH=oAr().isPlainObject),ZH}var cAr=lAr();const uAr=Uo(cAr);var BAe,UAe,VAe,qAe,HAe;function QAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function WAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?QAe(Object(r),!0).forEach(function(n){dAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):QAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function dAr(e,t,r){return(t=fAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fAr(e){var t=hAr(e,"string");return typeof t=="symbol"?t:t+""}function hAr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function S5(){return S5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},S5.apply(null,arguments)}function rT(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var GAe=(e,t,r,n,s)=>{var a=r-n,i;return i=Qi(BAe||(BAe=rT(["M ",",",""])),e,t),i+=Qi(UAe||(UAe=rT(["L ",",",""])),e+r,t),i+=Qi(VAe||(VAe=rT(["L ",",",""])),e+r-a/2,t+s),i+=Qi(qAe||(qAe=rT(["L ",",",""])),e+r-a/2-n,t+s),i+=Qi(HAe||(HAe=rT(["L ",","," Z"])),e,t),i},pAr={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},mAr=e=>{var t=nd(e,pAr),{x:r,y:n,upperWidth:s,lowerWidth:a,height:i,className:l}=t,{animationEasing:c,animationDuration:u,animationBegin:d,isUpdateAnimationActive:f}=t,h=b.useRef(null),[p,m]=b.useState(-1),g=b.useRef(s),y=b.useRef(a),x=b.useRef(i),w=b.useRef(r),S=b.useRef(n),k=Che(e,"trapezoid-");if(b.useEffect(()=>{if(h.current&&h.current.getTotalLength)try{var D=h.current.getTotalLength();D&&m(D)}catch{}},[]),r!==+r||n!==+n||s!==+s||a!==+a||i!==+i||s===0&&a===0||i===0)return null;var _=xa("recharts-trapezoid",l);if(!f)return b.createElement("g",null,b.createElement("path",S5({},su(t),{className:_,d:GAe(r,n,s,a,i)})));var E=g.current,T=y.current,j=x.current,N=w.current,I=S.current,P="0px ".concat(p===-1?1:p,"px"),R="".concat(p,"px ").concat(p,"px"),B=hit(["strokeDasharray"],u,c);return b.createElement(Ehe,{animationId:k,key:k,canBegin:p>0,duration:u,easing:c,isActive:f,begin:d},D=>{var $=Mu(E,s,D),U=Mu(T,a,D),z=Mu(j,i,D),H=Mu(N,r,D),Q=Mu(I,n,D);h.current&&(g.current=$,y.current=U,x.current=z,w.current=H,S.current=Q);var L=D>0?{transition:B,strokeDasharray:R}:{strokeDasharray:P};return b.createElement("path",S5({},su(t),{className:_,d:GAe(H,Q,$,U,z),ref:h,style:WAe(WAe({},L),t.style)}))})},gAr=["option","shapeType","activeClassName","inActiveClassName"];function yAr(e,t){if(e==null)return{};var r,n,s=vAr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function vAr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function ZAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function O5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ZAe(Object(r),!0).forEach(function(n){bAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ZAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function bAr(e,t,r){return(t=xAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xAr(e){var t=wAr(e,"string");return typeof t=="symbol"?t:t+""}function wAr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function SAr(e,t){return O5(O5({},t),e)}function OAr(e,t){return e==="symbols"}function YAe(e){var{shapeType:t,elementProps:r}=e;switch(t){case"rectangle":return b.createElement(yit,r);case"trapezoid":return b.createElement(mAr,r);case"sector":return b.createElement(xit,r);case"symbols":if(OAr(t))return b.createElement(nat,r);break;case"curve":return b.createElement(fit,r);default:return null}}function kAr(e){return b.isValidElement(e)?e.props:e}function _Ar(e){var{option:t,shapeType:r,activeClassName:n="recharts-active-shape",inActiveClassName:s="recharts-shape"}=e,a=yAr(e,gAr),i;if(b.isValidElement(t))i=b.cloneElement(t,O5(O5({},a),kAr(t)));else if(typeof t=="function")i=t(a,a.index);else if(uAr(t)&&typeof t!="boolean"){var l=SAr(t,a);i=b.createElement(YAe,{shapeType:r,elementProps:l})}else{var c=a;i=b.createElement(YAe,{shapeType:r,elementProps:c})}return a.isActive?b.createElement(Qy,{className:n},i):b.createElement(Qy,{className:s},i)}function EAr(e){var{tooltipEntrySettings:t}=e,r=Vo(),n=sd(),s=b.useRef(null);return b.useLayoutEffect(()=>{n||(s.current===null?r(PCr(t)):s.current!==t&&r(MCr({prev:s.current,next:t})),s.current=t)},[t,r,n]),b.useLayoutEffect(()=>()=>{s.current&&(r(DCr(s.current)),s.current=null)},[r]),null}function CAr(e){var{legendPayload:t}=e,r=Vo(),n=sd(),s=b.useRef(null);return b.useLayoutEffect(()=>{n||(s.current===null?r(ZSr(t)):s.current!==t&&r(YSr({prev:s.current,next:t})),s.current=t)},[r,n,t]),b.useLayoutEffect(()=>()=>{s.current&&(r(XSr(s.current)),s.current=null)},[r]),null}var YH,jAr=()=>{var[e]=b.useState(()=>WA("uid-"));return e},TAr=(YH=ZS.useId)!==null&&YH!==void 0?YH:jAr;function NAr(e,t){var r=TAr();return t||(e?"".concat(e,"-").concat(r):r)}var AAr=b.createContext(void 0),IAr=e=>{var{id:t,type:r,children:n}=e,s=NAr("recharts-".concat(r),t);return b.createElement(AAr.Provider,{value:s},n(s))},RAr={cartesianItems:[],polarItems:[]},Klt=Ec({name:"graphicalItems",initialState:RAr,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:li()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,s=uh(e).cartesianItems.indexOf(r);s>-1&&(e.cartesianItems[s]=n)},prepare:li()},removeCartesianGraphicalItem:{reducer(e,t){var r=uh(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:li()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:li()},removePolarGraphicalItem:{reducer(e,t){var r=uh(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:li()},replacePolarGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,s=uh(e).polarItems.indexOf(r);s>-1&&(e.polarItems[s]=n)},prepare:li()}}}),{addCartesianGraphicalItem:PAr,replaceCartesianGraphicalItem:MAr,removeCartesianGraphicalItem:DAr,addPolarGraphicalItem:LPn,removePolarGraphicalItem:$Pn,replacePolarGraphicalItem:FPn}=Klt.actions,LAr=Klt.reducer,$Ar=e=>{var t=Vo(),r=b.useRef(null);return b.useLayoutEffect(()=>{r.current===null?t(PAr(e)):r.current!==e&&t(MAr({prev:r.current,next:e})),r.current=e},[t,e]),b.useLayoutEffect(()=>()=>{r.current&&(t(DAr(r.current)),r.current=null)},[t]),null},FAr=b.memo($Ar),zAr=["points"];function XAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function XH(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?XAe(Object(r),!0).forEach(function(n){BAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):XAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function BAr(e,t,r){return(t=UAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function UAr(e){var t=VAr(e,"string");return typeof t=="symbol"?t:t+""}function VAr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function k5(){return k5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},k5.apply(null,arguments)}function qAr(e,t){if(e==null)return{};var r,n,s=HAr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function HAr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function QAr(e){var{option:t,dotProps:r,className:n}=e;if(b.isValidElement(t))return b.cloneElement(t,r);if(typeof t=="function")return t(r);var s=xa(n,typeof t!="boolean"?t.className:""),a=r??{},{points:i}=a,l=qAr(a,zAr);return b.createElement(Zlt,k5({},l,{className:s}))}function WAr(e,t){return e==null?!1:t?!0:e.length===1}function GAr(e){var{points:t,dot:r,className:n,dotClassName:s,dataKey:a,baseProps:i,needClip:l,clipPathId:c,zIndex:u=Zc.scatter}=e;if(!WAr(t,r))return null;var d=Xlt(r),f=ixr(r),h=t.map((m,g)=>{var y,x,w=XH(XH(XH({r:3},i),f),{},{index:g,cx:(y=m.x)!==null&&y!==void 0?y:void 0,cy:(x=m.y)!==null&&x!==void 0?x:void 0,dataKey:a,value:m.value,payload:m.payload,points:t});return b.createElement(QAr,{key:"dot-".concat(g),option:r,dotProps:w,className:s})}),p={};return l&&c!=null&&(p.clipPath="url(#clipPath-".concat(d?"":"dots-").concat(c,")")),b.createElement(xv,{zIndex:u},b.createElement(Qy,k5({className:n},p),h))}function KAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function JAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?KAe(Object(r),!0).forEach(function(n){ZAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):KAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ZAr(e,t,r){return(t=YAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function YAr(e){var t=XAr(e,"string");return typeof t=="symbol"?t:t+""}function XAr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var KAr={xAxis:{},yAxis:{},zAxis:{}},Jlt=Ec({name:"cartesianAxis",initialState:KAr,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:li()},replaceXAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;e.xAxis[r.id]!==void 0&&(r.id!==n.id&&delete e.xAxis[r.id],e.xAxis[n.id]=n)},prepare:li()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:li()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:li()},replaceYAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;e.yAxis[r.id]!==void 0&&(r.id!==n.id&&delete e.yAxis[r.id],e.yAxis[n.id]=n)},prepare:li()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:li()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:li()},replaceZAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;e.zAxis[r.id]!==void 0&&(r.id!==n.id&&delete e.zAxis[r.id],e.zAxis[n.id]=n)},prepare:li()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:li()},updateYAxisWidth(e,t){var{id:r,width:n}=t.payload,s=e.yAxis[r];if(s){var a,i=s.widthHistory||[];if(i.length===3&&i[0]===i[2]&&n===i[1]&&n!==s.width&&Math.abs(n-((a=i[0])!==null&&a!==void 0?a:0))<=1)return;var l=[...i,n].slice(-3);e.yAxis[r]=JAe(JAe({},s),{},{width:n,widthHistory:l})}}}}),{addXAxis:JAr,replaceXAxis:eIr,removeXAxis:tIr,addYAxis:rIr,replaceYAxis:nIr,removeYAxis:sIr,addZAxis:zPn,replaceZAxis:BPn,removeZAxis:UPn,updateYAxisWidth:aIr}=Jlt.actions,iIr=Jlt.reducer,oIr=Xe([Yl],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),lIr=Xe([oIr,pv,mv],(e,t,r)=>{if(!(!e||t==null||r==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,r-e.top-e.bottom)}}),Ape=()=>en(lIr),cIr=()=>en(Pjr);function eIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function KH(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?eIe(Object(r),!0).forEach(function(n){uIr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function uIr(e,t,r){return(t=dIr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dIr(e){var t=fIr(e,"string");return typeof t=="symbol"?t:t+""}function fIr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var hIr=e=>{var{point:t,childIndex:r,mainColor:n,activeDot:s,dataKey:a,clipPath:i}=e;if(s===!1||t.x==null||t.y==null)return null;var l={index:r,dataKey:a,cx:t.x,cy:t.y,r:4,fill:n??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},c=KH(KH(KH({},l),zz(s)),phe(s)),u;return b.isValidElement(s)?u=b.cloneElement(s,c):typeof s=="function"?u=s(c):u=b.createElement(Zlt,c),b.createElement(Qy,{className:"recharts-active-dot",clipPath:i},u)};function pIr(e){var{points:t,mainColor:r,activeDot:n,itemDataKey:s,clipPath:a,zIndex:i=Zc.activeDot}=e,l=en(aI),c=cIr();if(t==null||c==null)return null;var u=t.find(d=>c.includes(d.payload));return Sl(u)?null:b.createElement(xv,{zIndex:i},b.createElement(hIr,{point:u,childIndex:Number(l),mainColor:r,dataKey:s,activeDot:n,clipPath:a}))}var mIr=e=>{var{chartData:t}=e,r=Vo(),n=sd();return b.useEffect(()=>n?()=>{}:(r(vAe(t)),()=>{r(vAe(void 0))}),[t,r,n]),null},tIe={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},ect=Ec({name:"brush",initialState:tIe,reducers:{setBrushSettings(e,t){return t.payload==null?tIe:t.payload}}}),{setBrushSettings:VPn}=ect.actions,gIr=ect.reducer;function yIr(e){return(e%180+180)%180}var vIr=function(t){var{width:r,height:n}=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=yIr(s),i=a*Math.PI/180,l=Math.atan(n/r),c=i>l&&i<Math.PI-l?n/Math.sin(i):r/Math.cos(i);return Math.abs(c)},bIr={dots:[],areas:[],lines:[]},tct=Ec({name:"referenceElements",initialState:bIr,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=uh(e).dots.findIndex(n=>n===t.payload);r!==-1&&e.dots.splice(r,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var r=uh(e).areas.findIndex(n=>n===t.payload);r!==-1&&e.areas.splice(r,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var r=uh(e).lines.findIndex(n=>n===t.payload);r!==-1&&e.lines.splice(r,1)}}}),{addDot:qPn,removeDot:HPn,addArea:QPn,removeArea:WPn,addLine:GPn,removeLine:ZPn}=tct.actions,xIr=tct.reducer,wIr=b.createContext(void 0),SIr=e=>{var{children:t}=e,[r]=b.useState("".concat(WA("recharts"),"-clip")),n=Ape();if(n==null)return null;var{x:s,y:a,width:i,height:l}=n;return b.createElement(wIr.Provider,{value:r},b.createElement("defs",null,b.createElement("clipPath",{id:r},b.createElement("rect",{x:s,y:a,height:l,width:i}))),t)};function rct(e,t){if(t<1)return[];if(t===1)return e;for(var r=[],n=0;n<e.length;n+=t){var s=e[n];s!==void 0&&r.push(s)}return r}function OIr(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return vIr(n,r)}function kIr(e,t,r){var n=r==="width",{x:s,y:a,width:i,height:l}=e;return t===1?{start:n?s:a,end:n?s+i:a+l}:{start:n?s+i:a+l,end:n?s:a}}function oI(e,t,r,n,s){if(e*t<e*n||e*t>e*s)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-s)<=0}function _Ir(e,t){return rct(e,t+1)}function EIr(e,t,r,n,s){for(var a=(n||[]).slice(),{start:i,end:l}=t,c=0,u=1,d=i,f=function(){var m=n?.[c];if(m===void 0)return{v:rct(n,u)};var g=c,y,x=()=>(y===void 0&&(y=r(m,g)),y),w=m.coordinate,S=c===0||oI(e,w,x,d,l);S||(c=0,d=i,u+=1),S&&(d=w+e*(x()/2+s),c+=u)},h;u<=a.length;)if(h=f(),h)return h.v;return[]}function CIr(e,t,r,n,s){var a=(n||[]).slice(),i=a.length;if(i===0)return[];for(var{start:l,end:c}=t,u=1;u<=i;u++){for(var d=(i-1)%u,f=l,h=!0,p=function(){var k=n[g];if(k==null)return 0;var _=g,E,T=()=>(E===void 0&&(E=r(k,_)),E),j=k.coordinate,N=g===d||oI(e,j,T,f,c);if(!N)return h=!1,1;N&&(f=j+e*(T()/2+s))},m,g=d;g<i&&(m=p(),!(m!==0&&m===1));g+=u);if(h){for(var y=[],x=d;x<i;x+=u){var w=n[x];w!=null&&y.push(w)}return y}}return[]}function rIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function rc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?rIe(Object(r),!0).forEach(function(n){jIr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function jIr(e,t,r){return(t=TIr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function TIr(e){var t=NIr(e,"string");return typeof t=="symbol"?t:t+""}function NIr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function AIr(e,t,r,n,s){for(var a=(n||[]).slice(),i=a.length,{start:l}=t,{end:c}=t,u=function(h){var p=a[h];if(p==null)return 1;var m=p,g,y=()=>(g===void 0&&(g=r(p,h)),g);if(h===i-1){var x=e*(m.coordinate+e*y()/2-c);a[h]=m=rc(rc({},m),{},{tickCoord:x>0?m.coordinate-x*e:m.coordinate})}else a[h]=m=rc(rc({},m),{},{tickCoord:m.coordinate});if(m.tickCoord!=null){var w=oI(e,m.tickCoord,y,l,c);w&&(c=m.tickCoord-e*(y()/2+s),a[h]=rc(rc({},m),{},{isShow:!0}))}},d=i-1;d>=0;d--)u(d);return a}function IIr(e,t,r,n,s,a){var i=(n||[]).slice(),l=i.length,{start:c,end:u}=t;if(a){var d=n[l-1];if(d!=null){var f=r(d,l-1),h=e*(d.coordinate+e*f/2-u);if(i[l-1]=d=rc(rc({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate}),d.tickCoord!=null){var p=oI(e,d.tickCoord,()=>f,c,u);p&&(u=d.tickCoord-e*(f/2+s),i[l-1]=rc(rc({},d),{},{isShow:!0}))}}}for(var m=a?l-1:l,g=function(w){var S=i[w];if(S==null)return 1;var k=S,_,E=()=>(_===void 0&&(_=r(S,w)),_);if(w===0){var T=e*(k.coordinate-e*E()/2-c);i[w]=k=rc(rc({},k),{},{tickCoord:T<0?k.coordinate-T*e:k.coordinate})}else i[w]=k=rc(rc({},k),{},{tickCoord:k.coordinate});if(k.tickCoord!=null){var j=oI(e,k.tickCoord,E,c,u);j&&(c=k.tickCoord+e*(E()/2+s),i[w]=rc(rc({},k),{},{isShow:!0}))}},y=0;y<m;y++)g(y);return i}function Ipe(e,t,r){var{tick:n,ticks:s,viewBox:a,minTickGap:i,orientation:l,interval:c,tickFormatter:u,unit:d,angle:f}=e;if(!s||!s.length||!n)return[];if(qr(c)||xP.isSsr){var h;return(h=_Ir(s,qr(c)?c:0))!==null&&h!==void 0?h:[]}var p=[],m=l==="top"||l==="bottom"?"width":"height",g=d&&m==="width"?CN(d,{fontSize:t,letterSpacing:r}):{width:0,height:0},y=(_,E)=>{var T=typeof u=="function"?u(_.value,E):_.value;return m==="width"?OIr(CN(T,{fontSize:t,letterSpacing:r}),g,f):CN(T,{fontSize:t,letterSpacing:r})[m]},x=s[0],w=s[1],S=s.length>=2&&x!=null&&w!=null?ch(w.coordinate-x.coordinate):1,k=kIr(a,S,m);return c==="equidistantPreserveStart"?EIr(S,k,y,s,i):c==="equidistantPreserveEnd"?CIr(S,k,y,s,i):(c==="preserveStart"||c==="preserveStartEnd"?p=IIr(S,k,y,s,i,c==="preserveStartEnd"):p=AIr(S,k,y,s,i),p.filter(_=>_.isShow))}var RIr=e=>{var{ticks:t,label:r,labelGapWithTick:n=5,tickSize:s=0,tickMargin:a=0}=e,i=0;if(t){Array.from(t).forEach(d=>{if(d){var f=d.getBoundingClientRect();f.width>i&&(i=f.width)}});var l=r?r.getBoundingClientRect().width:0,c=s+a,u=i+c+l+(r?n:0);return Math.round(u)}return 0},PIr={xAxis:{},yAxis:{}},nct=Ec({name:"renderedTicks",initialState:PIr,reducers:{setRenderedTicks:(e,t)=>{var{axisType:r,axisId:n,ticks:s}=t.payload;e[r][n]=s},removeRenderedTicks:(e,t)=>{var{axisType:r,axisId:n}=t.payload;delete e[r][n]}}}),{setRenderedTicks:MIr,removeRenderedTicks:DIr}=nct.actions,LIr=nct.reducer,$Ir=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function FIr(e,t){if(e==null)return{};var r,n,s=zIr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function zIr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function TS(){return TS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},TS.apply(null,arguments)}function nIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Hi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?nIe(Object(r),!0).forEach(function(n){BIr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function BIr(e,t,r){return(t=UIr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function UIr(e){var t=VIr(e,"string");return typeof t=="symbol"?t:t+""}function VIr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Dy={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",zIndex:Zc.axis};function qIr(e){var{x:t,y:r,width:n,height:s,orientation:a,mirror:i,axisLine:l,otherSvgProps:c}=e;if(!l)return null;var u=Hi(Hi(Hi({},c),Jm(l)),{},{fill:"none"});if(a==="top"||a==="bottom"){var d=+(a==="top"&&!i||a==="bottom"&&i);u=Hi(Hi({},u),{},{x1:t,y1:r+d*s,x2:t+n,y2:r+d*s})}else{var f=+(a==="left"&&!i||a==="right"&&i);u=Hi(Hi({},u),{},{x1:t+f*n,y1:r,x2:t+f*n,y2:r+s})}return b.createElement("line",TS({},u,{className:xa("recharts-cartesian-axis-line",qz(l,"className"))}))}function HIr(e,t,r,n,s,a,i,l,c){var u,d,f,h,p,m,g=l?-1:1,y=e.tickSize||i,x=qr(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":u=d=e.coordinate,h=r+ +!l*s,f=h-g*y,m=f-g*c,p=x;break;case"left":f=h=e.coordinate,d=t+ +!l*n,u=d-g*y,p=u-g*c,m=x;break;case"right":f=h=e.coordinate,d=t+ +l*n,u=d+g*y,p=u+g*c,m=x;break;default:u=d=e.coordinate,h=r+ +l*s,f=h+g*y,m=f+g*c,p=x;break}return{line:{x1:u,y1:f,x2:d,y2:h},tick:{x:p,y:m}}}function QIr(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function WIr(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function GIr(e){var{option:t,tickProps:r,value:n}=e,s,a=xa(r.className,"recharts-cartesian-axis-tick-value");if(b.isValidElement(t))s=b.cloneElement(t,Hi(Hi({},r),{},{className:a}));else if(typeof t=="function")s=t(Hi(Hi({},r),{},{className:a}));else{var i="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(i=xa(i,sAr(t))),s=b.createElement(Tpe,TS({},r,{className:i}),n)}return s}function ZIr(e){var{ticks:t,axisType:r,axisId:n}=e,s=Vo();return b.useEffect(()=>{if(n==null||r==null)return f1;var a=t.map(i=>({value:i.value,coordinate:i.coordinate,offset:i.offset,index:i.index}));return s(MIr({ticks:a,axisId:n,axisType:r})),()=>{s(DIr({axisId:n,axisType:r}))}},[s,t,n,r]),null}var YIr=b.forwardRef((e,t)=>{var{ticks:r=[],tick:n,tickLine:s,stroke:a,tickFormatter:i,unit:l,padding:c,tickTextProps:u,orientation:d,mirror:f,x:h,y:p,width:m,height:g,tickSize:y,tickMargin:x,fontSize:w,letterSpacing:S,getTicksConfig:k,events:_,axisType:E,axisId:T}=e,j=Ipe(Hi(Hi({},k),{},{ticks:r}),w,S),N=Jm(k),I=zz(n),P=Blt(N.textAnchor)?N.textAnchor:QIr(d,f),R=WIr(d,f),B={};typeof s=="object"&&(B=s);var D=Hi(Hi({},N),{},{fill:"none"},B),$=j.map(H=>Hi({entry:H},HIr(H,h,p,m,g,d,y,f,x))),U=$.map(H=>{var{entry:Q,line:L}=H;return b.createElement(Qy,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(Q.value,"-").concat(Q.coordinate,"-").concat(Q.tickCoord)},s&&b.createElement("line",TS({},D,L,{className:xa("recharts-cartesian-axis-tick-line",qz(s,"className"))})))}),z=$.map((H,Q)=>{var L,Z,{entry:V,tick:M}=H,W=Hi(Hi(Hi(Hi({verticalAnchor:R},N),{},{textAnchor:P,stroke:"none",fill:a},M),{},{index:Q,payload:V,visibleTicksCount:j.length,tickFormatter:i,padding:c},u),{},{angle:(L=(Z=u?.angle)!==null&&Z!==void 0?Z:N.angle)!==null&&L!==void 0?L:0}),G=Hi(Hi({},W),I);return b.createElement(Qy,TS({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(V.value,"-").concat(V.coordinate,"-").concat(V.tickCoord)},u0r(_,V,Q)),n&&b.createElement(GIr,{option:n,tickProps:G,value:"".concat(typeof i=="function"?i(V.value,Q):V.value).concat(l||"")}))});return b.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(E,"-ticks")},b.createElement(ZIr,{ticks:j,axisId:T,axisType:E}),z.length>0&&b.createElement(xv,{zIndex:Zc.label},b.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(E,"-tick-labels"),ref:t},z)),U.length>0&&b.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(E,"-tick-lines")},U))}),XIr=b.forwardRef((e,t)=>{var{axisLine:r,width:n,height:s,className:a,hide:i,ticks:l,axisType:c,axisId:u}=e,d=FIr(e,$Ir),[f,h]=b.useState(""),[p,m]=b.useState(""),g=b.useRef(null);b.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var x;return RIr({ticks:g.current,label:(x=e.labelRef)===null||x===void 0?void 0:x.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var y=b.useCallback(x=>{if(x){var w=x.getElementsByClassName("recharts-cartesian-axis-tick-value");g.current=w;var S=w[0];if(S){var k=window.getComputedStyle(S),_=k.fontSize,E=k.letterSpacing;(_!==f||E!==p)&&(h(_),m(E))}}},[f,p]);return i||n!=null&&n<=0||s!=null&&s<=0?null:b.createElement(xv,{zIndex:e.zIndex},b.createElement(Qy,{className:xa("recharts-cartesian-axis",a)},b.createElement(qIr,{x:e.x,y:e.y,width:n,height:s,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:Jm(e)}),b.createElement(YIr,{ref:y,axisType:c,events:d,fontSize:f,getTicksConfig:e,height:e.height,letterSpacing:p,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:l,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:u}),b.createElement(LNr,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},b.createElement(WNr,{label:e.label,labelRef:e.labelRef}),e.children)))}),Rpe=b.forwardRef((e,t)=>{var r=nd(e,Dy);return b.createElement(XIr,TS({},r,{ref:t}))});Rpe.displayName="CartesianAxis";var KIr=["x1","y1","x2","y2","key"],JIr=["offset"],eRr=["xAxisId","yAxisId"],tRr=["xAxisId","yAxisId"];function sIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function cc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sIe(Object(r),!0).forEach(function(n){rRr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function rRr(e,t,r){return(t=nRr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nRr(e){var t=sRr(e,"string");return typeof t=="symbol"?t:t+""}function sRr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ew(){return Ew=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ew.apply(null,arguments)}function _5(e,t){if(e==null)return{};var r,n,s=aRr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function aRr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var iRr=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:r,x:n,y:s,width:a,height:i,ry:l}=e;return b.createElement("rect",{x:n,y:s,ry:l,width:a,height:i,stroke:"none",fill:t,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function sct(e){var{option:t,lineItemProps:r}=e,n;if(b.isValidElement(t))n=b.cloneElement(t,r);else if(typeof t=="function")n=t(r);else{var s,{x1:a,y1:i,x2:l,y2:c,key:u}=r,d=_5(r,KIr),f=(s=Jm(d))!==null&&s!==void 0?s:{},{offset:h}=f,p=_5(f,JIr);n=b.createElement("line",Ew({},p,{x1:a,y1:i,x2:l,y2:c,fill:"none",key:u}))}return n}function oRr(e){var{x:t,width:r,horizontal:n=!0,horizontalPoints:s}=e;if(!n||!s||!s.length)return null;var{xAxisId:a,yAxisId:i}=e,l=_5(e,eRr),c=s.map((u,d)=>{var f=cc(cc({},l),{},{x1:t,y1:u,x2:t+r,y2:u,key:"line-".concat(d),index:d});return b.createElement(sct,{key:"line-".concat(d),option:n,lineItemProps:f})});return b.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function lRr(e){var{y:t,height:r,vertical:n=!0,verticalPoints:s}=e;if(!n||!s||!s.length)return null;var{xAxisId:a,yAxisId:i}=e,l=_5(e,tRr),c=s.map((u,d)=>{var f=cc(cc({},l),{},{x1:u,y1:t,x2:u,y2:t+r,key:"line-".concat(d),index:d});return b.createElement(sct,{option:n,lineItemProps:f,key:"line-".concat(d)})});return b.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function cRr(e){var{horizontalFill:t,fillOpacity:r,x:n,y:s,width:a,height:i,horizontalPoints:l,horizontal:c=!0}=e;if(!c||!t||!t.length||l==null)return null;var u=l.map(f=>Math.round(f+s-s)).sort((f,h)=>f-h);s!==u[0]&&u.unshift(0);var d=u.map((f,h)=>{var p=u[h+1],m=p==null,g=m?s+i-f:p-f;if(g<=0)return null;var y=h%t.length;return b.createElement("rect",{key:"react-".concat(h),y:f,x:n,height:g,width:a,stroke:"none",fill:t[y],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return b.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function uRr(e){var{vertical:t=!0,verticalFill:r,fillOpacity:n,x:s,y:a,width:i,height:l,verticalPoints:c}=e;if(!t||!r||!r.length)return null;var u=c.map(f=>Math.round(f+s-s)).sort((f,h)=>f-h);s!==u[0]&&u.unshift(0);var d=u.map((f,h)=>{var p=u[h+1],m=p==null,g=m?s+i-f:p-f;if(g<=0)return null;var y=h%r.length;return b.createElement("rect",{key:"react-".concat(h),x:f,y:a,width:g,height:l,stroke:"none",fill:r[y],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return b.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var dRr=(e,t)=>{var{xAxis:r,width:n,height:s,offset:a}=e;return qat(Ipe(cc(cc(cc({},Dy),r),{},{ticks:Hat(r),viewBox:{x:0,y:0,width:n,height:s}})),a.left,a.left+a.width,t)},fRr=(e,t)=>{var{yAxis:r,width:n,height:s,offset:a}=e;return qat(Ipe(cc(cc(cc({},Dy),r),{},{ticks:Hat(r),viewBox:{x:0,y:0,width:n,height:s}})),a.top,a.top+a.height,t)},hRr={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Zc.grid};function act(e){var t=Jat(),r=eit(),n=Kat(),s=cc(cc({},nd(e,hRr)),{},{x:qr(e.x)?e.x:n.left,y:qr(e.y)?e.y:n.top,width:qr(e.width)?e.width:n.width,height:qr(e.height)?e.height:n.height}),{xAxisId:a,yAxisId:i,x:l,y:c,width:u,height:d,syncWithTicks:f,horizontalValues:h,verticalValues:p}=s,m=sd(),g=en(N=>aAe(N,"xAxis",a,m)),y=en(N=>aAe(N,"yAxis",i,m));if(!tg(u)||!tg(d)||!qr(l)||!qr(c))return null;var x=s.verticalCoordinatesGenerator||dRr,w=s.horizontalCoordinatesGenerator||fRr,{horizontalPoints:S,verticalPoints:k}=s;if((!S||!S.length)&&typeof w=="function"){var _=h&&h.length,E=w({yAxis:y?cc(cc({},y),{},{ticks:_?h:y.ticks}):void 0,width:t??u,height:r??d,offset:n},_?!0:f);Y4(Array.isArray(E),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof E,"]")),Array.isArray(E)&&(S=E)}if((!k||!k.length)&&typeof x=="function"){var T=p&&p.length,j=x({xAxis:g?cc(cc({},g),{},{ticks:T?p:g.ticks}):void 0,width:t??u,height:r??d,offset:n},T?!0:f);Y4(Array.isArray(j),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof j,"]")),Array.isArray(j)&&(k=j)}return b.createElement(xv,{zIndex:s.zIndex},b.createElement("g",{className:"recharts-cartesian-grid"},b.createElement(iRr,{fill:s.fill,fillOpacity:s.fillOpacity,x:s.x,y:s.y,width:s.width,height:s.height,ry:s.ry}),b.createElement(cRr,Ew({},s,{horizontalPoints:S})),b.createElement(uRr,Ew({},s,{verticalPoints:k})),b.createElement(oRr,Ew({},s,{offset:n,horizontalPoints:S,xAxis:g,yAxis:y})),b.createElement(lRr,Ew({},s,{offset:n,verticalPoints:k,xAxis:g,yAxis:y}))))}act.displayName="CartesianGrid";var pRr={},ict=Ec({name:"errorBars",initialState:pRr,reducers:{addErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]||(e[r]=[]),e[r].push(n)},replaceErrorBar:(e,t)=>{var{itemId:r,prev:n,next:s}=t.payload;e[r]&&(e[r]=e[r].map(a=>a.dataKey===n.dataKey&&a.direction===n.direction?s:a))},removeErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]&&(e[r]=e[r].filter(s=>s.dataKey!==n.dataKey||s.direction!==n.direction))}}}),{addErrorBar:YPn,replaceErrorBar:XPn,removeErrorBar:KPn}=ict.actions,mRr=ict.reducer,gRr=["children"];function yRr(e,t){if(e==null)return{};var r,n,s=vRr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function vRr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var bRr={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},xRr=b.createContext(bRr);function wRr(e){var{children:t}=e,r=yRr(e,gRr);return b.createElement(xRr.Provider,{value:r},t)}function oct(e,t){var r,n,s=en(u=>yv(u,e)),a=en(u=>vv(u,t)),i=(r=s?.allowDataOverflow)!==null&&r!==void 0?r:Yo.allowDataOverflow,l=(n=a?.allowDataOverflow)!==null&&n!==void 0?n:Xo.allowDataOverflow,c=i||l;return{needClip:c,needClipX:i,needClipY:l}}function SRr(e){var{xAxisId:t,yAxisId:r,clipPathId:n}=e,s=Ape(),{needClipX:a,needClipY:i,needClip:l}=oct(t,r);if(!l||!s)return null;var{x:c,y:u,width:d,height:f}=s;return b.createElement("clipPath",{id:"clipPath-".concat(n)},b.createElement("rect",{x:a?c:c-d/2,y:i?u:u-f/2,width:a?d:d*2,height:i?f:f*2}))}var lct=(e,t,r,n)=>olt(e,"xAxis",t,n),cct=(e,t,r,n)=>ilt(e,"xAxis",t,n),uct=(e,t,r,n)=>olt(e,"yAxis",r,n),dct=(e,t,r,n)=>ilt(e,"yAxis",r,n),ORr=Xe([Fi,lct,uct,cct,dct],(e,t,r,n,s)=>hv(e,"xAxis")?Z4(t,n,!1):Z4(r,s,!1)),kRr=(e,t,r,n,s)=>s;function _Rr(e){return e.type==="line"}var ERr=Xe([Not,kRr],(e,t)=>e.filter(_Rr).find(r=>r.id===t)),CRr=Xe([Fi,lct,uct,cct,dct,ERr,ORr,jhe],(e,t,r,n,s,a,i,l)=>{var{chartData:c,dataStartIndex:u,dataEndIndex:d}=l;if(!(a==null||t==null||r==null||n==null||s==null||n.length===0||s.length===0||i==null||e!=="horizontal"&&e!=="vertical")){var{dataKey:f,data:h}=a,p;if(h!=null&&h.length>0?p=h:p=c?.slice(u,d+1),p!=null)return GRr({layout:e,xAxis:t,yAxis:r,xAxisTicks:n,yAxisTicks:s,dataKey:f,bandSize:i,displayedData:p})}});function jRr(e){var t=zz(e),r=3,n=2;if(t!=null){var{r:s,strokeWidth:a}=t,i=Number(s),l=Number(a);return(Number.isNaN(i)||i<0)&&(i=r),(Number.isNaN(l)||l<0)&&(l=n),{r:i,strokeWidth:l}}return{r,strokeWidth:n}}var TRr=["id"],NRr=["type","layout","connectNulls","needClip","shape"],ARr=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function lI(){return lI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lI.apply(null,arguments)}function aIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function pm(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?aIe(Object(r),!0).forEach(function(n){IRr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):aIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function IRr(e,t,r){return(t=RRr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function RRr(e){var t=PRr(e,"string");return typeof t=="symbol"?t:t+""}function PRr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ppe(e,t){if(e==null)return{};var r,n,s=MRr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function MRr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var DRr=e=>{var{dataKey:t,name:r,stroke:n,legendType:s,hide:a}=e;return[{inactive:a,dataKey:t,type:s,color:n,value:Qat(r,t),payload:e}]},LRr=b.memo(e=>{var{dataKey:t,data:r,stroke:n,strokeWidth:s,fill:a,name:i,hide:l,unit:c,tooltipType:u,id:d}=e,f={dataDefinedOnItem:r,getPosition:f1,settings:{stroke:n,strokeWidth:s,fill:a,dataKey:t,nameKey:void 0,name:Qat(i,t),hide:l,type:u,color:n,unit:c,graphicalItemId:d}};return b.createElement(EAr,{tooltipEntrySettings:f})}),fct=(e,t)=>"".concat(t,"px ").concat(e,"px");function $Rr(e,t){for(var r=e.length%2!==0?[...e,0]:e,n=[],s=0;s<t;++s)n.push(...r);return n}var FRr=(e,t,r)=>{var n=r.reduce((h,p)=>h+p,0);if(!n)return fct(t,e);for(var s=Math.floor(e/n),a=e%n,i=[],l=0,c=0;l<r.length;c+=(u=r[l])!==null&&u!==void 0?u:0,++l){var u,d=r[l];if(d!=null&&c+d>a){i=[...r.slice(0,l),a-c];break}}var f=i.length%2===0?[0,t]:[t];return[...$Rr(r,s),...i,...f].map(h=>"".concat(h,"px")).join(", ")};function zRr(e){var{clipPathId:t,points:r,props:n}=e,{dot:s,dataKey:a,needClip:i}=n,{id:l}=n,c=Ppe(n,TRr),u=Jm(c);return b.createElement(GAr,{points:r,dot:s,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:u,needClip:i,clipPathId:t})}function BRr(e){var{showLabels:t,children:r,points:n}=e,s=b.useMemo(()=>n?.map(a=>{var i,l,c={x:(i=a.x)!==null&&i!==void 0?i:0,y:(l=a.y)!==null&&l!==void 0?l:0,width:0,lowerWidth:0,upperWidth:0,height:0};return pm(pm({},c),{},{value:a.value,payload:a.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[n]);return b.createElement(KNr,{value:t?s:void 0},r)}function iIe(e){var{clipPathId:t,pathRef:r,points:n,strokeDasharray:s,props:a}=e,{type:i,layout:l,connectNulls:c,needClip:u,shape:d}=a,f=Ppe(a,NRr),h=pm(pm({},su(f)),{},{fill:"none",className:"recharts-line-curve",clipPath:u?"url(#clipPath-".concat(t,")"):void 0,points:n,type:i,layout:l,connectNulls:c,strokeDasharray:s??a.strokeDasharray});return b.createElement(b.Fragment,null,n?.length>1&&b.createElement(_Ar,lI({shapeType:"curve",option:d},h,{pathRef:r})),b.createElement(zRr,{points:n,clipPathId:t,props:a}))}function URr(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function VRr(e){var{clipPathId:t,props:r,pathRef:n,previousPointsRef:s,longestAnimatedLengthRef:a}=e,{points:i,strokeDasharray:l,isAnimationActive:c,animationBegin:u,animationDuration:d,animationEasing:f,animateNewValues:h,width:p,height:m,onAnimationEnd:g,onAnimationStart:y}=r,x=s.current,w=Che(i,"recharts-line-"),S=b.useRef(w),[k,_]=b.useState(!1),E=!k,T=b.useCallback(()=>{typeof g=="function"&&g(),_(!1)},[g]),j=b.useCallback(()=>{typeof y=="function"&&y(),_(!0)},[y]),N=URr(n.current),I=b.useRef(0);S.current!==w&&(I.current=a.current,S.current=w);var P=I.current;return b.createElement(BRr,{points:i,showLabels:E},r.children,b.createElement(Ehe,{animationId:w,begin:u,duration:d,isActive:c,easing:f,onAnimationEnd:T,onAnimationStart:j,key:w},R=>{var B=Mu(P,N+P,R),D=Math.min(B,N),$;if(c)if(l){var U="".concat(l).split(/[,\s]+/gim).map(Q=>parseFloat(Q));$=FRr(D,N,U)}else $=fct(N,D);else $=l==null?void 0:String(l);if(R>0&&N>0&&(s.current=i,a.current=Math.max(a.current,D)),x){var z=x.length/i.length,H=R===1?i:i.map((Q,L)=>{var Z=Math.floor(L*z);if(x[Z]){var V=x[Z];return pm(pm({},Q),{},{x:Mu(V.x,Q.x,R),y:Mu(V.y,Q.y,R)})}return h?pm(pm({},Q),{},{x:Mu(p*2,Q.x,R),y:Mu(m/2,Q.y,R)}):pm(pm({},Q),{},{x:Q.x,y:Q.y})});return s.current=H,b.createElement(iIe,{props:r,points:H,clipPathId:t,pathRef:n,strokeDasharray:$})}return b.createElement(iIe,{props:r,points:i,clipPathId:t,pathRef:n,strokeDasharray:$})}),b.createElement(tAr,{label:r.label}))}function qRr(e){var{clipPathId:t,props:r}=e,n=b.useRef(null),s=b.useRef(0),a=b.useRef(null);return b.createElement(VRr,{props:r,clipPathId:t,previousPointsRef:n,longestAnimatedLengthRef:s,pathRef:a})}var HRr=(e,t)=>{var r,n;return{x:(r=e.x)!==null&&r!==void 0?r:void 0,y:(n=e.y)!==null&&n!==void 0?n:void 0,value:e.value,errorVal:Ql(e.payload,t)}};class QRr extends b.Component{render(){var{hide:t,dot:r,points:n,className:s,xAxisId:a,yAxisId:i,top:l,left:c,width:u,height:d,id:f,needClip:h,zIndex:p}=this.props;if(t)return null;var m=xa("recharts-line",s),g=f,{r:y,strokeWidth:x}=jRr(r),w=Xlt(r),S=y*2+x,k=h?"url(#clipPath-".concat(w?"":"dots-").concat(g,")"):void 0;return b.createElement(xv,{zIndex:p},b.createElement(Qy,{className:m},h&&b.createElement("defs",null,b.createElement(SRr,{clipPathId:g,xAxisId:a,yAxisId:i}),!w&&b.createElement("clipPath",{id:"clipPath-dots-".concat(g)},b.createElement("rect",{x:c-S/2,y:l-S/2,width:u+S,height:d+S}))),b.createElement(wRr,{xAxisId:a,yAxisId:i,data:n,dataPointFormatter:HRr,errorBarOffset:0},b.createElement(qRr,{props:this.props,clipPathId:g}))),b.createElement(pIr,{activeDot:this.props.activeDot,points:n,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:k}))}}var hct={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:Zc.line,type:"linear"};function WRr(e){var t=nd(e,hct),{activeDot:r,animateNewValues:n,animationBegin:s,animationDuration:a,animationEasing:i,connectNulls:l,dot:c,hide:u,isAnimationActive:d,label:f,legendType:h,xAxisId:p,yAxisId:m,id:g}=t,y=Ppe(t,ARr),{needClip:x}=oct(p,m),w=Ape(),S=eC(),k=sd(),_=en(I=>CRr(I,p,m,k,g));if(S!=="horizontal"&&S!=="vertical"||_==null||w==null)return null;var{height:E,width:T,x:j,y:N}=w;return b.createElement(QRr,lI({},y,{id:g,connectNulls:l,dot:c,activeDot:r,animateNewValues:n,animationBegin:s,animationDuration:a,animationEasing:i,isAnimationActive:d,hide:u,label:f,legendType:h,xAxisId:p,yAxisId:m,points:_,layout:S,height:E,width:T,left:j,top:N,needClip:x}))}function GRr(e){var{layout:t,xAxis:r,yAxis:n,xAxisTicks:s,yAxisTicks:a,dataKey:i,bandSize:l,displayedData:c}=e;return c.map((u,d)=>{var f=Ql(u,i);if(t==="horizontal"){var h=sTe({axis:r,ticks:s,bandSize:l,entry:u,index:d}),p=Sl(f)?null:n.scale.map(f);return{x:h,y:p??null,value:f,payload:u}}var m=Sl(f)?null:r.scale.map(f),g=sTe({axis:n,ticks:a,bandSize:l,entry:u,index:d});return m==null||g==null?null:{x:m,y:g,value:f,payload:u}}).filter(Boolean)}function ZRr(e){var t=nd(e,hct),r=sd();return b.createElement(IAr,{id:t.id,type:"line"},n=>b.createElement(b.Fragment,null,b.createElement(CAr,{legendPayload:DRr(t)}),b.createElement(LRr,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:n}),b.createElement(FAr,{type:"line",id:n,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:r}),b.createElement(WRr,lI({},t,{id:n}))))}var pct=b.memo(ZRr,c9);pct.displayName="Line";var YRr=["domain","range"],XRr=["domain","range"];function oIe(e,t){if(e==null)return{};var r,n,s=KRr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function KRr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function lIe(e,t){return e===t?!0:Array.isArray(e)&&e.length===2&&Array.isArray(t)&&t.length===2?e[0]===t[0]&&e[1]===t[1]:!1}function mct(e,t){if(e===t)return!0;var{domain:r,range:n}=e,s=oIe(e,YRr),{domain:a,range:i}=t,l=oIe(t,XRr);return!lIe(r,a)||!lIe(n,i)?!1:c9(s,l)}var JRr=["type"],ePr=["dangerouslySetInnerHTML","ticks","scale"],tPr=["id","scale"];function Wae(){return Wae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Wae.apply(null,arguments)}function cIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function uIe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?cIe(Object(r),!0).forEach(function(n){rPr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function rPr(e,t,r){return(t=nPr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nPr(e){var t=sPr(e,"string");return typeof t=="symbol"?t:t+""}function sPr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Gae(e,t){if(e==null)return{};var r,n,s=aPr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function aPr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function iPr(e){var t=Vo(),r=b.useRef(null),n=tit(),{type:s}=e,a=Gae(e,JRr),i=f9(n,"xAxis",s),l=b.useMemo(()=>{if(i!=null)return uIe(uIe({},a),{},{type:i})},[a,i]);return b.useLayoutEffect(()=>{l!=null&&(r.current===null?t(JAr(l)):r.current!==l&&t(eIr({prev:r.current,next:l})),r.current=l)},[l,t]),b.useLayoutEffect(()=>()=>{r.current&&(t(tIr(r.current)),r.current=null)},[t]),null}var oPr=e=>{var{xAxisId:t,className:r}=e,n=en(Gat),s=sd(),a="xAxis",i=en(x=>alt(x,a,t,s)),l=en(x=>mCr(x,t)),c=en(x=>wCr(x,t)),u=en(x=>Eot(x,t));if(l==null||c==null||u==null)return null;var{dangerouslySetInnerHTML:d,ticks:f,scale:h}=e,p=Gae(e,ePr),{id:m,scale:g}=u,y=Gae(u,tPr);return b.createElement(Rpe,Wae({},p,y,{x:c.x,y:c.y,width:l.width,height:l.height,className:xa("recharts-".concat(a," ").concat(a),r),viewBox:n,ticks:i,axisType:a,axisId:t}))},lPr={allowDataOverflow:Yo.allowDataOverflow,allowDecimals:Yo.allowDecimals,allowDuplicatedCategory:Yo.allowDuplicatedCategory,angle:Yo.angle,axisLine:Dy.axisLine,height:Yo.height,hide:!1,includeHidden:Yo.includeHidden,interval:Yo.interval,label:!1,minTickGap:Yo.minTickGap,mirror:Yo.mirror,orientation:Yo.orientation,padding:Yo.padding,reversed:Yo.reversed,scale:Yo.scale,tick:Yo.tick,tickCount:Yo.tickCount,tickLine:Dy.tickLine,tickSize:Dy.tickSize,type:Yo.type,niceTicks:Yo.niceTicks,xAxisId:0},cPr=e=>{var t=nd(e,lPr);return b.createElement(b.Fragment,null,b.createElement(iPr,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),b.createElement(oPr,t))},gct=b.memo(cPr,mct);gct.displayName="XAxis";var uPr=["type"],dPr=["dangerouslySetInnerHTML","ticks","scale"],fPr=["id","scale"];function Zae(){return Zae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zae.apply(null,arguments)}function dIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function fIe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?dIe(Object(r),!0).forEach(function(n){hPr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hPr(e,t,r){return(t=pPr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pPr(e){var t=mPr(e,"string");return typeof t=="symbol"?t:t+""}function mPr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Yae(e,t){if(e==null)return{};var r,n,s=gPr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function gPr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function yPr(e){var t=Vo(),r=b.useRef(null),n=tit(),{type:s}=e,a=Yae(e,uPr),i=f9(n,"yAxis",s),l=b.useMemo(()=>{if(i!=null)return fIe(fIe({},a),{},{type:i})},[i,a]);return b.useLayoutEffect(()=>{l!=null&&(r.current===null?t(rIr(l)):r.current!==l&&t(nIr({prev:r.current,next:l})),r.current=l)},[l,t]),b.useLayoutEffect(()=>()=>{r.current&&(t(sIr(r.current)),r.current=null)},[t]),null}function vPr(e){var{yAxisId:t,className:r,width:n,label:s}=e,a=b.useRef(null),i=b.useRef(null),l=en(Gat),c=sd(),u=Vo(),d="yAxis",f=en(E=>kCr(E,t)),h=en(E=>OCr(E,t)),p=en(E=>alt(E,d,t,c)),m=en(E=>Cot(E,t));if(b.useLayoutEffect(()=>{if(!(n!=="auto"||!f||Npe(s)||b.isValidElement(s)||m==null)){var E=a.current;if(E){var T=E.getCalculatedWidth();Math.round(f.width)!==Math.round(T)&&u(aIr({id:t,width:T}))}}},[p,f,u,s,t,n,m]),f==null||h==null||m==null)return null;var{dangerouslySetInnerHTML:g,ticks:y,scale:x}=e,w=Yae(e,dPr),{id:S,scale:k}=m,_=Yae(m,fPr);return b.createElement(Rpe,Zae({},w,_,{ref:a,labelRef:i,x:h.x,y:h.y,tickTextProps:n==="auto"?{width:void 0}:{width:n},width:f.width,height:f.height,className:xa("recharts-".concat(d," ").concat(d),r),viewBox:l,ticks:p,axisType:d,axisId:t}))}var bPr={allowDataOverflow:Xo.allowDataOverflow,allowDecimals:Xo.allowDecimals,allowDuplicatedCategory:Xo.allowDuplicatedCategory,angle:Xo.angle,axisLine:Dy.axisLine,hide:!1,includeHidden:Xo.includeHidden,interval:Xo.interval,label:!1,minTickGap:Xo.minTickGap,mirror:Xo.mirror,orientation:Xo.orientation,padding:Xo.padding,reversed:Xo.reversed,scale:Xo.scale,tick:Xo.tick,tickCount:Xo.tickCount,tickLine:Dy.tickLine,tickSize:Dy.tickSize,type:Xo.type,niceTicks:Xo.niceTicks,width:Xo.width,yAxisId:0},xPr=e=>{var t=nd(e,bPr);return b.createElement(b.Fragment,null,b.createElement(yPr,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),b.createElement(vPr,t))},yct=b.memo(xPr,mct);yct.displayName="YAxis";var wPr=(e,t)=>t,Mpe=Xe([wPr,Fi,Fit,_l,Olt,bv,Wjr,Yl],eTr);function SPr(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function Dpe(e){var t=e.currentTarget.getBoundingClientRect(),r,n;if(SPr(e)){var s=e.currentTarget.getBBox();r=s.width>0?t.width/s.width:1,n=s.height>0?t.height/s.height:1}else{var a=e.currentTarget;r=a.offsetWidth>0?t.width/a.offsetWidth:1,n=a.offsetHeight>0?t.height/a.offsetHeight:1}var i=(l,c)=>({relativeX:Math.round((l-t.left)/r),relativeY:Math.round((c-t.top)/n)});return"touches"in e?Array.from(e.touches).map(l=>i(l.clientX,l.clientY)):i(e.clientX,e.clientY)}var vct=of("mouseClick"),bct=gP();bct.startListening({actionCreator:vct,effect:(e,t)=>{var r=e.payload,n=Mpe(t.getState(),Dpe(r));n?.activeIndex!=null&&t.dispatch(FCr({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var Xae=of("mouseMove"),xct=gP(),wO=null,F0=null,JH=null;xct.startListening({actionCreator:Xae,effect:(e,t)=>{var r=e.payload,n=t.getState(),{throttleDelay:s,throttledEvents:a}=n.eventSettings,i=a==="all"||a?.includes("mousemove");wO!==null&&(cancelAnimationFrame(wO),wO=null),F0!==null&&(typeof s!="number"||!i)&&(clearTimeout(F0),F0=null),JH=Dpe(r);var l=()=>{var c=t.getState(),u=bpe(c,c.tooltip.settings.shared);if(!JH){wO=null,F0=null;return}if(u==="axis"){var d=Mpe(c,JH);d?.activeIndex!=null?t.dispatch(plt({activeIndex:d.activeIndex,activeDataKey:void 0,activeCoordinate:d.activeCoordinate})):t.dispatch(hlt())}wO=null,F0=null};if(!i){l();return}s==="raf"?wO=requestAnimationFrame(l):typeof s=="number"&&F0===null&&(F0=setTimeout(l,s))}});function OPr(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<<CHILDREN>>":t}var hIe={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},wct=Ec({name:"rootProps",initialState:hIe,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:hIe.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),kPr=wct.reducer,{updateOptions:_Pr}=wct.actions,EPr=null,CPr={updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)},Sct=Ec({name:"polarOptions",initialState:EPr,reducers:CPr}),{updatePolarOptions:JPn}=Sct.actions,jPr=Sct.reducer,Oct=of("keyDown"),kct=of("focus"),_ct=of("blur"),E9=gP(),SO=null,z0=null,QD=null;E9.startListening({actionCreator:Oct,effect:(e,t)=>{QD=e.payload,SO!==null&&(cancelAnimationFrame(SO),SO=null);var r=t.getState(),{throttleDelay:n,throttledEvents:s}=r.eventSettings,a=s==="all"||s.includes("keydown");z0!==null&&(typeof n!="number"||!a)&&(clearTimeout(z0),z0=null);var i=()=>{try{var l=t.getState(),c=l.rootProps.accessibilityLayer!==!1;if(!c)return;var{keyboardInteraction:u}=l.tooltip,d=QD;if(d!=="ArrowRight"&&d!=="ArrowLeft"&&d!=="Enter")return;var f=xpe(u,lC(l),jP(l),NP(l)),h=f==null?-1:Number(f);if(!Number.isFinite(h)||h<0)return;var p=bv(l);if(d==="Enter"){var m=x5(l,"axis","hover",String(u.index));t.dispatch(b5({active:!u.active,activeIndex:u.index,activeCoordinate:m}));return}var g=TCr(l),y=g==="left-to-right"?1:-1,x=d==="ArrowRight"?1:-1,w=h+x*y;if(p==null||w>=p.length||w<0)return;var S=x5(l,"axis","hover",String(w));t.dispatch(b5({active:!0,activeIndex:w.toString(),activeCoordinate:S}))}finally{SO=null,z0=null}};if(!a){i();return}n==="raf"?SO=requestAnimationFrame(i):typeof n=="number"&&z0===null&&(i(),QD=null,z0=setTimeout(()=>{QD?i():(z0=null,SO=null)},n))}});E9.startListening({actionCreator:kct,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:s}=r.tooltip;if(!s.active&&s.index==null){var a="0",i=x5(r,"axis","hover",String(a));t.dispatch(b5({active:!0,activeIndex:a,activeCoordinate:i}))}}}});E9.startListening({actionCreator:_ct,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:s}=r.tooltip;s.active&&t.dispatch(b5({active:!1,activeIndex:s.index,activeCoordinate:s.coordinate}))}}});function Ect(e){e.persist();var{currentTarget:t}=e;return new Proxy(e,{get:(r,n)=>{if(n==="currentTarget")return t;var s=Reflect.get(r,n);return typeof s=="function"?s.bind(r):s}})}var Wf=of("externalEvent"),Cct=gP(),WD=new Map,nT=new Map,eQ=new Map;Cct.startListening({actionCreator:Wf,effect:(e,t)=>{var{handler:r,reactEvent:n}=e.payload;if(r!=null){var s=n.type,a=Ect(n);eQ.set(s,{handler:r,reactEvent:a});var i=WD.get(s);i!==void 0&&(cancelAnimationFrame(i),WD.delete(s));var l=t.getState(),{throttleDelay:c,throttledEvents:u}=l.eventSettings,d=u,f=d==="all"||d?.includes(s),h=nT.get(s);h!==void 0&&(typeof c!="number"||!f)&&(clearTimeout(h),nT.delete(s));var p=()=>{var y=eQ.get(s);try{if(!y)return;var{handler:x,reactEvent:w}=y,S=t.getState(),k={activeCoordinate:Ajr(S),activeDataKey:jjr(S),activeIndex:aI(S),activeLabel:Elt(S),activeTooltipIndex:aI(S),isTooltipActive:Ijr(S)};x&&x(k,w)}finally{WD.delete(s),nT.delete(s),eQ.delete(s)}};if(!f){p();return}if(c==="raf"){var m=requestAnimationFrame(p);WD.set(s,m)}else if(typeof c=="number"){if(!nT.has(s)){p();var g=setTimeout(p,c);nT.set(s,g)}}else p()}}});var TPr=Xe([iC],e=>e.tooltipItemPayloads),NPr=Xe([TPr,(e,t)=>t,(e,t,r)=>r],(e,t,r)=>{if(t!=null){var n=e.find(a=>a.settings.graphicalItemId===r);if(n!=null){var{getPosition:s}=n;if(s!=null)return s(t)}}}),jct=of("touchMove"),Tct=gP(),B0=null,rb=null,pIe=null,sT=null;Tct.startListening({actionCreator:jct,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){sT=Ect(r);var n=t.getState(),{throttleDelay:s,throttledEvents:a}=n.eventSettings,i=a==="all"||a.includes("touchmove");B0!==null&&(cancelAnimationFrame(B0),B0=null),rb!==null&&(typeof s!="number"||!i)&&(clearTimeout(rb),rb=null),pIe=Array.from(r.touches).map(c=>Dpe({clientX:c.clientX,clientY:c.clientY,currentTarget:r.currentTarget}));var l=()=>{if(sT!=null){var c=t.getState(),u=bpe(c,c.tooltip.settings.shared);if(u==="axis"){var d,f=(d=pIe)===null||d===void 0?void 0:d[0];if(f==null){B0=null,rb=null;return}var h=Mpe(c,f);h?.activeIndex!=null&&t.dispatch(plt({activeIndex:h.activeIndex,activeDataKey:void 0,activeCoordinate:h.activeCoordinate}))}else if(u==="item"){var p,m=sT.touches[0];if(document.elementFromPoint==null||m==null)return;var g=document.elementFromPoint(m.clientX,m.clientY);if(!g||!g.getAttribute)return;var y=g.getAttribute(aSr),x=(p=g.getAttribute(iSr))!==null&&p!==void 0?p:void 0,w=oC(c).find(_=>_.id===x);if(y==null||w==null||x==null)return;var{dataKey:S}=w,k=NPr(c,y,x);t.dispatch($Cr({activeDataKey:S,activeIndex:y,activeCoordinate:k,activeGraphicalItemId:x}))}B0=null,rb=null}};if(!i){l();return}s==="raf"?B0=requestAnimationFrame(l):typeof s=="number"&&rb===null&&(l(),sT=null,rb=setTimeout(()=>{sT?l():(rb=null,B0=null)},s))}}});var Nct={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},Act=Ec({name:"eventSettings",initialState:Nct,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:APr}=Act.actions,IPr=Act.reducer,RPr=ont({brush:gIr,cartesianAxis:iIr,chartData:ITr,errorBars:mRr,eventSettings:IPr,graphicalItems:LAr,layout:qwr,legend:KSr,options:CTr,polarAxis:nAr,polarOptions:jPr,referenceElements:xIr,renderedTicks:LIr,rootProps:kPr,tooltip:zCr,zIndex:pTr}),PPr=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return mwr({reducer:RPr,preloadedState:t,middleware:n=>{var s;return n({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((s="es6")!==null&&s!==void 0?s:"")}).concat([bct.middleware,xct.middleware,E9.middleware,Cct.middleware,Tct.middleware])},enhancers:n=>{var s=n;return typeof n=="function"&&(s=n()),s.concat(Nat({type:"raf"}))},devTools:{serialize:{replacer:OPr},name:"recharts-".concat(r)}})};function MPr(e){var{preloadedState:t,children:r,reduxStoreName:n}=e,s=sd(),a=b.useRef(null);if(s)return r;a.current==null&&(a.current=PPr(t,n));var i=ghe;return b.createElement(gnt,{context:i,store:a.current},r)}function DPr(e){var{layout:t,margin:r}=e,n=Vo(),s=sd();return b.useEffect(()=>{s||(n(Bwr(t)),n(zwr(r)))},[n,s,t,r]),null}var LPr=b.memo(DPr,c9);function $Pr(e){var t=Vo();return b.useEffect(()=>{t(_Pr(e))},[t,e]),null}var FPr=e=>{var t=Vo();return b.useEffect(()=>{t(APr(e))},[t,e]),null},zPr=b.memo(FPr,c9);function mIe(e){var{zIndex:t,isPanorama:r}=e,n=b.useRef(null),s=Vo();return b.useLayoutEffect(()=>(n.current&&s(fTr({zIndex:t,element:n.current,isPanorama:r})),()=>{s(hTr({zIndex:t,isPanorama:r}))}),[s,t,r]),b.createElement("g",{tabIndex:-1,ref:n,className:"recharts-zIndex-layer_".concat(t)})}function gIe(e){var{children:t,isPanorama:r}=e,n=en(rTr);if(!n||n.length===0)return t;var s=n.filter(i=>i<0),a=n.filter(i=>i>0);return b.createElement(b.Fragment,null,s.map(i=>b.createElement(mIe,{key:i,zIndex:i,isPanorama:r})),t,a.map(i=>b.createElement(mIe,{key:i,zIndex:i,isPanorama:r})))}var BPr=["children"];function UPr(e,t){if(e==null)return{};var r,n,s=VPr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function VPr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function E5(){return E5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},E5.apply(null,arguments)}var qPr={width:"100%",height:"100%",display:"block"},HPr=b.forwardRef((e,t)=>{var r=Jat(),n=eit(),s=dit();if(!tg(r)||!tg(n))return null;var{children:a,otherAttributes:i,title:l,desc:c}=e,u,d;return i!=null&&(typeof i.tabIndex=="number"?u=i.tabIndex:u=s?0:void 0,typeof i.role=="string"?d=i.role:d=s?"application":void 0),b.createElement(Dst,E5({},i,{title:l,desc:c,role:d,tabIndex:u,width:r,height:n,style:qPr,ref:t}),a)}),QPr=e=>{var{children:t}=e,r=en(s9);if(!r)return null;var{width:n,height:s,y:a,x:i}=r;return b.createElement(Dst,{width:n,height:s,x:i,y:a},t)},yIe=b.forwardRef((e,t)=>{var{children:r}=e,n=UPr(e,BPr),s=sd();return s?b.createElement(QPr,null,b.createElement(gIe,{isPanorama:!0},r)):b.createElement(HPr,E5({ref:t},n),b.createElement(gIe,{isPanorama:!1},r))});function WPr(){var e=Vo(),[t,r]=b.useState(null),n=en(sSr);return b.useEffect(()=>{if(t!=null){var s=t.getBoundingClientRect(),a=s.width/t.offsetWidth;zs(a)&&a!==n&&e(Vwr(a))}},[t,e,n]),r}function vIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function GPr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?vIe(Object(r),!0).forEach(function(n){ZPr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ZPr(e,t,r){return(t=YPr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function YPr(e){var t=XPr(e,"string");return typeof t=="symbol"?t:t+""}function XPr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Wb(){return Wb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Wb.apply(null,arguments)}var KPr=()=>(BTr(),null);function C5(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var JPr=b.forwardRef((e,t)=>{var r,n,s=b.useRef(null),[a,i]=b.useState({containerWidth:C5((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:C5((n=e.style)===null||n===void 0?void 0:n.height)}),l=b.useCallback((u,d)=>{i(f=>{var h=Math.round(u),p=Math.round(d);return f.containerWidth===h&&f.containerHeight===p?f:{containerWidth:h,containerHeight:p}})},[]),c=b.useCallback(u=>{if(typeof t=="function"&&t(u),u!=null&&typeof ResizeObserver<"u"){var{width:d,height:f}=u.getBoundingClientRect();l(d,f);var h=m=>{var g=m[0];if(g!=null){var{width:y,height:x}=g.contentRect;l(y,x)}},p=new ResizeObserver(h);p.observe(u),s.current=p}},[t,l]);return b.useEffect(()=>()=>{var u=s.current;u?.disconnect()},[l]),b.createElement(b.Fragment,null,b.createElement(vP,{width:a.containerWidth,height:a.containerHeight}),b.createElement("div",Wb({ref:c},e)))}),eMr=b.forwardRef((e,t)=>{var{width:r,height:n}=e,[s,a]=b.useState({containerWidth:C5(r),containerHeight:C5(n)}),i=b.useCallback((c,u)=>{a(d=>{var f=Math.round(c),h=Math.round(u);return d.containerWidth===f&&d.containerHeight===h?d:{containerWidth:f,containerHeight:h}})},[]),l=b.useCallback(c=>{if(typeof t=="function"&&t(c),c!=null){var{width:u,height:d}=c.getBoundingClientRect();i(u,d)}},[t,i]);return b.createElement(b.Fragment,null,b.createElement(vP,{width:s.containerWidth,height:s.containerHeight}),b.createElement("div",Wb({ref:l},e)))}),tMr=b.forwardRef((e,t)=>{var{width:r,height:n}=e;return b.createElement(b.Fragment,null,b.createElement(vP,{width:r,height:n}),b.createElement("div",Wb({ref:t},e)))}),rMr=b.forwardRef((e,t)=>{var{width:r,height:n}=e;return typeof r=="string"||typeof n=="string"?b.createElement(eMr,Wb({},e,{ref:t})):typeof r=="number"&&typeof n=="number"?b.createElement(tMr,Wb({},e,{width:r,height:n,ref:t})):b.createElement(b.Fragment,null,b.createElement(vP,{width:r,height:n}),b.createElement("div",Wb({ref:t},e)))});function nMr(e){return e?JPr:rMr}var sMr=b.forwardRef((e,t)=>{var{children:r,className:n,height:s,onClick:a,onContextMenu:i,onDoubleClick:l,onMouseDown:c,onMouseEnter:u,onMouseLeave:d,onMouseMove:f,onMouseUp:h,onTouchEnd:p,onTouchMove:m,onTouchStart:g,style:y,width:x,responsive:w,dispatchTouchEvents:S=!0}=e,k=b.useRef(null),_=Vo(),[E,T]=b.useState(null),[j,N]=b.useState(null),I=WPr(),P=She(),R=P?.width>0?P.width:x,B=P?.height>0?P.height:s,D=b.useCallback(ie=>{I(ie),typeof t=="function"&&t(ie),T(ie),N(ie),ie!=null&&(k.current=ie)},[I,t,T,N]),$=b.useCallback(ie=>{_(vct(ie)),_(Wf({handler:a,reactEvent:ie}))},[_,a]),U=b.useCallback(ie=>{_(Xae(ie)),_(Wf({handler:u,reactEvent:ie}))},[_,u]),z=b.useCallback(ie=>{_(hlt()),_(Wf({handler:d,reactEvent:ie}))},[_,d]),H=b.useCallback(ie=>{_(Xae(ie)),_(Wf({handler:f,reactEvent:ie}))},[_,f]),Q=b.useCallback(()=>{_(kct())},[_]),L=b.useCallback(()=>{_(_ct())},[_]),Z=b.useCallback(ie=>{_(Oct(ie.key))},[_]),V=b.useCallback(ie=>{_(Wf({handler:i,reactEvent:ie}))},[_,i]),M=b.useCallback(ie=>{_(Wf({handler:l,reactEvent:ie}))},[_,l]),W=b.useCallback(ie=>{_(Wf({handler:c,reactEvent:ie}))},[_,c]),G=b.useCallback(ie=>{_(Wf({handler:h,reactEvent:ie}))},[_,h]),J=b.useCallback(ie=>{_(Wf({handler:g,reactEvent:ie}))},[_,g]),ae=b.useCallback(ie=>{S&&_(jct(ie)),_(Wf({handler:m,reactEvent:ie}))},[_,S,m]),te=b.useCallback(ie=>{_(Wf({handler:p,reactEvent:ie}))},[_,p]),re=nMr(w);return b.createElement(Rlt.Provider,{value:E},b.createElement(hxr.Provider,{value:j},b.createElement(re,{width:R??y?.width,height:B??y?.height,className:xa("recharts-wrapper",n),style:GPr({position:"relative",cursor:"default",width:R,height:B},y),onClick:$,onContextMenu:V,onDoubleClick:M,onFocus:Q,onBlur:L,onKeyDown:Z,onMouseDown:W,onMouseEnter:U,onMouseLeave:z,onMouseMove:H,onMouseUp:G,onTouchEnd:te,onTouchMove:ae,onTouchStart:J,ref:D},b.createElement(KPr,null),r)))}),aMr=["width","height","responsive","children","className","style","compact","title","desc"];function iMr(e,t){if(e==null)return{};var r,n,s=oMr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function oMr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var lMr=b.forwardRef((e,t)=>{var{width:r,height:n,responsive:s,children:a,className:i,style:l,compact:c,title:u,desc:d}=e,f=iMr(e,aMr),h=Jm(f);return c?b.createElement(b.Fragment,null,b.createElement(vP,{width:r,height:n}),b.createElement(yIe,{otherAttributes:h,title:u,desc:d},a)):b.createElement(sMr,{className:i,style:l,width:r,height:n,responsive:s??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},b.createElement(yIe,{otherAttributes:h,title:u,desc:d,ref:t},b.createElement(SIr,null,a)))});function Kae(){return Kae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Kae.apply(null,arguments)}function bIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function cMr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bIe(Object(r),!0).forEach(function(n){uMr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function uMr(e,t,r){return(t=dMr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dMr(e){var t=fMr(e,"string");return typeof t=="symbol"?t:t+""}function fMr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var hMr={top:5,right:5,bottom:5,left:5},pMr=cMr({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:hMr,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},Nct),mMr=b.forwardRef(function(t,r){var n,s=nd(t.categoricalChartProps,pMr),{chartName:a,defaultTooltipEventType:i,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,categoricalChartProps:u}=t,d={chartName:a,defaultTooltipEventType:i,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,eventEmitter:void 0};return b.createElement(MPr,{preloadedState:{options:d},reduxStoreName:(n=u.id)!==null&&n!==void 0?n:a},b.createElement(mIr,{chartData:u.data}),b.createElement(LPr,{layout:s.layout,margin:s.margin}),b.createElement(zPr,{throttleDelay:s.throttleDelay,throttledEvents:s.throttledEvents}),b.createElement($Pr,{baseValue:s.baseValue,accessibilityLayer:s.accessibilityLayer,barCategoryGap:s.barCategoryGap,maxBarSize:s.maxBarSize,stackOffset:s.stackOffset,barGap:s.barGap,barSize:s.barSize,syncId:s.syncId,syncMethod:s.syncMethod,className:s.className,reverseStackOrder:s.reverseStackOrder}),b.createElement(lMr,Kae({},s,{ref:r})))}),gMr=["axis"],yMr=b.forwardRef((e,t)=>b.createElement(mMr,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:gMr,tooltipPayloadSearcher:_Tr,categoricalChartProps:e,ref:t}));function vMr(e,t){const r=getComputedStyle(e),n=parseFloat(r.fontSize);return t*n}function bMr(e,t){const r=getComputedStyle(e.ownerDocument.body),n=parseFloat(r.fontSize);return t*n}function xMr(e){return e/100*window.innerHeight}function wMr(e){return e/100*window.innerWidth}function SMr(e){switch(typeof e){case"number":return[e,"px"];case"string":{const t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}function qT({groupSize:e,panelElement:t,styleProp:r}){let n;const[s,a]=SMr(r);switch(a){case"%":{n=s/100*e;break}case"px":{n=s;break}case"rem":{n=bMr(t,s);break}case"em":{n=vMr(t,s);break}case"vh":{n=xMr(s);break}case"vw":{n=wMr(s);break}}return n}function zu(e){return parseFloat(e.toFixed(3))}function Z_({group:e}){const{orientation:t,panels:r}=e;return r.reduce((n,s)=>(n+=t==="horizontal"?s.element.offsetWidth:s.element.offsetHeight,n),0)}function Jae(e){const{panels:t}=e,r=Z_({group:e});return r===0?t.map(n=>({groupResizeBehavior:n.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:n.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:n.panelConstraints.disabled,minSize:0,maxSize:100,panelId:n.id})):t.map(n=>{const{element:s,panelConstraints:a}=n;let i=0;if(a.collapsedSize!==void 0){const d=qT({groupSize:r,panelElement:s,styleProp:a.collapsedSize});i=zu(d/r*100)}let l;if(a.defaultSize!==void 0){const d=qT({groupSize:r,panelElement:s,styleProp:a.defaultSize});l=zu(d/r*100)}let c=0;if(a.minSize!==void 0){const d=qT({groupSize:r,panelElement:s,styleProp:a.minSize});c=zu(d/r*100)}let u=100;if(a.maxSize!==void 0){const d=qT({groupSize:r,panelElement:s,styleProp:a.maxSize});u=zu(d/r*100)}return{groupResizeBehavior:a.groupResizeBehavior,collapsedSize:i,collapsible:a.collapsible===!0,defaultSize:l,disabled:a.disabled,minSize:c,maxSize:u,panelId:n.id}})}function ja(e,t="Assertion error"){if(!e)throw Error(t)}function eie(e,t){return Array.from(t).sort(e==="horizontal"?OMr:kMr)}function OMr(e,t){const r=e.element.offsetLeft-t.element.offsetLeft;return r!==0?r:e.element.offsetWidth-t.element.offsetWidth}function kMr(e,t){const r=e.element.offsetTop-t.element.offsetTop;return r!==0?r:e.element.offsetHeight-t.element.offsetHeight}function Ict(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Rct(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function _Mr({orientation:e,rects:t,targetRect:r}){const n={x:r.x+r.width/2,y:r.y+r.height/2};let s,a=Number.MAX_VALUE;for(const i of t){const{x:l,y:c}=Rct(n,i),u=e==="horizontal"?l:c;u<a&&(a=u,s=i)}return ja(s,"No rect found"),s}let GD;function EMr(){return GD===void 0&&(typeof matchMedia=="function"?GD=!!matchMedia("(pointer:coarse)").matches:GD=!1),GD}function Pct(e){const{element:t,orientation:r,panels:n,separators:s}=e,a=eie(r,Array.from(t.children).filter(Ict).map(m=>({element:m}))).map(({element:m})=>m),i=[];let l=!1,c=!1,u=-1,d=-1,f=0,h,p=[];{let m=-1;for(const g of a)g.hasAttribute("data-panel")&&(m++,g.ariaDisabled===null&&(f++,u===-1&&(u=m),d=m))}if(f>1){let m=-1;for(const g of a)if(g.hasAttribute("data-panel")){m++;const y=n.find(x=>x.element===g);if(y){if(h){const x=h.element.getBoundingClientRect(),w=g.getBoundingClientRect();let S;if(c){const k=r==="horizontal"?new DOMRect(x.right,x.top,0,x.height):new DOMRect(x.left,x.bottom,x.width,0),_=r==="horizontal"?new DOMRect(w.left,w.top,0,w.height):new DOMRect(w.left,w.top,w.width,0);switch(p.length){case 0:{S=[k,_];break}case 1:{const E=p[0],T=_Mr({orientation:r,rects:[x,w],targetRect:E.element.getBoundingClientRect()});S=[E,T===x?_:k];break}default:{S=p;break}}}else p.length?S=p:S=[r==="horizontal"?new DOMRect(x.right,w.top,w.left-x.right,w.height):new DOMRect(w.left,x.bottom,w.width,w.top-x.bottom)];for(const k of S){let _="width"in k?k:k.element.getBoundingClientRect();const E=EMr()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(_.width<E){const j=E-_.width;_=new DOMRect(_.x-j/2,_.y,_.width+j,_.height)}if(_.height<E){const j=E-_.height;_=new DOMRect(_.x,_.y-j/2,_.width,_.height+j)}const T=m<=u||m>d;!l&&!T&&i.push({group:e,groupSize:Z_({group:e}),panels:[h,y],separator:"width"in k?void 0:k,rect:_}),l=!1}}c=!1,h=y,p=[]}}else if(g.hasAttribute("data-separator")){g.ariaDisabled!==null&&(l=!0);const y=s.find(x=>x.element===g);y?p.push(y):(h=void 0,p=[])}else c=!0}return i}let Mct=class{#e={};addListener(t,r){const n=this.#e[t];return n===void 0?this.#e[t]=[r]:n.includes(r)||n.push(r),()=>{this.removeListener(t,r)}}emit(t,r){const n=this.#e[t];if(n!==void 0)if(n.length===1)n[0].call(null,r);else{let s=!1,a=null;const i=Array.from(n);for(let l=0;l<i.length;l++){const c=i[l];try{c.call(null,r)}catch(u){a===null&&(s=!0,a=u)}}if(s)throw a}}removeAllListeners(){this.#e={}}removeListener(t,r){const n=this.#e[t];if(n!==void 0){const s=n.indexOf(r);s>=0&&n.splice(s,1)}}},Pm=new Map;const Dct=new Mct;function CMr(e){Pm=new Map(Pm),Pm.delete(e)}function xIe(e,t){for(const[r]of Pm)if(r.id===e)return r}function Gb(e,t){for(const[r,n]of Pm)if(r.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function m1(){return Pm}function Lpe(e,t){return Dct.addListener("groupChange",r=>{r.group.id===e&&t(r)})}function Jy(e,t){const r=Pm.get(e);Pm=new Map(Pm),Pm.set(e,t),Dct.emit("groupChange",{group:e,prev:r,next:t})}function jMr(e,t,r){let n,s={x:1/0,y:1/0};for(const a of t){const i=Rct(r,a.rect);switch(e){case"horizontal":{i.x<=s.x&&(n=a,s=i);break}case"vertical":{i.y<=s.y&&(n=a,s=i);break}}}return n?{distance:s,hitRegion:n}:void 0}function TMr(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function NMr(e,t){if(e===t)throw new Error("Cannot compare node with itself");const r={a:OIe(e),b:OIe(t)};let n;for(;r.a.at(-1)===r.b.at(-1);)n=r.a.pop(),r.b.pop();ja(n,"Stacking order can only be calculated for elements with a common ancestor");const s={a:SIe(wIe(r.a)),b:SIe(wIe(r.b))};if(s.a===s.b){const a=n.childNodes,i={a:r.a.at(-1),b:r.b.at(-1)};let l=a.length;for(;l--;){const c=a[l];if(c===i.a)return 1;if(c===i.b)return-1}}return Math.sign(s.a-s.b)}const AMr=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function IMr(e){const t=getComputedStyle(Lct(e)??e).display;return t==="flex"||t==="inline-flex"}function RMr(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||IMr(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||AMr.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function wIe(e){let t=e.length;for(;t--;){const r=e[t];if(ja(r,"Missing node"),RMr(r))return r}return null}function SIe(e){return e&&Number(getComputedStyle(e).zIndex)||0}function OIe(e){const t=[];for(;e;)t.push(e),e=Lct(e);return t}function Lct(e){const{parentNode:t}=e;return TMr(t)?t.host:t}function PMr(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function MMr({groupElement:e,hitRegion:t,pointerEventTarget:r}){if(!Ict(r)||r.contains(e)||e.contains(r))return!0;if(NMr(r,e)>0){let n=r;for(;n;){if(n.contains(e))return!0;if(PMr(n.getBoundingClientRect(),t))return!1;n=n.parentElement}}return!0}function $pe(e,t){const r=[];return t.forEach((n,s)=>{if(s.disabled)return;const a=Pct(s),i=jMr(s.orientation,a,{x:e.clientX,y:e.clientY});i&&i.distance.x<=0&&i.distance.y<=0&&MMr({groupElement:s.element,hitRegion:i.hitRegion.rect,pointerEventTarget:e.target})&&r.push(i.hitRegion)}),r}function DMr(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!=t[r])return!1;return!0}function qc(e,t,r=0){return Math.abs(zu(e)-zu(t))<=r}function um(e,t){return qc(e,t)?0:e>t?1:-1}function hk({overrideDisabledPanels:e,panelConstraints:t,prevSize:r,size:n}){const{collapsedSize:s=0,collapsible:a,disabled:i,maxSize:l=100,minSize:c=0}=t;if(i&&!e)return r;if(um(n,c)<0)if(a){const u=(s+c)/2;um(n,u)<0?n=s:n=c}else n=c;return n=Math.min(l,n),n=zu(n),n}function cI({delta:e,initialLayout:t,panelConstraints:r,pivotIndices:n,prevLayout:s,trigger:a}){if(qc(e,0))return t;const i=a==="imperative-api",l=Object.values(t),c=Object.values(s),u=[...l],[d,f]=n;ja(d!=null,"Invalid first pivot index"),ja(f!=null,"Invalid second pivot index");let h=0;switch(a){case"keyboard":{{const g=e<0?f:d,y=r[g];ja(y,`Panel constraints not found for index ${g}`);const{collapsedSize:x=0,collapsible:w,minSize:S=0}=y;if(w){const k=l[g];if(ja(k!=null,`Previous layout not found for panel index ${g}`),qc(k,x)){const _=S-k;um(_,Math.abs(e))>0&&(e=e<0?0-_:_)}}}{const g=e<0?d:f,y=r[g];ja(y,`No panel constraints found for index ${g}`);const{collapsedSize:x=0,collapsible:w,minSize:S=0}=y;if(w){const k=l[g];if(ja(k!=null,`Previous layout not found for panel index ${g}`),qc(k,S)){const _=k-x;um(_,Math.abs(e))>0&&(e=e<0?0-_:_)}}}break}default:{const g=e<0?f:d,y=r[g];ja(y,`Panel constraints not found for index ${g}`);const x=l[g],{collapsible:w,collapsedSize:S,minSize:k}=y;if(w&&um(x,k)<0)if(e>0){const _=k-S,E=_/2,T=x+e;um(T,k)<0&&(e=um(e,E)<=0?0:_)}else{const _=k-S,E=100-_/2,T=x-e;um(T,k)<0&&(e=um(100+e,E)>0?0:-_)}break}}{const g=e<0?1:-1;let y=e<0?f:d,x=0;for(;;){const S=l[y];ja(S!=null,`Previous layout not found for panel index ${y}`);const k=hk({overrideDisabledPanels:i,panelConstraints:r[y],prevSize:S,size:100})-S;if(x+=k,y+=g,y<0||y>=r.length)break}const w=Math.min(Math.abs(e),Math.abs(x));e=e<0?0-w:w}{let g=e<0?d:f;for(;g>=0&&g<r.length;){const y=Math.abs(e)-Math.abs(h),x=l[g];ja(x!=null,`Previous layout not found for panel index ${g}`);const w=x-y,S=hk({overrideDisabledPanels:i,panelConstraints:r[g],prevSize:x,size:w});if(!qc(x,S)&&(h+=x-S,u[g]=S,h.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?g--:g++}}if(DMr(c,u))return s;{const g=e<0?f:d,y=l[g];ja(y!=null,`Previous layout not found for panel index ${g}`);const x=y+h,w=hk({overrideDisabledPanels:i,panelConstraints:r[g],prevSize:y,size:x});if(u[g]=w,!qc(w,x)){let S=x-w,k=e<0?f:d;for(;k>=0&&k<r.length;){const _=u[k];ja(_!=null,`Previous layout not found for panel index ${k}`);const E=_+S,T=hk({overrideDisabledPanels:i,panelConstraints:r[k],prevSize:_,size:E});if(qc(_,T)||(S-=T-_,u[k]=T),qc(S,0))break;e>0?k--:k++}}}const p=Object.values(u).reduce((g,y)=>y+g,0);if(!qc(p,100,.1))return s;const m=Object.keys(s);return u.reduce((g,y,x)=>(g[m[x]]=y,g),{})}function NS(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(t[r]===void 0||um(e[r],t[r])!==0)return!1;return!0}function AS({layout:e,panelConstraints:t}){const r=Object.values(e),n=[...r],s=n.reduce((l,c)=>l+c,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(l=>`${l}%`).join(", ")}`);if(!qc(s,100)&&n.length>0)for(let l=0;l<t.length;l++){const c=n[l];ja(c!=null,`No layout data found for index ${l}`);const u=100/s*c;n[l]=u}let a=0;for(let l=0;l<t.length;l++){const c=r[l];ja(c!=null,`No layout data found for index ${l}`);const u=n[l];ja(u!=null,`No layout data found for index ${l}`);const d=hk({overrideDisabledPanels:!0,panelConstraints:t[l],prevSize:c,size:u});u!=d&&(a+=u-d,n[l]=d)}if(!qc(a,0))for(let l=0;l<t.length;l++){const c=n[l];ja(c!=null,`No layout data found for index ${l}`);const u=c+a,d=hk({overrideDisabledPanels:!0,panelConstraints:t[l],prevSize:c,size:u});if(c!==d&&(a-=d-c,n[l]=d,qc(a,0)))break}const i=Object.keys(e);return n.reduce((l,c,u)=>(l[i[u]]=c,l),{})}function $ct({groupId:e,panelId:t}){const r=()=>{const l=m1();for(const[c,{defaultLayoutDeferred:u,derivedPanelConstraints:d,layout:f,groupSize:h,separatorToPanels:p}]of l)if(c.id===e)return{defaultLayoutDeferred:u,derivedPanelConstraints:d,group:c,groupSize:h,layout:f,separatorToPanels:p};throw Error(`Group ${e} not found`)},n=()=>{const l=r().derivedPanelConstraints.find(c=>c.panelId===t);if(l!==void 0)return l;throw Error(`Panel constraints not found for Panel ${t}`)},s=()=>{const l=r().group.panels.find(c=>c.id===t);if(l!==void 0)return l;throw Error(`Layout not found for Panel ${t}`)},a=()=>{const l=r().layout[t];if(l!==void 0)return l;throw Error(`Layout not found for Panel ${t}`)},i=l=>{const c=a();if(l===c)return;const{defaultLayoutDeferred:u,derivedPanelConstraints:d,group:f,groupSize:h,layout:p,separatorToPanels:m}=r(),g=f.panels.findIndex(S=>S.id===t),y=g===f.panels.length-1,x=cI({delta:y?c-l:l-c,initialLayout:p,panelConstraints:d,pivotIndices:y?[g-1,g]:[g,g+1],prevLayout:p,trigger:"imperative-api"}),w=AS({layout:x,panelConstraints:d});NS(p,w)||Jy(f,{defaultLayoutDeferred:u,derivedPanelConstraints:d,groupSize:h,layout:w,separatorToPanels:m})};return{collapse:()=>{const{collapsible:l,collapsedSize:c}=n(),{mutableValues:u}=s(),d=a();l&&d!==c&&(u.expandToSize=d,i(c))},expand:()=>{const{collapsible:l,collapsedSize:c,minSize:u}=n(),{mutableValues:d}=s(),f=a();if(l&&f===c){let h=d.expandToSize??u;h===0&&(h=1),i(h)}},getSize:()=>{const{group:l}=r(),c=a(),{element:u}=s(),d=l.orientation==="horizontal"?u.offsetWidth:u.offsetHeight;return{asPercentage:c,inPixels:d}},isCollapsed:()=>{const{collapsible:l,collapsedSize:c}=n(),u=a();return l&&qc(c,u)},resize:l=>{const{group:c}=r(),{element:u}=s(),d=Z_({group:c}),f=qT({groupSize:d,panelElement:u,styleProp:l}),h=zu(f/d*100);i(h)}}}function kIe(e){if(e.defaultPrevented)return;const t=m1();$pe(e,t).forEach(r=>{if(r.separator){const n=r.panels.find(s=>s.panelConstraints.defaultSize!==void 0);if(n){const s=n.panelConstraints.defaultSize,a=$ct({groupId:r.group.id,panelId:n.id});a&&s!==void 0&&(a.resize(s),e.preventDefault())}}})}function C$(e){const t=m1();for(const[r]of t)if(r.separators.some(n=>n.element===e))return r;throw Error("Could not find parent Group for separator element")}function Fct({groupId:e}){const t=()=>{const r=m1();for(const[n,s]of r)if(n.id===e)return{group:n,...s};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:r,layout:n}=t();return r?{}:n},setLayout(r){const{defaultLayoutDeferred:n,derivedPanelConstraints:s,group:a,groupSize:i,layout:l,separatorToPanels:c}=t(),u=AS({layout:r,panelConstraints:s});return n?l:(NS(l,u)||Jy(a,{defaultLayoutDeferred:n,derivedPanelConstraints:s,groupSize:i,layout:u,separatorToPanels:c}),u)}}}function U0(e,t){const r=C$(e),n=Gb(r.id,!0),s=r.separators.find(d=>d.element===e);ja(s,"Matching separator not found");const a=n.separatorToPanels.get(s);ja(a,"Matching panels not found");const i=a.map(d=>r.panels.indexOf(d)),l=Fct({groupId:r.id}).getLayout(),c=cI({delta:t,initialLayout:l,panelConstraints:n.derivedPanelConstraints,pivotIndices:i,prevLayout:l,trigger:"keyboard"}),u=AS({layout:c,panelConstraints:n.derivedPanelConstraints});NS(l,u)||Jy(r,{defaultLayoutDeferred:n.defaultLayoutDeferred,derivedPanelConstraints:n.derivedPanelConstraints,groupSize:n.groupSize,layout:u,separatorToPanels:n.separatorToPanels})}function _Ie(e){if(e.defaultPrevented)return;const t=e.currentTarget,r=C$(t);if(!r.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),r.orientation==="vertical"&&U0(t,5);break}case"ArrowLeft":{e.preventDefault(),r.orientation==="horizontal"&&U0(t,-5);break}case"ArrowRight":{e.preventDefault(),r.orientation==="horizontal"&&U0(t,5);break}case"ArrowUp":{e.preventDefault(),r.orientation==="vertical"&&U0(t,-5);break}case"End":{e.preventDefault(),U0(t,100);break}case"Enter":{e.preventDefault();const n=C$(t),s=Gb(n.id,!0),{derivedPanelConstraints:a,layout:i,separatorToPanels:l}=s,c=n.separators.find(h=>h.element===t);ja(c,"Matching separator not found");const u=l.get(c);ja(u,"Matching panels not found");const d=u[0],f=a.find(h=>h.panelId===d.id);if(ja(f,"Panel metadata not found"),f.collapsible){const h=i[d.id],p=f.collapsedSize===h?n.mutableState.expandedPanelSizes[d.id]??f.minSize:f.collapsedSize;U0(t,p-h)}break}case"F6":{e.preventDefault();const n=C$(t).separators.map(i=>i.element),s=Array.from(n).findIndex(i=>i===e.currentTarget);ja(s!==null,"Index not found");const a=e.shiftKey?s>0?s-1:n.length-1:s+1<n.length?s+1:0;n[a].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),U0(t,-100);break}}}let Xk={cursorFlags:0,state:"inactive"};const Fpe=new Mct;function IS(){return Xk}function LMr(e){return Fpe.addListener("change",e)}function $Mr(e){const t=Xk,r={...Xk};r.cursorFlags=e,Xk=r,Fpe.emit("change",{prev:t,next:r})}function Kk(e){const t=Xk;Xk=e,Fpe.emit("change",{prev:t,next:e})}function EIe(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=m1(),r=$pe(e,t),n=new Map;let s=!1;r.forEach(a=>{a.separator&&(s||(s=!0,a.separator.element.focus({preventScroll:!0})));const i=t.get(a.group);i&&n.set(a.group,i.layout)}),Kk({cursorFlags:0,hitRegions:r,initialLayoutMap:n,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),r.length&&e.preventDefault()}const FMr=e=>e,tQ=()=>{},zct=1,Bct=2,Uct=4,Vct=8,CIe=3,jIe=12;let ZD;function TIe(){return ZD===void 0&&(ZD=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(ZD=!0)),ZD}function zMr({cursorFlags:e,groups:t,state:r}){let n=0,s=0;switch(r){case"active":case"hover":t.forEach(a=>{if(!a.mutableState.disableCursor)switch(a.orientation){case"horizontal":{n++;break}case"vertical":{s++;break}}})}if(!(n===0&&s===0)){switch(r){case"active":{if(e&&TIe()){const a=(e&zct)!==0,i=(e&Bct)!==0,l=(e&Uct)!==0,c=(e&Vct)!==0;if(a)return l?"se-resize":c?"ne-resize":"e-resize";if(i)return l?"sw-resize":c?"nw-resize":"w-resize";if(l)return"s-resize";if(c)return"n-resize"}break}}return TIe()?n>0&&s>0?"move":n>0?"ew-resize":"ns-resize":n>0&&s>0?"grab":n>0?"col-resize":"row-resize"}}const NIe=new WeakMap;function zpe(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:r}=NIe.get(e)??{};r===void 0&&(r=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(r));const n=IS();switch(n.state){case"active":case"hover":{const s=zMr({cursorFlags:n.cursorFlags,groups:n.hitRegions.map(i=>i.group),state:n.state}),a=`*, *:hover {cursor: ${s} !important; }`;if(t===a)return;t=a,s?r.cssRules.length===0?r.insertRule(a):r.replaceSync(a):r.cssRules.length===1&&r.deleteRule(0);break}case"inactive":{t=void 0,r.cssRules.length===1&&r.deleteRule(0);break}}NIe.set(e,{prevStyle:t,styleSheet:r})}function qct({document:e,event:t,hitRegions:r,initialLayoutMap:n,mountedGroups:s,pointerDownAtPoint:a,prevCursorFlags:i}){let l=0;r.forEach(u=>{const{group:d,groupSize:f}=u,{orientation:h,panels:p}=d,{disableCursor:m}=d.mutableState;let g=0;a?h==="horizontal"?g=(t.clientX-a.x)/f*100:g=(t.clientY-a.y)/f*100:h==="horizontal"?g=t.clientX<0?-100:100:g=t.clientY<0?-100:100;const y=n.get(d),x=s.get(d);if(!y||!x)return;const{defaultLayoutDeferred:w,derivedPanelConstraints:S,groupSize:k,layout:_,separatorToPanels:E}=x;if(S&&_&&E){const T=cI({delta:g,initialLayout:y,panelConstraints:S,pivotIndices:u.panels.map(j=>p.indexOf(j)),prevLayout:_,trigger:"mouse-or-touch"});if(NS(T,_)){if(g!==0&&!m)switch(h){case"horizontal":{l|=g<0?zct:Bct;break}case"vertical":{l|=g<0?Uct:Vct;break}}}else Jy(u.group,{defaultLayoutDeferred:w,derivedPanelConstraints:S,groupSize:k,layout:T,separatorToPanels:E})}});let c=0;t.movementX===0?c|=i&CIe:c|=l&CIe,t.movementY===0?c|=i&jIe:c|=l&jIe,$Mr(c),zpe(e)}function AIe(e){const t=m1(),r=IS();r.state==="active"&&qct({document:e.currentTarget,event:e,hitRegions:r.hitRegions,initialLayoutMap:r.initialLayoutMap,mountedGroups:t,prevCursorFlags:r.cursorFlags})}function IIe(e){if(e.defaultPrevented)return;const t=IS(),r=m1();switch(t.state){case"active":{if(e.buttons===0){Kk({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(n=>{const s=Gb(n.group.id,!0);Jy(n.group,s)});return}qct({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:r,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const n=$pe(e,r);n.length===0?t.state!=="inactive"&&Kk({cursorFlags:0,state:"inactive"}):Kk({cursorFlags:0,hitRegions:n,state:"hover"}),zpe(e.currentTarget);break}}}function RIe(e){e.relatedTarget instanceof HTMLIFrameElement&&IS().state==="hover"&&Kk({cursorFlags:0,state:"inactive"})}function PIe(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=IS();t.state==="active"&&(Kk({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(zpe(e.currentTarget),t.hitRegions.forEach(r=>{const n=Gb(r.group.id,!0);Jy(r.group,n)}),e.preventDefault()))}function MIe(e){let t=0,r=0;const n={};for(const a of e)if(a.defaultSize!==void 0){t++;const i=zu(a.defaultSize);r+=i,n[a.panelId]=i}else n[a.panelId]=void 0;const s=e.length-t;if(s!==0){const a=zu((100-r)/s);for(const i of e)i.defaultSize===void 0&&(n[i.panelId]=a)}return n}function BMr(e,t,r){if(!r[0])return;const n=e.panels.find(c=>c.element===t);if(!n||!n.onResize)return;const s=Z_({group:e}),a=e.orientation==="horizontal"?n.element.offsetWidth:n.element.offsetHeight,i=n.mutableValues.prevSize,l={asPercentage:zu(a/s*100),inPixels:a};n.mutableValues.prevSize=l,n.onResize(l,n.id,i)}function UMr(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function VMr({group:e,nextGroupSize:t,prevGroupSize:r,prevLayout:n}){if(r<=0||t<=0||r===t)return n;let s=0,a=0,i=!1;const l=new Map,c=[];for(const f of e.panels){const h=n[f.id]??0;if(f.panelConstraints.groupResizeBehavior==="preserve-pixel-size"){i=!0;const p=h/100*r,m=zu(p/t*100);l.set(f.id,m),s+=m}else c.push(f.id),a+=h}if(!i||c.length===0)return n;const u=100-s,d={...n};if(l.forEach((f,h)=>{d[h]=f}),a>0)for(const f of c){const h=n[f]??0;d[f]=zu(h/a*u)}else{const f=zu(u/c.length);for(const h of c)d[h]=f}return d}function qMr(e,t){const r=e.map(s=>s.id),n=Object.keys(t);if(r.length!==n.length)return!1;for(const s of r)if(!n.includes(s))return!1;return!0}const OO=new Map;function HMr(e){let t=!0;ja(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const r=e.element.ownerDocument.defaultView.ResizeObserver,n=new Set,s=new Set,a=new r(m=>{for(const g of m){const{borderBoxSize:y,target:x}=g;if(x===e.element){if(t){const w=Z_({group:e});if(w===0)return;const S=Gb(e.id);if(!S)return;const k=Jae(e),_=S.defaultLayoutDeferred?MIe(k):S.layout,E=VMr({group:e,nextGroupSize:w,prevGroupSize:S.groupSize,prevLayout:_}),T=AS({layout:E,panelConstraints:k});if(!S.defaultLayoutDeferred&&NS(S.layout,T)&&UMr(S.derivedPanelConstraints,k)&&S.groupSize===w)return;Jy(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:k,groupSize:w,layout:T,separatorToPanels:S.separatorToPanels})}}else BMr(e,x,y)}});a.observe(e.element),e.panels.forEach(m=>{ja(!n.has(m.id),`Panel ids must be unique; id "${m.id}" was used more than once`),n.add(m.id),m.onResize&&a.observe(m.element)});const i=Z_({group:e}),l=Jae(e),c=e.panels.map(({id:m})=>m).join(",");let u=e.mutableState.defaultLayout;u&&(qMr(e.panels,u)||(u=void 0));const d=e.mutableState.layouts[c]??u??MIe(l),f=AS({layout:d,panelConstraints:l}),h=e.element.ownerDocument;OO.set(h,(OO.get(h)??0)+1);const p=new Map;return Pct(e).forEach(m=>{m.separator&&p.set(m.separator,m.panels)}),Jy(e,{defaultLayoutDeferred:i===0,derivedPanelConstraints:l,groupSize:i,layout:f,separatorToPanels:p}),e.separators.forEach(m=>{ja(!s.has(m.id),`Separator ids must be unique; id "${m.id}" was used more than once`),s.add(m.id),m.element.addEventListener("keydown",_Ie)}),OO.get(h)===1&&(h.addEventListener("dblclick",kIe,!0),h.addEventListener("pointerdown",EIe,!0),h.addEventListener("pointerleave",AIe),h.addEventListener("pointermove",IIe),h.addEventListener("pointerout",RIe),h.addEventListener("pointerup",PIe,!0)),function(){t=!1,OO.set(h,Math.max(0,(OO.get(h)??0)-1)),CMr(e),e.separators.forEach(m=>{m.element.removeEventListener("keydown",_Ie)}),OO.get(h)||(h.removeEventListener("dblclick",kIe,!0),h.removeEventListener("pointerdown",EIe,!0),h.removeEventListener("pointerleave",AIe),h.removeEventListener("pointermove",IIe),h.removeEventListener("pointerout",RIe),h.removeEventListener("pointerup",PIe,!0)),a.disconnect()}}function QMr(){const[e,t]=b.useState({}),r=b.useCallback(()=>t({}),[]);return[e,r]}function Bpe(e){const t=b.useId();return`${e??t}`}const g1=typeof window<"u"?b.useLayoutEffect:b.useEffect;function jN(e){const t=b.useRef(e);return g1(()=>{t.current=e},[e]),b.useCallback((...r)=>t.current?.(...r),[t])}function Upe(...e){return jN(t=>{e.forEach(r=>{if(r)switch(typeof r){case"function":{r(t);break}case"object":{r.current=t;break}}})})}function Vpe(e){const t=b.useRef({...e});return g1(()=>{for(const r in e)t.current[r]=e[r]},[e]),t.current}const Hct=b.createContext(null);function WMr(e,t){const r=b.useRef({getLayout:()=>({}),setLayout:FMr});b.useImperativeHandle(t,()=>r.current,[]),g1(()=>{Object.assign(r.current,Fct({groupId:e}))})}function C9({children:e,className:t,defaultLayout:r,disableCursor:n,disabled:s,elementRef:a,groupRef:i,id:l,onLayoutChange:c,onLayoutChanged:u,orientation:d="horizontal",resizeTargetMinimumSize:f={coarse:20,fine:10},style:h,...p}){const m=b.useRef({onLayoutChange:{},onLayoutChanged:{}}),g=jN(P=>{NS(m.current.onLayoutChange,P)||(m.current.onLayoutChange=P,c?.(P))}),y=jN(P=>{NS(m.current.onLayoutChanged,P)||(m.current.onLayoutChanged=P,u?.(P))}),x=Bpe(l),w=b.useRef(null),[S,k]=QMr(),_=b.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:f,separators:[]}),E=Upe(w,a);WMr(x,i);const T=jN((P,R)=>{const B=IS(),D=xIe(P),$=Gb(P);if($){let U=!1;return B.state==="active"&&(U=B.hitRegions.some(z=>z.group===D)),{flexGrow:$.layout[R]??1,pointerEvents:U?"none":void 0}}return{flexGrow:r?.[R]??1}}),j=Vpe({defaultLayout:r,disableCursor:n}),N=b.useMemo(()=>({get disableCursor(){return!!j.disableCursor},getPanelStyles:T,id:x,orientation:d,registerPanel:P=>{const R=_.current;return R.panels=eie(d,[...R.panels,P]),k(),()=>{R.panels=R.panels.filter(B=>B!==P),k()}},registerSeparator:P=>{const R=_.current;return R.separators=eie(d,[...R.separators,P]),k(),()=>{R.separators=R.separators.filter(B=>B!==P),k()}},togglePanelDisabled:(P,R)=>{const B=_.current.panels.find(U=>U.id===P);B&&(B.panelConstraints.disabled=R);const D=xIe(x),$=Gb(x);D&&$&&Jy(D,{...$,derivedPanelConstraints:Jae(D)})},toggleSeparatorDisabled:(P,R)=>{const B=_.current.separators.find(D=>D.id===P);B&&(B.disabled=R)}}),[T,x,k,d,j]),I=b.useRef(null);return g1(()=>{const P=w.current;if(P===null)return;const R=_.current;let B;if(j.defaultLayout!==void 0&&Object.keys(j.defaultLayout).length===R.panels.length){B={};for(const L of R.panels){const Z=j.defaultLayout[L.id];Z!==void 0&&(B[L.id]=Z)}}const D={disabled:!!s,element:P,id:x,mutableState:{defaultLayout:B,disableCursor:!!j.disableCursor,expandedPanelSizes:_.current.lastExpandedPanelSizes,layouts:_.current.layouts},orientation:d,panels:R.panels,resizeTargetMinimumSize:R.resizeTargetMinimumSize,separators:R.separators};I.current=D;const $=HMr(D),{defaultLayoutDeferred:U,derivedPanelConstraints:z,layout:H}=Gb(D.id,!0);!U&&z.length>0&&(g(H),y(H));const Q=Lpe(x,L=>{const{defaultLayoutDeferred:Z,derivedPanelConstraints:V,layout:M}=L.next;if(Z||V.length===0)return;const W=D.panels.map(({id:J})=>J).join(",");D.mutableState.layouts[W]=M,V.forEach(J=>{if(J.collapsible){const{layout:ae}=L.prev??{};if(ae){const te=qc(J.collapsedSize,M[J.panelId]),re=qc(J.collapsedSize,ae[J.panelId]);te&&!re&&(D.mutableState.expandedPanelSizes[J.panelId]=ae[J.panelId])}}});const G=IS().state!=="active";g(M),G&&y(M)});return()=>{I.current=null,$(),Q()}},[s,x,y,g,d,S,j]),b.useEffect(()=>{const P=I.current;P&&(P.mutableState.defaultLayout=r,P.mutableState.disableCursor=!!n)}),o.jsx(Hct.Provider,{value:N,children:o.jsx("div",{...p,className:t,"data-group":!0,"data-testid":x,id:x,ref:E,style:{height:"100%",width:"100%",overflow:"hidden",...h,display:"flex",flexDirection:d==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:d==="horizontal"?"pan-y":"pan-x"},children:e})})}C9.displayName="Group";function rQ(e,t){return`react-resizable-panels:${[e,...t].join(":")}`}function qpe({debounceSaveMs:e=100,panelIds:t,storage:r=localStorage,...n}){const s=t!==void 0,a="id"in n?n.id:n.groupId,i=rQ(a,t??[]),l=b.useSyncExternalStore(GMr,()=>r.getItem(i),()=>r.getItem(i)),c=b.useMemo(()=>l?JSON.parse(l):void 0,[l]),u=b.useRef(null),d=b.useCallback(()=>{const p=u.current;p&&(u.current=null,clearTimeout(p))},[]);b.useLayoutEffect(()=>()=>{d()},[d]);const f=b.useCallback(p=>{d();let m;s?m=rQ(a,Object.keys(p)):m=rQ(a,[]);try{r.setItem(m,JSON.stringify(p))}catch(g){console.error(g)}},[d,s,a,r]),h=b.useCallback(p=>{d(),e===0?f(p):u.current=setTimeout(()=>{f(p)},e)},[d,e,f]);return{defaultLayout:c,onLayoutChange:h,onLayoutChanged:f}}function GMr(){return function(){}}function Hpe(){const e=b.useContext(Hct);return ja(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function ZMr(e,t){const{id:r}=Hpe(),n=b.useRef({collapse:tQ,expand:tQ,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:tQ});b.useImperativeHandle(t,()=>n.current,[]),g1(()=>{Object.assign(n.current,$ct({groupId:r,panelId:e}))})}function Y_({children:e,className:t,collapsedSize:r="0%",collapsible:n=!1,defaultSize:s,disabled:a,elementRef:i,groupResizeBehavior:l="preserve-relative-size",id:c,maxSize:u="100%",minSize:d="0%",onResize:f,panelRef:h,style:p,...m}){const g=!!c,y=Bpe(c),x=Vpe({disabled:a}),w=b.useRef(null),S=Upe(w,i),{getPanelStyles:k,id:_,orientation:E,registerPanel:T,togglePanelDisabled:j}=Hpe(),N=f!==null,I=jN((R,B,D)=>{f?.(R,c,D)});g1(()=>{const R=w.current;if(R!==null){const B={element:R,id:y,idIsStable:g,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:N?I:void 0,panelConstraints:{groupResizeBehavior:l,collapsedSize:r,collapsible:n,defaultSize:s,disabled:x.disabled,maxSize:u,minSize:d}};return T(B)}},[l,r,n,s,N,y,g,u,d,I,T,x]),b.useEffect(()=>{j(y,!!a)},[a,y,j]),ZMr(y,h);const P=b.useSyncExternalStore(R=>Lpe(_,R),()=>JSON.stringify(k(_,y)),()=>JSON.stringify(k(_,y)));return o.jsx("div",{...m,"aria-disabled":a||void 0,"data-panel":!0,"data-testid":y,id:y,ref:S,style:{...YMr,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...JSON.parse(P)},children:o.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...p,touchAction:E==="horizontal"?"pan-y":"pan-x"},children:e})})}Y_.displayName="Panel";const YMr={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function XMr(){return b.useRef(null)}function KMr({layout:e,panelConstraints:t,panelId:r,panelIndex:n}){let s,a;const i=e[r],l=t.find(c=>c.panelId===r);if(l){const c=l.maxSize,u=l.collapsible?l.collapsedSize:l.minSize,d=[n,n+1];a=AS({layout:cI({delta:u-i,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[r],s=AS({layout:cI({delta:c-i,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[r]}return{valueControls:r,valueMax:s,valueMin:a,valueNow:i}}function Qct({children:e,className:t,disabled:r,elementRef:n,id:s,style:a,...i}){const l=Bpe(s),c=Vpe({disabled:r}),[u,d]=b.useState({}),[f,h]=b.useState("inactive"),p=b.useRef(null),m=Upe(p,n),{disableCursor:g,id:y,orientation:x,registerSeparator:w,toggleSeparatorDisabled:S}=Hpe(),k=x==="horizontal"?"vertical":"horizontal";g1(()=>{const E=p.current;if(E!==null){const T={disabled:c.disabled,element:E,id:l},j=w(T),N=LMr(P=>{h(P.next.state!=="inactive"&&P.next.hitRegions.some(R=>R.separator===T)?P.next.state:"inactive")}),I=Lpe(y,P=>{const{derivedPanelConstraints:R,layout:B,separatorToPanels:D}=P.next,$=D.get(T);if($){const U=$[0],z=$.indexOf(U);d(KMr({layout:B,panelConstraints:R,panelId:U.id,panelIndex:z}))}});return()=>{N(),I(),j()}}},[y,l,w,c]),b.useEffect(()=>{S(l,!!r)},[r,l,S]);let _;return r&&!g&&(_="not-allowed"),o.jsx("div",{...i,"aria-controls":u.valueControls,"aria-disabled":r||void 0,"aria-orientation":k,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":r?"disabled":f,"data-testid":l,id:l,ref:m,role:"separator",style:{flexBasis:"auto",cursor:_,...a,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:r?void 0:0})}Qct.displayName="Separator";const DIe=e=>{let t;const r=new Set,n=(u,d)=>{const f=typeof u=="function"?u(t):u;if(!Object.is(f,t)){const h=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),r.forEach(p=>p(t,h))}},s=()=>t,l={setState:n,getState:s,getInitialState:()=>c,subscribe:u=>(r.add(u),()=>r.delete(u))},c=t=e(n,s,l);return l},JMr=(e=>e?DIe(e):DIe),e2r=e=>e;function t2r(e,t=e2r){const r=je.useSyncExternalStore(e.subscribe,je.useCallback(()=>t(e.getState()),[e,t]),je.useCallback(()=>t(e.getInitialState()),[e,t]));return je.useDebugValue(r),r}const LIe=e=>{const t=JMr(e),r=n=>t2r(t,n);return Object.assign(r,t),r},Qpe=(e=>e?LIe(e):LIe);function r2r(e,t){let r;try{r=e()}catch{return}return{getItem:s=>{var a;const i=c=>c===null?null:JSON.parse(c,void 0),l=(a=r.getItem(s))!=null?a:null;return l instanceof Promise?l.then(i):i(l)},setItem:(s,a)=>r.setItem(s,JSON.stringify(a,void 0)),removeItem:s=>r.removeItem(s)}}const tie=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(n){return tie(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return tie(n)(r)}}}},n2r=(e,t)=>(r,n,s)=>{let a={storage:r2r(()=>window.localStorage),partialize:y=>y,version:0,merge:(y,x)=>({...x,...y}),...t},i=!1,l=0;const c=new Set,u=new Set;let d=a.storage;if(!d)return e((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),r(...y)},n,s);const f=()=>{const y=a.partialize({...n()});return d.setItem(a.name,{state:y,version:a.version})},h=s.setState;s.setState=(y,x)=>(h(y,x),f());const p=e((...y)=>(r(...y),f()),n,s);s.getInitialState=()=>p;let m;const g=()=>{var y,x;if(!d)return;const w=++l;i=!1,c.forEach(k=>{var _;return k((_=n())!=null?_:p)});const S=((x=a.onRehydrateStorage)==null?void 0:x.call(a,(y=n())!=null?y:p))||void 0;return tie(d.getItem.bind(d))(a.name).then(k=>{if(k)if(typeof k.version=="number"&&k.version!==a.version){if(a.migrate){const _=a.migrate(k.state,k.version);return _ instanceof Promise?_.then(E=>[!0,E]):[!0,_]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,k.state];return[!1,void 0]}).then(k=>{var _;if(w!==l)return;const[E,T]=k;if(m=a.merge(T,(_=n())!=null?_:p),r(m,!0),E)return f()}).then(()=>{w===l&&(S?.(n(),void 0),m=n(),i=!0,u.forEach(k=>k(m)))}).catch(k=>{w===l&&S?.(void 0,k)})};return s.persist={setOptions:y=>{a={...a,...y},y.storage&&(d=y.storage)},clearStorage:()=>{d?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>g(),hasHydrated:()=>i,onHydrate:y=>(c.add(y),()=>{c.delete(y)}),onFinishHydration:y=>(u.add(y),()=>{u.delete(y)})},a.skipHydration||g(),m||p},s2r=n2r;var y1=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(){}},a2r={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},i2r=class{#e=a2r;#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)}},Cw=new i2r;function o2r(e){setTimeout(e,0)}var RS=typeof window>"u"||"Deno"in globalThis;function ic(){}function l2r(e,t){return typeof e=="function"?e(t):e}function rie(e){return typeof e=="number"&&e>=0&&e!==1/0}function Wct(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Zb(e,t){return typeof e=="function"?e(t):e}function Yf(e,t){return typeof e=="function"?e(t):e}function $Ie(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:a,queryKey:i,stale:l}=e;if(i){if(n){if(t.queryHash!==Wpe(i,t.options))return!1}else if(!uI(t.queryKey,i))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||a&&!a(t))}function FIe(e,t){const{exact:r,status:n,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(PS(t.options.mutationKey)!==PS(a))return!1}else if(!uI(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function Wpe(e,t){return(t?.queryKeyHashFn||PS)(e)}function PS(e){return JSON.stringify(e,(t,r)=>nie(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function uI(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>uI(e[r],t[r])):!1}var c2r=Object.prototype.hasOwnProperty;function Gpe(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=zIe(e)&&zIe(t);if(!n&&!(nie(e)&&nie(t)))return t;const a=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),l=i.length,c=n?new Array(l):{};let u=0;for(let d=0;d<l;d++){const f=n?d:i[d],h=e[f],p=t[f];if(h===p){c[f]=h,(n?d<a:c2r.call(e,f))&&u++;continue}if(h===null||p===null||typeof h!="object"||typeof p!="object"){c[f]=p;continue}const m=Gpe(h,p,r+1);c[f]=m,m===h&&u++}return a===l&&u===a?e:c}function dI(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function zIe(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function nie(e){if(!BIe(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!BIe(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function BIe(e){return Object.prototype.toString.call(e)==="[object Object]"}function u2r(e){return new Promise(t=>{Cw.setTimeout(t,e)})}function sie(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?Gpe(e,t):t}function d2r(e){return e}function f2r(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function h2r(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Zpe=Symbol();function Gct(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Zpe?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ype(e,t){return typeof e=="function"?e(...t):!!e}function p2r(e,t,r){let n=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=t(),n||(n=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)}),e}var m2r=class extends y1{#e;#t;#r;constructor(){super(),this.#r=e=>{if(!RS&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=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"}},Xpe=new m2r;function aie(){let e,t;const r=new Promise((s,a)=>{e=s,t=a});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}var g2r=o2r;function y2r(){let e=[],t=0,r=l=>{l()},n=l=>{l()},s=g2r;const a=l=>{t?e.push(l):s(()=>{r(l)})},i=()=>{const l=e;e=[],l.length&&s(()=>{n(()=>{l.forEach(c=>{r(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||i()}return c},batchCalls:l=>(...c)=>{a(()=>{l(...c)})},schedule:a,setNotifyFunction:l=>{r=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{s=l}}}var Zi=y2r(),v2r=class extends y1{#e=!0;#t;#r;constructor(){super(),this.#r=e=>{if(!RS&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#e}},j5=new v2r;function b2r(e){return Math.min(1e3*2**e,3e4)}function Zct(e){return(e??"online")==="online"?j5.isOnline():!0}var iie=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Yct(e){let t=!1,r=0,n;const s=aie(),a=()=>s.status!=="pending",i=g=>{if(!a()){const y=new iie(g);h(y),e.onCancel?.(y)}},l=()=>{t=!0},c=()=>{t=!1},u=()=>Xpe.isFocused()&&(e.networkMode==="always"||j5.isOnline())&&e.canRun(),d=()=>Zct(e.networkMode)&&e.canRun(),f=g=>{a()||(n?.(),s.resolve(g))},h=g=>{a()||(n?.(),s.reject(g))},p=()=>new Promise(g=>{n=y=>{(a()||u())&&g(y)},e.onPause?.()}).then(()=>{n=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let g;const y=r===0?e.initialPromise:void 0;try{g=y??e.fn()}catch(x){g=Promise.reject(x)}Promise.resolve(g).then(f).catch(x=>{if(a())return;const w=e.retry??(RS?0:3),S=e.retryDelay??b2r,k=typeof S=="function"?S(r,x):S,_=w===!0||typeof w=="number"&&r<w||typeof w=="function"&&w(r,x);if(t||!_){h(x);return}r++,e.onFail?.(r,x),u2r(k).then(()=>u()?void 0:p()).then(()=>{t?h(x):m()})})};return{promise:s,status:()=>s.status,cancel:i,continue:()=>(n?.(),s),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?m():p().then(m),s)}}var Xct=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),rie(this.gcTime)&&(this.#e=Cw.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(RS?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Cw.clearTimeout(this.#e),this.#e=void 0)}},x2r=class extends Xct{#e;#t;#r;#s;#n;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#r=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=VIe(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=VIe(this.options);t.data!==void 0&&(this.setState(UIe(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const r=sie(this.state.data,e,this.options);return this.#i({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#i({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#n?.promise;return this.#n?.cancel(e),t?t.then(ic).catch(ic):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Yf(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Zpe||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Zb(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:!Wct(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.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.#n&&(this.#o?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#n?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(e&&this.setOptions(e),!this.options.queryFn){const l=this.observers.find(c=>c.options.queryFn);l&&this.setOptions(l.options)}const r=new AbortController,n=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(this.#o=!0,r.signal)})},s=()=>{const l=Gct(this.options,t),u=(()=>{const d={client:this.#s,queryKey:this.queryKey,meta:this.meta};return n(d),d})();return this.#o=!1,this.options.persister?this.options.persister(l,u,this):l(u)},i=(()=>{const l={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:s};return n(l),l})();this.options.behavior?.onFetch(i,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#i({type:"fetch",meta:i.fetchOptions?.meta}),this.#n=Yct({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:l=>{l instanceof iie&&l.revert&&this.setState({...this.#t,fetchStatus:"idle"}),r.abort()},onFail:(l,c)=>{this.#i({type:"failed",failureCount:l,error:c})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0});try{const l=await this.#n.start();if(l===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(l),this.#r.config.onSuccess?.(l,this),this.#r.config.onSettled?.(l,this.state.error,this),l}catch(l){if(l instanceof iie){if(l.silent)return this.#n.promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw this.#i({type:"error",error:l}),this.#r.config.onError?.(l,this),this.#r.config.onSettled?.(this.state.data,l,this),l}finally{this.scheduleGc()}}#i(e){const t=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Kct(r.data,this.options),fetchMeta:e.meta??null};case"success":const n={...r,...UIe(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case"error":const s=e.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=t(this.state),Zi.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function Kct(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Zct(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function UIe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function VIe(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var j9=class extends y1{constructor(e,t){super(),this.options=t,this.#e=e,this.#i=null,this.#o=aie(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#r=void 0;#s=void 0;#n;#a;#o;#i;#p;#d;#f;#c;#u;#l;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),qIe(this.#t,this.options)?this.#m():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return oie(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return oie(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Yf(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#t.setOptions(this.options),t._defaulted&&!dI(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const n=this.hasListeners();n&&HIe(this.#t,r,this.options,t)&&this.#m(),this.updateResult(),n&&(this.#t!==r||Yf(this.options.enabled,this.#t)!==Yf(t.enabled,this.#t)||Zb(this.options.staleTime,this.#t)!==Zb(t.staleTime,this.#t))&&this.#g();const s=this.#y();n&&(this.#t!==r||Yf(this.options.enabled,this.#t)!==Yf(t.enabled,this.#t)||s!==this.#l)&&this.#v(s)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(t,e);return S2r(this,r)&&(this.#s=r,this.#a=this.options,this.#n=this.#t.state),r}getCurrentResult(){return this.#s}trackResult(e,t){return new Proxy(e,{get:(r,n)=>(this.trackProp(n),t?.(n),n==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,n))})}trackProp(e){this.#h.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(ic)),t}#g(){this.#x();const e=Zb(this.options.staleTime,this.#t);if(RS||this.#s.isStale||!rie(e))return;const r=Wct(this.#s.dataUpdatedAt,e)+1;this.#c=Cw.setTimeout(()=>{this.#s.isStale||this.updateResult()},r)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#w(),this.#l=e,!(RS||Yf(this.options.enabled,this.#t)===!1||!rie(this.#l)||this.#l===0)&&(this.#u=Cw.setInterval(()=>{(this.options.refetchIntervalInBackground||Xpe.isFocused())&&this.#m()},this.#l))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#c&&(Cw.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(Cw.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const r=this.#t,n=this.options,s=this.#s,a=this.#n,i=this.#a,c=e!==r?e.state:this.#r,{state:u}=e;let d={...u},f=!1,h;if(t._optimisticResults){const j=this.hasListeners(),N=!j&&qIe(e,t),I=j&&HIe(e,r,t,n);(N||I)&&(d={...d,...Kct(u.data,e.options)}),t._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:p,errorUpdatedAt:m,status:g}=d;h=d.data;let y=!1;if(t.placeholderData!==void 0&&h===void 0&&g==="pending"){let j;s?.isPlaceholderData&&t.placeholderData===i?.placeholderData?(j=s.data,y=!0):j=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,j!==void 0&&(g="success",h=sie(s?.data,j,t),f=!0)}if(t.select&&h!==void 0&&!y)if(s&&h===a?.data&&t.select===this.#p)h=this.#d;else try{this.#p=t.select,h=t.select(h),h=sie(s?.data,h,t),this.#d=h,this.#i=null}catch(j){this.#i=j}this.#i&&(p=this.#i,h=this.#d,m=Date.now(),g="error");const x=d.fetchStatus==="fetching",w=g==="pending",S=g==="error",k=w&&x,_=h!==void 0,T={status:g,fetchStatus:d.fetchStatus,isPending:w,isSuccess:g==="success",isError:S,isInitialLoading:k,isLoading:k,data:h,dataUpdatedAt:d.dataUpdatedAt,error:p,errorUpdatedAt:m,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:x,isRefetching:x&&!w,isLoadingError:S&&!_,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:S&&_,isStale:Kpe(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Yf(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const j=T.data!==void 0,N=T.status==="error"&&!j,I=B=>{N?B.reject(T.error):j&&B.resolve(T.data)},P=()=>{const B=this.#o=T.promise=aie();I(B)},R=this.#o;switch(R.status){case"pending":e.queryHash===r.queryHash&&I(R);break;case"fulfilled":(N||T.data!==R.value)&&P();break;case"rejected":(!N||T.error!==R.reason)&&P();break}}return T}updateResult(){const e=this.#s,t=this.createResult(this.#t,this.options);if(this.#n=this.#t.state,this.#a=this.options,this.#n.data!==void 0&&(this.#f=this.#t),dI(t,e))return;this.#s=t;const r=()=>{if(!e)return!0;const{notifyOnChangeProps:n}=this.options,s=typeof n=="function"?n():n;if(s==="all"||!s&&!this.#h.size)return!0;const a=new Set(s??this.#h);return this.options.throwOnError&&a.add("error"),Object.keys(this.#s).some(i=>{const l=i;return this.#s[l]!==e[l]&&a.has(l)})};this.#O({listeners:r()})}#S(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#r=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#O(e){Zi.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function w2r(e,t){return Yf(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function qIe(e,t){return w2r(e,t)||e.state.data!==void 0&&oie(e,t,t.refetchOnMount)}function oie(e,t,r){if(Yf(t.enabled,e)!==!1&&Zb(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Kpe(e,t)}return!1}function HIe(e,t,r,n){return(e!==t||Yf(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Kpe(e,r)}function Kpe(e,t){return Yf(t.enabled,e)!==!1&&e.isStaleByTime(Zb(t.staleTime,e))}function S2r(e,t){return!dI(e.getCurrentResult(),t)}function T5(e){return{onFetch:(t,r)=>{const n=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],i=t.state.data?.pageParams||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let d=!1;const f=m=>{p2r(m,()=>t.signal,()=>d=!0)},h=Gct(t.options,t.fetchOptions),p=async(m,g,y)=>{if(d)return Promise.reject();if(g==null&&m.pages.length)return Promise.resolve(m);const w=(()=>{const E={client:t.client,queryKey:t.queryKey,pageParam:g,direction:y?"backward":"forward",meta:t.options.meta};return f(E),E})(),S=await h(w),{maxPages:k}=t.options,_=y?h2r:f2r;return{pages:_(m.pages,S,k),pageParams:_(m.pageParams,g,k)}};if(s&&a.length){const m=s==="backward",g=m?Jct:lie,y={pages:a,pageParams:i},x=g(n,y);l=await p(y,x,m)}else{const m=e??a.length;do{const g=c===0?i[0]??n.initialPageParam:lie(n,l);if(c>0&&g==null)break;l=await p(l,g),c++}while(c<m)}return l};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=u}}}function lie(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function Jct(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}function O2r(e,t){return t?lie(e,t)!=null:!1}function k2r(e,t){return!t||!e.getPreviousPageParam?!1:Jct(e,t)!=null}var _2r=class extends j9{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:T5()})}getOptimisticResult(e){return e.behavior=T5(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:r}=e,n=super.createResult(e,t),{isFetching:s,isRefetching:a,isError:i,isRefetchError:l}=n,c=r.fetchMeta?.fetchMore?.direction,u=i&&c==="forward",d=s&&c==="forward",f=i&&c==="backward",h=s&&c==="backward";return{...n,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:O2r(t,r.data),hasPreviousPage:k2r(t,r.data),isFetchNextPageError:u,isFetchingNextPage:d,isFetchPreviousPageError:f,isFetchingPreviousPage:h,isRefetchError:l&&!u&&!f,isRefetching:a&&!d&&!h}}},E2r=class extends Xct{#e;#t;#r;#s;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#r=e.mutationCache,this.#t=[],this.state=e.state||eut(),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.#r.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#r.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#n({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=Yct({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(a,i)=>{this.#n({type:"failed",failureCount:a,error:i})},onPause:()=>{this.#n({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#r.canRun(this)});const n=this.state.status==="pending",s=!this.#s.canStart();try{if(n)t();else{this.#n({type:"pending",variables:e,isPaused:s}),this.#r.config.onMutate&&await this.#r.config.onMutate(e,this,r);const i=await this.options.onMutate?.(e,r);i!==this.state.context&&this.#n({type:"pending",context:i,variables:e,isPaused:s})}const a=await this.#s.start();return await this.#r.config.onSuccess?.(a,e,this.state.context,this,r),await this.options.onSuccess?.(a,e,this.state.context,r),await this.#r.config.onSettled?.(a,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(a,null,e,this.state.context,r),this.#n({type:"success",data:a}),a}catch(a){try{await this.#r.config.onError?.(a,e,this.state.context,this,r)}catch(i){Promise.reject(i)}try{await this.options.onError?.(a,e,this.state.context,r)}catch(i){Promise.reject(i)}try{await this.#r.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,r)}catch(i){Promise.reject(i)}try{await this.options.onSettled?.(void 0,a,e,this.state.context,r)}catch(i){Promise.reject(i)}throw this.#n({type:"error",error:a}),a}finally{this.#r.runNext(this)}}#n(e){const t=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,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{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Zi.batch(()=>{this.#t.forEach(r=>{r.onMutationUpdate(e)}),this.#r.notify({mutation:this,type:"updated",action:e})})}};function eut(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var C2r=class extends y1{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#r=0}#e;#t;#r;build(e,t,r){const n=new E2r({client:e,mutationCache:this,mutationId:++this.#r,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#e.add(e);const t=YD(e);if(typeof t=="string"){const r=this.#t.get(t);r?r.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=YD(e);if(typeof t=="string"){const r=this.#t.get(t);if(r)if(r.length>1){const n=r.indexOf(e);n!==-1&&r.splice(n,1)}else r[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=YD(e);if(typeof t=="string"){const n=this.#t.get(t)?.find(s=>s.state.status==="pending");return!n||n===e}else return!0}runNext(e){const t=YD(e);return typeof t=="string"?this.#t.get(t)?.find(n=>n!==e&&n.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Zi.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(r=>FIe(t,r))}findAll(e={}){return this.getAll().filter(t=>FIe(e,t))}notify(e){Zi.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Zi.batch(()=>Promise.all(e.map(t=>t.continue().catch(ic))))}};function YD(e){return e.options.scope?.id}var j2r=class extends y1{#e;#t=void 0;#r;#s;constructor(t,r){super(),this.#e=t,this.setOptions(r),this.bindMethods(),this.#n()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const r=this.options;this.options=this.#e.defaultMutationOptions(t),dI(this.options,r)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),r?.mutationKey&&this.options.mutationKey&&PS(r.mutationKey)!==PS(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(t){this.#n(),this.#a(t)}getCurrentResult(){return this.#t}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#n(),this.#a()}mutate(t,r){return this.#s=r,this.#r?.removeObserver(this),this.#r=this.#e.getMutationCache().build(this.#e,this.options),this.#r.addObserver(this),this.#r.execute(t)}#n(){const t=this.#r?.state??eut();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#a(t){Zi.batch(()=>{if(this.#s&&this.hasListeners()){const r=this.#t.variables,n=this.#t.context,s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#s.onSuccess?.(t.data,r,n,s)}catch(a){Promise.reject(a)}try{this.#s.onSettled?.(t.data,null,r,n,s)}catch(a){Promise.reject(a)}}else if(t?.type==="error"){try{this.#s.onError?.(t.error,r,n,s)}catch(a){Promise.reject(a)}try{this.#s.onSettled?.(void 0,t.error,r,n,s)}catch(a){Promise.reject(a)}}}this.listeners.forEach(r=>{r(this.#t)})})}};function QIe(e,t){const r=new Set(t);return e.filter(n=>!r.has(n))}function T2r(e,t,r){const n=e.slice(0);return n[t]=r,n}var N2r=class extends y1{#e;#t;#r;#s;#n;#a;#o;#i;#p;#d=[];constructor(e,t,r){super(),this.#e=e,this.#s=r,this.#r=[],this.#n=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#n.forEach(e=>{e.subscribe(t=>{this.#l(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#n.forEach(e=>{e.destroy()})}setQueries(e,t){this.#r=e,this.#s=t,Zi.batch(()=>{const r=this.#n,n=this.#u(this.#r);n.forEach(d=>d.observer.setOptions(d.defaultedQueryOptions));const s=n.map(d=>d.observer),a=s.map(d=>d.getCurrentResult()),i=r.length!==s.length,l=s.some((d,f)=>d!==r[f]),c=i||l,u=c?!0:a.some((d,f)=>{const h=this.#t[f];return!h||!dI(d,h)});!c&&!u||(c&&(this.#d=n,this.#n=s),this.#t=a,this.hasListeners()&&(c&&(QIe(r,s).forEach(d=>{d.destroy()}),QIe(s,r).forEach(d=>{d.subscribe(f=>{this.#l(d,f)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#n.map(e=>e.getCurrentQuery())}getObservers(){return this.#n}getOptimisticResult(e,t){const r=this.#u(e),n=r.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),s=r.map(a=>a.defaultedQueryOptions.queryHash);return[n,a=>this.#c(a??n,t,s),()=>this.#f(n,r)]}#f(e,t){return t.map((r,n)=>{const s=e[n];return r.defaultedQueryOptions.notifyOnChangeProps?s:r.observer.trackResult(s,a=>{t.forEach(i=>{i.observer.trackProp(a)})})})}#c(e,t,r){if(t){const n=this.#p,s=r!==void 0&&n!==void 0&&(n.length!==r.length||r.some((a,i)=>a!==n[i]));return(!this.#a||this.#t!==this.#i||s||t!==this.#o)&&(this.#o=t,this.#i=this.#t,r!==void 0&&(this.#p=r),this.#a=Gpe(this.#a,t(e))),this.#a}return e}#u(e){const t=new Map;this.#n.forEach(n=>{const s=n.options.queryHash;if(!s)return;const a=t.get(s);a?a.push(n):t.set(s,[n])});const r=[];return e.forEach(n=>{const s=this.#e.defaultQueryOptions(n),i=t.get(s.queryHash)?.shift()??new j9(this.#e,s);r.push({defaultedQueryOptions:s,observer:i})}),r}#l(e,t){const r=this.#n.indexOf(e);r!==-1&&(this.#t=T2r(this.#t,r,t),this.#h())}#h(){if(this.hasListeners()){const e=this.#a,t=this.#f(this.#t,this.#d),r=this.#c(t,this.#s?.combine);e!==r&&Zi.batch(()=>{this.listeners.forEach(n=>{n(this.#t)})})}}},A2r=class extends y1{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){const n=t.queryKey,s=t.queryHash??Wpe(n,t);let a=this.get(s);return a||(a=new x2r({client:e,queryKey:n,queryHash:s,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(n)}),this.add(a)),a}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(){Zi.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(r=>$Ie(t,r))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(r=>$Ie(e,r)):t}notify(e){Zi.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Zi.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Zi.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},I2r=class{#e;#t;#r;#s;#n;#a;#o;#i;constructor(e={}){this.#e=e.queryCache||new A2r,this.#t=e.mutationCache||new C2r,this.#r=e.defaultOptions||{},this.#s=new Map,this.#n=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Xpe.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=j5.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=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),r=this.#e.build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Zb(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),a=this.#e.get(n.queryHash)?.state.data,i=l2r(t,a);if(i!==void 0)return this.#e.build(this,n).setData(i,{...r,manual:!0})}setQueriesData(e,t,r){return Zi.batch(()=>this.#e.findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Zi.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=this.#e;return Zi.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Zi.batch(()=>this.#e.findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(ic).catch(ic)}invalidateQueries(e,t={}){return Zi.batch(()=>(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Zi.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let a=s.fetch(void 0,r);return r.throwOnError||(a=a.catch(ic)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(ic)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=this.#e.build(this,t);return r.isStaleByTime(Zb(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ic).catch(ic)}fetchInfiniteQuery(e){return e.behavior=T5(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ic).catch(ic)}ensureInfiniteQueryData(e){return e.behavior=T5(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return j5.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#r}setDefaultOptions(e){this.#r=e}setQueryDefaults(e,t){this.#s.set(PS(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],r={};return t.forEach(n=>{uI(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){this.#n.set(PS(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#n.values()],r={};return t.forEach(n=>{uI(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#r.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Wpe(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===Zpe&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#r.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},tut=b.createContext(void 0),wa=e=>{const t=b.useContext(tut);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},R2r=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),o.jsx(tut.Provider,{value:e,children:t})),rut=b.createContext(!1),nut=()=>b.useContext(rut);rut.Provider;function P2r(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var M2r=b.createContext(P2r()),sut=()=>b.useContext(M2r),aut=(e,t,r)=>{const n=r?.state.error&&typeof e.throwOnError=="function"?Ype(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},iut=e=>{b.useEffect(()=>{e.clearReset()},[e])},out=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||Ype(r,[e.error,n])),lut=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...s)=>r(n(...s)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},D2r=(e,t)=>e.isLoading&&e.isFetching&&!t,cie=(e,t)=>e?.suspense&&t.isPending,uie=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function L2r({queries:e,...t},r){const n=wa(),s=nut(),a=sut(),i=b.useMemo(()=>e.map(g=>{const y=n.defaultQueryOptions(g);return y._optimisticResults=s?"isRestoring":"optimistic",y}),[e,n,s]);i.forEach(g=>{lut(g);const y=n.getQueryCache().get(g.queryHash);aut(g,a,y)}),iut(a);const[l]=b.useState(()=>new N2r(n,i,t)),[c,u,d]=l.getOptimisticResult(i,t.combine),f=!s&&t.subscribed!==!1;b.useSyncExternalStore(b.useCallback(g=>f?l.subscribe(Zi.batchCalls(g)):ic,[l,f]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),b.useEffect(()=>{l.setQueries(i,t)},[i,t,l]);const p=c.some((g,y)=>cie(i[y],g))?c.flatMap((g,y)=>{const x=i[y];if(x&&cie(x,g)){const w=new j9(n,x);return uie(x,w,a)}return[]}):[];if(p.length>0)throw Promise.all(p);const m=c.find((g,y)=>{const x=i[y];return x&&out({result:g,errorResetBoundary:a,throwOnError:x.throwOnError,query:n.getQueryCache().get(x.queryHash),suspense:x.suspense})});if(m?.error)throw m.error;return u(d())}function cut(e,t,r){const n=nut(),s=sut(),a=wa(),i=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(i);const l=a.getQueryCache().get(i.queryHash);i._optimisticResults=n?"isRestoring":"optimistic",lut(i),aut(i,s,l),iut(s);const c=!a.getQueryCache().get(i.queryHash),[u]=b.useState(()=>new t(a,i)),d=u.getOptimisticResult(i),f=!n&&e.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(h=>{const p=f?u.subscribe(Zi.batchCalls(h)):ic;return u.updateResult(),p},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),b.useEffect(()=>{u.setOptions(i)},[i,u]),cie(i,d))throw uie(i,u,s);if(out({result:d,errorResetBoundary:s,throwOnError:i.throwOnError,query:l,suspense:i.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(i,d),i.experimental_prefetchInRender&&!RS&&D2r(d,n)&&(c?uie(i,u,s):l?.promise)?.catch(ic).finally(()=>{u.updateResult()}),i.notifyOnChangeProps?d:u.trackResult(d)}function kt(e,t){return cut(e,j9)}function Kr(e,t){const r=wa(),[n]=b.useState(()=>new j2r(r,e));b.useEffect(()=>{n.setOptions(e)},[n,e]);const s=b.useSyncExternalStore(b.useCallback(i=>n.subscribe(Zi.batchCalls(i)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),a=b.useCallback((i,l)=>{n.mutate(i,l).catch(ic)},[n]);if(s.error&&Ype(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}function s0(e,t){return cut(e,_2r)}var Do=(e=>(e.AGENT="agent",e.SCORER="scorer",e.RAG_INGESTION="rag_ingestion",e.TRAJECTORY="trajectory",e.INPUT_PROCESSOR="input_processor",e.INPUT_STEP_PROCESSOR="input_step_processor",e.OUTPUT_PROCESSOR="output_processor",e.OUTPUT_STEP_PROCESSOR="output_step_processor",e.WORKFLOW_STEP="workflow_step",e.TOOL="tool",e.WORKFLOW_RUN="workflow_run",e.MEMORY="memory",e))(Do||{});XS().describe("Database record creation time");var $2r=XS().describe("Database record last update time");$2r.nullable();var T9=_e({page:rSe().int().min(0).optional().default(0).describe("Zero-indexed page number"),perPage:rSe().int().min(1).max(100).optional().default(10).describe("Number of items per page")}).describe("Pagination options for list queries"),N9=_e({total:St().describe("Total number of items available"),page:St().describe("Current page"),perPage:Hr([St(),Bt(!1)]).describe("Number of items per page, or false if pagination is disabled"),hasMore:yo().describe("True if more pages are available")}),F2r=_e({start:nSe().optional().describe("Start of date range (inclusive by default)"),end:nSe().optional().describe("End of date range (inclusive by default)"),startExclusive:yo().optional().describe("When true, excludes the start date from results (uses > instead of >=)"),endExclusive:yo().optional().describe("When true, excludes the end date from results (uses < instead of <=)")}).describe("Date range filter for timestamps"),A9=So(["ASC","DESC"]).describe("Sort direction: 'ASC' | 'DESC'"),wg=So(["sum","avg","min","max","count","last"]).describe("Aggregation function"),v1=So(["1m","5m","15m","1h","1d"]).describe("Time bucket interval"),Jpe=So(["previous_period","previous_day","previous_week"]).describe("Comparison period for aggregate queries"),b1=Et(pe()).min(1).describe("Fields to group by"),eme=Et(St().min(0).max(1)).min(1).describe("Percentile values (0-1)"),tme={value:St().nullable().describe("Aggregated value"),previousValue:St().nullable().optional().describe("Value from comparison period"),changePercent:St().nullable().optional().describe("Percentage change from comparison period")},rme=Ws(pe(),pe().nullable()).describe("Dimension values for this group"),cC=St().describe("Aggregated value"),uC=XS().describe("Bucket timestamp"),nme=St().describe("Percentile value"),sme=St().describe("Percentile value at this bucket"),dC=Kle(Do).describe("Entity type (e.g., 'agent' | 'processor' | 'tool' | 'workflow')"),z2r=pe().describe('ID of the entity (e.g., "weatherAgent", "orderWorkflow")'),uut=pe().describe("Name of the entity"),dut=pe().describe("Human end-user who triggered execution"),fut=pe().describe("Multi-tenant organization/account"),hut=pe().describe("Broader resource context (Mastra memory compatibility)"),put=pe().describe("Unique execution run identifier"),mut=pe().describe("Session identifier for grouping traces"),gut=pe().describe("Conversation thread identifier"),yut=pe().describe("HTTP request ID for log correlation"),vut=pe().describe('Environment (e.g., "production" | "staging" | "development")'),B2r=pe().describe('Source of execution (e.g., "local" | "cloud" | "ci")'),but=pe().describe('Source of execution (e.g., "local" | "cloud" | "ci")'),xut=pe().describe("Name of the service"),wut=Kle(Do).describe("Entity type of the parent entity"),U2r=pe().describe("ID of the parent entity"),Sut=pe().describe("Name of the parent entity"),Out=Kle(Do).describe("Entity type of the root entity"),V2r=pe().describe("ID of the root entity"),kut=pe().describe("Name of the root entity"),_ut=pe().describe("Version ID of the entity that produced this signal (e.g., agent version, workflow version)"),Eut=pe().describe("Version ID of the parent entity that produced this signal"),Cut=pe().describe("Version ID of the root entity that produced this signal"),I9=pe().describe("Experiment or eval run identifier"),q2r=Ws(pe(),Ia()).describe('Arbitrary package/app version info (e.g., {"core": "1.0.0", "memory": "1.0.0", "gitSha": "abcd1234"})'),jut=Ws(pe(),Ia()).describe("User-defined metadata for custom filtering"),Tut=Et(pe()).describe("Labels for filtering"),H2r={entityType:dC.nullish(),entityId:z2r.nullish(),entityName:uut.nullish(),parentEntityType:wut.nullish(),parentEntityId:U2r.nullish(),parentEntityName:Sut.nullish(),rootEntityType:Out.nullish(),rootEntityId:V2r.nullish(),rootEntityName:kut.nullish(),userId:dut.nullish(),organizationId:fut.nullish(),resourceId:hut.nullish(),runId:put.nullish(),sessionId:mut.nullish(),threadId:gut.nullish(),requestId:yut.nullish(),environment:vut.nullish(),serviceName:xut.nullish(),scope:q2r.nullish(),entityVersionId:_ut.nullish(),parentEntityVersionId:Eut.nullish(),rootEntityVersionId:Cut.nullish(),experimentId:I9.nullish()},R9={...H2r,executionSource:but.nullish(),tags:Tut.nullish()};B2r.nullish();var P9={timestamp:F2r.optional().describe("Filter by timestamp range"),traceId:pe().optional().describe("Filter by trace ID"),spanId:pe().optional().describe("Filter by span ID"),entityType:dC.optional(),entityName:uut.optional(),entityVersionId:_ut.optional(),parentEntityVersionId:Eut.optional(),rootEntityVersionId:Cut.optional(),userId:dut.optional(),organizationId:fut.optional(),experimentId:I9.optional(),serviceName:xut.optional(),environment:vut.optional(),parentEntityType:wut.optional(),parentEntityName:Sut.optional(),rootEntityType:Out.optional(),rootEntityName:kut.optional(),resourceId:hut.optional(),runId:put.optional(),sessionId:mut.optional(),threadId:gut.optional(),requestId:yut.optional(),executionSource:but.optional(),tags:Et(pe()).optional().describe("Filter by tags (must have all specified tags)")},M9=pe().describe("Unique trace identifier"),D9=pe().describe("Unique span identifier within a trace"),N5=So(["debug","info","warn","error","fatal"]),Nut=pe().describe("Log message"),Aut=Ws(pe(),Ia()).describe("Structured data attached to the log"),Iut=_e({logId:pe().nullish().describe("Unique id for this log event"),timestamp:XS().describe("When the log was created"),level:N5.describe("Log severity level"),message:Nut,data:Aut.nullish(),traceId:M9.nullish(),spanId:D9.nullish(),...R9,source:pe().nullish().describe("Execution source"),metadata:jut.nullish()}).describe("Log record as stored in the database");_e({level:N5,message:Nut,data:Aut.optional(),tags:Tut.optional()}).describe("User-provided log input");var Q2r=Iut;_e({logs:Et(Q2r)}).describe("Arguments for batch creating logs");var W2r=_e({...P9,source:pe().optional().describe("Filter by execution source"),level:Hr([N5,Et(N5)]).optional().describe("Filter by log level(s)")}).describe("Filters for querying logs"),G2r=So(["timestamp"]).describe("Field to order by: 'timestamp'"),Z2r=_e({field:G2r.default("timestamp").describe("Field to order by"),direction:A9.default("DESC").describe("Sort direction")}).describe("Order by configuration");_e({filters:W2r.optional().describe("Optional filters to apply"),pagination:T9.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:Z2r.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing logs");_e({pagination:N9,logs:Et(Iut)});var fC=pe().describe("Identifier of the scorer (e.g., relevance, accuracy)"),Rut=pe().describe("Display name of the scorer"),Put=pe().describe("Version of the scorer"),ng=pe().describe("How the score was produced (e.g., manual, automated, experiment)"),Mut=St().describe("Score value (range defined by scorer)"),Dut=pe().describe("Explanation for the score"),Lut=_e({scoreId:pe().nullish().describe("Unique id for this score event"),timestamp:XS().describe("When the score was recorded"),traceId:M9.nullish().describe("Trace that anchors the scored target when available"),spanId:D9.nullish().describe("Span ID this score applies to"),scorerId:fC,scorerName:Rut.nullish(),scorerVersion:Put.nullish(),scoreSource:ng.nullish(),source:ng.nullish(),score:Mut,reason:Dut.nullish(),...R9,scoreTraceId:pe().nullish().describe("Trace ID of the scoring run for debugging score generation"),metadata:Ws(pe(),Ia()).nullish().describe("User-defined metadata")}).describe("Score record as stored in the database");_e({scorerId:fC,scorerName:Rut.optional(),scorerVersion:Put.optional(),scoreSource:ng.optional(),source:ng.optional(),score:Mut,reason:Dut.optional(),metadata:Ws(pe(),Ia()).optional().describe("Additional scorer-specific metadata"),experimentId:I9.optional(),scoreTraceId:pe().optional().describe("Trace ID of the scoring run for debugging score generation"),targetEntityType:dC.optional().describe("Entity type the scorer evaluated when known")}).describe("User-provided score input");var ame=Lut;_e({score:ame}).describe("Arguments for creating a score");_e({score:ame.omit({timestamp:!0})}).describe("Arguments for creating a score");_e({success:yo()}).describe("Response from creating a score");_e({scores:Et(ame)}).describe("Arguments for batch recording scores");var IP=_e({...P9,scorerId:Hr([pe(),Et(pe())]).optional().describe("Filter by scorer ID(s)"),scoreSource:ng.optional().describe("Filter by how the score was produced"),source:ng.optional().describe("Filter by how the score was produced")}).describe("Filters for querying scores"),Y2r=So(["timestamp","score"]).describe("Field to order by: 'timestamp' | 'score'"),X2r=_e({field:Y2r.default("timestamp").describe("Field to order by"),direction:A9.default("DESC").describe("Sort direction")}).describe("Order by configuration");_e({filters:IP.optional(),pagination:T9.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:X2r.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing scores");_e({pagination:N9,scores:Et(Lut)});_e({scorerId:fC,scoreSource:ng.optional(),aggregation:wg,filters:IP.optional(),comparePeriod:Jpe.optional()}).describe("Arguments for getting a score aggregate");_e(tme);_e({scorerId:fC,scoreSource:ng.optional(),groupBy:b1,aggregation:wg,filters:IP.optional()}).describe("Arguments for getting a score breakdown");_e({groups:Et(_e({dimensions:rme,value:cC}))});_e({scorerId:fC,scoreSource:ng.optional(),interval:v1,aggregation:wg,filters:IP.optional(),groupBy:b1.optional()}).describe("Arguments for getting score time series");_e({series:Et(_e({name:pe().describe("Series name (scorer ID or group key)"),points:Et(_e({timestamp:uC,value:cC}))}))});_e({scorerId:fC,scoreSource:ng.optional(),percentiles:eme,interval:v1,filters:IP.optional()}).describe("Arguments for getting score percentiles");_e({series:Et(_e({percentile:nme,points:Et(_e({timestamp:uC,value:sme}))}))});var sg=pe().describe("Source of feedback (e.g., 'user', 'system', 'manual')"),hC=pe().describe("Type of feedback (e.g., 'thumbs', 'rating', 'correction')"),$ut=Hr([St(),pe()]).describe("Feedback value (rating number or correction text)"),Fut=pe().describe("Additional comment or context"),A5=pe().describe("User who provided the feedback");function ime(e){if(!e||typeof e!="object"||Array.isArray(e))return e;const t={...e};return typeof t.userId=="string"&&t.feedbackUserId==null&&(t.feedbackUserId=t.userId,delete t.userId),t}var L9=_e({feedbackId:pe().nullish().describe("Unique id for this feedback event"),timestamp:XS().describe("When the feedback was recorded"),traceId:M9.nullish().describe("Trace that anchors the feedback target when available"),spanId:D9.nullish().describe("Span ID this feedback applies to"),feedbackSource:sg.nullish(),source:sg.nullish(),feedbackType:hC,value:$ut,comment:Fut.nullish(),feedbackUserId:A5.nullish(),...R9,sourceId:pe().nullish().describe("ID of the source record this feedback is linked to (e.g. experiment result ID)"),metadata:Ws(pe(),Ia()).nullish().describe("User-defined metadata")}),K2r=_e(L9.shape).describe("Feedback record as stored in the database"),J2r=_e({feedbackSource:sg.optional(),source:sg.optional(),feedbackType:hC,value:$ut,comment:Fut.optional(),feedbackUserId:A5.optional(),userId:A5.optional(),metadata:Ws(pe(),Ia()).optional().describe("Additional feedback-specific metadata"),experimentId:I9.optional(),sourceId:pe().optional().describe("ID of the source record this feedback is linked to")});_e(J2r.shape).describe("User-provided feedback input");_e({feedback:rce(ime,L9)}).describe("Arguments for creating feedback");_e({feedback:L9.omit({timestamp:!0})}).describe("Arguments for creating feedback");_e({success:yo()}).describe("Response from creating feedback");_e({feedbacks:Et(rce(ime,L9))}).describe("Arguments for batch recording feedback");var zut=_e({...P9,feedbackType:Hr([pe(),Et(pe())]).optional().describe("Filter by feedback type(s)"),feedbackSource:sg.optional(),source:sg.optional(),feedbackUserId:A5.optional()}),$9=_e(zut.shape).describe("Filters for querying feedback"),eDr=So(["timestamp"]).describe("Field to order by: 'timestamp'"),tDr=_e({field:eDr.default("timestamp").describe("Field to order by"),direction:A9.default("DESC").describe("Sort direction")}).describe("Order by configuration");_e({filters:rce(ime,zut).optional().describe("Optional filters to apply"),pagination:T9.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:tDr.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing feedback");_e({pagination:N9,feedback:Et(K2r)});_e({feedbackType:hC,feedbackSource:sg.optional(),aggregation:wg,filters:$9.optional(),comparePeriod:Jpe.optional()}).describe("Arguments for getting a feedback aggregate over numeric values");_e(tme);_e({feedbackType:hC,feedbackSource:sg.optional(),groupBy:b1,aggregation:wg,filters:$9.optional()}).describe("Arguments for getting a feedback breakdown over numeric values");_e({groups:Et(_e({dimensions:rme,value:cC}))});_e({feedbackType:hC,feedbackSource:sg.optional(),interval:v1,aggregation:wg,filters:$9.optional(),groupBy:b1.optional()}).describe("Arguments for getting feedback time series over numeric values");_e({series:Et(_e({name:pe().describe("Series name (feedback type or group key)"),points:Et(_e({timestamp:uC,value:cC}))}))});_e({feedbackType:hC,feedbackSource:sg.optional(),percentiles:eme,interval:v1,filters:$9.optional()}).describe("Arguments for getting feedback percentiles over numeric values");_e({series:Et(_e({percentile:nme,points:Et(_e({timestamp:uC,value:sme}))}))});So(["counter","gauge","histogram"]);var But=pe().describe("Metric name (e.g., mastra_agent_duration_ms)"),Uut=St().describe("Metric value"),Vut=Ws(pe(),pe()).describe("Metric labels for dimensional filtering"),qut=pe().describe("Model provider"),Hut=pe().describe("Model"),rDr=St().describe("Estimated cost"),Qut=pe().describe("Unit for the estimated cost (e.g., usd)"),nDr=Ws(pe(),Ia()).nullish().describe("Structured costing metadata"),Wut=_e({metricId:pe().nullish().describe("Unique id for this metric event"),timestamp:XS().describe("When the metric was recorded"),name:But,value:Uut,traceId:M9.nullish(),spanId:D9.nullish(),...R9,source:pe().nullish().describe("Execution source"),provider:qut.nullish(),model:Hut.nullish(),estimatedCost:rDr.nullish(),costUnit:Qut.nullish(),costMetadata:nDr.nullish(),labels:Vut.default({}),metadata:jut.nullish()}).describe("Metric record as stored in the database");_e({name:But,value:Uut,labels:Vut.optional()}).describe("User-provided metric input");var sDr=Wut;_e({metrics:Et(sDr)}).describe("Arguments for batch recording metrics");_e({type:wg,interval:v1.optional(),groupBy:b1.optional()}).describe("Metrics aggregation configuration");var RP=_e({...P9,name:Et(pe()).nonempty().optional().describe("Filter by metric name(s)"),source:pe().optional().describe("Filter by execution source"),provider:qut.optional(),model:Hut.optional(),costUnit:Qut.optional(),labels:Ws(pe(),pe()).optional().describe("Exact match on label key-value pairs")}).describe("Filters for querying metrics"),aDr=So(["timestamp"]).describe("Field to order by: 'timestamp'"),iDr=_e({field:aDr.default("timestamp").describe("Field to order by"),direction:A9.default("DESC").describe("Sort direction")}).describe("Order by configuration");_e({filters:RP.optional(),pagination:T9.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:iDr.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing metrics");_e({pagination:N9,metrics:Et(Wut)});_e({name:Et(pe()).nonempty().describe("Metric name(s) to aggregate"),aggregation:wg,filters:RP.optional(),comparePeriod:Jpe.optional()}).describe("Arguments for getting a metric aggregate");_e({...tme,estimatedCost:St().nullable().optional().describe("Aggregated estimated cost from the same filtered row set"),costUnit:pe().nullable().optional().describe("Shared cost unit for the aggregated rows, or null when mixed/unknown"),previousEstimatedCost:St().nullable().optional().describe("Aggregated estimated cost from the comparison period"),costChangePercent:St().nullable().optional().describe("Percentage change in estimated cost from comparison period")});_e({name:Et(pe()).nonempty().describe("Metric name(s) to break down"),groupBy:b1,aggregation:wg,filters:RP.optional()}).describe("Arguments for getting a metric breakdown");_e({groups:Et(_e({dimensions:rme,value:cC,estimatedCost:St().nullable().optional().describe("Summed estimated cost for this group"),costUnit:pe().nullable().optional().describe("Shared cost unit for this group, or null when mixed/unknown")}))});_e({name:Et(pe()).nonempty().describe("Metric name(s)"),interval:v1,aggregation:wg,filters:RP.optional(),groupBy:b1.optional()}).describe("Arguments for getting metric time series");_e({series:Et(_e({name:pe().describe("Series name (metric name or group key)"),costUnit:pe().nullable().optional().describe("Shared cost unit for this series, or null when mixed/unknown"),points:Et(_e({timestamp:uC,value:cC,estimatedCost:St().nullable().optional().describe("Summed estimated cost in this bucket")}))}))});_e({name:pe().describe("Metric name"),percentiles:eme,interval:v1,filters:RP.optional()}).describe("Arguments for getting metric percentiles");_e({series:Et(_e({percentile:nme,points:Et(_e({timestamp:uC,value:sme}))}))});_e({prefix:pe().optional().describe("Filter metric names by prefix"),limit:St().int().min(1).optional().describe("Maximum number of names to return")}).describe("Arguments for getting metric names");_e({names:Et(pe()).describe("Distinct metric names")});_e({metricName:pe().describe("Metric name to get label keys for")}).describe("Arguments for getting metric label keys");_e({keys:Et(pe()).describe("Distinct label keys for the metric")});_e({metricName:pe().describe("Metric name"),labelKey:pe().describe("Label key to get values for"),prefix:pe().optional().describe("Filter values by prefix"),limit:St().int().min(1).optional().describe("Maximum number of values to return")}).describe("Arguments for getting label values");_e({values:Et(pe()).describe("Distinct label values")});_e({}).describe("Arguments for getting entity types");_e({entityTypes:Et(dC).describe("Distinct entity types")});_e({entityType:dC.optional().describe("Optional entity type filter")}).describe("Arguments for getting entity names");_e({names:Et(pe()).describe("Distinct entity names")});_e({}).describe("Arguments for getting service names");_e({serviceNames:Et(pe()).describe("Distinct service names")});_e({}).describe("Arguments for getting environments");_e({environments:Et(pe()).describe("Distinct environments")});_e({entityType:dC.optional().describe("Optional entity type filter")}).describe("Arguments for getting tags");_e({tags:Et(pe()).describe("Distinct tags")});function Gut(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=Gut(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Zut(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=Gut(e))&&(n&&(n+=" "),n+=t);return n}const WIe=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,GIe=Zut,x1=(e,t)=>r=>{var n;if(t?.variants==null)return GIe(e,r?.class,r?.className);const{variants:s,defaultVariants:a}=t,i=Object.keys(s).map(u=>{const d=r?.[u],f=a?.[u];if(d===null)return null;const h=WIe(d)||WIe(f);return s[u][h]}),l=r&&Object.entries(r).reduce((u,d)=>{let[f,h]=d;return h===void 0||(u[f]=h),u},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,d)=>{let{class:f,className:h,...p}=d;return Object.entries(p).every(m=>{let[g,y]=m;return Array.isArray(y)?y.includes({...a,...l}[g]):{...a,...l}[g]===y})?[...u,f,h]:u},[]);return GIe(e,i,c,r?.class,r?.className)},oDr=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},lDr=(e,t)=>({classGroupId:e,validator:t}),Yut=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),I5="-",ZIe=[],cDr="arbitrary..",uDr=e=>{const t=fDr(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return dDr(i);const l=i.split(I5),c=l[0]===""&&l.length>1?1:0;return Xut(l,c,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=n[i],u=r[i];return c?u?oDr(u,c):c:u||ZIe}return r[i]||ZIe}}},Xut=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const s=e[t],a=r.nextPart.get(s);if(a){const u=Xut(e,t+1,a);if(u)return u}const i=r.validators;if(i===null)return;const l=t===0?e.join(I5):e.slice(t).join(I5),c=i.length;for(let u=0;u<c;u++){const d=i[u];if(d.validator(l))return d.classGroupId}},dDr=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?cDr+n:void 0})(),fDr=e=>{const{theme:t,classGroups:r}=e;return hDr(r,t)},hDr=(e,t)=>{const r=Yut();for(const n in e){const s=e[n];ome(s,r,n,t)}return r},ome=(e,t,r,n)=>{const s=e.length;for(let a=0;a<s;a++){const i=e[a];pDr(i,t,r,n)}},pDr=(e,t,r,n)=>{if(typeof e=="string"){mDr(e,t,r);return}if(typeof e=="function"){gDr(e,t,r,n);return}yDr(e,t,r,n)},mDr=(e,t,r)=>{const n=e===""?t:Kut(t,e);n.classGroupId=r},gDr=(e,t,r,n)=>{if(vDr(e)){ome(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(lDr(r,e))},yDr=(e,t,r,n)=>{const s=Object.entries(e),a=s.length;for(let i=0;i<a;i++){const[l,c]=s[i];ome(c,Kut(t,l),r,n)}},Kut=(e,t)=>{let r=e;const n=t.split(I5),s=n.length;for(let a=0;a<s;a++){const i=n[a];let l=r.nextPart.get(i);l||(l=Yut(),r.nextPart.set(i,l)),r=l}return r},vDr=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,bDr=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const s=(a,i)=>{r[a]=i,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(a){let i=r[a];if(i!==void 0)return i;if((i=n[a])!==void 0)return s(a,i),i},set(a,i){a in r?r[a]=i:s(a,i)}}},die="!",YIe=":",xDr=[],XIe=(e,t,r,n,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:s}),wDr=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=s=>{const a=[];let i=0,l=0,c=0,u;const d=s.length;for(let g=0;g<d;g++){const y=s[g];if(i===0&&l===0){if(y===YIe){a.push(s.slice(c,g)),c=g+1;continue}if(y==="/"){u=g;continue}}y==="["?i++:y==="]"?i--:y==="("?l++:y===")"&&l--}const f=a.length===0?s:s.slice(c);let h=f,p=!1;f.endsWith(die)?(h=f.slice(0,-1),p=!0):f.startsWith(die)&&(h=f.slice(1),p=!0);const m=u&&u>c?u-c:void 0;return XIe(a,p,h,m)};if(t){const s=t+YIe,a=n;n=i=>i.startsWith(s)?a(i.slice(s.length)):XIe(xDr,!1,i,void 0,!0)}if(r){const s=n;n=a=>r({className:a,parseClassName:s})}return n},SDr=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let s=[];for(let a=0;a<r.length;a++){const i=r[a],l=i[0]==="[",c=t.has(i);l||c?(s.length>0&&(s.sort(),n.push(...s),s=[]),n.push(i)):s.push(i)}return s.length>0&&(s.sort(),n.push(...s)),n}},ODr=e=>({cache:bDr(e.cacheSize),parseClassName:wDr(e),sortModifiers:SDr(e),...uDr(e)}),kDr=/\s+/,_Dr=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s,sortModifiers:a}=t,i=[],l=e.trim().split(kDr);let c="";for(let u=l.length-1;u>=0;u-=1){const d=l[u],{isExternal:f,modifiers:h,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:g}=r(d);if(f){c=d+(c.length>0?" "+c:c);continue}let y=!!g,x=n(y?m.substring(0,g):m);if(!x){if(!y){c=d+(c.length>0?" "+c:c);continue}if(x=n(m),!x){c=d+(c.length>0?" "+c:c);continue}y=!1}const w=h.length===0?"":h.length===1?h[0]:a(h).join(":"),S=p?w+die:w,k=S+x;if(i.indexOf(k)>-1)continue;i.push(k);const _=s(x,y);for(let E=0;E<_.length;++E){const T=_[E];i.push(S+T)}c=d+(c.length>0?" "+c:c)}return c},EDr=(...e)=>{let t=0,r,n,s="";for(;t<e.length;)(r=e[t++])&&(n=Jut(r))&&(s&&(s+=" "),s+=n);return s},Jut=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Jut(e[n]))&&(r&&(r+=" "),r+=t);return r},KIe=(e,...t)=>{let r,n,s,a;const i=c=>{const u=t.reduce((d,f)=>f(d),e());return r=ODr(u),n=r.cache.get,s=r.cache.set,a=l,l(c)},l=c=>{const u=n(c);if(u)return u;const d=_Dr(c,r);return s(c,d),d};return a=i,(...c)=>a(EDr(...c))},CDr=[],Go=e=>{const t=r=>r[e]||CDr;return t.isThemeGetter=!0,t},edt=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,tdt=/^\((?:(\w[\w-]*):)?(.+)\)$/i,jDr=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,TDr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,NDr=/\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$/,ADr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,IDr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,RDr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,nb=e=>jDr.test(e),qn=e=>!!e&&!Number.isNaN(Number(e)),sb=e=>!!e&&Number.isInteger(Number(e)),nQ=e=>e.endsWith("%")&&qn(e.slice(0,-1)),Jg=e=>TDr.test(e),rdt=()=>!0,PDr=e=>NDr.test(e)&&!ADr.test(e),lme=()=>!1,MDr=e=>IDr.test(e),DDr=e=>RDr.test(e),LDr=e=>!vr(e)&&!kr(e),$Dr=e=>a0(e,adt,lme),vr=e=>edt.test(e),V0=e=>a0(e,idt,PDr),JIe=e=>a0(e,QDr,qn),FDr=e=>a0(e,ldt,rdt),zDr=e=>a0(e,odt,lme),eRe=e=>a0(e,ndt,lme),BDr=e=>a0(e,sdt,DDr),XD=e=>a0(e,cdt,MDr),kr=e=>tdt.test(e),aT=e=>w1(e,idt),UDr=e=>w1(e,odt),tRe=e=>w1(e,ndt),VDr=e=>w1(e,adt),qDr=e=>w1(e,sdt),KD=e=>w1(e,cdt,!0),HDr=e=>w1(e,ldt,!0),a0=(e,t,r)=>{const n=edt.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},w1=(e,t,r=!1)=>{const n=tdt.exec(e);return n?n[1]?t(n[1]):r:!1},ndt=e=>e==="position"||e==="percentage",sdt=e=>e==="image"||e==="url",adt=e=>e==="length"||e==="size"||e==="bg-size",idt=e=>e==="length",QDr=e=>e==="number",odt=e=>e==="family-name",ldt=e=>e==="number"||e==="weight",cdt=e=>e==="shadow",rRe=()=>{const e=Go("color"),t=Go("font"),r=Go("text"),n=Go("font-weight"),s=Go("tracking"),a=Go("leading"),i=Go("breakpoint"),l=Go("container"),c=Go("spacing"),u=Go("radius"),d=Go("shadow"),f=Go("inset-shadow"),h=Go("text-shadow"),p=Go("drop-shadow"),m=Go("blur"),g=Go("perspective"),y=Go("aspect"),x=Go("ease"),w=Go("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],_=()=>[...k(),kr,vr],E=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],j=()=>[kr,vr,c],N=()=>[nb,"full","auto",...j()],I=()=>[sb,"none","subgrid",kr,vr],P=()=>["auto",{span:["full",sb,kr,vr]},sb,kr,vr],R=()=>[sb,"auto",kr,vr],B=()=>["auto","min","max","fr",kr,vr],D=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],$=()=>["start","end","center","stretch","center-safe","end-safe"],U=()=>["auto",...j()],z=()=>[nb,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],H=()=>[nb,"screen","full","dvw","lvw","svw","min","max","fit",...j()],Q=()=>[nb,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],L=()=>[e,kr,vr],Z=()=>[...k(),tRe,eRe,{position:[kr,vr]}],V=()=>["no-repeat",{repeat:["","x","y","space","round"]}],M=()=>["auto","cover","contain",VDr,$Dr,{size:[kr,vr]}],W=()=>[nQ,aT,V0],G=()=>["","none","full",u,kr,vr],J=()=>["",qn,aT,V0],ae=()=>["solid","dashed","dotted","double"],te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[qn,nQ,tRe,eRe],ie=()=>["","none",m,kr,vr],he=()=>["none",qn,kr,vr],X=()=>["none",qn,kr,vr],se=()=>[qn,kr,vr],le=()=>[nb,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Jg],breakpoint:[Jg],color:[rdt],container:[Jg],"drop-shadow":[Jg],ease:["in","out","in-out"],font:[LDr],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Jg],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Jg],shadow:[Jg],spacing:["px",qn],text:[Jg],"text-shadow":[Jg],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",nb,vr,kr,y]}],container:["container"],columns:[{columns:[qn,vr,kr,l]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"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"],sr:["sr-only","not-sr-only"],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:_()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:N()}],"inset-x":[{"inset-x":N()}],"inset-y":[{"inset-y":N()}],start:[{"inset-s":N(),start:N()}],end:[{"inset-e":N(),end:N()}],"inset-bs":[{"inset-bs":N()}],"inset-be":[{"inset-be":N()}],top:[{top:N()}],right:[{right:N()}],bottom:[{bottom:N()}],left:[{left:N()}],visibility:["visible","invisible","collapse"],z:[{z:[sb,"auto",kr,vr]}],basis:[{basis:[nb,"full","auto",l,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qn,nb,"auto","initial","none",vr]}],grow:[{grow:["",qn,kr,vr]}],shrink:[{shrink:["",qn,kr,vr]}],order:[{order:[sb,"first","last","none",kr,vr]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:P()}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:P()}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":B()}],"auto-rows":[{"auto-rows":B()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...D(),"normal"]}],"justify-items":[{"justify-items":[...$(),"normal"]}],"justify-self":[{"justify-self":["auto",...$()]}],"align-content":[{content:["normal",...D()]}],"align-items":[{items:[...$(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...$(),{baseline:["","last"]}]}],"place-content":[{"place-content":D()}],"place-items":[{"place-items":[...$(),"baseline"]}],"place-self":[{"place-self":["auto",...$()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:U()}],mx:[{mx:U()}],my:[{my:U()}],ms:[{ms:U()}],me:[{me:U()}],mbs:[{mbs:U()}],mbe:[{mbe:U()}],mt:[{mt:U()}],mr:[{mr:U()}],mb:[{mb:U()}],ml:[{ml:U()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],"inline-size":[{inline:["auto",...H()]}],"min-inline-size":[{"min-inline":["auto",...H()]}],"max-inline-size":[{"max-inline":["none",...H()]}],"block-size":[{block:["auto",...Q()]}],"min-block-size":[{"min-block":["auto",...Q()]}],"max-block-size":[{"max-block":["none",...Q()]}],w:[{w:[l,"screen",...z()]}],"min-w":[{"min-w":[l,"screen","none",...z()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...z()]}],h:[{h:["screen","lh",...z()]}],"min-h":[{"min-h":["screen","lh","none",...z()]}],"max-h":[{"max-h":["screen","lh",...z()]}],"font-size":[{text:["base",r,aT,V0]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,HDr,FDr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",nQ,vr]}],"font-family":[{font:[UDr,zDr,t]}],"font-features":[{"font-features":[vr]}],"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:[s,kr,vr]}],"line-clamp":[{"line-clamp":[qn,"none",kr,JIe]}],leading:[{leading:[a,...j()]}],"list-image":[{"list-image":["none",kr,vr]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",kr,vr]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[qn,"from-font","auto",kr,V0]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[qn,"auto",kr,vr]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",kr,vr]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",kr,vr]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Z()}],"bg-repeat":[{bg:V()}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},sb,kr,vr],radial:["",kr,vr],conic:[sb,kr,vr]},qDr,BDr]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:G()}],"rounded-s":[{"rounded-s":G()}],"rounded-e":[{"rounded-e":G()}],"rounded-t":[{"rounded-t":G()}],"rounded-r":[{"rounded-r":G()}],"rounded-b":[{"rounded-b":G()}],"rounded-l":[{"rounded-l":G()}],"rounded-ss":[{"rounded-ss":G()}],"rounded-se":[{"rounded-se":G()}],"rounded-ee":[{"rounded-ee":G()}],"rounded-es":[{"rounded-es":G()}],"rounded-tl":[{"rounded-tl":G()}],"rounded-tr":[{"rounded-tr":G()}],"rounded-br":[{"rounded-br":G()}],"rounded-bl":[{"rounded-bl":G()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-bs":[{"border-bs":J()}],"border-w-be":[{"border-be":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ae(),"hidden","none"]}],"divide-style":[{divide:[...ae(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qn,kr,vr]}],"outline-w":[{outline:["",qn,aT,V0]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",d,KD,XD]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",f,KD,XD]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[qn,V0]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",h,KD,XD]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[qn,kr,vr]}],"mix-blend":[{"mix-blend":[...te(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":te()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[qn]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[kr,vr]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":k()}],"mask-image-conic-pos":[{"mask-conic":[qn]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Z()}],"mask-repeat":[{mask:V()}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",kr,vr]}],filter:[{filter:["","none",kr,vr]}],blur:[{blur:ie()}],brightness:[{brightness:[qn,kr,vr]}],contrast:[{contrast:[qn,kr,vr]}],"drop-shadow":[{"drop-shadow":["","none",p,KD,XD]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",qn,kr,vr]}],"hue-rotate":[{"hue-rotate":[qn,kr,vr]}],invert:[{invert:["",qn,kr,vr]}],saturate:[{saturate:[qn,kr,vr]}],sepia:[{sepia:["",qn,kr,vr]}],"backdrop-filter":[{"backdrop-filter":["","none",kr,vr]}],"backdrop-blur":[{"backdrop-blur":ie()}],"backdrop-brightness":[{"backdrop-brightness":[qn,kr,vr]}],"backdrop-contrast":[{"backdrop-contrast":[qn,kr,vr]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qn,kr,vr]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qn,kr,vr]}],"backdrop-invert":[{"backdrop-invert":["",qn,kr,vr]}],"backdrop-opacity":[{"backdrop-opacity":[qn,kr,vr]}],"backdrop-saturate":[{"backdrop-saturate":[qn,kr,vr]}],"backdrop-sepia":[{"backdrop-sepia":["",qn,kr,vr]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",kr,vr]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qn,"initial",kr,vr]}],ease:[{ease:["linear","initial",x,kr,vr]}],delay:[{delay:[qn,kr,vr]}],animate:[{animate:["none",w,kr,vr]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,kr,vr]}],"perspective-origin":[{"perspective-origin":_()}],rotate:[{rotate:he()}],"rotate-x":[{"rotate-x":he()}],"rotate-y":[{"rotate-y":he()}],"rotate-z":[{"rotate-z":he()}],scale:[{scale:X()}],"scale-x":[{"scale-x":X()}],"scale-y":[{"scale-y":X()}],"scale-z":[{"scale-z":X()}],"scale-3d":["scale-3d"],skew:[{skew:se()}],"skew-x":[{"skew-x":se()}],"skew-y":[{"skew-y":se()}],transform:[{transform:[kr,vr,"","none","gpu","cpu"]}],"transform-origin":[{origin:_()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:le()}],"translate-x":[{"translate-x":le()}],"translate-y":[{"translate-y":le()}],"translate-z":[{"translate-z":le()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",kr,vr]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",kr,vr]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[qn,aT,V0,JIe]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","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-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},WDr=(e,{cacheSize:t,prefix:r,experimentalParseClassName:n,extend:s={},override:a={}})=>(HT(e,"cacheSize",t),HT(e,"prefix",r),HT(e,"experimentalParseClassName",n),JD(e.theme,a.theme),JD(e.classGroups,a.classGroups),JD(e.conflictingClassGroups,a.conflictingClassGroups),JD(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),HT(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),eL(e.theme,s.theme),eL(e.classGroups,s.classGroups),eL(e.conflictingClassGroups,s.conflictingClassGroups),eL(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),udt(e,s,"orderSensitiveModifiers"),e),HT=(e,t,r)=>{r!==void 0&&(e[t]=r)},JD=(e,t)=>{if(t)for(const r in t)HT(e,r,t[r])},eL=(e,t)=>{if(t)for(const r in t)udt(e,t,r)},udt=(e,t,r)=>{const n=t[r];n!==void 0&&(e[r]=e[r]?e[r].concat(n):n)},GDr=(e,...t)=>typeof e=="function"?KIe(rRe,e,...t):KIe(()=>WDr(rRe(),e),...t),ZDr=Object.keys({...ky,...W9t}),YDr=Object.keys(J9t),XDr=Object.keys(G9t),KDr=Object.keys(Z9t),JDr=Object.keys(Q9t),q0=Object.keys(K9t),eLr=Object.keys(Y9t).concat(Object.keys(X9t)),tLr=GDr({extend:{theme:{color:ZDr,spacing:YDr,radius:JDr,leading:KDr,shadow:eLr},classGroups:{"font-size":[{text:XDr}],h:[{h:q0}],w:[{w:q0}],size:[{size:q0}],"min-h":[{"min-h":q0}],"min-w":[{"min-w":q0}],"max-h":[{"max-h":q0}],"max-w":[{"max-w":q0}]}}});function Y(...e){return tLr(Zut(e))}const ad=u4t,Yr=d4t,Xr=f4t,Wr=b.forwardRef(({className:e,sideOffset:t=4,children:r,...n},s)=>o.jsx(h4t,{children:o.jsxs(Iqe,{ref:s,sideOffset:t,className:Y("z-50 overflow-hidden rounded-md bg-surface3 px-3 py-1.5 text-xs text-neutral4 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,children:[r,o.jsx(p4t,{className:"fill-surface3"})]})}));Wr.displayName=Iqe.displayName;const rLr={sm:"[&>svg]:h-icon-sm [&>svg]:w-icon-sm",default:"[&>svg]:h-icon-default [&>svg]:w-icon-default",lg:"[&>svg]:h-icon-lg [&>svg]:w-icon-lg"},Ce=({children:e,className:t,size:r="default",...n})=>o.jsx("span",{className:Y("block",rLr[r],t),...n,children:e}),lc={sm:"h-form-sm",md:"h-form-md",default:"h-form-default",lg:"h-form-lg"},F9="focus:outline-hidden focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring transition-shadow duration-normal",nLr="focus-within:outline-hidden focus-within:ring-1 focus-within:ring-accent1 focus-within:shadow-focus-ring transition-shadow duration-normal",sLr="rounded-md",ddt="bg-surface2 border-2 border-border1 text-neutral5 hover:text-neutral6 hover:border-border2 rounded-lg",cme="outline-hidden focus-visible:outline-hidden focus-visible:border-accent1 focus-visible:ring-1 focus-visible:ring-accent1/40",ume="disabled:opacity-50 disabled:cursor-not-allowed",tL=Y("gap-[.75em] rounded-lg","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:mx-[-.3em]","[&>svg]:opacity-50 [&:hover>svg]:opacity-100"),pC=x1(Y("inline-flex items-center justify-center leading-0","transition-all duration-normal ease-out-custom",ume,cme),{variants:{variant:{default:"bg-surface3 border-2 border-border1 hover:bg-surface5 hover:text-neutral6 active:bg-surface6 text-neutral6",primary:"bg-surface4 border-2 border-border2 hover:bg-surface5 hover:text-neutral6 active:bg-surface6 text-neutral6",cta:"bg-accent1 border-2 border-transparent hover:bg-accent1/90 hover:shadow-glow-accent1 disabled:hover:shadow-none text-surface1 font-medium",ghost:"bg-transparent border-2 border-transparent hover:bg-surface4 hover:text-neutral6 active:bg-surface5 text-neutral4",outline:"bg-transparent border-2 border-border1 hover:bg-surface3 hover:text-neutral6 active:bg-surface4 text-neutral5",link:"inline-flex justify-start rounded-none h-auto px-0 bg-transparent text-neutral3 hover:text-neutral4 gap-1 [&>svg]:mx-0 w-auto [&>svg]:opacity-70"},size:{sm:Y(`${lc.sm} text-ui-sm px-[.75em]`,tL),md:Y(`${lc.md} text-ui-md px-[.75em]`,tL),default:Y(`${lc.default} text-ui-md px-[.85em]`,tL),lg:Y(`${lc.lg} text-ui-lg px-[1em]`,tL),"icon-sm":`${lc.sm} w-form-sm rounded-md`,"icon-md":`${lc.md} w-form-md rounded-md`,"icon-lg":`${lc.lg} w-form-lg rounded-md`}},defaultVariants:{variant:"default",size:"default"}}),aLr={"icon-sm":"sm","icon-md":"default","icon-lg":"lg"};function fdt(e){const t=[];return je.Children.forEach(e,r=>{je.isValidElement(r)&&r.type===je.Fragment?t.push(...fdt(r.props.children)):t.push(r)}),t}function iLr(e){const t=fdt(e);return t.length>0&&t.every(r=>je.isValidElement(r))}function oLr(e){return typeof e=="string"&&e.startsWith("icon-")}const ce=je.forwardRef(({className:e,as:t,size:r,variant:n="default",disabled:s,children:a,tooltip:i,"aria-label":l,...c},u)=>{const d=t||"button",f=oLr(r),h=r??"default",p=!f&&iLr(a),m=l??((f||p)&&typeof i=="string"?i:void 0),g=f?o.jsx(Ce,{size:aLr[r],children:a}):a,y=o.jsx(d,{ref:u,disabled:s,"aria-label":m,className:Y(pC({variant:n,size:h}),p&&"[&>svg]:opacity-75",e),...c,children:g});return i?o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:y}),o.jsx(Wr,{children:i})]}):y});ce.displayName="Button";const Ln=je.forwardRef(({tooltipContent:e,...t},r)=>o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(ce,{ref:r,...t})}),e&&o.jsx(Wr,{children:e})]}));Ln.displayName="ButtonWithTooltip";const ln={colors:"transition-colors duration-normal ease-out-custom",all:"transition-all duration-normal ease-out-custom",opacity:"transition-opacity duration-normal ease-out-custom",allSlow:"transition-all duration-slow ease-out-custom"},i0={visible:"focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-accent1 focus-visible:shadow-focus-ring"},hdt=({children:e})=>o.jsx("nav",{className:"bg-surface2 min-h-full overflow-hidden",children:e}),R5=({children:e,as:t="a",href:r,className:n,prefetch:s,to:a})=>o.jsx(t,{href:r,prefetch:s,to:a,className:Y("text-ui-sm flex h-full w-full flex-col justify-center font-medium cursor-pointer",ln.colors,n),children:e}),pdt=({children:e})=>o.jsx("ol",{"data-testid":"thread-list",children:e}),P5=({children:e,isActive:t,className:r})=>o.jsx("li",{className:Y("border-b border-border1 group flex h-[54px] items-center justify-between gap-2 px-3 py-2",ln.colors,"hover:bg-surface3",t&&"bg-accent1Dark",r),children:e}),mdt=({onClick:e})=>o.jsx(ce,{variant:"ghost",className:Y("shrink-0 opacity-0",ln.all,"group-focus-within:opacity-100 group-hover:opacity-100","hover:bg-surface4 hover:text-accent2"),onClick:e,children:o.jsx(Ce,{children:o.jsx(Wl,{"aria-label":"delete thread",className:"text-neutral3 hover:text-accent2 transition-colors"})})}),lLr={"ui-xs":"text-ui-xs leading-ui-xs","ui-sm":"text-ui-sm leading-ui-sm","ui-smd":"text-ui-smd leading-ui-smd","ui-md":"text-ui-md leading-ui-md","ui-lg":"text-ui-lg leading-ui-lg","header-xs":"text-header-xs leading-header-xs","header-sm":"text-header-sm leading-header-sm","header-md":"text-header-md leading-header-md","header-lg":"text-header-lg leading-header-lg","header-xl":"text-header-xl leading-header-xl"},cLr={mono:"font-mono"},me=({as:e="p",className:t,variant:r="ui-md",font:n,...s})=>o.jsx(e,{className:Y(lLr[r],n&&cLr[n],t),...s}),uLr={sm:"h-avatar-sm w-avatar-sm",md:"h-avatar-md w-avatar-md",lg:"h-avatar-lg w-avatar-lg"},gdt=({src:e,name:t,size:r="sm",interactive:n=!1})=>o.jsx("div",{className:Y(uLr[r],"border border-border1 bg-surface3 shrink-0 overflow-hidden rounded-full flex items-center justify-center",ln.all,n&&"cursor-pointer hover:scale-105 hover:border-neutral2 hover:shadow-sm"),children:e?o.jsx("img",{src:e,alt:t,className:"h-full w-full object-cover"}):o.jsx(me,{variant:"ui-md",className:"text-center text-neutral4",children:t[0].toUpperCase()})}),dLr={default:"text-neutral3 bg-surface4",success:"text-accent1 bg-accent1Dark",error:"text-accent2 bg-accent2Dark",info:"text-accent5 bg-accent5Dark",warning:"text-accent6 bg-accent6Dark"},fLr={default:"text-neutral3",success:"text-accent1",error:"text-accent2",info:"text-accent5",warning:"text-accent6"},vt=({icon:e,variant:t="default",className:r,children:n,...s})=>o.jsxs("div",{className:Y("font-mono text-ui-sm gap-1 h-badge-default inline-flex items-center rounded-full border border-border1 shrink-0",ln.colors,e?"pl-2 pr-2.5":"px-2.5",t==="default"&&e?"bg-surface4 text-neutral5":dLr[t],r),...s,children:[e&&o.jsx("span",{className:fLr[t],children:o.jsx(Ce,{children:e})}),n]}),hLr=e=>o.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{d:"M5.25684 12.6387L10.4003 3.36133H11.7432L6.5997 12.6387H5.25684Z",fill:"currentColor"})}),Xa=({children:e,label:t})=>o.jsx("nav",{"aria-label":t,children:o.jsx("ol",{className:"gap-0.5 flex items-center",children:e})}),jr=({className:e,as:t,isCurrent:r,action:n,...s})=>{const a=t||"span";return o.jsxs(o.Fragment,{children:[o.jsxs("li",{className:"flex h-full shrink-0 items-center gap-1",children:[o.jsx(a,{"aria-current":r?"page":void 0,className:Y("text-ui-md leading-ui-md flex items-center gap-2",ln.colors,r?"text-white":"text-neutral3 hover:text-neutral5",e),...s}),n]}),!r&&o.jsx("li",{role:"separator",className:"flex h-full items-center",children:o.jsx(Ce,{className:Y("text-neutral2",ln.colors),children:o.jsx(hLr,{})})})]})};function pLr(e,t=5){if(!e?.properties)return[];const r=[];function n(s,a,i){if(i>t)return;const l=Array.isArray(s.type)?s.type.join(" | "):s.type;if(r.push({path:a,label:a,description:s.description??s.title,type:l}),s.properties)for(const[c,u]of Object.entries(s.properties))n(u,`${a}.${c}`,i+1);if(s.items?.properties)for(const[c,u]of Object.entries(s.items.properties))n(u,`${a}[].${c}`,i+1)}for(const[s,a]of Object.entries(e.properties))n(a,s,1);return r}function mLr(e){const t=pLr(e);return XWe({override:[gLr(t)],defaultKeymap:!0,closeOnBlur:!0,icons:!1})}function gLr(e){return t=>{const n=t.state.sliceDoc(Math.max(0,t.pos-50),t.pos).match(/\{\{([a-zA-Z0-9_.\[\]]*)?$/);if(!n)return null;const s=n[1]??"",a=t.pos-s.length,i=s?e.filter(c=>c.path.toLowerCase().startsWith(s.toLowerCase())):e;if(i.length===0)return null;const l=i.map(c=>({label:c.path,displayLabel:c.path,detail:c.type,info:c.description,apply:(u,d,f,h)=>{const g=u.state.sliceDoc(h,h+2)==="}}"?d.label:`${d.label}}}`;u.dispatch({changes:{from:f,to:h,insert:g},selection:{anchor:f+g.length}})}}));return{from:a,options:l,validFor:/^[a-zA-Z0-9_.\[\]]*$/}}}const yLr=/\{\{([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\}\}/g,vLr=er.mark({class:"cm-variable-highlight"}),nRe=new dWe({regexp:yLr,decoration:()=>vLr}),bLr=Oi.fromClass(class{decorations;constructor(e){this.decorations=nRe.createDeco(e)}update(e){this.decorations=nRe.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}),xLr=bLr,ga=e=>o.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.5 15C10.3565 15 12.137 14.2625 13.4497 12.9497C14.7625 11.637 15.5 9.85652 15.5 8C15.5 6.14348 14.7625 4.36301 13.4497 3.05025C12.137 1.7375 10.3565 1 8.5 1C6.64348 1 4.86301 1.7375 3.55025 3.05025C2.2375 4.36301 1.5 6.14348 1.5 8C1.5 9.85652 2.2375 11.637 3.55025 12.9497C4.86301 14.2625 6.64348 15 8.5 15ZM5.621 10.879L4.611 11.889C3.84179 11.1198 3.31794 10.1398 3.1057 9.07291C2.89346 8.00601 3.00236 6.90013 3.41864 5.89512C3.83491 4.89012 4.53986 4.03112 5.44434 3.42676C6.34881 2.8224 7.41219 2.49983 8.5 2.49983C9.58781 2.49983 10.6512 2.8224 11.5557 3.42676C12.4601 4.03112 13.1651 4.89012 13.5814 5.89512C13.9976 6.90013 14.1065 8.00601 13.8943 9.07291C13.6821 10.1398 13.1582 11.1198 12.389 11.889L11.379 10.879C11.1004 10.6003 10.7696 10.3792 10.4055 10.2284C10.0414 10.0776 9.6511 9.99995 9.257 10H7.743C7.3489 9.99995 6.95865 10.0776 6.59455 10.2284C6.23045 10.3792 5.89963 10.6003 5.621 10.879Z",fill:"currentColor"}),o.jsx("path",{d:"M8.5 4C7.96957 4 7.46086 4.21071 7.08579 4.58579C6.71071 4.96086 6.5 5.46957 6.5 6V6.5C6.5 7.03043 6.71071 7.53914 7.08579 7.91421C7.46086 8.28929 7.96957 8.5 8.5 8.5C9.03043 8.5 9.53914 8.28929 9.91421 7.91421C10.2893 7.53914 10.5 7.03043 10.5 6.5V6C10.5 5.46957 10.2893 4.96086 9.91421 4.58579C9.53914 4.21071 9.03043 4 8.5 4Z",fill:"currentColor"})]}),wLr=e=>o.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{d:"M11.0313 7.97578C11.0313 9.34436 9.92183 10.4538 8.55324 10.4538C7.18466 10.4538 6.0752 9.34436 6.0752 7.97578C6.0752 6.60719 7.18466 5.49773 8.55324 5.49773C9.92183 5.49773 11.0313 6.60719 11.0313 7.97578ZM11.0313 7.97578H14.573",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round"}),o.jsx("path",{d:"M12.967 4.46154C11.9273 3.14431 10.3165 2.29883 8.50814 2.29883C5.37277 2.29883 2.83105 4.84055 2.83105 7.97591C2.83105 11.1113 5.37277 13.653 8.50814 13.653C10.3165 13.653 11.9273 12.8075 12.967 11.4903",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round"})]}),dme=e=>o.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.99982 2.0625C3.8252 2.0625 2.06232 3.82538 2.06232 6C2.06232 8.17462 3.8252 9.9375 5.99982 9.9375C8.17444 9.9375 9.93732 8.17462 9.93732 6C9.93732 3.82538 8.17444 2.0625 5.99982 2.0625ZM0.937317 6C0.937317 3.20406 3.20388 0.9375 5.99982 0.9375C8.79576 0.9375 11.0623 3.20406 11.0623 6C11.0623 8.79594 8.79576 11.0625 5.99982 11.0625C3.20388 11.0625 0.937317 8.79594 0.937317 6Z",fill:"currentColor"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.97865 4.57004C8.22604 4.75795 8.27426 5.11082 8.08635 5.35821L6.05486 8.03279C5.94873 8.17251 5.78348 8.25471 5.60803 8.25505C5.43257 8.2554 5.267 8.17385 5.16032 8.03454L3.80937 6.27034C3.6205 6.02369 3.66733 5.67063 3.91398 5.48176C4.16063 5.29288 4.51369 5.33972 4.70257 5.58637L5.6051 6.76498L7.19048 4.67774C7.37839 4.43036 7.73126 4.38213 7.97865 4.57004Z",fill:"currentColor"})]}),fme=e=>o.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.99982 2.0625C3.8252 2.0625 2.06232 3.82538 2.06232 6C2.06232 8.17462 3.8252 9.9375 5.99982 9.9375C8.17444 9.9375 9.93732 8.17462 9.93732 6C9.93732 3.82538 8.17444 2.0625 5.99982 2.0625ZM0.937317 6C0.937317 3.20406 3.20388 0.9375 5.99982 0.9375C8.79576 0.9375 11.0623 3.20406 11.0623 6C11.0623 8.79594 8.79576 11.0625 5.99982 11.0625C3.20388 11.0625 0.937317 8.79594 0.937317 6Z",fill:"currentColor"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.89741 4.10293C8.11707 4.32261 8.11706 4.67877 7.89738 4.89843L6.79517 6.00058L7.8962 7.10155C8.11588 7.32122 8.11589 7.67737 7.89623 7.89705C7.67656 8.11673 7.32041 8.11674 7.10073 7.89707L5.99965 6.79605L4.89856 7.89707C4.67889 8.11673 4.32273 8.11672 4.10307 7.89704C3.88341 7.67737 3.88342 7.32121 4.10309 7.10155L5.20413 6.00058L4.10191 4.89843C3.88224 4.67877 3.88223 4.32262 4.10189 4.10294C4.32155 3.88326 4.67771 3.88325 4.89738 4.10292L5.99965 5.20511L7.10191 4.10291C7.32159 3.88325 7.67774 3.88326 7.89741 4.10293Z",fill:"currentColor"})]}),o0=e=>o.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.1747 3.18598L7.02554 1.95209C7.11557 1.89207 7.31087 1.87106 7.41016 1.90924L12.4139 3.83377C12.4683 3.85467 12.546 3.96798 12.546 4.03118V13.0167C12.546 13.265 12.7473 13.4663 12.9956 13.4663C13.2439 13.4663 13.4452 13.265 13.4452 13.0167V4.03118C13.4452 3.59605 13.1384 3.14906 12.7367 2.99456L7.73293 1.07004C7.36225 0.927472 6.86056 0.981451 6.52679 1.20396L4.20445 2.75219L3.90419 2.95236L3.90647 2.95824C3.69329 3.05449 3.55469 3.27599 3.55469 3.57581V11.7119C3.55469 12.2084 3.93067 12.7499 4.39251 12.9206L9.89804 14.955C10.3608 15.126 10.7359 14.8596 10.7359 14.3659V5.83295C10.7359 5.33662 10.3498 4.81289 9.88389 4.66643L5.1747 3.18598Z",fill:"currentColor"})}),ydt=e=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("g",{clipPath:"url(#clip0_21999_22095)",children:o.jsx("path",{d:"M7.5 0.75C3.6325 0.75 0.5 3.8825 0.5 7.75C0.5 10.8475 2.50375 13.4637 5.28625 14.3912C5.63625 14.4525 5.7675 14.2425 5.7675 14.0587C5.7675 13.8925 5.75875 13.3412 5.75875 12.755C4 13.0787 3.545 12.3262 3.405 11.9325C3.32625 11.7312 2.985 11.11 2.6875 10.9437C2.4425 10.8125 2.0925 10.4887 2.67875 10.48C3.23 10.4712 3.62375 10.9875 3.755 11.1975C4.385 12.2562 5.39125 11.9587 5.79375 11.775C5.855 11.32 6.03875 11.0137 6.24 10.8387C4.6825 10.6637 3.055 10.06 3.055 7.3825C3.055 6.62125 3.32625 5.99125 3.7725 5.50125C3.7025 5.32625 3.4575 4.60875 3.8425 3.64625C3.8425 3.64625 4.42875 3.4625 5.7675 4.36375C6.3275 4.20625 6.9225 4.1275 7.5175 4.1275C8.1125 4.1275 8.7075 4.20625 9.2675 4.36375C10.6062 3.45375 11.1925 3.64625 11.1925 3.64625C11.5775 4.60875 11.3325 5.32625 11.2625 5.50125C11.7087 5.99125 11.98 6.6125 11.98 7.3825C11.98 10.0687 10.3438 10.6637 8.78625 10.8387C9.04 11.0575 9.25875 11.4775 9.25875 12.1337C9.25875 13.07 9.25 13.8225 9.25 14.0587C9.25 14.2425 9.38125 14.4612 9.73125 14.3912C11.1209 13.9221 12.3284 13.029 13.1839 11.8377C14.0393 10.6463 14.4996 9.21668 14.5 7.75C14.5 3.8825 11.3675 0.75 7.5 0.75Z",fill:"currentColor"})}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_21999_22095",children:o.jsx("rect",{width:"14",height:"14",fill:"currentColor",transform:"translate(0.5 0.75)"})})})]}),vdt=e=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsxs("g",{clipPath:"url(#clip0_21999_20513)",children:[o.jsx("path",{d:"M13.5037 7.54867C13.5037 7.1144 13.4648 6.69683 13.3924 6.29596H7.62436V8.66776H10.9204C10.7756 9.43052 10.3413 10.0764 9.68994 10.5106V12.0529H11.6776C12.8356 10.9839 13.5037 9.41382 13.5037 7.54867Z",fill:"#4285F4"}),o.jsx("path",{d:"M7.62415 13.5339C9.27773 13.5339 10.6643 12.9882 11.6776 12.0529L9.68994 10.5106C9.14431 10.8781 8.44816 11.1009 7.62415 11.1009C6.03182 11.1009 4.67889 10.0263 4.19451 8.57877H2.15677V10.16C3.1645 12.1587 5.23008 13.5339 7.62415 13.5339Z",fill:"#34A853"}),o.jsx("path",{d:"M4.19472 8.57315C4.07223 8.20569 3.99985 7.81595 3.99985 7.40952C3.99985 7.00308 4.07223 6.61335 4.19472 6.24589V4.66469H2.15698C1.73941 5.4887 1.5 6.41849 1.5 7.40952C1.5 8.40055 1.73941 9.33034 2.15698 10.1543L3.74374 8.91834L4.19472 8.57315Z",fill:"#FBBC05"}),o.jsx("path",{d:"M7.62415 3.72376C8.5261 3.72376 9.32783 4.03555 9.96811 4.63685L11.7219 2.88306C10.6585 1.89202 9.27773 1.28516 7.62415 1.28516C5.23008 1.28516 3.16471 2.66036 2.15698 4.66469L4.19472 6.24589C4.6791 4.79832 6.03182 3.72376 7.62415 3.72376Z",fill:"#EA4335"})]}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_21999_20513",children:o.jsx("rect",{width:"12.2487",height:"12.2487",fill:"white",transform:"translate(1.375 1.28516)"})})})]}),SLr=e=>o.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{d:"M4.31445 3.16083C3.78402 3.16083 3.27531 3.37154 2.90024 3.74661C2.52517 4.12169 2.31445 4.63039 2.31445 5.16083V5.66083C2.31445 6.19126 2.52517 6.69997 2.90024 7.07504C3.27531 7.45011 3.78402 7.66083 4.31445 7.66083C4.84489 7.66083 5.35359 7.45011 5.72867 7.07504C6.10374 6.69997 6.31445 6.19126 6.31445 5.66083V5.16083C6.31445 4.63039 6.10374 4.12169 5.72867 3.74661C5.35359 3.37154 4.84489 3.16083 4.31445 3.16083Z",fill:"currentColor"}),o.jsx("path",{d:"M6.76666 9.50235C6.57678 9.28532 6.30244 9.16083 6.01407 9.16083H4.50201C4.10791 9.16078 3.71766 9.23838 3.35356 9.38921C3.11733 9.48706 2.8951 9.6145 2.69205 9.76806C2.48056 9.928 2.38001 10.1888 2.38001 10.454V13.0642C2.38001 13.6165 2.82773 14.0642 3.38001 14.0642H8.55436C9.4135 14.0642 9.87269 13.0523 9.30695 12.4057L6.76666 9.50235Z",fill:"currentColor"}),o.jsx("rect",{x:"7.92188",y:"6.46759",width:"1.41089",height:"1.56773",rx:"0.705445",fill:"currentColor"}),o.jsx("rect",{x:"10.4258",y:"4.35107",width:"1.41089",height:"3.72998",rx:"0.705445",fill:"currentColor"}),o.jsx("rect",{x:"12.9287",y:"2.23419",width:"1.41089",height:"5.75781",rx:"0.705445",fill:"currentColor"})]}),z9=e=>o.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{d:"M3.8674 9.19968L4.14554 10.8649C4.23965 11.4283 4.75254 11.8237 5.32137 11.7713L5.58252 11.7472C6.56555 11.6567 7.43309 12.3868 7.51181 13.3708L7.59308 14.3867C7.60422 14.5259 7.71868 14.6342 7.85825 14.6376L9.91053 14.6876C10.1066 14.6924 10.2434 14.4948 10.17 14.3129L8.90452 11.1782C8.80956 10.9429 8.65085 10.7389 8.44626 10.5889L7.90134 10.1895C7.70604 10.0464 7.55223 9.85411 7.45759 9.63124C7.15011 8.90712 6.6579 7.71234 6.37054 6.88944C6.19204 6.3783 5.79931 6.29158 5.45492 6.21553C4.98179 6.11106 4.5999 6.02673 4.99001 4.88985C5.66408 2.92541 8.06015 2.07904 10.6601 3.33088C12.6488 4.2884 13.1187 6.35416 13.0328 7.58237C13.0297 7.62768 13.0214 7.67186 13.0094 7.71566C12.8829 8.17534 12.368 8.40491 11.9415 8.19169L10.3022 7.37201C10.2069 7.32439 10.0927 7.33657 10.0096 7.40322L8.64809 8.49559C8.55405 8.57104 8.52072 8.69931 8.56615 8.811L10.8995 14.5478C10.9404 14.6483 11.0369 14.715 11.1454 14.7177L12.0572 14.7399C12.2581 14.7448 12.3951 14.5382 12.3124 14.3551L11.8681 13.3706C11.4211 12.3803 11.6047 11.2192 12.3354 10.4151L13.4616 9.17575C13.7473 8.86125 13.9224 8.46187 13.9599 8.03858L13.9763 7.85359C14.2866 4.35298 11.377 1.41272 7.87336 1.68639C6.03919 1.82965 4.45399 3.02228 3.80807 4.74492L3.70275 5.02579C3.5828 5.34571 3.62741 5.70411 3.82213 5.98485L3.88946 6.08192C4.12183 6.41695 4.0958 6.86726 3.82637 7.17328L3.06705 8.03572C2.96261 8.15435 2.98058 8.33664 3.10617 8.43259L3.66059 8.85617C3.77064 8.94026 3.84458 9.06307 3.8674 9.19968Z",fill:"currentColor"})}),hme=e=>o.jsx("svg",{width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.40864 11.9983C7.58064 11.9733 6.84164 11.6153 6.31564 11.0563C6.31464 11.0563 6.31464 11.0553 6.31464 11.0553C5.78864 10.4963 5.47564 9.73633 5.50064 8.90833C5.52564 8.08033 5.88464 7.34133 6.44364 6.81533C7.00264 6.28833 7.76264 5.97633 8.59064 6.00133C9.41864 6.02633 10.1576 6.38433 10.6836 6.94333H10.6846C11.2106 7.50333 11.5236 8.26233 11.4986 9.09033C11.4726 9.91833 11.1146 10.6583 10.5556 11.1843C9.99664 11.7103 9.23664 12.0233 8.40864 11.9983ZM16.1266 8.15033L14.3606 7.74033C14.2316 7.14133 14.0146 6.57633 13.7216 6.05733L14.7726 4.57933C14.9116 4.38533 14.8926 4.12033 14.7296 3.94633L13.9206 3.08733C13.7576 2.91333 13.4946 2.87933 13.2916 3.00533L11.7526 3.96533C11.2526 3.64133 10.7016 3.39033 10.1116 3.22633L9.80964 1.43833C9.76964 1.20333 9.56964 1.02833 9.33164 1.02133L8.15264 0.985326C7.91364 0.978326 7.70364 1.14033 7.64964 1.37233L7.24064 3.13933C6.64164 3.26733 6.07664 3.48433 5.55664 3.77733L4.07864 2.72633C3.88464 2.58833 3.61964 2.60633 3.44664 2.76933L2.58664 3.57833C2.41364 3.74133 2.37964 4.00533 2.50564 4.20733L3.46564 5.74633C3.14164 6.24633 2.89064 6.79833 2.72564 7.38833L0.937635 7.68933C0.702635 7.72933 0.528635 7.92933 0.520635 8.16733L0.485635 9.34733C0.477635 9.58533 0.639635 9.79533 0.872635 9.84933L2.63864 10.2583C2.76764 10.8573 2.98464 11.4233 3.27764 11.9423L2.22564 13.4203C2.08764 13.6143 2.10564 13.8793 2.26964 14.0523L3.07864 14.9123C3.24164 15.0853 3.50464 15.1203 3.70664 14.9933L5.24564 14.0333C5.74663 14.3583 6.29764 14.6093 6.88764 14.7733L7.18964 16.5613C7.22864 16.7963 7.42864 16.9713 7.66764 16.9783L8.84663 17.0143C9.08564 17.0213 9.29564 16.8593 9.34964 16.6273L9.75864 14.8603C10.3576 14.7323 10.9226 14.5153 11.4416 14.2213L12.9206 15.2733C13.1146 15.4113 13.3786 15.3933 13.5526 15.2293L14.4116 14.4213C14.5856 14.2573 14.6196 13.9943 14.4936 13.7923L13.5336 12.2533C13.8576 11.7523 14.1086 11.2013 14.2726 10.6113L16.0616 10.3103C16.2966 10.2703 16.4706 10.0703 16.4776 9.83233L16.5136 8.65233C16.5206 8.41433 16.3586 8.20433 16.1266 8.15033Z",fill:"currentColor"})}),Mi=e=>o.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.5605 1.42351C8.0791 0.904904 8.92215 0.906157 9.4395 1.42351L10.6922 2.67617C11.2108 3.19477 11.2095 4.03782 10.6922 4.55517L9.4395 5.80783C8.9209 6.32643 8.07785 6.32518 7.5605 5.80783L6.30784 4.55517C5.78923 4.03656 5.79049 3.19352 6.30784 2.67617L7.5605 1.42351ZM3.17618 5.80783C3.69478 5.28923 4.53782 5.29048 5.05517 5.80783L6.30784 7.0605C6.82644 7.5791 6.82519 8.42214 6.30784 8.93949L5.05517 10.1922C4.53657 10.7108 3.69353 10.7095 3.17618 10.1922L1.92351 8.93949C1.40491 8.42089 1.40616 7.57785 1.92351 7.0605L3.17618 5.80783ZM11.9448 5.80783C12.4634 5.28923 13.3065 5.29048 13.8238 5.80783L15.0765 7.0605C15.5951 7.5791 15.5938 8.42214 15.0765 8.93949L13.8238 10.1922C13.3052 10.7108 12.4622 10.7095 11.9448 10.1922L10.6922 8.93949C10.1736 8.42089 10.1748 7.57785 10.6922 7.0605L11.9448 5.80783ZM7.5605 10.1922C8.0791 9.67355 8.92215 9.67481 9.4395 10.1922L10.6922 11.4448C11.2108 11.9634 11.2095 12.8065 10.6922 13.3238L9.4395 14.5765C8.9209 15.0951 8.07785 15.0938 7.5605 14.5765L6.30784 13.3238C5.78923 12.8052 5.79049 11.9622 6.30784 11.4448L7.5605 10.1922Z",fill:"currentColor"})}),mC=e=>o.jsx(q9t,{...e}),Di=e=>o.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.24388 2.4018C6.24388 2.0394 6.53767 1.74561 6.90008 1.74561H10.0991C10.4614 1.74561 10.7553 2.0394 10.7553 2.4018V4.57546C10.7553 4.93787 10.4614 5.23166 10.0991 5.23166H9.31982V7.35469L10.0033 9.22664C9.90442 9.20146 9.80035 9.1761 9.6915 9.14986L9.62652 9.13422C9.30473 9.05687 8.92256 8.96501 8.61993 8.84491C8.5819 8.82981 8.54147 8.81292 8.49957 8.79391C8.45767 8.81292 8.41724 8.82981 8.3792 8.84491C8.07657 8.96501 7.6944 9.05687 7.37261 9.13422L7.30763 9.14986C7.19879 9.1761 7.09471 9.20146 6.99577 9.22664L7.67932 7.35469V5.23166H6.90008C6.53767 5.23166 6.24388 4.93787 6.24388 4.57546V2.4018ZM6.99577 9.22664C6.99577 9.22664 6.99578 9.22664 6.99577 9.22664L6.43283 10.7683H6.81806C7.18047 10.7683 7.47426 11.0622 7.47426 11.4245V13.5982C7.47426 13.9606 7.18047 14.2544 6.81806 14.2544H3.61909C3.25668 14.2544 2.96289 13.9606 2.96289 13.5982V11.4245C2.96289 11.0622 3.25668 10.7683 3.61909 10.7683H4.26617C4.2921 10.4663 4.32783 10.1494 4.37744 9.85171C4.43762 9.49063 4.52982 9.08135 4.68998 8.76102C4.93975 8.2615 5.44743 8.01751 5.7771 7.88788C6.14684 7.74249 6.57537 7.63889 6.92317 7.55505C7.24707 7.47696 7.49576 7.41679 7.67932 7.35469L6.99577 9.22664ZM6.43283 10.7683L6.99577 9.22664C6.75846 9.28705 6.55067 9.34646 6.37745 9.41458C6.22784 9.47341 6.1623 9.51712 6.14023 9.53254C6.09752 9.63631 6.04409 9.83055 5.99562 10.1214C5.96201 10.3231 5.93498 10.5439 5.91341 10.7683H6.43283ZM10.0033 9.22664L9.31982 7.35469C9.50338 7.41679 9.75206 7.47696 10.076 7.55505C10.4238 7.63889 10.8523 7.74249 11.2221 7.88788C11.5517 8.01751 12.0594 8.2615 12.3091 8.76102C12.4693 9.08135 12.5615 9.49063 12.6217 9.85171C12.6713 10.1494 12.707 10.4663 12.733 10.7683H13.38C13.7424 10.7683 14.0362 11.0622 14.0362 11.4245V13.5982C14.0362 13.9606 13.7424 14.2544 13.38 14.2544H10.1811C9.81867 14.2544 9.52488 13.9606 9.52488 13.5982V11.4245C9.52488 11.0622 9.81867 10.7683 10.1811 10.7683H10.5663L10.0033 9.22664ZM10.0033 9.22664L10.5663 10.7683H11.0857C11.0642 10.5439 11.0372 10.3231 11.0035 10.1214C10.9551 9.83055 10.9016 9.63631 10.8589 9.53254C10.8369 9.51712 10.7713 9.47341 10.6217 9.41458C10.4485 9.34646 10.2407 9.28705 10.0033 9.22664Z",fill:"currentColor"})}),gl=e=>o.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{d:"M6.53918 9.32122C6.34324 9.51508 6.02724 9.51338 5.83338 9.31744C5.63952 9.1215 5.6412 8.80551 5.83713 8.61164L10.1958 4.29931C10.7996 3.70186 10.8017 2.72852 10.2041 2.12839L10.1899 2.11428C9.58767 1.52481 8.62251 1.53208 8.0292 2.13052L2.29396 7.91536C2.0999 8.1111 1.78388 8.11246 1.58813 7.9184C1.39239 7.72433 1.39103 7.40831 1.58509 7.21257L7.32036 1.42774C8.30005 0.439581 9.89369 0.427613 10.8881 1.40094L10.9116 1.42425C11.4942 2.00929 11.7316 2.80913 11.6232 3.56922C12.389 3.44866 13.1999 3.67918 13.7961 4.26273C14.804 5.24929 14.8147 6.86824 13.82 7.86808L8.5531 13.1619C8.50045 13.2148 8.50024 13.3002 8.55263 13.3534L9.65448 14.4717C9.84794 14.668 9.8456 14.984 9.64925 15.1775C9.45291 15.3709 9.13691 15.3686 8.94345 15.1723L7.84163 14.054C7.40505 13.6109 7.40677 12.8988 7.8455 12.4579L13.1124 7.16405C13.7161 6.55727 13.7095 5.57478 13.0979 4.97606C12.4925 4.38347 11.4942 4.40725 10.8978 5.00886L6.53918 9.32122Z",fill:"currentColor"}),o.jsx("path",{d:"M8.84622 2.75411C9.04697 2.56188 9.36555 2.56381 9.56395 2.76076C9.76234 2.95771 9.76658 3.27625 9.57582 3.4784L9.56661 3.48794L5.25912 7.82701C4.67023 8.42022 4.672 9.37798 5.26305 9.96904C5.85624 10.5622 6.81818 10.5615 7.41052 9.9675L11.6299 5.73599L11.6395 5.72671C11.8406 5.53493 12.1592 5.53756 12.3572 5.73496C12.5583 5.93548 12.5587 6.26104 12.3582 6.46214L8.13877 10.6937C7.14498 11.6903 5.53105 11.6915 4.53584 10.6963C3.5442 9.70461 3.54127 8.09774 4.52928 7.10248L8.83677 2.76342L8.84622 2.75411Z",fill:"currentColor"})]}),B9=e=>o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{d:"M1.5 8.5V8C1.5 7.60218 1.65804 7.22064 1.93934 6.93934C2.22064 6.65804 2.60218 6.5 3 6.5H13C13.3978 6.5 13.7794 6.65804 14.0607 6.93934C14.342 7.22064 14.5 7.60218 14.5 8V8.5M8.70667 4.20667L7.29333 2.79333C7.20048 2.70037 7.09022 2.62661 6.96886 2.57628C6.84749 2.52595 6.71739 2.50003 6.586 2.5H3C2.60218 2.5 2.22064 2.65804 1.93934 2.93934C1.65804 3.22064 1.5 3.60218 1.5 4V12C1.5 12.3978 1.65804 12.7794 1.93934 13.0607C2.22064 13.342 2.60218 13.5 3 13.5H13C13.3978 13.5 13.7794 13.342 14.0607 13.0607C14.342 12.7794 14.5 12.3978 14.5 12V6C14.5 5.60218 14.342 5.22064 14.0607 4.93934C13.7794 4.65804 13.3978 4.5 13 4.5H9.414C9.14887 4.49977 8.89402 4.39426 8.70667 4.20667Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})});function lp(e){return o.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("rect",{width:"16",height:"16",x:"4",y:"4",rx:"2"}),o.jsx("rect",{width:"6",height:"6",x:"9",y:"9",rx:"1"}),o.jsx("path",{d:"M15 2v2"}),o.jsx("path",{d:"M15 20v2"}),o.jsx("path",{d:"M2 15h2"}),o.jsx("path",{d:"M2 9h2"}),o.jsx("path",{d:"M20 15h2"}),o.jsx("path",{d:"M20 9h2"}),o.jsx("path",{d:"M9 2v2"}),o.jsx("path",{d:"M9 20v2"})]})}const bdt=e=>o.jsxs("svg",{className:"h-3 w-3",width:"16",height:"16",viewBox:"0 0 181 108",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsxs("g",{clipPath:"url(#clip0_1480_1723)",children:[o.jsx("path",{d:"M51.2203 39.3158C51.2203 41.5066 51.4572 43.2829 51.8717 44.5856C52.3453 45.8882 52.9374 47.3093 53.7664 48.8487C54.0624 49.3224 54.1809 49.7961 54.1809 50.2106C54.1809 50.8027 53.8256 51.3948 53.0559 51.9869L49.3256 54.4737C48.7927 54.829 48.2598 55.0066 47.7861 55.0066C47.194 55.0066 46.6019 54.7106 46.0098 54.1777C45.1809 53.2895 44.4703 52.3422 43.8782 51.3948C43.2861 50.3882 42.694 49.2632 42.0427 47.9014C37.4243 53.3487 31.6217 56.0724 24.6348 56.0724C19.6611 56.0724 15.694 54.6514 12.7927 51.8093C9.8914 48.9672 8.41113 45.1777 8.41113 40.4408C8.41113 35.4079 10.1874 31.3224 13.7993 28.2435C17.4111 25.1645 22.2072 23.6251 28.3059 23.6251C30.319 23.6251 32.3914 23.8027 34.5822 24.0987C36.773 24.3948 39.023 24.8685 41.3914 25.4014V21.079C41.3914 16.579 40.444 13.4408 38.6085 11.6053C36.7138 9.76979 33.5164 8.88163 28.9572 8.88163C26.8848 8.88163 24.7532 9.11847 22.5624 9.65137C20.3717 10.1843 18.2401 10.8356 16.1677 11.6645C15.2203 12.079 14.5098 12.3158 14.0953 12.4343C13.6809 12.5527 13.3848 12.6119 13.148 12.6119C12.319 12.6119 11.9046 12.0198 11.9046 10.7764V7.87505C11.9046 6.92768 12.023 6.21716 12.319 5.80268C12.6151 5.38821 13.148 4.97374 13.9769 4.55926C16.0493 3.49347 18.5361 2.60531 21.4374 1.89479C24.3388 1.12505 27.4177 0.769788 30.6743 0.769788C37.7203 0.769788 42.8717 2.36847 46.1875 5.56584C49.444 8.76321 51.1019 13.6185 51.1019 20.1316V39.3158H51.2203ZM27.1809 48.3158C29.1348 48.3158 31.148 47.9606 33.2796 47.2501C35.4111 46.5395 37.3059 45.2369 38.9046 43.4606C39.8519 42.3356 40.5625 41.0922 40.9177 39.6711C41.273 38.2501 41.5098 36.5329 41.5098 34.5198V32.0329C39.7927 31.6185 37.9572 31.2632 36.0624 31.0264C34.1677 30.7895 32.3322 30.6711 30.4967 30.6711C26.5296 30.6711 23.6282 31.4408 21.6743 33.0395C19.7203 34.6382 18.773 36.8882 18.773 39.8487C18.773 42.6316 19.4835 44.704 20.9638 46.1251C22.3848 47.6053 24.4572 48.3158 27.1809 48.3158ZM74.7269 54.7106C73.6611 54.7106 72.9506 54.5329 72.4769 54.1185C72.0032 53.7632 71.5888 52.9343 71.2335 51.8093L57.319 6.03953C56.9638 4.85531 56.7861 4.08558 56.7861 3.6711C56.7861 2.72374 57.2598 2.19084 58.2072 2.19084H64.0098C65.1348 2.19084 65.9046 2.36847 66.319 2.78295C66.7927 3.13821 67.148 3.96716 67.5032 5.09216L77.4506 44.2895L86.6874 5.09216C86.9835 3.90795 87.3388 3.13821 87.8124 2.78295C88.2861 2.42768 89.1151 2.19084 90.1809 2.19084H94.9177C96.0427 2.19084 96.8124 2.36847 97.2861 2.78295C97.7598 3.13821 98.1743 3.96716 98.4111 5.09216L107.766 44.7632L118.01 5.09216C118.365 3.90795 118.78 3.13821 119.194 2.78295C119.668 2.42768 120.437 2.19084 121.503 2.19084H127.01C127.957 2.19084 128.49 2.66453 128.49 3.6711C128.49 3.96716 128.431 4.26321 128.372 4.61847C128.312 4.97374 128.194 5.44742 127.957 6.09874L113.687 51.8685C113.332 53.0527 112.918 53.8224 112.444 54.1777C111.97 54.5329 111.201 54.7698 110.194 54.7698H105.102C103.977 54.7698 103.207 54.5922 102.733 54.1777C102.26 53.7632 101.845 52.9935 101.608 51.8093L92.4309 13.6185L83.3125 51.7501C83.0164 52.9343 82.6611 53.704 82.1874 54.1185C81.7138 54.5329 80.8848 54.7106 79.819 54.7106H74.7269ZM150.812 56.3093C147.734 56.3093 144.655 55.954 141.694 55.2435C138.733 54.5329 136.424 53.7632 134.885 52.8751C133.937 52.3422 133.286 51.7501 133.049 51.2172C132.812 50.6843 132.694 50.0922 132.694 49.5593V46.5395C132.694 45.2961 133.168 44.704 134.056 44.704C134.411 44.704 134.766 44.7632 135.122 44.8816C135.477 45.0001 136.01 45.2369 136.602 45.4737C138.615 46.3619 140.806 47.0724 143.115 47.5461C145.484 48.0198 147.793 48.2566 150.161 48.2566C153.891 48.2566 156.793 47.6053 158.806 46.3027C160.819 45 161.885 43.1053 161.885 40.6777C161.885 39.0198 161.352 37.6579 160.286 36.5329C159.22 35.4079 157.207 34.4014 154.306 33.454L145.72 30.7895C141.398 29.4277 138.201 27.4145 136.247 24.7501C134.293 22.1448 133.286 19.2435 133.286 16.1645C133.286 13.6777 133.819 11.4869 134.885 9.59216C135.951 7.69742 137.372 6.03953 139.148 4.73689C140.924 3.37505 142.937 2.36847 145.306 1.65795C147.674 0.94742 150.161 0.651367 152.766 0.651367C154.069 0.651367 155.431 0.710578 156.734 0.888209C158.095 1.06584 159.339 1.30268 160.582 1.53953C161.766 1.83558 162.891 2.13163 163.957 2.48689C165.023 2.84216 165.852 3.19742 166.444 3.55268C167.273 4.02637 167.865 4.50005 168.22 5.03295C168.576 5.50663 168.753 6.15795 168.753 6.98689V9.76979C168.753 11.0132 168.28 11.6645 167.391 11.6645C166.918 11.6645 166.148 11.4277 165.141 10.954C161.766 9.41453 157.977 8.64479 153.773 8.64479C150.398 8.64479 147.734 9.17768 145.898 10.3027C144.062 11.4277 143.115 13.1448 143.115 15.5724C143.115 17.2303 143.707 18.6514 144.891 19.7764C146.076 20.9014 148.266 22.0264 151.405 23.0329L159.812 25.6974C164.076 27.0593 167.155 28.954 168.99 31.3816C170.826 33.8093 171.714 36.5922 171.714 39.6711C171.714 42.2172 171.181 44.5264 170.174 46.5395C169.108 48.5527 167.687 50.329 165.852 51.7501C164.016 53.2303 161.826 54.2961 159.28 55.0658C156.615 55.8948 153.832 56.3093 150.812 56.3093Z",fill:"currentColor"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M162.004 85.0856C142.524 99.4738 114.221 107.112 89.8855 107.112C55.7803 107.112 25.05 94.5001 1.83948 73.5396C0.00394917 71.8817 1.66184 69.6317 3.85263 70.9343C28.9579 85.5001 59.925 94.3225 91.9579 94.3225C113.57 94.3225 137.313 89.8225 159.162 80.5856C162.418 79.1054 165.201 82.7172 162.004 85.0856Z",fill:"#FF9900"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M170.115 75.8487C167.628 72.6513 153.654 74.3092 147.319 75.079C145.424 75.3158 145.128 73.6579 146.845 72.4145C157.976 64.5987 176.272 66.8487 178.404 69.454C180.536 72.1184 177.812 90.4145 167.391 99.1776C165.792 100.539 164.253 99.8289 164.963 98.0526C167.332 92.1908 172.601 78.9868 170.115 75.8487Z",fill:"#FF9900"})]}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_1480_1723",children:o.jsx("rect",{width:"180",height:"107.763",fill:"white",transform:"translate(0.0625)"})})})]}),OLr=e=>o.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 320 320",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",...e,children:o.jsx("path",{d:"m297.06 130.97c7.26-21.79 4.76-45.66-6.85-65.48-17.46-30.4-52.56-46.04-86.84-38.68-15.25-17.18-37.16-26.95-60.13-26.81-35.04-.08-66.13 22.48-76.91 55.82-22.51 4.61-41.94 18.7-53.31 38.67-17.59 30.32-13.58 68.54 9.92 94.54-7.26 21.79-4.76 45.66 6.85 65.48 17.46 30.4 52.56 46.04 86.84 38.68 15.24 17.18 37.16 26.95 60.13 26.8 35.06.09 66.16-22.49 76.94-55.86 22.51-4.61 41.94-18.7 53.31-38.67 17.57-30.32 13.55-68.51-9.94-94.51zm-120.28 168.11c-14.03.02-27.62-4.89-38.39-13.88.49-.26 1.34-.73 1.89-1.07l63.72-36.8c3.26-1.85 5.26-5.32 5.24-9.07v-89.83l26.93 15.55c.29.14.48.42.52.74v74.39c-.04 33.08-26.83 59.9-59.91 59.97zm-128.84-55.03c-7.03-12.14-9.56-26.37-7.15-40.18.47.28 1.3.79 1.89 1.13l63.72 36.8c3.23 1.89 7.23 1.89 10.47 0l77.79-44.92v31.1c.02.32-.13.63-.38.83l-64.41 37.19c-28.69 16.52-65.33 6.7-81.92-21.95zm-16.77-139.09c7-12.16 18.05-21.46 31.21-26.29 0 .55-.03 1.52-.03 2.2v73.61c-.02 3.74 1.98 7.21 5.23 9.06l77.79 44.91-26.93 15.55c-.27.18-.61.21-.91.08l-64.42-37.22c-28.63-16.58-38.45-53.21-21.95-81.89zm221.26 51.49-77.79-44.92 26.93-15.54c.27-.18.61-.21.91-.08l64.42 37.19c28.68 16.57 38.51 53.26 21.94 81.94-7.01 12.14-18.05 21.44-31.2 26.28v-75.81c.03-3.74-1.96-7.2-5.2-9.06zm26.8-40.34c-.47-.29-1.3-.79-1.89-1.13l-63.72-36.8c-3.23-1.89-7.23-1.89-10.47 0l-77.79 44.92v-31.1c-.02-.32.13-.63.38-.83l64.41-37.16c28.69-16.55 65.37-6.7 81.91 22 6.99 12.12 9.52 26.31 7.15 40.1zm-168.51 55.43-26.94-15.55c-.29-.14-.48-.42-.52-.74v-74.39c.02-33.12 26.89-59.96 60.01-59.94 14.01 0 27.57 4.92 38.34 13.88-.49.26-1.33.73-1.89 1.07l-63.72 36.8c-3.26 1.85-5.26 5.31-5.24 9.06l-.04 89.79zm14.63-31.54 34.65-20.01 34.65 20v40.01l-34.65 20-34.65-20z"})}),kLr=e=>o.jsx("svg",{className:"h-3 w-3",fill:"white",height:"78",strokeLinejoin:"round",viewBox:"0 0 16 16",width:"78",style:{color:"currentcolor"},...e,children:o.jsx("g",{transform:"translate(0,2)",children:o.jsx("path",{d:"M11.375 0h-2.411L13.352 11.13h2.411L11.375 0ZM4.4 0 0 11.13h2.46l0.9-2.336h4.604l0.9 2.336h2.46L6.924 0H4.4Zm-0.244 6.723 1.506-3.909 1.506 3.909H4.156Z",fill:"currentColor"})})}),xdt=e=>o.jsx("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",...e,children:o.jsx("path",{d:"M7.402 13.8777C9.45763 13.4674 11.1555 13.128 11.175 13.1233L11.2104 13.1148L9.2697 10.507C8.2023 9.07276 7.32898 7.8937 7.32898 7.88691C7.32898 7.87404 9.33293 1.63997 9.3442 1.61779C9.34797 1.61037 10.7117 4.27017 12.65 8.06532C14.4647 11.6184 15.9608 14.5479 15.9747 14.5754L16 14.6253L9.83224 14.6244L3.66449 14.6235L7.402 13.8777ZM0 13.0824C0 13.0787 0.914457 11.2855 2.03212 9.09735L4.06425 5.11896L6.43245 2.87384C7.73497 1.63902 8.80417 0.627201 8.80845 0.625356C8.81274 0.623511 8.79561 0.672228 8.77038 0.733617C8.74515 0.795006 7.58796 3.59893 6.19884 6.96455L3.67317 13.0839L1.83659 13.0865C0.826464 13.0879 0 13.0861 0 13.0824Z",fill:"#0089D6",style:{fill:"#0089D6",fillOpacity:1}})}),_Lr=e=>o.jsxs("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",width:"17",height:"18",fill:"none",...e,children:[o.jsx("mask",{id:"mask0_174_2406",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"17",height:"18",children:o.jsx("path",{d:"M17 0.5H0V17.5H17V0.5Z",fill:"white"})}),o.jsxs("g",{mask:"url(#mask0_174_2406)",children:[o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.50773 10.6219C5.9653 10.6219 6.8755 10.5968 8.13362 10.0788C9.59973 9.47518 12.5166 8.37942 14.6208 7.2539C16.0924 6.46668 16.7375 5.42553 16.7375 4.02344C16.7375 2.07751 15.16 0.5 13.2141 0.5H5.06095C2.26586 0.5 0 2.76586 0 5.56095C0 8.35604 2.12151 10.6219 5.50773 10.6219Z",fill:"#39594D"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.88672 14.107C6.88672 12.7369 7.71155 11.5016 8.97699 10.9764L11.5446 9.9108C14.1417 8.83294 17.0003 10.7415 17.0003 13.5535C17.0003 15.732 15.2339 17.4979 13.0553 17.4973L10.2754 17.4966C8.40372 17.4961 6.88672 15.9787 6.88672 14.107Z",fill:"#D18EE2"}),o.jsx("path",{d:"M2.91749 11.2891C1.30623 11.2891 0 12.5952 0 14.2065V14.5844C0 16.1956 1.30618 17.5018 2.91744 17.5018C4.5287 17.5018 5.83493 16.1956 5.83493 14.5844V14.2065C5.83493 12.5952 4.52875 11.2891 2.91749 11.2891Z",fill:"#FF7759"})]})]}),ELr=e=>o.jsxs("svg",{className:"h-3 w-3","data-testid":"geist-icon",height:"78",strokeLinejoin:"round",viewBox:"0 0 160 59",width:"104",style:{color:"currentcolor"},...e,children:[o.jsx("mask",{id:"mask0_4345_1846",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"160",height:"59",style:{maskType:"luminance"},children:o.jsx("path",{d:"M0.273438 0.219727H159.216V58.1817H0.273438V0.219727Z",fill:"white"})}),o.jsx("g",{mask:"url(#mask0_4345_1846)",children:o.jsx("path",{d:"M95.4635 0.314595C84.4822 0.314595 75.5599 9.19525 75.5599 20.1677C75.5599 31.1402 84.4632 40.0208 95.4635 40.0208C106.464 40.0208 115.367 31.1402 115.367 20.1677C115.348 9.21427 106.445 0.333611 95.4635 0.314595ZM95.4635 32.5664C88.6002 32.5664 83.0333 27.0136 83.0333 20.1677C83.0333 13.3218 88.6002 7.76902 95.4635 7.76902C102.327 7.76902 107.894 13.3218 107.894 20.1677C107.894 27.0136 102.327 32.5664 95.4635 32.5664ZM67.9912 0.39066C67.3049 0.314595 66.6376 0.276562 65.9513 0.276562C65.6081 0.276562 65.284 0.276562 64.9599 0.295578C64.6358 0.314595 64.2926 0.333611 63.9685 0.352628C62.634 0.44771 61.2995 0.675906 60.0031 1.03722C57.3531 1.74082 54.8556 2.99591 52.7013 4.68836C50.4898 6.43787 48.7358 8.68181 47.5347 11.23C46.9437 12.5041 46.5052 13.8543 46.2193 15.2234C46.0858 15.908 45.9905 16.5926 45.9142 17.2772C45.8952 17.6195 45.857 17.9618 45.857 18.3041L45.838 18.8175V19.293L45.8761 32.5854L45.9142 39.2221H53.3685L53.4067 32.5854L53.4448 19.293V18.5893C53.4448 18.3802 53.4829 18.171 53.4829 17.9618C53.5211 17.5434 53.5973 17.1441 53.6736 16.7257C53.8452 15.9271 54.093 15.1474 54.4362 14.4057C55.1225 12.9225 56.152 11.6293 57.4293 10.6025C58.7639 9.53755 60.3081 8.75787 61.9477 8.3205C62.7865 8.0923 63.6635 7.94017 64.5405 7.8641C64.7693 7.84509 64.979 7.82607 65.2078 7.82607C65.4365 7.82607 65.6653 7.80705 65.875 7.80705C66.2944 7.80705 66.7329 7.82607 67.1524 7.8641C68.8491 8.03525 70.4887 8.54869 71.9948 9.38541L75.7124 2.93886C73.3484 1.56968 70.7175 0.694923 67.9912 0.39066ZM20.3484 0.219513C9.36711 0.124431 0.36855 8.92902 0.273226 19.8825C0.177902 30.8359 9.00488 39.8116 19.9862 39.9067H26.8876V32.4713H20.3484C13.4851 32.5474 7.84193 27.0707 7.76567 20.2057C7.68941 13.3408 13.1801 7.73099 20.0624 7.65492H20.3484C27.2117 7.65492 32.7786 13.2077 32.8167 20.0536V38.3284C32.8167 45.1172 27.2689 50.651 20.4819 50.7271C17.2218 50.708 14.1142 49.3959 11.8265 47.0949L6.54553 52.3625C10.206 56.0326 15.1628 58.1244 20.3484 58.1625H20.6153C31.4632 58.0103 40.1757 49.2248 40.2329 38.4044V19.5592C39.966 8.81492 31.1391 0.238529 20.3484 0.219513ZM139.389 0.314595C128.407 0.314595 119.485 9.19525 119.504 20.1677C119.504 31.1212 128.407 40.0018 139.389 40.0018H146.195V32.5664H139.389C132.525 32.5664 126.958 27.0136 126.958 20.1677C126.958 13.3218 132.525 7.76902 139.389 7.76902C145.833 7.76902 151.209 12.6943 151.781 19.1028H151.762V57.2116H159.216V20.1677C159.216 9.21427 150.351 0.314595 139.389 0.314595Z",fill:"currentColor"})})]}),CLr=e=>o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 34 21",fill:"none",...e,children:o.jsx("path",{d:"M4.49805 11.6934C6.98237 11.6934 8.99609 13.7081 8.99609 16.1924C8.9959 18.6765 6.98225 20.6904 4.49805 20.6904C2.01394 20.6903 0.000196352 18.6765 0 16.1924C0 13.7081 2.01382 11.6935 4.49805 11.6934ZM10.3867 0C12.8709 0 14.8846 2.01388 14.8848 4.49805C14.8848 4.8377 14.847 5.16846 14.7755 5.48643C14.4618 6.88139 14.1953 8.4633 14.9928 9.65L16.2575 11.5319C16.3363 11.6491 16.4727 11.7115 16.6137 11.703C16.7369 11.6957 16.8525 11.6343 16.9214 11.5318L18.1876 9.64717C18.9772 8.47198 18.7236 6.90783 18.4205 5.52484C18.3523 5.21392 18.3164 4.89094 18.3164 4.55957C18.3167 2.07546 20.3313 0.0615234 22.8154 0.0615234C25.2994 0.0617476 27.3132 2.0756 27.3135 4.55957C27.3135 4.93883 27.2665 5.30712 27.178 5.65896C26.8547 6.94441 26.5817 8.37932 27.2446 9.52714L28.459 11.6301C28.4819 11.6697 28.5245 11.6934 28.5703 11.6934C31.0545 11.6935 33.0684 13.7081 33.0684 16.1924C33.0682 18.6765 31.0544 20.6903 28.5703 20.6904C26.0861 20.6904 24.0725 18.6765 24.0723 16.1924C24.0723 15.8049 24.1212 15.4288 24.2133 15.0701C24.5458 13.7746 24.8298 12.3251 24.1609 11.1668L23.0044 9.16384C22.9656 9.09659 22.8931 9.05859 22.8154 9.05859C22.7983 9.05859 22.7824 9.06614 22.7728 9.08033L21.4896 10.9895C20.686 12.1851 20.9622 13.781 21.284 15.1851C21.3582 15.5089 21.3975 15.8461 21.3975 16.1924C21.3973 18.6764 19.3834 20.6902 16.8994 20.6904C14.4152 20.6904 12.4006 18.6765 12.4004 16.1924C12.4004 15.932 12.4226 15.6768 12.4651 15.4286C12.6859 14.14 12.8459 12.7122 12.1167 11.6271L11.2419 10.3253C10.6829 9.49347 9.71913 9.05932 8.78286 8.70188C7.0906 8.05584 5.88867 6.41734 5.88867 4.49805C5.88886 2.0139 7.90254 3.29835e-05 10.3867 0Z",fill:e.fill||"currentColor"})}),jLr=e=>o.jsxs("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",width:"176",height:"162",viewBox:"0 0 176 162",fill:"none",...e,children:[o.jsx("rect",{x:"15",y:"1",width:"32",height:"32",fill:"#FFCD00",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"143",y:"1",width:"32",height:"32",fill:"#FFCD00",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"15",y:"33",width:"32",height:"32",fill:"#FFA400",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"47",y:"33",width:"32",height:"32",fill:"#FFA400",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"111",y:"33",width:"32",height:"32",fill:"#FFA400",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"143",y:"33",width:"32",height:"32",fill:"#FFA400",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"15",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"47",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"79",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"111",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"143",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"15",y:"97",width:"32",height:"32",fill:"#FF4902",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"79",y:"97",width:"32",height:"32",fill:"#FF4902",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"143",y:"97",width:"32",height:"32",fill:"#FF4902",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"15",y:"129",width:"32",height:"32",fill:"#FF0006",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"143",y:"129",width:"32",height:"32",fill:"#FF0006",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{y:"1",width:"16",height:"160",fill:"black"}),o.jsx("rect",{x:"63",y:"97",width:"16",height:"32",fill:"black"}),o.jsx("rect",{x:"95",y:"33",width:"16",height:"32",fill:"black"}),o.jsx("rect",{x:"127",y:"1",width:"16",height:"32",fill:"black"}),o.jsx("rect",{x:"127",y:"97",width:"16",height:"64",fill:"black"})]}),TLr=e=>o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"128",height:"113",viewBox:"0 0 128 113",children:[o.jsxs("g",{clipPath:"url(#clip0_236_138)",...e,children:[o.jsx("path",{d:"M34.593 94.0509H33.3844L27.3514 88.0179V86.8094L36.5743 77.5866H42.9639L43.8158 78.4385V84.8281L34.593 94.0509Z",fill:e.fill||"#05BDBA"}),o.jsx("path",{d:"M27.3514 25.816V24.6074L33.3844 18.5744H34.593L43.8158 27.7972V34.1868L42.9639 35.0388H36.5743L27.3514 25.816Z",fill:e.fill||"#05BDBA"}),o.jsx("path",{d:"M80.4594 74.6047H71.6824L70.9493 73.8717V53.3259C70.9493 49.6705 69.5129 46.8372 65.1046 46.7382C62.836 46.6787 60.2405 46.7382 57.4668 46.8471L57.0507 47.2731V73.8618L56.3176 74.5948H47.5406L46.8075 73.8618V38.7636L47.5406 38.0305H67.2939C74.9713 38.0305 81.1925 44.2517 81.1925 51.9291V73.8717L80.4594 74.6047Z",fill:e.fill||"#014847"}),o.jsx("path",{d:"M35.8412 61.4491H0.73307L0 60.716V51.9192L0.73307 51.1861H35.8412L36.5743 51.9192V60.716L35.8412 61.4491Z",fill:e.fill||"#05BDBA"}),o.jsx("path",{d:"M127.277 61.4491H92.1687L91.4356 60.716V51.9192L92.1687 51.1861H127.277L128.01 51.9192V60.716L127.277 61.4491Z",fill:e.fill||"#05BDBA"}),o.jsx("path",{d:"M58.9428 27.0642V0.73307L59.6759 0H68.4727L69.2058 0.73307V27.0642L68.4727 27.7972H59.6759L58.9428 27.0642Z",fill:e.fill||"#05BDBA"}),o.jsx("path",{d:"M58.9428 111.902V85.5711L59.6759 84.838H68.4727L69.2058 85.5711V111.902L68.4727 112.635H59.6759L58.9428 111.902Z",fill:e.fill||"#05BDBA"})]}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_236_138",children:o.jsx("rect",{width:"128",height:"112.635",fill:"white"})})})]}),sRe=e=>o.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 320 320",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",...e,children:o.jsx("path",{d:"m297.06 130.97c7.26-21.79 4.76-45.66-6.85-65.48-17.46-30.4-52.56-46.04-86.84-38.68-15.25-17.18-37.16-26.95-60.13-26.81-35.04-.08-66.13 22.48-76.91 55.82-22.51 4.61-41.94 18.7-53.31 38.67-17.59 30.32-13.58 68.54 9.92 94.54-7.26 21.79-4.76 45.66 6.85 65.48 17.46 30.4 52.56 46.04 86.84 38.68 15.24 17.18 37.16 26.95 60.13 26.8 35.06.09 66.16-22.49 76.94-55.86 22.51-4.61 41.94-18.7 53.31-38.67 17.57-30.32 13.55-68.51-9.94-94.51zm-120.28 168.11c-14.03.02-27.62-4.89-38.39-13.88.49-.26 1.34-.73 1.89-1.07l63.72-36.8c3.26-1.85 5.26-5.32 5.24-9.07v-89.83l26.93 15.55c.29.14.48.42.52.74v74.39c-.04 33.08-26.83 59.9-59.91 59.97zm-128.84-55.03c-7.03-12.14-9.56-26.37-7.15-40.18.47.28 1.3.79 1.89 1.13l63.72 36.8c3.23 1.89 7.23 1.89 10.47 0l77.79-44.92v31.1c.02.32-.13.63-.38.83l-64.41 37.19c-28.69 16.52-65.33 6.7-81.92-21.95zm-16.77-139.09c7-12.16 18.05-21.46 31.21-26.29 0 .55-.03 1.52-.03 2.2v73.61c-.02 3.74 1.98 7.21 5.23 9.06l77.79 44.91-26.93 15.55c-.27.18-.61.21-.91.08l-64.42-37.22c-28.63-16.58-38.45-53.21-21.95-81.89zm221.26 51.49-77.79-44.92 26.93-15.54c.27-.18.61-.21.91-.08l64.42 37.19c28.68 16.57 38.51 53.26 21.94 81.94-7.01 12.14-18.05 21.44-31.2 26.28v-75.81c.03-3.74-1.96-7.2-5.2-9.06zm26.8-40.34c-.47-.29-1.3-.79-1.89-1.13l-63.72-36.8c-3.23-1.89-7.23-1.89-10.47 0l-77.79 44.92v-31.1c-.02-.32.13-.63.38-.83l64.41-37.16c28.69-16.55 65.37-6.7 81.91 22 6.99 12.12 9.52 26.31 7.15 40.1zm-168.51 55.43-26.94-15.55c-.29-.14-.48-.42-.52-.74v-74.39c.02-33.12 26.89-59.96 60.01-59.94 14.01 0 27.57 4.92 38.34 13.88-.49.26-1.33.73-1.89 1.07l-63.72 36.8c-3.26 1.85-5.26 5.31-5.24 9.06l-.04 89.79zm14.63-31.54 34.65-20.01 34.65 20v40.01l-34.65 20-34.65-20z"})}),NLr=e=>o.jsx("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1000 1000",width:"78",height:"78",style:{color:"currentcolor"},...e,children:o.jsxs("g",{children:[o.jsx("polygon",{fill:"currentColor",points:"226.83 411.15 501.31 803.15 623.31 803.15 348.82 411.15 226.83 411.15"}),o.jsx("polygon",{fill:"currentColor",points:"348.72 628.87 226.69 803.15 348.77 803.15 409.76 716.05 348.72 628.87"}),o.jsx("polygon",{fill:"currentColor",points:"651.23 196.85 440.28 498.12 501.32 585.29 773.31 196.85 651.23 196.85"}),o.jsx("polygon",{fill:"currentColor",points:"673.31 383.25 673.31 803.15 773.31 803.15 773.31 240.44 673.31 383.25"})]})}),ALr={duration:5e3,cancel:{label:o.jsx(Ce,{children:o.jsx(Wl,{})}),onClick:()=>{}},unstyled:!0,classNames:{toast:"bg-surface3 w-full h-auto rounded-xl gap-2 border border-border1 px-3 py-2 flex items-center justify-between pointer-events-auto shadow-card :data-content:flex-1",title:"text-xs font-medium text-neutral5",description:"text-xs text-neutral3",cancelButton:"bg-transparent! hover:bg-surface2! border-none! rounded-md! p-1.5! m-0! text-neutral3! hover:text-neutral6! shrink-0 transition-all",actionButton:"bg-white! flex items-center justify-center font-medium text-black! order-last hover:opacity-80"}};function Jd(e){const{classNames:t,...r}=ALr,{classNames:n,...s}=e||{};return{...r,classNames:{...t,title:Y(t?.title,n?.title),toast:Y(t?.toast,n?.toast),cancelButton:Y(t?.cancelButton,n?.cancelButton),actionButton:Y(t?.actionButton,n?.actionButton),description:Y(t?.description,n?.description)},...s}}const ze=(e,t={})=>{if(Array.isArray(e))return e.forEach(r=>mc(r,Jd(t)));if(je.isValidElement(e))return mc(e,Jd(t));if(typeof e=="string")return mc(e,Jd(t));throw new Error("Invalid message type")};ze.success=(e,t={})=>{const r={...t,icon:o.jsx(Ce,{className:"text-accent1 shrink-0",children:o.jsx(jzt,{})}),classNames:{...t.classNames,toast:Y("bg-accent1Darker border-accent1/30 border-l-[3px] border-l-accent1",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return mc.success(e,Jd(r));case"object":return e.forEach(n=>mc.success(n,Jd(r)))}};ze.error=(e,t={})=>{const r={...t,icon:o.jsx(Ce,{className:"text-accent2 shrink-0",children:o.jsx(NHe,{})}),classNames:{...t.classNames,toast:Y("bg-accent2Darker border-accent2/30 border-l-[3px] border-l-accent2",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return mc.error(e,Jd(r));case"object":return e.forEach(n=>mc.error(n,Jd(r)))}};ze.warning=(e,t={})=>{const r={...t,icon:o.jsx(Ce,{className:"text-accent6 shrink-0",children:o.jsx(Uce,{})}),classNames:{...t.classNames,toast:Y("bg-accent6Darker border-accent6/30 border-l-[3px] border-l-accent6",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return mc.warning(e,Jd(r));case"object":return e.forEach(n=>mc.warning(n,Jd(r)))}};ze.info=(e,t={})=>{const r={...t,icon:o.jsx(Ce,{className:"text-accent3 shrink-0",children:o.jsx($R,{})}),classNames:{...t.classNames,toast:Y("bg-accent3Darker border-accent3/30 border-l-[3px] border-l-accent3",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return mc.info(e,Jd(r));case"object":return e.forEach(n=>mc.info(n,Jd(r)))}};ze.custom=(e,t={})=>mc(e,Jd(t));ze.dismiss=e=>{e&&mc.dismiss(e)};ze.promise=({myPromise:e,loadingMessage:t,successMessage:r,errorMessage:n,onSuccess:s,onError:a,options:i={}})=>mc.promise(e,{loading:t??"Loading...",success:l=>(s?.(l),r),error:l=>(a?.(l),n||l?.message||"Error..."),...Jd(i)});function cf({text:e,copyMessage:t="Copied to clipboard!"}){const[r,n]=b.useState(!1),s=b.useRef(null),a=b.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{ze.success(t),n(!0),s.current&&(clearTimeout(s.current),s.current=null),s.current=setTimeout(()=>{n(!1)},2e3)}).catch(()=>{ze.error("Failed to copy to clipboard.")})},[e,t]);return{isCopied:r,handleCopy:a}}function ta({content:e,copyMessage:t,tooltip:r="Copy to clipboard",size:n="sm",className:s}){const[a,i]=b.useState(!1),{handleCopy:l}=cf({text:e,copyMessage:t}),c=()=>{l(),i(!0),setTimeout(()=>i(!1),2e3)};return o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(ce,{onClick:c,type:"button",size:n,className:s,"aria-label":a?"Copied!":r,children:a?o.jsx(cv,{}):o.jsx(IHe,{})})}),o.jsx(Wr,{children:a?"Copied!":r})]})}const ILr="mastra-theme",RLr="mastra-playground-store",fie=e=>e==="dark"||e==="light"||e==="system",PLr=e=>{try{const t=e.getItem(RLr);if(!t)return;const n=JSON.parse(t)?.state?.theme;return fie(n)?n:void 0}catch{return}},MLr=(e=ILr)=>({get(){if(typeof window>"u")return null;try{const t=window.localStorage.getItem(e);if(fie(t))return t;const r=PLr(window.localStorage);return r?(window.localStorage.setItem(e,r),r):null}catch{return null}},set(t){if(!(typeof window>"u"))try{window.localStorage.setItem(e,t)}catch{}},subscribe(t){if(typeof window>"u")return()=>{};const r=n=>{if(n.key===e){if(n.newValue===null){t(null);return}fie(n.newValue)&&t(n.newValue)}};return window.addEventListener("storage",r),()=>window.removeEventListener("storage",r)}}),wdt=b.createContext(null),Sdt="(prefers-color-scheme: dark)",DLr=typeof window>"u"?b.useEffect:b.useLayoutEffect,Odt=()=>typeof window>"u"||typeof window.matchMedia!="function"||window.matchMedia(Sdt).matches?"dark":"light",kdt=e=>{if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};const t=window.matchMedia(Sdt);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},LLr=(e,t)=>{e.classList.remove(t==="dark"?"light":"dark"),e.classList.add(t)},_dt=({children:e,defaultTheme:t="system",storageKey:r,target:n})=>{const s=b.useMemo(()=>MLr(r),[r]),a=b.useRef(null),[i,l]=b.useState(()=>s.get()??t),c=b.useSyncExternalStore(kdt,Odt,()=>"dark");b.useEffect(()=>s.subscribe(f=>l(f??t)),[s,t]);const u=i==="system"?c:i;DLr(()=>{const f=n??(typeof window>"u"?null:window.document.documentElement);a.current&&a.current!==f&&a.current.classList.remove("dark","light"),f&&LLr(f,u),a.current=f},[u,n]);const d=b.useMemo(()=>({theme:i,resolvedTheme:u,systemTheme:c,setTheme:f=>{l(f),s.set(f)}}),[i,u,c,s]);return o.jsx(wdt.Provider,{value:d,children:e})},$Lr=()=>{},gC=()=>{const e=b.useContext(wdt),t=b.useSyncExternalStore(kdt,Odt,()=>"dark");return b.useMemo(()=>e??{theme:"system",resolvedTheme:t,systemTheme:t,setTheme:$Lr},[e,t])};function FLr(){const e=VE({settings:{fontFamily:"var(--geist-mono)",fontSize:"0.8rem",lineHighlight:"transparent",gutterBackground:"transparent",gutterForeground:"var(--neutral2)",background:"transparent",foreground:"var(--neutral6)",caret:"var(--neutral6)"},styles:[{tag:[ne.className,ne.propertyName],color:"var(--neutral6)"},{tag:ne.heading,color:"var(--accent3)",fontWeight:"bold"},{tag:[ne.heading1,ne.heading2,ne.heading3,ne.heading4,ne.heading5,ne.heading6],color:"var(--accent3)",fontWeight:"bold"},{tag:ne.emphasis,fontStyle:"italic",color:"var(--neutral6)"},{tag:ne.strong,fontWeight:"bold",color:"var(--neutral6)"},{tag:ne.link,color:"var(--accent3)",textDecoration:"underline"},{tag:ne.url,color:"var(--accent3)"},{tag:ne.monospace,color:"var(--neutral6)"},{tag:ne.strikethrough,textDecoration:"line-through"},{tag:ne.quote,fontStyle:"italic",color:"var(--neutral2)"}]}),t=ft.theme({".cm-editor":{backgroundColor:"transparent"},".cm-content":{color:"var(--neutral6)",caretColor:"var(--neutral6)"},".cm-lineNumbers .cm-gutterElement":{color:"var(--neutral2)"},".cm-activeLineGutter":{color:"var(--neutral3)"},".cm-cursor":{borderLeftColor:"var(--neutral6)"},".cm-selectionBackground, .cm-content ::selection":{backgroundColor:"color-mix(in srgb, var(--accent3) 22%, transparent)"},".cm-tooltip-autocomplete":{backgroundColor:"var(--surface2)",border:"1px solid var(--border1)",borderRadius:"6px",boxShadow:"0 8px 16px rgba(0, 0, 0, 0.2)"},".cm-tooltip-autocomplete > ul":{fontFamily:"var(--geist-mono)"},".cm-completionLabel":{color:"var(--neutral6)"},".cm-completionDetail":{color:"var(--neutral3)",fontSize:"0.7rem",marginLeft:"auto",paddingLeft:"12px"},".cm-completionInfo":{backgroundColor:"var(--surface2)",border:"1px solid var(--border1)",color:"var(--neutral3)",padding:"8px 12px"},".cm-completionIcon":{display:"none"},"ul.cm-completionList li[aria-selected]":{backgroundColor:"var(--surface4)",color:"var(--neutral6)"},".cm-line .cm-variable-highlight":{color:"var(--accent6) !important",fontWeight:"500"}});return[e,t]}function zLr(){const e=ft.theme({"&":{backgroundColor:"transparent",color:"var(--neutral6)",fontSize:"0.8rem"},"&.cm-editor .cm-scroller":{fontFamily:"var(--geist-mono)"},".cm-gutters":{backgroundColor:"transparent",color:"var(--neutral2)",borderRight:"none"},".cm-content":{color:"var(--neutral6)",caretColor:"var(--neutral6)"},".cm-activeLine":{backgroundColor:"transparent"},".cm-lineNumbers .cm-gutterElement":{color:"var(--neutral2)"},".cm-activeLineGutter":{backgroundColor:"transparent",color:"var(--neutral3)"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--neutral6)"},"&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection":{background:"color-mix(in srgb, var(--accent3) 22%, transparent) !important"},".cm-tooltip-autocomplete":{backgroundColor:"var(--surface2)",border:"1px solid var(--border1)",borderRadius:"6px",boxShadow:"0 8px 16px rgba(0, 0, 0, 0.2)"},".cm-tooltip-autocomplete > ul":{fontFamily:"var(--geist-mono)"},".cm-completionLabel":{color:"var(--neutral6)"},".cm-completionDetail":{color:"var(--neutral3)",fontSize:"0.7rem",marginLeft:"auto",paddingLeft:"12px"},".cm-completionInfo":{backgroundColor:"var(--surface2)",border:"1px solid var(--border1)",color:"var(--neutral3)",padding:"8px 12px"},".cm-completionIcon":{display:"none"},"ul.cm-completionList li[aria-selected]":{backgroundColor:"var(--surface4)",color:"var(--neutral6)"},".cm-line .cm-variable-highlight":{color:"var(--accent6) !important",fontWeight:"500"}}),t=Pp.define([{tag:[ne.comment,ne.bracket],color:"var(--neutral2)"},{tag:[ne.string,ne.meta,ne.regexp],color:"var(--accent1)"},{tag:[ne.atom,ne.bool,ne.special(ne.variableName)],color:"var(--accent6)"},{tag:[ne.keyword,ne.operator,ne.tagName],color:"var(--accent2)"},{tag:[ne.function(ne.propertyName),ne.propertyName],color:"var(--accent5)"},{tag:[ne.definition(ne.variableName),ne.function(ne.variableName),ne.className,ne.attributeName],color:"var(--accent3)"},{tag:[ne.variableName,ne.number],color:"var(--accent5)"},{tag:[ne.name,ne.quote],color:"var(--accent1)"},{tag:ne.heading,color:"var(--accent3)",fontWeight:"bold"},{tag:[ne.heading1,ne.heading2,ne.heading3,ne.heading4,ne.heading5,ne.heading6],color:"var(--accent3)",fontWeight:"bold"},{tag:[ne.emphasis],fontStyle:"italic",color:"var(--neutral6)"},{tag:[ne.strong],fontWeight:"bold",color:"var(--neutral6)"},{tag:ne.link,color:"var(--accent3)",textDecoration:"underline"},{tag:ne.url,color:"var(--accent3)"},{tag:ne.monospace,color:"var(--neutral6)"},{tag:ne.strikethrough,textDecoration:"line-through"},{tag:[ne.deleted],color:"var(--accent2)"},{tag:ne.invalid,color:"var(--error)"},{tag:[ne.standard(ne.tagName)],color:"var(--accent1)"}]);return[e,Wx(t)]}const wv=()=>{const e=gC().resolvedTheme==="dark";return b.useMemo(()=>e?FLr():zLr(),[e])},Xn=b.forwardRef(({data:e,value:t,onChange:r,showCopyButton:n=!0,className:s,language:a="json",highlightVariables:i=!1,placeholder:l,schema:c,autoFocus:u,lineNumbers:d=!0,editable:f,...h},p)=>{const m=wv(),g=e?JSON.stringify(e,null,2):t??"",y=b.useMemo(()=>{const x=[];return a==="json"?x.push(Gd):a==="markdown"&&(x.push(Que({base:dS,codeLanguages:bZe})),x.push(ft.lineWrapping)),i&&a==="markdown"&&x.push(xLr),c&&a==="markdown"&&x.push(mLr(c)),f===!1&&x.push(zn.readOnly.of(!0)),x},[a,i,c,f]);return o.jsxs("div",{className:Y("rounded-md bg-surface3 p-1 font-mono relative border border-border1 overflow-hidden",s),...h,children:[n&&o.jsx(ta,{content:g,className:"absolute top-2 right-2 z-20"}),o.jsx(vc,{ref:p,value:g,theme:m,extensions:y,onChange:r,editable:f,"aria-label":"Code editor",placeholder:l,height:"100%",style:{height:"100%"},autoFocus:u,basicSetup:{lineNumbers:d}})]})});async function BLr(e,t){const{codeToTokens:r,bundledLanguages:n}=await Ke(async()=>{const{codeToTokens:a,bundledLanguages:i}=await import("./index-CiNbRhWy.js");return{codeToTokens:a,bundledLanguages:i}},__vite__mapDeps([23,1]),import.meta.url);if(!(t in n))return null;const{tokens:s}=await r(e,{lang:t,defaultColor:!1,themes:{light:"github-light",dark:"github-dark"}});return s}function Ja({iconSlot:e,titleSlot:t,descriptionSlot:r,actionSlot:n,className:s,as:a="h3"}){return o.jsxs("div",{className:Y("flex flex-col items-center justify-center text-center py-10 px-6","transition-opacity duration-normal ease-out-custom",s),children:[e&&o.jsx("div",{className:"mb-4",children:e}),o.jsx(a,{className:"font-medium text-neutral5 text-ui-md",children:t}),r&&o.jsx("p",{className:"mt-1.5 text-neutral3 text-ui-sm max-w-md",children:r}),n&&o.jsx("div",{className:"mt-5",children:n})]})}const wf=({children:e,className:t,onClick:r})=>o.jsx("div",{tabIndex:r?0:void 0,onKeyDown:n=>{r&&(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),r?.())},className:Y("flex gap-3 group/entity bg-surface3 rounded-xl border border-border1 py-3 px-4",r&&"cursor-pointer hover:bg-surface4 transition-all",t),onClick:r,children:e}),Edt=({children:e,className:t,style:r})=>o.jsx(Ce,{size:"lg",className:Y("text-neutral3 mt-1 shrink-0",t),style:r,children:e}),Sf=({children:e,className:t})=>o.jsx(me,{as:"p",variant:"ui-lg",className:Y("text-neutral6 font-medium",t),children:e}),Of=({children:e,className:t})=>o.jsx(me,{as:"div",variant:"ui-sm",className:Y("text-neutral3",t),children:e}),kf=({children:e,className:t})=>o.jsx("div",{className:Y("flex-1 w-full",t),children:e});function Zs({resource:e,title:t,description:r,actionSlot:n,className:s}){const a="Permission Denied",i=e?`You don't have permission to access ${e}. Contact your administrator for access.`:"You don't have permission to access this resource. Contact your administrator for access.";return o.jsx(Ja,{className:s,iconSlot:o.jsx(Ce,{size:"lg",className:"text-neutral3",children:o.jsx(N9t,{})}),titleSlot:t??a,descriptionSlot:r??i,actionSlot:n})}function sa({title:e,description:t,className:r}){const[n,s]=b.useState(!1),a=Ge(),i=b.useCallback(async()=>{try{s(!0);const{baseUrl:l="",apiPrefix:c}=a.options||{},u=(c||"/api").trim(),d=(u.startsWith("/")?u:`/${u}`).replace(/\/$/,""),f=new URLSearchParams({redirect_uri:window.location.href}),h=`${l}${d}/auth/sso/login?${f}`,p=await fetch(h,{credentials:"include",headers:{"Content-Type":"application/json"}});if(p.ok){const m=await p.json();window.location.href=m.url}}finally{s(!1)}},[a]);return o.jsx(Ja,{className:r,iconSlot:o.jsx(Ce,{size:"lg",className:"text-neutral3",children:o.jsx(w9t,{})}),titleSlot:e??"Session Expired",descriptionSlot:t??"Your session has expired. Please log in again to continue.",actionSlot:o.jsx(ce,{variant:"default",onClick:i,disabled:n,children:n?"Redirecting...":"Log in"})})}const Cn=({children:e,border:t=!0,className:r})=>o.jsx("header",{className:Y("h-header-default z-50 flex w-full items-center gap-4 bg-transparent px-3",{"border-b border-border1":t},r),children:e}),Qu=({children:e})=>o.jsx(me,{as:"h1",variant:"ui-md",className:"text-neutral6 flex items-center gap-2",children:e}),fu=({children:e})=>o.jsx("div",{className:"ml-auto flex items-center gap-3",children:e}),ULr=({children:e})=>o.jsx("div",{className:"gap-2 flex items-center",children:e}),Yb=e=>o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 34 21",fill:"none",...e,children:o.jsx("path",{d:"M4.49805 11.6934C6.98237 11.6934 8.99609 13.7081 8.99609 16.1924C8.9959 18.6765 6.98225 20.6904 4.49805 20.6904C2.01394 20.6903 0.000196352 18.6765 0 16.1924C0 13.7081 2.01382 11.6935 4.49805 11.6934ZM10.3867 0C12.8709 0 14.8846 2.01388 14.8848 4.49805C14.8848 4.8377 14.847 5.16846 14.7755 5.48643C14.4618 6.88139 14.1953 8.4633 14.9928 9.65L16.2575 11.5319C16.3363 11.6491 16.4727 11.7115 16.6137 11.703C16.7369 11.6957 16.8525 11.6343 16.9214 11.5318L18.1876 9.64717C18.9772 8.47198 18.7236 6.90783 18.4205 5.52484C18.3523 5.21392 18.3164 4.89094 18.3164 4.55957C18.3167 2.07546 20.3313 0.0615234 22.8154 0.0615234C25.2994 0.0617476 27.3132 2.0756 27.3135 4.55957C27.3135 4.93883 27.2665 5.30712 27.178 5.65896C26.8547 6.94441 26.5817 8.37932 27.2446 9.52714L28.459 11.6301C28.4819 11.6697 28.5245 11.6934 28.5703 11.6934C31.0545 11.6935 33.0684 13.7081 33.0684 16.1924C33.0682 18.6765 31.0544 20.6903 28.5703 20.6904C26.0861 20.6904 24.0725 18.6765 24.0723 16.1924C24.0723 15.8049 24.1212 15.4288 24.2133 15.0701C24.5458 13.7746 24.8298 12.3251 24.1609 11.1668L23.0044 9.16384C22.9656 9.09659 22.8931 9.05859 22.8154 9.05859C22.7983 9.05859 22.7824 9.06614 22.7728 9.08033L21.4896 10.9895C20.686 12.1851 20.9622 13.781 21.284 15.1851C21.3582 15.5089 21.3975 15.8461 21.3975 16.1924C21.3973 18.6764 19.3834 20.6902 16.8994 20.6904C14.4152 20.6904 12.4006 18.6765 12.4004 16.1924C12.4004 15.932 12.4226 15.6768 12.4651 15.4286C12.6859 14.14 12.8459 12.7122 12.1167 11.6271L11.2419 10.3253C10.6829 9.49347 9.71913 9.05932 8.78286 8.70188C7.0906 8.05584 5.88867 6.41734 5.88867 4.49805C5.88886 2.0139 7.90254 3.29835e-05 10.3867 0Z",fill:"currentColor"})}),VLr={default:"[&>tbody>tr]:h-table-row",small:"[&>tbody>tr]:h-table-row-small"},qLr=({className:e,children:t,size:r="default",style:n})=>o.jsx("table",{className:Y("w-full",VLr[r],e),style:n,children:t}),HLr=({className:e,children:t})=>o.jsx("thead",{children:o.jsx("tr",{className:Y("h-table-header border-b border-border1 bg-surface2/80",e),children:t})}),QLr=({className:e,children:t,...r})=>o.jsx("th",{className:Y("text-neutral2 text-ui-xs h-full whitespace-nowrap text-left font-medium uppercase tracking-wide first:pl-3 last:pr-3",e),...r,children:t}),WLr=({className:e,children:t,...r})=>o.jsx("tbody",{className:Y("",e),...r,children:t}),GLr=b.forwardRef(({className:e,children:t,selected:r=!1,style:n,onClick:s,isActive:a=!1,...i},l)=>{const c=b.useRef(null);b.useEffect(()=>{l&&(typeof l=="function"?l(c.current):l.current=c.current)},[l]),b.useEffect(()=>{a&&c.current&&(c.current.focus(),c.current.scrollIntoView({block:"nearest"}))},[a]);const u=d=>{d.key==="Enter"&&s&&s()};return o.jsx("tr",{className:Y("border-b border-border1","transition-colors duration-normal ease-out-custom","hover:bg-surface3","focus:bg-surface3 focus:outline-hidden focus:ring-1 focus:ring-inset focus:ring-accent1/50",r&&"bg-surface4",s&&"cursor-pointer",e),style:n,onClick:s,ref:c,tabIndex:s?0:void 0,onKeyDown:u,"data-active":a||void 0,...i,children:t})}),ZLr=({className:e,children:t,...r})=>o.jsx("td",{className:Y("text-neutral5 first:pl-3 last:pr-3",e),...r,children:o.jsx("div",{className:Y("flex h-full w-full shrink-0 items-center"),children:t})}),YLr=x1(Y("flex w-full text-neutral6 border bg-transparent","transition-all duration-normal ease-out-custom","placeholder:text-neutral2 placeholder:transition-opacity placeholder:duration-normal","focus:placeholder:opacity-70","min-h-[80px] resize-y"),{variants:{variant:{default:Y(ddt,cme,ume),unstyled:"border-0 bg-transparent shadow-none focus:shadow-none focus:ring-0"},size:{sm:"px-2 py-1.5 text-ui-sm",md:"px-3 py-2 text-ui-sm",default:"px-3 py-2 text-ui-md",lg:"px-4 py-3 text-ui-sm"}},defaultVariants:{variant:"default",size:"default"}}),gc=b.forwardRef(({className:e,size:t,testId:r,variant:n,error:s,...a},i)=>o.jsx("textarea",{className:Y(YLr({variant:n,size:t}),s&&"border-error focus:ring-error focus:shadow-glow-accent2",e),"data-testid":r,ref:i,"aria-invalid":s,...a}));gc.displayName="Textarea";const XLr=IXt,KLr=RXt,Cdt=PXt;function $t({open:e,onOpenChange:t,children:r}){return o.jsx(XLr,{open:e,onOpenChange:t,children:r})}const pme=b.forwardRef(({className:e,...t},r)=>o.jsx(JYe,{ref:r,className:Y("dialog-overlay-anim fixed inset-0 z-50 bg-overlay backdrop-blur-xs",e),...t}));pme.displayName=JYe.displayName;const jdt=b.forwardRef(({className:e,...t},r)=>o.jsxs(Cdt,{children:[o.jsx(pme,{}),o.jsx(eXe,{ref:r,className:Y("dialog-content-anim","fixed left-[50%] top-[50%] z-50 grid translate-x-[-50%] translate-y-[-50%]","w-full max-w-[calc(100%-2rem)] sm:max-w-lg","rounded-xl border border-border1/40 bg-surface2/96 backdrop-blur-md shadow-dialog",e),...t})]}));jdt.displayName=eXe.displayName;const Tdt=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col gap-0.5 px-4 py-3 text-left",e),...t});Tdt.displayName="AlertDialogHeader";const Ndt=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col-reverse gap-1.5 px-4 py-2.5 sm:flex-row sm:justify-end",e),...t});Ndt.displayName="AlertDialogFooter";const Adt=({className:e,...t})=>o.jsx("div",{className:Y("overflow-y-auto px-4 py-3.5 max-h-[50vh]",e),...t});Adt.displayName="AlertDialogBody";const Idt=b.forwardRef(({className:e,...t},r)=>o.jsx(nXe,{ref:r,className:Y("text-ui-md font-medium",e),...t}));Idt.displayName=nXe.displayName;const Rdt=b.forwardRef(({className:e,...t},r)=>o.jsx(sXe,{ref:r,className:Y("text-ui-sm text-neutral3",e),...t}));Rdt.displayName=sXe.displayName;const Pdt=b.forwardRef(({className:e,...t},r)=>o.jsx(tXe,{ref:r,className:Y(pC({variant:"primary",size:"default"}),e),...t}));Pdt.displayName=tXe.displayName;const Mdt=b.forwardRef(({className:e,...t},r)=>o.jsx(rXe,{ref:r,className:Y(pC({variant:"default",size:"default"}),e),...t}));Mdt.displayName=rXe.displayName;$t.Trigger=KLr;$t.Portal=Cdt;$t.Overlay=pme;$t.Content=jdt;$t.Header=Tdt;$t.Footer=Ndt;$t.Body=Adt;$t.Title=Idt;$t.Description=Rdt;$t.Action=Pdt;$t.Cancel=Mdt;const fi=b.forwardRef(({className:e,...t},r)=>o.jsx(ide,{ref:r,className:Y("peer h-4 w-4 shrink-0 rounded-sm border border-neutral3","shadow-sm",ln.all,"hover:border-neutral5 hover:shadow-md",F9,"disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-neutral3 disabled:hover:shadow-sm","data-[state=checked]:bg-accent1 data-[state=checked]:border-accent1 data-[state=checked]:text-surface1","data-[state=checked]:shadow-glow-accent1",e),...t,children:o.jsx(lXe,{className:Y("flex items-center justify-center text-current","data-[state=checked]:animate-in data-[state=checked]:zoom-in-50 data-[state=checked]:duration-150"),children:o.jsx(cv,{className:"h-3.5 w-3.5 stroke-3"})})}));fi.displayName=ide.displayName;const Cp=UXt,_h=je.forwardRef(({className:e,children:t,...r},n)=>o.jsx(lde,{ref:n,className:Y("-outline-offset-2",ln.colors,i0.visible,"hover:text-neutral5","[&>svg]:transition-transform [&>svg]:duration-normal [&>svg]:ease-out-custom","[&[data-state=open]>svg]:rotate-90",e),...r,children:t}));_h.displayName=lde.displayName;const Eh=je.forwardRef(({className:e,children:t,...r},n)=>o.jsx(ude,{ref:n,className:Y("overflow-hidden","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:slide-in-from-top-1","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-1","duration-normal ease-out-custom",e),...r,children:t}));Eh.displayName=ude.displayName;const yn={root:"flex flex-col gap-1.5",trigger:"w-full min-w-32 justify-between",triggerError:"border-accent2",chevron:"ml-2 h-4 w-4 shrink-0 opacity-50",placeholder:"text-neutral3",popup:Y("min-w-(--anchor-width) w-max max-w-[500px] rounded-md bg-surface3 text-neutral5","shadow-elevated","origin-(--transform-origin)","transition-[transform,scale,opacity] duration-150 ease-out","data-starting-style:scale-95 data-starting-style:opacity-0","data-ending-style:scale-95 data-ending-style:opacity-0"),positioner:"z-50 pointer-events-auto",searchContainer:Y("flex items-center border-b border-border1 px-3 py-2",ln.colors),searchIcon:Y("mr-2 h-4 w-4 shrink-0 text-neutral3",ln.colors),searchInput:Y("flex h-8 w-full rounded-md bg-transparent py-1 text-sm","placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50","outline-hidden",ln.colors),empty:"not-empty:block hidden py-6 text-center text-sm text-neutral3",list:"max-h-dropdown-max-height overflow-y-auto overflow-x-hidden p-1",item:Y("relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm",ln.colors,"data-highlighted:bg-surface5 data-highlighted:text-neutral5"),itemSelected:"data-selected:bg-accent1Dark data-selected:text-accent1",checkContainer:"mr-2 flex h-4 w-4 shrink-0 items-center justify-center",checkIcon:Y("h-4 w-4 text-accent1",ln.opacity),checkbox:"mr-2 flex h-4 w-4 shrink-0 items-center justify-center rounded border",checkboxSelected:"bg-accent1 border-accent1",checkboxUnselected:"border-border1",checkboxIcon:"h-3 w-3 text-white",optionContent:"flex items-center gap-2 w-full min-w-0",optionText:"flex flex-col gap-0.5 min-w-0",optionLabel:"truncate",optionDescription:"text-xs text-neutral3 truncate",optionEnd:"ml-auto",error:"text-xs text-accent2"};function Gl({options:e,value:t,onValueChange:r,placeholder:n="Select option...",searchPlaceholder:s="Search...",emptyText:a="No option found.",className:i,disabled:l=!1,variant:c="default",size:u="default",open:d,onOpenChange:f,container:h,error:p}){const m=e.find(y=>y.value===t)??null,g=y=>{y&&r?.(y.value)};return o.jsxs("div",{className:yn.root,children:[o.jsxs(dKe,{items:e,value:m,onValueChange:g,disabled:l,open:d,onOpenChange:f,children:[o.jsxs(bKe,{className:Y(pC({variant:c,size:u}),yn.trigger,p&&yn.triggerError,i),children:[o.jsxs("span",{className:"truncate flex items-center gap-2",children:[m?.start,o.jsx(ber,{placeholder:n})]}),o.jsx(TF,{className:yn.chevron})]}),o.jsx(OKe,{container:h,children:o.jsx(EKe,{align:"start",sideOffset:4,className:yn.positioner,children:o.jsxs(CKe,{className:yn.popup,children:[o.jsxs("div",{className:yn.searchContainer,children:[o.jsx(x_,{className:yn.searchIcon}),o.jsx(vKe,{className:yn.searchInput,placeholder:s})]}),o.jsx(IKe,{className:yn.empty,children:a}),o.jsx(wKe,{className:yn.list,children:y=>o.jsxs(AKe,{value:y,className:Y(yn.item,yn.itemSelected),children:[o.jsx("span",{className:yn.checkContainer,children:o.jsx(itr,{children:o.jsx(cv,{className:yn.checkIcon})})}),o.jsxs("span",{className:yn.optionContent,children:[y.start,o.jsxs("span",{className:yn.optionText,children:[o.jsx("span",{className:yn.optionLabel,children:y.label}),y.description&&o.jsx("span",{className:yn.optionDescription,children:y.description})]}),y.end?o.jsx("div",{className:yn.optionEnd,children:y.end}):null]})]},y.value)})]})})})]}),p&&o.jsx("span",{className:yn.error,children:p})]})}function Ddt({options:e,value:t=[],onValueChange:r,placeholder:n="Select options...",searchPlaceholder:s="Search...",emptyText:a="No option found.",className:i,disabled:l=!1,variant:c="default",size:u="md",open:d,onOpenChange:f,container:h,error:p}){const m=e.filter(x=>t.includes(x.value)),g=x=>{x&&r?.(x.map(w=>w.value))},y=m.length===0?n:`${m.length} selected`;return o.jsxs("div",{className:yn.root,children:[o.jsxs(dKe,{multiple:!0,items:e,value:m,onValueChange:g,disabled:l,open:d,onOpenChange:f,children:[o.jsxs(bKe,{className:Y(pC({variant:c,size:u}),yn.trigger,p&&yn.triggerError,i),children:[o.jsx("span",{className:Y("truncate",m.length===0&&yn.placeholder),children:y}),o.jsx(TF,{className:yn.chevron})]}),o.jsx(OKe,{container:h,children:o.jsx(EKe,{align:"start",sideOffset:4,className:yn.positioner,children:o.jsxs(CKe,{className:yn.popup,children:[o.jsxs("div",{className:yn.searchContainer,children:[o.jsx(x_,{className:yn.searchIcon}),o.jsx(vKe,{className:yn.searchInput,placeholder:s})]}),o.jsx(IKe,{className:yn.empty,children:a}),o.jsx(wKe,{className:yn.list,children:x=>{const w=t.includes(x.value);return o.jsxs(AKe,{value:x,className:yn.item,children:[o.jsx("span",{className:Y(yn.checkbox,w?yn.checkboxSelected:yn.checkboxUnselected),children:w&&o.jsx(cv,{className:yn.checkboxIcon})}),o.jsxs("span",{className:yn.optionContent,children:[x.start,o.jsxs("span",{className:yn.optionText,children:[o.jsx("span",{className:yn.optionLabel,children:x.label}),x.description&&o.jsx("span",{className:yn.optionDescription,children:x.description})]}),x.end?o.jsx("div",{className:yn.optionEnd,children:x.end}):null]})]},x.value)}})]})})})]}),p&&o.jsx("span",{className:yn.error,children:p})]})}const On=YF,Ldt=FYe,JLr=XF,e$r=YR,$dt=b.forwardRef(({className:e,...t},r)=>o.jsx(GR,{ref:r,className:Y("dialog-overlay-anim fixed inset-0 z-50 bg-overlay backdrop-blur-xs",e),...t}));$dt.displayName=GR.displayName;const vn=b.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(JLr,{children:[o.jsx($dt,{}),o.jsxs(ZR,{ref:n,className:Y("dialog-content-anim","fixed left-[50%] top-[50%] z-50 grid translate-x-[-50%] translate-y-[-50%]","w-full max-w-[calc(100%-2rem)] sm:max-w-lg","rounded-xl border border-border1/40 bg-surface2/96 backdrop-blur-md shadow-dialog",e),...r,children:[t,o.jsx(YR,{asChild:!0,children:o.jsx(ce,{variant:"ghost",size:"sm",className:"absolute top-3 right-3","aria-label":"Close",children:o.jsx(Wl,{})})})]})]}));vn.displayName=ZR.displayName;const kn=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col gap-0.5 px-4 py-3 text-left",e),...t});kn.displayName="DialogHeader";const uf=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col-reverse gap-1.5 px-4 py-2.5 sm:flex-row sm:justify-end",e),...t});uf.displayName="DialogFooter";const Bn=({className:e,...t})=>o.jsx("div",{className:Y("overflow-y-auto px-4 py-3.5 max-h-[50vh]",e),...t});Bn.displayName="DialogBody";const bn=b.forwardRef(({className:e,...t},r)=>o.jsx(KF,{ref:r,className:Y("text-ui-md font-medium",e),...t}));bn.displayName=KF.displayName;const qs=b.forwardRef(({className:e,...t},r)=>o.jsx(JF,{ref:r,className:Y("sr-only",e),...t}));qs.displayName=JF.displayName;const Fdt=b.forwardRef(({className:e,...t},r)=>o.jsx(rd,{ref:r,className:Y("flex h-full w-full flex-col overflow-hidden rounded-md bg-surface3 text-neutral5",e),...t}));Fdt.displayName=rd.displayName;const t$r=({children:e,title:t="Command Palette",description:r="Search for commands and actions",...n})=>{const s=b.useCallback((i,l)=>{const c=i.toLowerCase();return l.toLowerCase().split(/\s+/).filter(Boolean).every(h=>c.includes(h))?1:0},[]),a=b.useCallback(i=>{i.stopPropagation()},[]);return o.jsx(On,{...n,children:o.jsxs(vn,{className:"overflow-hidden p-0",children:[o.jsx(bn,{className:"sr-only",children:t}),o.jsx(qs,{className:"sr-only",children:r}),o.jsx(Fdt,{filter:s,onKeyDown:a,className:Y("**:[[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-neutral3","[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 **:[[cmdk-group]]:px-2","[&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5","**:[[cmdk-input]]:h-12","**:[[cmdk-item]]:px-2 **:[[cmdk-item]]:py-3","[&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5"),children:e})]})})},zdt=b.forwardRef(({className:e,...t},r)=>o.jsxs("div",{className:Y("flex items-center border-b border-border1 px-3",ln.colors),"cmdk-input-wrapper":"",children:[o.jsx(x_,{className:Y("mr-2 h-4 w-4 shrink-0 text-neutral3",ln.colors)}),o.jsx(rd.Input,{ref:r,className:Y("flex h-10 w-full rounded-md bg-transparent py-3 text-sm","placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50","outline-hidden",ln.colors,e),...t})]}));zdt.displayName=rd.Input.displayName;const Bdt=b.forwardRef(({className:e,...t},r)=>o.jsx(rd.List,{ref:r,className:Y("max-h-dropdown-max-height overflow-y-auto overflow-x-hidden",e),...t}));Bdt.displayName=rd.List.displayName;const Udt=b.forwardRef((e,t)=>o.jsx(rd.Empty,{ref:t,className:"py-6 text-center text-sm text-neutral3",...e}));Udt.displayName=rd.Empty.displayName;const fb=b.forwardRef(({className:e,...t},r)=>o.jsx(rd.Group,{ref:r,className:Y("overflow-hidden p-1 text-neutral5","**:[[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-neutral3",e),...t}));fb.displayName=rd.Group.displayName;const iw=b.forwardRef(({className:e,...t},r)=>o.jsx(rd.Separator,{ref:r,className:Y("-mx-1 h-px bg-border1",e),...t}));iw.displayName=rd.Separator.displayName;const Zo=b.forwardRef(({className:e,...t},r)=>o.jsx(rd.Item,{ref:r,className:Y("relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden",ln.colors,"data-[selected=true]:bg-surface5 data-[selected=true]:text-neutral5","data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50","[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));Zo.displayName=rd.Item.displayName;const Vdt=({className:e,...t})=>o.jsx("span",{className:Y("ml-auto text-xs tracking-widest text-neutral3",e),...t});Vdt.displayName="CommandShortcut";function qdt({children:e,className:t}){return o.jsx("div",{className:Y("border border-border1 rounded-lg p-6 bg-surface2",t),children:e})}const r$r=nnr,n$r=snr,s$r=aP,a$r=onr,i$r=anr,mme=Y("relative flex cursor-pointer select-none items-center gap-3 rounded-lg px-3 py-1.5 text-sm transition-colors text-neutral4 dark:hover:text-white dark:focus:text-white hover:text-neutral6 focus:text-neutral6 hover:bg-surface4 focus:bg-surface4 active:bg-surface5 data-disabled:pointer-events-none data-disabled:opacity-50 [&>span]:truncate [&_svg]:size-4 [&_svg]:shrink-0 focus-visible:outline-hidden focus-visible:ring-0","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:opacity-50 [&>svg]:mx-[-.25em] [&:hover>svg]:opacity-100"),Hdt=b.forwardRef(({className:e,children:t,...r},n)=>o.jsx(MJe,{ref:n,className:Y("cursor-pointer",e),...r,children:t}));Hdt.displayName=MJe.displayName;const Qdt=b.forwardRef(({className:e,inset:t,children:r,...n},s)=>o.jsxs(UJe,{ref:s,className:Y(mme,"data-[state=open]:bg-surface4",t&&"pl-8",e),...n,children:[r,o.jsx("span",{className:"ml-auto pl-2",children:o.jsx(zce,{className:"-rotate-90 opacity-50"})})]}));Qdt.displayName=UJe.displayName;const Wdt=b.forwardRef(({className:e,...t},r)=>o.jsx(aP,{children:o.jsx(fz,{ref:r,className:Y("bg-surface3 backdrop-blur-xl data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 z-50 min-w-44 max-h-[min(20rem,var(--radix-dropdown-menu-content-available-height))] overflow-x-hidden overflow-y-auto rounded-xl border-2 border-border1/50 p-1 shadow-md",e),...t})}));Wdt.displayName=fz.displayName;const Gdt=b.forwardRef(({className:e,container:t,sideOffset:r=8,...n},s)=>o.jsx(aP,{container:t,children:o.jsx(DJe,{ref:s,sideOffset:r,className:Y("bg-surface3 data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 backdrop-blur-xl text-neutral4 z-50 min-w-44 max-h-[min(20rem,var(--radix-dropdown-menu-content-available-height))] overflow-x-hidden overflow-y-auto rounded-xl border-2 border-border1/50 p-1 shadow-md",e),...n})}));Gdt.displayName=DJe.displayName;const Zdt=b.forwardRef(({className:e,...t},r)=>o.jsx($Je,{ref:r,className:Y(mme,e),...t}));Zdt.displayName=$Je.displayName;const Ydt=b.forwardRef(({className:e,children:t,checked:r,...n},s)=>o.jsxs(FJe,{ref:s,className:Y(mme,"w-full gap-4 px-2",e),checked:r,...n,children:[o.jsx("div",{className:"border dark:border-white/20 border-black/20 flex h-4 w-4 items-center justify-center rounded-sm",children:r&&o.jsx(cv,{})}),t]}));Ydt.displayName=FJe.displayName;const Xdt=b.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(zJe,{ref:n,className:Y("relative flex cursor-pointer select-none items-center rounded-md py-1.5 pl-8 pr-2 text-sm transition-colors text-neutral4 dark:hover:text-white dark:focus:text-white hover:text-neutral6 focus:text-neutral6 hover:bg-surface4 focus:bg-surface4 active:bg-surface5 data-disabled:pointer-events-none data-disabled:opacity-50 focus-visible:outline-hidden focus-visible:ring-0",e),...r,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(inr,{children:o.jsx(AHe,{className:"h-2 w-2 fill-current"})})}),t]}));Xdt.displayName=zJe.displayName;const Kdt=b.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(LJe,{ref:n,className:Y("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));Kdt.displayName=LJe.displayName;const Jdt=b.forwardRef(({className:e,...t},r)=>o.jsx(BJe,{ref:r,className:Y("bg-border1/50 -mx-1.5 my-1 h-0.5",e),...t}));Jdt.displayName=BJe.displayName;const eft=({className:e,...t})=>o.jsx("span",{className:Y("ml-auto text-xs tracking-widest opacity-60",e),...t});eft.displayName="DropdownMenuShortcut";function yt({open:e,onOpenChange:t,children:r,modal:n}){return o.jsx(r$r,{modal:n,open:e,onOpenChange:t,children:r})}yt.Trigger=Hdt;yt.Content=Gdt;yt.Group=n$r;yt.Portal=s$r;yt.Item=Zdt;yt.CheckboxItem=Ydt;yt.RadioItem=Xdt;yt.Label=Kdt;yt.Separator=Jdt;yt.Shortcut=eft;yt.Sub=a$r;yt.SubContent=Wdt;yt.SubTrigger=Qdt;yt.RadioGroup=i$r;const rL=({label:e,children:t})=>o.jsxs("div",{className:"space-y-2",children:[o.jsx(me,{as:"p",variant:"ui-md",className:"text-neutral3",children:e}),t]});function Dn({className:e,...t}){return o.jsx("div",{className:Y("rounded-md bg-surface4 relative overflow-hidden","before:absolute before:inset-0","before:-translate-x-full","before:animate-[shimmer_2s_infinite]","before:bg-linear-to-r before:from-transparent before:via-surface5/20 before:to-transparent",e),...t})}const tft=({icon:e,title:t,isLoading:r,children:n})=>o.jsxs("div",{className:"p-5 w-full overflow-x-hidden",children:[o.jsxs("div",{className:"text-neutral6 flex items-center gap-2",children:[o.jsx(Ce,{size:"lg",className:"bg-surface4 rounded-md p-1",children:e}),r?o.jsx(Dn,{className:"h-3 w-1/3"}):o.jsx("div",{className:"flex min-w-0 items-center gap-4",children:o.jsx(me,{variant:"header-md",as:"h2",className:"truncate font-medium",children:t})})]}),n&&o.jsx("div",{className:"pt-2",children:n})]});function o$r({children:e,className:t}){return o.jsx("div",{className:Y("grid gap-2 text-neutral4",t),children:e})}function l$r({children:e}){return o.jsxs("p",{className:Y("text-ui-sm text-neutral4 flex items-center gap-2","[&>svg]:w-[1.2em] [&>svg]:h-[1.2em] [&>svg]:opacity-70 [&>svg]:text-red-400"),children:[o.jsx(LE,{})," ",e]})}function c$r({children:e}){return o.jsx("p",{className:"text-neutral3 text-ui-sm",children:e})}function u$r({children:e,name:t,required:r,size:n="default",className:s}){return o.jsxs("label",{htmlFor:`input-${t}`,className:Y("text-ui-smd text-neutral3 flex justify-between items-center ","in-[.horizontal-field-block]:grid in-[.horizontal-field-block]:content-start",{"text-ui-md":n==="bigger"},s),children:[e,r&&o.jsx("i",{className:"text-neutral2 text-xs",children:"(required)"})]})}function d$r({children:e,className:t,layout:r="vertical",labelColumnWidth:n}){return o.jsx("div",{className:Y("grid gap-2 text-neutral4",{"horizontal-field-block grid-cols-[auto_1fr] items-baseline":r==="horizontal"},t),style:r==="horizontal"&&n?{gridTemplateColumns:`${n} 1fr`}:void 0,children:e})}const mo=Object.assign({},{Layout:d$r,Column:o$r,Label:u$r,HelpText:c$r,ErrorMsg:l$r});function f$r({children:e,className:t}){return o.jsx("div",{className:Y("grid gap-6 content-start",t),children:e})}function h$r({children:e,className:t,columns:r=1,gap:n}){return o.jsx("div",{className:Y("grid",{"grid-cols-1":r===1,"grid-cols-2":r===2},n??"gap-6",t),children:e})}Object.assign(h$r,{Column:f$r});const p$r=x1(Y("flex w-full text-neutral6 border bg-transparent","transition-all duration-normal ease-out-custom","placeholder:text-neutral2 placeholder:transition-opacity placeholder:duration-normal","focus:placeholder:opacity-70"),{variants:{variant:{default:Y(ddt,cme,ume),unstyled:"border-0 bg-transparent shadow-none focus:shadow-none focus:ring-0"},size:{sm:`${lc.sm} text-ui-sm px-[.75em]`,md:`${lc.md} text-ui-md px-[.75em]`,default:`${lc.default} text-ui-md px-[.85em]`,lg:`${lc.lg} text-ui-lg px-[.85em]`}},defaultVariants:{variant:"default",size:"default"}}),ar=b.forwardRef(({className:e,size:t,testId:r,variant:n,type:s,error:a,...i},l)=>o.jsx("input",{type:s,className:Y(p$r({variant:n,size:t}),a&&"border-error focus:ring-error focus:shadow-glow-accent2",e),"data-testid":r,ref:l,"aria-invalid":a,...i}));ar.displayName="Input";function Sx({name:e,value:t,label:r,labelIsHidden:n=!1,labelColumnWidth:s,helpText:a,errorMsg:i,required:l=!1,disabled:c=!1,labelSize:u,layout:d="vertical",placeholder:f,size:h="default",testId:p,className:m,...g}){return o.jsxs(mo.Layout,{layout:d,labelColumnWidth:s,className:m,children:[d==="horizontal"?o.jsx(mo.Column,{children:o.jsx(mo.Label,{name:e,required:l,size:u||"bigger",children:n?o.jsx(Zu,{children:r}):r})}):null,o.jsxs(mo.Column,{children:[!n&&d==="vertical"?o.jsx(mo.Label,{name:e,required:l,size:u||"default",children:r}):null,o.jsx(ar,{name:e,disabled:c,required:l,value:t,placeholder:f,"data-testid":p,size:h,...g}),a&&o.jsx(mo.HelpText,{children:a}),i&&o.jsx(mo.ErrorMsg,{children:i})]})]})}function Ox({name:e,helpText:t,errorMsg:r,required:n=!1,disabled:s=!1,value:a,label:i,labelIsHidden:l=!1,layout:c="vertical",placeholder:u="Search...",onChange:d,onReset:f,className:h,size:p,isMinimized:m,onMinimizedChange:g}){const y=b.useRef(null);return b.useEffect(()=>{m===!1&&y.current?.focus()},[m]),m?o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(ce,{size:p||"sm","aria-label":i||"Search",disabled:s,onClick:()=>g?.(!1),children:o.jsx(x_,{})})}),o.jsx(Wr,{children:i||"Search"})]}):o.jsxs(mo.Layout,{layout:c,className:h,children:[c==="horizontal"?o.jsx(mo.Column,{children:o.jsx(mo.Label,{name:e,required:n,children:l?o.jsx(Zu,{children:i}):i})}):null,o.jsxs(mo.Column,{children:[c==="vertical"&&i&&!l?o.jsx(mo.Label,{name:e,required:n,children:i}):null,o.jsxs("div",{className:"relative group",children:[o.jsx(ar,{ref:y,name:e,disabled:s,value:a,placeholder:u,onChange:d,size:p,className:Y(p==="sm"&&"pl-8 pr-8",p==="md"&&"pl-9 pr-9",(!p||p==="default")&&"pl-10 pr-10",p==="lg"&&"pl-11 pr-11")}),o.jsx(x_,{"aria-hidden":"true",className:Y("text-neutral4 opacity-50 group-has-focus:opacity-100 absolute left-3 top-1/2 -translate-y-1/2",p==="sm"&&"w-3.5 h-3.5",p==="md"&&"w-4 h-4",(!p||p==="default")&&"w-[1.125rem] h-[1.125rem]",p==="lg"&&"w-5 h-5")}),f&&(a||m===!1)&&o.jsx(ce,{variant:"ghost",size:p||"default","aria-label":"Clear search",onClick:()=>{a&&f(),m===!1&&g?.(!0)},className:"absolute top-1/2 right-0 -translate-y-1/2",children:o.jsx(Wl,{})})]}),t&&o.jsx(mo.HelpText,{children:t}),r&&o.jsx(mo.ErrorMsg,{children:r})]})]})}const hi=Dnr,pi=Lnr,ei=b.forwardRef(({className:e,children:t,variant:r="default",size:n="default",...s},a)=>o.jsxs(pet,{ref:a,className:Y(pC({variant:r,size:n}),"justify-between [&>svg]:opacity-100",e),...s,children:[t,o.jsx($nr,{asChild:!0,children:o.jsx(zce,{className:Y("h-4 w-4 text-neutral3",ln.colors)})})]}));ei.displayName=pet.displayName;const ti=b.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>o.jsx(Fnr,{children:o.jsx(met,{ref:s,className:Y("relative z-50 min-w-32 max-h-dropdown-max-height overflow-y-auto overflow-x-hidden rounded-md border border-border1 bg-surface3 text-neutral5 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",r==="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:r,...n,children:o.jsx(znr,{className:Y("p-1",r==="popper"&&"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"),children:t})})}));ti.displayName=met.displayName;const ss=b.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(get,{ref:n,className:Y("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-neutral5 text-sm",ln.colors,"hover:bg-surface5 hover:text-neutral5","focus:bg-surface5 focus:text-neutral5","data-[state=checked]:bg-accent1Dark data-[state=checked]:text-accent1","data-disabled:pointer-events-none data-disabled:opacity-50",e),...r,children:[o.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(Unr,{children:o.jsx(cv,{className:"h-4 w-4 text-accent1"})})}),o.jsx(Bnr,{children:t})]}));ss.displayName=get.displayName;function $o({name:e,helpText:t,errorMsg:r,required:n=!1,disabled:s=!1,size:a="default",value:i,label:l,labelIsHidden:c=!1,layout:u="vertical",labelColumnWidth:d,options:f,placeholder:h="Select an option",onValueChange:p,className:m}){return o.jsxs(mo.Layout,{layout:u,labelColumnWidth:d,className:m,children:[u==="horizontal"?o.jsx(mo.Column,{children:o.jsx(mo.Label,{name:e,required:n,children:c?o.jsx(Zu,{children:l}):l})}):null,o.jsxs(mo.Column,{children:[u==="vertical"&&l&&!c?o.jsx(mo.Label,{name:e,required:n,children:l}):null,o.jsxs(hi,{"aria-label":c?l:void 0,name:e,value:i,onValueChange:p,disabled:s,children:[o.jsx(ei,{size:a,children:o.jsx(pi,{placeholder:h})}),o.jsx(ti,{children:f.map(g=>o.jsx(ss,{value:g.value,children:g.label},g.value))})]}),t&&o.jsx(mo.HelpText,{children:t}),r&&o.jsx(mo.ErrorMsg,{children:r})]})]})}const m$r=x1("text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),xt=b.forwardRef(({className:e,...t},r)=>o.jsx(vet,{ref:r,className:Y(m$r(),e),...t}));xt.displayName=vet.displayName;function X_({children:e}){const t=e.replace(/\\n/g,`
|
|
293
|
+
`).concat(k.x,",").concat(k.y),E=Sl(e.id)?WA("recharts-radial-line-"):e.id;return b.createElement("text",wy({},n,{dominantBaseline:"central",className:xa("recharts-radial-bar-label",i)}),b.createElement("defs",null,b.createElement("path",{id:E,d:_})),b.createElement("textPath",{xlinkHref:"#".concat(E)},r))},VNr=(e,t,r)=>{var{cx:n,cy:s,innerRadius:a,outerRadius:i,startAngle:l,endAngle:c}=e,u=(l+c)/2;if(r==="outside"){var{x:d,y:f}=Ul(n,s,i+t,u);return{x:d,y:f,textAnchor:d>=n?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:n,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:n,y:s,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:n,y:s,textAnchor:"middle",verticalAnchor:"end"};var h=(a+i)/2,{x:p,y:m}=Ul(n,s,h,u);return{x:p,y:m,textAnchor:"middle",verticalAnchor:"middle"}},_$=e=>e!=null&&"cx"in e&&qr(e.cx),qNr={angle:0,offset:5,zIndex:Zc.label,position:"middle",textBreakAll:!1};function HNr(e){if(!_$(e))return e;var{cx:t,cy:r,outerRadius:n}=e,s=n*2;return{x:t-n,y:r-n,width:s,upperWidth:s,lowerWidth:s,height:s}}function bb(e){var t=nd(e,qNr),{viewBox:r,parentViewBox:n,position:s,value:a,children:i,content:l,className:c="",textBreakAll:u,labelRef:d}=t,f=FNr(),h=Qlt(),p=s==="center"?h:f??h,m,g,y;r==null?m=p:_$(r)?m=r:m=Ohe(r);var x=HNr(m);if(!m||Sl(a)&&Sl(i)&&!b.isValidElement(l)&&typeof l!="function")return null;var w=VT(VT({},t),{},{viewBox:m});if(b.isValidElement(l)){var{labelRef:S}=w,k=PAe(w,ANr);return b.cloneElement(l,k)}if(typeof l=="function"){var{content:_}=w,E=PAe(w,INr);if(g=b.createElement(l,E),b.isValidElement(g))return g}else g=zNr(t);var T=su(t);if(_$(m)){if(s==="insideStart"||s==="insideEnd"||s==="end")return UNr(t,s,g,T,m);y=VNr(m,t.offset,t.position)}else{if(!x)return null;var j=NNr({viewBox:x,position:s,offset:t.offset,parentViewBox:_$(n)?void 0:n});y=VT(VT({x:j.x,y:j.y,textAnchor:j.horizontalAnchor,verticalAnchor:j.verticalAnchor},j.width!==void 0?{width:j.width}:{}),j.height!==void 0?{height:j.height}:{})}return b.createElement(xv,{zIndex:t.zIndex},b.createElement(Tpe,wy({ref:d,className:xa("recharts-label",c)},T,y,{textAnchor:Blt(T.textAnchor)?T.textAnchor:y.textAnchor,breakAll:u}),g))}bb.displayName="Label";var QNr=(e,t,r)=>{if(!e)return null;var n={viewBox:t,labelRef:r};return e===!0?b.createElement(bb,wy({key:"label-implicit"},n)):eg(e)?b.createElement(bb,wy({key:"label-implicit",value:e},n)):b.isValidElement(e)?e.type===bb?b.cloneElement(e,VT({key:"label-implicit"},n)):b.createElement(bb,wy({key:"label-implicit",content:e},n)):Npe(e)?b.createElement(bb,wy({key:"label-implicit",content:e},n)):e&&typeof e=="object"?b.createElement(bb,wy({},e,{key:"label-implicit"},n)):null};function WNr(e){var{label:t,labelRef:r}=e,n=Qlt();return QNr(t,n,r)||null}var GNr=["valueAccessor"],ZNr=["dataKey","clockWise","id","textBreakAll","zIndex"];function w5(){return w5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},w5.apply(null,arguments)}function DAe(e,t){if(e==null)return{};var r,n,s=YNr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function YNr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var XNr=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(SNr(t))return t},Wlt=b.createContext(void 0),KNr=Wlt.Provider,Glt=b.createContext(void 0);Glt.Provider;function JNr(){return b.useContext(Wlt)}function eAr(){return b.useContext(Glt)}function E$(e){var{valueAccessor:t=XNr}=e,r=DAe(e,GNr),{dataKey:n,clockWise:s,id:a,textBreakAll:i,zIndex:l}=r,c=DAe(r,ZNr),u=JNr(),d=eAr(),f=u||d;return!f||!f.length?null:b.createElement(xv,{zIndex:l??Zc.label},b.createElement(Qy,{className:"recharts-label-list"},f.map((h,p)=>{var m,g=Sl(n)?t(h,p):Ql(h.payload,n),y=Sl(a)?{}:{id:"".concat(a,"-").concat(p)};return b.createElement(bb,w5({key:"label-".concat(p)},su(h),c,y,{fill:(m=r.fill)!==null&&m!==void 0?m:h.fill,parentViewBox:h.parentViewBox,value:g,textBreakAll:i,viewBox:h.viewBox,index:p,zIndex:0}))})))}E$.displayName="LabelList";function tAr(e){var{label:t}=e;return t?t===!0?b.createElement(E$,{key:"labelList-implicit"}):b.isValidElement(t)||Npe(t)?b.createElement(E$,{key:"labelList-implicit",content:t}):typeof t=="object"?b.createElement(E$,w5({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function Qae(){return Qae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qae.apply(null,arguments)}var Zlt=e=>{var{cx:t,cy:r,r:n,className:s}=e,a=xa("recharts-dot",s);return qr(t)&&qr(r)&&qr(n)?b.createElement("circle",Qae({},Jm(e),phe(e),{className:a,cx:t,cy:r,r:n})):null},rAr={radiusAxis:{},angleAxis:{}},Ylt=Ec({name:"polarAxis",initialState:rAr,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:RPn,removeRadiusAxis:PPn,addAngleAxis:MPn,removeAngleAxis:DPn}=Ylt.actions,nAr=Ylt.reducer;function sAr(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var WH={exports:{}},Ks={};var LAe;function aAr(){if(LAe)return Ks;LAe=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),i=Symbol.for("react.context"),l=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),m;m=Symbol.for("react.module.reference");function g(y){if(typeof y=="object"&&y!==null){var x=y.$$typeof;switch(x){case e:switch(y=y.type,y){case r:case s:case n:case u:case d:return y;default:switch(y=y&&y.$$typeof,y){case l:case i:case c:case h:case f:case a:return y;default:return x}}case t:return x}}}return Ks.ContextConsumer=i,Ks.ContextProvider=a,Ks.Element=e,Ks.ForwardRef=c,Ks.Fragment=r,Ks.Lazy=h,Ks.Memo=f,Ks.Portal=t,Ks.Profiler=s,Ks.StrictMode=n,Ks.Suspense=u,Ks.SuspenseList=d,Ks.isAsyncMode=function(){return!1},Ks.isConcurrentMode=function(){return!1},Ks.isContextConsumer=function(y){return g(y)===i},Ks.isContextProvider=function(y){return g(y)===a},Ks.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===e},Ks.isForwardRef=function(y){return g(y)===c},Ks.isFragment=function(y){return g(y)===r},Ks.isLazy=function(y){return g(y)===h},Ks.isMemo=function(y){return g(y)===f},Ks.isPortal=function(y){return g(y)===t},Ks.isProfiler=function(y){return g(y)===s},Ks.isStrictMode=function(y){return g(y)===n},Ks.isSuspense=function(y){return g(y)===u},Ks.isSuspenseList=function(y){return g(y)===d},Ks.isValidElementType=function(y){return typeof y=="string"||typeof y=="function"||y===r||y===s||y===n||y===u||y===d||y===p||typeof y=="object"&&y!==null&&(y.$$typeof===h||y.$$typeof===f||y.$$typeof===a||y.$$typeof===i||y.$$typeof===c||y.$$typeof===m||y.getModuleId!==void 0)},Ks.typeOf=g,Ks}var $Ae;function iAr(){return $Ae||($Ae=1,WH.exports=aAr()),WH.exports}iAr();var Xlt=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,GH={},FAe;function oAr(){return FAe||(FAe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){if(typeof r!="object"||r==null)return!1;if(Object.getPrototypeOf(r)===null)return!0;if(Object.prototype.toString.call(r)!=="[object Object]"){const s=r[Symbol.toStringTag];return s==null||!Object.getOwnPropertyDescriptor(r,Symbol.toStringTag)?.writable?!1:r.toString()===`[object ${s}]`}let n=r;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(r)===n}e.isPlainObject=t})(GH)),GH}var ZH,zAe;function lAr(){return zAe||(zAe=1,ZH=oAr().isPlainObject),ZH}var cAr=lAr();const uAr=Uo(cAr);var BAe,UAe,VAe,qAe,HAe;function QAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function WAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?QAe(Object(r),!0).forEach(function(n){dAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):QAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function dAr(e,t,r){return(t=fAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fAr(e){var t=hAr(e,"string");return typeof t=="symbol"?t:t+""}function hAr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function S5(){return S5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},S5.apply(null,arguments)}function rT(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var GAe=(e,t,r,n,s)=>{var a=r-n,i;return i=Qi(BAe||(BAe=rT(["M ",",",""])),e,t),i+=Qi(UAe||(UAe=rT(["L ",",",""])),e+r,t),i+=Qi(VAe||(VAe=rT(["L ",",",""])),e+r-a/2,t+s),i+=Qi(qAe||(qAe=rT(["L ",",",""])),e+r-a/2-n,t+s),i+=Qi(HAe||(HAe=rT(["L ",","," Z"])),e,t),i},pAr={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},mAr=e=>{var t=nd(e,pAr),{x:r,y:n,upperWidth:s,lowerWidth:a,height:i,className:l}=t,{animationEasing:c,animationDuration:u,animationBegin:d,isUpdateAnimationActive:f}=t,h=b.useRef(null),[p,m]=b.useState(-1),g=b.useRef(s),y=b.useRef(a),x=b.useRef(i),w=b.useRef(r),S=b.useRef(n),k=Che(e,"trapezoid-");if(b.useEffect(()=>{if(h.current&&h.current.getTotalLength)try{var D=h.current.getTotalLength();D&&m(D)}catch{}},[]),r!==+r||n!==+n||s!==+s||a!==+a||i!==+i||s===0&&a===0||i===0)return null;var _=xa("recharts-trapezoid",l);if(!f)return b.createElement("g",null,b.createElement("path",S5({},su(t),{className:_,d:GAe(r,n,s,a,i)})));var E=g.current,T=y.current,j=x.current,N=w.current,I=S.current,P="0px ".concat(p===-1?1:p,"px"),R="".concat(p,"px ").concat(p,"px"),B=hit(["strokeDasharray"],u,c);return b.createElement(Ehe,{animationId:k,key:k,canBegin:p>0,duration:u,easing:c,isActive:f,begin:d},D=>{var $=Mu(E,s,D),U=Mu(T,a,D),z=Mu(j,i,D),H=Mu(N,r,D),Q=Mu(I,n,D);h.current&&(g.current=$,y.current=U,x.current=z,w.current=H,S.current=Q);var L=D>0?{transition:B,strokeDasharray:R}:{strokeDasharray:P};return b.createElement("path",S5({},su(t),{className:_,d:GAe(H,Q,$,U,z),ref:h,style:WAe(WAe({},L),t.style)}))})},gAr=["option","shapeType","activeClassName","inActiveClassName"];function yAr(e,t){if(e==null)return{};var r,n,s=vAr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function vAr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function ZAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function O5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ZAe(Object(r),!0).forEach(function(n){bAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ZAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function bAr(e,t,r){return(t=xAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xAr(e){var t=wAr(e,"string");return typeof t=="symbol"?t:t+""}function wAr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function SAr(e,t){return O5(O5({},t),e)}function OAr(e,t){return e==="symbols"}function YAe(e){var{shapeType:t,elementProps:r}=e;switch(t){case"rectangle":return b.createElement(yit,r);case"trapezoid":return b.createElement(mAr,r);case"sector":return b.createElement(xit,r);case"symbols":if(OAr(t))return b.createElement(nat,r);break;case"curve":return b.createElement(fit,r);default:return null}}function kAr(e){return b.isValidElement(e)?e.props:e}function _Ar(e){var{option:t,shapeType:r,activeClassName:n="recharts-active-shape",inActiveClassName:s="recharts-shape"}=e,a=yAr(e,gAr),i;if(b.isValidElement(t))i=b.cloneElement(t,O5(O5({},a),kAr(t)));else if(typeof t=="function")i=t(a,a.index);else if(uAr(t)&&typeof t!="boolean"){var l=SAr(t,a);i=b.createElement(YAe,{shapeType:r,elementProps:l})}else{var c=a;i=b.createElement(YAe,{shapeType:r,elementProps:c})}return a.isActive?b.createElement(Qy,{className:n},i):b.createElement(Qy,{className:s},i)}function EAr(e){var{tooltipEntrySettings:t}=e,r=Vo(),n=sd(),s=b.useRef(null);return b.useLayoutEffect(()=>{n||(s.current===null?r(PCr(t)):s.current!==t&&r(MCr({prev:s.current,next:t})),s.current=t)},[t,r,n]),b.useLayoutEffect(()=>()=>{s.current&&(r(DCr(s.current)),s.current=null)},[r]),null}function CAr(e){var{legendPayload:t}=e,r=Vo(),n=sd(),s=b.useRef(null);return b.useLayoutEffect(()=>{n||(s.current===null?r(ZSr(t)):s.current!==t&&r(YSr({prev:s.current,next:t})),s.current=t)},[r,n,t]),b.useLayoutEffect(()=>()=>{s.current&&(r(XSr(s.current)),s.current=null)},[r]),null}var YH,jAr=()=>{var[e]=b.useState(()=>WA("uid-"));return e},TAr=(YH=ZS.useId)!==null&&YH!==void 0?YH:jAr;function NAr(e,t){var r=TAr();return t||(e?"".concat(e,"-").concat(r):r)}var AAr=b.createContext(void 0),IAr=e=>{var{id:t,type:r,children:n}=e,s=NAr("recharts-".concat(r),t);return b.createElement(AAr.Provider,{value:s},n(s))},RAr={cartesianItems:[],polarItems:[]},Klt=Ec({name:"graphicalItems",initialState:RAr,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:li()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,s=uh(e).cartesianItems.indexOf(r);s>-1&&(e.cartesianItems[s]=n)},prepare:li()},removeCartesianGraphicalItem:{reducer(e,t){var r=uh(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:li()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:li()},removePolarGraphicalItem:{reducer(e,t){var r=uh(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:li()},replacePolarGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,s=uh(e).polarItems.indexOf(r);s>-1&&(e.polarItems[s]=n)},prepare:li()}}}),{addCartesianGraphicalItem:PAr,replaceCartesianGraphicalItem:MAr,removeCartesianGraphicalItem:DAr,addPolarGraphicalItem:LPn,removePolarGraphicalItem:$Pn,replacePolarGraphicalItem:FPn}=Klt.actions,LAr=Klt.reducer,$Ar=e=>{var t=Vo(),r=b.useRef(null);return b.useLayoutEffect(()=>{r.current===null?t(PAr(e)):r.current!==e&&t(MAr({prev:r.current,next:e})),r.current=e},[t,e]),b.useLayoutEffect(()=>()=>{r.current&&(t(DAr(r.current)),r.current=null)},[t]),null},FAr=b.memo($Ar),zAr=["points"];function XAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function XH(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?XAe(Object(r),!0).forEach(function(n){BAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):XAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function BAr(e,t,r){return(t=UAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function UAr(e){var t=VAr(e,"string");return typeof t=="symbol"?t:t+""}function VAr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function k5(){return k5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},k5.apply(null,arguments)}function qAr(e,t){if(e==null)return{};var r,n,s=HAr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function HAr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function QAr(e){var{option:t,dotProps:r,className:n}=e;if(b.isValidElement(t))return b.cloneElement(t,r);if(typeof t=="function")return t(r);var s=xa(n,typeof t!="boolean"?t.className:""),a=r??{},{points:i}=a,l=qAr(a,zAr);return b.createElement(Zlt,k5({},l,{className:s}))}function WAr(e,t){return e==null?!1:t?!0:e.length===1}function GAr(e){var{points:t,dot:r,className:n,dotClassName:s,dataKey:a,baseProps:i,needClip:l,clipPathId:c,zIndex:u=Zc.scatter}=e;if(!WAr(t,r))return null;var d=Xlt(r),f=ixr(r),h=t.map((m,g)=>{var y,x,w=XH(XH(XH({r:3},i),f),{},{index:g,cx:(y=m.x)!==null&&y!==void 0?y:void 0,cy:(x=m.y)!==null&&x!==void 0?x:void 0,dataKey:a,value:m.value,payload:m.payload,points:t});return b.createElement(QAr,{key:"dot-".concat(g),option:r,dotProps:w,className:s})}),p={};return l&&c!=null&&(p.clipPath="url(#clipPath-".concat(d?"":"dots-").concat(c,")")),b.createElement(xv,{zIndex:u},b.createElement(Qy,k5({className:n},p),h))}function KAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function JAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?KAe(Object(r),!0).forEach(function(n){ZAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):KAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ZAr(e,t,r){return(t=YAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function YAr(e){var t=XAr(e,"string");return typeof t=="symbol"?t:t+""}function XAr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var KAr={xAxis:{},yAxis:{},zAxis:{}},Jlt=Ec({name:"cartesianAxis",initialState:KAr,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:li()},replaceXAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;e.xAxis[r.id]!==void 0&&(r.id!==n.id&&delete e.xAxis[r.id],e.xAxis[n.id]=n)},prepare:li()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:li()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:li()},replaceYAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;e.yAxis[r.id]!==void 0&&(r.id!==n.id&&delete e.yAxis[r.id],e.yAxis[n.id]=n)},prepare:li()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:li()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:li()},replaceZAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;e.zAxis[r.id]!==void 0&&(r.id!==n.id&&delete e.zAxis[r.id],e.zAxis[n.id]=n)},prepare:li()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:li()},updateYAxisWidth(e,t){var{id:r,width:n}=t.payload,s=e.yAxis[r];if(s){var a,i=s.widthHistory||[];if(i.length===3&&i[0]===i[2]&&n===i[1]&&n!==s.width&&Math.abs(n-((a=i[0])!==null&&a!==void 0?a:0))<=1)return;var l=[...i,n].slice(-3);e.yAxis[r]=JAe(JAe({},s),{},{width:n,widthHistory:l})}}}}),{addXAxis:JAr,replaceXAxis:eIr,removeXAxis:tIr,addYAxis:rIr,replaceYAxis:nIr,removeYAxis:sIr,addZAxis:zPn,replaceZAxis:BPn,removeZAxis:UPn,updateYAxisWidth:aIr}=Jlt.actions,iIr=Jlt.reducer,oIr=Xe([Yl],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),lIr=Xe([oIr,pv,mv],(e,t,r)=>{if(!(!e||t==null||r==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,r-e.top-e.bottom)}}),Ape=()=>en(lIr),cIr=()=>en(Pjr);function eIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function KH(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?eIe(Object(r),!0).forEach(function(n){uIr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function uIr(e,t,r){return(t=dIr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dIr(e){var t=fIr(e,"string");return typeof t=="symbol"?t:t+""}function fIr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var hIr=e=>{var{point:t,childIndex:r,mainColor:n,activeDot:s,dataKey:a,clipPath:i}=e;if(s===!1||t.x==null||t.y==null)return null;var l={index:r,dataKey:a,cx:t.x,cy:t.y,r:4,fill:n??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},c=KH(KH(KH({},l),zz(s)),phe(s)),u;return b.isValidElement(s)?u=b.cloneElement(s,c):typeof s=="function"?u=s(c):u=b.createElement(Zlt,c),b.createElement(Qy,{className:"recharts-active-dot",clipPath:i},u)};function pIr(e){var{points:t,mainColor:r,activeDot:n,itemDataKey:s,clipPath:a,zIndex:i=Zc.activeDot}=e,l=en(aI),c=cIr();if(t==null||c==null)return null;var u=t.find(d=>c.includes(d.payload));return Sl(u)?null:b.createElement(xv,{zIndex:i},b.createElement(hIr,{point:u,childIndex:Number(l),mainColor:r,dataKey:s,activeDot:n,clipPath:a}))}var mIr=e=>{var{chartData:t}=e,r=Vo(),n=sd();return b.useEffect(()=>n?()=>{}:(r(vAe(t)),()=>{r(vAe(void 0))}),[t,r,n]),null},tIe={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},ect=Ec({name:"brush",initialState:tIe,reducers:{setBrushSettings(e,t){return t.payload==null?tIe:t.payload}}}),{setBrushSettings:VPn}=ect.actions,gIr=ect.reducer;function yIr(e){return(e%180+180)%180}var vIr=function(t){var{width:r,height:n}=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=yIr(s),i=a*Math.PI/180,l=Math.atan(n/r),c=i>l&&i<Math.PI-l?n/Math.sin(i):r/Math.cos(i);return Math.abs(c)},bIr={dots:[],areas:[],lines:[]},tct=Ec({name:"referenceElements",initialState:bIr,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=uh(e).dots.findIndex(n=>n===t.payload);r!==-1&&e.dots.splice(r,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var r=uh(e).areas.findIndex(n=>n===t.payload);r!==-1&&e.areas.splice(r,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var r=uh(e).lines.findIndex(n=>n===t.payload);r!==-1&&e.lines.splice(r,1)}}}),{addDot:qPn,removeDot:HPn,addArea:QPn,removeArea:WPn,addLine:GPn,removeLine:ZPn}=tct.actions,xIr=tct.reducer,wIr=b.createContext(void 0),SIr=e=>{var{children:t}=e,[r]=b.useState("".concat(WA("recharts"),"-clip")),n=Ape();if(n==null)return null;var{x:s,y:a,width:i,height:l}=n;return b.createElement(wIr.Provider,{value:r},b.createElement("defs",null,b.createElement("clipPath",{id:r},b.createElement("rect",{x:s,y:a,height:l,width:i}))),t)};function rct(e,t){if(t<1)return[];if(t===1)return e;for(var r=[],n=0;n<e.length;n+=t){var s=e[n];s!==void 0&&r.push(s)}return r}function OIr(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return vIr(n,r)}function kIr(e,t,r){var n=r==="width",{x:s,y:a,width:i,height:l}=e;return t===1?{start:n?s:a,end:n?s+i:a+l}:{start:n?s+i:a+l,end:n?s:a}}function oI(e,t,r,n,s){if(e*t<e*n||e*t>e*s)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-s)<=0}function _Ir(e,t){return rct(e,t+1)}function EIr(e,t,r,n,s){for(var a=(n||[]).slice(),{start:i,end:l}=t,c=0,u=1,d=i,f=function(){var m=n?.[c];if(m===void 0)return{v:rct(n,u)};var g=c,y,x=()=>(y===void 0&&(y=r(m,g)),y),w=m.coordinate,S=c===0||oI(e,w,x,d,l);S||(c=0,d=i,u+=1),S&&(d=w+e*(x()/2+s),c+=u)},h;u<=a.length;)if(h=f(),h)return h.v;return[]}function CIr(e,t,r,n,s){var a=(n||[]).slice(),i=a.length;if(i===0)return[];for(var{start:l,end:c}=t,u=1;u<=i;u++){for(var d=(i-1)%u,f=l,h=!0,p=function(){var k=n[g];if(k==null)return 0;var _=g,E,T=()=>(E===void 0&&(E=r(k,_)),E),j=k.coordinate,N=g===d||oI(e,j,T,f,c);if(!N)return h=!1,1;N&&(f=j+e*(T()/2+s))},m,g=d;g<i&&(m=p(),!(m!==0&&m===1));g+=u);if(h){for(var y=[],x=d;x<i;x+=u){var w=n[x];w!=null&&y.push(w)}return y}}return[]}function rIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function rc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?rIe(Object(r),!0).forEach(function(n){jIr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function jIr(e,t,r){return(t=TIr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function TIr(e){var t=NIr(e,"string");return typeof t=="symbol"?t:t+""}function NIr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function AIr(e,t,r,n,s){for(var a=(n||[]).slice(),i=a.length,{start:l}=t,{end:c}=t,u=function(h){var p=a[h];if(p==null)return 1;var m=p,g,y=()=>(g===void 0&&(g=r(p,h)),g);if(h===i-1){var x=e*(m.coordinate+e*y()/2-c);a[h]=m=rc(rc({},m),{},{tickCoord:x>0?m.coordinate-x*e:m.coordinate})}else a[h]=m=rc(rc({},m),{},{tickCoord:m.coordinate});if(m.tickCoord!=null){var w=oI(e,m.tickCoord,y,l,c);w&&(c=m.tickCoord-e*(y()/2+s),a[h]=rc(rc({},m),{},{isShow:!0}))}},d=i-1;d>=0;d--)u(d);return a}function IIr(e,t,r,n,s,a){var i=(n||[]).slice(),l=i.length,{start:c,end:u}=t;if(a){var d=n[l-1];if(d!=null){var f=r(d,l-1),h=e*(d.coordinate+e*f/2-u);if(i[l-1]=d=rc(rc({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate}),d.tickCoord!=null){var p=oI(e,d.tickCoord,()=>f,c,u);p&&(u=d.tickCoord-e*(f/2+s),i[l-1]=rc(rc({},d),{},{isShow:!0}))}}}for(var m=a?l-1:l,g=function(w){var S=i[w];if(S==null)return 1;var k=S,_,E=()=>(_===void 0&&(_=r(S,w)),_);if(w===0){var T=e*(k.coordinate-e*E()/2-c);i[w]=k=rc(rc({},k),{},{tickCoord:T<0?k.coordinate-T*e:k.coordinate})}else i[w]=k=rc(rc({},k),{},{tickCoord:k.coordinate});if(k.tickCoord!=null){var j=oI(e,k.tickCoord,E,c,u);j&&(c=k.tickCoord+e*(E()/2+s),i[w]=rc(rc({},k),{},{isShow:!0}))}},y=0;y<m;y++)g(y);return i}function Ipe(e,t,r){var{tick:n,ticks:s,viewBox:a,minTickGap:i,orientation:l,interval:c,tickFormatter:u,unit:d,angle:f}=e;if(!s||!s.length||!n)return[];if(qr(c)||xP.isSsr){var h;return(h=_Ir(s,qr(c)?c:0))!==null&&h!==void 0?h:[]}var p=[],m=l==="top"||l==="bottom"?"width":"height",g=d&&m==="width"?CN(d,{fontSize:t,letterSpacing:r}):{width:0,height:0},y=(_,E)=>{var T=typeof u=="function"?u(_.value,E):_.value;return m==="width"?OIr(CN(T,{fontSize:t,letterSpacing:r}),g,f):CN(T,{fontSize:t,letterSpacing:r})[m]},x=s[0],w=s[1],S=s.length>=2&&x!=null&&w!=null?ch(w.coordinate-x.coordinate):1,k=kIr(a,S,m);return c==="equidistantPreserveStart"?EIr(S,k,y,s,i):c==="equidistantPreserveEnd"?CIr(S,k,y,s,i):(c==="preserveStart"||c==="preserveStartEnd"?p=IIr(S,k,y,s,i,c==="preserveStartEnd"):p=AIr(S,k,y,s,i),p.filter(_=>_.isShow))}var RIr=e=>{var{ticks:t,label:r,labelGapWithTick:n=5,tickSize:s=0,tickMargin:a=0}=e,i=0;if(t){Array.from(t).forEach(d=>{if(d){var f=d.getBoundingClientRect();f.width>i&&(i=f.width)}});var l=r?r.getBoundingClientRect().width:0,c=s+a,u=i+c+l+(r?n:0);return Math.round(u)}return 0},PIr={xAxis:{},yAxis:{}},nct=Ec({name:"renderedTicks",initialState:PIr,reducers:{setRenderedTicks:(e,t)=>{var{axisType:r,axisId:n,ticks:s}=t.payload;e[r][n]=s},removeRenderedTicks:(e,t)=>{var{axisType:r,axisId:n}=t.payload;delete e[r][n]}}}),{setRenderedTicks:MIr,removeRenderedTicks:DIr}=nct.actions,LIr=nct.reducer,$Ir=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function FIr(e,t){if(e==null)return{};var r,n,s=zIr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function zIr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function TS(){return TS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},TS.apply(null,arguments)}function nIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Hi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?nIe(Object(r),!0).forEach(function(n){BIr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function BIr(e,t,r){return(t=UIr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function UIr(e){var t=VIr(e,"string");return typeof t=="symbol"?t:t+""}function VIr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Dy={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",zIndex:Zc.axis};function qIr(e){var{x:t,y:r,width:n,height:s,orientation:a,mirror:i,axisLine:l,otherSvgProps:c}=e;if(!l)return null;var u=Hi(Hi(Hi({},c),Jm(l)),{},{fill:"none"});if(a==="top"||a==="bottom"){var d=+(a==="top"&&!i||a==="bottom"&&i);u=Hi(Hi({},u),{},{x1:t,y1:r+d*s,x2:t+n,y2:r+d*s})}else{var f=+(a==="left"&&!i||a==="right"&&i);u=Hi(Hi({},u),{},{x1:t+f*n,y1:r,x2:t+f*n,y2:r+s})}return b.createElement("line",TS({},u,{className:xa("recharts-cartesian-axis-line",qz(l,"className"))}))}function HIr(e,t,r,n,s,a,i,l,c){var u,d,f,h,p,m,g=l?-1:1,y=e.tickSize||i,x=qr(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":u=d=e.coordinate,h=r+ +!l*s,f=h-g*y,m=f-g*c,p=x;break;case"left":f=h=e.coordinate,d=t+ +!l*n,u=d-g*y,p=u-g*c,m=x;break;case"right":f=h=e.coordinate,d=t+ +l*n,u=d+g*y,p=u+g*c,m=x;break;default:u=d=e.coordinate,h=r+ +l*s,f=h+g*y,m=f+g*c,p=x;break}return{line:{x1:u,y1:f,x2:d,y2:h},tick:{x:p,y:m}}}function QIr(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function WIr(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function GIr(e){var{option:t,tickProps:r,value:n}=e,s,a=xa(r.className,"recharts-cartesian-axis-tick-value");if(b.isValidElement(t))s=b.cloneElement(t,Hi(Hi({},r),{},{className:a}));else if(typeof t=="function")s=t(Hi(Hi({},r),{},{className:a}));else{var i="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(i=xa(i,sAr(t))),s=b.createElement(Tpe,TS({},r,{className:i}),n)}return s}function ZIr(e){var{ticks:t,axisType:r,axisId:n}=e,s=Vo();return b.useEffect(()=>{if(n==null||r==null)return f1;var a=t.map(i=>({value:i.value,coordinate:i.coordinate,offset:i.offset,index:i.index}));return s(MIr({ticks:a,axisId:n,axisType:r})),()=>{s(DIr({axisId:n,axisType:r}))}},[s,t,n,r]),null}var YIr=b.forwardRef((e,t)=>{var{ticks:r=[],tick:n,tickLine:s,stroke:a,tickFormatter:i,unit:l,padding:c,tickTextProps:u,orientation:d,mirror:f,x:h,y:p,width:m,height:g,tickSize:y,tickMargin:x,fontSize:w,letterSpacing:S,getTicksConfig:k,events:_,axisType:E,axisId:T}=e,j=Ipe(Hi(Hi({},k),{},{ticks:r}),w,S),N=Jm(k),I=zz(n),P=Blt(N.textAnchor)?N.textAnchor:QIr(d,f),R=WIr(d,f),B={};typeof s=="object"&&(B=s);var D=Hi(Hi({},N),{},{fill:"none"},B),$=j.map(H=>Hi({entry:H},HIr(H,h,p,m,g,d,y,f,x))),U=$.map(H=>{var{entry:Q,line:L}=H;return b.createElement(Qy,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(Q.value,"-").concat(Q.coordinate,"-").concat(Q.tickCoord)},s&&b.createElement("line",TS({},D,L,{className:xa("recharts-cartesian-axis-tick-line",qz(s,"className"))})))}),z=$.map((H,Q)=>{var L,Z,{entry:V,tick:M}=H,W=Hi(Hi(Hi(Hi({verticalAnchor:R},N),{},{textAnchor:P,stroke:"none",fill:a},M),{},{index:Q,payload:V,visibleTicksCount:j.length,tickFormatter:i,padding:c},u),{},{angle:(L=(Z=u?.angle)!==null&&Z!==void 0?Z:N.angle)!==null&&L!==void 0?L:0}),G=Hi(Hi({},W),I);return b.createElement(Qy,TS({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(V.value,"-").concat(V.coordinate,"-").concat(V.tickCoord)},u0r(_,V,Q)),n&&b.createElement(GIr,{option:n,tickProps:G,value:"".concat(typeof i=="function"?i(V.value,Q):V.value).concat(l||"")}))});return b.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(E,"-ticks")},b.createElement(ZIr,{ticks:j,axisId:T,axisType:E}),z.length>0&&b.createElement(xv,{zIndex:Zc.label},b.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(E,"-tick-labels"),ref:t},z)),U.length>0&&b.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(E,"-tick-lines")},U))}),XIr=b.forwardRef((e,t)=>{var{axisLine:r,width:n,height:s,className:a,hide:i,ticks:l,axisType:c,axisId:u}=e,d=FIr(e,$Ir),[f,h]=b.useState(""),[p,m]=b.useState(""),g=b.useRef(null);b.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var x;return RIr({ticks:g.current,label:(x=e.labelRef)===null||x===void 0?void 0:x.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var y=b.useCallback(x=>{if(x){var w=x.getElementsByClassName("recharts-cartesian-axis-tick-value");g.current=w;var S=w[0];if(S){var k=window.getComputedStyle(S),_=k.fontSize,E=k.letterSpacing;(_!==f||E!==p)&&(h(_),m(E))}}},[f,p]);return i||n!=null&&n<=0||s!=null&&s<=0?null:b.createElement(xv,{zIndex:e.zIndex},b.createElement(Qy,{className:xa("recharts-cartesian-axis",a)},b.createElement(qIr,{x:e.x,y:e.y,width:n,height:s,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:Jm(e)}),b.createElement(YIr,{ref:y,axisType:c,events:d,fontSize:f,getTicksConfig:e,height:e.height,letterSpacing:p,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:l,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:u}),b.createElement(LNr,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},b.createElement(WNr,{label:e.label,labelRef:e.labelRef}),e.children)))}),Rpe=b.forwardRef((e,t)=>{var r=nd(e,Dy);return b.createElement(XIr,TS({},r,{ref:t}))});Rpe.displayName="CartesianAxis";var KIr=["x1","y1","x2","y2","key"],JIr=["offset"],eRr=["xAxisId","yAxisId"],tRr=["xAxisId","yAxisId"];function sIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function cc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sIe(Object(r),!0).forEach(function(n){rRr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function rRr(e,t,r){return(t=nRr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nRr(e){var t=sRr(e,"string");return typeof t=="symbol"?t:t+""}function sRr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ew(){return Ew=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ew.apply(null,arguments)}function _5(e,t){if(e==null)return{};var r,n,s=aRr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function aRr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var iRr=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:r,x:n,y:s,width:a,height:i,ry:l}=e;return b.createElement("rect",{x:n,y:s,ry:l,width:a,height:i,stroke:"none",fill:t,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function sct(e){var{option:t,lineItemProps:r}=e,n;if(b.isValidElement(t))n=b.cloneElement(t,r);else if(typeof t=="function")n=t(r);else{var s,{x1:a,y1:i,x2:l,y2:c,key:u}=r,d=_5(r,KIr),f=(s=Jm(d))!==null&&s!==void 0?s:{},{offset:h}=f,p=_5(f,JIr);n=b.createElement("line",Ew({},p,{x1:a,y1:i,x2:l,y2:c,fill:"none",key:u}))}return n}function oRr(e){var{x:t,width:r,horizontal:n=!0,horizontalPoints:s}=e;if(!n||!s||!s.length)return null;var{xAxisId:a,yAxisId:i}=e,l=_5(e,eRr),c=s.map((u,d)=>{var f=cc(cc({},l),{},{x1:t,y1:u,x2:t+r,y2:u,key:"line-".concat(d),index:d});return b.createElement(sct,{key:"line-".concat(d),option:n,lineItemProps:f})});return b.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function lRr(e){var{y:t,height:r,vertical:n=!0,verticalPoints:s}=e;if(!n||!s||!s.length)return null;var{xAxisId:a,yAxisId:i}=e,l=_5(e,tRr),c=s.map((u,d)=>{var f=cc(cc({},l),{},{x1:u,y1:t,x2:u,y2:t+r,key:"line-".concat(d),index:d});return b.createElement(sct,{option:n,lineItemProps:f,key:"line-".concat(d)})});return b.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function cRr(e){var{horizontalFill:t,fillOpacity:r,x:n,y:s,width:a,height:i,horizontalPoints:l,horizontal:c=!0}=e;if(!c||!t||!t.length||l==null)return null;var u=l.map(f=>Math.round(f+s-s)).sort((f,h)=>f-h);s!==u[0]&&u.unshift(0);var d=u.map((f,h)=>{var p=u[h+1],m=p==null,g=m?s+i-f:p-f;if(g<=0)return null;var y=h%t.length;return b.createElement("rect",{key:"react-".concat(h),y:f,x:n,height:g,width:a,stroke:"none",fill:t[y],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return b.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function uRr(e){var{vertical:t=!0,verticalFill:r,fillOpacity:n,x:s,y:a,width:i,height:l,verticalPoints:c}=e;if(!t||!r||!r.length)return null;var u=c.map(f=>Math.round(f+s-s)).sort((f,h)=>f-h);s!==u[0]&&u.unshift(0);var d=u.map((f,h)=>{var p=u[h+1],m=p==null,g=m?s+i-f:p-f;if(g<=0)return null;var y=h%r.length;return b.createElement("rect",{key:"react-".concat(h),x:f,y:a,width:g,height:l,stroke:"none",fill:r[y],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return b.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var dRr=(e,t)=>{var{xAxis:r,width:n,height:s,offset:a}=e;return qat(Ipe(cc(cc(cc({},Dy),r),{},{ticks:Hat(r),viewBox:{x:0,y:0,width:n,height:s}})),a.left,a.left+a.width,t)},fRr=(e,t)=>{var{yAxis:r,width:n,height:s,offset:a}=e;return qat(Ipe(cc(cc(cc({},Dy),r),{},{ticks:Hat(r),viewBox:{x:0,y:0,width:n,height:s}})),a.top,a.top+a.height,t)},hRr={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Zc.grid};function act(e){var t=Jat(),r=eit(),n=Kat(),s=cc(cc({},nd(e,hRr)),{},{x:qr(e.x)?e.x:n.left,y:qr(e.y)?e.y:n.top,width:qr(e.width)?e.width:n.width,height:qr(e.height)?e.height:n.height}),{xAxisId:a,yAxisId:i,x:l,y:c,width:u,height:d,syncWithTicks:f,horizontalValues:h,verticalValues:p}=s,m=sd(),g=en(N=>aAe(N,"xAxis",a,m)),y=en(N=>aAe(N,"yAxis",i,m));if(!tg(u)||!tg(d)||!qr(l)||!qr(c))return null;var x=s.verticalCoordinatesGenerator||dRr,w=s.horizontalCoordinatesGenerator||fRr,{horizontalPoints:S,verticalPoints:k}=s;if((!S||!S.length)&&typeof w=="function"){var _=h&&h.length,E=w({yAxis:y?cc(cc({},y),{},{ticks:_?h:y.ticks}):void 0,width:t??u,height:r??d,offset:n},_?!0:f);Y4(Array.isArray(E),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof E,"]")),Array.isArray(E)&&(S=E)}if((!k||!k.length)&&typeof x=="function"){var T=p&&p.length,j=x({xAxis:g?cc(cc({},g),{},{ticks:T?p:g.ticks}):void 0,width:t??u,height:r??d,offset:n},T?!0:f);Y4(Array.isArray(j),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof j,"]")),Array.isArray(j)&&(k=j)}return b.createElement(xv,{zIndex:s.zIndex},b.createElement("g",{className:"recharts-cartesian-grid"},b.createElement(iRr,{fill:s.fill,fillOpacity:s.fillOpacity,x:s.x,y:s.y,width:s.width,height:s.height,ry:s.ry}),b.createElement(cRr,Ew({},s,{horizontalPoints:S})),b.createElement(uRr,Ew({},s,{verticalPoints:k})),b.createElement(oRr,Ew({},s,{offset:n,horizontalPoints:S,xAxis:g,yAxis:y})),b.createElement(lRr,Ew({},s,{offset:n,verticalPoints:k,xAxis:g,yAxis:y}))))}act.displayName="CartesianGrid";var pRr={},ict=Ec({name:"errorBars",initialState:pRr,reducers:{addErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]||(e[r]=[]),e[r].push(n)},replaceErrorBar:(e,t)=>{var{itemId:r,prev:n,next:s}=t.payload;e[r]&&(e[r]=e[r].map(a=>a.dataKey===n.dataKey&&a.direction===n.direction?s:a))},removeErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]&&(e[r]=e[r].filter(s=>s.dataKey!==n.dataKey||s.direction!==n.direction))}}}),{addErrorBar:YPn,replaceErrorBar:XPn,removeErrorBar:KPn}=ict.actions,mRr=ict.reducer,gRr=["children"];function yRr(e,t){if(e==null)return{};var r,n,s=vRr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function vRr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var bRr={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},xRr=b.createContext(bRr);function wRr(e){var{children:t}=e,r=yRr(e,gRr);return b.createElement(xRr.Provider,{value:r},t)}function oct(e,t){var r,n,s=en(u=>yv(u,e)),a=en(u=>vv(u,t)),i=(r=s?.allowDataOverflow)!==null&&r!==void 0?r:Yo.allowDataOverflow,l=(n=a?.allowDataOverflow)!==null&&n!==void 0?n:Xo.allowDataOverflow,c=i||l;return{needClip:c,needClipX:i,needClipY:l}}function SRr(e){var{xAxisId:t,yAxisId:r,clipPathId:n}=e,s=Ape(),{needClipX:a,needClipY:i,needClip:l}=oct(t,r);if(!l||!s)return null;var{x:c,y:u,width:d,height:f}=s;return b.createElement("clipPath",{id:"clipPath-".concat(n)},b.createElement("rect",{x:a?c:c-d/2,y:i?u:u-f/2,width:a?d:d*2,height:i?f:f*2}))}var lct=(e,t,r,n)=>olt(e,"xAxis",t,n),cct=(e,t,r,n)=>ilt(e,"xAxis",t,n),uct=(e,t,r,n)=>olt(e,"yAxis",r,n),dct=(e,t,r,n)=>ilt(e,"yAxis",r,n),ORr=Xe([Fi,lct,uct,cct,dct],(e,t,r,n,s)=>hv(e,"xAxis")?Z4(t,n,!1):Z4(r,s,!1)),kRr=(e,t,r,n,s)=>s;function _Rr(e){return e.type==="line"}var ERr=Xe([Not,kRr],(e,t)=>e.filter(_Rr).find(r=>r.id===t)),CRr=Xe([Fi,lct,uct,cct,dct,ERr,ORr,jhe],(e,t,r,n,s,a,i,l)=>{var{chartData:c,dataStartIndex:u,dataEndIndex:d}=l;if(!(a==null||t==null||r==null||n==null||s==null||n.length===0||s.length===0||i==null||e!=="horizontal"&&e!=="vertical")){var{dataKey:f,data:h}=a,p;if(h!=null&&h.length>0?p=h:p=c?.slice(u,d+1),p!=null)return GRr({layout:e,xAxis:t,yAxis:r,xAxisTicks:n,yAxisTicks:s,dataKey:f,bandSize:i,displayedData:p})}});function jRr(e){var t=zz(e),r=3,n=2;if(t!=null){var{r:s,strokeWidth:a}=t,i=Number(s),l=Number(a);return(Number.isNaN(i)||i<0)&&(i=r),(Number.isNaN(l)||l<0)&&(l=n),{r:i,strokeWidth:l}}return{r,strokeWidth:n}}var TRr=["id"],NRr=["type","layout","connectNulls","needClip","shape"],ARr=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function lI(){return lI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lI.apply(null,arguments)}function aIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function pm(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?aIe(Object(r),!0).forEach(function(n){IRr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):aIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function IRr(e,t,r){return(t=RRr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function RRr(e){var t=PRr(e,"string");return typeof t=="symbol"?t:t+""}function PRr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ppe(e,t){if(e==null)return{};var r,n,s=MRr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function MRr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var DRr=e=>{var{dataKey:t,name:r,stroke:n,legendType:s,hide:a}=e;return[{inactive:a,dataKey:t,type:s,color:n,value:Qat(r,t),payload:e}]},LRr=b.memo(e=>{var{dataKey:t,data:r,stroke:n,strokeWidth:s,fill:a,name:i,hide:l,unit:c,tooltipType:u,id:d}=e,f={dataDefinedOnItem:r,getPosition:f1,settings:{stroke:n,strokeWidth:s,fill:a,dataKey:t,nameKey:void 0,name:Qat(i,t),hide:l,type:u,color:n,unit:c,graphicalItemId:d}};return b.createElement(EAr,{tooltipEntrySettings:f})}),fct=(e,t)=>"".concat(t,"px ").concat(e,"px");function $Rr(e,t){for(var r=e.length%2!==0?[...e,0]:e,n=[],s=0;s<t;++s)n.push(...r);return n}var FRr=(e,t,r)=>{var n=r.reduce((h,p)=>h+p,0);if(!n)return fct(t,e);for(var s=Math.floor(e/n),a=e%n,i=[],l=0,c=0;l<r.length;c+=(u=r[l])!==null&&u!==void 0?u:0,++l){var u,d=r[l];if(d!=null&&c+d>a){i=[...r.slice(0,l),a-c];break}}var f=i.length%2===0?[0,t]:[t];return[...$Rr(r,s),...i,...f].map(h=>"".concat(h,"px")).join(", ")};function zRr(e){var{clipPathId:t,points:r,props:n}=e,{dot:s,dataKey:a,needClip:i}=n,{id:l}=n,c=Ppe(n,TRr),u=Jm(c);return b.createElement(GAr,{points:r,dot:s,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:u,needClip:i,clipPathId:t})}function BRr(e){var{showLabels:t,children:r,points:n}=e,s=b.useMemo(()=>n?.map(a=>{var i,l,c={x:(i=a.x)!==null&&i!==void 0?i:0,y:(l=a.y)!==null&&l!==void 0?l:0,width:0,lowerWidth:0,upperWidth:0,height:0};return pm(pm({},c),{},{value:a.value,payload:a.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[n]);return b.createElement(KNr,{value:t?s:void 0},r)}function iIe(e){var{clipPathId:t,pathRef:r,points:n,strokeDasharray:s,props:a}=e,{type:i,layout:l,connectNulls:c,needClip:u,shape:d}=a,f=Ppe(a,NRr),h=pm(pm({},su(f)),{},{fill:"none",className:"recharts-line-curve",clipPath:u?"url(#clipPath-".concat(t,")"):void 0,points:n,type:i,layout:l,connectNulls:c,strokeDasharray:s??a.strokeDasharray});return b.createElement(b.Fragment,null,n?.length>1&&b.createElement(_Ar,lI({shapeType:"curve",option:d},h,{pathRef:r})),b.createElement(zRr,{points:n,clipPathId:t,props:a}))}function URr(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function VRr(e){var{clipPathId:t,props:r,pathRef:n,previousPointsRef:s,longestAnimatedLengthRef:a}=e,{points:i,strokeDasharray:l,isAnimationActive:c,animationBegin:u,animationDuration:d,animationEasing:f,animateNewValues:h,width:p,height:m,onAnimationEnd:g,onAnimationStart:y}=r,x=s.current,w=Che(i,"recharts-line-"),S=b.useRef(w),[k,_]=b.useState(!1),E=!k,T=b.useCallback(()=>{typeof g=="function"&&g(),_(!1)},[g]),j=b.useCallback(()=>{typeof y=="function"&&y(),_(!0)},[y]),N=URr(n.current),I=b.useRef(0);S.current!==w&&(I.current=a.current,S.current=w);var P=I.current;return b.createElement(BRr,{points:i,showLabels:E},r.children,b.createElement(Ehe,{animationId:w,begin:u,duration:d,isActive:c,easing:f,onAnimationEnd:T,onAnimationStart:j,key:w},R=>{var B=Mu(P,N+P,R),D=Math.min(B,N),$;if(c)if(l){var U="".concat(l).split(/[,\s]+/gim).map(Q=>parseFloat(Q));$=FRr(D,N,U)}else $=fct(N,D);else $=l==null?void 0:String(l);if(R>0&&N>0&&(s.current=i,a.current=Math.max(a.current,D)),x){var z=x.length/i.length,H=R===1?i:i.map((Q,L)=>{var Z=Math.floor(L*z);if(x[Z]){var V=x[Z];return pm(pm({},Q),{},{x:Mu(V.x,Q.x,R),y:Mu(V.y,Q.y,R)})}return h?pm(pm({},Q),{},{x:Mu(p*2,Q.x,R),y:Mu(m/2,Q.y,R)}):pm(pm({},Q),{},{x:Q.x,y:Q.y})});return s.current=H,b.createElement(iIe,{props:r,points:H,clipPathId:t,pathRef:n,strokeDasharray:$})}return b.createElement(iIe,{props:r,points:i,clipPathId:t,pathRef:n,strokeDasharray:$})}),b.createElement(tAr,{label:r.label}))}function qRr(e){var{clipPathId:t,props:r}=e,n=b.useRef(null),s=b.useRef(0),a=b.useRef(null);return b.createElement(VRr,{props:r,clipPathId:t,previousPointsRef:n,longestAnimatedLengthRef:s,pathRef:a})}var HRr=(e,t)=>{var r,n;return{x:(r=e.x)!==null&&r!==void 0?r:void 0,y:(n=e.y)!==null&&n!==void 0?n:void 0,value:e.value,errorVal:Ql(e.payload,t)}};class QRr extends b.Component{render(){var{hide:t,dot:r,points:n,className:s,xAxisId:a,yAxisId:i,top:l,left:c,width:u,height:d,id:f,needClip:h,zIndex:p}=this.props;if(t)return null;var m=xa("recharts-line",s),g=f,{r:y,strokeWidth:x}=jRr(r),w=Xlt(r),S=y*2+x,k=h?"url(#clipPath-".concat(w?"":"dots-").concat(g,")"):void 0;return b.createElement(xv,{zIndex:p},b.createElement(Qy,{className:m},h&&b.createElement("defs",null,b.createElement(SRr,{clipPathId:g,xAxisId:a,yAxisId:i}),!w&&b.createElement("clipPath",{id:"clipPath-dots-".concat(g)},b.createElement("rect",{x:c-S/2,y:l-S/2,width:u+S,height:d+S}))),b.createElement(wRr,{xAxisId:a,yAxisId:i,data:n,dataPointFormatter:HRr,errorBarOffset:0},b.createElement(qRr,{props:this.props,clipPathId:g}))),b.createElement(pIr,{activeDot:this.props.activeDot,points:n,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:k}))}}var hct={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:Zc.line,type:"linear"};function WRr(e){var t=nd(e,hct),{activeDot:r,animateNewValues:n,animationBegin:s,animationDuration:a,animationEasing:i,connectNulls:l,dot:c,hide:u,isAnimationActive:d,label:f,legendType:h,xAxisId:p,yAxisId:m,id:g}=t,y=Ppe(t,ARr),{needClip:x}=oct(p,m),w=Ape(),S=eC(),k=sd(),_=en(I=>CRr(I,p,m,k,g));if(S!=="horizontal"&&S!=="vertical"||_==null||w==null)return null;var{height:E,width:T,x:j,y:N}=w;return b.createElement(QRr,lI({},y,{id:g,connectNulls:l,dot:c,activeDot:r,animateNewValues:n,animationBegin:s,animationDuration:a,animationEasing:i,isAnimationActive:d,hide:u,label:f,legendType:h,xAxisId:p,yAxisId:m,points:_,layout:S,height:E,width:T,left:j,top:N,needClip:x}))}function GRr(e){var{layout:t,xAxis:r,yAxis:n,xAxisTicks:s,yAxisTicks:a,dataKey:i,bandSize:l,displayedData:c}=e;return c.map((u,d)=>{var f=Ql(u,i);if(t==="horizontal"){var h=sTe({axis:r,ticks:s,bandSize:l,entry:u,index:d}),p=Sl(f)?null:n.scale.map(f);return{x:h,y:p??null,value:f,payload:u}}var m=Sl(f)?null:r.scale.map(f),g=sTe({axis:n,ticks:a,bandSize:l,entry:u,index:d});return m==null||g==null?null:{x:m,y:g,value:f,payload:u}}).filter(Boolean)}function ZRr(e){var t=nd(e,hct),r=sd();return b.createElement(IAr,{id:t.id,type:"line"},n=>b.createElement(b.Fragment,null,b.createElement(CAr,{legendPayload:DRr(t)}),b.createElement(LRr,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:n}),b.createElement(FAr,{type:"line",id:n,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:r}),b.createElement(WRr,lI({},t,{id:n}))))}var pct=b.memo(ZRr,c9);pct.displayName="Line";var YRr=["domain","range"],XRr=["domain","range"];function oIe(e,t){if(e==null)return{};var r,n,s=KRr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function KRr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function lIe(e,t){return e===t?!0:Array.isArray(e)&&e.length===2&&Array.isArray(t)&&t.length===2?e[0]===t[0]&&e[1]===t[1]:!1}function mct(e,t){if(e===t)return!0;var{domain:r,range:n}=e,s=oIe(e,YRr),{domain:a,range:i}=t,l=oIe(t,XRr);return!lIe(r,a)||!lIe(n,i)?!1:c9(s,l)}var JRr=["type"],ePr=["dangerouslySetInnerHTML","ticks","scale"],tPr=["id","scale"];function Wae(){return Wae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Wae.apply(null,arguments)}function cIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function uIe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?cIe(Object(r),!0).forEach(function(n){rPr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function rPr(e,t,r){return(t=nPr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nPr(e){var t=sPr(e,"string");return typeof t=="symbol"?t:t+""}function sPr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Gae(e,t){if(e==null)return{};var r,n,s=aPr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function aPr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function iPr(e){var t=Vo(),r=b.useRef(null),n=tit(),{type:s}=e,a=Gae(e,JRr),i=f9(n,"xAxis",s),l=b.useMemo(()=>{if(i!=null)return uIe(uIe({},a),{},{type:i})},[a,i]);return b.useLayoutEffect(()=>{l!=null&&(r.current===null?t(JAr(l)):r.current!==l&&t(eIr({prev:r.current,next:l})),r.current=l)},[l,t]),b.useLayoutEffect(()=>()=>{r.current&&(t(tIr(r.current)),r.current=null)},[t]),null}var oPr=e=>{var{xAxisId:t,className:r}=e,n=en(Gat),s=sd(),a="xAxis",i=en(x=>alt(x,a,t,s)),l=en(x=>mCr(x,t)),c=en(x=>wCr(x,t)),u=en(x=>Eot(x,t));if(l==null||c==null||u==null)return null;var{dangerouslySetInnerHTML:d,ticks:f,scale:h}=e,p=Gae(e,ePr),{id:m,scale:g}=u,y=Gae(u,tPr);return b.createElement(Rpe,Wae({},p,y,{x:c.x,y:c.y,width:l.width,height:l.height,className:xa("recharts-".concat(a," ").concat(a),r),viewBox:n,ticks:i,axisType:a,axisId:t}))},lPr={allowDataOverflow:Yo.allowDataOverflow,allowDecimals:Yo.allowDecimals,allowDuplicatedCategory:Yo.allowDuplicatedCategory,angle:Yo.angle,axisLine:Dy.axisLine,height:Yo.height,hide:!1,includeHidden:Yo.includeHidden,interval:Yo.interval,label:!1,minTickGap:Yo.minTickGap,mirror:Yo.mirror,orientation:Yo.orientation,padding:Yo.padding,reversed:Yo.reversed,scale:Yo.scale,tick:Yo.tick,tickCount:Yo.tickCount,tickLine:Dy.tickLine,tickSize:Dy.tickSize,type:Yo.type,niceTicks:Yo.niceTicks,xAxisId:0},cPr=e=>{var t=nd(e,lPr);return b.createElement(b.Fragment,null,b.createElement(iPr,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),b.createElement(oPr,t))},gct=b.memo(cPr,mct);gct.displayName="XAxis";var uPr=["type"],dPr=["dangerouslySetInnerHTML","ticks","scale"],fPr=["id","scale"];function Zae(){return Zae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zae.apply(null,arguments)}function dIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function fIe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?dIe(Object(r),!0).forEach(function(n){hPr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hPr(e,t,r){return(t=pPr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pPr(e){var t=mPr(e,"string");return typeof t=="symbol"?t:t+""}function mPr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Yae(e,t){if(e==null)return{};var r,n,s=gPr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function gPr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function yPr(e){var t=Vo(),r=b.useRef(null),n=tit(),{type:s}=e,a=Yae(e,uPr),i=f9(n,"yAxis",s),l=b.useMemo(()=>{if(i!=null)return fIe(fIe({},a),{},{type:i})},[i,a]);return b.useLayoutEffect(()=>{l!=null&&(r.current===null?t(rIr(l)):r.current!==l&&t(nIr({prev:r.current,next:l})),r.current=l)},[l,t]),b.useLayoutEffect(()=>()=>{r.current&&(t(sIr(r.current)),r.current=null)},[t]),null}function vPr(e){var{yAxisId:t,className:r,width:n,label:s}=e,a=b.useRef(null),i=b.useRef(null),l=en(Gat),c=sd(),u=Vo(),d="yAxis",f=en(E=>kCr(E,t)),h=en(E=>OCr(E,t)),p=en(E=>alt(E,d,t,c)),m=en(E=>Cot(E,t));if(b.useLayoutEffect(()=>{if(!(n!=="auto"||!f||Npe(s)||b.isValidElement(s)||m==null)){var E=a.current;if(E){var T=E.getCalculatedWidth();Math.round(f.width)!==Math.round(T)&&u(aIr({id:t,width:T}))}}},[p,f,u,s,t,n,m]),f==null||h==null||m==null)return null;var{dangerouslySetInnerHTML:g,ticks:y,scale:x}=e,w=Yae(e,dPr),{id:S,scale:k}=m,_=Yae(m,fPr);return b.createElement(Rpe,Zae({},w,_,{ref:a,labelRef:i,x:h.x,y:h.y,tickTextProps:n==="auto"?{width:void 0}:{width:n},width:f.width,height:f.height,className:xa("recharts-".concat(d," ").concat(d),r),viewBox:l,ticks:p,axisType:d,axisId:t}))}var bPr={allowDataOverflow:Xo.allowDataOverflow,allowDecimals:Xo.allowDecimals,allowDuplicatedCategory:Xo.allowDuplicatedCategory,angle:Xo.angle,axisLine:Dy.axisLine,hide:!1,includeHidden:Xo.includeHidden,interval:Xo.interval,label:!1,minTickGap:Xo.minTickGap,mirror:Xo.mirror,orientation:Xo.orientation,padding:Xo.padding,reversed:Xo.reversed,scale:Xo.scale,tick:Xo.tick,tickCount:Xo.tickCount,tickLine:Dy.tickLine,tickSize:Dy.tickSize,type:Xo.type,niceTicks:Xo.niceTicks,width:Xo.width,yAxisId:0},xPr=e=>{var t=nd(e,bPr);return b.createElement(b.Fragment,null,b.createElement(yPr,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),b.createElement(vPr,t))},yct=b.memo(xPr,mct);yct.displayName="YAxis";var wPr=(e,t)=>t,Mpe=Xe([wPr,Fi,Fit,_l,Olt,bv,Wjr,Yl],eTr);function SPr(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function Dpe(e){var t=e.currentTarget.getBoundingClientRect(),r,n;if(SPr(e)){var s=e.currentTarget.getBBox();r=s.width>0?t.width/s.width:1,n=s.height>0?t.height/s.height:1}else{var a=e.currentTarget;r=a.offsetWidth>0?t.width/a.offsetWidth:1,n=a.offsetHeight>0?t.height/a.offsetHeight:1}var i=(l,c)=>({relativeX:Math.round((l-t.left)/r),relativeY:Math.round((c-t.top)/n)});return"touches"in e?Array.from(e.touches).map(l=>i(l.clientX,l.clientY)):i(e.clientX,e.clientY)}var vct=of("mouseClick"),bct=gP();bct.startListening({actionCreator:vct,effect:(e,t)=>{var r=e.payload,n=Mpe(t.getState(),Dpe(r));n?.activeIndex!=null&&t.dispatch(FCr({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var Xae=of("mouseMove"),xct=gP(),wO=null,F0=null,JH=null;xct.startListening({actionCreator:Xae,effect:(e,t)=>{var r=e.payload,n=t.getState(),{throttleDelay:s,throttledEvents:a}=n.eventSettings,i=a==="all"||a?.includes("mousemove");wO!==null&&(cancelAnimationFrame(wO),wO=null),F0!==null&&(typeof s!="number"||!i)&&(clearTimeout(F0),F0=null),JH=Dpe(r);var l=()=>{var c=t.getState(),u=bpe(c,c.tooltip.settings.shared);if(!JH){wO=null,F0=null;return}if(u==="axis"){var d=Mpe(c,JH);d?.activeIndex!=null?t.dispatch(plt({activeIndex:d.activeIndex,activeDataKey:void 0,activeCoordinate:d.activeCoordinate})):t.dispatch(hlt())}wO=null,F0=null};if(!i){l();return}s==="raf"?wO=requestAnimationFrame(l):typeof s=="number"&&F0===null&&(F0=setTimeout(l,s))}});function OPr(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<<CHILDREN>>":t}var hIe={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},wct=Ec({name:"rootProps",initialState:hIe,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:hIe.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),kPr=wct.reducer,{updateOptions:_Pr}=wct.actions,EPr=null,CPr={updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)},Sct=Ec({name:"polarOptions",initialState:EPr,reducers:CPr}),{updatePolarOptions:JPn}=Sct.actions,jPr=Sct.reducer,Oct=of("keyDown"),kct=of("focus"),_ct=of("blur"),E9=gP(),SO=null,z0=null,QD=null;E9.startListening({actionCreator:Oct,effect:(e,t)=>{QD=e.payload,SO!==null&&(cancelAnimationFrame(SO),SO=null);var r=t.getState(),{throttleDelay:n,throttledEvents:s}=r.eventSettings,a=s==="all"||s.includes("keydown");z0!==null&&(typeof n!="number"||!a)&&(clearTimeout(z0),z0=null);var i=()=>{try{var l=t.getState(),c=l.rootProps.accessibilityLayer!==!1;if(!c)return;var{keyboardInteraction:u}=l.tooltip,d=QD;if(d!=="ArrowRight"&&d!=="ArrowLeft"&&d!=="Enter")return;var f=xpe(u,lC(l),jP(l),NP(l)),h=f==null?-1:Number(f);if(!Number.isFinite(h)||h<0)return;var p=bv(l);if(d==="Enter"){var m=x5(l,"axis","hover",String(u.index));t.dispatch(b5({active:!u.active,activeIndex:u.index,activeCoordinate:m}));return}var g=TCr(l),y=g==="left-to-right"?1:-1,x=d==="ArrowRight"?1:-1,w=h+x*y;if(p==null||w>=p.length||w<0)return;var S=x5(l,"axis","hover",String(w));t.dispatch(b5({active:!0,activeIndex:w.toString(),activeCoordinate:S}))}finally{SO=null,z0=null}};if(!a){i();return}n==="raf"?SO=requestAnimationFrame(i):typeof n=="number"&&z0===null&&(i(),QD=null,z0=setTimeout(()=>{QD?i():(z0=null,SO=null)},n))}});E9.startListening({actionCreator:kct,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:s}=r.tooltip;if(!s.active&&s.index==null){var a="0",i=x5(r,"axis","hover",String(a));t.dispatch(b5({active:!0,activeIndex:a,activeCoordinate:i}))}}}});E9.startListening({actionCreator:_ct,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:s}=r.tooltip;s.active&&t.dispatch(b5({active:!1,activeIndex:s.index,activeCoordinate:s.coordinate}))}}});function Ect(e){e.persist();var{currentTarget:t}=e;return new Proxy(e,{get:(r,n)=>{if(n==="currentTarget")return t;var s=Reflect.get(r,n);return typeof s=="function"?s.bind(r):s}})}var Wf=of("externalEvent"),Cct=gP(),WD=new Map,nT=new Map,eQ=new Map;Cct.startListening({actionCreator:Wf,effect:(e,t)=>{var{handler:r,reactEvent:n}=e.payload;if(r!=null){var s=n.type,a=Ect(n);eQ.set(s,{handler:r,reactEvent:a});var i=WD.get(s);i!==void 0&&(cancelAnimationFrame(i),WD.delete(s));var l=t.getState(),{throttleDelay:c,throttledEvents:u}=l.eventSettings,d=u,f=d==="all"||d?.includes(s),h=nT.get(s);h!==void 0&&(typeof c!="number"||!f)&&(clearTimeout(h),nT.delete(s));var p=()=>{var y=eQ.get(s);try{if(!y)return;var{handler:x,reactEvent:w}=y,S=t.getState(),k={activeCoordinate:Ajr(S),activeDataKey:jjr(S),activeIndex:aI(S),activeLabel:Elt(S),activeTooltipIndex:aI(S),isTooltipActive:Ijr(S)};x&&x(k,w)}finally{WD.delete(s),nT.delete(s),eQ.delete(s)}};if(!f){p();return}if(c==="raf"){var m=requestAnimationFrame(p);WD.set(s,m)}else if(typeof c=="number"){if(!nT.has(s)){p();var g=setTimeout(p,c);nT.set(s,g)}}else p()}}});var TPr=Xe([iC],e=>e.tooltipItemPayloads),NPr=Xe([TPr,(e,t)=>t,(e,t,r)=>r],(e,t,r)=>{if(t!=null){var n=e.find(a=>a.settings.graphicalItemId===r);if(n!=null){var{getPosition:s}=n;if(s!=null)return s(t)}}}),jct=of("touchMove"),Tct=gP(),B0=null,rb=null,pIe=null,sT=null;Tct.startListening({actionCreator:jct,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){sT=Ect(r);var n=t.getState(),{throttleDelay:s,throttledEvents:a}=n.eventSettings,i=a==="all"||a.includes("touchmove");B0!==null&&(cancelAnimationFrame(B0),B0=null),rb!==null&&(typeof s!="number"||!i)&&(clearTimeout(rb),rb=null),pIe=Array.from(r.touches).map(c=>Dpe({clientX:c.clientX,clientY:c.clientY,currentTarget:r.currentTarget}));var l=()=>{if(sT!=null){var c=t.getState(),u=bpe(c,c.tooltip.settings.shared);if(u==="axis"){var d,f=(d=pIe)===null||d===void 0?void 0:d[0];if(f==null){B0=null,rb=null;return}var h=Mpe(c,f);h?.activeIndex!=null&&t.dispatch(plt({activeIndex:h.activeIndex,activeDataKey:void 0,activeCoordinate:h.activeCoordinate}))}else if(u==="item"){var p,m=sT.touches[0];if(document.elementFromPoint==null||m==null)return;var g=document.elementFromPoint(m.clientX,m.clientY);if(!g||!g.getAttribute)return;var y=g.getAttribute(aSr),x=(p=g.getAttribute(iSr))!==null&&p!==void 0?p:void 0,w=oC(c).find(_=>_.id===x);if(y==null||w==null||x==null)return;var{dataKey:S}=w,k=NPr(c,y,x);t.dispatch($Cr({activeDataKey:S,activeIndex:y,activeCoordinate:k,activeGraphicalItemId:x}))}B0=null,rb=null}};if(!i){l();return}s==="raf"?B0=requestAnimationFrame(l):typeof s=="number"&&rb===null&&(l(),sT=null,rb=setTimeout(()=>{sT?l():(rb=null,B0=null)},s))}}});var Nct={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},Act=Ec({name:"eventSettings",initialState:Nct,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:APr}=Act.actions,IPr=Act.reducer,RPr=ont({brush:gIr,cartesianAxis:iIr,chartData:ITr,errorBars:mRr,eventSettings:IPr,graphicalItems:LAr,layout:qwr,legend:KSr,options:CTr,polarAxis:nAr,polarOptions:jPr,referenceElements:xIr,renderedTicks:LIr,rootProps:kPr,tooltip:zCr,zIndex:pTr}),PPr=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return mwr({reducer:RPr,preloadedState:t,middleware:n=>{var s;return n({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((s="es6")!==null&&s!==void 0?s:"")}).concat([bct.middleware,xct.middleware,E9.middleware,Cct.middleware,Tct.middleware])},enhancers:n=>{var s=n;return typeof n=="function"&&(s=n()),s.concat(Nat({type:"raf"}))},devTools:{serialize:{replacer:OPr},name:"recharts-".concat(r)}})};function MPr(e){var{preloadedState:t,children:r,reduxStoreName:n}=e,s=sd(),a=b.useRef(null);if(s)return r;a.current==null&&(a.current=PPr(t,n));var i=ghe;return b.createElement(gnt,{context:i,store:a.current},r)}function DPr(e){var{layout:t,margin:r}=e,n=Vo(),s=sd();return b.useEffect(()=>{s||(n(Bwr(t)),n(zwr(r)))},[n,s,t,r]),null}var LPr=b.memo(DPr,c9);function $Pr(e){var t=Vo();return b.useEffect(()=>{t(_Pr(e))},[t,e]),null}var FPr=e=>{var t=Vo();return b.useEffect(()=>{t(APr(e))},[t,e]),null},zPr=b.memo(FPr,c9);function mIe(e){var{zIndex:t,isPanorama:r}=e,n=b.useRef(null),s=Vo();return b.useLayoutEffect(()=>(n.current&&s(fTr({zIndex:t,element:n.current,isPanorama:r})),()=>{s(hTr({zIndex:t,isPanorama:r}))}),[s,t,r]),b.createElement("g",{tabIndex:-1,ref:n,className:"recharts-zIndex-layer_".concat(t)})}function gIe(e){var{children:t,isPanorama:r}=e,n=en(rTr);if(!n||n.length===0)return t;var s=n.filter(i=>i<0),a=n.filter(i=>i>0);return b.createElement(b.Fragment,null,s.map(i=>b.createElement(mIe,{key:i,zIndex:i,isPanorama:r})),t,a.map(i=>b.createElement(mIe,{key:i,zIndex:i,isPanorama:r})))}var BPr=["children"];function UPr(e,t){if(e==null)return{};var r,n,s=VPr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function VPr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function E5(){return E5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},E5.apply(null,arguments)}var qPr={width:"100%",height:"100%",display:"block"},HPr=b.forwardRef((e,t)=>{var r=Jat(),n=eit(),s=dit();if(!tg(r)||!tg(n))return null;var{children:a,otherAttributes:i,title:l,desc:c}=e,u,d;return i!=null&&(typeof i.tabIndex=="number"?u=i.tabIndex:u=s?0:void 0,typeof i.role=="string"?d=i.role:d=s?"application":void 0),b.createElement(Dst,E5({},i,{title:l,desc:c,role:d,tabIndex:u,width:r,height:n,style:qPr,ref:t}),a)}),QPr=e=>{var{children:t}=e,r=en(s9);if(!r)return null;var{width:n,height:s,y:a,x:i}=r;return b.createElement(Dst,{width:n,height:s,x:i,y:a},t)},yIe=b.forwardRef((e,t)=>{var{children:r}=e,n=UPr(e,BPr),s=sd();return s?b.createElement(QPr,null,b.createElement(gIe,{isPanorama:!0},r)):b.createElement(HPr,E5({ref:t},n),b.createElement(gIe,{isPanorama:!1},r))});function WPr(){var e=Vo(),[t,r]=b.useState(null),n=en(sSr);return b.useEffect(()=>{if(t!=null){var s=t.getBoundingClientRect(),a=s.width/t.offsetWidth;zs(a)&&a!==n&&e(Vwr(a))}},[t,e,n]),r}function vIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function GPr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?vIe(Object(r),!0).forEach(function(n){ZPr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ZPr(e,t,r){return(t=YPr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function YPr(e){var t=XPr(e,"string");return typeof t=="symbol"?t:t+""}function XPr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Wb(){return Wb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Wb.apply(null,arguments)}var KPr=()=>(BTr(),null);function C5(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var JPr=b.forwardRef((e,t)=>{var r,n,s=b.useRef(null),[a,i]=b.useState({containerWidth:C5((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:C5((n=e.style)===null||n===void 0?void 0:n.height)}),l=b.useCallback((u,d)=>{i(f=>{var h=Math.round(u),p=Math.round(d);return f.containerWidth===h&&f.containerHeight===p?f:{containerWidth:h,containerHeight:p}})},[]),c=b.useCallback(u=>{if(typeof t=="function"&&t(u),u!=null&&typeof ResizeObserver<"u"){var{width:d,height:f}=u.getBoundingClientRect();l(d,f);var h=m=>{var g=m[0];if(g!=null){var{width:y,height:x}=g.contentRect;l(y,x)}},p=new ResizeObserver(h);p.observe(u),s.current=p}},[t,l]);return b.useEffect(()=>()=>{var u=s.current;u?.disconnect()},[l]),b.createElement(b.Fragment,null,b.createElement(vP,{width:a.containerWidth,height:a.containerHeight}),b.createElement("div",Wb({ref:c},e)))}),eMr=b.forwardRef((e,t)=>{var{width:r,height:n}=e,[s,a]=b.useState({containerWidth:C5(r),containerHeight:C5(n)}),i=b.useCallback((c,u)=>{a(d=>{var f=Math.round(c),h=Math.round(u);return d.containerWidth===f&&d.containerHeight===h?d:{containerWidth:f,containerHeight:h}})},[]),l=b.useCallback(c=>{if(typeof t=="function"&&t(c),c!=null){var{width:u,height:d}=c.getBoundingClientRect();i(u,d)}},[t,i]);return b.createElement(b.Fragment,null,b.createElement(vP,{width:s.containerWidth,height:s.containerHeight}),b.createElement("div",Wb({ref:l},e)))}),tMr=b.forwardRef((e,t)=>{var{width:r,height:n}=e;return b.createElement(b.Fragment,null,b.createElement(vP,{width:r,height:n}),b.createElement("div",Wb({ref:t},e)))}),rMr=b.forwardRef((e,t)=>{var{width:r,height:n}=e;return typeof r=="string"||typeof n=="string"?b.createElement(eMr,Wb({},e,{ref:t})):typeof r=="number"&&typeof n=="number"?b.createElement(tMr,Wb({},e,{width:r,height:n,ref:t})):b.createElement(b.Fragment,null,b.createElement(vP,{width:r,height:n}),b.createElement("div",Wb({ref:t},e)))});function nMr(e){return e?JPr:rMr}var sMr=b.forwardRef((e,t)=>{var{children:r,className:n,height:s,onClick:a,onContextMenu:i,onDoubleClick:l,onMouseDown:c,onMouseEnter:u,onMouseLeave:d,onMouseMove:f,onMouseUp:h,onTouchEnd:p,onTouchMove:m,onTouchStart:g,style:y,width:x,responsive:w,dispatchTouchEvents:S=!0}=e,k=b.useRef(null),_=Vo(),[E,T]=b.useState(null),[j,N]=b.useState(null),I=WPr(),P=She(),R=P?.width>0?P.width:x,B=P?.height>0?P.height:s,D=b.useCallback(ie=>{I(ie),typeof t=="function"&&t(ie),T(ie),N(ie),ie!=null&&(k.current=ie)},[I,t,T,N]),$=b.useCallback(ie=>{_(vct(ie)),_(Wf({handler:a,reactEvent:ie}))},[_,a]),U=b.useCallback(ie=>{_(Xae(ie)),_(Wf({handler:u,reactEvent:ie}))},[_,u]),z=b.useCallback(ie=>{_(hlt()),_(Wf({handler:d,reactEvent:ie}))},[_,d]),H=b.useCallback(ie=>{_(Xae(ie)),_(Wf({handler:f,reactEvent:ie}))},[_,f]),Q=b.useCallback(()=>{_(kct())},[_]),L=b.useCallback(()=>{_(_ct())},[_]),Z=b.useCallback(ie=>{_(Oct(ie.key))},[_]),V=b.useCallback(ie=>{_(Wf({handler:i,reactEvent:ie}))},[_,i]),M=b.useCallback(ie=>{_(Wf({handler:l,reactEvent:ie}))},[_,l]),W=b.useCallback(ie=>{_(Wf({handler:c,reactEvent:ie}))},[_,c]),G=b.useCallback(ie=>{_(Wf({handler:h,reactEvent:ie}))},[_,h]),J=b.useCallback(ie=>{_(Wf({handler:g,reactEvent:ie}))},[_,g]),ae=b.useCallback(ie=>{S&&_(jct(ie)),_(Wf({handler:m,reactEvent:ie}))},[_,S,m]),te=b.useCallback(ie=>{_(Wf({handler:p,reactEvent:ie}))},[_,p]),re=nMr(w);return b.createElement(Rlt.Provider,{value:E},b.createElement(hxr.Provider,{value:j},b.createElement(re,{width:R??y?.width,height:B??y?.height,className:xa("recharts-wrapper",n),style:GPr({position:"relative",cursor:"default",width:R,height:B},y),onClick:$,onContextMenu:V,onDoubleClick:M,onFocus:Q,onBlur:L,onKeyDown:Z,onMouseDown:W,onMouseEnter:U,onMouseLeave:z,onMouseMove:H,onMouseUp:G,onTouchEnd:te,onTouchMove:ae,onTouchStart:J,ref:D},b.createElement(KPr,null),r)))}),aMr=["width","height","responsive","children","className","style","compact","title","desc"];function iMr(e,t){if(e==null)return{};var r,n,s=oMr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function oMr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var lMr=b.forwardRef((e,t)=>{var{width:r,height:n,responsive:s,children:a,className:i,style:l,compact:c,title:u,desc:d}=e,f=iMr(e,aMr),h=Jm(f);return c?b.createElement(b.Fragment,null,b.createElement(vP,{width:r,height:n}),b.createElement(yIe,{otherAttributes:h,title:u,desc:d},a)):b.createElement(sMr,{className:i,style:l,width:r,height:n,responsive:s??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},b.createElement(yIe,{otherAttributes:h,title:u,desc:d,ref:t},b.createElement(SIr,null,a)))});function Kae(){return Kae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Kae.apply(null,arguments)}function bIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function cMr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bIe(Object(r),!0).forEach(function(n){uMr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function uMr(e,t,r){return(t=dMr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dMr(e){var t=fMr(e,"string");return typeof t=="symbol"?t:t+""}function fMr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var hMr={top:5,right:5,bottom:5,left:5},pMr=cMr({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:hMr,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},Nct),mMr=b.forwardRef(function(t,r){var n,s=nd(t.categoricalChartProps,pMr),{chartName:a,defaultTooltipEventType:i,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,categoricalChartProps:u}=t,d={chartName:a,defaultTooltipEventType:i,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,eventEmitter:void 0};return b.createElement(MPr,{preloadedState:{options:d},reduxStoreName:(n=u.id)!==null&&n!==void 0?n:a},b.createElement(mIr,{chartData:u.data}),b.createElement(LPr,{layout:s.layout,margin:s.margin}),b.createElement(zPr,{throttleDelay:s.throttleDelay,throttledEvents:s.throttledEvents}),b.createElement($Pr,{baseValue:s.baseValue,accessibilityLayer:s.accessibilityLayer,barCategoryGap:s.barCategoryGap,maxBarSize:s.maxBarSize,stackOffset:s.stackOffset,barGap:s.barGap,barSize:s.barSize,syncId:s.syncId,syncMethod:s.syncMethod,className:s.className,reverseStackOrder:s.reverseStackOrder}),b.createElement(lMr,Kae({},s,{ref:r})))}),gMr=["axis"],yMr=b.forwardRef((e,t)=>b.createElement(mMr,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:gMr,tooltipPayloadSearcher:_Tr,categoricalChartProps:e,ref:t}));function vMr(e,t){const r=getComputedStyle(e),n=parseFloat(r.fontSize);return t*n}function bMr(e,t){const r=getComputedStyle(e.ownerDocument.body),n=parseFloat(r.fontSize);return t*n}function xMr(e){return e/100*window.innerHeight}function wMr(e){return e/100*window.innerWidth}function SMr(e){switch(typeof e){case"number":return[e,"px"];case"string":{const t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}function qT({groupSize:e,panelElement:t,styleProp:r}){let n;const[s,a]=SMr(r);switch(a){case"%":{n=s/100*e;break}case"px":{n=s;break}case"rem":{n=bMr(t,s);break}case"em":{n=vMr(t,s);break}case"vh":{n=xMr(s);break}case"vw":{n=wMr(s);break}}return n}function zu(e){return parseFloat(e.toFixed(3))}function Z_({group:e}){const{orientation:t,panels:r}=e;return r.reduce((n,s)=>(n+=t==="horizontal"?s.element.offsetWidth:s.element.offsetHeight,n),0)}function Jae(e){const{panels:t}=e,r=Z_({group:e});return r===0?t.map(n=>({groupResizeBehavior:n.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:n.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:n.panelConstraints.disabled,minSize:0,maxSize:100,panelId:n.id})):t.map(n=>{const{element:s,panelConstraints:a}=n;let i=0;if(a.collapsedSize!==void 0){const d=qT({groupSize:r,panelElement:s,styleProp:a.collapsedSize});i=zu(d/r*100)}let l;if(a.defaultSize!==void 0){const d=qT({groupSize:r,panelElement:s,styleProp:a.defaultSize});l=zu(d/r*100)}let c=0;if(a.minSize!==void 0){const d=qT({groupSize:r,panelElement:s,styleProp:a.minSize});c=zu(d/r*100)}let u=100;if(a.maxSize!==void 0){const d=qT({groupSize:r,panelElement:s,styleProp:a.maxSize});u=zu(d/r*100)}return{groupResizeBehavior:a.groupResizeBehavior,collapsedSize:i,collapsible:a.collapsible===!0,defaultSize:l,disabled:a.disabled,minSize:c,maxSize:u,panelId:n.id}})}function ja(e,t="Assertion error"){if(!e)throw Error(t)}function eie(e,t){return Array.from(t).sort(e==="horizontal"?OMr:kMr)}function OMr(e,t){const r=e.element.offsetLeft-t.element.offsetLeft;return r!==0?r:e.element.offsetWidth-t.element.offsetWidth}function kMr(e,t){const r=e.element.offsetTop-t.element.offsetTop;return r!==0?r:e.element.offsetHeight-t.element.offsetHeight}function Ict(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Rct(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function _Mr({orientation:e,rects:t,targetRect:r}){const n={x:r.x+r.width/2,y:r.y+r.height/2};let s,a=Number.MAX_VALUE;for(const i of t){const{x:l,y:c}=Rct(n,i),u=e==="horizontal"?l:c;u<a&&(a=u,s=i)}return ja(s,"No rect found"),s}let GD;function EMr(){return GD===void 0&&(typeof matchMedia=="function"?GD=!!matchMedia("(pointer:coarse)").matches:GD=!1),GD}function Pct(e){const{element:t,orientation:r,panels:n,separators:s}=e,a=eie(r,Array.from(t.children).filter(Ict).map(m=>({element:m}))).map(({element:m})=>m),i=[];let l=!1,c=!1,u=-1,d=-1,f=0,h,p=[];{let m=-1;for(const g of a)g.hasAttribute("data-panel")&&(m++,g.ariaDisabled===null&&(f++,u===-1&&(u=m),d=m))}if(f>1){let m=-1;for(const g of a)if(g.hasAttribute("data-panel")){m++;const y=n.find(x=>x.element===g);if(y){if(h){const x=h.element.getBoundingClientRect(),w=g.getBoundingClientRect();let S;if(c){const k=r==="horizontal"?new DOMRect(x.right,x.top,0,x.height):new DOMRect(x.left,x.bottom,x.width,0),_=r==="horizontal"?new DOMRect(w.left,w.top,0,w.height):new DOMRect(w.left,w.top,w.width,0);switch(p.length){case 0:{S=[k,_];break}case 1:{const E=p[0],T=_Mr({orientation:r,rects:[x,w],targetRect:E.element.getBoundingClientRect()});S=[E,T===x?_:k];break}default:{S=p;break}}}else p.length?S=p:S=[r==="horizontal"?new DOMRect(x.right,w.top,w.left-x.right,w.height):new DOMRect(w.left,x.bottom,w.width,w.top-x.bottom)];for(const k of S){let _="width"in k?k:k.element.getBoundingClientRect();const E=EMr()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(_.width<E){const j=E-_.width;_=new DOMRect(_.x-j/2,_.y,_.width+j,_.height)}if(_.height<E){const j=E-_.height;_=new DOMRect(_.x,_.y-j/2,_.width,_.height+j)}const T=m<=u||m>d;!l&&!T&&i.push({group:e,groupSize:Z_({group:e}),panels:[h,y],separator:"width"in k?void 0:k,rect:_}),l=!1}}c=!1,h=y,p=[]}}else if(g.hasAttribute("data-separator")){g.ariaDisabled!==null&&(l=!0);const y=s.find(x=>x.element===g);y?p.push(y):(h=void 0,p=[])}else c=!0}return i}let Mct=class{#e={};addListener(t,r){const n=this.#e[t];return n===void 0?this.#e[t]=[r]:n.includes(r)||n.push(r),()=>{this.removeListener(t,r)}}emit(t,r){const n=this.#e[t];if(n!==void 0)if(n.length===1)n[0].call(null,r);else{let s=!1,a=null;const i=Array.from(n);for(let l=0;l<i.length;l++){const c=i[l];try{c.call(null,r)}catch(u){a===null&&(s=!0,a=u)}}if(s)throw a}}removeAllListeners(){this.#e={}}removeListener(t,r){const n=this.#e[t];if(n!==void 0){const s=n.indexOf(r);s>=0&&n.splice(s,1)}}},Pm=new Map;const Dct=new Mct;function CMr(e){Pm=new Map(Pm),Pm.delete(e)}function xIe(e,t){for(const[r]of Pm)if(r.id===e)return r}function Gb(e,t){for(const[r,n]of Pm)if(r.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function m1(){return Pm}function Lpe(e,t){return Dct.addListener("groupChange",r=>{r.group.id===e&&t(r)})}function Jy(e,t){const r=Pm.get(e);Pm=new Map(Pm),Pm.set(e,t),Dct.emit("groupChange",{group:e,prev:r,next:t})}function jMr(e,t,r){let n,s={x:1/0,y:1/0};for(const a of t){const i=Rct(r,a.rect);switch(e){case"horizontal":{i.x<=s.x&&(n=a,s=i);break}case"vertical":{i.y<=s.y&&(n=a,s=i);break}}}return n?{distance:s,hitRegion:n}:void 0}function TMr(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function NMr(e,t){if(e===t)throw new Error("Cannot compare node with itself");const r={a:OIe(e),b:OIe(t)};let n;for(;r.a.at(-1)===r.b.at(-1);)n=r.a.pop(),r.b.pop();ja(n,"Stacking order can only be calculated for elements with a common ancestor");const s={a:SIe(wIe(r.a)),b:SIe(wIe(r.b))};if(s.a===s.b){const a=n.childNodes,i={a:r.a.at(-1),b:r.b.at(-1)};let l=a.length;for(;l--;){const c=a[l];if(c===i.a)return 1;if(c===i.b)return-1}}return Math.sign(s.a-s.b)}const AMr=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function IMr(e){const t=getComputedStyle(Lct(e)??e).display;return t==="flex"||t==="inline-flex"}function RMr(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||IMr(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||AMr.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function wIe(e){let t=e.length;for(;t--;){const r=e[t];if(ja(r,"Missing node"),RMr(r))return r}return null}function SIe(e){return e&&Number(getComputedStyle(e).zIndex)||0}function OIe(e){const t=[];for(;e;)t.push(e),e=Lct(e);return t}function Lct(e){const{parentNode:t}=e;return TMr(t)?t.host:t}function PMr(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function MMr({groupElement:e,hitRegion:t,pointerEventTarget:r}){if(!Ict(r)||r.contains(e)||e.contains(r))return!0;if(NMr(r,e)>0){let n=r;for(;n;){if(n.contains(e))return!0;if(PMr(n.getBoundingClientRect(),t))return!1;n=n.parentElement}}return!0}function $pe(e,t){const r=[];return t.forEach((n,s)=>{if(s.disabled)return;const a=Pct(s),i=jMr(s.orientation,a,{x:e.clientX,y:e.clientY});i&&i.distance.x<=0&&i.distance.y<=0&&MMr({groupElement:s.element,hitRegion:i.hitRegion.rect,pointerEventTarget:e.target})&&r.push(i.hitRegion)}),r}function DMr(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!=t[r])return!1;return!0}function qc(e,t,r=0){return Math.abs(zu(e)-zu(t))<=r}function um(e,t){return qc(e,t)?0:e>t?1:-1}function hk({overrideDisabledPanels:e,panelConstraints:t,prevSize:r,size:n}){const{collapsedSize:s=0,collapsible:a,disabled:i,maxSize:l=100,minSize:c=0}=t;if(i&&!e)return r;if(um(n,c)<0)if(a){const u=(s+c)/2;um(n,u)<0?n=s:n=c}else n=c;return n=Math.min(l,n),n=zu(n),n}function cI({delta:e,initialLayout:t,panelConstraints:r,pivotIndices:n,prevLayout:s,trigger:a}){if(qc(e,0))return t;const i=a==="imperative-api",l=Object.values(t),c=Object.values(s),u=[...l],[d,f]=n;ja(d!=null,"Invalid first pivot index"),ja(f!=null,"Invalid second pivot index");let h=0;switch(a){case"keyboard":{{const g=e<0?f:d,y=r[g];ja(y,`Panel constraints not found for index ${g}`);const{collapsedSize:x=0,collapsible:w,minSize:S=0}=y;if(w){const k=l[g];if(ja(k!=null,`Previous layout not found for panel index ${g}`),qc(k,x)){const _=S-k;um(_,Math.abs(e))>0&&(e=e<0?0-_:_)}}}{const g=e<0?d:f,y=r[g];ja(y,`No panel constraints found for index ${g}`);const{collapsedSize:x=0,collapsible:w,minSize:S=0}=y;if(w){const k=l[g];if(ja(k!=null,`Previous layout not found for panel index ${g}`),qc(k,S)){const _=k-x;um(_,Math.abs(e))>0&&(e=e<0?0-_:_)}}}break}default:{const g=e<0?f:d,y=r[g];ja(y,`Panel constraints not found for index ${g}`);const x=l[g],{collapsible:w,collapsedSize:S,minSize:k}=y;if(w&&um(x,k)<0)if(e>0){const _=k-S,E=_/2,T=x+e;um(T,k)<0&&(e=um(e,E)<=0?0:_)}else{const _=k-S,E=100-_/2,T=x-e;um(T,k)<0&&(e=um(100+e,E)>0?0:-_)}break}}{const g=e<0?1:-1;let y=e<0?f:d,x=0;for(;;){const S=l[y];ja(S!=null,`Previous layout not found for panel index ${y}`);const k=hk({overrideDisabledPanels:i,panelConstraints:r[y],prevSize:S,size:100})-S;if(x+=k,y+=g,y<0||y>=r.length)break}const w=Math.min(Math.abs(e),Math.abs(x));e=e<0?0-w:w}{let g=e<0?d:f;for(;g>=0&&g<r.length;){const y=Math.abs(e)-Math.abs(h),x=l[g];ja(x!=null,`Previous layout not found for panel index ${g}`);const w=x-y,S=hk({overrideDisabledPanels:i,panelConstraints:r[g],prevSize:x,size:w});if(!qc(x,S)&&(h+=x-S,u[g]=S,h.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?g--:g++}}if(DMr(c,u))return s;{const g=e<0?f:d,y=l[g];ja(y!=null,`Previous layout not found for panel index ${g}`);const x=y+h,w=hk({overrideDisabledPanels:i,panelConstraints:r[g],prevSize:y,size:x});if(u[g]=w,!qc(w,x)){let S=x-w,k=e<0?f:d;for(;k>=0&&k<r.length;){const _=u[k];ja(_!=null,`Previous layout not found for panel index ${k}`);const E=_+S,T=hk({overrideDisabledPanels:i,panelConstraints:r[k],prevSize:_,size:E});if(qc(_,T)||(S-=T-_,u[k]=T),qc(S,0))break;e>0?k--:k++}}}const p=Object.values(u).reduce((g,y)=>y+g,0);if(!qc(p,100,.1))return s;const m=Object.keys(s);return u.reduce((g,y,x)=>(g[m[x]]=y,g),{})}function NS(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(t[r]===void 0||um(e[r],t[r])!==0)return!1;return!0}function AS({layout:e,panelConstraints:t}){const r=Object.values(e),n=[...r],s=n.reduce((l,c)=>l+c,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(l=>`${l}%`).join(", ")}`);if(!qc(s,100)&&n.length>0)for(let l=0;l<t.length;l++){const c=n[l];ja(c!=null,`No layout data found for index ${l}`);const u=100/s*c;n[l]=u}let a=0;for(let l=0;l<t.length;l++){const c=r[l];ja(c!=null,`No layout data found for index ${l}`);const u=n[l];ja(u!=null,`No layout data found for index ${l}`);const d=hk({overrideDisabledPanels:!0,panelConstraints:t[l],prevSize:c,size:u});u!=d&&(a+=u-d,n[l]=d)}if(!qc(a,0))for(let l=0;l<t.length;l++){const c=n[l];ja(c!=null,`No layout data found for index ${l}`);const u=c+a,d=hk({overrideDisabledPanels:!0,panelConstraints:t[l],prevSize:c,size:u});if(c!==d&&(a-=d-c,n[l]=d,qc(a,0)))break}const i=Object.keys(e);return n.reduce((l,c,u)=>(l[i[u]]=c,l),{})}function $ct({groupId:e,panelId:t}){const r=()=>{const l=m1();for(const[c,{defaultLayoutDeferred:u,derivedPanelConstraints:d,layout:f,groupSize:h,separatorToPanels:p}]of l)if(c.id===e)return{defaultLayoutDeferred:u,derivedPanelConstraints:d,group:c,groupSize:h,layout:f,separatorToPanels:p};throw Error(`Group ${e} not found`)},n=()=>{const l=r().derivedPanelConstraints.find(c=>c.panelId===t);if(l!==void 0)return l;throw Error(`Panel constraints not found for Panel ${t}`)},s=()=>{const l=r().group.panels.find(c=>c.id===t);if(l!==void 0)return l;throw Error(`Layout not found for Panel ${t}`)},a=()=>{const l=r().layout[t];if(l!==void 0)return l;throw Error(`Layout not found for Panel ${t}`)},i=l=>{const c=a();if(l===c)return;const{defaultLayoutDeferred:u,derivedPanelConstraints:d,group:f,groupSize:h,layout:p,separatorToPanels:m}=r(),g=f.panels.findIndex(S=>S.id===t),y=g===f.panels.length-1,x=cI({delta:y?c-l:l-c,initialLayout:p,panelConstraints:d,pivotIndices:y?[g-1,g]:[g,g+1],prevLayout:p,trigger:"imperative-api"}),w=AS({layout:x,panelConstraints:d});NS(p,w)||Jy(f,{defaultLayoutDeferred:u,derivedPanelConstraints:d,groupSize:h,layout:w,separatorToPanels:m})};return{collapse:()=>{const{collapsible:l,collapsedSize:c}=n(),{mutableValues:u}=s(),d=a();l&&d!==c&&(u.expandToSize=d,i(c))},expand:()=>{const{collapsible:l,collapsedSize:c,minSize:u}=n(),{mutableValues:d}=s(),f=a();if(l&&f===c){let h=d.expandToSize??u;h===0&&(h=1),i(h)}},getSize:()=>{const{group:l}=r(),c=a(),{element:u}=s(),d=l.orientation==="horizontal"?u.offsetWidth:u.offsetHeight;return{asPercentage:c,inPixels:d}},isCollapsed:()=>{const{collapsible:l,collapsedSize:c}=n(),u=a();return l&&qc(c,u)},resize:l=>{const{group:c}=r(),{element:u}=s(),d=Z_({group:c}),f=qT({groupSize:d,panelElement:u,styleProp:l}),h=zu(f/d*100);i(h)}}}function kIe(e){if(e.defaultPrevented)return;const t=m1();$pe(e,t).forEach(r=>{if(r.separator){const n=r.panels.find(s=>s.panelConstraints.defaultSize!==void 0);if(n){const s=n.panelConstraints.defaultSize,a=$ct({groupId:r.group.id,panelId:n.id});a&&s!==void 0&&(a.resize(s),e.preventDefault())}}})}function C$(e){const t=m1();for(const[r]of t)if(r.separators.some(n=>n.element===e))return r;throw Error("Could not find parent Group for separator element")}function Fct({groupId:e}){const t=()=>{const r=m1();for(const[n,s]of r)if(n.id===e)return{group:n,...s};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:r,layout:n}=t();return r?{}:n},setLayout(r){const{defaultLayoutDeferred:n,derivedPanelConstraints:s,group:a,groupSize:i,layout:l,separatorToPanels:c}=t(),u=AS({layout:r,panelConstraints:s});return n?l:(NS(l,u)||Jy(a,{defaultLayoutDeferred:n,derivedPanelConstraints:s,groupSize:i,layout:u,separatorToPanels:c}),u)}}}function U0(e,t){const r=C$(e),n=Gb(r.id,!0),s=r.separators.find(d=>d.element===e);ja(s,"Matching separator not found");const a=n.separatorToPanels.get(s);ja(a,"Matching panels not found");const i=a.map(d=>r.panels.indexOf(d)),l=Fct({groupId:r.id}).getLayout(),c=cI({delta:t,initialLayout:l,panelConstraints:n.derivedPanelConstraints,pivotIndices:i,prevLayout:l,trigger:"keyboard"}),u=AS({layout:c,panelConstraints:n.derivedPanelConstraints});NS(l,u)||Jy(r,{defaultLayoutDeferred:n.defaultLayoutDeferred,derivedPanelConstraints:n.derivedPanelConstraints,groupSize:n.groupSize,layout:u,separatorToPanels:n.separatorToPanels})}function _Ie(e){if(e.defaultPrevented)return;const t=e.currentTarget,r=C$(t);if(!r.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),r.orientation==="vertical"&&U0(t,5);break}case"ArrowLeft":{e.preventDefault(),r.orientation==="horizontal"&&U0(t,-5);break}case"ArrowRight":{e.preventDefault(),r.orientation==="horizontal"&&U0(t,5);break}case"ArrowUp":{e.preventDefault(),r.orientation==="vertical"&&U0(t,-5);break}case"End":{e.preventDefault(),U0(t,100);break}case"Enter":{e.preventDefault();const n=C$(t),s=Gb(n.id,!0),{derivedPanelConstraints:a,layout:i,separatorToPanels:l}=s,c=n.separators.find(h=>h.element===t);ja(c,"Matching separator not found");const u=l.get(c);ja(u,"Matching panels not found");const d=u[0],f=a.find(h=>h.panelId===d.id);if(ja(f,"Panel metadata not found"),f.collapsible){const h=i[d.id],p=f.collapsedSize===h?n.mutableState.expandedPanelSizes[d.id]??f.minSize:f.collapsedSize;U0(t,p-h)}break}case"F6":{e.preventDefault();const n=C$(t).separators.map(i=>i.element),s=Array.from(n).findIndex(i=>i===e.currentTarget);ja(s!==null,"Index not found");const a=e.shiftKey?s>0?s-1:n.length-1:s+1<n.length?s+1:0;n[a].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),U0(t,-100);break}}}let Xk={cursorFlags:0,state:"inactive"};const Fpe=new Mct;function IS(){return Xk}function LMr(e){return Fpe.addListener("change",e)}function $Mr(e){const t=Xk,r={...Xk};r.cursorFlags=e,Xk=r,Fpe.emit("change",{prev:t,next:r})}function Kk(e){const t=Xk;Xk=e,Fpe.emit("change",{prev:t,next:e})}function EIe(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=m1(),r=$pe(e,t),n=new Map;let s=!1;r.forEach(a=>{a.separator&&(s||(s=!0,a.separator.element.focus({preventScroll:!0})));const i=t.get(a.group);i&&n.set(a.group,i.layout)}),Kk({cursorFlags:0,hitRegions:r,initialLayoutMap:n,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),r.length&&e.preventDefault()}const FMr=e=>e,tQ=()=>{},zct=1,Bct=2,Uct=4,Vct=8,CIe=3,jIe=12;let ZD;function TIe(){return ZD===void 0&&(ZD=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(ZD=!0)),ZD}function zMr({cursorFlags:e,groups:t,state:r}){let n=0,s=0;switch(r){case"active":case"hover":t.forEach(a=>{if(!a.mutableState.disableCursor)switch(a.orientation){case"horizontal":{n++;break}case"vertical":{s++;break}}})}if(!(n===0&&s===0)){switch(r){case"active":{if(e&&TIe()){const a=(e&zct)!==0,i=(e&Bct)!==0,l=(e&Uct)!==0,c=(e&Vct)!==0;if(a)return l?"se-resize":c?"ne-resize":"e-resize";if(i)return l?"sw-resize":c?"nw-resize":"w-resize";if(l)return"s-resize";if(c)return"n-resize"}break}}return TIe()?n>0&&s>0?"move":n>0?"ew-resize":"ns-resize":n>0&&s>0?"grab":n>0?"col-resize":"row-resize"}}const NIe=new WeakMap;function zpe(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:r}=NIe.get(e)??{};r===void 0&&(r=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(r));const n=IS();switch(n.state){case"active":case"hover":{const s=zMr({cursorFlags:n.cursorFlags,groups:n.hitRegions.map(i=>i.group),state:n.state}),a=`*, *:hover {cursor: ${s} !important; }`;if(t===a)return;t=a,s?r.cssRules.length===0?r.insertRule(a):r.replaceSync(a):r.cssRules.length===1&&r.deleteRule(0);break}case"inactive":{t=void 0,r.cssRules.length===1&&r.deleteRule(0);break}}NIe.set(e,{prevStyle:t,styleSheet:r})}function qct({document:e,event:t,hitRegions:r,initialLayoutMap:n,mountedGroups:s,pointerDownAtPoint:a,prevCursorFlags:i}){let l=0;r.forEach(u=>{const{group:d,groupSize:f}=u,{orientation:h,panels:p}=d,{disableCursor:m}=d.mutableState;let g=0;a?h==="horizontal"?g=(t.clientX-a.x)/f*100:g=(t.clientY-a.y)/f*100:h==="horizontal"?g=t.clientX<0?-100:100:g=t.clientY<0?-100:100;const y=n.get(d),x=s.get(d);if(!y||!x)return;const{defaultLayoutDeferred:w,derivedPanelConstraints:S,groupSize:k,layout:_,separatorToPanels:E}=x;if(S&&_&&E){const T=cI({delta:g,initialLayout:y,panelConstraints:S,pivotIndices:u.panels.map(j=>p.indexOf(j)),prevLayout:_,trigger:"mouse-or-touch"});if(NS(T,_)){if(g!==0&&!m)switch(h){case"horizontal":{l|=g<0?zct:Bct;break}case"vertical":{l|=g<0?Uct:Vct;break}}}else Jy(u.group,{defaultLayoutDeferred:w,derivedPanelConstraints:S,groupSize:k,layout:T,separatorToPanels:E})}});let c=0;t.movementX===0?c|=i&CIe:c|=l&CIe,t.movementY===0?c|=i&jIe:c|=l&jIe,$Mr(c),zpe(e)}function AIe(e){const t=m1(),r=IS();r.state==="active"&&qct({document:e.currentTarget,event:e,hitRegions:r.hitRegions,initialLayoutMap:r.initialLayoutMap,mountedGroups:t,prevCursorFlags:r.cursorFlags})}function IIe(e){if(e.defaultPrevented)return;const t=IS(),r=m1();switch(t.state){case"active":{if(e.buttons===0){Kk({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(n=>{const s=Gb(n.group.id,!0);Jy(n.group,s)});return}qct({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:r,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const n=$pe(e,r);n.length===0?t.state!=="inactive"&&Kk({cursorFlags:0,state:"inactive"}):Kk({cursorFlags:0,hitRegions:n,state:"hover"}),zpe(e.currentTarget);break}}}function RIe(e){e.relatedTarget instanceof HTMLIFrameElement&&IS().state==="hover"&&Kk({cursorFlags:0,state:"inactive"})}function PIe(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=IS();t.state==="active"&&(Kk({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(zpe(e.currentTarget),t.hitRegions.forEach(r=>{const n=Gb(r.group.id,!0);Jy(r.group,n)}),e.preventDefault()))}function MIe(e){let t=0,r=0;const n={};for(const a of e)if(a.defaultSize!==void 0){t++;const i=zu(a.defaultSize);r+=i,n[a.panelId]=i}else n[a.panelId]=void 0;const s=e.length-t;if(s!==0){const a=zu((100-r)/s);for(const i of e)i.defaultSize===void 0&&(n[i.panelId]=a)}return n}function BMr(e,t,r){if(!r[0])return;const n=e.panels.find(c=>c.element===t);if(!n||!n.onResize)return;const s=Z_({group:e}),a=e.orientation==="horizontal"?n.element.offsetWidth:n.element.offsetHeight,i=n.mutableValues.prevSize,l={asPercentage:zu(a/s*100),inPixels:a};n.mutableValues.prevSize=l,n.onResize(l,n.id,i)}function UMr(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function VMr({group:e,nextGroupSize:t,prevGroupSize:r,prevLayout:n}){if(r<=0||t<=0||r===t)return n;let s=0,a=0,i=!1;const l=new Map,c=[];for(const f of e.panels){const h=n[f.id]??0;if(f.panelConstraints.groupResizeBehavior==="preserve-pixel-size"){i=!0;const p=h/100*r,m=zu(p/t*100);l.set(f.id,m),s+=m}else c.push(f.id),a+=h}if(!i||c.length===0)return n;const u=100-s,d={...n};if(l.forEach((f,h)=>{d[h]=f}),a>0)for(const f of c){const h=n[f]??0;d[f]=zu(h/a*u)}else{const f=zu(u/c.length);for(const h of c)d[h]=f}return d}function qMr(e,t){const r=e.map(s=>s.id),n=Object.keys(t);if(r.length!==n.length)return!1;for(const s of r)if(!n.includes(s))return!1;return!0}const OO=new Map;function HMr(e){let t=!0;ja(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const r=e.element.ownerDocument.defaultView.ResizeObserver,n=new Set,s=new Set,a=new r(m=>{for(const g of m){const{borderBoxSize:y,target:x}=g;if(x===e.element){if(t){const w=Z_({group:e});if(w===0)return;const S=Gb(e.id);if(!S)return;const k=Jae(e),_=S.defaultLayoutDeferred?MIe(k):S.layout,E=VMr({group:e,nextGroupSize:w,prevGroupSize:S.groupSize,prevLayout:_}),T=AS({layout:E,panelConstraints:k});if(!S.defaultLayoutDeferred&&NS(S.layout,T)&&UMr(S.derivedPanelConstraints,k)&&S.groupSize===w)return;Jy(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:k,groupSize:w,layout:T,separatorToPanels:S.separatorToPanels})}}else BMr(e,x,y)}});a.observe(e.element),e.panels.forEach(m=>{ja(!n.has(m.id),`Panel ids must be unique; id "${m.id}" was used more than once`),n.add(m.id),m.onResize&&a.observe(m.element)});const i=Z_({group:e}),l=Jae(e),c=e.panels.map(({id:m})=>m).join(",");let u=e.mutableState.defaultLayout;u&&(qMr(e.panels,u)||(u=void 0));const d=e.mutableState.layouts[c]??u??MIe(l),f=AS({layout:d,panelConstraints:l}),h=e.element.ownerDocument;OO.set(h,(OO.get(h)??0)+1);const p=new Map;return Pct(e).forEach(m=>{m.separator&&p.set(m.separator,m.panels)}),Jy(e,{defaultLayoutDeferred:i===0,derivedPanelConstraints:l,groupSize:i,layout:f,separatorToPanels:p}),e.separators.forEach(m=>{ja(!s.has(m.id),`Separator ids must be unique; id "${m.id}" was used more than once`),s.add(m.id),m.element.addEventListener("keydown",_Ie)}),OO.get(h)===1&&(h.addEventListener("dblclick",kIe,!0),h.addEventListener("pointerdown",EIe,!0),h.addEventListener("pointerleave",AIe),h.addEventListener("pointermove",IIe),h.addEventListener("pointerout",RIe),h.addEventListener("pointerup",PIe,!0)),function(){t=!1,OO.set(h,Math.max(0,(OO.get(h)??0)-1)),CMr(e),e.separators.forEach(m=>{m.element.removeEventListener("keydown",_Ie)}),OO.get(h)||(h.removeEventListener("dblclick",kIe,!0),h.removeEventListener("pointerdown",EIe,!0),h.removeEventListener("pointerleave",AIe),h.removeEventListener("pointermove",IIe),h.removeEventListener("pointerout",RIe),h.removeEventListener("pointerup",PIe,!0)),a.disconnect()}}function QMr(){const[e,t]=b.useState({}),r=b.useCallback(()=>t({}),[]);return[e,r]}function Bpe(e){const t=b.useId();return`${e??t}`}const g1=typeof window<"u"?b.useLayoutEffect:b.useEffect;function jN(e){const t=b.useRef(e);return g1(()=>{t.current=e},[e]),b.useCallback((...r)=>t.current?.(...r),[t])}function Upe(...e){return jN(t=>{e.forEach(r=>{if(r)switch(typeof r){case"function":{r(t);break}case"object":{r.current=t;break}}})})}function Vpe(e){const t=b.useRef({...e});return g1(()=>{for(const r in e)t.current[r]=e[r]},[e]),t.current}const Hct=b.createContext(null);function WMr(e,t){const r=b.useRef({getLayout:()=>({}),setLayout:FMr});b.useImperativeHandle(t,()=>r.current,[]),g1(()=>{Object.assign(r.current,Fct({groupId:e}))})}function C9({children:e,className:t,defaultLayout:r,disableCursor:n,disabled:s,elementRef:a,groupRef:i,id:l,onLayoutChange:c,onLayoutChanged:u,orientation:d="horizontal",resizeTargetMinimumSize:f={coarse:20,fine:10},style:h,...p}){const m=b.useRef({onLayoutChange:{},onLayoutChanged:{}}),g=jN(P=>{NS(m.current.onLayoutChange,P)||(m.current.onLayoutChange=P,c?.(P))}),y=jN(P=>{NS(m.current.onLayoutChanged,P)||(m.current.onLayoutChanged=P,u?.(P))}),x=Bpe(l),w=b.useRef(null),[S,k]=QMr(),_=b.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:f,separators:[]}),E=Upe(w,a);WMr(x,i);const T=jN((P,R)=>{const B=IS(),D=xIe(P),$=Gb(P);if($){let U=!1;return B.state==="active"&&(U=B.hitRegions.some(z=>z.group===D)),{flexGrow:$.layout[R]??1,pointerEvents:U?"none":void 0}}return{flexGrow:r?.[R]??1}}),j=Vpe({defaultLayout:r,disableCursor:n}),N=b.useMemo(()=>({get disableCursor(){return!!j.disableCursor},getPanelStyles:T,id:x,orientation:d,registerPanel:P=>{const R=_.current;return R.panels=eie(d,[...R.panels,P]),k(),()=>{R.panels=R.panels.filter(B=>B!==P),k()}},registerSeparator:P=>{const R=_.current;return R.separators=eie(d,[...R.separators,P]),k(),()=>{R.separators=R.separators.filter(B=>B!==P),k()}},togglePanelDisabled:(P,R)=>{const B=_.current.panels.find(U=>U.id===P);B&&(B.panelConstraints.disabled=R);const D=xIe(x),$=Gb(x);D&&$&&Jy(D,{...$,derivedPanelConstraints:Jae(D)})},toggleSeparatorDisabled:(P,R)=>{const B=_.current.separators.find(D=>D.id===P);B&&(B.disabled=R)}}),[T,x,k,d,j]),I=b.useRef(null);return g1(()=>{const P=w.current;if(P===null)return;const R=_.current;let B;if(j.defaultLayout!==void 0&&Object.keys(j.defaultLayout).length===R.panels.length){B={};for(const L of R.panels){const Z=j.defaultLayout[L.id];Z!==void 0&&(B[L.id]=Z)}}const D={disabled:!!s,element:P,id:x,mutableState:{defaultLayout:B,disableCursor:!!j.disableCursor,expandedPanelSizes:_.current.lastExpandedPanelSizes,layouts:_.current.layouts},orientation:d,panels:R.panels,resizeTargetMinimumSize:R.resizeTargetMinimumSize,separators:R.separators};I.current=D;const $=HMr(D),{defaultLayoutDeferred:U,derivedPanelConstraints:z,layout:H}=Gb(D.id,!0);!U&&z.length>0&&(g(H),y(H));const Q=Lpe(x,L=>{const{defaultLayoutDeferred:Z,derivedPanelConstraints:V,layout:M}=L.next;if(Z||V.length===0)return;const W=D.panels.map(({id:J})=>J).join(",");D.mutableState.layouts[W]=M,V.forEach(J=>{if(J.collapsible){const{layout:ae}=L.prev??{};if(ae){const te=qc(J.collapsedSize,M[J.panelId]),re=qc(J.collapsedSize,ae[J.panelId]);te&&!re&&(D.mutableState.expandedPanelSizes[J.panelId]=ae[J.panelId])}}});const G=IS().state!=="active";g(M),G&&y(M)});return()=>{I.current=null,$(),Q()}},[s,x,y,g,d,S,j]),b.useEffect(()=>{const P=I.current;P&&(P.mutableState.defaultLayout=r,P.mutableState.disableCursor=!!n)}),o.jsx(Hct.Provider,{value:N,children:o.jsx("div",{...p,className:t,"data-group":!0,"data-testid":x,id:x,ref:E,style:{height:"100%",width:"100%",overflow:"hidden",...h,display:"flex",flexDirection:d==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:d==="horizontal"?"pan-y":"pan-x"},children:e})})}C9.displayName="Group";function rQ(e,t){return`react-resizable-panels:${[e,...t].join(":")}`}function qpe({debounceSaveMs:e=100,panelIds:t,storage:r=localStorage,...n}){const s=t!==void 0,a="id"in n?n.id:n.groupId,i=rQ(a,t??[]),l=b.useSyncExternalStore(GMr,()=>r.getItem(i),()=>r.getItem(i)),c=b.useMemo(()=>l?JSON.parse(l):void 0,[l]),u=b.useRef(null),d=b.useCallback(()=>{const p=u.current;p&&(u.current=null,clearTimeout(p))},[]);b.useLayoutEffect(()=>()=>{d()},[d]);const f=b.useCallback(p=>{d();let m;s?m=rQ(a,Object.keys(p)):m=rQ(a,[]);try{r.setItem(m,JSON.stringify(p))}catch(g){console.error(g)}},[d,s,a,r]),h=b.useCallback(p=>{d(),e===0?f(p):u.current=setTimeout(()=>{f(p)},e)},[d,e,f]);return{defaultLayout:c,onLayoutChange:h,onLayoutChanged:f}}function GMr(){return function(){}}function Hpe(){const e=b.useContext(Hct);return ja(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function ZMr(e,t){const{id:r}=Hpe(),n=b.useRef({collapse:tQ,expand:tQ,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:tQ});b.useImperativeHandle(t,()=>n.current,[]),g1(()=>{Object.assign(n.current,$ct({groupId:r,panelId:e}))})}function Y_({children:e,className:t,collapsedSize:r="0%",collapsible:n=!1,defaultSize:s,disabled:a,elementRef:i,groupResizeBehavior:l="preserve-relative-size",id:c,maxSize:u="100%",minSize:d="0%",onResize:f,panelRef:h,style:p,...m}){const g=!!c,y=Bpe(c),x=Vpe({disabled:a}),w=b.useRef(null),S=Upe(w,i),{getPanelStyles:k,id:_,orientation:E,registerPanel:T,togglePanelDisabled:j}=Hpe(),N=f!==null,I=jN((R,B,D)=>{f?.(R,c,D)});g1(()=>{const R=w.current;if(R!==null){const B={element:R,id:y,idIsStable:g,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:N?I:void 0,panelConstraints:{groupResizeBehavior:l,collapsedSize:r,collapsible:n,defaultSize:s,disabled:x.disabled,maxSize:u,minSize:d}};return T(B)}},[l,r,n,s,N,y,g,u,d,I,T,x]),b.useEffect(()=>{j(y,!!a)},[a,y,j]),ZMr(y,h);const P=b.useSyncExternalStore(R=>Lpe(_,R),()=>JSON.stringify(k(_,y)),()=>JSON.stringify(k(_,y)));return o.jsx("div",{...m,"aria-disabled":a||void 0,"data-panel":!0,"data-testid":y,id:y,ref:S,style:{...YMr,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...JSON.parse(P)},children:o.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...p,touchAction:E==="horizontal"?"pan-y":"pan-x"},children:e})})}Y_.displayName="Panel";const YMr={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function XMr(){return b.useRef(null)}function KMr({layout:e,panelConstraints:t,panelId:r,panelIndex:n}){let s,a;const i=e[r],l=t.find(c=>c.panelId===r);if(l){const c=l.maxSize,u=l.collapsible?l.collapsedSize:l.minSize,d=[n,n+1];a=AS({layout:cI({delta:u-i,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[r],s=AS({layout:cI({delta:c-i,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[r]}return{valueControls:r,valueMax:s,valueMin:a,valueNow:i}}function Qct({children:e,className:t,disabled:r,elementRef:n,id:s,style:a,...i}){const l=Bpe(s),c=Vpe({disabled:r}),[u,d]=b.useState({}),[f,h]=b.useState("inactive"),p=b.useRef(null),m=Upe(p,n),{disableCursor:g,id:y,orientation:x,registerSeparator:w,toggleSeparatorDisabled:S}=Hpe(),k=x==="horizontal"?"vertical":"horizontal";g1(()=>{const E=p.current;if(E!==null){const T={disabled:c.disabled,element:E,id:l},j=w(T),N=LMr(P=>{h(P.next.state!=="inactive"&&P.next.hitRegions.some(R=>R.separator===T)?P.next.state:"inactive")}),I=Lpe(y,P=>{const{derivedPanelConstraints:R,layout:B,separatorToPanels:D}=P.next,$=D.get(T);if($){const U=$[0],z=$.indexOf(U);d(KMr({layout:B,panelConstraints:R,panelId:U.id,panelIndex:z}))}});return()=>{N(),I(),j()}}},[y,l,w,c]),b.useEffect(()=>{S(l,!!r)},[r,l,S]);let _;return r&&!g&&(_="not-allowed"),o.jsx("div",{...i,"aria-controls":u.valueControls,"aria-disabled":r||void 0,"aria-orientation":k,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":r?"disabled":f,"data-testid":l,id:l,ref:m,role:"separator",style:{flexBasis:"auto",cursor:_,...a,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:r?void 0:0})}Qct.displayName="Separator";const DIe=e=>{let t;const r=new Set,n=(u,d)=>{const f=typeof u=="function"?u(t):u;if(!Object.is(f,t)){const h=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),r.forEach(p=>p(t,h))}},s=()=>t,l={setState:n,getState:s,getInitialState:()=>c,subscribe:u=>(r.add(u),()=>r.delete(u))},c=t=e(n,s,l);return l},JMr=(e=>e?DIe(e):DIe),e2r=e=>e;function t2r(e,t=e2r){const r=je.useSyncExternalStore(e.subscribe,je.useCallback(()=>t(e.getState()),[e,t]),je.useCallback(()=>t(e.getInitialState()),[e,t]));return je.useDebugValue(r),r}const LIe=e=>{const t=JMr(e),r=n=>t2r(t,n);return Object.assign(r,t),r},Qpe=(e=>e?LIe(e):LIe);function r2r(e,t){let r;try{r=e()}catch{return}return{getItem:s=>{var a;const i=c=>c===null?null:JSON.parse(c,void 0),l=(a=r.getItem(s))!=null?a:null;return l instanceof Promise?l.then(i):i(l)},setItem:(s,a)=>r.setItem(s,JSON.stringify(a,void 0)),removeItem:s=>r.removeItem(s)}}const tie=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(n){return tie(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return tie(n)(r)}}}},n2r=(e,t)=>(r,n,s)=>{let a={storage:r2r(()=>window.localStorage),partialize:y=>y,version:0,merge:(y,x)=>({...x,...y}),...t},i=!1,l=0;const c=new Set,u=new Set;let d=a.storage;if(!d)return e((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),r(...y)},n,s);const f=()=>{const y=a.partialize({...n()});return d.setItem(a.name,{state:y,version:a.version})},h=s.setState;s.setState=(y,x)=>(h(y,x),f());const p=e((...y)=>(r(...y),f()),n,s);s.getInitialState=()=>p;let m;const g=()=>{var y,x;if(!d)return;const w=++l;i=!1,c.forEach(k=>{var _;return k((_=n())!=null?_:p)});const S=((x=a.onRehydrateStorage)==null?void 0:x.call(a,(y=n())!=null?y:p))||void 0;return tie(d.getItem.bind(d))(a.name).then(k=>{if(k)if(typeof k.version=="number"&&k.version!==a.version){if(a.migrate){const _=a.migrate(k.state,k.version);return _ instanceof Promise?_.then(E=>[!0,E]):[!0,_]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,k.state];return[!1,void 0]}).then(k=>{var _;if(w!==l)return;const[E,T]=k;if(m=a.merge(T,(_=n())!=null?_:p),r(m,!0),E)return f()}).then(()=>{w===l&&(S?.(n(),void 0),m=n(),i=!0,u.forEach(k=>k(m)))}).catch(k=>{w===l&&S?.(void 0,k)})};return s.persist={setOptions:y=>{a={...a,...y},y.storage&&(d=y.storage)},clearStorage:()=>{d?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>g(),hasHydrated:()=>i,onHydrate:y=>(c.add(y),()=>{c.delete(y)}),onFinishHydration:y=>(u.add(y),()=>{u.delete(y)})},a.skipHydration||g(),m||p},s2r=n2r;var y1=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(){}},a2r={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},i2r=class{#e=a2r;#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)}},Cw=new i2r;function o2r(e){setTimeout(e,0)}var RS=typeof window>"u"||"Deno"in globalThis;function ic(){}function l2r(e,t){return typeof e=="function"?e(t):e}function rie(e){return typeof e=="number"&&e>=0&&e!==1/0}function Wct(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Zb(e,t){return typeof e=="function"?e(t):e}function Yf(e,t){return typeof e=="function"?e(t):e}function $Ie(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:a,queryKey:i,stale:l}=e;if(i){if(n){if(t.queryHash!==Wpe(i,t.options))return!1}else if(!uI(t.queryKey,i))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||a&&!a(t))}function FIe(e,t){const{exact:r,status:n,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(PS(t.options.mutationKey)!==PS(a))return!1}else if(!uI(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function Wpe(e,t){return(t?.queryKeyHashFn||PS)(e)}function PS(e){return JSON.stringify(e,(t,r)=>nie(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function uI(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>uI(e[r],t[r])):!1}var c2r=Object.prototype.hasOwnProperty;function Gpe(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=zIe(e)&&zIe(t);if(!n&&!(nie(e)&&nie(t)))return t;const a=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),l=i.length,c=n?new Array(l):{};let u=0;for(let d=0;d<l;d++){const f=n?d:i[d],h=e[f],p=t[f];if(h===p){c[f]=h,(n?d<a:c2r.call(e,f))&&u++;continue}if(h===null||p===null||typeof h!="object"||typeof p!="object"){c[f]=p;continue}const m=Gpe(h,p,r+1);c[f]=m,m===h&&u++}return a===l&&u===a?e:c}function dI(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function zIe(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function nie(e){if(!BIe(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!BIe(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function BIe(e){return Object.prototype.toString.call(e)==="[object Object]"}function u2r(e){return new Promise(t=>{Cw.setTimeout(t,e)})}function sie(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?Gpe(e,t):t}function d2r(e){return e}function f2r(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function h2r(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Zpe=Symbol();function Gct(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Zpe?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ype(e,t){return typeof e=="function"?e(...t):!!e}function p2r(e,t,r){let n=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=t(),n||(n=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)}),e}var m2r=class extends y1{#e;#t;#r;constructor(){super(),this.#r=e=>{if(!RS&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=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"}},Xpe=new m2r;function aie(){let e,t;const r=new Promise((s,a)=>{e=s,t=a});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}var g2r=o2r;function y2r(){let e=[],t=0,r=l=>{l()},n=l=>{l()},s=g2r;const a=l=>{t?e.push(l):s(()=>{r(l)})},i=()=>{const l=e;e=[],l.length&&s(()=>{n(()=>{l.forEach(c=>{r(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||i()}return c},batchCalls:l=>(...c)=>{a(()=>{l(...c)})},schedule:a,setNotifyFunction:l=>{r=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{s=l}}}var Zi=y2r(),v2r=class extends y1{#e=!0;#t;#r;constructor(){super(),this.#r=e=>{if(!RS&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#e}},j5=new v2r;function b2r(e){return Math.min(1e3*2**e,3e4)}function Zct(e){return(e??"online")==="online"?j5.isOnline():!0}var iie=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Yct(e){let t=!1,r=0,n;const s=aie(),a=()=>s.status!=="pending",i=g=>{if(!a()){const y=new iie(g);h(y),e.onCancel?.(y)}},l=()=>{t=!0},c=()=>{t=!1},u=()=>Xpe.isFocused()&&(e.networkMode==="always"||j5.isOnline())&&e.canRun(),d=()=>Zct(e.networkMode)&&e.canRun(),f=g=>{a()||(n?.(),s.resolve(g))},h=g=>{a()||(n?.(),s.reject(g))},p=()=>new Promise(g=>{n=y=>{(a()||u())&&g(y)},e.onPause?.()}).then(()=>{n=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let g;const y=r===0?e.initialPromise:void 0;try{g=y??e.fn()}catch(x){g=Promise.reject(x)}Promise.resolve(g).then(f).catch(x=>{if(a())return;const w=e.retry??(RS?0:3),S=e.retryDelay??b2r,k=typeof S=="function"?S(r,x):S,_=w===!0||typeof w=="number"&&r<w||typeof w=="function"&&w(r,x);if(t||!_){h(x);return}r++,e.onFail?.(r,x),u2r(k).then(()=>u()?void 0:p()).then(()=>{t?h(x):m()})})};return{promise:s,status:()=>s.status,cancel:i,continue:()=>(n?.(),s),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?m():p().then(m),s)}}var Xct=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),rie(this.gcTime)&&(this.#e=Cw.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(RS?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Cw.clearTimeout(this.#e),this.#e=void 0)}},x2r=class extends Xct{#e;#t;#r;#s;#n;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#r=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=VIe(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=VIe(this.options);t.data!==void 0&&(this.setState(UIe(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const r=sie(this.state.data,e,this.options);return this.#i({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#i({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#n?.promise;return this.#n?.cancel(e),t?t.then(ic).catch(ic):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Yf(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Zpe||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Zb(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:!Wct(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.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.#n&&(this.#o?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#n?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(e&&this.setOptions(e),!this.options.queryFn){const l=this.observers.find(c=>c.options.queryFn);l&&this.setOptions(l.options)}const r=new AbortController,n=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(this.#o=!0,r.signal)})},s=()=>{const l=Gct(this.options,t),u=(()=>{const d={client:this.#s,queryKey:this.queryKey,meta:this.meta};return n(d),d})();return this.#o=!1,this.options.persister?this.options.persister(l,u,this):l(u)},i=(()=>{const l={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:s};return n(l),l})();this.options.behavior?.onFetch(i,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#i({type:"fetch",meta:i.fetchOptions?.meta}),this.#n=Yct({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:l=>{l instanceof iie&&l.revert&&this.setState({...this.#t,fetchStatus:"idle"}),r.abort()},onFail:(l,c)=>{this.#i({type:"failed",failureCount:l,error:c})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0});try{const l=await this.#n.start();if(l===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(l),this.#r.config.onSuccess?.(l,this),this.#r.config.onSettled?.(l,this.state.error,this),l}catch(l){if(l instanceof iie){if(l.silent)return this.#n.promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw this.#i({type:"error",error:l}),this.#r.config.onError?.(l,this),this.#r.config.onSettled?.(this.state.data,l,this),l}finally{this.scheduleGc()}}#i(e){const t=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Kct(r.data,this.options),fetchMeta:e.meta??null};case"success":const n={...r,...UIe(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case"error":const s=e.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=t(this.state),Zi.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function Kct(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Zct(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function UIe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function VIe(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var j9=class extends y1{constructor(e,t){super(),this.options=t,this.#e=e,this.#i=null,this.#o=aie(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#r=void 0;#s=void 0;#n;#a;#o;#i;#p;#d;#f;#c;#u;#l;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),qIe(this.#t,this.options)?this.#m():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return oie(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return oie(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Yf(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#t.setOptions(this.options),t._defaulted&&!dI(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const n=this.hasListeners();n&&HIe(this.#t,r,this.options,t)&&this.#m(),this.updateResult(),n&&(this.#t!==r||Yf(this.options.enabled,this.#t)!==Yf(t.enabled,this.#t)||Zb(this.options.staleTime,this.#t)!==Zb(t.staleTime,this.#t))&&this.#g();const s=this.#y();n&&(this.#t!==r||Yf(this.options.enabled,this.#t)!==Yf(t.enabled,this.#t)||s!==this.#l)&&this.#v(s)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(t,e);return S2r(this,r)&&(this.#s=r,this.#a=this.options,this.#n=this.#t.state),r}getCurrentResult(){return this.#s}trackResult(e,t){return new Proxy(e,{get:(r,n)=>(this.trackProp(n),t?.(n),n==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,n))})}trackProp(e){this.#h.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(ic)),t}#g(){this.#x();const e=Zb(this.options.staleTime,this.#t);if(RS||this.#s.isStale||!rie(e))return;const r=Wct(this.#s.dataUpdatedAt,e)+1;this.#c=Cw.setTimeout(()=>{this.#s.isStale||this.updateResult()},r)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#w(),this.#l=e,!(RS||Yf(this.options.enabled,this.#t)===!1||!rie(this.#l)||this.#l===0)&&(this.#u=Cw.setInterval(()=>{(this.options.refetchIntervalInBackground||Xpe.isFocused())&&this.#m()},this.#l))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#c&&(Cw.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(Cw.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const r=this.#t,n=this.options,s=this.#s,a=this.#n,i=this.#a,c=e!==r?e.state:this.#r,{state:u}=e;let d={...u},f=!1,h;if(t._optimisticResults){const j=this.hasListeners(),N=!j&&qIe(e,t),I=j&&HIe(e,r,t,n);(N||I)&&(d={...d,...Kct(u.data,e.options)}),t._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:p,errorUpdatedAt:m,status:g}=d;h=d.data;let y=!1;if(t.placeholderData!==void 0&&h===void 0&&g==="pending"){let j;s?.isPlaceholderData&&t.placeholderData===i?.placeholderData?(j=s.data,y=!0):j=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,j!==void 0&&(g="success",h=sie(s?.data,j,t),f=!0)}if(t.select&&h!==void 0&&!y)if(s&&h===a?.data&&t.select===this.#p)h=this.#d;else try{this.#p=t.select,h=t.select(h),h=sie(s?.data,h,t),this.#d=h,this.#i=null}catch(j){this.#i=j}this.#i&&(p=this.#i,h=this.#d,m=Date.now(),g="error");const x=d.fetchStatus==="fetching",w=g==="pending",S=g==="error",k=w&&x,_=h!==void 0,T={status:g,fetchStatus:d.fetchStatus,isPending:w,isSuccess:g==="success",isError:S,isInitialLoading:k,isLoading:k,data:h,dataUpdatedAt:d.dataUpdatedAt,error:p,errorUpdatedAt:m,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:x,isRefetching:x&&!w,isLoadingError:S&&!_,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:S&&_,isStale:Kpe(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Yf(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const j=T.data!==void 0,N=T.status==="error"&&!j,I=B=>{N?B.reject(T.error):j&&B.resolve(T.data)},P=()=>{const B=this.#o=T.promise=aie();I(B)},R=this.#o;switch(R.status){case"pending":e.queryHash===r.queryHash&&I(R);break;case"fulfilled":(N||T.data!==R.value)&&P();break;case"rejected":(!N||T.error!==R.reason)&&P();break}}return T}updateResult(){const e=this.#s,t=this.createResult(this.#t,this.options);if(this.#n=this.#t.state,this.#a=this.options,this.#n.data!==void 0&&(this.#f=this.#t),dI(t,e))return;this.#s=t;const r=()=>{if(!e)return!0;const{notifyOnChangeProps:n}=this.options,s=typeof n=="function"?n():n;if(s==="all"||!s&&!this.#h.size)return!0;const a=new Set(s??this.#h);return this.options.throwOnError&&a.add("error"),Object.keys(this.#s).some(i=>{const l=i;return this.#s[l]!==e[l]&&a.has(l)})};this.#O({listeners:r()})}#S(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#r=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#O(e){Zi.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function w2r(e,t){return Yf(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function qIe(e,t){return w2r(e,t)||e.state.data!==void 0&&oie(e,t,t.refetchOnMount)}function oie(e,t,r){if(Yf(t.enabled,e)!==!1&&Zb(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Kpe(e,t)}return!1}function HIe(e,t,r,n){return(e!==t||Yf(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Kpe(e,r)}function Kpe(e,t){return Yf(t.enabled,e)!==!1&&e.isStaleByTime(Zb(t.staleTime,e))}function S2r(e,t){return!dI(e.getCurrentResult(),t)}function T5(e){return{onFetch:(t,r)=>{const n=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],i=t.state.data?.pageParams||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let d=!1;const f=m=>{p2r(m,()=>t.signal,()=>d=!0)},h=Gct(t.options,t.fetchOptions),p=async(m,g,y)=>{if(d)return Promise.reject();if(g==null&&m.pages.length)return Promise.resolve(m);const w=(()=>{const E={client:t.client,queryKey:t.queryKey,pageParam:g,direction:y?"backward":"forward",meta:t.options.meta};return f(E),E})(),S=await h(w),{maxPages:k}=t.options,_=y?h2r:f2r;return{pages:_(m.pages,S,k),pageParams:_(m.pageParams,g,k)}};if(s&&a.length){const m=s==="backward",g=m?Jct:lie,y={pages:a,pageParams:i},x=g(n,y);l=await p(y,x,m)}else{const m=e??a.length;do{const g=c===0?i[0]??n.initialPageParam:lie(n,l);if(c>0&&g==null)break;l=await p(l,g),c++}while(c<m)}return l};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=u}}}function lie(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function Jct(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}function O2r(e,t){return t?lie(e,t)!=null:!1}function k2r(e,t){return!t||!e.getPreviousPageParam?!1:Jct(e,t)!=null}var _2r=class extends j9{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:T5()})}getOptimisticResult(e){return e.behavior=T5(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:r}=e,n=super.createResult(e,t),{isFetching:s,isRefetching:a,isError:i,isRefetchError:l}=n,c=r.fetchMeta?.fetchMore?.direction,u=i&&c==="forward",d=s&&c==="forward",f=i&&c==="backward",h=s&&c==="backward";return{...n,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:O2r(t,r.data),hasPreviousPage:k2r(t,r.data),isFetchNextPageError:u,isFetchingNextPage:d,isFetchPreviousPageError:f,isFetchingPreviousPage:h,isRefetchError:l&&!u&&!f,isRefetching:a&&!d&&!h}}},E2r=class extends Xct{#e;#t;#r;#s;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#r=e.mutationCache,this.#t=[],this.state=e.state||eut(),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.#r.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#r.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#n({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=Yct({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(a,i)=>{this.#n({type:"failed",failureCount:a,error:i})},onPause:()=>{this.#n({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#r.canRun(this)});const n=this.state.status==="pending",s=!this.#s.canStart();try{if(n)t();else{this.#n({type:"pending",variables:e,isPaused:s}),this.#r.config.onMutate&&await this.#r.config.onMutate(e,this,r);const i=await this.options.onMutate?.(e,r);i!==this.state.context&&this.#n({type:"pending",context:i,variables:e,isPaused:s})}const a=await this.#s.start();return await this.#r.config.onSuccess?.(a,e,this.state.context,this,r),await this.options.onSuccess?.(a,e,this.state.context,r),await this.#r.config.onSettled?.(a,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(a,null,e,this.state.context,r),this.#n({type:"success",data:a}),a}catch(a){try{await this.#r.config.onError?.(a,e,this.state.context,this,r)}catch(i){Promise.reject(i)}try{await this.options.onError?.(a,e,this.state.context,r)}catch(i){Promise.reject(i)}try{await this.#r.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,r)}catch(i){Promise.reject(i)}try{await this.options.onSettled?.(void 0,a,e,this.state.context,r)}catch(i){Promise.reject(i)}throw this.#n({type:"error",error:a}),a}finally{this.#r.runNext(this)}}#n(e){const t=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,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{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Zi.batch(()=>{this.#t.forEach(r=>{r.onMutationUpdate(e)}),this.#r.notify({mutation:this,type:"updated",action:e})})}};function eut(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var C2r=class extends y1{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#r=0}#e;#t;#r;build(e,t,r){const n=new E2r({client:e,mutationCache:this,mutationId:++this.#r,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#e.add(e);const t=YD(e);if(typeof t=="string"){const r=this.#t.get(t);r?r.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=YD(e);if(typeof t=="string"){const r=this.#t.get(t);if(r)if(r.length>1){const n=r.indexOf(e);n!==-1&&r.splice(n,1)}else r[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=YD(e);if(typeof t=="string"){const n=this.#t.get(t)?.find(s=>s.state.status==="pending");return!n||n===e}else return!0}runNext(e){const t=YD(e);return typeof t=="string"?this.#t.get(t)?.find(n=>n!==e&&n.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Zi.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(r=>FIe(t,r))}findAll(e={}){return this.getAll().filter(t=>FIe(e,t))}notify(e){Zi.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Zi.batch(()=>Promise.all(e.map(t=>t.continue().catch(ic))))}};function YD(e){return e.options.scope?.id}var j2r=class extends y1{#e;#t=void 0;#r;#s;constructor(t,r){super(),this.#e=t,this.setOptions(r),this.bindMethods(),this.#n()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const r=this.options;this.options=this.#e.defaultMutationOptions(t),dI(this.options,r)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),r?.mutationKey&&this.options.mutationKey&&PS(r.mutationKey)!==PS(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(t){this.#n(),this.#a(t)}getCurrentResult(){return this.#t}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#n(),this.#a()}mutate(t,r){return this.#s=r,this.#r?.removeObserver(this),this.#r=this.#e.getMutationCache().build(this.#e,this.options),this.#r.addObserver(this),this.#r.execute(t)}#n(){const t=this.#r?.state??eut();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#a(t){Zi.batch(()=>{if(this.#s&&this.hasListeners()){const r=this.#t.variables,n=this.#t.context,s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#s.onSuccess?.(t.data,r,n,s)}catch(a){Promise.reject(a)}try{this.#s.onSettled?.(t.data,null,r,n,s)}catch(a){Promise.reject(a)}}else if(t?.type==="error"){try{this.#s.onError?.(t.error,r,n,s)}catch(a){Promise.reject(a)}try{this.#s.onSettled?.(void 0,t.error,r,n,s)}catch(a){Promise.reject(a)}}}this.listeners.forEach(r=>{r(this.#t)})})}};function QIe(e,t){const r=new Set(t);return e.filter(n=>!r.has(n))}function T2r(e,t,r){const n=e.slice(0);return n[t]=r,n}var N2r=class extends y1{#e;#t;#r;#s;#n;#a;#o;#i;#p;#d=[];constructor(e,t,r){super(),this.#e=e,this.#s=r,this.#r=[],this.#n=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#n.forEach(e=>{e.subscribe(t=>{this.#l(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#n.forEach(e=>{e.destroy()})}setQueries(e,t){this.#r=e,this.#s=t,Zi.batch(()=>{const r=this.#n,n=this.#u(this.#r);n.forEach(d=>d.observer.setOptions(d.defaultedQueryOptions));const s=n.map(d=>d.observer),a=s.map(d=>d.getCurrentResult()),i=r.length!==s.length,l=s.some((d,f)=>d!==r[f]),c=i||l,u=c?!0:a.some((d,f)=>{const h=this.#t[f];return!h||!dI(d,h)});!c&&!u||(c&&(this.#d=n,this.#n=s),this.#t=a,this.hasListeners()&&(c&&(QIe(r,s).forEach(d=>{d.destroy()}),QIe(s,r).forEach(d=>{d.subscribe(f=>{this.#l(d,f)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#n.map(e=>e.getCurrentQuery())}getObservers(){return this.#n}getOptimisticResult(e,t){const r=this.#u(e),n=r.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),s=r.map(a=>a.defaultedQueryOptions.queryHash);return[n,a=>this.#c(a??n,t,s),()=>this.#f(n,r)]}#f(e,t){return t.map((r,n)=>{const s=e[n];return r.defaultedQueryOptions.notifyOnChangeProps?s:r.observer.trackResult(s,a=>{t.forEach(i=>{i.observer.trackProp(a)})})})}#c(e,t,r){if(t){const n=this.#p,s=r!==void 0&&n!==void 0&&(n.length!==r.length||r.some((a,i)=>a!==n[i]));return(!this.#a||this.#t!==this.#i||s||t!==this.#o)&&(this.#o=t,this.#i=this.#t,r!==void 0&&(this.#p=r),this.#a=Gpe(this.#a,t(e))),this.#a}return e}#u(e){const t=new Map;this.#n.forEach(n=>{const s=n.options.queryHash;if(!s)return;const a=t.get(s);a?a.push(n):t.set(s,[n])});const r=[];return e.forEach(n=>{const s=this.#e.defaultQueryOptions(n),i=t.get(s.queryHash)?.shift()??new j9(this.#e,s);r.push({defaultedQueryOptions:s,observer:i})}),r}#l(e,t){const r=this.#n.indexOf(e);r!==-1&&(this.#t=T2r(this.#t,r,t),this.#h())}#h(){if(this.hasListeners()){const e=this.#a,t=this.#f(this.#t,this.#d),r=this.#c(t,this.#s?.combine);e!==r&&Zi.batch(()=>{this.listeners.forEach(n=>{n(this.#t)})})}}},A2r=class extends y1{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){const n=t.queryKey,s=t.queryHash??Wpe(n,t);let a=this.get(s);return a||(a=new x2r({client:e,queryKey:n,queryHash:s,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(n)}),this.add(a)),a}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(){Zi.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(r=>$Ie(t,r))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(r=>$Ie(e,r)):t}notify(e){Zi.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Zi.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Zi.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},I2r=class{#e;#t;#r;#s;#n;#a;#o;#i;constructor(e={}){this.#e=e.queryCache||new A2r,this.#t=e.mutationCache||new C2r,this.#r=e.defaultOptions||{},this.#s=new Map,this.#n=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Xpe.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=j5.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=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),r=this.#e.build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Zb(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),a=this.#e.get(n.queryHash)?.state.data,i=l2r(t,a);if(i!==void 0)return this.#e.build(this,n).setData(i,{...r,manual:!0})}setQueriesData(e,t,r){return Zi.batch(()=>this.#e.findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Zi.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=this.#e;return Zi.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Zi.batch(()=>this.#e.findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(ic).catch(ic)}invalidateQueries(e,t={}){return Zi.batch(()=>(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Zi.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let a=s.fetch(void 0,r);return r.throwOnError||(a=a.catch(ic)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(ic)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=this.#e.build(this,t);return r.isStaleByTime(Zb(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ic).catch(ic)}fetchInfiniteQuery(e){return e.behavior=T5(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ic).catch(ic)}ensureInfiniteQueryData(e){return e.behavior=T5(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return j5.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#r}setDefaultOptions(e){this.#r=e}setQueryDefaults(e,t){this.#s.set(PS(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],r={};return t.forEach(n=>{uI(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){this.#n.set(PS(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#n.values()],r={};return t.forEach(n=>{uI(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#r.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Wpe(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===Zpe&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#r.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},tut=b.createContext(void 0),wa=e=>{const t=b.useContext(tut);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},R2r=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),o.jsx(tut.Provider,{value:e,children:t})),rut=b.createContext(!1),nut=()=>b.useContext(rut);rut.Provider;function P2r(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var M2r=b.createContext(P2r()),sut=()=>b.useContext(M2r),aut=(e,t,r)=>{const n=r?.state.error&&typeof e.throwOnError=="function"?Ype(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},iut=e=>{b.useEffect(()=>{e.clearReset()},[e])},out=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||Ype(r,[e.error,n])),lut=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...s)=>r(n(...s)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},D2r=(e,t)=>e.isLoading&&e.isFetching&&!t,cie=(e,t)=>e?.suspense&&t.isPending,uie=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function L2r({queries:e,...t},r){const n=wa(),s=nut(),a=sut(),i=b.useMemo(()=>e.map(g=>{const y=n.defaultQueryOptions(g);return y._optimisticResults=s?"isRestoring":"optimistic",y}),[e,n,s]);i.forEach(g=>{lut(g);const y=n.getQueryCache().get(g.queryHash);aut(g,a,y)}),iut(a);const[l]=b.useState(()=>new N2r(n,i,t)),[c,u,d]=l.getOptimisticResult(i,t.combine),f=!s&&t.subscribed!==!1;b.useSyncExternalStore(b.useCallback(g=>f?l.subscribe(Zi.batchCalls(g)):ic,[l,f]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),b.useEffect(()=>{l.setQueries(i,t)},[i,t,l]);const p=c.some((g,y)=>cie(i[y],g))?c.flatMap((g,y)=>{const x=i[y];if(x&&cie(x,g)){const w=new j9(n,x);return uie(x,w,a)}return[]}):[];if(p.length>0)throw Promise.all(p);const m=c.find((g,y)=>{const x=i[y];return x&&out({result:g,errorResetBoundary:a,throwOnError:x.throwOnError,query:n.getQueryCache().get(x.queryHash),suspense:x.suspense})});if(m?.error)throw m.error;return u(d())}function cut(e,t,r){const n=nut(),s=sut(),a=wa(),i=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(i);const l=a.getQueryCache().get(i.queryHash);i._optimisticResults=n?"isRestoring":"optimistic",lut(i),aut(i,s,l),iut(s);const c=!a.getQueryCache().get(i.queryHash),[u]=b.useState(()=>new t(a,i)),d=u.getOptimisticResult(i),f=!n&&e.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(h=>{const p=f?u.subscribe(Zi.batchCalls(h)):ic;return u.updateResult(),p},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),b.useEffect(()=>{u.setOptions(i)},[i,u]),cie(i,d))throw uie(i,u,s);if(out({result:d,errorResetBoundary:s,throwOnError:i.throwOnError,query:l,suspense:i.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(i,d),i.experimental_prefetchInRender&&!RS&&D2r(d,n)&&(c?uie(i,u,s):l?.promise)?.catch(ic).finally(()=>{u.updateResult()}),i.notifyOnChangeProps?d:u.trackResult(d)}function kt(e,t){return cut(e,j9)}function Kr(e,t){const r=wa(),[n]=b.useState(()=>new j2r(r,e));b.useEffect(()=>{n.setOptions(e)},[n,e]);const s=b.useSyncExternalStore(b.useCallback(i=>n.subscribe(Zi.batchCalls(i)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),a=b.useCallback((i,l)=>{n.mutate(i,l).catch(ic)},[n]);if(s.error&&Ype(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}function s0(e,t){return cut(e,_2r)}var Do=(e=>(e.AGENT="agent",e.SCORER="scorer",e.RAG_INGESTION="rag_ingestion",e.TRAJECTORY="trajectory",e.INPUT_PROCESSOR="input_processor",e.INPUT_STEP_PROCESSOR="input_step_processor",e.OUTPUT_PROCESSOR="output_processor",e.OUTPUT_STEP_PROCESSOR="output_step_processor",e.WORKFLOW_STEP="workflow_step",e.TOOL="tool",e.WORKFLOW_RUN="workflow_run",e.MEMORY="memory",e))(Do||{});XS().describe("Database record creation time");var $2r=XS().describe("Database record last update time");$2r.nullable();var T9=_e({page:rSe().int().min(0).optional().default(0).describe("Zero-indexed page number"),perPage:rSe().int().min(1).max(100).optional().default(10).describe("Number of items per page")}).describe("Pagination options for list queries"),N9=_e({total:St().describe("Total number of items available"),page:St().describe("Current page"),perPage:Hr([St(),Bt(!1)]).describe("Number of items per page, or false if pagination is disabled"),hasMore:yo().describe("True if more pages are available")}),F2r=_e({start:nSe().optional().describe("Start of date range (inclusive by default)"),end:nSe().optional().describe("End of date range (inclusive by default)"),startExclusive:yo().optional().describe("When true, excludes the start date from results (uses > instead of >=)"),endExclusive:yo().optional().describe("When true, excludes the end date from results (uses < instead of <=)")}).describe("Date range filter for timestamps"),A9=So(["ASC","DESC"]).describe("Sort direction: 'ASC' | 'DESC'"),wg=So(["sum","avg","min","max","count","last"]).describe("Aggregation function"),v1=So(["1m","5m","15m","1h","1d"]).describe("Time bucket interval"),Jpe=So(["previous_period","previous_day","previous_week"]).describe("Comparison period for aggregate queries"),b1=Et(pe()).min(1).describe("Fields to group by"),eme=Et(St().min(0).max(1)).min(1).describe("Percentile values (0-1)"),tme={value:St().nullable().describe("Aggregated value"),previousValue:St().nullable().optional().describe("Value from comparison period"),changePercent:St().nullable().optional().describe("Percentage change from comparison period")},rme=Ws(pe(),pe().nullable()).describe("Dimension values for this group"),cC=St().describe("Aggregated value"),uC=XS().describe("Bucket timestamp"),nme=St().describe("Percentile value"),sme=St().describe("Percentile value at this bucket"),dC=Kle(Do).describe("Entity type (e.g., 'agent' | 'processor' | 'tool' | 'workflow')"),z2r=pe().describe('ID of the entity (e.g., "weatherAgent", "orderWorkflow")'),uut=pe().describe("Name of the entity"),dut=pe().describe("Human end-user who triggered execution"),fut=pe().describe("Multi-tenant organization/account"),hut=pe().describe("Broader resource context (Mastra memory compatibility)"),put=pe().describe("Unique execution run identifier"),mut=pe().describe("Session identifier for grouping traces"),gut=pe().describe("Conversation thread identifier"),yut=pe().describe("HTTP request ID for log correlation"),vut=pe().describe('Environment (e.g., "production" | "staging" | "development")'),B2r=pe().describe('Source of execution (e.g., "local" | "cloud" | "ci")'),but=pe().describe('Source of execution (e.g., "local" | "cloud" | "ci")'),xut=pe().describe("Name of the service"),wut=Kle(Do).describe("Entity type of the parent entity"),U2r=pe().describe("ID of the parent entity"),Sut=pe().describe("Name of the parent entity"),Out=Kle(Do).describe("Entity type of the root entity"),V2r=pe().describe("ID of the root entity"),kut=pe().describe("Name of the root entity"),_ut=pe().describe("Version ID of the entity that produced this signal (e.g., agent version, workflow version)"),Eut=pe().describe("Version ID of the parent entity that produced this signal"),Cut=pe().describe("Version ID of the root entity that produced this signal"),I9=pe().describe("Experiment or eval run identifier"),q2r=Ws(pe(),Ia()).describe('Arbitrary package/app version info (e.g., {"core": "1.0.0", "memory": "1.0.0", "gitSha": "abcd1234"})'),jut=Ws(pe(),Ia()).describe("User-defined metadata for custom filtering"),Tut=Et(pe()).describe("Labels for filtering"),H2r={entityType:dC.nullish(),entityId:z2r.nullish(),entityName:uut.nullish(),parentEntityType:wut.nullish(),parentEntityId:U2r.nullish(),parentEntityName:Sut.nullish(),rootEntityType:Out.nullish(),rootEntityId:V2r.nullish(),rootEntityName:kut.nullish(),userId:dut.nullish(),organizationId:fut.nullish(),resourceId:hut.nullish(),runId:put.nullish(),sessionId:mut.nullish(),threadId:gut.nullish(),requestId:yut.nullish(),environment:vut.nullish(),serviceName:xut.nullish(),scope:q2r.nullish(),entityVersionId:_ut.nullish(),parentEntityVersionId:Eut.nullish(),rootEntityVersionId:Cut.nullish(),experimentId:I9.nullish()},R9={...H2r,executionSource:but.nullish(),tags:Tut.nullish()};B2r.nullish();var P9={timestamp:F2r.optional().describe("Filter by timestamp range"),traceId:pe().optional().describe("Filter by trace ID"),spanId:pe().optional().describe("Filter by span ID"),entityType:dC.optional(),entityName:uut.optional(),entityVersionId:_ut.optional(),parentEntityVersionId:Eut.optional(),rootEntityVersionId:Cut.optional(),userId:dut.optional(),organizationId:fut.optional(),experimentId:I9.optional(),serviceName:xut.optional(),environment:vut.optional(),parentEntityType:wut.optional(),parentEntityName:Sut.optional(),rootEntityType:Out.optional(),rootEntityName:kut.optional(),resourceId:hut.optional(),runId:put.optional(),sessionId:mut.optional(),threadId:gut.optional(),requestId:yut.optional(),executionSource:but.optional(),tags:Et(pe()).optional().describe("Filter by tags (must have all specified tags)")},M9=pe().describe("Unique trace identifier"),D9=pe().describe("Unique span identifier within a trace"),N5=So(["debug","info","warn","error","fatal"]),Nut=pe().describe("Log message"),Aut=Ws(pe(),Ia()).describe("Structured data attached to the log"),Iut=_e({logId:pe().nullish().describe("Unique id for this log event"),timestamp:XS().describe("When the log was created"),level:N5.describe("Log severity level"),message:Nut,data:Aut.nullish(),traceId:M9.nullish(),spanId:D9.nullish(),...R9,source:pe().nullish().describe("Execution source"),metadata:jut.nullish()}).describe("Log record as stored in the database");_e({level:N5,message:Nut,data:Aut.optional(),tags:Tut.optional()}).describe("User-provided log input");var Q2r=Iut;_e({logs:Et(Q2r)}).describe("Arguments for batch creating logs");var W2r=_e({...P9,source:pe().optional().describe("Filter by execution source"),level:Hr([N5,Et(N5)]).optional().describe("Filter by log level(s)")}).describe("Filters for querying logs"),G2r=So(["timestamp"]).describe("Field to order by: 'timestamp'"),Z2r=_e({field:G2r.default("timestamp").describe("Field to order by"),direction:A9.default("DESC").describe("Sort direction")}).describe("Order by configuration");_e({filters:W2r.optional().describe("Optional filters to apply"),pagination:T9.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:Z2r.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing logs");_e({pagination:N9,logs:Et(Iut)});var fC=pe().describe("Identifier of the scorer (e.g., relevance, accuracy)"),Rut=pe().describe("Display name of the scorer"),Put=pe().describe("Version of the scorer"),ng=pe().describe("How the score was produced (e.g., manual, automated, experiment)"),Mut=St().describe("Score value (range defined by scorer)"),Dut=pe().describe("Explanation for the score"),Lut=_e({scoreId:pe().nullish().describe("Unique id for this score event"),timestamp:XS().describe("When the score was recorded"),traceId:M9.nullish().describe("Trace that anchors the scored target when available"),spanId:D9.nullish().describe("Span ID this score applies to"),scorerId:fC,scorerName:Rut.nullish(),scorerVersion:Put.nullish(),scoreSource:ng.nullish(),source:ng.nullish(),score:Mut,reason:Dut.nullish(),...R9,scoreTraceId:pe().nullish().describe("Trace ID of the scoring run for debugging score generation"),metadata:Ws(pe(),Ia()).nullish().describe("User-defined metadata")}).describe("Score record as stored in the database");_e({scorerId:fC,scorerName:Rut.optional(),scorerVersion:Put.optional(),scoreSource:ng.optional(),source:ng.optional(),score:Mut,reason:Dut.optional(),metadata:Ws(pe(),Ia()).optional().describe("Additional scorer-specific metadata"),experimentId:I9.optional(),scoreTraceId:pe().optional().describe("Trace ID of the scoring run for debugging score generation"),targetEntityType:dC.optional().describe("Entity type the scorer evaluated when known")}).describe("User-provided score input");var ame=Lut;_e({score:ame}).describe("Arguments for creating a score");_e({score:ame.omit({timestamp:!0})}).describe("Arguments for creating a score");_e({success:yo()}).describe("Response from creating a score");_e({scores:Et(ame)}).describe("Arguments for batch recording scores");var IP=_e({...P9,scorerId:Hr([pe(),Et(pe())]).optional().describe("Filter by scorer ID(s)"),scoreSource:ng.optional().describe("Filter by how the score was produced"),source:ng.optional().describe("Filter by how the score was produced")}).describe("Filters for querying scores"),Y2r=So(["timestamp","score"]).describe("Field to order by: 'timestamp' | 'score'"),X2r=_e({field:Y2r.default("timestamp").describe("Field to order by"),direction:A9.default("DESC").describe("Sort direction")}).describe("Order by configuration");_e({filters:IP.optional(),pagination:T9.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:X2r.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing scores");_e({pagination:N9,scores:Et(Lut)});_e({scorerId:fC,scoreSource:ng.optional(),aggregation:wg,filters:IP.optional(),comparePeriod:Jpe.optional()}).describe("Arguments for getting a score aggregate");_e(tme);_e({scorerId:fC,scoreSource:ng.optional(),groupBy:b1,aggregation:wg,filters:IP.optional()}).describe("Arguments for getting a score breakdown");_e({groups:Et(_e({dimensions:rme,value:cC}))});_e({scorerId:fC,scoreSource:ng.optional(),interval:v1,aggregation:wg,filters:IP.optional(),groupBy:b1.optional()}).describe("Arguments for getting score time series");_e({series:Et(_e({name:pe().describe("Series name (scorer ID or group key)"),points:Et(_e({timestamp:uC,value:cC}))}))});_e({scorerId:fC,scoreSource:ng.optional(),percentiles:eme,interval:v1,filters:IP.optional()}).describe("Arguments for getting score percentiles");_e({series:Et(_e({percentile:nme,points:Et(_e({timestamp:uC,value:sme}))}))});var sg=pe().describe("Source of feedback (e.g., 'user', 'system', 'manual')"),hC=pe().describe("Type of feedback (e.g., 'thumbs', 'rating', 'correction')"),$ut=Hr([St(),pe()]).describe("Feedback value (rating number or correction text)"),Fut=pe().describe("Additional comment or context"),A5=pe().describe("User who provided the feedback");function ime(e){if(!e||typeof e!="object"||Array.isArray(e))return e;const t={...e};return typeof t.userId=="string"&&t.feedbackUserId==null&&(t.feedbackUserId=t.userId,delete t.userId),t}var L9=_e({feedbackId:pe().nullish().describe("Unique id for this feedback event"),timestamp:XS().describe("When the feedback was recorded"),traceId:M9.nullish().describe("Trace that anchors the feedback target when available"),spanId:D9.nullish().describe("Span ID this feedback applies to"),feedbackSource:sg.nullish(),source:sg.nullish(),feedbackType:hC,value:$ut,comment:Fut.nullish(),feedbackUserId:A5.nullish(),...R9,sourceId:pe().nullish().describe("ID of the source record this feedback is linked to (e.g. experiment result ID)"),metadata:Ws(pe(),Ia()).nullish().describe("User-defined metadata")}),K2r=_e(L9.shape).describe("Feedback record as stored in the database"),J2r=_e({feedbackSource:sg.optional(),source:sg.optional(),feedbackType:hC,value:$ut,comment:Fut.optional(),feedbackUserId:A5.optional(),userId:A5.optional(),metadata:Ws(pe(),Ia()).optional().describe("Additional feedback-specific metadata"),experimentId:I9.optional(),sourceId:pe().optional().describe("ID of the source record this feedback is linked to")});_e(J2r.shape).describe("User-provided feedback input");_e({feedback:rce(ime,L9)}).describe("Arguments for creating feedback");_e({feedback:L9.omit({timestamp:!0})}).describe("Arguments for creating feedback");_e({success:yo()}).describe("Response from creating feedback");_e({feedbacks:Et(rce(ime,L9))}).describe("Arguments for batch recording feedback");var zut=_e({...P9,feedbackType:Hr([pe(),Et(pe())]).optional().describe("Filter by feedback type(s)"),feedbackSource:sg.optional(),source:sg.optional(),feedbackUserId:A5.optional()}),$9=_e(zut.shape).describe("Filters for querying feedback"),eDr=So(["timestamp"]).describe("Field to order by: 'timestamp'"),tDr=_e({field:eDr.default("timestamp").describe("Field to order by"),direction:A9.default("DESC").describe("Sort direction")}).describe("Order by configuration");_e({filters:rce(ime,zut).optional().describe("Optional filters to apply"),pagination:T9.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:tDr.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing feedback");_e({pagination:N9,feedback:Et(K2r)});_e({feedbackType:hC,feedbackSource:sg.optional(),aggregation:wg,filters:$9.optional(),comparePeriod:Jpe.optional()}).describe("Arguments for getting a feedback aggregate over numeric values");_e(tme);_e({feedbackType:hC,feedbackSource:sg.optional(),groupBy:b1,aggregation:wg,filters:$9.optional()}).describe("Arguments for getting a feedback breakdown over numeric values");_e({groups:Et(_e({dimensions:rme,value:cC}))});_e({feedbackType:hC,feedbackSource:sg.optional(),interval:v1,aggregation:wg,filters:$9.optional(),groupBy:b1.optional()}).describe("Arguments for getting feedback time series over numeric values");_e({series:Et(_e({name:pe().describe("Series name (feedback type or group key)"),points:Et(_e({timestamp:uC,value:cC}))}))});_e({feedbackType:hC,feedbackSource:sg.optional(),percentiles:eme,interval:v1,filters:$9.optional()}).describe("Arguments for getting feedback percentiles over numeric values");_e({series:Et(_e({percentile:nme,points:Et(_e({timestamp:uC,value:sme}))}))});So(["counter","gauge","histogram"]);var But=pe().describe("Metric name (e.g., mastra_agent_duration_ms)"),Uut=St().describe("Metric value"),Vut=Ws(pe(),pe()).describe("Metric labels for dimensional filtering"),qut=pe().describe("Model provider"),Hut=pe().describe("Model"),rDr=St().describe("Estimated cost"),Qut=pe().describe("Unit for the estimated cost (e.g., usd)"),nDr=Ws(pe(),Ia()).nullish().describe("Structured costing metadata"),Wut=_e({metricId:pe().nullish().describe("Unique id for this metric event"),timestamp:XS().describe("When the metric was recorded"),name:But,value:Uut,traceId:M9.nullish(),spanId:D9.nullish(),...R9,source:pe().nullish().describe("Execution source"),provider:qut.nullish(),model:Hut.nullish(),estimatedCost:rDr.nullish(),costUnit:Qut.nullish(),costMetadata:nDr.nullish(),labels:Vut.default({}),metadata:jut.nullish()}).describe("Metric record as stored in the database");_e({name:But,value:Uut,labels:Vut.optional()}).describe("User-provided metric input");var sDr=Wut;_e({metrics:Et(sDr)}).describe("Arguments for batch recording metrics");_e({type:wg,interval:v1.optional(),groupBy:b1.optional()}).describe("Metrics aggregation configuration");var RP=_e({...P9,name:Et(pe()).nonempty().optional().describe("Filter by metric name(s)"),source:pe().optional().describe("Filter by execution source"),provider:qut.optional(),model:Hut.optional(),costUnit:Qut.optional(),labels:Ws(pe(),pe()).optional().describe("Exact match on label key-value pairs")}).describe("Filters for querying metrics"),aDr=So(["timestamp"]).describe("Field to order by: 'timestamp'"),iDr=_e({field:aDr.default("timestamp").describe("Field to order by"),direction:A9.default("DESC").describe("Sort direction")}).describe("Order by configuration");_e({filters:RP.optional(),pagination:T9.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:iDr.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing metrics");_e({pagination:N9,metrics:Et(Wut)});_e({name:Et(pe()).nonempty().describe("Metric name(s) to aggregate"),aggregation:wg,filters:RP.optional(),comparePeriod:Jpe.optional()}).describe("Arguments for getting a metric aggregate");_e({...tme,estimatedCost:St().nullable().optional().describe("Aggregated estimated cost from the same filtered row set"),costUnit:pe().nullable().optional().describe("Shared cost unit for the aggregated rows, or null when mixed/unknown"),previousEstimatedCost:St().nullable().optional().describe("Aggregated estimated cost from the comparison period"),costChangePercent:St().nullable().optional().describe("Percentage change in estimated cost from comparison period")});_e({name:Et(pe()).nonempty().describe("Metric name(s) to break down"),groupBy:b1,aggregation:wg,filters:RP.optional()}).describe("Arguments for getting a metric breakdown");_e({groups:Et(_e({dimensions:rme,value:cC,estimatedCost:St().nullable().optional().describe("Summed estimated cost for this group"),costUnit:pe().nullable().optional().describe("Shared cost unit for this group, or null when mixed/unknown")}))});_e({name:Et(pe()).nonempty().describe("Metric name(s)"),interval:v1,aggregation:wg,filters:RP.optional(),groupBy:b1.optional()}).describe("Arguments for getting metric time series");_e({series:Et(_e({name:pe().describe("Series name (metric name or group key)"),costUnit:pe().nullable().optional().describe("Shared cost unit for this series, or null when mixed/unknown"),points:Et(_e({timestamp:uC,value:cC,estimatedCost:St().nullable().optional().describe("Summed estimated cost in this bucket")}))}))});_e({name:pe().describe("Metric name"),percentiles:eme,interval:v1,filters:RP.optional()}).describe("Arguments for getting metric percentiles");_e({series:Et(_e({percentile:nme,points:Et(_e({timestamp:uC,value:sme}))}))});_e({prefix:pe().optional().describe("Filter metric names by prefix"),limit:St().int().min(1).optional().describe("Maximum number of names to return")}).describe("Arguments for getting metric names");_e({names:Et(pe()).describe("Distinct metric names")});_e({metricName:pe().describe("Metric name to get label keys for")}).describe("Arguments for getting metric label keys");_e({keys:Et(pe()).describe("Distinct label keys for the metric")});_e({metricName:pe().describe("Metric name"),labelKey:pe().describe("Label key to get values for"),prefix:pe().optional().describe("Filter values by prefix"),limit:St().int().min(1).optional().describe("Maximum number of values to return")}).describe("Arguments for getting label values");_e({values:Et(pe()).describe("Distinct label values")});_e({}).describe("Arguments for getting entity types");_e({entityTypes:Et(dC).describe("Distinct entity types")});_e({entityType:dC.optional().describe("Optional entity type filter")}).describe("Arguments for getting entity names");_e({names:Et(pe()).describe("Distinct entity names")});_e({}).describe("Arguments for getting service names");_e({serviceNames:Et(pe()).describe("Distinct service names")});_e({}).describe("Arguments for getting environments");_e({environments:Et(pe()).describe("Distinct environments")});_e({entityType:dC.optional().describe("Optional entity type filter")}).describe("Arguments for getting tags");_e({tags:Et(pe()).describe("Distinct tags")});function Gut(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=Gut(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Zut(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=Gut(e))&&(n&&(n+=" "),n+=t);return n}const WIe=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,GIe=Zut,x1=(e,t)=>r=>{var n;if(t?.variants==null)return GIe(e,r?.class,r?.className);const{variants:s,defaultVariants:a}=t,i=Object.keys(s).map(u=>{const d=r?.[u],f=a?.[u];if(d===null)return null;const h=WIe(d)||WIe(f);return s[u][h]}),l=r&&Object.entries(r).reduce((u,d)=>{let[f,h]=d;return h===void 0||(u[f]=h),u},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,d)=>{let{class:f,className:h,...p}=d;return Object.entries(p).every(m=>{let[g,y]=m;return Array.isArray(y)?y.includes({...a,...l}[g]):{...a,...l}[g]===y})?[...u,f,h]:u},[]);return GIe(e,i,c,r?.class,r?.className)},oDr=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},lDr=(e,t)=>({classGroupId:e,validator:t}),Yut=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),I5="-",ZIe=[],cDr="arbitrary..",uDr=e=>{const t=fDr(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return dDr(i);const l=i.split(I5),c=l[0]===""&&l.length>1?1:0;return Xut(l,c,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=n[i],u=r[i];return c?u?oDr(u,c):c:u||ZIe}return r[i]||ZIe}}},Xut=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const s=e[t],a=r.nextPart.get(s);if(a){const u=Xut(e,t+1,a);if(u)return u}const i=r.validators;if(i===null)return;const l=t===0?e.join(I5):e.slice(t).join(I5),c=i.length;for(let u=0;u<c;u++){const d=i[u];if(d.validator(l))return d.classGroupId}},dDr=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?cDr+n:void 0})(),fDr=e=>{const{theme:t,classGroups:r}=e;return hDr(r,t)},hDr=(e,t)=>{const r=Yut();for(const n in e){const s=e[n];ome(s,r,n,t)}return r},ome=(e,t,r,n)=>{const s=e.length;for(let a=0;a<s;a++){const i=e[a];pDr(i,t,r,n)}},pDr=(e,t,r,n)=>{if(typeof e=="string"){mDr(e,t,r);return}if(typeof e=="function"){gDr(e,t,r,n);return}yDr(e,t,r,n)},mDr=(e,t,r)=>{const n=e===""?t:Kut(t,e);n.classGroupId=r},gDr=(e,t,r,n)=>{if(vDr(e)){ome(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(lDr(r,e))},yDr=(e,t,r,n)=>{const s=Object.entries(e),a=s.length;for(let i=0;i<a;i++){const[l,c]=s[i];ome(c,Kut(t,l),r,n)}},Kut=(e,t)=>{let r=e;const n=t.split(I5),s=n.length;for(let a=0;a<s;a++){const i=n[a];let l=r.nextPart.get(i);l||(l=Yut(),r.nextPart.set(i,l)),r=l}return r},vDr=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,bDr=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const s=(a,i)=>{r[a]=i,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(a){let i=r[a];if(i!==void 0)return i;if((i=n[a])!==void 0)return s(a,i),i},set(a,i){a in r?r[a]=i:s(a,i)}}},die="!",YIe=":",xDr=[],XIe=(e,t,r,n,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:s}),wDr=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=s=>{const a=[];let i=0,l=0,c=0,u;const d=s.length;for(let g=0;g<d;g++){const y=s[g];if(i===0&&l===0){if(y===YIe){a.push(s.slice(c,g)),c=g+1;continue}if(y==="/"){u=g;continue}}y==="["?i++:y==="]"?i--:y==="("?l++:y===")"&&l--}const f=a.length===0?s:s.slice(c);let h=f,p=!1;f.endsWith(die)?(h=f.slice(0,-1),p=!0):f.startsWith(die)&&(h=f.slice(1),p=!0);const m=u&&u>c?u-c:void 0;return XIe(a,p,h,m)};if(t){const s=t+YIe,a=n;n=i=>i.startsWith(s)?a(i.slice(s.length)):XIe(xDr,!1,i,void 0,!0)}if(r){const s=n;n=a=>r({className:a,parseClassName:s})}return n},SDr=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let s=[];for(let a=0;a<r.length;a++){const i=r[a],l=i[0]==="[",c=t.has(i);l||c?(s.length>0&&(s.sort(),n.push(...s),s=[]),n.push(i)):s.push(i)}return s.length>0&&(s.sort(),n.push(...s)),n}},ODr=e=>({cache:bDr(e.cacheSize),parseClassName:wDr(e),sortModifiers:SDr(e),...uDr(e)}),kDr=/\s+/,_Dr=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s,sortModifiers:a}=t,i=[],l=e.trim().split(kDr);let c="";for(let u=l.length-1;u>=0;u-=1){const d=l[u],{isExternal:f,modifiers:h,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:g}=r(d);if(f){c=d+(c.length>0?" "+c:c);continue}let y=!!g,x=n(y?m.substring(0,g):m);if(!x){if(!y){c=d+(c.length>0?" "+c:c);continue}if(x=n(m),!x){c=d+(c.length>0?" "+c:c);continue}y=!1}const w=h.length===0?"":h.length===1?h[0]:a(h).join(":"),S=p?w+die:w,k=S+x;if(i.indexOf(k)>-1)continue;i.push(k);const _=s(x,y);for(let E=0;E<_.length;++E){const T=_[E];i.push(S+T)}c=d+(c.length>0?" "+c:c)}return c},EDr=(...e)=>{let t=0,r,n,s="";for(;t<e.length;)(r=e[t++])&&(n=Jut(r))&&(s&&(s+=" "),s+=n);return s},Jut=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Jut(e[n]))&&(r&&(r+=" "),r+=t);return r},KIe=(e,...t)=>{let r,n,s,a;const i=c=>{const u=t.reduce((d,f)=>f(d),e());return r=ODr(u),n=r.cache.get,s=r.cache.set,a=l,l(c)},l=c=>{const u=n(c);if(u)return u;const d=_Dr(c,r);return s(c,d),d};return a=i,(...c)=>a(EDr(...c))},CDr=[],Go=e=>{const t=r=>r[e]||CDr;return t.isThemeGetter=!0,t},edt=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,tdt=/^\((?:(\w[\w-]*):)?(.+)\)$/i,jDr=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,TDr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,NDr=/\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$/,ADr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,IDr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,RDr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,nb=e=>jDr.test(e),qn=e=>!!e&&!Number.isNaN(Number(e)),sb=e=>!!e&&Number.isInteger(Number(e)),nQ=e=>e.endsWith("%")&&qn(e.slice(0,-1)),Jg=e=>TDr.test(e),rdt=()=>!0,PDr=e=>NDr.test(e)&&!ADr.test(e),lme=()=>!1,MDr=e=>IDr.test(e),DDr=e=>RDr.test(e),LDr=e=>!vr(e)&&!kr(e),$Dr=e=>a0(e,adt,lme),vr=e=>edt.test(e),V0=e=>a0(e,idt,PDr),JIe=e=>a0(e,QDr,qn),FDr=e=>a0(e,ldt,rdt),zDr=e=>a0(e,odt,lme),eRe=e=>a0(e,ndt,lme),BDr=e=>a0(e,sdt,DDr),XD=e=>a0(e,cdt,MDr),kr=e=>tdt.test(e),aT=e=>w1(e,idt),UDr=e=>w1(e,odt),tRe=e=>w1(e,ndt),VDr=e=>w1(e,adt),qDr=e=>w1(e,sdt),KD=e=>w1(e,cdt,!0),HDr=e=>w1(e,ldt,!0),a0=(e,t,r)=>{const n=edt.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},w1=(e,t,r=!1)=>{const n=tdt.exec(e);return n?n[1]?t(n[1]):r:!1},ndt=e=>e==="position"||e==="percentage",sdt=e=>e==="image"||e==="url",adt=e=>e==="length"||e==="size"||e==="bg-size",idt=e=>e==="length",QDr=e=>e==="number",odt=e=>e==="family-name",ldt=e=>e==="number"||e==="weight",cdt=e=>e==="shadow",rRe=()=>{const e=Go("color"),t=Go("font"),r=Go("text"),n=Go("font-weight"),s=Go("tracking"),a=Go("leading"),i=Go("breakpoint"),l=Go("container"),c=Go("spacing"),u=Go("radius"),d=Go("shadow"),f=Go("inset-shadow"),h=Go("text-shadow"),p=Go("drop-shadow"),m=Go("blur"),g=Go("perspective"),y=Go("aspect"),x=Go("ease"),w=Go("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],_=()=>[...k(),kr,vr],E=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],j=()=>[kr,vr,c],N=()=>[nb,"full","auto",...j()],I=()=>[sb,"none","subgrid",kr,vr],P=()=>["auto",{span:["full",sb,kr,vr]},sb,kr,vr],R=()=>[sb,"auto",kr,vr],B=()=>["auto","min","max","fr",kr,vr],D=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],$=()=>["start","end","center","stretch","center-safe","end-safe"],U=()=>["auto",...j()],z=()=>[nb,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],H=()=>[nb,"screen","full","dvw","lvw","svw","min","max","fit",...j()],Q=()=>[nb,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],L=()=>[e,kr,vr],Z=()=>[...k(),tRe,eRe,{position:[kr,vr]}],V=()=>["no-repeat",{repeat:["","x","y","space","round"]}],M=()=>["auto","cover","contain",VDr,$Dr,{size:[kr,vr]}],W=()=>[nQ,aT,V0],G=()=>["","none","full",u,kr,vr],J=()=>["",qn,aT,V0],ae=()=>["solid","dashed","dotted","double"],te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[qn,nQ,tRe,eRe],ie=()=>["","none",m,kr,vr],he=()=>["none",qn,kr,vr],X=()=>["none",qn,kr,vr],se=()=>[qn,kr,vr],le=()=>[nb,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Jg],breakpoint:[Jg],color:[rdt],container:[Jg],"drop-shadow":[Jg],ease:["in","out","in-out"],font:[LDr],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Jg],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Jg],shadow:[Jg],spacing:["px",qn],text:[Jg],"text-shadow":[Jg],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",nb,vr,kr,y]}],container:["container"],columns:[{columns:[qn,vr,kr,l]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"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"],sr:["sr-only","not-sr-only"],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:_()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:N()}],"inset-x":[{"inset-x":N()}],"inset-y":[{"inset-y":N()}],start:[{"inset-s":N(),start:N()}],end:[{"inset-e":N(),end:N()}],"inset-bs":[{"inset-bs":N()}],"inset-be":[{"inset-be":N()}],top:[{top:N()}],right:[{right:N()}],bottom:[{bottom:N()}],left:[{left:N()}],visibility:["visible","invisible","collapse"],z:[{z:[sb,"auto",kr,vr]}],basis:[{basis:[nb,"full","auto",l,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qn,nb,"auto","initial","none",vr]}],grow:[{grow:["",qn,kr,vr]}],shrink:[{shrink:["",qn,kr,vr]}],order:[{order:[sb,"first","last","none",kr,vr]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:P()}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:P()}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":B()}],"auto-rows":[{"auto-rows":B()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...D(),"normal"]}],"justify-items":[{"justify-items":[...$(),"normal"]}],"justify-self":[{"justify-self":["auto",...$()]}],"align-content":[{content:["normal",...D()]}],"align-items":[{items:[...$(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...$(),{baseline:["","last"]}]}],"place-content":[{"place-content":D()}],"place-items":[{"place-items":[...$(),"baseline"]}],"place-self":[{"place-self":["auto",...$()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:U()}],mx:[{mx:U()}],my:[{my:U()}],ms:[{ms:U()}],me:[{me:U()}],mbs:[{mbs:U()}],mbe:[{mbe:U()}],mt:[{mt:U()}],mr:[{mr:U()}],mb:[{mb:U()}],ml:[{ml:U()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],"inline-size":[{inline:["auto",...H()]}],"min-inline-size":[{"min-inline":["auto",...H()]}],"max-inline-size":[{"max-inline":["none",...H()]}],"block-size":[{block:["auto",...Q()]}],"min-block-size":[{"min-block":["auto",...Q()]}],"max-block-size":[{"max-block":["none",...Q()]}],w:[{w:[l,"screen",...z()]}],"min-w":[{"min-w":[l,"screen","none",...z()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...z()]}],h:[{h:["screen","lh",...z()]}],"min-h":[{"min-h":["screen","lh","none",...z()]}],"max-h":[{"max-h":["screen","lh",...z()]}],"font-size":[{text:["base",r,aT,V0]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,HDr,FDr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",nQ,vr]}],"font-family":[{font:[UDr,zDr,t]}],"font-features":[{"font-features":[vr]}],"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:[s,kr,vr]}],"line-clamp":[{"line-clamp":[qn,"none",kr,JIe]}],leading:[{leading:[a,...j()]}],"list-image":[{"list-image":["none",kr,vr]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",kr,vr]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[qn,"from-font","auto",kr,V0]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[qn,"auto",kr,vr]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",kr,vr]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",kr,vr]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Z()}],"bg-repeat":[{bg:V()}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},sb,kr,vr],radial:["",kr,vr],conic:[sb,kr,vr]},qDr,BDr]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:G()}],"rounded-s":[{"rounded-s":G()}],"rounded-e":[{"rounded-e":G()}],"rounded-t":[{"rounded-t":G()}],"rounded-r":[{"rounded-r":G()}],"rounded-b":[{"rounded-b":G()}],"rounded-l":[{"rounded-l":G()}],"rounded-ss":[{"rounded-ss":G()}],"rounded-se":[{"rounded-se":G()}],"rounded-ee":[{"rounded-ee":G()}],"rounded-es":[{"rounded-es":G()}],"rounded-tl":[{"rounded-tl":G()}],"rounded-tr":[{"rounded-tr":G()}],"rounded-br":[{"rounded-br":G()}],"rounded-bl":[{"rounded-bl":G()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-bs":[{"border-bs":J()}],"border-w-be":[{"border-be":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ae(),"hidden","none"]}],"divide-style":[{divide:[...ae(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qn,kr,vr]}],"outline-w":[{outline:["",qn,aT,V0]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",d,KD,XD]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",f,KD,XD]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[qn,V0]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",h,KD,XD]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[qn,kr,vr]}],"mix-blend":[{"mix-blend":[...te(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":te()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[qn]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[kr,vr]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":k()}],"mask-image-conic-pos":[{"mask-conic":[qn]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Z()}],"mask-repeat":[{mask:V()}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",kr,vr]}],filter:[{filter:["","none",kr,vr]}],blur:[{blur:ie()}],brightness:[{brightness:[qn,kr,vr]}],contrast:[{contrast:[qn,kr,vr]}],"drop-shadow":[{"drop-shadow":["","none",p,KD,XD]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",qn,kr,vr]}],"hue-rotate":[{"hue-rotate":[qn,kr,vr]}],invert:[{invert:["",qn,kr,vr]}],saturate:[{saturate:[qn,kr,vr]}],sepia:[{sepia:["",qn,kr,vr]}],"backdrop-filter":[{"backdrop-filter":["","none",kr,vr]}],"backdrop-blur":[{"backdrop-blur":ie()}],"backdrop-brightness":[{"backdrop-brightness":[qn,kr,vr]}],"backdrop-contrast":[{"backdrop-contrast":[qn,kr,vr]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qn,kr,vr]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qn,kr,vr]}],"backdrop-invert":[{"backdrop-invert":["",qn,kr,vr]}],"backdrop-opacity":[{"backdrop-opacity":[qn,kr,vr]}],"backdrop-saturate":[{"backdrop-saturate":[qn,kr,vr]}],"backdrop-sepia":[{"backdrop-sepia":["",qn,kr,vr]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",kr,vr]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qn,"initial",kr,vr]}],ease:[{ease:["linear","initial",x,kr,vr]}],delay:[{delay:[qn,kr,vr]}],animate:[{animate:["none",w,kr,vr]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,kr,vr]}],"perspective-origin":[{"perspective-origin":_()}],rotate:[{rotate:he()}],"rotate-x":[{"rotate-x":he()}],"rotate-y":[{"rotate-y":he()}],"rotate-z":[{"rotate-z":he()}],scale:[{scale:X()}],"scale-x":[{"scale-x":X()}],"scale-y":[{"scale-y":X()}],"scale-z":[{"scale-z":X()}],"scale-3d":["scale-3d"],skew:[{skew:se()}],"skew-x":[{"skew-x":se()}],"skew-y":[{"skew-y":se()}],transform:[{transform:[kr,vr,"","none","gpu","cpu"]}],"transform-origin":[{origin:_()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:le()}],"translate-x":[{"translate-x":le()}],"translate-y":[{"translate-y":le()}],"translate-z":[{"translate-z":le()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",kr,vr]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",kr,vr]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[qn,aT,V0,JIe]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","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-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},WDr=(e,{cacheSize:t,prefix:r,experimentalParseClassName:n,extend:s={},override:a={}})=>(HT(e,"cacheSize",t),HT(e,"prefix",r),HT(e,"experimentalParseClassName",n),JD(e.theme,a.theme),JD(e.classGroups,a.classGroups),JD(e.conflictingClassGroups,a.conflictingClassGroups),JD(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),HT(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),eL(e.theme,s.theme),eL(e.classGroups,s.classGroups),eL(e.conflictingClassGroups,s.conflictingClassGroups),eL(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),udt(e,s,"orderSensitiveModifiers"),e),HT=(e,t,r)=>{r!==void 0&&(e[t]=r)},JD=(e,t)=>{if(t)for(const r in t)HT(e,r,t[r])},eL=(e,t)=>{if(t)for(const r in t)udt(e,t,r)},udt=(e,t,r)=>{const n=t[r];n!==void 0&&(e[r]=e[r]?e[r].concat(n):n)},GDr=(e,...t)=>typeof e=="function"?KIe(rRe,e,...t):KIe(()=>WDr(rRe(),e),...t),ZDr=Object.keys({...ky,...W9t}),YDr=Object.keys(J9t),XDr=Object.keys(G9t),KDr=Object.keys(Z9t),JDr=Object.keys(Q9t),q0=Object.keys(K9t),eLr=Object.keys(Y9t).concat(Object.keys(X9t)),tLr=GDr({extend:{theme:{color:ZDr,spacing:YDr,radius:JDr,leading:KDr,shadow:eLr},classGroups:{"font-size":[{text:XDr}],h:[{h:q0}],w:[{w:q0}],size:[{size:q0}],"min-h":[{"min-h":q0}],"min-w":[{"min-w":q0}],"max-h":[{"max-h":q0}],"max-w":[{"max-w":q0}]}}});function Y(...e){return tLr(Zut(e))}const ad=u4t,Yr=d4t,Xr=f4t,Wr=b.forwardRef(({className:e,sideOffset:t=4,children:r,...n},s)=>o.jsx(h4t,{children:o.jsxs(Iqe,{ref:s,sideOffset:t,className:Y("z-50 overflow-hidden rounded-md bg-surface3 px-3 py-1.5 text-xs text-neutral4 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,children:[r,o.jsx(p4t,{className:"fill-surface3"})]})}));Wr.displayName=Iqe.displayName;const rLr={sm:"[&>svg]:h-icon-sm [&>svg]:w-icon-sm",default:"[&>svg]:h-icon-default [&>svg]:w-icon-default",lg:"[&>svg]:h-icon-lg [&>svg]:w-icon-lg"},Ce=({children:e,className:t,size:r="default",...n})=>o.jsx("span",{className:Y("block",rLr[r],t),...n,children:e}),lc={sm:"h-form-sm",md:"h-form-md",default:"h-form-default",lg:"h-form-lg"},F9="focus:outline-hidden focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring transition-shadow duration-normal",nLr="focus-within:outline-hidden focus-within:ring-1 focus-within:ring-accent1 focus-within:shadow-focus-ring transition-shadow duration-normal",sLr="rounded-md",ddt="bg-surface2 border-2 border-border1 text-neutral5 hover:text-neutral6 hover:border-border2 rounded-lg",cme="outline-hidden focus-visible:outline-hidden focus-visible:border-accent1 focus-visible:ring-1 focus-visible:ring-accent1/40",ume="disabled:opacity-50 disabled:cursor-not-allowed",tL=Y("gap-[.75em] rounded-lg","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:mx-[-.3em]","[&>svg]:opacity-50 [&:hover>svg]:opacity-100"),pC=x1(Y("inline-flex items-center justify-center leading-0","transition-all duration-normal ease-out-custom",ume,cme),{variants:{variant:{default:"bg-surface3 border-2 border-border1 hover:bg-surface5 hover:text-neutral6 active:bg-surface6 text-neutral6",primary:"bg-surface4 border-2 border-border2 hover:bg-surface5 hover:text-neutral6 active:bg-surface6 text-neutral6",cta:"bg-accent1 border-2 border-transparent hover:bg-accent1/90 hover:shadow-glow-accent1 disabled:hover:shadow-none text-surface1 font-medium",ghost:"bg-transparent border-2 border-transparent hover:bg-surface4 hover:text-neutral6 active:bg-surface5 text-neutral4",outline:"bg-transparent border-2 border-border1 hover:bg-surface3 hover:text-neutral6 active:bg-surface4 text-neutral5",link:"inline-flex justify-start rounded-none h-auto px-0 bg-transparent text-neutral3 hover:text-neutral4 gap-1 [&>svg]:mx-0 w-auto [&>svg]:opacity-70"},size:{sm:Y(`${lc.sm} text-ui-sm px-[.75em]`,tL),md:Y(`${lc.md} text-ui-md px-[.75em]`,tL),default:Y(`${lc.default} text-ui-md px-[.85em]`,tL),lg:Y(`${lc.lg} text-ui-lg px-[1em]`,tL),"icon-sm":`${lc.sm} w-form-sm rounded-md`,"icon-md":`${lc.md} w-form-md rounded-md`,"icon-lg":`${lc.lg} w-form-lg rounded-md`}},defaultVariants:{variant:"default",size:"default"}}),aLr={"icon-sm":"sm","icon-md":"default","icon-lg":"lg"};function fdt(e){const t=[];return je.Children.forEach(e,r=>{je.isValidElement(r)&&r.type===je.Fragment?t.push(...fdt(r.props.children)):t.push(r)}),t}function iLr(e){const t=fdt(e);return t.length>0&&t.every(r=>je.isValidElement(r))}function oLr(e){return typeof e=="string"&&e.startsWith("icon-")}const ce=je.forwardRef(({className:e,as:t,size:r,variant:n="default",disabled:s,children:a,tooltip:i,"aria-label":l,...c},u)=>{const d=t||"button",f=oLr(r),h=r??"default",p=!f&&iLr(a),m=l??((f||p)&&typeof i=="string"?i:void 0),g=f?o.jsx(Ce,{size:aLr[r],children:a}):a,y=o.jsx(d,{ref:u,disabled:s,"aria-label":m,className:Y(pC({variant:n,size:h}),p&&"[&>svg]:opacity-75",e),...c,children:g});return i?o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:y}),o.jsx(Wr,{children:i})]}):y});ce.displayName="Button";const Ln=je.forwardRef(({tooltipContent:e,...t},r)=>o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(ce,{ref:r,...t})}),e&&o.jsx(Wr,{children:e})]}));Ln.displayName="ButtonWithTooltip";const ln={colors:"transition-colors duration-normal ease-out-custom",all:"transition-all duration-normal ease-out-custom",opacity:"transition-opacity duration-normal ease-out-custom",allSlow:"transition-all duration-slow ease-out-custom"},i0={visible:"focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-accent1 focus-visible:shadow-focus-ring"},hdt=({children:e})=>o.jsx("nav",{className:"bg-surface2 min-h-full overflow-hidden",children:e}),R5=({children:e,as:t="a",href:r,className:n,prefetch:s,to:a})=>o.jsx(t,{href:r,prefetch:s,to:a,className:Y("text-ui-sm flex h-full w-full flex-col justify-center font-medium cursor-pointer",ln.colors,n),children:e}),pdt=({children:e})=>o.jsx("ol",{"data-testid":"thread-list",children:e}),P5=({children:e,isActive:t,className:r})=>o.jsx("li",{className:Y("border-b border-border1 group flex h-[54px] items-center justify-between gap-2 px-3 py-2",ln.colors,"hover:bg-surface3",t&&"bg-accent1Dark",r),children:e}),mdt=({onClick:e})=>o.jsx(ce,{variant:"ghost",className:Y("shrink-0 opacity-0",ln.all,"group-focus-within:opacity-100 group-hover:opacity-100","hover:bg-surface4 hover:text-accent2"),onClick:e,children:o.jsx(Ce,{children:o.jsx(Wl,{"aria-label":"delete thread",className:"text-neutral3 hover:text-accent2 transition-colors"})})}),lLr={"ui-xs":"text-ui-xs leading-ui-xs","ui-sm":"text-ui-sm leading-ui-sm","ui-smd":"text-ui-smd leading-ui-smd","ui-md":"text-ui-md leading-ui-md","ui-lg":"text-ui-lg leading-ui-lg","header-xs":"text-header-xs leading-header-xs","header-sm":"text-header-sm leading-header-sm","header-md":"text-header-md leading-header-md","header-lg":"text-header-lg leading-header-lg","header-xl":"text-header-xl leading-header-xl"},cLr={mono:"font-mono"},me=({as:e="p",className:t,variant:r="ui-md",font:n,...s})=>o.jsx(e,{className:Y(lLr[r],n&&cLr[n],t),...s}),uLr={sm:"h-avatar-sm w-avatar-sm",md:"h-avatar-md w-avatar-md",lg:"h-avatar-lg w-avatar-lg"},gdt=({src:e,name:t,size:r="sm",interactive:n=!1})=>o.jsx("div",{className:Y(uLr[r],"border border-border1 bg-surface3 shrink-0 overflow-hidden rounded-full flex items-center justify-center",ln.all,n&&"cursor-pointer hover:scale-105 hover:border-neutral2 hover:shadow-sm"),children:e?o.jsx("img",{src:e,alt:t,className:"h-full w-full object-cover"}):o.jsx(me,{variant:"ui-md",className:"text-center text-neutral4",children:t[0].toUpperCase()})}),dLr={default:"text-neutral3 bg-surface4",success:"text-accent1 bg-accent1Dark",error:"text-accent2 bg-accent2Dark",info:"text-accent5 bg-accent5Dark",warning:"text-accent6 bg-accent6Dark"},fLr={default:"text-neutral3",success:"text-accent1",error:"text-accent2",info:"text-accent5",warning:"text-accent6"},vt=({icon:e,variant:t="default",className:r,children:n,...s})=>o.jsxs("div",{className:Y("font-mono text-ui-sm gap-1 h-badge-default inline-flex items-center rounded-full border border-border1 shrink-0",ln.colors,e?"pl-2 pr-2.5":"px-2.5",t==="default"&&e?"bg-surface4 text-neutral5":dLr[t],r),...s,children:[e&&o.jsx("span",{className:fLr[t],children:o.jsx(Ce,{children:e})}),n]}),hLr=e=>o.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{d:"M5.25684 12.6387L10.4003 3.36133H11.7432L6.5997 12.6387H5.25684Z",fill:"currentColor"})}),Xa=({children:e,label:t})=>o.jsx("nav",{"aria-label":t,children:o.jsx("ol",{className:"gap-0.5 flex items-center",children:e})}),jr=({className:e,as:t,isCurrent:r,action:n,...s})=>{const a=t||"span";return o.jsxs(o.Fragment,{children:[o.jsxs("li",{className:"flex h-full shrink-0 items-center gap-1",children:[o.jsx(a,{"aria-current":r?"page":void 0,className:Y("text-ui-md leading-ui-md flex items-center gap-2",ln.colors,r?"text-white":"text-neutral3 hover:text-neutral5",e),...s}),n]}),!r&&o.jsx("li",{role:"separator",className:"flex h-full items-center",children:o.jsx(Ce,{className:Y("text-neutral2",ln.colors),children:o.jsx(hLr,{})})})]})};function pLr(e,t=5){if(!e?.properties)return[];const r=[];function n(s,a,i){if(i>t)return;const l=Array.isArray(s.type)?s.type.join(" | "):s.type;if(r.push({path:a,label:a,description:s.description??s.title,type:l}),s.properties)for(const[c,u]of Object.entries(s.properties))n(u,`${a}.${c}`,i+1);if(s.items?.properties)for(const[c,u]of Object.entries(s.items.properties))n(u,`${a}[].${c}`,i+1)}for(const[s,a]of Object.entries(e.properties))n(a,s,1);return r}function mLr(e){const t=pLr(e);return XWe({override:[gLr(t)],defaultKeymap:!0,closeOnBlur:!0,icons:!1})}function gLr(e){return t=>{const n=t.state.sliceDoc(Math.max(0,t.pos-50),t.pos).match(/\{\{([a-zA-Z0-9_.\[\]]*)?$/);if(!n)return null;const s=n[1]??"",a=t.pos-s.length,i=s?e.filter(c=>c.path.toLowerCase().startsWith(s.toLowerCase())):e;if(i.length===0)return null;const l=i.map(c=>({label:c.path,displayLabel:c.path,detail:c.type,info:c.description,apply:(u,d,f,h)=>{const g=u.state.sliceDoc(h,h+2)==="}}"?d.label:`${d.label}}}`;u.dispatch({changes:{from:f,to:h,insert:g},selection:{anchor:f+g.length}})}}));return{from:a,options:l,validFor:/^[a-zA-Z0-9_.\[\]]*$/}}}const yLr=/\{\{([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\}\}/g,vLr=er.mark({class:"cm-variable-highlight"}),nRe=new dWe({regexp:yLr,decoration:()=>vLr}),bLr=Oi.fromClass(class{decorations;constructor(e){this.decorations=nRe.createDeco(e)}update(e){this.decorations=nRe.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}),xLr=bLr,ga=e=>o.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.5 15C10.3565 15 12.137 14.2625 13.4497 12.9497C14.7625 11.637 15.5 9.85652 15.5 8C15.5 6.14348 14.7625 4.36301 13.4497 3.05025C12.137 1.7375 10.3565 1 8.5 1C6.64348 1 4.86301 1.7375 3.55025 3.05025C2.2375 4.36301 1.5 6.14348 1.5 8C1.5 9.85652 2.2375 11.637 3.55025 12.9497C4.86301 14.2625 6.64348 15 8.5 15ZM5.621 10.879L4.611 11.889C3.84179 11.1198 3.31794 10.1398 3.1057 9.07291C2.89346 8.00601 3.00236 6.90013 3.41864 5.89512C3.83491 4.89012 4.53986 4.03112 5.44434 3.42676C6.34881 2.8224 7.41219 2.49983 8.5 2.49983C9.58781 2.49983 10.6512 2.8224 11.5557 3.42676C12.4601 4.03112 13.1651 4.89012 13.5814 5.89512C13.9976 6.90013 14.1065 8.00601 13.8943 9.07291C13.6821 10.1398 13.1582 11.1198 12.389 11.889L11.379 10.879C11.1004 10.6003 10.7696 10.3792 10.4055 10.2284C10.0414 10.0776 9.6511 9.99995 9.257 10H7.743C7.3489 9.99995 6.95865 10.0776 6.59455 10.2284C6.23045 10.3792 5.89963 10.6003 5.621 10.879Z",fill:"currentColor"}),o.jsx("path",{d:"M8.5 4C7.96957 4 7.46086 4.21071 7.08579 4.58579C6.71071 4.96086 6.5 5.46957 6.5 6V6.5C6.5 7.03043 6.71071 7.53914 7.08579 7.91421C7.46086 8.28929 7.96957 8.5 8.5 8.5C9.03043 8.5 9.53914 8.28929 9.91421 7.91421C10.2893 7.53914 10.5 7.03043 10.5 6.5V6C10.5 5.46957 10.2893 4.96086 9.91421 4.58579C9.53914 4.21071 9.03043 4 8.5 4Z",fill:"currentColor"})]}),wLr=e=>o.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{d:"M11.0313 7.97578C11.0313 9.34436 9.92183 10.4538 8.55324 10.4538C7.18466 10.4538 6.0752 9.34436 6.0752 7.97578C6.0752 6.60719 7.18466 5.49773 8.55324 5.49773C9.92183 5.49773 11.0313 6.60719 11.0313 7.97578ZM11.0313 7.97578H14.573",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round"}),o.jsx("path",{d:"M12.967 4.46154C11.9273 3.14431 10.3165 2.29883 8.50814 2.29883C5.37277 2.29883 2.83105 4.84055 2.83105 7.97591C2.83105 11.1113 5.37277 13.653 8.50814 13.653C10.3165 13.653 11.9273 12.8075 12.967 11.4903",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round"})]}),dme=e=>o.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.99982 2.0625C3.8252 2.0625 2.06232 3.82538 2.06232 6C2.06232 8.17462 3.8252 9.9375 5.99982 9.9375C8.17444 9.9375 9.93732 8.17462 9.93732 6C9.93732 3.82538 8.17444 2.0625 5.99982 2.0625ZM0.937317 6C0.937317 3.20406 3.20388 0.9375 5.99982 0.9375C8.79576 0.9375 11.0623 3.20406 11.0623 6C11.0623 8.79594 8.79576 11.0625 5.99982 11.0625C3.20388 11.0625 0.937317 8.79594 0.937317 6Z",fill:"currentColor"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.97865 4.57004C8.22604 4.75795 8.27426 5.11082 8.08635 5.35821L6.05486 8.03279C5.94873 8.17251 5.78348 8.25471 5.60803 8.25505C5.43257 8.2554 5.267 8.17385 5.16032 8.03454L3.80937 6.27034C3.6205 6.02369 3.66733 5.67063 3.91398 5.48176C4.16063 5.29288 4.51369 5.33972 4.70257 5.58637L5.6051 6.76498L7.19048 4.67774C7.37839 4.43036 7.73126 4.38213 7.97865 4.57004Z",fill:"currentColor"})]}),fme=e=>o.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.99982 2.0625C3.8252 2.0625 2.06232 3.82538 2.06232 6C2.06232 8.17462 3.8252 9.9375 5.99982 9.9375C8.17444 9.9375 9.93732 8.17462 9.93732 6C9.93732 3.82538 8.17444 2.0625 5.99982 2.0625ZM0.937317 6C0.937317 3.20406 3.20388 0.9375 5.99982 0.9375C8.79576 0.9375 11.0623 3.20406 11.0623 6C11.0623 8.79594 8.79576 11.0625 5.99982 11.0625C3.20388 11.0625 0.937317 8.79594 0.937317 6Z",fill:"currentColor"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.89741 4.10293C8.11707 4.32261 8.11706 4.67877 7.89738 4.89843L6.79517 6.00058L7.8962 7.10155C8.11588 7.32122 8.11589 7.67737 7.89623 7.89705C7.67656 8.11673 7.32041 8.11674 7.10073 7.89707L5.99965 6.79605L4.89856 7.89707C4.67889 8.11673 4.32273 8.11672 4.10307 7.89704C3.88341 7.67737 3.88342 7.32121 4.10309 7.10155L5.20413 6.00058L4.10191 4.89843C3.88224 4.67877 3.88223 4.32262 4.10189 4.10294C4.32155 3.88326 4.67771 3.88325 4.89738 4.10292L5.99965 5.20511L7.10191 4.10291C7.32159 3.88325 7.67774 3.88326 7.89741 4.10293Z",fill:"currentColor"})]}),o0=e=>o.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.1747 3.18598L7.02554 1.95209C7.11557 1.89207 7.31087 1.87106 7.41016 1.90924L12.4139 3.83377C12.4683 3.85467 12.546 3.96798 12.546 4.03118V13.0167C12.546 13.265 12.7473 13.4663 12.9956 13.4663C13.2439 13.4663 13.4452 13.265 13.4452 13.0167V4.03118C13.4452 3.59605 13.1384 3.14906 12.7367 2.99456L7.73293 1.07004C7.36225 0.927472 6.86056 0.981451 6.52679 1.20396L4.20445 2.75219L3.90419 2.95236L3.90647 2.95824C3.69329 3.05449 3.55469 3.27599 3.55469 3.57581V11.7119C3.55469 12.2084 3.93067 12.7499 4.39251 12.9206L9.89804 14.955C10.3608 15.126 10.7359 14.8596 10.7359 14.3659V5.83295C10.7359 5.33662 10.3498 4.81289 9.88389 4.66643L5.1747 3.18598Z",fill:"currentColor"})}),ydt=e=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("g",{clipPath:"url(#clip0_21999_22095)",children:o.jsx("path",{d:"M7.5 0.75C3.6325 0.75 0.5 3.8825 0.5 7.75C0.5 10.8475 2.50375 13.4637 5.28625 14.3912C5.63625 14.4525 5.7675 14.2425 5.7675 14.0587C5.7675 13.8925 5.75875 13.3412 5.75875 12.755C4 13.0787 3.545 12.3262 3.405 11.9325C3.32625 11.7312 2.985 11.11 2.6875 10.9437C2.4425 10.8125 2.0925 10.4887 2.67875 10.48C3.23 10.4712 3.62375 10.9875 3.755 11.1975C4.385 12.2562 5.39125 11.9587 5.79375 11.775C5.855 11.32 6.03875 11.0137 6.24 10.8387C4.6825 10.6637 3.055 10.06 3.055 7.3825C3.055 6.62125 3.32625 5.99125 3.7725 5.50125C3.7025 5.32625 3.4575 4.60875 3.8425 3.64625C3.8425 3.64625 4.42875 3.4625 5.7675 4.36375C6.3275 4.20625 6.9225 4.1275 7.5175 4.1275C8.1125 4.1275 8.7075 4.20625 9.2675 4.36375C10.6062 3.45375 11.1925 3.64625 11.1925 3.64625C11.5775 4.60875 11.3325 5.32625 11.2625 5.50125C11.7087 5.99125 11.98 6.6125 11.98 7.3825C11.98 10.0687 10.3438 10.6637 8.78625 10.8387C9.04 11.0575 9.25875 11.4775 9.25875 12.1337C9.25875 13.07 9.25 13.8225 9.25 14.0587C9.25 14.2425 9.38125 14.4612 9.73125 14.3912C11.1209 13.9221 12.3284 13.029 13.1839 11.8377C14.0393 10.6463 14.4996 9.21668 14.5 7.75C14.5 3.8825 11.3675 0.75 7.5 0.75Z",fill:"currentColor"})}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_21999_22095",children:o.jsx("rect",{width:"14",height:"14",fill:"currentColor",transform:"translate(0.5 0.75)"})})})]}),vdt=e=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsxs("g",{clipPath:"url(#clip0_21999_20513)",children:[o.jsx("path",{d:"M13.5037 7.54867C13.5037 7.1144 13.4648 6.69683 13.3924 6.29596H7.62436V8.66776H10.9204C10.7756 9.43052 10.3413 10.0764 9.68994 10.5106V12.0529H11.6776C12.8356 10.9839 13.5037 9.41382 13.5037 7.54867Z",fill:"#4285F4"}),o.jsx("path",{d:"M7.62415 13.5339C9.27773 13.5339 10.6643 12.9882 11.6776 12.0529L9.68994 10.5106C9.14431 10.8781 8.44816 11.1009 7.62415 11.1009C6.03182 11.1009 4.67889 10.0263 4.19451 8.57877H2.15677V10.16C3.1645 12.1587 5.23008 13.5339 7.62415 13.5339Z",fill:"#34A853"}),o.jsx("path",{d:"M4.19472 8.57315C4.07223 8.20569 3.99985 7.81595 3.99985 7.40952C3.99985 7.00308 4.07223 6.61335 4.19472 6.24589V4.66469H2.15698C1.73941 5.4887 1.5 6.41849 1.5 7.40952C1.5 8.40055 1.73941 9.33034 2.15698 10.1543L3.74374 8.91834L4.19472 8.57315Z",fill:"#FBBC05"}),o.jsx("path",{d:"M7.62415 3.72376C8.5261 3.72376 9.32783 4.03555 9.96811 4.63685L11.7219 2.88306C10.6585 1.89202 9.27773 1.28516 7.62415 1.28516C5.23008 1.28516 3.16471 2.66036 2.15698 4.66469L4.19472 6.24589C4.6791 4.79832 6.03182 3.72376 7.62415 3.72376Z",fill:"#EA4335"})]}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_21999_20513",children:o.jsx("rect",{width:"12.2487",height:"12.2487",fill:"white",transform:"translate(1.375 1.28516)"})})})]}),SLr=e=>o.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{d:"M4.31445 3.16083C3.78402 3.16083 3.27531 3.37154 2.90024 3.74661C2.52517 4.12169 2.31445 4.63039 2.31445 5.16083V5.66083C2.31445 6.19126 2.52517 6.69997 2.90024 7.07504C3.27531 7.45011 3.78402 7.66083 4.31445 7.66083C4.84489 7.66083 5.35359 7.45011 5.72867 7.07504C6.10374 6.69997 6.31445 6.19126 6.31445 5.66083V5.16083C6.31445 4.63039 6.10374 4.12169 5.72867 3.74661C5.35359 3.37154 4.84489 3.16083 4.31445 3.16083Z",fill:"currentColor"}),o.jsx("path",{d:"M6.76666 9.50235C6.57678 9.28532 6.30244 9.16083 6.01407 9.16083H4.50201C4.10791 9.16078 3.71766 9.23838 3.35356 9.38921C3.11733 9.48706 2.8951 9.6145 2.69205 9.76806C2.48056 9.928 2.38001 10.1888 2.38001 10.454V13.0642C2.38001 13.6165 2.82773 14.0642 3.38001 14.0642H8.55436C9.4135 14.0642 9.87269 13.0523 9.30695 12.4057L6.76666 9.50235Z",fill:"currentColor"}),o.jsx("rect",{x:"7.92188",y:"6.46759",width:"1.41089",height:"1.56773",rx:"0.705445",fill:"currentColor"}),o.jsx("rect",{x:"10.4258",y:"4.35107",width:"1.41089",height:"3.72998",rx:"0.705445",fill:"currentColor"}),o.jsx("rect",{x:"12.9287",y:"2.23419",width:"1.41089",height:"5.75781",rx:"0.705445",fill:"currentColor"})]}),z9=e=>o.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{d:"M3.8674 9.19968L4.14554 10.8649C4.23965 11.4283 4.75254 11.8237 5.32137 11.7713L5.58252 11.7472C6.56555 11.6567 7.43309 12.3868 7.51181 13.3708L7.59308 14.3867C7.60422 14.5259 7.71868 14.6342 7.85825 14.6376L9.91053 14.6876C10.1066 14.6924 10.2434 14.4948 10.17 14.3129L8.90452 11.1782C8.80956 10.9429 8.65085 10.7389 8.44626 10.5889L7.90134 10.1895C7.70604 10.0464 7.55223 9.85411 7.45759 9.63124C7.15011 8.90712 6.6579 7.71234 6.37054 6.88944C6.19204 6.3783 5.79931 6.29158 5.45492 6.21553C4.98179 6.11106 4.5999 6.02673 4.99001 4.88985C5.66408 2.92541 8.06015 2.07904 10.6601 3.33088C12.6488 4.2884 13.1187 6.35416 13.0328 7.58237C13.0297 7.62768 13.0214 7.67186 13.0094 7.71566C12.8829 8.17534 12.368 8.40491 11.9415 8.19169L10.3022 7.37201C10.2069 7.32439 10.0927 7.33657 10.0096 7.40322L8.64809 8.49559C8.55405 8.57104 8.52072 8.69931 8.56615 8.811L10.8995 14.5478C10.9404 14.6483 11.0369 14.715 11.1454 14.7177L12.0572 14.7399C12.2581 14.7448 12.3951 14.5382 12.3124 14.3551L11.8681 13.3706C11.4211 12.3803 11.6047 11.2192 12.3354 10.4151L13.4616 9.17575C13.7473 8.86125 13.9224 8.46187 13.9599 8.03858L13.9763 7.85359C14.2866 4.35298 11.377 1.41272 7.87336 1.68639C6.03919 1.82965 4.45399 3.02228 3.80807 4.74492L3.70275 5.02579C3.5828 5.34571 3.62741 5.70411 3.82213 5.98485L3.88946 6.08192C4.12183 6.41695 4.0958 6.86726 3.82637 7.17328L3.06705 8.03572C2.96261 8.15435 2.98058 8.33664 3.10617 8.43259L3.66059 8.85617C3.77064 8.94026 3.84458 9.06307 3.8674 9.19968Z",fill:"currentColor"})}),hme=e=>o.jsx("svg",{width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.40864 11.9983C7.58064 11.9733 6.84164 11.6153 6.31564 11.0563C6.31464 11.0563 6.31464 11.0553 6.31464 11.0553C5.78864 10.4963 5.47564 9.73633 5.50064 8.90833C5.52564 8.08033 5.88464 7.34133 6.44364 6.81533C7.00264 6.28833 7.76264 5.97633 8.59064 6.00133C9.41864 6.02633 10.1576 6.38433 10.6836 6.94333H10.6846C11.2106 7.50333 11.5236 8.26233 11.4986 9.09033C11.4726 9.91833 11.1146 10.6583 10.5556 11.1843C9.99664 11.7103 9.23664 12.0233 8.40864 11.9983ZM16.1266 8.15033L14.3606 7.74033C14.2316 7.14133 14.0146 6.57633 13.7216 6.05733L14.7726 4.57933C14.9116 4.38533 14.8926 4.12033 14.7296 3.94633L13.9206 3.08733C13.7576 2.91333 13.4946 2.87933 13.2916 3.00533L11.7526 3.96533C11.2526 3.64133 10.7016 3.39033 10.1116 3.22633L9.80964 1.43833C9.76964 1.20333 9.56964 1.02833 9.33164 1.02133L8.15264 0.985326C7.91364 0.978326 7.70364 1.14033 7.64964 1.37233L7.24064 3.13933C6.64164 3.26733 6.07664 3.48433 5.55664 3.77733L4.07864 2.72633C3.88464 2.58833 3.61964 2.60633 3.44664 2.76933L2.58664 3.57833C2.41364 3.74133 2.37964 4.00533 2.50564 4.20733L3.46564 5.74633C3.14164 6.24633 2.89064 6.79833 2.72564 7.38833L0.937635 7.68933C0.702635 7.72933 0.528635 7.92933 0.520635 8.16733L0.485635 9.34733C0.477635 9.58533 0.639635 9.79533 0.872635 9.84933L2.63864 10.2583C2.76764 10.8573 2.98464 11.4233 3.27764 11.9423L2.22564 13.4203C2.08764 13.6143 2.10564 13.8793 2.26964 14.0523L3.07864 14.9123C3.24164 15.0853 3.50464 15.1203 3.70664 14.9933L5.24564 14.0333C5.74663 14.3583 6.29764 14.6093 6.88764 14.7733L7.18964 16.5613C7.22864 16.7963 7.42864 16.9713 7.66764 16.9783L8.84663 17.0143C9.08564 17.0213 9.29564 16.8593 9.34964 16.6273L9.75864 14.8603C10.3576 14.7323 10.9226 14.5153 11.4416 14.2213L12.9206 15.2733C13.1146 15.4113 13.3786 15.3933 13.5526 15.2293L14.4116 14.4213C14.5856 14.2573 14.6196 13.9943 14.4936 13.7923L13.5336 12.2533C13.8576 11.7523 14.1086 11.2013 14.2726 10.6113L16.0616 10.3103C16.2966 10.2703 16.4706 10.0703 16.4776 9.83233L16.5136 8.65233C16.5206 8.41433 16.3586 8.20433 16.1266 8.15033Z",fill:"currentColor"})}),Mi=e=>o.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.5605 1.42351C8.0791 0.904904 8.92215 0.906157 9.4395 1.42351L10.6922 2.67617C11.2108 3.19477 11.2095 4.03782 10.6922 4.55517L9.4395 5.80783C8.9209 6.32643 8.07785 6.32518 7.5605 5.80783L6.30784 4.55517C5.78923 4.03656 5.79049 3.19352 6.30784 2.67617L7.5605 1.42351ZM3.17618 5.80783C3.69478 5.28923 4.53782 5.29048 5.05517 5.80783L6.30784 7.0605C6.82644 7.5791 6.82519 8.42214 6.30784 8.93949L5.05517 10.1922C4.53657 10.7108 3.69353 10.7095 3.17618 10.1922L1.92351 8.93949C1.40491 8.42089 1.40616 7.57785 1.92351 7.0605L3.17618 5.80783ZM11.9448 5.80783C12.4634 5.28923 13.3065 5.29048 13.8238 5.80783L15.0765 7.0605C15.5951 7.5791 15.5938 8.42214 15.0765 8.93949L13.8238 10.1922C13.3052 10.7108 12.4622 10.7095 11.9448 10.1922L10.6922 8.93949C10.1736 8.42089 10.1748 7.57785 10.6922 7.0605L11.9448 5.80783ZM7.5605 10.1922C8.0791 9.67355 8.92215 9.67481 9.4395 10.1922L10.6922 11.4448C11.2108 11.9634 11.2095 12.8065 10.6922 13.3238L9.4395 14.5765C8.9209 15.0951 8.07785 15.0938 7.5605 14.5765L6.30784 13.3238C5.78923 12.8052 5.79049 11.9622 6.30784 11.4448L7.5605 10.1922Z",fill:"currentColor"})}),mC=e=>o.jsx(q9t,{...e}),Di=e=>o.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.24388 2.4018C6.24388 2.0394 6.53767 1.74561 6.90008 1.74561H10.0991C10.4614 1.74561 10.7553 2.0394 10.7553 2.4018V4.57546C10.7553 4.93787 10.4614 5.23166 10.0991 5.23166H9.31982V7.35469L10.0033 9.22664C9.90442 9.20146 9.80035 9.1761 9.6915 9.14986L9.62652 9.13422C9.30473 9.05687 8.92256 8.96501 8.61993 8.84491C8.5819 8.82981 8.54147 8.81292 8.49957 8.79391C8.45767 8.81292 8.41724 8.82981 8.3792 8.84491C8.07657 8.96501 7.6944 9.05687 7.37261 9.13422L7.30763 9.14986C7.19879 9.1761 7.09471 9.20146 6.99577 9.22664L7.67932 7.35469V5.23166H6.90008C6.53767 5.23166 6.24388 4.93787 6.24388 4.57546V2.4018ZM6.99577 9.22664C6.99577 9.22664 6.99578 9.22664 6.99577 9.22664L6.43283 10.7683H6.81806C7.18047 10.7683 7.47426 11.0622 7.47426 11.4245V13.5982C7.47426 13.9606 7.18047 14.2544 6.81806 14.2544H3.61909C3.25668 14.2544 2.96289 13.9606 2.96289 13.5982V11.4245C2.96289 11.0622 3.25668 10.7683 3.61909 10.7683H4.26617C4.2921 10.4663 4.32783 10.1494 4.37744 9.85171C4.43762 9.49063 4.52982 9.08135 4.68998 8.76102C4.93975 8.2615 5.44743 8.01751 5.7771 7.88788C6.14684 7.74249 6.57537 7.63889 6.92317 7.55505C7.24707 7.47696 7.49576 7.41679 7.67932 7.35469L6.99577 9.22664ZM6.43283 10.7683L6.99577 9.22664C6.75846 9.28705 6.55067 9.34646 6.37745 9.41458C6.22784 9.47341 6.1623 9.51712 6.14023 9.53254C6.09752 9.63631 6.04409 9.83055 5.99562 10.1214C5.96201 10.3231 5.93498 10.5439 5.91341 10.7683H6.43283ZM10.0033 9.22664L9.31982 7.35469C9.50338 7.41679 9.75206 7.47696 10.076 7.55505C10.4238 7.63889 10.8523 7.74249 11.2221 7.88788C11.5517 8.01751 12.0594 8.2615 12.3091 8.76102C12.4693 9.08135 12.5615 9.49063 12.6217 9.85171C12.6713 10.1494 12.707 10.4663 12.733 10.7683H13.38C13.7424 10.7683 14.0362 11.0622 14.0362 11.4245V13.5982C14.0362 13.9606 13.7424 14.2544 13.38 14.2544H10.1811C9.81867 14.2544 9.52488 13.9606 9.52488 13.5982V11.4245C9.52488 11.0622 9.81867 10.7683 10.1811 10.7683H10.5663L10.0033 9.22664ZM10.0033 9.22664L10.5663 10.7683H11.0857C11.0642 10.5439 11.0372 10.3231 11.0035 10.1214C10.9551 9.83055 10.9016 9.63631 10.8589 9.53254C10.8369 9.51712 10.7713 9.47341 10.6217 9.41458C10.4485 9.34646 10.2407 9.28705 10.0033 9.22664Z",fill:"currentColor"})}),gl=e=>o.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{d:"M6.53918 9.32122C6.34324 9.51508 6.02724 9.51338 5.83338 9.31744C5.63952 9.1215 5.6412 8.80551 5.83713 8.61164L10.1958 4.29931C10.7996 3.70186 10.8017 2.72852 10.2041 2.12839L10.1899 2.11428C9.58767 1.52481 8.62251 1.53208 8.0292 2.13052L2.29396 7.91536C2.0999 8.1111 1.78388 8.11246 1.58813 7.9184C1.39239 7.72433 1.39103 7.40831 1.58509 7.21257L7.32036 1.42774C8.30005 0.439581 9.89369 0.427613 10.8881 1.40094L10.9116 1.42425C11.4942 2.00929 11.7316 2.80913 11.6232 3.56922C12.389 3.44866 13.1999 3.67918 13.7961 4.26273C14.804 5.24929 14.8147 6.86824 13.82 7.86808L8.5531 13.1619C8.50045 13.2148 8.50024 13.3002 8.55263 13.3534L9.65448 14.4717C9.84794 14.668 9.8456 14.984 9.64925 15.1775C9.45291 15.3709 9.13691 15.3686 8.94345 15.1723L7.84163 14.054C7.40505 13.6109 7.40677 12.8988 7.8455 12.4579L13.1124 7.16405C13.7161 6.55727 13.7095 5.57478 13.0979 4.97606C12.4925 4.38347 11.4942 4.40725 10.8978 5.00886L6.53918 9.32122Z",fill:"currentColor"}),o.jsx("path",{d:"M8.84622 2.75411C9.04697 2.56188 9.36555 2.56381 9.56395 2.76076C9.76234 2.95771 9.76658 3.27625 9.57582 3.4784L9.56661 3.48794L5.25912 7.82701C4.67023 8.42022 4.672 9.37798 5.26305 9.96904C5.85624 10.5622 6.81818 10.5615 7.41052 9.9675L11.6299 5.73599L11.6395 5.72671C11.8406 5.53493 12.1592 5.53756 12.3572 5.73496C12.5583 5.93548 12.5587 6.26104 12.3582 6.46214L8.13877 10.6937C7.14498 11.6903 5.53105 11.6915 4.53584 10.6963C3.5442 9.70461 3.54127 8.09774 4.52928 7.10248L8.83677 2.76342L8.84622 2.75411Z",fill:"currentColor"})]}),B9=e=>o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{d:"M1.5 8.5V8C1.5 7.60218 1.65804 7.22064 1.93934 6.93934C2.22064 6.65804 2.60218 6.5 3 6.5H13C13.3978 6.5 13.7794 6.65804 14.0607 6.93934C14.342 7.22064 14.5 7.60218 14.5 8V8.5M8.70667 4.20667L7.29333 2.79333C7.20048 2.70037 7.09022 2.62661 6.96886 2.57628C6.84749 2.52595 6.71739 2.50003 6.586 2.5H3C2.60218 2.5 2.22064 2.65804 1.93934 2.93934C1.65804 3.22064 1.5 3.60218 1.5 4V12C1.5 12.3978 1.65804 12.7794 1.93934 13.0607C2.22064 13.342 2.60218 13.5 3 13.5H13C13.3978 13.5 13.7794 13.342 14.0607 13.0607C14.342 12.7794 14.5 12.3978 14.5 12V6C14.5 5.60218 14.342 5.22064 14.0607 4.93934C13.7794 4.65804 13.3978 4.5 13 4.5H9.414C9.14887 4.49977 8.89402 4.39426 8.70667 4.20667Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})});function lp(e){return o.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("rect",{width:"16",height:"16",x:"4",y:"4",rx:"2"}),o.jsx("rect",{width:"6",height:"6",x:"9",y:"9",rx:"1"}),o.jsx("path",{d:"M15 2v2"}),o.jsx("path",{d:"M15 20v2"}),o.jsx("path",{d:"M2 15h2"}),o.jsx("path",{d:"M2 9h2"}),o.jsx("path",{d:"M20 15h2"}),o.jsx("path",{d:"M20 9h2"}),o.jsx("path",{d:"M9 2v2"}),o.jsx("path",{d:"M9 20v2"})]})}const bdt=e=>o.jsxs("svg",{className:"h-3 w-3",width:"16",height:"16",viewBox:"0 0 181 108",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsxs("g",{clipPath:"url(#clip0_1480_1723)",children:[o.jsx("path",{d:"M51.2203 39.3158C51.2203 41.5066 51.4572 43.2829 51.8717 44.5856C52.3453 45.8882 52.9374 47.3093 53.7664 48.8487C54.0624 49.3224 54.1809 49.7961 54.1809 50.2106C54.1809 50.8027 53.8256 51.3948 53.0559 51.9869L49.3256 54.4737C48.7927 54.829 48.2598 55.0066 47.7861 55.0066C47.194 55.0066 46.6019 54.7106 46.0098 54.1777C45.1809 53.2895 44.4703 52.3422 43.8782 51.3948C43.2861 50.3882 42.694 49.2632 42.0427 47.9014C37.4243 53.3487 31.6217 56.0724 24.6348 56.0724C19.6611 56.0724 15.694 54.6514 12.7927 51.8093C9.8914 48.9672 8.41113 45.1777 8.41113 40.4408C8.41113 35.4079 10.1874 31.3224 13.7993 28.2435C17.4111 25.1645 22.2072 23.6251 28.3059 23.6251C30.319 23.6251 32.3914 23.8027 34.5822 24.0987C36.773 24.3948 39.023 24.8685 41.3914 25.4014V21.079C41.3914 16.579 40.444 13.4408 38.6085 11.6053C36.7138 9.76979 33.5164 8.88163 28.9572 8.88163C26.8848 8.88163 24.7532 9.11847 22.5624 9.65137C20.3717 10.1843 18.2401 10.8356 16.1677 11.6645C15.2203 12.079 14.5098 12.3158 14.0953 12.4343C13.6809 12.5527 13.3848 12.6119 13.148 12.6119C12.319 12.6119 11.9046 12.0198 11.9046 10.7764V7.87505C11.9046 6.92768 12.023 6.21716 12.319 5.80268C12.6151 5.38821 13.148 4.97374 13.9769 4.55926C16.0493 3.49347 18.5361 2.60531 21.4374 1.89479C24.3388 1.12505 27.4177 0.769788 30.6743 0.769788C37.7203 0.769788 42.8717 2.36847 46.1875 5.56584C49.444 8.76321 51.1019 13.6185 51.1019 20.1316V39.3158H51.2203ZM27.1809 48.3158C29.1348 48.3158 31.148 47.9606 33.2796 47.2501C35.4111 46.5395 37.3059 45.2369 38.9046 43.4606C39.8519 42.3356 40.5625 41.0922 40.9177 39.6711C41.273 38.2501 41.5098 36.5329 41.5098 34.5198V32.0329C39.7927 31.6185 37.9572 31.2632 36.0624 31.0264C34.1677 30.7895 32.3322 30.6711 30.4967 30.6711C26.5296 30.6711 23.6282 31.4408 21.6743 33.0395C19.7203 34.6382 18.773 36.8882 18.773 39.8487C18.773 42.6316 19.4835 44.704 20.9638 46.1251C22.3848 47.6053 24.4572 48.3158 27.1809 48.3158ZM74.7269 54.7106C73.6611 54.7106 72.9506 54.5329 72.4769 54.1185C72.0032 53.7632 71.5888 52.9343 71.2335 51.8093L57.319 6.03953C56.9638 4.85531 56.7861 4.08558 56.7861 3.6711C56.7861 2.72374 57.2598 2.19084 58.2072 2.19084H64.0098C65.1348 2.19084 65.9046 2.36847 66.319 2.78295C66.7927 3.13821 67.148 3.96716 67.5032 5.09216L77.4506 44.2895L86.6874 5.09216C86.9835 3.90795 87.3388 3.13821 87.8124 2.78295C88.2861 2.42768 89.1151 2.19084 90.1809 2.19084H94.9177C96.0427 2.19084 96.8124 2.36847 97.2861 2.78295C97.7598 3.13821 98.1743 3.96716 98.4111 5.09216L107.766 44.7632L118.01 5.09216C118.365 3.90795 118.78 3.13821 119.194 2.78295C119.668 2.42768 120.437 2.19084 121.503 2.19084H127.01C127.957 2.19084 128.49 2.66453 128.49 3.6711C128.49 3.96716 128.431 4.26321 128.372 4.61847C128.312 4.97374 128.194 5.44742 127.957 6.09874L113.687 51.8685C113.332 53.0527 112.918 53.8224 112.444 54.1777C111.97 54.5329 111.201 54.7698 110.194 54.7698H105.102C103.977 54.7698 103.207 54.5922 102.733 54.1777C102.26 53.7632 101.845 52.9935 101.608 51.8093L92.4309 13.6185L83.3125 51.7501C83.0164 52.9343 82.6611 53.704 82.1874 54.1185C81.7138 54.5329 80.8848 54.7106 79.819 54.7106H74.7269ZM150.812 56.3093C147.734 56.3093 144.655 55.954 141.694 55.2435C138.733 54.5329 136.424 53.7632 134.885 52.8751C133.937 52.3422 133.286 51.7501 133.049 51.2172C132.812 50.6843 132.694 50.0922 132.694 49.5593V46.5395C132.694 45.2961 133.168 44.704 134.056 44.704C134.411 44.704 134.766 44.7632 135.122 44.8816C135.477 45.0001 136.01 45.2369 136.602 45.4737C138.615 46.3619 140.806 47.0724 143.115 47.5461C145.484 48.0198 147.793 48.2566 150.161 48.2566C153.891 48.2566 156.793 47.6053 158.806 46.3027C160.819 45 161.885 43.1053 161.885 40.6777C161.885 39.0198 161.352 37.6579 160.286 36.5329C159.22 35.4079 157.207 34.4014 154.306 33.454L145.72 30.7895C141.398 29.4277 138.201 27.4145 136.247 24.7501C134.293 22.1448 133.286 19.2435 133.286 16.1645C133.286 13.6777 133.819 11.4869 134.885 9.59216C135.951 7.69742 137.372 6.03953 139.148 4.73689C140.924 3.37505 142.937 2.36847 145.306 1.65795C147.674 0.94742 150.161 0.651367 152.766 0.651367C154.069 0.651367 155.431 0.710578 156.734 0.888209C158.095 1.06584 159.339 1.30268 160.582 1.53953C161.766 1.83558 162.891 2.13163 163.957 2.48689C165.023 2.84216 165.852 3.19742 166.444 3.55268C167.273 4.02637 167.865 4.50005 168.22 5.03295C168.576 5.50663 168.753 6.15795 168.753 6.98689V9.76979C168.753 11.0132 168.28 11.6645 167.391 11.6645C166.918 11.6645 166.148 11.4277 165.141 10.954C161.766 9.41453 157.977 8.64479 153.773 8.64479C150.398 8.64479 147.734 9.17768 145.898 10.3027C144.062 11.4277 143.115 13.1448 143.115 15.5724C143.115 17.2303 143.707 18.6514 144.891 19.7764C146.076 20.9014 148.266 22.0264 151.405 23.0329L159.812 25.6974C164.076 27.0593 167.155 28.954 168.99 31.3816C170.826 33.8093 171.714 36.5922 171.714 39.6711C171.714 42.2172 171.181 44.5264 170.174 46.5395C169.108 48.5527 167.687 50.329 165.852 51.7501C164.016 53.2303 161.826 54.2961 159.28 55.0658C156.615 55.8948 153.832 56.3093 150.812 56.3093Z",fill:"currentColor"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M162.004 85.0856C142.524 99.4738 114.221 107.112 89.8855 107.112C55.7803 107.112 25.05 94.5001 1.83948 73.5396C0.00394917 71.8817 1.66184 69.6317 3.85263 70.9343C28.9579 85.5001 59.925 94.3225 91.9579 94.3225C113.57 94.3225 137.313 89.8225 159.162 80.5856C162.418 79.1054 165.201 82.7172 162.004 85.0856Z",fill:"#FF9900"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M170.115 75.8487C167.628 72.6513 153.654 74.3092 147.319 75.079C145.424 75.3158 145.128 73.6579 146.845 72.4145C157.976 64.5987 176.272 66.8487 178.404 69.454C180.536 72.1184 177.812 90.4145 167.391 99.1776C165.792 100.539 164.253 99.8289 164.963 98.0526C167.332 92.1908 172.601 78.9868 170.115 75.8487Z",fill:"#FF9900"})]}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_1480_1723",children:o.jsx("rect",{width:"180",height:"107.763",fill:"white",transform:"translate(0.0625)"})})})]}),OLr=e=>o.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 320 320",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",...e,children:o.jsx("path",{d:"m297.06 130.97c7.26-21.79 4.76-45.66-6.85-65.48-17.46-30.4-52.56-46.04-86.84-38.68-15.25-17.18-37.16-26.95-60.13-26.81-35.04-.08-66.13 22.48-76.91 55.82-22.51 4.61-41.94 18.7-53.31 38.67-17.59 30.32-13.58 68.54 9.92 94.54-7.26 21.79-4.76 45.66 6.85 65.48 17.46 30.4 52.56 46.04 86.84 38.68 15.24 17.18 37.16 26.95 60.13 26.8 35.06.09 66.16-22.49 76.94-55.86 22.51-4.61 41.94-18.7 53.31-38.67 17.57-30.32 13.55-68.51-9.94-94.51zm-120.28 168.11c-14.03.02-27.62-4.89-38.39-13.88.49-.26 1.34-.73 1.89-1.07l63.72-36.8c3.26-1.85 5.26-5.32 5.24-9.07v-89.83l26.93 15.55c.29.14.48.42.52.74v74.39c-.04 33.08-26.83 59.9-59.91 59.97zm-128.84-55.03c-7.03-12.14-9.56-26.37-7.15-40.18.47.28 1.3.79 1.89 1.13l63.72 36.8c3.23 1.89 7.23 1.89 10.47 0l77.79-44.92v31.1c.02.32-.13.63-.38.83l-64.41 37.19c-28.69 16.52-65.33 6.7-81.92-21.95zm-16.77-139.09c7-12.16 18.05-21.46 31.21-26.29 0 .55-.03 1.52-.03 2.2v73.61c-.02 3.74 1.98 7.21 5.23 9.06l77.79 44.91-26.93 15.55c-.27.18-.61.21-.91.08l-64.42-37.22c-28.63-16.58-38.45-53.21-21.95-81.89zm221.26 51.49-77.79-44.92 26.93-15.54c.27-.18.61-.21.91-.08l64.42 37.19c28.68 16.57 38.51 53.26 21.94 81.94-7.01 12.14-18.05 21.44-31.2 26.28v-75.81c.03-3.74-1.96-7.2-5.2-9.06zm26.8-40.34c-.47-.29-1.3-.79-1.89-1.13l-63.72-36.8c-3.23-1.89-7.23-1.89-10.47 0l-77.79 44.92v-31.1c-.02-.32.13-.63.38-.83l64.41-37.16c28.69-16.55 65.37-6.7 81.91 22 6.99 12.12 9.52 26.31 7.15 40.1zm-168.51 55.43-26.94-15.55c-.29-.14-.48-.42-.52-.74v-74.39c.02-33.12 26.89-59.96 60.01-59.94 14.01 0 27.57 4.92 38.34 13.88-.49.26-1.33.73-1.89 1.07l-63.72 36.8c-3.26 1.85-5.26 5.31-5.24 9.06l-.04 89.79zm14.63-31.54 34.65-20.01 34.65 20v40.01l-34.65 20-34.65-20z"})}),kLr=e=>o.jsx("svg",{className:"h-3 w-3",fill:"white",height:"78",strokeLinejoin:"round",viewBox:"0 0 16 16",width:"78",style:{color:"currentcolor"},...e,children:o.jsx("g",{transform:"translate(0,2)",children:o.jsx("path",{d:"M11.375 0h-2.411L13.352 11.13h2.411L11.375 0ZM4.4 0 0 11.13h2.46l0.9-2.336h4.604l0.9 2.336h2.46L6.924 0H4.4Zm-0.244 6.723 1.506-3.909 1.506 3.909H4.156Z",fill:"currentColor"})})}),xdt=e=>o.jsx("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",...e,children:o.jsx("path",{d:"M7.402 13.8777C9.45763 13.4674 11.1555 13.128 11.175 13.1233L11.2104 13.1148L9.2697 10.507C8.2023 9.07276 7.32898 7.8937 7.32898 7.88691C7.32898 7.87404 9.33293 1.63997 9.3442 1.61779C9.34797 1.61037 10.7117 4.27017 12.65 8.06532C14.4647 11.6184 15.9608 14.5479 15.9747 14.5754L16 14.6253L9.83224 14.6244L3.66449 14.6235L7.402 13.8777ZM0 13.0824C0 13.0787 0.914457 11.2855 2.03212 9.09735L4.06425 5.11896L6.43245 2.87384C7.73497 1.63902 8.80417 0.627201 8.80845 0.625356C8.81274 0.623511 8.79561 0.672228 8.77038 0.733617C8.74515 0.795006 7.58796 3.59893 6.19884 6.96455L3.67317 13.0839L1.83659 13.0865C0.826464 13.0879 0 13.0861 0 13.0824Z",fill:"#0089D6",style:{fill:"#0089D6",fillOpacity:1}})}),_Lr=e=>o.jsxs("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",width:"17",height:"18",fill:"none",...e,children:[o.jsx("mask",{id:"mask0_174_2406",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"17",height:"18",children:o.jsx("path",{d:"M17 0.5H0V17.5H17V0.5Z",fill:"white"})}),o.jsxs("g",{mask:"url(#mask0_174_2406)",children:[o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.50773 10.6219C5.9653 10.6219 6.8755 10.5968 8.13362 10.0788C9.59973 9.47518 12.5166 8.37942 14.6208 7.2539C16.0924 6.46668 16.7375 5.42553 16.7375 4.02344C16.7375 2.07751 15.16 0.5 13.2141 0.5H5.06095C2.26586 0.5 0 2.76586 0 5.56095C0 8.35604 2.12151 10.6219 5.50773 10.6219Z",fill:"#39594D"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.88672 14.107C6.88672 12.7369 7.71155 11.5016 8.97699 10.9764L11.5446 9.9108C14.1417 8.83294 17.0003 10.7415 17.0003 13.5535C17.0003 15.732 15.2339 17.4979 13.0553 17.4973L10.2754 17.4966C8.40372 17.4961 6.88672 15.9787 6.88672 14.107Z",fill:"#D18EE2"}),o.jsx("path",{d:"M2.91749 11.2891C1.30623 11.2891 0 12.5952 0 14.2065V14.5844C0 16.1956 1.30618 17.5018 2.91744 17.5018C4.5287 17.5018 5.83493 16.1956 5.83493 14.5844V14.2065C5.83493 12.5952 4.52875 11.2891 2.91749 11.2891Z",fill:"#FF7759"})]})]}),ELr=e=>o.jsxs("svg",{className:"h-3 w-3","data-testid":"geist-icon",height:"78",strokeLinejoin:"round",viewBox:"0 0 160 59",width:"104",style:{color:"currentcolor"},...e,children:[o.jsx("mask",{id:"mask0_4345_1846",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"160",height:"59",style:{maskType:"luminance"},children:o.jsx("path",{d:"M0.273438 0.219727H159.216V58.1817H0.273438V0.219727Z",fill:"white"})}),o.jsx("g",{mask:"url(#mask0_4345_1846)",children:o.jsx("path",{d:"M95.4635 0.314595C84.4822 0.314595 75.5599 9.19525 75.5599 20.1677C75.5599 31.1402 84.4632 40.0208 95.4635 40.0208C106.464 40.0208 115.367 31.1402 115.367 20.1677C115.348 9.21427 106.445 0.333611 95.4635 0.314595ZM95.4635 32.5664C88.6002 32.5664 83.0333 27.0136 83.0333 20.1677C83.0333 13.3218 88.6002 7.76902 95.4635 7.76902C102.327 7.76902 107.894 13.3218 107.894 20.1677C107.894 27.0136 102.327 32.5664 95.4635 32.5664ZM67.9912 0.39066C67.3049 0.314595 66.6376 0.276562 65.9513 0.276562C65.6081 0.276562 65.284 0.276562 64.9599 0.295578C64.6358 0.314595 64.2926 0.333611 63.9685 0.352628C62.634 0.44771 61.2995 0.675906 60.0031 1.03722C57.3531 1.74082 54.8556 2.99591 52.7013 4.68836C50.4898 6.43787 48.7358 8.68181 47.5347 11.23C46.9437 12.5041 46.5052 13.8543 46.2193 15.2234C46.0858 15.908 45.9905 16.5926 45.9142 17.2772C45.8952 17.6195 45.857 17.9618 45.857 18.3041L45.838 18.8175V19.293L45.8761 32.5854L45.9142 39.2221H53.3685L53.4067 32.5854L53.4448 19.293V18.5893C53.4448 18.3802 53.4829 18.171 53.4829 17.9618C53.5211 17.5434 53.5973 17.1441 53.6736 16.7257C53.8452 15.9271 54.093 15.1474 54.4362 14.4057C55.1225 12.9225 56.152 11.6293 57.4293 10.6025C58.7639 9.53755 60.3081 8.75787 61.9477 8.3205C62.7865 8.0923 63.6635 7.94017 64.5405 7.8641C64.7693 7.84509 64.979 7.82607 65.2078 7.82607C65.4365 7.82607 65.6653 7.80705 65.875 7.80705C66.2944 7.80705 66.7329 7.82607 67.1524 7.8641C68.8491 8.03525 70.4887 8.54869 71.9948 9.38541L75.7124 2.93886C73.3484 1.56968 70.7175 0.694923 67.9912 0.39066ZM20.3484 0.219513C9.36711 0.124431 0.36855 8.92902 0.273226 19.8825C0.177902 30.8359 9.00488 39.8116 19.9862 39.9067H26.8876V32.4713H20.3484C13.4851 32.5474 7.84193 27.0707 7.76567 20.2057C7.68941 13.3408 13.1801 7.73099 20.0624 7.65492H20.3484C27.2117 7.65492 32.7786 13.2077 32.8167 20.0536V38.3284C32.8167 45.1172 27.2689 50.651 20.4819 50.7271C17.2218 50.708 14.1142 49.3959 11.8265 47.0949L6.54553 52.3625C10.206 56.0326 15.1628 58.1244 20.3484 58.1625H20.6153C31.4632 58.0103 40.1757 49.2248 40.2329 38.4044V19.5592C39.966 8.81492 31.1391 0.238529 20.3484 0.219513ZM139.389 0.314595C128.407 0.314595 119.485 9.19525 119.504 20.1677C119.504 31.1212 128.407 40.0018 139.389 40.0018H146.195V32.5664H139.389C132.525 32.5664 126.958 27.0136 126.958 20.1677C126.958 13.3218 132.525 7.76902 139.389 7.76902C145.833 7.76902 151.209 12.6943 151.781 19.1028H151.762V57.2116H159.216V20.1677C159.216 9.21427 150.351 0.314595 139.389 0.314595Z",fill:"currentColor"})})]}),CLr=e=>o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 34 21",fill:"none",...e,children:o.jsx("path",{d:"M4.49805 11.6934C6.98237 11.6934 8.99609 13.7081 8.99609 16.1924C8.9959 18.6765 6.98225 20.6904 4.49805 20.6904C2.01394 20.6903 0.000196352 18.6765 0 16.1924C0 13.7081 2.01382 11.6935 4.49805 11.6934ZM10.3867 0C12.8709 0 14.8846 2.01388 14.8848 4.49805C14.8848 4.8377 14.847 5.16846 14.7755 5.48643C14.4618 6.88139 14.1953 8.4633 14.9928 9.65L16.2575 11.5319C16.3363 11.6491 16.4727 11.7115 16.6137 11.703C16.7369 11.6957 16.8525 11.6343 16.9214 11.5318L18.1876 9.64717C18.9772 8.47198 18.7236 6.90783 18.4205 5.52484C18.3523 5.21392 18.3164 4.89094 18.3164 4.55957C18.3167 2.07546 20.3313 0.0615234 22.8154 0.0615234C25.2994 0.0617476 27.3132 2.0756 27.3135 4.55957C27.3135 4.93883 27.2665 5.30712 27.178 5.65896C26.8547 6.94441 26.5817 8.37932 27.2446 9.52714L28.459 11.6301C28.4819 11.6697 28.5245 11.6934 28.5703 11.6934C31.0545 11.6935 33.0684 13.7081 33.0684 16.1924C33.0682 18.6765 31.0544 20.6903 28.5703 20.6904C26.0861 20.6904 24.0725 18.6765 24.0723 16.1924C24.0723 15.8049 24.1212 15.4288 24.2133 15.0701C24.5458 13.7746 24.8298 12.3251 24.1609 11.1668L23.0044 9.16384C22.9656 9.09659 22.8931 9.05859 22.8154 9.05859C22.7983 9.05859 22.7824 9.06614 22.7728 9.08033L21.4896 10.9895C20.686 12.1851 20.9622 13.781 21.284 15.1851C21.3582 15.5089 21.3975 15.8461 21.3975 16.1924C21.3973 18.6764 19.3834 20.6902 16.8994 20.6904C14.4152 20.6904 12.4006 18.6765 12.4004 16.1924C12.4004 15.932 12.4226 15.6768 12.4651 15.4286C12.6859 14.14 12.8459 12.7122 12.1167 11.6271L11.2419 10.3253C10.6829 9.49347 9.71913 9.05932 8.78286 8.70188C7.0906 8.05584 5.88867 6.41734 5.88867 4.49805C5.88886 2.0139 7.90254 3.29835e-05 10.3867 0Z",fill:e.fill||"currentColor"})}),jLr=e=>o.jsxs("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",width:"176",height:"162",viewBox:"0 0 176 162",fill:"none",...e,children:[o.jsx("rect",{x:"15",y:"1",width:"32",height:"32",fill:"#FFCD00",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"143",y:"1",width:"32",height:"32",fill:"#FFCD00",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"15",y:"33",width:"32",height:"32",fill:"#FFA400",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"47",y:"33",width:"32",height:"32",fill:"#FFA400",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"111",y:"33",width:"32",height:"32",fill:"#FFA400",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"143",y:"33",width:"32",height:"32",fill:"#FFA400",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"15",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"47",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"79",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"111",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"143",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"15",y:"97",width:"32",height:"32",fill:"#FF4902",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"79",y:"97",width:"32",height:"32",fill:"#FF4902",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"143",y:"97",width:"32",height:"32",fill:"#FF4902",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"15",y:"129",width:"32",height:"32",fill:"#FF0006",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"143",y:"129",width:"32",height:"32",fill:"#FF0006",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{y:"1",width:"16",height:"160",fill:"black"}),o.jsx("rect",{x:"63",y:"97",width:"16",height:"32",fill:"black"}),o.jsx("rect",{x:"95",y:"33",width:"16",height:"32",fill:"black"}),o.jsx("rect",{x:"127",y:"1",width:"16",height:"32",fill:"black"}),o.jsx("rect",{x:"127",y:"97",width:"16",height:"64",fill:"black"})]}),TLr=e=>o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"128",height:"113",viewBox:"0 0 128 113",children:[o.jsxs("g",{clipPath:"url(#clip0_236_138)",...e,children:[o.jsx("path",{d:"M34.593 94.0509H33.3844L27.3514 88.0179V86.8094L36.5743 77.5866H42.9639L43.8158 78.4385V84.8281L34.593 94.0509Z",fill:e.fill||"#05BDBA"}),o.jsx("path",{d:"M27.3514 25.816V24.6074L33.3844 18.5744H34.593L43.8158 27.7972V34.1868L42.9639 35.0388H36.5743L27.3514 25.816Z",fill:e.fill||"#05BDBA"}),o.jsx("path",{d:"M80.4594 74.6047H71.6824L70.9493 73.8717V53.3259C70.9493 49.6705 69.5129 46.8372 65.1046 46.7382C62.836 46.6787 60.2405 46.7382 57.4668 46.8471L57.0507 47.2731V73.8618L56.3176 74.5948H47.5406L46.8075 73.8618V38.7636L47.5406 38.0305H67.2939C74.9713 38.0305 81.1925 44.2517 81.1925 51.9291V73.8717L80.4594 74.6047Z",fill:e.fill||"#014847"}),o.jsx("path",{d:"M35.8412 61.4491H0.73307L0 60.716V51.9192L0.73307 51.1861H35.8412L36.5743 51.9192V60.716L35.8412 61.4491Z",fill:e.fill||"#05BDBA"}),o.jsx("path",{d:"M127.277 61.4491H92.1687L91.4356 60.716V51.9192L92.1687 51.1861H127.277L128.01 51.9192V60.716L127.277 61.4491Z",fill:e.fill||"#05BDBA"}),o.jsx("path",{d:"M58.9428 27.0642V0.73307L59.6759 0H68.4727L69.2058 0.73307V27.0642L68.4727 27.7972H59.6759L58.9428 27.0642Z",fill:e.fill||"#05BDBA"}),o.jsx("path",{d:"M58.9428 111.902V85.5711L59.6759 84.838H68.4727L69.2058 85.5711V111.902L68.4727 112.635H59.6759L58.9428 111.902Z",fill:e.fill||"#05BDBA"})]}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_236_138",children:o.jsx("rect",{width:"128",height:"112.635",fill:"white"})})})]}),sRe=e=>o.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 320 320",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",...e,children:o.jsx("path",{d:"m297.06 130.97c7.26-21.79 4.76-45.66-6.85-65.48-17.46-30.4-52.56-46.04-86.84-38.68-15.25-17.18-37.16-26.95-60.13-26.81-35.04-.08-66.13 22.48-76.91 55.82-22.51 4.61-41.94 18.7-53.31 38.67-17.59 30.32-13.58 68.54 9.92 94.54-7.26 21.79-4.76 45.66 6.85 65.48 17.46 30.4 52.56 46.04 86.84 38.68 15.24 17.18 37.16 26.95 60.13 26.8 35.06.09 66.16-22.49 76.94-55.86 22.51-4.61 41.94-18.7 53.31-38.67 17.57-30.32 13.55-68.51-9.94-94.51zm-120.28 168.11c-14.03.02-27.62-4.89-38.39-13.88.49-.26 1.34-.73 1.89-1.07l63.72-36.8c3.26-1.85 5.26-5.32 5.24-9.07v-89.83l26.93 15.55c.29.14.48.42.52.74v74.39c-.04 33.08-26.83 59.9-59.91 59.97zm-128.84-55.03c-7.03-12.14-9.56-26.37-7.15-40.18.47.28 1.3.79 1.89 1.13l63.72 36.8c3.23 1.89 7.23 1.89 10.47 0l77.79-44.92v31.1c.02.32-.13.63-.38.83l-64.41 37.19c-28.69 16.52-65.33 6.7-81.92-21.95zm-16.77-139.09c7-12.16 18.05-21.46 31.21-26.29 0 .55-.03 1.52-.03 2.2v73.61c-.02 3.74 1.98 7.21 5.23 9.06l77.79 44.91-26.93 15.55c-.27.18-.61.21-.91.08l-64.42-37.22c-28.63-16.58-38.45-53.21-21.95-81.89zm221.26 51.49-77.79-44.92 26.93-15.54c.27-.18.61-.21.91-.08l64.42 37.19c28.68 16.57 38.51 53.26 21.94 81.94-7.01 12.14-18.05 21.44-31.2 26.28v-75.81c.03-3.74-1.96-7.2-5.2-9.06zm26.8-40.34c-.47-.29-1.3-.79-1.89-1.13l-63.72-36.8c-3.23-1.89-7.23-1.89-10.47 0l-77.79 44.92v-31.1c-.02-.32.13-.63.38-.83l64.41-37.16c28.69-16.55 65.37-6.7 81.91 22 6.99 12.12 9.52 26.31 7.15 40.1zm-168.51 55.43-26.94-15.55c-.29-.14-.48-.42-.52-.74v-74.39c.02-33.12 26.89-59.96 60.01-59.94 14.01 0 27.57 4.92 38.34 13.88-.49.26-1.33.73-1.89 1.07l-63.72 36.8c-3.26 1.85-5.26 5.31-5.24 9.06l-.04 89.79zm14.63-31.54 34.65-20.01 34.65 20v40.01l-34.65 20-34.65-20z"})}),NLr=e=>o.jsx("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1000 1000",width:"78",height:"78",style:{color:"currentcolor"},...e,children:o.jsxs("g",{children:[o.jsx("polygon",{fill:"currentColor",points:"226.83 411.15 501.31 803.15 623.31 803.15 348.82 411.15 226.83 411.15"}),o.jsx("polygon",{fill:"currentColor",points:"348.72 628.87 226.69 803.15 348.77 803.15 409.76 716.05 348.72 628.87"}),o.jsx("polygon",{fill:"currentColor",points:"651.23 196.85 440.28 498.12 501.32 585.29 773.31 196.85 651.23 196.85"}),o.jsx("polygon",{fill:"currentColor",points:"673.31 383.25 673.31 803.15 773.31 803.15 773.31 240.44 673.31 383.25"})]})}),ALr={duration:5e3,cancel:{label:o.jsx(Ce,{children:o.jsx(Wl,{})}),onClick:()=>{}},unstyled:!0,classNames:{toast:"bg-surface3 w-full h-auto rounded-xl gap-2 border border-border1 px-3 py-2 flex items-center justify-between pointer-events-auto shadow-card :data-content:flex-1",title:"text-xs font-medium text-neutral5",description:"text-xs text-neutral3",cancelButton:"bg-transparent! hover:bg-surface2! border-none! rounded-md! p-1.5! m-0! text-neutral3! hover:text-neutral6! shrink-0 transition-all",actionButton:"bg-white! flex items-center justify-center font-medium text-black! order-last hover:opacity-80"}};function Jd(e){const{classNames:t,...r}=ALr,{classNames:n,...s}=e||{};return{...r,classNames:{...t,title:Y(t?.title,n?.title),toast:Y(t?.toast,n?.toast),cancelButton:Y(t?.cancelButton,n?.cancelButton),actionButton:Y(t?.actionButton,n?.actionButton),description:Y(t?.description,n?.description)},...s}}const ze=(e,t={})=>{if(Array.isArray(e))return e.forEach(r=>mc(r,Jd(t)));if(je.isValidElement(e))return mc(e,Jd(t));if(typeof e=="string")return mc(e,Jd(t));throw new Error("Invalid message type")};ze.success=(e,t={})=>{const r={...t,icon:o.jsx(Ce,{className:"text-accent1 shrink-0",children:o.jsx(jzt,{})}),classNames:{...t.classNames,toast:Y("bg-accent1Darker border-accent1/30 border-l-[3px] border-l-accent1",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return mc.success(e,Jd(r));case"object":return e.forEach(n=>mc.success(n,Jd(r)))}};ze.error=(e,t={})=>{const r={...t,icon:o.jsx(Ce,{className:"text-accent2 shrink-0",children:o.jsx(NHe,{})}),classNames:{...t.classNames,toast:Y("bg-accent2Darker border-accent2/30 border-l-[3px] border-l-accent2",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return mc.error(e,Jd(r));case"object":return e.forEach(n=>mc.error(n,Jd(r)))}};ze.warning=(e,t={})=>{const r={...t,icon:o.jsx(Ce,{className:"text-accent6 shrink-0",children:o.jsx(Uce,{})}),classNames:{...t.classNames,toast:Y("bg-accent6Darker border-accent6/30 border-l-[3px] border-l-accent6",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return mc.warning(e,Jd(r));case"object":return e.forEach(n=>mc.warning(n,Jd(r)))}};ze.info=(e,t={})=>{const r={...t,icon:o.jsx(Ce,{className:"text-accent3 shrink-0",children:o.jsx($R,{})}),classNames:{...t.classNames,toast:Y("bg-accent3Darker border-accent3/30 border-l-[3px] border-l-accent3",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return mc.info(e,Jd(r));case"object":return e.forEach(n=>mc.info(n,Jd(r)))}};ze.custom=(e,t={})=>mc(e,Jd(t));ze.dismiss=e=>{e&&mc.dismiss(e)};ze.promise=({myPromise:e,loadingMessage:t,successMessage:r,errorMessage:n,onSuccess:s,onError:a,options:i={}})=>mc.promise(e,{loading:t??"Loading...",success:l=>(s?.(l),r),error:l=>(a?.(l),n||l?.message||"Error..."),...Jd(i)});function cf({text:e,copyMessage:t="Copied to clipboard!"}){const[r,n]=b.useState(!1),s=b.useRef(null),a=b.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{ze.success(t),n(!0),s.current&&(clearTimeout(s.current),s.current=null),s.current=setTimeout(()=>{n(!1)},2e3)}).catch(()=>{ze.error("Failed to copy to clipboard.")})},[e,t]);return{isCopied:r,handleCopy:a}}function ta({content:e,copyMessage:t,tooltip:r="Copy to clipboard",size:n="sm",className:s}){const[a,i]=b.useState(!1),{handleCopy:l}=cf({text:e,copyMessage:t}),c=()=>{l(),i(!0),setTimeout(()=>i(!1),2e3)};return o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(ce,{onClick:c,type:"button",size:n,className:s,"aria-label":a?"Copied!":r,children:a?o.jsx(cv,{}):o.jsx(IHe,{})})}),o.jsx(Wr,{children:a?"Copied!":r})]})}const ILr="mastra-theme",RLr="mastra-playground-store",fie=e=>e==="dark"||e==="light"||e==="system",PLr=e=>{try{const t=e.getItem(RLr);if(!t)return;const n=JSON.parse(t)?.state?.theme;return fie(n)?n:void 0}catch{return}},MLr=(e=ILr)=>({get(){if(typeof window>"u")return null;try{const t=window.localStorage.getItem(e);if(fie(t))return t;const r=PLr(window.localStorage);return r?(window.localStorage.setItem(e,r),r):null}catch{return null}},set(t){if(!(typeof window>"u"))try{window.localStorage.setItem(e,t)}catch{}},subscribe(t){if(typeof window>"u")return()=>{};const r=n=>{if(n.key===e){if(n.newValue===null){t(null);return}fie(n.newValue)&&t(n.newValue)}};return window.addEventListener("storage",r),()=>window.removeEventListener("storage",r)}}),wdt=b.createContext(null),Sdt="(prefers-color-scheme: dark)",DLr=typeof window>"u"?b.useEffect:b.useLayoutEffect,Odt=()=>typeof window>"u"||typeof window.matchMedia!="function"||window.matchMedia(Sdt).matches?"dark":"light",kdt=e=>{if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};const t=window.matchMedia(Sdt);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},LLr=(e,t)=>{e.classList.remove(t==="dark"?"light":"dark"),e.classList.add(t)},_dt=({children:e,defaultTheme:t="system",storageKey:r,target:n})=>{const s=b.useMemo(()=>MLr(r),[r]),a=b.useRef(null),[i,l]=b.useState(()=>s.get()??t),c=b.useSyncExternalStore(kdt,Odt,()=>"dark");b.useEffect(()=>s.subscribe(f=>l(f??t)),[s,t]);const u=i==="system"?c:i;DLr(()=>{const f=n??(typeof window>"u"?null:window.document.documentElement);a.current&&a.current!==f&&a.current.classList.remove("dark","light"),f&&LLr(f,u),a.current=f},[u,n]);const d=b.useMemo(()=>({theme:i,resolvedTheme:u,systemTheme:c,setTheme:f=>{l(f),s.set(f)}}),[i,u,c,s]);return o.jsx(wdt.Provider,{value:d,children:e})},$Lr=()=>{},gC=()=>{const e=b.useContext(wdt),t=b.useSyncExternalStore(kdt,Odt,()=>"dark");return b.useMemo(()=>e??{theme:"system",resolvedTheme:t,systemTheme:t,setTheme:$Lr},[e,t])};function FLr(){const e=VE({settings:{fontFamily:"var(--geist-mono)",fontSize:"0.8rem",lineHighlight:"transparent",gutterBackground:"transparent",gutterForeground:"var(--neutral2)",background:"transparent",foreground:"var(--neutral6)",caret:"var(--neutral6)"},styles:[{tag:[ne.className,ne.propertyName],color:"var(--neutral6)"},{tag:ne.heading,color:"var(--accent3)",fontWeight:"bold"},{tag:[ne.heading1,ne.heading2,ne.heading3,ne.heading4,ne.heading5,ne.heading6],color:"var(--accent3)",fontWeight:"bold"},{tag:ne.emphasis,fontStyle:"italic",color:"var(--neutral6)"},{tag:ne.strong,fontWeight:"bold",color:"var(--neutral6)"},{tag:ne.link,color:"var(--accent3)",textDecoration:"underline"},{tag:ne.url,color:"var(--accent3)"},{tag:ne.monospace,color:"var(--neutral6)"},{tag:ne.strikethrough,textDecoration:"line-through"},{tag:ne.quote,fontStyle:"italic",color:"var(--neutral2)"}]}),t=ft.theme({".cm-editor":{backgroundColor:"transparent"},".cm-content":{color:"var(--neutral6)",caretColor:"var(--neutral6)"},".cm-lineNumbers .cm-gutterElement":{color:"var(--neutral2)"},".cm-activeLineGutter":{color:"var(--neutral3)"},".cm-cursor":{borderLeftColor:"var(--neutral6)"},".cm-selectionBackground, .cm-content ::selection":{backgroundColor:"color-mix(in srgb, var(--accent3) 22%, transparent)"},".cm-tooltip-autocomplete":{backgroundColor:"var(--surface2)",border:"1px solid var(--border1)",borderRadius:"6px",boxShadow:"0 8px 16px rgba(0, 0, 0, 0.2)"},".cm-tooltip-autocomplete > ul":{fontFamily:"var(--geist-mono)"},".cm-completionLabel":{color:"var(--neutral6)"},".cm-completionDetail":{color:"var(--neutral3)",fontSize:"0.7rem",marginLeft:"auto",paddingLeft:"12px"},".cm-completionInfo":{backgroundColor:"var(--surface2)",border:"1px solid var(--border1)",color:"var(--neutral3)",padding:"8px 12px"},".cm-completionIcon":{display:"none"},"ul.cm-completionList li[aria-selected]":{backgroundColor:"var(--surface4)",color:"var(--neutral6)"},".cm-line .cm-variable-highlight":{color:"var(--accent6) !important",fontWeight:"500"}});return[e,t]}function zLr(){const e=ft.theme({"&":{backgroundColor:"transparent",color:"var(--neutral6)",fontSize:"0.8rem"},"&.cm-editor .cm-scroller":{fontFamily:"var(--geist-mono)"},".cm-gutters":{backgroundColor:"transparent",color:"var(--neutral2)",borderRight:"none"},".cm-content":{color:"var(--neutral6)",caretColor:"var(--neutral6)"},".cm-activeLine":{backgroundColor:"transparent"},".cm-lineNumbers .cm-gutterElement":{color:"var(--neutral2)"},".cm-activeLineGutter":{backgroundColor:"transparent",color:"var(--neutral3)"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--neutral6)"},"&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection":{background:"color-mix(in srgb, var(--accent3) 22%, transparent) !important"},".cm-tooltip-autocomplete":{backgroundColor:"var(--surface2)",border:"1px solid var(--border1)",borderRadius:"6px",boxShadow:"0 8px 16px rgba(0, 0, 0, 0.2)"},".cm-tooltip-autocomplete > ul":{fontFamily:"var(--geist-mono)"},".cm-completionLabel":{color:"var(--neutral6)"},".cm-completionDetail":{color:"var(--neutral3)",fontSize:"0.7rem",marginLeft:"auto",paddingLeft:"12px"},".cm-completionInfo":{backgroundColor:"var(--surface2)",border:"1px solid var(--border1)",color:"var(--neutral3)",padding:"8px 12px"},".cm-completionIcon":{display:"none"},"ul.cm-completionList li[aria-selected]":{backgroundColor:"var(--surface4)",color:"var(--neutral6)"},".cm-line .cm-variable-highlight":{color:"var(--accent6) !important",fontWeight:"500"}}),t=Pp.define([{tag:[ne.comment,ne.bracket],color:"var(--neutral2)"},{tag:[ne.string,ne.meta,ne.regexp],color:"var(--accent1)"},{tag:[ne.atom,ne.bool,ne.special(ne.variableName)],color:"var(--accent6)"},{tag:[ne.keyword,ne.operator,ne.tagName],color:"var(--accent2)"},{tag:[ne.function(ne.propertyName),ne.propertyName],color:"var(--accent5)"},{tag:[ne.definition(ne.variableName),ne.function(ne.variableName),ne.className,ne.attributeName],color:"var(--accent3)"},{tag:[ne.variableName,ne.number],color:"var(--accent5)"},{tag:[ne.name,ne.quote],color:"var(--accent1)"},{tag:ne.heading,color:"var(--accent3)",fontWeight:"bold"},{tag:[ne.heading1,ne.heading2,ne.heading3,ne.heading4,ne.heading5,ne.heading6],color:"var(--accent3)",fontWeight:"bold"},{tag:[ne.emphasis],fontStyle:"italic",color:"var(--neutral6)"},{tag:[ne.strong],fontWeight:"bold",color:"var(--neutral6)"},{tag:ne.link,color:"var(--accent3)",textDecoration:"underline"},{tag:ne.url,color:"var(--accent3)"},{tag:ne.monospace,color:"var(--neutral6)"},{tag:ne.strikethrough,textDecoration:"line-through"},{tag:[ne.deleted],color:"var(--accent2)"},{tag:ne.invalid,color:"var(--error)"},{tag:[ne.standard(ne.tagName)],color:"var(--accent1)"}]);return[e,Wx(t)]}const wv=()=>{const e=gC().resolvedTheme==="dark";return b.useMemo(()=>e?FLr():zLr(),[e])},Xn=b.forwardRef(({data:e,value:t,onChange:r,showCopyButton:n=!0,className:s,language:a="json",highlightVariables:i=!1,placeholder:l,schema:c,autoFocus:u,lineNumbers:d=!0,editable:f,...h},p)=>{const m=wv(),g=e?JSON.stringify(e,null,2):t??"",y=b.useMemo(()=>{const x=[];return a==="json"?x.push(Gd):a==="markdown"&&(x.push(Que({base:dS,codeLanguages:bZe})),x.push(ft.lineWrapping)),i&&a==="markdown"&&x.push(xLr),c&&a==="markdown"&&x.push(mLr(c)),f===!1&&x.push(zn.readOnly.of(!0)),x},[a,i,c,f]);return o.jsxs("div",{className:Y("rounded-md bg-surface3 p-1 font-mono relative border border-border1 overflow-hidden",s),...h,children:[n&&o.jsx(ta,{content:g,className:"absolute top-2 right-2 z-20"}),o.jsx(vc,{ref:p,value:g,theme:m,extensions:y,onChange:r,editable:f,"aria-label":"Code editor",placeholder:l,height:"100%",style:{height:"100%"},autoFocus:u,basicSetup:{lineNumbers:d}})]})});async function BLr(e,t){const{codeToTokens:r,bundledLanguages:n}=await Ke(async()=>{const{codeToTokens:a,bundledLanguages:i}=await import("./index-BRfWvzT8.js");return{codeToTokens:a,bundledLanguages:i}},__vite__mapDeps([23,1]),import.meta.url);if(!(t in n))return null;const{tokens:s}=await r(e,{lang:t,defaultColor:!1,themes:{light:"github-light",dark:"github-dark"}});return s}function Ja({iconSlot:e,titleSlot:t,descriptionSlot:r,actionSlot:n,className:s,as:a="h3"}){return o.jsxs("div",{className:Y("flex flex-col items-center justify-center text-center py-10 px-6","transition-opacity duration-normal ease-out-custom",s),children:[e&&o.jsx("div",{className:"mb-4",children:e}),o.jsx(a,{className:"font-medium text-neutral5 text-ui-md",children:t}),r&&o.jsx("p",{className:"mt-1.5 text-neutral3 text-ui-sm max-w-md",children:r}),n&&o.jsx("div",{className:"mt-5",children:n})]})}const wf=({children:e,className:t,onClick:r})=>o.jsx("div",{tabIndex:r?0:void 0,onKeyDown:n=>{r&&(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),r?.())},className:Y("flex gap-3 group/entity bg-surface3 rounded-xl border border-border1 py-3 px-4",r&&"cursor-pointer hover:bg-surface4 transition-all",t),onClick:r,children:e}),Edt=({children:e,className:t,style:r})=>o.jsx(Ce,{size:"lg",className:Y("text-neutral3 mt-1 shrink-0",t),style:r,children:e}),Sf=({children:e,className:t})=>o.jsx(me,{as:"p",variant:"ui-lg",className:Y("text-neutral6 font-medium",t),children:e}),Of=({children:e,className:t})=>o.jsx(me,{as:"div",variant:"ui-sm",className:Y("text-neutral3",t),children:e}),kf=({children:e,className:t})=>o.jsx("div",{className:Y("flex-1 w-full",t),children:e});function Zs({resource:e,title:t,description:r,actionSlot:n,className:s}){const a="Permission Denied",i=e?`You don't have permission to access ${e}. Contact your administrator for access.`:"You don't have permission to access this resource. Contact your administrator for access.";return o.jsx(Ja,{className:s,iconSlot:o.jsx(Ce,{size:"lg",className:"text-neutral3",children:o.jsx(N9t,{})}),titleSlot:t??a,descriptionSlot:r??i,actionSlot:n})}function sa({title:e,description:t,className:r}){const[n,s]=b.useState(!1),a=Ge(),i=b.useCallback(async()=>{try{s(!0);const{baseUrl:l="",apiPrefix:c}=a.options||{},u=(c||"/api").trim(),d=(u.startsWith("/")?u:`/${u}`).replace(/\/$/,""),f=new URLSearchParams({redirect_uri:window.location.href}),h=`${l}${d}/auth/sso/login?${f}`,p=await fetch(h,{credentials:"include",headers:{"Content-Type":"application/json"}});if(p.ok){const m=await p.json();window.location.href=m.url}}finally{s(!1)}},[a]);return o.jsx(Ja,{className:r,iconSlot:o.jsx(Ce,{size:"lg",className:"text-neutral3",children:o.jsx(w9t,{})}),titleSlot:e??"Session Expired",descriptionSlot:t??"Your session has expired. Please log in again to continue.",actionSlot:o.jsx(ce,{variant:"default",onClick:i,disabled:n,children:n?"Redirecting...":"Log in"})})}const Cn=({children:e,border:t=!0,className:r})=>o.jsx("header",{className:Y("h-header-default z-50 flex w-full items-center gap-4 bg-transparent px-3",{"border-b border-border1":t},r),children:e}),Qu=({children:e})=>o.jsx(me,{as:"h1",variant:"ui-md",className:"text-neutral6 flex items-center gap-2",children:e}),fu=({children:e})=>o.jsx("div",{className:"ml-auto flex items-center gap-3",children:e}),ULr=({children:e})=>o.jsx("div",{className:"gap-2 flex items-center",children:e}),Yb=e=>o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 34 21",fill:"none",...e,children:o.jsx("path",{d:"M4.49805 11.6934C6.98237 11.6934 8.99609 13.7081 8.99609 16.1924C8.9959 18.6765 6.98225 20.6904 4.49805 20.6904C2.01394 20.6903 0.000196352 18.6765 0 16.1924C0 13.7081 2.01382 11.6935 4.49805 11.6934ZM10.3867 0C12.8709 0 14.8846 2.01388 14.8848 4.49805C14.8848 4.8377 14.847 5.16846 14.7755 5.48643C14.4618 6.88139 14.1953 8.4633 14.9928 9.65L16.2575 11.5319C16.3363 11.6491 16.4727 11.7115 16.6137 11.703C16.7369 11.6957 16.8525 11.6343 16.9214 11.5318L18.1876 9.64717C18.9772 8.47198 18.7236 6.90783 18.4205 5.52484C18.3523 5.21392 18.3164 4.89094 18.3164 4.55957C18.3167 2.07546 20.3313 0.0615234 22.8154 0.0615234C25.2994 0.0617476 27.3132 2.0756 27.3135 4.55957C27.3135 4.93883 27.2665 5.30712 27.178 5.65896C26.8547 6.94441 26.5817 8.37932 27.2446 9.52714L28.459 11.6301C28.4819 11.6697 28.5245 11.6934 28.5703 11.6934C31.0545 11.6935 33.0684 13.7081 33.0684 16.1924C33.0682 18.6765 31.0544 20.6903 28.5703 20.6904C26.0861 20.6904 24.0725 18.6765 24.0723 16.1924C24.0723 15.8049 24.1212 15.4288 24.2133 15.0701C24.5458 13.7746 24.8298 12.3251 24.1609 11.1668L23.0044 9.16384C22.9656 9.09659 22.8931 9.05859 22.8154 9.05859C22.7983 9.05859 22.7824 9.06614 22.7728 9.08033L21.4896 10.9895C20.686 12.1851 20.9622 13.781 21.284 15.1851C21.3582 15.5089 21.3975 15.8461 21.3975 16.1924C21.3973 18.6764 19.3834 20.6902 16.8994 20.6904C14.4152 20.6904 12.4006 18.6765 12.4004 16.1924C12.4004 15.932 12.4226 15.6768 12.4651 15.4286C12.6859 14.14 12.8459 12.7122 12.1167 11.6271L11.2419 10.3253C10.6829 9.49347 9.71913 9.05932 8.78286 8.70188C7.0906 8.05584 5.88867 6.41734 5.88867 4.49805C5.88886 2.0139 7.90254 3.29835e-05 10.3867 0Z",fill:"currentColor"})}),VLr={default:"[&>tbody>tr]:h-table-row",small:"[&>tbody>tr]:h-table-row-small"},qLr=({className:e,children:t,size:r="default",style:n})=>o.jsx("table",{className:Y("w-full",VLr[r],e),style:n,children:t}),HLr=({className:e,children:t})=>o.jsx("thead",{children:o.jsx("tr",{className:Y("h-table-header border-b border-border1 bg-surface2/80",e),children:t})}),QLr=({className:e,children:t,...r})=>o.jsx("th",{className:Y("text-neutral2 text-ui-xs h-full whitespace-nowrap text-left font-medium uppercase tracking-wide first:pl-3 last:pr-3",e),...r,children:t}),WLr=({className:e,children:t,...r})=>o.jsx("tbody",{className:Y("",e),...r,children:t}),GLr=b.forwardRef(({className:e,children:t,selected:r=!1,style:n,onClick:s,isActive:a=!1,...i},l)=>{const c=b.useRef(null);b.useEffect(()=>{l&&(typeof l=="function"?l(c.current):l.current=c.current)},[l]),b.useEffect(()=>{a&&c.current&&(c.current.focus(),c.current.scrollIntoView({block:"nearest"}))},[a]);const u=d=>{d.key==="Enter"&&s&&s()};return o.jsx("tr",{className:Y("border-b border-border1","transition-colors duration-normal ease-out-custom","hover:bg-surface3","focus:bg-surface3 focus:outline-hidden focus:ring-1 focus:ring-inset focus:ring-accent1/50",r&&"bg-surface4",s&&"cursor-pointer",e),style:n,onClick:s,ref:c,tabIndex:s?0:void 0,onKeyDown:u,"data-active":a||void 0,...i,children:t})}),ZLr=({className:e,children:t,...r})=>o.jsx("td",{className:Y("text-neutral5 first:pl-3 last:pr-3",e),...r,children:o.jsx("div",{className:Y("flex h-full w-full shrink-0 items-center"),children:t})}),YLr=x1(Y("flex w-full text-neutral6 border bg-transparent","transition-all duration-normal ease-out-custom","placeholder:text-neutral2 placeholder:transition-opacity placeholder:duration-normal","focus:placeholder:opacity-70","min-h-[80px] resize-y"),{variants:{variant:{default:Y(ddt,cme,ume),unstyled:"border-0 bg-transparent shadow-none focus:shadow-none focus:ring-0"},size:{sm:"px-2 py-1.5 text-ui-sm",md:"px-3 py-2 text-ui-sm",default:"px-3 py-2 text-ui-md",lg:"px-4 py-3 text-ui-sm"}},defaultVariants:{variant:"default",size:"default"}}),gc=b.forwardRef(({className:e,size:t,testId:r,variant:n,error:s,...a},i)=>o.jsx("textarea",{className:Y(YLr({variant:n,size:t}),s&&"border-error focus:ring-error focus:shadow-glow-accent2",e),"data-testid":r,ref:i,"aria-invalid":s,...a}));gc.displayName="Textarea";const XLr=IXt,KLr=RXt,Cdt=PXt;function $t({open:e,onOpenChange:t,children:r}){return o.jsx(XLr,{open:e,onOpenChange:t,children:r})}const pme=b.forwardRef(({className:e,...t},r)=>o.jsx(JYe,{ref:r,className:Y("dialog-overlay-anim fixed inset-0 z-50 bg-overlay backdrop-blur-xs",e),...t}));pme.displayName=JYe.displayName;const jdt=b.forwardRef(({className:e,...t},r)=>o.jsxs(Cdt,{children:[o.jsx(pme,{}),o.jsx(eXe,{ref:r,className:Y("dialog-content-anim","fixed left-[50%] top-[50%] z-50 grid translate-x-[-50%] translate-y-[-50%]","w-full max-w-[calc(100%-2rem)] sm:max-w-lg","rounded-xl border border-border1/40 bg-surface2/96 backdrop-blur-md shadow-dialog",e),...t})]}));jdt.displayName=eXe.displayName;const Tdt=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col gap-0.5 px-4 py-3 text-left",e),...t});Tdt.displayName="AlertDialogHeader";const Ndt=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col-reverse gap-1.5 px-4 py-2.5 sm:flex-row sm:justify-end",e),...t});Ndt.displayName="AlertDialogFooter";const Adt=({className:e,...t})=>o.jsx("div",{className:Y("overflow-y-auto px-4 py-3.5 max-h-[50vh]",e),...t});Adt.displayName="AlertDialogBody";const Idt=b.forwardRef(({className:e,...t},r)=>o.jsx(nXe,{ref:r,className:Y("text-ui-md font-medium",e),...t}));Idt.displayName=nXe.displayName;const Rdt=b.forwardRef(({className:e,...t},r)=>o.jsx(sXe,{ref:r,className:Y("text-ui-sm text-neutral3",e),...t}));Rdt.displayName=sXe.displayName;const Pdt=b.forwardRef(({className:e,...t},r)=>o.jsx(tXe,{ref:r,className:Y(pC({variant:"primary",size:"default"}),e),...t}));Pdt.displayName=tXe.displayName;const Mdt=b.forwardRef(({className:e,...t},r)=>o.jsx(rXe,{ref:r,className:Y(pC({variant:"default",size:"default"}),e),...t}));Mdt.displayName=rXe.displayName;$t.Trigger=KLr;$t.Portal=Cdt;$t.Overlay=pme;$t.Content=jdt;$t.Header=Tdt;$t.Footer=Ndt;$t.Body=Adt;$t.Title=Idt;$t.Description=Rdt;$t.Action=Pdt;$t.Cancel=Mdt;const fi=b.forwardRef(({className:e,...t},r)=>o.jsx(ide,{ref:r,className:Y("peer h-4 w-4 shrink-0 rounded-sm border border-neutral3","shadow-sm",ln.all,"hover:border-neutral5 hover:shadow-md",F9,"disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-neutral3 disabled:hover:shadow-sm","data-[state=checked]:bg-accent1 data-[state=checked]:border-accent1 data-[state=checked]:text-surface1","data-[state=checked]:shadow-glow-accent1",e),...t,children:o.jsx(lXe,{className:Y("flex items-center justify-center text-current","data-[state=checked]:animate-in data-[state=checked]:zoom-in-50 data-[state=checked]:duration-150"),children:o.jsx(cv,{className:"h-3.5 w-3.5 stroke-3"})})}));fi.displayName=ide.displayName;const Cp=UXt,_h=je.forwardRef(({className:e,children:t,...r},n)=>o.jsx(lde,{ref:n,className:Y("-outline-offset-2",ln.colors,i0.visible,"hover:text-neutral5","[&>svg]:transition-transform [&>svg]:duration-normal [&>svg]:ease-out-custom","[&[data-state=open]>svg]:rotate-90",e),...r,children:t}));_h.displayName=lde.displayName;const Eh=je.forwardRef(({className:e,children:t,...r},n)=>o.jsx(ude,{ref:n,className:Y("overflow-hidden","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:slide-in-from-top-1","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-1","duration-normal ease-out-custom",e),...r,children:t}));Eh.displayName=ude.displayName;const yn={root:"flex flex-col gap-1.5",trigger:"w-full min-w-32 justify-between",triggerError:"border-accent2",chevron:"ml-2 h-4 w-4 shrink-0 opacity-50",placeholder:"text-neutral3",popup:Y("min-w-(--anchor-width) w-max max-w-[500px] rounded-md bg-surface3 text-neutral5","shadow-elevated","origin-(--transform-origin)","transition-[transform,scale,opacity] duration-150 ease-out","data-starting-style:scale-95 data-starting-style:opacity-0","data-ending-style:scale-95 data-ending-style:opacity-0"),positioner:"z-50 pointer-events-auto",searchContainer:Y("flex items-center border-b border-border1 px-3 py-2",ln.colors),searchIcon:Y("mr-2 h-4 w-4 shrink-0 text-neutral3",ln.colors),searchInput:Y("flex h-8 w-full rounded-md bg-transparent py-1 text-sm","placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50","outline-hidden",ln.colors),empty:"not-empty:block hidden py-6 text-center text-sm text-neutral3",list:"max-h-dropdown-max-height overflow-y-auto overflow-x-hidden p-1",item:Y("relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm",ln.colors,"data-highlighted:bg-surface5 data-highlighted:text-neutral5"),itemSelected:"data-selected:bg-accent1Dark data-selected:text-accent1",checkContainer:"mr-2 flex h-4 w-4 shrink-0 items-center justify-center",checkIcon:Y("h-4 w-4 text-accent1",ln.opacity),checkbox:"mr-2 flex h-4 w-4 shrink-0 items-center justify-center rounded border",checkboxSelected:"bg-accent1 border-accent1",checkboxUnselected:"border-border1",checkboxIcon:"h-3 w-3 text-white",optionContent:"flex items-center gap-2 w-full min-w-0",optionText:"flex flex-col gap-0.5 min-w-0",optionLabel:"truncate",optionDescription:"text-xs text-neutral3 truncate",optionEnd:"ml-auto",error:"text-xs text-accent2"};function Gl({options:e,value:t,onValueChange:r,placeholder:n="Select option...",searchPlaceholder:s="Search...",emptyText:a="No option found.",className:i,disabled:l=!1,variant:c="default",size:u="default",open:d,onOpenChange:f,container:h,error:p}){const m=e.find(y=>y.value===t)??null,g=y=>{y&&r?.(y.value)};return o.jsxs("div",{className:yn.root,children:[o.jsxs(dKe,{items:e,value:m,onValueChange:g,disabled:l,open:d,onOpenChange:f,children:[o.jsxs(bKe,{className:Y(pC({variant:c,size:u}),yn.trigger,p&&yn.triggerError,i),children:[o.jsxs("span",{className:"truncate flex items-center gap-2",children:[m?.start,o.jsx(ber,{placeholder:n})]}),o.jsx(TF,{className:yn.chevron})]}),o.jsx(OKe,{container:h,children:o.jsx(EKe,{align:"start",sideOffset:4,className:yn.positioner,children:o.jsxs(CKe,{className:yn.popup,children:[o.jsxs("div",{className:yn.searchContainer,children:[o.jsx(x_,{className:yn.searchIcon}),o.jsx(vKe,{className:yn.searchInput,placeholder:s})]}),o.jsx(IKe,{className:yn.empty,children:a}),o.jsx(wKe,{className:yn.list,children:y=>o.jsxs(AKe,{value:y,className:Y(yn.item,yn.itemSelected),children:[o.jsx("span",{className:yn.checkContainer,children:o.jsx(itr,{children:o.jsx(cv,{className:yn.checkIcon})})}),o.jsxs("span",{className:yn.optionContent,children:[y.start,o.jsxs("span",{className:yn.optionText,children:[o.jsx("span",{className:yn.optionLabel,children:y.label}),y.description&&o.jsx("span",{className:yn.optionDescription,children:y.description})]}),y.end?o.jsx("div",{className:yn.optionEnd,children:y.end}):null]})]},y.value)})]})})})]}),p&&o.jsx("span",{className:yn.error,children:p})]})}function Ddt({options:e,value:t=[],onValueChange:r,placeholder:n="Select options...",searchPlaceholder:s="Search...",emptyText:a="No option found.",className:i,disabled:l=!1,variant:c="default",size:u="md",open:d,onOpenChange:f,container:h,error:p}){const m=e.filter(x=>t.includes(x.value)),g=x=>{x&&r?.(x.map(w=>w.value))},y=m.length===0?n:`${m.length} selected`;return o.jsxs("div",{className:yn.root,children:[o.jsxs(dKe,{multiple:!0,items:e,value:m,onValueChange:g,disabled:l,open:d,onOpenChange:f,children:[o.jsxs(bKe,{className:Y(pC({variant:c,size:u}),yn.trigger,p&&yn.triggerError,i),children:[o.jsx("span",{className:Y("truncate",m.length===0&&yn.placeholder),children:y}),o.jsx(TF,{className:yn.chevron})]}),o.jsx(OKe,{container:h,children:o.jsx(EKe,{align:"start",sideOffset:4,className:yn.positioner,children:o.jsxs(CKe,{className:yn.popup,children:[o.jsxs("div",{className:yn.searchContainer,children:[o.jsx(x_,{className:yn.searchIcon}),o.jsx(vKe,{className:yn.searchInput,placeholder:s})]}),o.jsx(IKe,{className:yn.empty,children:a}),o.jsx(wKe,{className:yn.list,children:x=>{const w=t.includes(x.value);return o.jsxs(AKe,{value:x,className:yn.item,children:[o.jsx("span",{className:Y(yn.checkbox,w?yn.checkboxSelected:yn.checkboxUnselected),children:w&&o.jsx(cv,{className:yn.checkboxIcon})}),o.jsxs("span",{className:yn.optionContent,children:[x.start,o.jsxs("span",{className:yn.optionText,children:[o.jsx("span",{className:yn.optionLabel,children:x.label}),x.description&&o.jsx("span",{className:yn.optionDescription,children:x.description})]}),x.end?o.jsx("div",{className:yn.optionEnd,children:x.end}):null]})]},x.value)}})]})})})]}),p&&o.jsx("span",{className:yn.error,children:p})]})}const On=YF,Ldt=FYe,JLr=XF,e$r=YR,$dt=b.forwardRef(({className:e,...t},r)=>o.jsx(GR,{ref:r,className:Y("dialog-overlay-anim fixed inset-0 z-50 bg-overlay backdrop-blur-xs",e),...t}));$dt.displayName=GR.displayName;const vn=b.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(JLr,{children:[o.jsx($dt,{}),o.jsxs(ZR,{ref:n,className:Y("dialog-content-anim","fixed left-[50%] top-[50%] z-50 grid translate-x-[-50%] translate-y-[-50%]","w-full max-w-[calc(100%-2rem)] sm:max-w-lg","rounded-xl border border-border1/40 bg-surface2/96 backdrop-blur-md shadow-dialog",e),...r,children:[t,o.jsx(YR,{asChild:!0,children:o.jsx(ce,{variant:"ghost",size:"sm",className:"absolute top-3 right-3","aria-label":"Close",children:o.jsx(Wl,{})})})]})]}));vn.displayName=ZR.displayName;const kn=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col gap-0.5 px-4 py-3 text-left",e),...t});kn.displayName="DialogHeader";const uf=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col-reverse gap-1.5 px-4 py-2.5 sm:flex-row sm:justify-end",e),...t});uf.displayName="DialogFooter";const Bn=({className:e,...t})=>o.jsx("div",{className:Y("overflow-y-auto px-4 py-3.5 max-h-[50vh]",e),...t});Bn.displayName="DialogBody";const bn=b.forwardRef(({className:e,...t},r)=>o.jsx(KF,{ref:r,className:Y("text-ui-md font-medium",e),...t}));bn.displayName=KF.displayName;const qs=b.forwardRef(({className:e,...t},r)=>o.jsx(JF,{ref:r,className:Y("sr-only",e),...t}));qs.displayName=JF.displayName;const Fdt=b.forwardRef(({className:e,...t},r)=>o.jsx(rd,{ref:r,className:Y("flex h-full w-full flex-col overflow-hidden rounded-md bg-surface3 text-neutral5",e),...t}));Fdt.displayName=rd.displayName;const t$r=({children:e,title:t="Command Palette",description:r="Search for commands and actions",...n})=>{const s=b.useCallback((i,l)=>{const c=i.toLowerCase();return l.toLowerCase().split(/\s+/).filter(Boolean).every(h=>c.includes(h))?1:0},[]),a=b.useCallback(i=>{i.stopPropagation()},[]);return o.jsx(On,{...n,children:o.jsxs(vn,{className:"overflow-hidden p-0",children:[o.jsx(bn,{className:"sr-only",children:t}),o.jsx(qs,{className:"sr-only",children:r}),o.jsx(Fdt,{filter:s,onKeyDown:a,className:Y("**:[[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-neutral3","[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 **:[[cmdk-group]]:px-2","[&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5","**:[[cmdk-input]]:h-12","**:[[cmdk-item]]:px-2 **:[[cmdk-item]]:py-3","[&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5"),children:e})]})})},zdt=b.forwardRef(({className:e,...t},r)=>o.jsxs("div",{className:Y("flex items-center border-b border-border1 px-3",ln.colors),"cmdk-input-wrapper":"",children:[o.jsx(x_,{className:Y("mr-2 h-4 w-4 shrink-0 text-neutral3",ln.colors)}),o.jsx(rd.Input,{ref:r,className:Y("flex h-10 w-full rounded-md bg-transparent py-3 text-sm","placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50","outline-hidden",ln.colors,e),...t})]}));zdt.displayName=rd.Input.displayName;const Bdt=b.forwardRef(({className:e,...t},r)=>o.jsx(rd.List,{ref:r,className:Y("max-h-dropdown-max-height overflow-y-auto overflow-x-hidden",e),...t}));Bdt.displayName=rd.List.displayName;const Udt=b.forwardRef((e,t)=>o.jsx(rd.Empty,{ref:t,className:"py-6 text-center text-sm text-neutral3",...e}));Udt.displayName=rd.Empty.displayName;const fb=b.forwardRef(({className:e,...t},r)=>o.jsx(rd.Group,{ref:r,className:Y("overflow-hidden p-1 text-neutral5","**:[[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-neutral3",e),...t}));fb.displayName=rd.Group.displayName;const iw=b.forwardRef(({className:e,...t},r)=>o.jsx(rd.Separator,{ref:r,className:Y("-mx-1 h-px bg-border1",e),...t}));iw.displayName=rd.Separator.displayName;const Zo=b.forwardRef(({className:e,...t},r)=>o.jsx(rd.Item,{ref:r,className:Y("relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden",ln.colors,"data-[selected=true]:bg-surface5 data-[selected=true]:text-neutral5","data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50","[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));Zo.displayName=rd.Item.displayName;const Vdt=({className:e,...t})=>o.jsx("span",{className:Y("ml-auto text-xs tracking-widest text-neutral3",e),...t});Vdt.displayName="CommandShortcut";function qdt({children:e,className:t}){return o.jsx("div",{className:Y("border border-border1 rounded-lg p-6 bg-surface2",t),children:e})}const r$r=nnr,n$r=snr,s$r=aP,a$r=onr,i$r=anr,mme=Y("relative flex cursor-pointer select-none items-center gap-3 rounded-lg px-3 py-1.5 text-sm transition-colors text-neutral4 dark:hover:text-white dark:focus:text-white hover:text-neutral6 focus:text-neutral6 hover:bg-surface4 focus:bg-surface4 active:bg-surface5 data-disabled:pointer-events-none data-disabled:opacity-50 [&>span]:truncate [&_svg]:size-4 [&_svg]:shrink-0 focus-visible:outline-hidden focus-visible:ring-0","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:opacity-50 [&>svg]:mx-[-.25em] [&:hover>svg]:opacity-100"),Hdt=b.forwardRef(({className:e,children:t,...r},n)=>o.jsx(MJe,{ref:n,className:Y("cursor-pointer",e),...r,children:t}));Hdt.displayName=MJe.displayName;const Qdt=b.forwardRef(({className:e,inset:t,children:r,...n},s)=>o.jsxs(UJe,{ref:s,className:Y(mme,"data-[state=open]:bg-surface4",t&&"pl-8",e),...n,children:[r,o.jsx("span",{className:"ml-auto pl-2",children:o.jsx(zce,{className:"-rotate-90 opacity-50"})})]}));Qdt.displayName=UJe.displayName;const Wdt=b.forwardRef(({className:e,...t},r)=>o.jsx(aP,{children:o.jsx(fz,{ref:r,className:Y("bg-surface3 backdrop-blur-xl data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 z-50 min-w-44 max-h-[min(20rem,var(--radix-dropdown-menu-content-available-height))] overflow-x-hidden overflow-y-auto rounded-xl border-2 border-border1/50 p-1 shadow-md",e),...t})}));Wdt.displayName=fz.displayName;const Gdt=b.forwardRef(({className:e,container:t,sideOffset:r=8,...n},s)=>o.jsx(aP,{container:t,children:o.jsx(DJe,{ref:s,sideOffset:r,className:Y("bg-surface3 data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 backdrop-blur-xl text-neutral4 z-50 min-w-44 max-h-[min(20rem,var(--radix-dropdown-menu-content-available-height))] overflow-x-hidden overflow-y-auto rounded-xl border-2 border-border1/50 p-1 shadow-md",e),...n})}));Gdt.displayName=DJe.displayName;const Zdt=b.forwardRef(({className:e,...t},r)=>o.jsx($Je,{ref:r,className:Y(mme,e),...t}));Zdt.displayName=$Je.displayName;const Ydt=b.forwardRef(({className:e,children:t,checked:r,...n},s)=>o.jsxs(FJe,{ref:s,className:Y(mme,"w-full gap-4 px-2",e),checked:r,...n,children:[o.jsx("div",{className:"border dark:border-white/20 border-black/20 flex h-4 w-4 items-center justify-center rounded-sm",children:r&&o.jsx(cv,{})}),t]}));Ydt.displayName=FJe.displayName;const Xdt=b.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(zJe,{ref:n,className:Y("relative flex cursor-pointer select-none items-center rounded-md py-1.5 pl-8 pr-2 text-sm transition-colors text-neutral4 dark:hover:text-white dark:focus:text-white hover:text-neutral6 focus:text-neutral6 hover:bg-surface4 focus:bg-surface4 active:bg-surface5 data-disabled:pointer-events-none data-disabled:opacity-50 focus-visible:outline-hidden focus-visible:ring-0",e),...r,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(inr,{children:o.jsx(AHe,{className:"h-2 w-2 fill-current"})})}),t]}));Xdt.displayName=zJe.displayName;const Kdt=b.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(LJe,{ref:n,className:Y("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));Kdt.displayName=LJe.displayName;const Jdt=b.forwardRef(({className:e,...t},r)=>o.jsx(BJe,{ref:r,className:Y("bg-border1/50 -mx-1.5 my-1 h-0.5",e),...t}));Jdt.displayName=BJe.displayName;const eft=({className:e,...t})=>o.jsx("span",{className:Y("ml-auto text-xs tracking-widest opacity-60",e),...t});eft.displayName="DropdownMenuShortcut";function yt({open:e,onOpenChange:t,children:r,modal:n}){return o.jsx(r$r,{modal:n,open:e,onOpenChange:t,children:r})}yt.Trigger=Hdt;yt.Content=Gdt;yt.Group=n$r;yt.Portal=s$r;yt.Item=Zdt;yt.CheckboxItem=Ydt;yt.RadioItem=Xdt;yt.Label=Kdt;yt.Separator=Jdt;yt.Shortcut=eft;yt.Sub=a$r;yt.SubContent=Wdt;yt.SubTrigger=Qdt;yt.RadioGroup=i$r;const rL=({label:e,children:t})=>o.jsxs("div",{className:"space-y-2",children:[o.jsx(me,{as:"p",variant:"ui-md",className:"text-neutral3",children:e}),t]});function Dn({className:e,...t}){return o.jsx("div",{className:Y("rounded-md bg-surface4 relative overflow-hidden","before:absolute before:inset-0","before:-translate-x-full","before:animate-[shimmer_2s_infinite]","before:bg-linear-to-r before:from-transparent before:via-surface5/20 before:to-transparent",e),...t})}const tft=({icon:e,title:t,isLoading:r,children:n})=>o.jsxs("div",{className:"p-5 w-full overflow-x-hidden",children:[o.jsxs("div",{className:"text-neutral6 flex items-center gap-2",children:[o.jsx(Ce,{size:"lg",className:"bg-surface4 rounded-md p-1",children:e}),r?o.jsx(Dn,{className:"h-3 w-1/3"}):o.jsx("div",{className:"flex min-w-0 items-center gap-4",children:o.jsx(me,{variant:"header-md",as:"h2",className:"truncate font-medium",children:t})})]}),n&&o.jsx("div",{className:"pt-2",children:n})]});function o$r({children:e,className:t}){return o.jsx("div",{className:Y("grid gap-2 text-neutral4",t),children:e})}function l$r({children:e}){return o.jsxs("p",{className:Y("text-ui-sm text-neutral4 flex items-center gap-2","[&>svg]:w-[1.2em] [&>svg]:h-[1.2em] [&>svg]:opacity-70 [&>svg]:text-red-400"),children:[o.jsx(LE,{})," ",e]})}function c$r({children:e}){return o.jsx("p",{className:"text-neutral3 text-ui-sm",children:e})}function u$r({children:e,name:t,required:r,size:n="default",className:s}){return o.jsxs("label",{htmlFor:`input-${t}`,className:Y("text-ui-smd text-neutral3 flex justify-between items-center ","in-[.horizontal-field-block]:grid in-[.horizontal-field-block]:content-start",{"text-ui-md":n==="bigger"},s),children:[e,r&&o.jsx("i",{className:"text-neutral2 text-xs",children:"(required)"})]})}function d$r({children:e,className:t,layout:r="vertical",labelColumnWidth:n}){return o.jsx("div",{className:Y("grid gap-2 text-neutral4",{"horizontal-field-block grid-cols-[auto_1fr] items-baseline":r==="horizontal"},t),style:r==="horizontal"&&n?{gridTemplateColumns:`${n} 1fr`}:void 0,children:e})}const mo=Object.assign({},{Layout:d$r,Column:o$r,Label:u$r,HelpText:c$r,ErrorMsg:l$r});function f$r({children:e,className:t}){return o.jsx("div",{className:Y("grid gap-6 content-start",t),children:e})}function h$r({children:e,className:t,columns:r=1,gap:n}){return o.jsx("div",{className:Y("grid",{"grid-cols-1":r===1,"grid-cols-2":r===2},n??"gap-6",t),children:e})}Object.assign(h$r,{Column:f$r});const p$r=x1(Y("flex w-full text-neutral6 border bg-transparent","transition-all duration-normal ease-out-custom","placeholder:text-neutral2 placeholder:transition-opacity placeholder:duration-normal","focus:placeholder:opacity-70"),{variants:{variant:{default:Y(ddt,cme,ume),unstyled:"border-0 bg-transparent shadow-none focus:shadow-none focus:ring-0"},size:{sm:`${lc.sm} text-ui-sm px-[.75em]`,md:`${lc.md} text-ui-md px-[.75em]`,default:`${lc.default} text-ui-md px-[.85em]`,lg:`${lc.lg} text-ui-lg px-[.85em]`}},defaultVariants:{variant:"default",size:"default"}}),ar=b.forwardRef(({className:e,size:t,testId:r,variant:n,type:s,error:a,...i},l)=>o.jsx("input",{type:s,className:Y(p$r({variant:n,size:t}),a&&"border-error focus:ring-error focus:shadow-glow-accent2",e),"data-testid":r,ref:l,"aria-invalid":a,...i}));ar.displayName="Input";function Sx({name:e,value:t,label:r,labelIsHidden:n=!1,labelColumnWidth:s,helpText:a,errorMsg:i,required:l=!1,disabled:c=!1,labelSize:u,layout:d="vertical",placeholder:f,size:h="default",testId:p,className:m,...g}){return o.jsxs(mo.Layout,{layout:d,labelColumnWidth:s,className:m,children:[d==="horizontal"?o.jsx(mo.Column,{children:o.jsx(mo.Label,{name:e,required:l,size:u||"bigger",children:n?o.jsx(Zu,{children:r}):r})}):null,o.jsxs(mo.Column,{children:[!n&&d==="vertical"?o.jsx(mo.Label,{name:e,required:l,size:u||"default",children:r}):null,o.jsx(ar,{name:e,disabled:c,required:l,value:t,placeholder:f,"data-testid":p,size:h,...g}),a&&o.jsx(mo.HelpText,{children:a}),i&&o.jsx(mo.ErrorMsg,{children:i})]})]})}function Ox({name:e,helpText:t,errorMsg:r,required:n=!1,disabled:s=!1,value:a,label:i,labelIsHidden:l=!1,layout:c="vertical",placeholder:u="Search...",onChange:d,onReset:f,className:h,size:p,isMinimized:m,onMinimizedChange:g}){const y=b.useRef(null);return b.useEffect(()=>{m===!1&&y.current?.focus()},[m]),m?o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(ce,{size:p||"sm","aria-label":i||"Search",disabled:s,onClick:()=>g?.(!1),children:o.jsx(x_,{})})}),o.jsx(Wr,{children:i||"Search"})]}):o.jsxs(mo.Layout,{layout:c,className:h,children:[c==="horizontal"?o.jsx(mo.Column,{children:o.jsx(mo.Label,{name:e,required:n,children:l?o.jsx(Zu,{children:i}):i})}):null,o.jsxs(mo.Column,{children:[c==="vertical"&&i&&!l?o.jsx(mo.Label,{name:e,required:n,children:i}):null,o.jsxs("div",{className:"relative group",children:[o.jsx(ar,{ref:y,name:e,disabled:s,value:a,placeholder:u,onChange:d,size:p,className:Y(p==="sm"&&"pl-8 pr-8",p==="md"&&"pl-9 pr-9",(!p||p==="default")&&"pl-10 pr-10",p==="lg"&&"pl-11 pr-11")}),o.jsx(x_,{"aria-hidden":"true",className:Y("text-neutral4 opacity-50 group-has-focus:opacity-100 absolute left-3 top-1/2 -translate-y-1/2",p==="sm"&&"w-3.5 h-3.5",p==="md"&&"w-4 h-4",(!p||p==="default")&&"w-[1.125rem] h-[1.125rem]",p==="lg"&&"w-5 h-5")}),f&&(a||m===!1)&&o.jsx(ce,{variant:"ghost",size:p||"default","aria-label":"Clear search",onClick:()=>{a&&f(),m===!1&&g?.(!0)},className:"absolute top-1/2 right-0 -translate-y-1/2",children:o.jsx(Wl,{})})]}),t&&o.jsx(mo.HelpText,{children:t}),r&&o.jsx(mo.ErrorMsg,{children:r})]})]})}const hi=Dnr,pi=Lnr,ei=b.forwardRef(({className:e,children:t,variant:r="default",size:n="default",...s},a)=>o.jsxs(pet,{ref:a,className:Y(pC({variant:r,size:n}),"justify-between [&>svg]:opacity-100",e),...s,children:[t,o.jsx($nr,{asChild:!0,children:o.jsx(zce,{className:Y("h-4 w-4 text-neutral3",ln.colors)})})]}));ei.displayName=pet.displayName;const ti=b.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>o.jsx(Fnr,{children:o.jsx(met,{ref:s,className:Y("relative z-50 min-w-32 max-h-dropdown-max-height overflow-y-auto overflow-x-hidden rounded-md border border-border1 bg-surface3 text-neutral5 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",r==="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:r,...n,children:o.jsx(znr,{className:Y("p-1",r==="popper"&&"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"),children:t})})}));ti.displayName=met.displayName;const ss=b.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(get,{ref:n,className:Y("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-neutral5 text-sm",ln.colors,"hover:bg-surface5 hover:text-neutral5","focus:bg-surface5 focus:text-neutral5","data-[state=checked]:bg-accent1Dark data-[state=checked]:text-accent1","data-disabled:pointer-events-none data-disabled:opacity-50",e),...r,children:[o.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(Unr,{children:o.jsx(cv,{className:"h-4 w-4 text-accent1"})})}),o.jsx(Bnr,{children:t})]}));ss.displayName=get.displayName;function $o({name:e,helpText:t,errorMsg:r,required:n=!1,disabled:s=!1,size:a="default",value:i,label:l,labelIsHidden:c=!1,layout:u="vertical",labelColumnWidth:d,options:f,placeholder:h="Select an option",onValueChange:p,className:m}){return o.jsxs(mo.Layout,{layout:u,labelColumnWidth:d,className:m,children:[u==="horizontal"?o.jsx(mo.Column,{children:o.jsx(mo.Label,{name:e,required:n,children:c?o.jsx(Zu,{children:l}):l})}):null,o.jsxs(mo.Column,{children:[u==="vertical"&&l&&!c?o.jsx(mo.Label,{name:e,required:n,children:l}):null,o.jsxs(hi,{"aria-label":c?l:void 0,name:e,value:i,onValueChange:p,disabled:s,children:[o.jsx(ei,{size:a,children:o.jsx(pi,{placeholder:h})}),o.jsx(ti,{children:f.map(g=>o.jsx(ss,{value:g.value,children:g.label},g.value))})]}),t&&o.jsx(mo.HelpText,{children:t}),r&&o.jsx(mo.ErrorMsg,{children:r})]})]})}const m$r=x1("text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),xt=b.forwardRef(({className:e,...t},r)=>o.jsx(vet,{ref:r,className:Y(m$r(),e),...t}));xt.displayName=vet.displayName;function X_({children:e}){const t=e.replace(/\\n/g,`
|
|
294
294
|
`);return o.jsx(Het,{remarkPlugins:[mtt],components:y$r,className:"space-y-3",children:t})}const rft=je.memo(({children:e,language:t,...r})=>{const[n,s]=b.useState([]);return b.useEffect(()=>{BLr(e,t).then(a=>{a&&s(a)})},[e,t]),n.length?o.jsx("pre",{...r,children:o.jsx("code",{children:n.map((a,i)=>o.jsxs(o.Fragment,{children:[o.jsx("span",{children:a.map((l,c)=>{const u=typeof l.htmlStyle=="string"?void 0:l.htmlStyle;return o.jsx("span",{className:"text-shiki-light bg-shiki-light-bg dark:text-shiki-dark dark:bg-shiki-dark-bg",style:u,children:l.content},c)})},i),i!==n.length-1&&`
|
|
295
295
|
`]}))})}):o.jsx("pre",{...r,children:e})});rft.displayName="HighlightedCode";const g$r=({children:e,className:t,language:r,...n})=>{const s=typeof e=="string"?e:hie(e),a=Y("overflow-x-scroll rounded-md border bg-surface1/50 p-4 font-mono text-sm [scrollbar-width:none]",t);return o.jsxs("div",{className:"group/code relative mb-4",children:[o.jsx(b.Suspense,{fallback:o.jsx("pre",{className:a,...n,children:e}),children:o.jsx(rft,{language:r,className:a,children:s})}),o.jsx("div",{className:"invisible absolute right-2 top-2 flex space-x-1 rounded-lg p-1 opacity-0 transition-all duration-200 group-hover/code:visible group-hover/code:opacity-100",children:o.jsx(ta,{content:s,copyMessage:"Copied code to clipboard"})})]})};function hie(e){if(typeof e=="string")return e;if(e?.props?.children){let t=e.props.children;return Array.isArray(t)?t.map(r=>hie(r)).join(""):hie(t)}return""}const y$r={h1:({children:e,...t})=>o.jsx("h1",{className:"text-2xl font-semibold",...t,children:e}),h2:({children:e,...t})=>o.jsx("h2",{className:"font-semibold text-xl",...t,children:e}),h3:({children:e,...t})=>o.jsx("h3",{className:"font-semibold text-lg",...t,children:e}),h4:({children:e,...t})=>o.jsx("h4",{className:"font-semibold text-base",...t,children:e}),h5:({children:e,...t})=>o.jsx("h5",{className:"font-medium",...t,children:e}),strong:({children:e,...t})=>o.jsx("strong",{className:"font-semibold",...t,children:e}),a:({children:e,...t})=>o.jsx("a",{className:"underline underline-offset-2",...t,children:e}),blockquote:({children:e,...t})=>o.jsx("blockquote",{className:"border-l-2 border-neutral6 pl-4",...t,children:e}),code:({children:e,className:t,...r})=>{const n=/language-(\w+)/.exec(t||"");return n?o.jsx(g$r,{className:t,language:n[1],...r,children:e}):o.jsx("code",{className:Y("font-mono [:not(pre)>&]:rounded-md [:not(pre)>&]:bg-surface1/50 [:not(pre)>&]:px-1 [:not(pre)>&]:py-0.5"),...r,children:e})},pre:({children:e})=>e,ol:({children:e,...t})=>o.jsx("ol",{className:"list-decimal space-y-2 pl-6",...t,children:e}),ul:({children:e,...t})=>o.jsx("ul",{className:"list-disc space-y-2 pl-6",...t,children:e}),li:({children:e,...t})=>o.jsx("li",{className:"my-1.5",...t,children:e}),table:({children:e,...t})=>o.jsx("table",{className:"w-full border-collapse overflow-y-auto rounded-md border border-neutral6/20",...t,children:e}),th:({children:e,...t})=>o.jsx("th",{className:"border border-neutral6/20 px-4 py-2 text-left font-bold [[align=center]]:text-center [[align=right]]:text-right",...t,children:e}),td:({children:e,...t})=>o.jsx("td",{className:"border border-neutral6/20 px-4 py-2 text-left [[align=center]]:text-center [[align=right]]:text-right",...t,children:e}),tr:({children:e,...t})=>o.jsx("tr",{className:"m-0 border-t p-0 even:bg-surface4",...t,children:e}),p:({children:e,...t})=>o.jsx("p",{className:"whitespace-pre-wrap leading-relaxed",...t,children:e}),hr:({...e})=>o.jsx("hr",{className:"border-neutral6/20",...e})};function v$r({children:e,className:t}){return o.jsx("div",{className:Y("overflow-x-auto ",t),children:e})}function nft({children:e,className:t}){return o.jsx("p",{className:Y("text-ui-md text-neutral2 leading-tight mt-0.5",t),children:e})}function b$r({message:e="Failed to load data",className:t}){return o.jsx("div",{className:Y("flex flex-col gap-3 items-center justify-center",t),children:o.jsx("p",{className:"text-ui-sm text-accent2",children:e})})}const x$r={sm:"w-4 h-4",md:"w-6 h-6",lg:"w-8 h-8"};function Dt({color:e,className:t,size:r="md"}){return o.jsx("svg",{className:Y("animate-spin",x$r[r],t),style:{animationDuration:"800ms",animationTimingFunction:"cubic-bezier(0.4, 0, 0.2, 1)"},xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56",stroke:e||"currentColor",className:"text-accent1"})})}function w$r({className:e}){return o.jsx("div",{className:Y("flex items-center justify-center",e),children:o.jsx(Dt,{size:"md",color:ky.neutral1})})}function S$r({message:e="No data yet",className:t}){return o.jsx("div",{className:Y("flex items-center justify-center h-full",t),children:o.jsx("p",{className:"text-neutral1 text-sm",children:e})})}function aRe({children:e,className:t}){return o.jsx(qdt,{className:Y("flex-1 grid grid-rows-[4rem_1fr] min-h-72 gap-2 min-w-80 md:min-w-[22rem] lg:min-w-[24rem] xl:min-w-[26rem] 2xl:min-w-[30rem]",t),children:e})}function O$r({value:e,label:t,className:r}){return o.jsxs("div",{className:Y("grid justify-end content-start text-right gap-1",r),children:[o.jsx("span",{className:"text-ui-lg font-semibold text-neutral4 leading-none",children:e}),t&&o.jsx("span",{className:"text-ui-md text-neutral2",children:t})]})}function sft({children:e,className:t,as:r="h2"}){return o.jsx(r,{className:Y("text-ui-md font-normal text-neutral4",t),children:e})}function k$r(e){if("children"in e)return o.jsx("div",{className:e.className,children:e.children});const{title:t,description:r,titleAs:n}=e;return o.jsxs("div",{className:e.className,children:[o.jsx(sft,{as:n,children:t}),r&&o.jsx(nft,{children:r})]})}function _$r({children:e,className:t}){return o.jsx("div",{className:Y("grid grid-cols-[1fr_auto] gap-4",t),children:e})}function E$r({changePct:e,prevValue:t,lowerIsBetter:r,className:n}){const s=r?e<0:e>=0;return o.jsxs("div",{className:Y("flex items-center gap-1 text-sm text-neutral1 flex-wrap",n),children:[o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("span",{className:Y("[&>svg]:w-4 [&>svg]:h-4",s?"text-green-600":"text-red-600"),children:e>=0?o.jsx(z9t,{}):o.jsx($9t,{})}),o.jsx("span",{className:Y(s?"text-green-600":"text-red-600"),children:`${e>=0?"+":"-"}${Math.abs(e).toFixed(1)}%`})]}),t&&o.jsxs("div",{children:["vs previous ",o.jsx("b",{className:"text-neutral2 font-semibold",children:t})]})]})}function C$r({message:e="Failed to load data",className:t}){return o.jsx("span",{className:Y("text-ui-sm text-accent2",t),children:e})}function j$r({children:e,className:t}){return o.jsx("span",{className:Y("text-ui-md text-neutral3 leading-relaxed",t),children:e})}function T$r({className:e}){return o.jsx("span",{className:Y("text-sm",e),children:o.jsx(Dt,{size:"md",color:ky.neutral1})})}function N$r({message:e="No previous value to compare",className:t}){return o.jsx("span",{className:Y("text-sm text-neutral1",t),children:e})}function A$r({message:e="No data yet",className:t}){return o.jsx("span",{className:Y("text-sm text-neutral1",t),children:e})}function I$r({children:e,className:t}){return o.jsx(qdt,{className:Y("flex-1 min-w-60",t),children:o.jsx("div",{className:"grid gap-1",children:e})})}function R$r({children:e,className:t}){return o.jsx("strong",{className:Y("text-header-lg text-neutral4 font-semibold",t),children:e})}const En=Object.assign(I$r,{Label:j$r,Value:R$r,Change:E$r,NoChange:N$r,NoData:A$r,Error:C$r,Loading:T$r}),Wt=Object.assign(aRe,{Root:aRe,Kpi:En,TopBar:_$r,TitleAndDescription:k$r,Title:sft,Description:nft,Summary:O$r,Loading:w$r,Error:b$r,Content:v$r,NoData:S$r});function pie({children:e,className:t}){return o.jsx("div",{className:Y("flex flex-wrap gap-8",t),children:e})}const _f=Icr,id=Rcr,hu=b.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},s)=>o.jsx(Pcr,{children:o.jsx(Ett,{ref:s,align:t,sideOffset:r,className:Y("z-50 w-72 rounded-xl border-2 border-border1/50 bg-surface3 text-neutral5 shadow-md focus-visible:outline-hidden 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&&/\bp[trblxy]?-\S+/.test(e)?!1:"py-3.5 px-3",e),...n})}));hu.displayName=Ett.displayName;function aft({children:e,...t}){const[r,n]=b.useState(!1),s=b.useRef(void 0),a=b.useCallback(()=>{clearTimeout(s.current),n(!0)},[]),i=b.useCallback(()=>{s.current=setTimeout(()=>n(!1),150)},[]);return b.useEffect(()=>()=>clearTimeout(s.current),[]),o.jsx(_f,{open:r,onOpenChange:n,...t,children:o.jsx("span",{onMouseEnter:a,onMouseLeave:i,onFocusCapture:a,onBlurCapture:i,style:{display:"contents"},children:e})})}function ift({disabled:e,onClear:t,onRemoveAll:r,onSave:n,onRemoveSaved:s}){const a=!!(r||n||s),i=!!t;return!i&&!a?null:o.jsxs("div",{className:"flex items-center gap-2",children:[i&&o.jsxs(ce,{disabled:e,size:"md",onClick:()=>t(),children:[o.jsx(Wl,{}),"Clear"]}),a&&o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsx(ce,{disabled:e,size:"md","aria-label":"More filter actions",children:o.jsx(Vzt,{})})}),o.jsxs(yt.Content,{align:"end",children:[r&&o.jsxs(yt.Item,{onSelect:()=>r(),children:[o.jsx(Wl,{}),"Remove all filters"]}),r&&(n||s)&&o.jsx(yt.Separator,{}),n&&o.jsxs(yt.Item,{onSelect:()=>n(),children:[o.jsx(PHe,{}),"Save filters for next time"]}),s&&o.jsxs(yt.Item,{onSelect:()=>s(),children:[o.jsx(MHe,{}),"Remove saved filters"]})]})]})]})}const yC=b.forwardRef(({className:e,...t},r)=>o.jsx(Ftt,{className:Y("grid gap-2",e),...t,ref:r}));yC.displayName=Ftt.displayName;const Xc=b.forwardRef(({className:e,...t},r)=>o.jsx(ztt,{ref:r,className:Y("aspect-square h-4 w-4 rounded-full border border-neutral3 text-neutral6","shadow-sm",ln.all,"hover:border-neutral5 hover:shadow-md",F9,"disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-neutral3 disabled:hover:shadow-sm","data-[state=checked]:border-accent1 data-[state=checked]:shadow-glow-accent1",e),...t,children:o.jsx(qcr,{className:Y("flex items-center justify-center","data-[state=checked]:animate-in data-[state=checked]:zoom-in-50 data-[state=checked]:duration-150"),children:o.jsx(AHe,{className:"h-2 w-2 fill-accent1 text-accent1"})})}));Xc.displayName=ztt.displayName;function oft({field:e,tokens:t,onChange:r}){const[n,s]=b.useState(""),a=b.useMemo(()=>{const u=n.trim().toLowerCase();return u?e.options.filter(d=>d.label.toLowerCase().includes(u)):e.options},[e.options,n]),i=b.useMemo(()=>t.find(u=>u.fieldId===e.id),[t,e.id]),l=typeof i?.value=="string"?i.value:void 0,c=b.useMemo(()=>Array.isArray(i?.value)?i.value:typeof i?.value=="string"?[i.value]:[],[i]);return o.jsxs(o.Fragment,{children:[e.searchable!==!1&&o.jsx(ar,{size:"sm",value:n,onChange:u=>s(u.target.value),placeholder:`Search ${e.label.toLowerCase()}...`,className:"mb-2",onKeyDown:u=>{if(u.key!=="ArrowDown")return;const f=u.currentTarget.closest("[data-pick-multi-panel]")?.querySelector("[data-pick-multi-item]:not([disabled])");f&&(u.preventDefault(),u.stopPropagation(),f.focus())}}),e.isLoading?o.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 text-ui-sm text-neutral3",children:[o.jsx(Dt,{size:"sm",className:"w-3 h-3",color:"var(--neutral3)"}),"Loading options…"]}):a.length===0?o.jsx("div",{className:"px-2 py-1.5 text-ui-sm text-neutral3",children:e.emptyText??"No option found."}):e.multi?o.jsx("div",{className:"max-h-[80dvh] overflow-auto",children:a.map(u=>{const d=c.includes(u.value);return o.jsxs("label",{title:u.label,className:"flex items-center gap-2 rounded-md px-2 py-1.5 text-ui-md text-neutral4 hover:bg-surface4 hover:text-neutral6 cursor-pointer focus-within:bg-surface4 focus-within:text-neutral6 min-w-0",children:[o.jsx(fi,{"data-pick-multi-item":"",checked:d,onCheckedChange:f=>{const p=f===!0?c.includes(u.value)?c:[...c,u.value]:c.filter(m=>m!==u.value);r(e.id,p)},className:"shrink-0"}),o.jsx("span",{className:"truncate min-w-0 flex-1",children:u.label})]},u.value)})}):o.jsxs(yC,{value:l??"",onValueChange:u=>r(e.id,u),className:"max-h-[80dvh] gap-0 overflow-auto",children:[a.map(u=>o.jsxs("label",{title:u.label,className:"flex items-center gap-2 rounded-md px-2 py-1.5 text-ui-md text-neutral4 hover:bg-surface4 hover:text-neutral6 cursor-pointer focus-within:bg-surface4 focus-within:text-neutral6 min-w-0",children:[o.jsx(Xc,{"data-pick-multi-item":"",value:u.value,className:"shrink-0"}),o.jsx("span",{className:"truncate min-w-0 flex-1",children:u.label})]},u.value)),o.jsxs("label",{title:"Any",className:"flex items-center gap-2 rounded-md px-2 py-1.5 text-ui-md text-neutral4 hover:bg-surface4 hover:text-neutral6 cursor-pointer focus-within:bg-surface4 focus-within:text-neutral6 min-w-0",children:[o.jsx(Xc,{"data-pick-multi-item":"",value:"Any",className:"shrink-0"}),o.jsx("span",{className:"truncate min-w-0 flex-1",children:"Any"})]})]})]})}function lft(e){return Array.isArray(e)?e.length===0?"Any":e.join(", "):e}const gme="inline-flex",cft=`${lc.md} border-y-2 border-border1 px-[.75em] text-neutral3 whitespace-nowrap flex items-center`,yme=`${cft} text-ui-md rounded-l-lg border-l-2 border-r-1`,vme=`${cft} text-ui-md `,bme="rounded-tl-none rounded-bl-none border-l-transparent",P$r="rounded-none",M$r="rounded-none";function D$r({field:e,value:t,onChange:r,onRemove:n,disabled:s,autoFocus:a}){const[i,l]=b.useState(t),c=b.useRef(null);return b.useEffect(()=>{i.trim()!==t&&l(t)},[t]),b.useEffect(()=>{a&&c.current?.focus()},[a]),o.jsxs("div",{className:gme,children:[o.jsx("span",{className:yme,children:e.label}),o.jsx("span",{className:vme,children:"is"}),o.jsx(ar,{ref:c,size:"md",disabled:s,value:i,placeholder:e.placeholder??`Enter ${e.label}`,className:P$r,onChange:u=>{const d=u.target.value;l(d),d.trim()!==t&&r(d)},onKeyDown:u=>{if(u.key==="Enter"){u.preventDefault();const d=i.trim();d!==t&&r(d)}else u.key==="Escape"&&(u.preventDefault(),l(t),u.target.blur())}}),o.jsx(ce,{type:"button",disabled:s,"aria-label":`Remove ${e.label} filter`,className:bme,size:"md",onMouseDown:u=>u.preventDefault(),onClick:n,children:o.jsx(Wl,{})})]})}function L$r({field:e,token:t,tokens:r,onChange:n,onRemove:s,disabled:a}){const[i,l]=b.useState(!1);return o.jsxs("div",{className:gme,children:[o.jsx("span",{className:yme,children:e.label}),o.jsx("span",{className:vme,children:"is"}),o.jsxs(_f,{open:i,onOpenChange:l,children:[o.jsx(id,{asChild:!0,children:o.jsx(ce,{type:"button",disabled:a,size:"md",className:M$r,children:lft(t.value)})}),o.jsx(hu,{align:"start",sideOffset:8,className:"w-64 p-2","data-pick-multi-panel":!0,children:o.jsx(oft,{field:e,tokens:r,onChange:n})})]}),o.jsx(ce,{type:"button",disabled:a,"aria-label":`Remove ${e.label} filter`,className:bme,size:"md",onClick:s,children:o.jsx(Wl,{})})]})}function uft({fields:e,tokens:t,onTokensChange:r,disabled:n,autoFocusFieldId:s}){if(t.length===0)return null;const a=(l,c)=>{const u=[...t];u[l]=c,r(u)},i=l=>{r(t.filter((c,u)=>u!==l))};return o.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:t.map((l,c)=>{const u=e.find(d=>d.id===l.fieldId);return u?u.kind==="text"&&typeof l.value=="string"?o.jsx(D$r,{field:u,value:l.value,disabled:n,autoFocus:s===l.fieldId,onChange:d=>a(c,{fieldId:l.fieldId,value:d}),onRemove:()=>i(c)},`${l.fieldId}-${c}`):u.kind==="pick-multi"?o.jsx(L$r,{field:u,token:l,tokens:t,disabled:n,onChange:(d,f)=>{if(f===void 0){i(c);return}a(c,{fieldId:d,value:f})},onRemove:()=>i(c)},`${l.fieldId}-${c}`):o.jsxs("div",{className:gme,children:[o.jsx("span",{className:yme,children:u.label}),o.jsx("span",{className:vme,children:"is"}),o.jsx("span",{className:"px-2.5 py-1.5 max-w-[20rem] truncate",children:lft(l.value)}),o.jsx(ce,{type:"button",disabled:n,size:"md","aria-label":`Remove ${u.label} filter`,className:bme,onClick:()=>i(c),children:o.jsx(Wl,{})})]},`${l.fieldId}-${c}`):null})})}function dft({fields:e,tokens:t,onTokensChange:r,label:n="Add Filter",disabled:s,size:a,onStartTextFilter:i}){const[l,c]=b.useState(!1),[u,d]=b.useState(),[f,h]=b.useState(""),[p,m]=b.useState([]),[g,y]=b.useState(),[x,w]=b.useState(),S=b.useRef(null),k=b.useRef(!1),_=b.useCallback(R=>{w(B=>B===R?void 0:R)},[]),E=b.useCallback(()=>w(void 0),[]);b.useEffect(()=>{l||w(void 0)},[l]);const T=b.useMemo(()=>e.find(R=>R.id===u),[e,u]),j=b.useMemo(()=>{const R=new Set;for(const B of t){const D=e.find($=>$.id===B.fieldId);D&&D.kind!=="pick-multi"&&R.add(B.fieldId)}return R},[t,e]),N=b.useCallback(()=>{d(void 0),h(""),m([]),y(void 0)},[]);b.useEffect(()=>{l||N()},[l,N]),b.useEffect(()=>{l&&T?.kind==="text"&&S.current?.focus()},[l,T]);const I=b.useCallback((R,B)=>{const D=t.findIndex(z=>z.fieldId===R);if(B===void 0||Array.isArray(B)&&B.length===0){if(D===-1)return;r(t.filter((z,H)=>H!==D));return}if(D===-1){r([...t,{fieldId:R,value:B}]);return}const U=[...t];U[D]={fieldId:R,value:B},r(U)},[r,t]),P=b.useCallback(()=>{if(!T){y("Choose a property first.");return}if(j.has(T.id)){y(`Remove the existing ${T.label} filter before adding another.`);return}if(T.kind==="text"&&!f.trim()){y(`Enter a value for ${T.label}.`);return}if(T.kind==="multi-select"&&p.length===0){y(`Choose at least one ${T.label.toLowerCase()} value.`);return}const R=T.kind==="multi-select"?{fieldId:T.id,value:p}:{fieldId:T.id,value:f.trim()};r([...t,R]),c(!1)},[p,r,T,j,f,t]);return o.jsxs(_f,{open:l,onOpenChange:c,children:[o.jsx(id,{asChild:!0,children:o.jsxs(ce,{variant:"outline",size:a,disabled:s,children:[o.jsx(g9t,{}),n]})}),o.jsx(hu,{align:"end",className:"p-3 w-64",onOpenAutoFocus:R=>R.preventDefault(),onCloseAutoFocus:R=>{k.current&&(k.current=!1,R.preventDefault())},children:o.jsxs("div",{className:"grid gap-3",children:[T&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("button",{type:"button","aria-label":"Back to properties",className:"text-neutral3 hover:text-neutral6 transition-colors",onClick:()=>{d(void 0),h(""),m([]),y(void 0)},children:o.jsx(DE,{className:"h-4 w-4"})}),o.jsx(a9t,{className:"h-4 w-4 shrink-0 text-neutral3"}),o.jsx("span",{className:"text-ui-sm text-neutral3",children:`${T.label} · is`})]}),!T&&o.jsx("div",{role:"menu",className:"max-h-[80dvh] overflow-auto",onKeyDown:R=>{if(R.key!=="ArrowDown"&&R.key!=="ArrowUp"&&R.key!=="Home"&&R.key!=="End")return;const B=Array.from(R.currentTarget.querySelectorAll("[data-filter-item]:not([disabled])"));if(B.length===0)return;R.preventDefault();const D=document.activeElement,$=B.findIndex(z=>z===D);let U;R.key==="Home"?U=0:R.key==="End"?U=B.length-1:R.key==="ArrowDown"?U=$<0?0:($+1)%B.length:U=$<=0?B.length-1:$-1,B[U]?.focus()},children:e.length>0?e.map(R=>{const B=j.has(R.id);return R.kind==="pick-multi"?o.jsx($$r,{field:R,tokens:t,onChange:I,open:x===R.id,onToggle:_,onClose:E},R.id):o.jsxs("button",{type:"button",role:"menuitem","data-filter-item":"",className:Y("group flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-ui-md transition-colors","focus:bg-surface4 focus:text-neutral6 focus:outline-none",B?"cursor-not-allowed text-neutral2 opacity-70":"text-neutral4 hover:bg-surface4 hover:text-neutral6"),disabled:B,onClick:()=>{if(y(void 0),R.kind==="text"){r([...t,{fieldId:R.id,value:""}]),i?.(R.id),k.current=!0,c(!1);return}d(R.id)},children:[o.jsx("span",{className:"truncate",children:R.label}),B?o.jsx("span",{className:"ml-auto text-neutral3",children:"In use"}):o.jsx(Hce,{className:"ml-auto h-4 w-4 text-neutral3 opacity-0 transition-opacity group-hover:opacity-100 group-focus:opacity-100"})]},R.id)}):o.jsx("div",{className:"px-2 py-1.5 text-ui-sm text-neutral3",children:"No matching property."})}),T&&T.kind==="text"&&o.jsx(ar,{ref:S,size:"md",value:f,onChange:R=>{h(R.target.value),y(void 0)},placeholder:T.placeholder??`Enter ${T.label}`,onKeyDown:R=>{R.key==="Enter"&&(R.preventDefault(),P())}}),T&&T.kind==="multi-select"&&o.jsx(Ddt,{options:T.options??[],value:p,onValueChange:R=>{m(R),y(void 0)},placeholder:T.placeholder??`Choose ${T.label}`,searchPlaceholder:`Search ${T.label.toLowerCase()}...`,emptyText:T.emptyText??"No option found.",size:"md"}),g&&o.jsx("div",{className:"text-ui-sm text-red-500",children:g}),T&&T.kind!=="pick-multi"&&o.jsxs("div",{className:"flex items-center justify-end gap-2",children:[o.jsx(ce,{variant:"ghost",size:"md",onClick:()=>c(!1),children:"Cancel"}),o.jsx(ce,{variant:"outline",size:"md",onClick:P,children:"Add filter"})]})]})})]})}function $$r({field:e,tokens:t,onChange:r,open:n,onToggle:s,onClose:a}){const i=b.useRef(null);return o.jsxs(_f,{open:n,onOpenChange:l=>{l?s(e.id):a()},children:[o.jsx(id,{asChild:!0,children:o.jsxs("button",{type:"button",role:"menuitem","data-filter-item":"",className:Y("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-ui-md text-neutral4 hover:bg-surface4 hover:text-neutral6 transition-colors","focus:bg-surface4 focus:text-neutral6 focus:outline-none"),onKeyDown:l=>{l.key!=="ArrowRight"&&l.key!=="ArrowLeft"||(n||s(e.id),l.preventDefault(),requestAnimationFrame(()=>{i.current?.querySelector('input, button, [tabindex]:not([tabindex="-1"])')?.focus()}))},children:[n&&o.jsx(Bce,{className:"h-4 w-4 text-neutral3 shrink-0"}),o.jsx("span",{className:"truncate",children:e.label}),!n&&o.jsx(b_,{className:"h-4 w-4 ml-auto text-neutral3 shrink-0"})]})}),o.jsx(hu,{ref:i,side:"right",align:"start",sideOffset:8,className:"w-64 p-2",onOpenAutoFocus:l=>l.preventDefault(),onKeyDown:l=>{if(l.key!=="ArrowDown"&&l.key!=="ArrowUp"&&l.key!=="Home"&&l.key!=="End")return;const c=Array.from(l.currentTarget.querySelectorAll("[data-pick-multi-item]:not([disabled])"));if(c.length===0)return;l.preventDefault(),l.stopPropagation();const u=document.activeElement,d=c.findIndex(h=>h===u);let f;l.key==="Home"?f=0:l.key==="End"?f=c.length-1:l.key==="ArrowDown"?f=d<0?0:(d+1)%c.length:f=d<=0?c.length-1:d-1,c[f]?.focus()},"data-pick-multi-panel":!0,children:o.jsx(oft,{field:e,tokens:t,onChange:r})})]})}const fft=(e,{enabled:t=!0})=>{const r=b.useRef(t);je.useEffect(()=>{if(!t||!e?.current)return;const n=e.current,s=new MutationObserver(()=>{r.current&&n.scrollTo({top:n.scrollHeight,behavior:"smooth"})});s.observe(n,{childList:!0,subtree:!0,characterData:!0});const a=i=>{const l=i.target,c=l.scrollTop+l.clientHeight,u=l.scrollHeight;c>=u-1?r.current=!0:r.current=!1};return n.addEventListener("scroll",a),()=>{n.removeEventListener("scroll",a),s.disconnect()}},[t,e])},Ms=b.forwardRef(({className:e,children:t,viewPortClassName:r,maxHeight:n,autoScroll:s=!1,orientation:a="vertical",...i},l)=>{const c=b.useRef(null);return fft(c,{enabled:s}),o.jsxs(Jtt,{ref:l,className:Y("relative overflow-hidden",e),...i,children:[o.jsx(rur,{ref:c,className:Y("h-full w-full rounded-[inherit] [&>div]:block!",r),style:n?{maxHeight:n}:void 0,children:t}),(a==="vertical"||a==="both")&&o.jsx(mie,{orientation:"vertical"}),(a==="horizontal"||a==="both")&&o.jsx(mie,{orientation:"horizontal"}),a==="both"&&o.jsx(nur,{})]})});Ms.displayName=Jtt.displayName;const mie=b.forwardRef(({className:e,orientation:t="vertical",...r},n)=>o.jsx(efe,{ref:n,orientation:t,className:Y("flex touch-none select-none transition-all duration-normal ease-out-custom","opacity-0 hover:opacity-100 data-[state=visible]:opacity-100",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-px",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-px",e),...r,children:o.jsx(Gtt,{className:"relative flex-1 rounded-full bg-neutral2 hover:bg-neutral3 transition-colors duration-normal"})}));mie.displayName=efe.displayName;const iRe={sm:lc.sm,md:lc.md,lg:lc.lg,default:lc.default},km=({onSearch:e,label:t,placeholder:r,debounceMs:n=300,size:s="md"})=>{const a=b.useId(),i=b.useRef(null),l=u1(u=>{e(u)},n);b.useEffect(()=>()=>{l.cancel()},[l]),b.useEffect(()=>{const u=i.current;if(!u)return;const d=f=>{f.key.toLowerCase()==="f"&&f.shiftKey&&(f.ctrlKey||f.metaKey)&&(f.preventDefault(),u.focus())};return window.addEventListener("keydown",d),()=>{window.removeEventListener("keydown",d)}},[]);const c=u=>{l(u.target.value)};return o.jsxs("div",{className:Y("border border-border1 flex w-full items-center gap-2 overflow-hidden pl-2 pr-1",sLr,nLr,ln.all,"hover:border-neutral2",iRe[s]),children:[o.jsx(x_,{className:Y("text-neutral3 h-4 w-4",ln.colors)}),o.jsxs("div",{className:"flex-1",children:[o.jsx("label",{htmlFor:a,className:"sr-only",children:t}),o.jsx("input",{id:a,type:"text",placeholder:r,className:Y("bg-transparent text-ui-md placeholder:text-neutral3 block w-full px-2 outline-hidden",iRe[s]),name:a,ref:i,onChange:c})]})]})},F$r=({children:e})=>o.jsx("div",{className:"px-3 py-2.5 border-b border-border1",children:e}),M5=b.forwardRef(({className:e,...t},r)=>o.jsxs(mrt,{ref:r,className:Y("relative flex w-full touch-none select-none items-center group",e),...t,children:[o.jsx(wur,{className:Y("relative h-1.5 w-full grow overflow-hidden rounded-full bg-neutral2",ln.colors),children:o.jsx(Sur,{className:Y("absolute h-full bg-accent1",ln.all)})}),o.jsx(Our,{className:Y("block h-4 w-4 rounded-full border-2 border-accent1 bg-white shadow-md","transition-all duration-normal ease-out-custom",F9,"hover:scale-110 hover:shadow-lg","active:scale-95","disabled:pointer-events-none disabled:opacity-50")})]}));M5.displayName=mrt.displayName;const bc=b.forwardRef(({className:e,...t},r)=>o.jsx(wrt,{className:Y("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent",ln.all,F9,"hover:brightness-110","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:brightness-100","data-[state=checked]:bg-accent1 data-[state=checked]:shadow-glow-accent1","data-[state=unchecked]:bg-neutral2",e),...t,ref:r,children:o.jsx(jur,{className:Y("pointer-events-none block h-4 w-4 rounded-full bg-white shadow-md","transition-all duration-normal ease-out-custom","data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0","data-[state=checked]:shadow-lg")})}));bc.displayName=wrt.displayName;function z$r({children:e,untilChar:t,charCount:r,copy:n,withTooltip:s=!0,className:a,as:i="span",...l}){const c=e;let u=c,d=!1;if(t!==void 0){const h=c.indexOf(t);h!==-1&&(u=c.slice(0,h),d=!0)}else r!==void 0&&c.length>r&&(u=c.slice(0,r),d=!0);if(!d)return o.jsx(me,{as:i,className:a,...l,children:c});const f=o.jsxs(me,{as:"span",className:"cursor-default",variant:l.variant,font:l.font,children:[u,"..."]});return o.jsxs(me,{as:i,className:Y("group inline-flex items-center gap-1",a),...l,children:[s?o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:f}),o.jsx(Wr,{children:c})]}):f,n&&o.jsx(ta,{content:c,className:"opacity-0 group-hover:opacity-100 transition-opacity"})]})}function ps({children:e,className:t,spacing:r="default"}){return o.jsx("div",{className:Y("flex gap-2 items-center ",{"gap-[2px] [&>*:not(:last-child)]:rounded-r-none [&>*:not(:first-child)]:rounded-l-none":r==="close"},t),children:e})}function zr({children:e,className:t,style:r}){const n=hft("MainContentLayout");return o.jsx("main",{className:Y("grid grid-rows-[auto_1fr] h-full items-start content-start",t),style:{...r,...n?{border:"3px dotted red"}:{}},children:e})}function df({children:e,className:t,isCentered:r=!1,isDivided:n=!1,hasLeftServiceColumn:s=!1,style:a}){const i=hft("MainContentContent"),l=xme({isCentered:r,isDivided:n,hasLeftServiceColumn:s,className:t});return o.jsx("div",{className:l,style:{...a,...i?{border:"3px dotted orange"}:{}},children:e})}const xme=({isCentered:e,isDivided:t,hasLeftServiceColumn:r,className:n})=>Y("grid overflow-y-auto h-full ","overflow-x-auto min-w-min",{"items-start content-start":!e&&!t&&!r,"grid place-items-center":e,"grid-cols-[1fr_1fr]":t&&!r,"grid-cols-[12rem_1fr_1fr]":t&&r,"grid-cols-[auto_1fr]":!t&&r},n);function hft(e){try{const t=localStorage.getItem("add-dev-style-to-components");return t?t.split(",").map(n=>n.trim()).filter(Boolean).includes(e):!1}catch(t){return console.error("Error reading or parsing localStorage:",t),!1}}function B$r({children:e,className:t}){return o.jsx("div",{className:Y("grid content-start",t),children:e})}function U$r({children:e,isLoading:t}){return o.jsx("p",{className:Y("text-neutral3 text-sm max-w-[35rem] flex flex-wrap gap-x-4 gap-y-1 mt-1 first-of-type:mt-3 ml-1",{"bg-surface4 w-[40rem] max-w-[80%] rounded-md animate-pulse":t}),children:t?o.jsx(o.Fragment,{children:" "}):o.jsx(o.Fragment,{children:e})})}function V$r({children:e,title:t,description:r,icon:n,className:s,withMargins:a=!0}){const i=t==="loading",l=r==="loading";return e?o.jsx("header",{className:Y("grid grid-cols-[1fr_auto] gap-16 w-full ",{"mt-[6vh] mb-[4vh]":a},s),children:e}):o.jsxs("header",{className:Y("grid gap-2 pt-8 pb-8 ",s),children:[o.jsx("h1",{className:Y("text-neutral6 text-xl font-normal flex items-center gap-2","[&>svg]:w-6 [&>svg]:h-6 [&>svg]:text-neutral3",{"bg-surface4 w-60 max-w-[50%] rounded-md animate-pulse":i}),children:i?o.jsx(o.Fragment,{children:" "}):o.jsxs(o.Fragment,{children:[n&&n," ",t]})}),r&&o.jsx("p",{className:Y("text-neutral4 text-sm m-0",{"bg-surface4 w-[40rem] max-w-[80%] rounded-md animate-pulse":l}),children:l?o.jsx(o.Fragment,{children:" "}):r})]})}function q$r({children:e,isLoading:t,size:r="default"}){return o.jsx("h1",{className:Y("text-neutral5 text-xl font-normal gap-2 flex items-center","[&>svg]:w-[1.25em] [&>svg]:h-[1.25em] [&>svg]:opacity-50",{"bg-surface4 w-60 max-w-[50%] rounded-md animate-pulse":t,"text-md":r==="smaller"}),children:t?o.jsx(o.Fragment,{children:" "}):o.jsx(o.Fragment,{children:e})})}const Ir=Object.assign(V$r,{Title:q$r,Description:U$r,Column:B$r});function kx({children:e,className:t}){return o.jsx("div",{className:Y("grid gap-12",t),children:e})}const pft=({className:e,children:t})=>o.jsx("div",{className:Y("flex items-center text-ui-sm border border-border1 rounded-lg overflow-hidden","[&>button]:border-0 [&>button:not(:first-child)]:border-l [&>button:not(:first-child)]:border-border1","[&>button]:rounded-none [&>button:first-child]:rounded-l-lg [&>button:last-child]:rounded-r-lg",e),children:t});function D5({className:e,classNames:t,showOutsideDays:r=!0,...n}){return o.jsx(upr,{showOutsideDays:r,className:Y("p-3",e),classNames:{months:"flex flex-col space-y-4 sm:space-y-0 ",month:"space-y-4 text-ui-sm ",caption:"flex justify-between pt-1 items-center pl-2",caption_label:"text-text font-medium ",nav:"flex items-center",nav_button_previous:Y("flex justify-center items-center h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_next:Y("flex justify-center items-center h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),dropdown_month:"w-full border-collapse space-y-1",weeknumber:"flex",day:Y("relative p-0 text-center focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-surface5 [&:has([aria-selected].day-outside)]:bg-surface5/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",n.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md","h-8 w-8 p-0 hover:bg-lightGray-7/50 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start rounded-l-md",day_range_end:"day-range-end rounded-r-md",day_selected:Y("bg-accent1! text-white! hover:bg-accent1/80! focus:bg-accent1/80! focus:text-white!",n.mode!=="range"&&"rounded-md"),day_today:"bg-neutral6/10 text-neutral5",day_outside:"day-outside text-neutral3 opacity-50 aria-selected:bg-surface5/50 aria-selected:text-neutral3 aria-selected:opacity-30",day_disabled:"text-neutral3 opacity-50",day_range_middle:"aria-selected:bg-surface5 aria-selected:text-neutral5",day_hidden:"invisible",head_cell:"text-ui-xs text-neutral3",...t},...n})}const sQ=["12","1","2","3","4","5","6","7","8","9","10","11"],nL=["00","15","30","45","59"],sL=["AM","PM"];function gie({defaultValue:e,onValueChange:t,className:r}){const[n,s]=b.useState("12"),[a,i]=b.useState("00"),[l,c]=b.useState("AM");b.useEffect(()=>{if(e){const h=/^(\d{1,2}):(\d{2})(?::\d{2})?\s*(AM|PM|am|pm)?$/,p=e.match(h);if(p){let m=parseInt(p[1],10);const g=parseInt(p[2],10),y=p[3]?.toUpperCase();m>=1&&m<=12&&g>=0&&g<=59&&(s(m.toString()),i(g===0?"00":g.toString()),c(y||"AM"))}}},[e]);const u=h=>{s(h),t(`${sQ[+h]}:${a} ${l}`.trim())},d=h=>{i(nL[+h]),t(`${n}:${nL[+h]} ${l}`.trim())},f=h=>{c(sL[+h]),t(`${n}:${a} ${sL[+h]}`.trim())};return o.jsxs("div",{className:Y("flex gap-2 items-center",r),children:[o.jsxs(hi,{name:"hour",value:sQ.indexOf(n).toString(),onValueChange:u,children:[o.jsx(ei,{size:"sm",children:o.jsx(pi,{placeholder:"Select..."})}),o.jsx(ti,{children:sQ.map((h,p)=>o.jsx(ss,{value:`${p}`,children:h},h))})]}),":",o.jsxs(hi,{name:"minute",value:nL.indexOf(a).toString(),onValueChange:d,children:[o.jsx(ei,{size:"sm",children:o.jsx(pi,{placeholder:"Select..."})}),o.jsx(ti,{children:nL.map((h,p)=>o.jsx(ss,{value:`${p}`,children:h},h))})]}),o.jsxs(hi,{name:"period",value:sL.indexOf(l).toString(),onValueChange:f,children:[o.jsx(ei,{size:"sm",children:o.jsx(pi,{placeholder:"Select..."})}),o.jsx(ti,{children:sL.map((h,p)=>o.jsx(ss,{value:`${p}`,children:h},h))})]})]})}const oRe=({value:e,minValue:t,maxValue:r,defaultTimeStrValue:n,onValueChange:s,children:a,className:i,placeholder:l,...c})=>{const[u,d]=b.useState(!1);return o.jsxs(_f,{open:u,onOpenChange:d,children:[o.jsx(id,{asChild:!0,children:a||o.jsx(Q$r,{value:e,placeholder:l,className:i,"data-testid":"datepicker-button"})}),o.jsx(hu,{className:"backdrop-blur-4xl w-auto p-0! bg-surface4 max-w-[16.5rem]",align:"start","data-testid":"datepicker-calendar",children:o.jsx(H$r,{value:e,minValue:t,maxValue:r,onValueChange:s,setOpenPopover:d,defaultTimeStrValue:n,...c})})]})};function aL({date:e,timeStr:t=""}){if(!_y(e))return null;if(t){const r=tr(e,"yyyy-MM-dd"),n=new Date(`${r} ${t}`);if(_y(n))return n}return e}const H$r=({value:e,minValue:t,maxValue:r,onValueChange:n,setOpenPopover:s,placeholder:a,className:i,defaultTimeStrValue:l,...c})=>{const[u,d]=b.useState(null),[f,h]=b.useState(e?tr(aL({date:e,timeStr:l})||"","PP p"):""),[p,m]=b.useState(l||""),[g,y]=b.useState(e?new Date(e):void 0),x=u1(B=>{_y(B)&&(y(B),n?.(B),s?.(!1))},500),w=B=>{h(B.currentTarget.value);const D=new Date(B.currentTarget.value);x(D)},S=B=>{_y(B)?r&&B>r?(d(`The selected date should be before ${tr(r,"PP p")}`),h("")):t&&B<t?(d(`The selected date should be after ${tr(t,"PP p")}`),h("")):(h(tr(B,"PP p")),d("")):(h(""),d(""))},k=new Date(f),_=_y(k),E=_&&k.getTime()!==e?.getTime(),T=B=>{if(y(B),B){const D=aL({date:B,timeStr:p});S(D||"")}else S("")},j=B=>{if(y(B),B){const D=aL({date:B,timeStr:p});S(D||"")}else S("")},N=B=>{if(m(B),_){const D=aL({date:k,timeStr:B});S(D||"")}},I=()=>{s?.(!1)},P=()=>{_y(k)&&n(k),s?.(!1)},R=()=>{n(void 0),y(void 0),h(""),m(""),s?.(!1)};return o.jsxs("div",{"aria-label":"Choose date",className:Y("relative flex flex-col",i),onKeyDown:B=>{B.stopPropagation(),B.key==="Escape"&&s?.(!1)},children:[o.jsx(Sx,{name:"date-range",type:"text",value:f,onChange:w,placeholder:a,className:"m-4 mb-0 w-auto!"}),u&&o.jsxs("div",{className:Y("text-ui-md m-4 mb-0 text-neutral3","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:mt-0.5 [&>svg]:text-red-500 [&>svg]:float-left [&>svg]:mr-2"),children:[o.jsx(Uce,{})," ",u]}),o.jsx(D5,{mode:"single",month:g,selected:g,onMonthChange:j,onSelect:T,...c}),o.jsx(gie,{onValueChange:N,className:"m-4 mt-0 w-auto",defaultValue:e?tr(new Date(e),"hh:mm a"):l}),o.jsxs("div",{className:"grid grid-cols-[1fr_2fr] gap-2 m-4 mt-0",children:[E&&o.jsx(ce,{tabIndex:0,size:"md",onClick:R,type:"button",children:"Clear"}),o.jsx(ce,{tabIndex:0,type:"button",size:"md",variant:E?"primary":"default",onClick:()=>{_?P():I()},children:E?"Apply":"Cancel"})]})]})},Q$r=b.forwardRef(({value:e,placeholder:t,className:r,...n},s)=>o.jsxs(ce,{ref:s,className:Y("justify-start",r),...n,children:[o.jsx(nne,{className:"h-4 w-4"}),e?o.jsx("span",{className:"text-white",children:tr(e,"PP p")}):o.jsx("span",{className:"text-gray",children:t??"Pick a date"})]}));function mft({children:e}){return o.jsx("ul",{className:"grid bg-surface3 overflow-y-auto",children:e})}function gft(e){return!e||e.length===0?"":e?.map(t=>t.size).join(" ")}function yft({entry:e,isSelected:t,onClick:r,children:n,columns:s}){const a=()=>{r?.(e?.id)};return o.jsx("li",{className:Y("border-t text-neutral5 border-border1 last:border-b-0 text-ui-md","[&:last-child>button]:rounded-b-lg",ln.colors,{"bg-accent1Dark":t}),children:o.jsx("button",{onClick:a,className:Y("grid w-full px-6 gap-6 text-left items-center min-h-12",ln.colors,i0.visible,{"hover:bg-surface4":e&&!t}),style:{gridTemplateColumns:gft(s)},disabled:!e,children:n})})}function W$r({children:e,isLoading:t}){return o.jsx("div",{className:"text-neutral4 text-ui-md truncate ",children:t?o.jsx("div",{className:"bg-surface4 rounded-md animate-pulse text-transparent h-4 select-none"}):e})}function G$r({status:e}){return o.jsxs("div",{className:Y("flex justify-center items-center w-full relative"),children:[e?o.jsx("div",{className:Y("w-[0.6rem] h-[0.6rem] rounded-full",{"bg-green-600":e==="success","bg-red-700":e==="failed"})}):o.jsx("div",{className:"text-neutral2 text-ui-sm leading-none",children:"-"}),o.jsxs(Zu,{children:["Status: ",e||"not provided"]})]})}function vft({columns:e}){return o.jsx("div",{className:Y("sticky top-0 bg-surface4 z-10 rounded-t-lg px-6"),children:o.jsx("div",{className:Y("grid gap-6 text-left uppercase py-3 text-neutral3 text-ui-sm"),style:{gridTemplateColumns:gft(e)},children:e?.map(t=>o.jsx("span",{children:t.label||t.name},t.name))})})}function Z$r({children:e,message:t,className:r,type:n}){return!e&&!t?null:o.jsx("div",{className:Y("grid border-t border-border1",r),children:t?o.jsxs("p",{className:Y("text-neutral3 text-ui-md text-center grid p-8 justify-center justify-items-center gap-2","[&>svg]:w-[1.5em] [&>svg]:h-[1.5em] [&>svg]:opacity-75",{"[&>svg]:text-red-500":n==="error"}),children:[n==="error"?o.jsx(LE,{}):o.jsx($R,{})," ",t]}):e})}function Y$r({isLoading:e,hasMore:t,setEndOfListElement:r,loadingText:n="Loading more data...",noMoreDataText:s="No more data to load"}){return r?o.jsxs("div",{ref:r,className:"text-ui-md text-neutral3 opacity-50 flex mt-8 justify-center",children:[e&&n,!t&&!e&&s]}):null}function X$r({currentPage:e,hasMore:t,onNextPage:r,onPrevPage:n}){const s=typeof e=="number"&&e>0||t;return o.jsxs("div",{className:Y("flex pt-6 items-center justify-center text-neutral3 text-ui-md gap-8"),children:[o.jsxs("span",{children:["Page ",o.jsx("b",{children:e?e+1:"1"})]}),s&&o.jsxs("div",{className:Y("flex gap-4","[&>button]:flex [&>button]:items-center [&>button]:gap-2 [&>button]:text-neutral4 [&>button:hover]:text-neutral5 [&>button]:transition-colors [&>button]:border [&>button]:border-border1 [&>button]:p-1 [&>button]:px-2 [&>button]:rounded-md","[&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:text-neutral3"),children:[typeof e=="number"&&e>0&&o.jsxs("button",{onClick:n,children:[o.jsx(DE,{}),"Previous"]}),t&&o.jsxs("button",{onClick:r,children:["Next",o.jsx(Um,{})]})]})]})}function K$r({children:e}){return o.jsx("div",{className:"grid",children:e})}function bft({children:e}){return o.jsx("div",{className:Y("rounded-lg border border-border1 overflow-clip"),children:e})}const ha=Object.assign(K$r,{Header:vft,Trim:bft,Entries:mft,Entry:yft,Message:Z$r,NextPageLoading:Y$r,Pagination:X$r,EntryText:W$r,EntryStatus:G$r}),lRe=["75%","50%","65%","90%","60%","80%"];function J$r({columns:e,numberOfRows:t=3}){const r=(n,s)=>{const a=(n+s+(e?.length||0)+(t||0))%lRe.length;return lRe[a]};return o.jsx(mft,{children:Array.from({length:t}).map((n,s)=>o.jsx(yft,{columns:e,children:(e||[]).map((a,i)=>{const l=`${a.name}-${i}`;return o.jsx("div",{className:"bg-surface4 rounded-md animate-pulse text-transparent h-4 select-none",style:{width:`${r(s,i)}`}},l)})},s))})}function xft({columns:e,numberOfRows:t}){return o.jsx(ha,{children:o.jsxs(bft,{children:[o.jsx(vft,{columns:e}),o.jsx(J$r,{columns:e,numberOfRows:t})]})})}function wft({entries:e,id:t,update:r}){const n=e.findIndex(a=>a.id===t);if(n<e.length-1)return()=>{const a=e[n+1];r(a.id)}}function Sft({entries:e,id:t,update:r}){const n=e.findIndex(a=>a.id===t);if(n>0)return()=>{const a=e[n-1];r(a.id)}}function Oft({name:e,value:t,label:r,labelIsHidden:n=!1,className:s,required:a,disabled:i,helpMsg:l,options:c,onValueChange:u,placeholder:d="Select an option",size:f="default"}){const h=({children:p})=>n?o.jsx(Zu,{children:p}):p;return o.jsxs("div",{className:Y("flex gap-2 items-center",{"grid-rows-[auto_1fr]":r,"grid-rows-[auto_1fr_auto]":l},s),children:[o.jsx(h,{children:o.jsxs("label",{className:Y("text-ui-sm text-neutral3 flex justify-between items-center shrink-0"),children:[r,a&&o.jsx("i",{className:"text-neutral2",children:"(required)"})]})}),o.jsxs(hi,{name:e,value:t,onValueChange:u,disabled:i,children:[o.jsx(ei,{id:`select-${e}`,size:f,className:"grid grid-cols-[1fr_auto] [&>span]:truncate w-full",children:o.jsx(pi,{placeholder:d})}),o.jsx(ti,{children:c.map(p=>o.jsx(ss,{value:p.value,disabled:p.disabled,children:o.jsxs("span",{className:"whitespace-nowrap truncate flex items-center gap-2",children:[p.icon,p.label]})},p.value))})]}),l&&o.jsx("p",{className:"text-neutral3 text-ui-sm",children:l})]})}const kft=b.createContext(null);function e3r({children:e,value:t}){return o.jsx(kft.Provider,{value:t,children:e})}function U9(){const e=b.useContext(kft);if(!e)throw new Error("useJSONSchemaForm must be used within a JSONSchemaForm.Root");return e}let t3r=0;function V9(e={}){return{id:`field-${Date.now()}-${t3r++}`,name:"",type:"string",nullable:!1,optional:!1,...e}}function r3r(e){return e==="text"?"string":e}function _ft(e){const t=r3r(e.type),n={type:e.nullable?[t,"null"]:t};if(e.description&&(n.description=e.description),e.type==="object"&&e.properties&&e.properties.length>0){const{properties:s,required:a}=Eft(e.properties);n.properties=s,a.length>0&&(n.required=a)}return e.type==="array"&&e.items&&(n.items=_ft(e.items)),n}function Eft(e){const t={},r=[];for(const n of e)n.name.trim()&&(t[n.name]=_ft(n),n.optional||r.push(n.name));return{properties:t,required:r}}function n3r(e){const{properties:t,required:r}=Eft(e),n={type:"object",properties:t};return r.length>0&&(n.required=r),n}function Cft(e){if(Array.isArray(e)){const t=e.includes("null");return{type:e.find(n=>n!=="null")||"string",nullable:t}}return{type:e||"string",nullable:!1}}function jft(e){return["string","number","boolean","object","array"].includes(e)?e:"string"}function Tft(e){const{type:t,nullable:r}=Cft(e.type);return V9({name:"",type:jft(t),description:e.description,nullable:r,optional:!1,properties:e.properties?q9({properties:e.properties,required:e.required}):void 0,items:e.items?Tft(e.items):void 0})}function q9(e){if(!e?.properties)return[];const t=new Set(e.required||[]);return Object.entries(e.properties).map(([r,n])=>{const{type:s,nullable:a}=Cft(n.type);return V9({name:r,type:jft(s),description:n.description,nullable:a,optional:!t.has(r),properties:n.properties?q9({properties:n.properties,required:n.required}):void 0,items:n.items?Tft(n.items):void 0})})}function yie(e,t,r,n){if(t.length===0)return e.map(i=>i.id===r?{...i,...n}:i);const[s,...a]=t;return e.map(i=>i.id!==s?i:i.type==="object"?{...i,properties:yie(i.properties||[],a,r,n)}:i.type==="array"&&i.items?{...i,items:{...i.items,properties:yie(i.items.properties||[],a,r,n)}}:i)}function vie(e,t,r){if(t.length===0)return[...e,r];const[n,...s]=t;return e.map(a=>a.id!==n?a:a.type==="object"?{...a,properties:vie(a.properties||[],s,r)}:a.type==="array"&&a.items?{...a,items:{...a.items,properties:vie(a.items.properties||[],s,r)}}:a)}function bie(e,t,r){if(t.length===0)return e.filter(a=>a.id!==r);const[n,...s]=t;return e.map(a=>a.id!==n?a:a.type==="object"?{...a,properties:bie(a.properties||[],s,r)}:a.type==="array"&&a.items?{...a,items:{...a.items,properties:bie(a.items.properties||[],s,r)}}:a)}function s3r({onChange:e,onFieldsChange:t,defaultValue:r,maxDepth:n=5,className:s,children:a}){const[i,l]=b.useState(()=>r||[]),c=b.useRef("");b.useEffect(()=>{const p=n3r(i),m=JSON.stringify(p);m!==c.current&&(c.current=m,e?.(p))},[i,e]),b.useEffect(()=>{t?.(i)},[i,t]);const u=b.useCallback(p=>{const m=V9();l(g=>vie(g,p,m))},[]),d=b.useCallback((p,m)=>{l(g=>bie(g,p,m))},[]),f=b.useCallback((p,m,g)=>{l(y=>yie(y,p,m,g))},[]),h=b.useMemo(()=>({fields:i,addField:u,removeField:d,updateField:f,maxDepth:n}),[i,u,d,f,n]);return o.jsx(e3r,{value:h,children:o.jsx("div",{className:Y(s),children:a})})}const Nft=b.createContext(null);function a3r({children:e,value:t}){return o.jsx(Nft.Provider,{value:t,children:e})}function vC(){const e=b.useContext(Nft);if(!e)throw new Error("useJSONSchemaFormField must be used within a JSONSchemaForm.Field");return e}function i3r({field:e,parentPath:t=[],depth:r=0,className:n,children:s}){const{updateField:a,removeField:i}=U9(),l=b.useCallback(d=>{a(t,e.id,d)},[a,t,e.id]),c=b.useCallback(()=>{i(t,e.id)},[i,t,e.id]),u=b.useMemo(()=>({field:e,parentPath:t,depth:r,update:l,remove:c}),[e,t,r,l,c]);return o.jsx(a3r,{value:u,children:o.jsx("div",{className:Y(n),children:s})})}const Aft=b.createContext(null);function o3r({children:e,value:t}){return o.jsx(Aft.Provider,{value:t,children:e})}function Ift(){return b.useContext(Aft)}function l3r({className:e,children:t}){const{fields:r}=U9(),n=Ift(),s=n?n.fields:r,a=n?n.parentPath:[],i=n?n.depth:0;return s.length===0?null:o.jsx("div",{className:e,children:s.map((l,c)=>t(l,c,{parentPath:a,depth:i}))})}function c3r(e){const{field:t,update:r}=vC(),n=b.useCallback(s=>{r({name:s.target.value})},[r]);return o.jsx(Sx,{...e,size:"md",labelIsHidden:!0,name:`field-name-${t.id}`,value:t.name,onChange:n})}const u3r=[{value:"string",label:"String",icon:o.jsx(Ce,{size:"sm",children:o.jsx(Wce,{})})},{value:"number",label:"Number",icon:o.jsx(Ce,{size:"sm",children:o.jsx(Vce,{})})},{value:"boolean",label:"Boolean",icon:o.jsx(Ce,{size:"sm",children:o.jsx(Qce,{})})},{value:"text",label:"Text",icon:o.jsx(Ce,{size:"sm",children:o.jsx(cA,{})})},{value:"object",label:"Object",icon:o.jsx(Ce,{size:"sm",children:o.jsx(Ib,{})})},{value:"array",label:"Array",icon:o.jsx(Ce,{size:"sm",children:o.jsx(qce,{})})}];function d3r({className:e,...t}){const{field:r,update:n}=vC(),s=b.useCallback(a=>{n({type:a})},[n]);return o.jsx($o,{className:Y("w-28 shrink-0",e),name:`field-type-${r.id}`,label:"Select type",labelIsHidden:!0,value:r.type,onValueChange:s,options:u3r,size:"md",...t})}function f3r({label:e="Optional",labelClassName:t,className:r,...n}){const{field:s,update:a}=vC(),i=b.useCallback(l=>{a({optional:l===!0})},[a]);return o.jsxs("label",{className:Y("flex items-center gap-2 text-ui-sm text-neutral3 cursor-pointer",t),children:[o.jsx(fi,{...n,className:r,checked:s.optional,onCheckedChange:i}),e]})}function h3r({label:e="Nullable",labelClassName:t,className:r,...n}){const{field:s,update:a}=vC(),i=b.useCallback(l=>{a({nullable:l===!0})},[a]);return o.jsxs("label",{className:Y("flex items-center gap-2 text-ui-sm text-neutral3 cursor-pointer",t),children:[o.jsx(fi,{...n,className:r,checked:s.nullable,onCheckedChange:i}),e]})}function p3r({children:e,tooltip:t="Remove field",...r}){const{remove:n}=vC();return o.jsx(ce,{...r,tooltip:t,onClick:n,size:"icon-md",children:e||o.jsx(MHe,{})})}function m3r({className:e,children:t}){const{maxDepth:r,updateField:n}=U9(),{field:s,parentPath:a,depth:i}=vC(),l=s.type==="object"||s.type==="array",c=i>=r;if(b.useEffect(()=>{s.type==="object"&&!s.properties&&n(a,s.id,{properties:[]}),s.type==="array"&&!s.items&&n(a,s.id,{items:V9({name:"items",type:"object",properties:[]})})},[s.type,s.properties,s.items,s.id,a,n]),!l||c)return null;const u=[...a,s.id],d=i+1,f=s.type==="object"?s.properties||[]:s.type==="array"&&s.items?s.items.properties||[]:[];return o.jsx(o3r,{value:{parentPath:u,depth:d,fields:f},children:o.jsx("div",{className:Y("pl-4 border-l border-border1 mt-2",e),children:t})})}function g3r({children:e,...t}){const{addField:r}=U9(),n=Ift(),s=n?n.parentPath:[],a=b.useCallback(()=>{r(s)},[r,s]);return o.jsx(ce,{type:"button",...t,onClick:a,children:e||"Add field"})}const vi={Root:s3r,Field:i3r,FieldList:l3r,FieldName:c3r,FieldType:d3r,FieldOptional:f3r,FieldNullable:h3r,FieldRemove:p3r,NestedFields:m3r,AddField:g3r};function S1({data:e,className:t,labelsAreHidden:r,isLoading:n,LinkComponent:s}){const a=({children:i})=>r?o.jsx(Zu,{children:i}):i;return!e||e.length===0?null:o.jsx("dl",{className:Y("grid grid-cols-[auto_1fr] gap-x-4 items-start content-start",t),children:e.map(({label:i,value:l,icon:c,separator:u},d)=>{const f=Array.isArray(l);return o.jsxs(je.Fragment,{children:[o.jsxs("dt",{className:Y("text-neutral3 text-ui-md flex items-center gap-8 justify-between min-h-9"),children:[o.jsxs("span",{className:Y("flex items-center gap-2","[&>svg]:w-[1.4em] [&>svg]:h-[1.4em] [&>svg]:text-neutral3 [&>svg]:opacity-50",{"[&>svg]:opacity-20":n}),children:[c," ",o.jsx(a,{children:i})]}),!r&&o.jsx("span",{className:Y("text-neutral3","[&>svg]:w-[1em] [&>svg]:h-[1em] [&>svg]:text-neutral3"),children:u})]}),o.jsx("dd",{className:Y("flex flex-wrap gap-2 py-1 min-h-9 text-ui-md items-center text-neutral5 text-wrap","[&>a]:text-neutral5 [&>a]:max-w-full [&>a]:w-auto truncate [&>a]:bg-surface4 [&>a]:transition-colors [&>a]:flex [&>a]:items-center [&>a]:gap-2 [&>a]:pt-0.5 [&>a]:pb-0.5 [&>a]:px-2 [&>a]:rounded-md [&>a]:text-ui-md [&>a]:min-h-7 [&>a]:leading-none","[&>a:hover]:text-neutral6 [&>a:hover]:bg-surface6","[&>a>svg]:w-[1em] [&>a>svg]:h-[1em] [&>a>svg]:text-neutral3 [&>a>svg]:ml-[-0.5em]"),children:n?o.jsx("span",{className:Y("bg-surface4 rounded-e-lg w-full"),style:{width:`${Math.floor(Math.random()*61)+50}%`},children:" "}):f?l?.map(h=>h.path&&s?o.jsx(cRe,{description:h.description,children:o.jsxs(s,{href:h.path,children:[h?.name," ",o.jsx(b_,{})]})},h.id):h.path?o.jsx(cRe,{description:h.description,children:o.jsxs("a",{href:h.path,children:[h?.name," ",o.jsx(b_,{})]})},h.id):o.jsx("span",{children:h?.name},h.id)):o.jsx(o.Fragment,{children:l||o.jsx("span",{className:"text-neutral3 text-ui-sm",children:"n/a"})})})]},i+d)})})}function cRe({description:e,children:t}){return e?o.jsxs(_fe,{openDelay:250,children:[o.jsx(Efe,{asChild:!0,children:t}),o.jsx(Cfe,{children:o.jsxs(jfe,{className:"z-50 w-auto max-w-60 rounded-md bg-surface5 p-2 px-4 text-ui-sm text-neutral5 text-center",sideOffset:5,side:"top",children:[e,o.jsx(Tfe,{className:"fill-surface5"})]})})]}):t}function y3r({children:e,className:t}){return o.jsx("div",{className:Y("mt-auto",t),children:e})}function v3r({children:e,className:t}){return o.jsx("nav",{className:Y("",t),children:e})}function Rft({className:e}){return o.jsx("div",{className:Y("min-h-5 relative",'[&:after]:content-[""] [&:after]:block [&:after]:absolute [&:after]:h-0 [&:after]:border-border1 [&:after]:border-t [&:after]:top-1/2 [&:after]:left-3 [&:after]:right-3',e)})}function b3r({children:e,className:t,state:r="default",href:n,isActive:s,LinkComponent:a}){const i=r==="default",l=i?e:o.jsx(Zu,{children:e});return o.jsxs("div",{className:Y("grid grid-cols-[auto_1fr] items-center min-h-11",t),children:[o.jsx("header",{className:Y("text-ui-xs uppercase tracking-widest",{"pl-3":i,"text-black dark:text-white font-semibold":s,"text-neutral3/75":!s}),children:n&&i&&a?o.jsx(a,{href:n,className:Y("transition-colors duration-normal",{"hover:text-neutral5":!s,"text-black dark:text-white":s}),children:l}):l}),o.jsx(Rft,{})]})}function x3r({link:e,state:t="default",children:r,isActive:n,className:s,LinkComponent:a}){const i=t==="collapsed",l=e?.variant==="featured",u=e?.url?.startsWith("http")?{target:"_blank",rel:"noreferrer"}:{};return o.jsx("li",{className:Y("flex relative","[&>a]:flex [&>a]:items-center [&>a]:min-h-8 [&>a]:gap-2.5 [&>a]:text-ui-md [&>a]:text-neutral3 [&>a]:py-1.5 [&>a]:px-3 [&>a]:w-full [&>a]:rounded-lg [&>a]:justify-center","[&>a]:transition-all [&>a]:duration-normal [&>a]:ease-out-custom","[&_svg]:w-4 [&_svg]:h-4 [&_svg]:text-neutral3/60 [&_svg]:transition-colors [&_svg]:duration-normal","[&>a:hover]:bg-surface4 [&>a:hover]:text-neutral5 [&>a:hover_svg]:text-neutral3",{"[&>a]:text-neutral5 [&>a]:bg-surface3":n,"[&_svg]:text-neutral5":n,"before:absolute before:left-0 before:top-1/2 before:-translate-y-1/2 before:w-0.5 before:h-5 before:bg-black dark:before:bg-white before:rounded-r-full before:transition-all before:duration-normal":n&&!i,"[&>a]:justify-start":!i,"[&_svg]:text-neutral3":i,"[&>a]:rounded-md [&>a]:my-2 [&>a]:bg-accent1Dark [&>a:hover]:bg-accent1Darker [&>a]:text-accent1 [&>a:hover]:text-accent1 [&>a]:border [&>a]:border-accent1/30":l,"dark:[&>a]:bg-accent1 dark:[&>a:hover]:bg-accent1/90 dark:[&>a]:text-black dark:[&>a:hover]:text-black dark:[&>a]:border-transparent":l,"[&_svg]:text-accent1 [&>a:hover_svg]:text-accent1 dark:[&_svg]:text-black/75 dark:[&>a:hover_svg]:text-black":l,"[&>a]:pl-7 [&>a]:text-ui-sm":e?.indent&&!i},s),children:e?o.jsx(o.Fragment,{children:i||e.tooltipMsg?o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsxs(a,{href:e.url,...u,children:[e.icon&&e.icon,i?o.jsx(Zu,{children:e.name}):e.name," ",r]})}),o.jsx(Wr,{side:"right",align:"center",className:"ml-4",children:e.tooltipMsg?o.jsxs(o.Fragment,{children:[i&&`${e.name} | `," ",e.tooltipMsg]}):e.name})]}):o.jsxs(a,{href:e.url,...u,children:[e.icon&&e.icon,i?o.jsx(Zu,{children:e.name}):e.name," ",r,e.isExperimental&&o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(Uce,{className:"ml-auto stroke-accent5"})}),o.jsx(Wr,{side:"right",align:"center",className:"ml-4",children:"Experimental Feature"})]})]})}):r})}function w3r({children:e,className:t}){return o.jsx("ul",{className:Y("grid gap-1 items-start content-center",t),children:e})}function S3r({children:e,className:t}){return o.jsx("section",{className:Y("grid items-start content-center relative",t),children:e})}const Pft="sidebar:state",wme=je.createContext(null);function Sme(){const e=je.useContext(wme);if(!e)throw new Error("useMainSidebar must be used within a MainSidebarProvider.");return e}function O3r(){return je.useContext(wme)}const k3r=e=>{window.localStorage.setItem(Pft,e.toString())};function _3r({children:e}){const[t,r]=je.useState(()=>"default");je.useLayoutEffect(()=>{const a=window.localStorage.getItem(Pft);(a==="collapsed"||a==="default")&&r(a)},[]);const n=je.useCallback(()=>{k3r(t==="default"?"collapsed":"default"),r(t==="default"?"collapsed":"default")},[t]),s=je.useMemo(()=>({state:t,toggleSidebar:n}),[t,n]);return o.jsx(wme.Provider,{value:s,children:e})}function E3r({children:e,className:t}){const{state:r,toggleSidebar:n}=Sme(),s=r==="collapsed";return o.jsxs("div",{className:Y("flex flex-col h-full px-4 relative overflow-y-auto","transition-all duration-slow ease-out-custom",{"lg:min-w-52 xl:min-w-56 2xl:min-w-60 3xl:min-w-64 4xl:min-w-72":!s},t),children:[e,o.jsx("button",{onClick:n,className:Y("w-[.75rem] h-full right-0 top-0 absolute opacity-10",{"cursor-w-resize":!s,"cursor-e-resize":s}),"aria-label":"Toggle sidebar"})]})}function C3r({className:e}){const{state:t,toggleSidebar:r}=Sme(),n=t==="collapsed";return b.useEffect(()=>{const s=a=>{a.ctrlKey&&a.key==="b"&&(a.preventDefault(),r())};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s)}},[r]),o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx("button",{onClick:r,className:Y("inline-flex w-auto items-center text-neutral3 h-8 px-3 rounded-md","hover:bg-surface4 hover:text-neutral5","transition-all duration-normal ease-out-custom","focus:outline-hidden focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring","[&_svg]:w-4 [&_svg]:h-4 [&_svg]:text-neutral3 [&_svg]:transition-transform [&_svg]:duration-normal",e),"aria-label":"Toggle sidebar",children:o.jsx(_9t,{className:Y({"rotate-180":n})})})}),o.jsxs(Wr,{children:["Toggle Sidebar",o.jsxs("div",{className:"flex items-center gap-1 [&>svg]:w-[1em] [&>svg]:h-[1em]",children:[o.jsx(d9t,{})," Ctrl+B"]})]})]})}const Hh=Object.assign(E3r,{Bottom:y3r,Nav:v3r,NavSection:S3r,NavLink:x3r,NavHeader:b3r,NavList:w3r,NavSeparator:Rft,Trigger:C3r});function aQ({children:e,className:t,isVisible:r,autoDismiss:n=!0,dismissTime:s=5e3,dismissible:a=!0,type:i="info"}){const[l,c]=b.useState(r),[u,d]=b.useState(!1);b.useEffect(()=>{if(a&&n&&r){const m=setTimeout(()=>{f()},s);return()=>clearTimeout(m)}},[n,r,s,a]),b.useEffect(()=>{r&&(d(!1),c(!0))},[r]);const f=()=>{d(!0),setTimeout(()=>{c(!1),d(!1)},200)};if(!l)return null;const h={info:"bg-surface4 border-border1",error:"bg-accent2Darker border-accent2/20",success:"bg-accent1Darker border-accent1/30",warning:"bg-accent6Darker border-accent6/30"},p={info:"text-accent5",error:"text-accent2",success:"text-accent1",warning:"text-accent6"};return o.jsxs("div",{className:Y("grid grid-cols-[auto_1fr_auto] gap-3 rounded-xl border py-2.5 px-3.5 text-ui-md text-neutral4 items-start","shadow-card",ln.all,u?"animate-out fade-out-0 slide-out-to-right-2 duration-200":"animate-in fade-in-0 slide-in-from-right-2 duration-300",h[i],t),children:[o.jsx("div",{className:Y("shrink-0 mt-0.5",p[i]),children:i==="error"||i==="warning"?o.jsx(LE,{className:"h-4 w-4"}):o.jsx($R,{className:"h-4 w-4"})}),o.jsx("div",{className:"flex gap-2 items-start min-w-0",children:e}),a&&o.jsxs(ce,{variant:"ghost",className:Y("h-6 w-6 p-0 shrink-0",ln.colors,"hover:bg-surface5"),onClick:f,children:[o.jsx(Wl,{className:"h-4 w-4"}),o.jsx(Zu,{children:"Dismiss"})]})]})}function Mft({children:e,isLoading:t}){return o.jsx("p",{className:Y("text-neutral2 text-sm max-w-[35rem] flex flex-wrap gap-x-4 gap-y-1 mt-1",{"bg-surface4 w-[40rem] max-w-[80%] rounded-md animate-pulse":t}),children:t?o.jsx(o.Fragment,{children:" "}):o.jsx(o.Fragment,{children:e})})}function Dft({children:e,isLoading:t,size:r="default"}){return o.jsx("h1",{className:Y("text-neutral5 text-xl font-normal gap-2 flex items-center","[&>svg]:w-[1.25em] [&>svg]:h-[1.25em] [&>svg]:opacity-50",{"bg-surface4 w-60 max-w-[50%] rounded-md animate-pulse":t,"text-md":r==="smaller"}),children:t?o.jsx(o.Fragment,{children:" "}):o.jsx(o.Fragment,{children:e})})}function j3r({children:e,className:t,title:r,description:n,icon:s,isLoading:a}){const i=e===void 0&&r!==void 0;return o.jsx("header",{className:Y("w-full grid",t),children:i?o.jsxs(o.Fragment,{children:[o.jsxs(Dft,{isLoading:a,children:[s," ",r]}),n!==void 0&&o.jsx(Mft,{isLoading:a,children:n})]}):e})}const xn=Object.assign(j3r,{Title:Dft,Description:Mft});function T3r({children:e,className:t}){return o.jsx("header",{className:Y("grid items-center grid-cols-[1fr_auto]",t),children:e})}function N3r({headingLevel:e="h2",children:t,className:r}){const n=e;return o.jsx(n,{className:Y("flex items-center gap-2 text-ui-lg font-bold text-neutral4","[&>svg]:w-[1.2em] [&>svg]:h-[1.2em] [&>svg]:opacity-50",r),children:t})}function Lft({children:e,className:t}){return o.jsx("section",{className:Y("grid gap-4",t),children:e})}function O1({children:e,className:t}){return o.jsx("section",{className:Y("grid gap-2",t),children:e})}const pl=Object.assign(Lft,{Header:T3r,Heading:N3r});function A3r(){return VE({settings:{fontFamily:"var(--geist-mono)",fontSize:"0.8125rem",lineHighlight:"transparent",gutterBackground:"transparent",gutterForeground:"#939393",background:"transparent"},styles:[{tag:[ne.className,ne.propertyName]}]})}function I3r(){const e=ft.theme({"&":{backgroundColor:"transparent",color:"var(--neutral6)",fontSize:"0.8125rem"},"&.cm-editor .cm-scroller":{fontFamily:"var(--geist-mono)"},".cm-gutters":{backgroundColor:"transparent",color:"var(--neutral2)",borderRight:"none"},".cm-content":{color:"var(--neutral6)",caretColor:"var(--neutral6)"},".cm-activeLine":{backgroundColor:"transparent"},".cm-activeLineGutter":{backgroundColor:"transparent"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--neutral6)"}}),t=Pp.define([{tag:[ne.comment,ne.bracket],color:"var(--neutral2)"},{tag:[ne.string,ne.meta,ne.regexp],color:"var(--accent1)"},{tag:[ne.atom,ne.bool,ne.special(ne.variableName)],color:"var(--accent6)"},{tag:[ne.keyword,ne.operator,ne.tagName],color:"var(--accent2)"},{tag:[ne.function(ne.propertyName),ne.propertyName],color:"var(--accent5)"},{tag:[ne.definition(ne.variableName),ne.function(ne.variableName),ne.className,ne.attributeName],color:"var(--accent3)"},{tag:[ne.variableName,ne.number],color:"var(--accent5)"},{tag:[ne.name,ne.quote],color:"var(--accent1)"}]);return[e,Wx(t)]}const R3r=()=>{const e=gC().resolvedTheme==="dark";return b.useMemo(()=>e?A3r():I3r(),[e])};function P3r({codeStr:e="",title:t,icon:r,simplified:n=!1}){const s=R3r(),[a,i]=b.useState(!1),l=b.useMemo(()=>{try{const u=JSON.parse(e);return xie(u||"")}catch{return!1}},[e]),c=a?e?.replace(/\\n/g,`
|
|
296
296
|
`):e;return o.jsxs(pl,{children:[o.jsxs(pl.Header,{children:[o.jsxs(pl.Heading,{children:[r,t]}),o.jsxs(ps,{children:[o.jsx(ta,{content:e||"No content"}),l&&o.jsx(ce,{onClick:()=>i(!a),children:a?o.jsx(cA,{}):o.jsx(_3,{})})]})]}),e&&o.jsx("div",{className:"dark:bg-black/20 bg-surface3 p-4 overflow-hidden rounded-xl border dark:border-white/10 border-border1 text-neutral4 text-ui-md break-all max-h-[30vh] overflow-y-auto",children:n?o.jsx("div",{className:"text-neutral4 font-mono break-all px-2",children:o.jsx("pre",{className:"text-wrap",children:e})}):o.jsx(vc,{extensions:[C_(),ft.lineWrapping],theme:s,value:c})})]})}function xie(e){if(typeof e=="string"){const t=e.indexOf(`
|
|
@@ -541,13 +541,13 @@ Token usage: ${r} input + ${n} output = ${s} total`:`The model stopped generatin
|
|
|
541
541
|
bg-surface2 text-neutral1
|
|
542
542
|
transition-all
|
|
543
543
|
${g.isDragging?"shadow-lg ring-2 ring-accent1/30":"hover:bg-surface3"}
|
|
544
|
-
`,children:[o.jsx("span",{...m.dragHandleProps,className:"text-neutral4 cursor-grab active:cursor-grabbing",children:o.jsx(Ce,{children:o.jsx(uF,{className:"h-3.5 w-3.5"})})}),o.jsx("span",{children:h})]});return g.isDragging?cu.createPortal(y,document.body):y}},h)),d.placeholder]})})]},i.id)}),!a&&o.jsx("div",{className:"text-sm text-warning",children:"At least one column must be mapped to Input"})]})})}function N8e({headers:e,data:t,maxRows:r=5}){const n=t.slice(0,r),s=t.length,a=i=>{if(i==null)return"";const l=typeof i=="object"?JSON.stringify(i):String(i);return l.length>50?l.slice(0,47)+"...":l};return o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("div",{className:"overflow-x-auto rounded-lg border border-border1",children:o.jsxs(qLr,{size:"small",children:[o.jsx(HLr,{children:e.map(i=>o.jsx(QLr,{children:i},i))}),o.jsx(WLr,{children:n.map((i,l)=>o.jsx(GLr,{children:e.map(c=>o.jsx(ZLr,{className:"text-sm max-w-[200px]",children:o.jsx("span",{className:"truncate block",children:a(i[c])})},c))},l))})]})}),o.jsx("div",{className:"text-xs text-neutral4",children:n.length<s?`Showing ${n.length} of ${s} rows`:`${s} row${s!==1?"s":""}`})]})}function wTn({onFileSelect:e,isParsing:t,error:r}){const n=b.useRef(null),[s,a]=b.useState(!1),i=b.useCallback(()=>{t||n.current?.click()},[t]),l=b.useCallback(f=>{const h=f.target.files?.[0];h&&e(h),f.target.value=""},[e]),c=b.useCallback(f=>{f.preventDefault(),f.stopPropagation(),a(!0)},[]),u=b.useCallback(f=>{f.preventDefault(),f.stopPropagation(),a(!1)},[]),d=b.useCallback(f=>{if(f.preventDefault(),f.stopPropagation(),a(!1),t)return;const h=f.dataTransfer.files?.[0];h&&h.name.endsWith(".csv")&&e(h)},[t,e]);return o.jsxs("div",{className:"flex flex-col gap-3",children:[o.jsx("input",{ref:n,type:"file",accept:".csv",onChange:l,className:"hidden",disabled:t}),o.jsx("div",{onClick:i,onDragOver:c,onDragLeave:u,onDrop:d,className:Y("flex flex-col items-center justify-center gap-3","min-h-[160px] rounded-lg border-2 border-dashed p-6","cursor-pointer transition-colors","border-surface4 bg-surface2",s&&"border-accent1/50 bg-accent1/5",r&&"border-accent2/50 bg-accent2/5",t&&"cursor-wait opacity-60"),children:t?o.jsxs(o.Fragment,{children:[o.jsx(Dt,{size:"lg"}),o.jsx("span",{className:"text-sm text-neutral4",children:"Parsing CSV..."})]}):o.jsxs(o.Fragment,{children:[o.jsx(Ce,{className:"text-neutral4",children:o.jsx(fF,{className:"h-8 w-8"})}),o.jsxs("div",{className:"flex flex-col items-center gap-1",children:[o.jsx("span",{className:"text-sm font-medium text-neutral1",children:"Click to upload or drag and drop"}),o.jsx("span",{className:"text-xs text-neutral4",children:"CSV files only"})]})]})}),r&&o.jsx("div",{className:"text-sm text-accent2",children:r})]})}function STn({result:e,className:t}){const{validCount:r,invalidCount:n,totalRows:s,invalidRows:a}=e;return n===0?o.jsxs("div",{className:Y("flex items-center gap-2 text-sm text-success",t),children:[o.jsx(Jw,{className:"w-4 h-4"}),"All ",s," row",s!==1?"s":""," valid"]}):o.jsxs("div",{className:Y("space-y-3",t),children:[o.jsxs("div",{className:"flex items-center gap-2 text-sm text-warning",children:[o.jsx(AE,{className:"w-4 h-4"}),n," of ",s," rows will be skipped (validation failed)"]}),r>0&&o.jsxs("div",{className:"text-sm text-muted-foreground",children:[r," rows will be imported"]}),o.jsx("div",{className:"max-h-48 overflow-y-auto border rounded-md",children:o.jsxs("table",{className:"w-full text-xs",children:[o.jsx("thead",{className:"bg-muted sticky top-0",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-2 py-1 text-left font-medium",children:"Row"}),o.jsx("th",{className:"px-2 py-1 text-left font-medium",children:"Field"}),o.jsx("th",{className:"px-2 py-1 text-left font-medium",children:"Error"})]})}),o.jsxs("tbody",{children:[a.map((i,l)=>o.jsx(OTn,{row:i},l)),n>a.length&&o.jsx("tr",{children:o.jsxs("td",{colSpan:3,className:"px-2 py-1 text-muted-foreground italic",children:["... and ",n-a.length," more"]})})]})]})})]})}function OTn({row:e}){const t=e.errors[0]?.message||"Validation failed",r=e.errors[0]?.path||"/";return o.jsxs("tr",{className:"border-t",children:[o.jsx("td",{className:"px-2 py-1 text-muted-foreground",children:e.rowNumber}),o.jsx("td",{className:"px-2 py-1",children:o.jsxs("code",{className:"text-xs bg-muted px-1 rounded",children:[e.field,r!=="/"?r:""]})}),o.jsx("td",{className:"px-2 py-1 text-destructive",children:t})]})}function kTn({errors:e}){return e.length===0?null:o.jsx(cn,{variant:"destructive",title:`${e.length} validation error${e.length!==1?"s":""} found`,children:o.jsx("div",{className:"max-h-[120px] overflow-y-auto space-y-1 text-sm",children:e.map((t,r)=>o.jsxs("div",{children:["Row ",t.row,": ",o.jsxs("span",{className:"font-medium",children:["[",t.column,"]"]})," - ",t.message]},r))})})}function _Tn({datasetId:e,open:t,onOpenChange:r,onSuccess:n}){const[s,a]=b.useState("upload"),[i,l]=b.useState(null),[c,u]=b.useState([]),[d,f]=b.useState({current:0,total:0}),[h,p]=b.useState(null),[m,g]=b.useState(!1),[y,x]=b.useState(null),{parseFile:w,isParsing:S,error:k}=Yjn(),{batchInsertItems:_}=ni(),{data:E}=Tg(e),T=vTn(i?.headers??[]),j=b.useCallback(async Q=>{try{const L=await w(Q);l(L),T.resetMapping(),a("preview")}catch{}},[w,T]),N=b.useCallback(()=>{if(!i)return[];const Q=[],{data:L,headers:Z}=i,{mapping:V}=T,M=Z.filter(W=>V[W]==="input");return M.length===0?(Q.push({row:0,column:"Input",message:"At least one column must be mapped to Input"}),Q):(L.forEach((W,G)=>{const J=G+2;M.forEach(ae=>{const te=W[ae];(te==null||te==="")&&Q.push({row:J,column:ae,message:"Input value is required"})})}),Q)},[i,T]),I=b.useCallback((Q,L,Z)=>{const V=Z.filter(te=>L[te]==="input"),M=V.length===1?Q[V[0]]:V.reduce((te,re)=>(te[re]=Q[re],te),{}),W=Z.filter(te=>L[te]==="groundTruth");let G;W.length===1?G=Q[W[0]]:W.length>1&&(G=W.reduce((te,re)=>(te[re]=Q[re],te),{}));const J=Z.filter(te=>L[te]==="metadata");let ae;return J.length>0&&(ae=J.reduce((te,re)=>(te[re]=Q[re],te),{})),{input:M,groundTruth:G,metadata:ae}},[]),P=b.useCallback(()=>{const Q=N();if(u(Q),Q.length>0||!i)return;const{data:L,headers:Z}=i,{mapping:V}=T,M=L.map(G=>I(G,V,Z));if(E?.inputSchema||E?.groundTruthSchema){const G=Xjn(M,E?.inputSchema,E?.groundTruthSchema,10);if(x(G),G.validCount===0){u([{row:0,column:"",message:"All rows failed schema validation. Please check your data."}]);return}a("validation")}else x({validCount:M.length,invalidCount:0,validRows:M.map((G,J)=>({rowNumber:J+2,...G})),invalidRows:[],totalRows:M.length}),a("validation")},[N,i,T,I,E]),R=b.useCallback(async()=>{if(!y||y.validCount===0)return;a("importing"),g(!0);const Q=y.validRows;f({current:0,total:Q.length});const L=Q.map(Z=>{const{input:V,groundTruth:M}=Z;let W;if(i){const G=Z.rowNumber-2,{headers:J}=i,{mapping:ae}=T,te=i.data[G];if(te){const re=J.filter(ie=>ae[ie]==="metadata");re.length>0&&(W=re.reduce((ie,he)=>(ie[he]=te[he],ie),{}))}}return{input:V,groundTruth:M,metadata:W}});try{await _.mutateAsync({datasetId:e,items:L}),p({success:L.length,errors:0})}catch{p({success:0,errors:L.length})}f({current:Q.length,total:Q.length}),g(!1),a("complete")},[y,_,e,i,T]),B=b.useCallback(()=>{if(h){const Q=y?.invalidCount??0;Q>0?ze.success(`Imported ${h.success} row${h.success!==1?"s":""} (${Q} skipped)`):ze.success(`Imported ${h.success} row${h.success!==1?"s":""}`)}r(!1),n?.(),setTimeout(()=>{a("upload"),l(null),u([]),x(null),f({current:0,total:0}),p(null)},150)},[r,n,h,y]),D=b.useCallback(()=>{m||(r(!1),setTimeout(()=>{a("upload"),l(null),u([]),x(null),f({current:0,total:0}),p(null)},150))},[m,r]),$=b.useCallback((Q,L)=>{T.setColumnField(Q,L),u([])},[T]),U=()=>{switch(s){case"upload":return o.jsx(wTn,{onFileSelect:j,isParsing:S,error:k?.message});case"preview":return i?o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsx("div",{className:"text-sm text-neutral4",children:"Preview of your CSV data. Click Next to map columns."}),o.jsx(N8e,{headers:i.headers,data:i.data,maxRows:5})]}):null;case"mapping":return i?o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsx(xTn,{headers:i.headers,mapping:T.mapping,onMappingChange:$}),c.length>0&&o.jsx(kTn,{errors:c}),o.jsxs("div",{className:"border-t border-border1 pt-4",children:[o.jsx("div",{className:"text-xs text-neutral4 mb-2",children:"Data Preview"}),o.jsx(N8e,{headers:i.headers,data:i.data,maxRows:3})]})]}):null;case"validation":return y?o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsx("div",{className:"text-sm text-neutral4",children:E?.inputSchema||E?.groundTruthSchema?"Rows have been validated against the dataset schema.":"Ready to import. No schema validation required."}),y.invalidCount>0?o.jsxs("div",{className:"p-3 bg-warning/10 border border-warning/30 rounded-md",children:[o.jsxs("div",{className:"flex items-center gap-2 text-warning font-medium",children:[o.jsx("span",{className:"text-lg",children:"⚠"}),y.invalidCount," row",y.invalidCount!==1?"s":""," will be skipped"]}),o.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[y.validCount," of ",y.totalRows," rows will be imported"]})]}):o.jsx("div",{className:"p-3 bg-success/10 border border-success/30 rounded-md",children:o.jsxs("div",{className:"flex items-center gap-2 text-success font-medium",children:[o.jsx("span",{className:"text-lg",children:"✓"}),"All ",y.totalRows," row",y.totalRows!==1?"s are":" is"," valid"]})}),y.validCount===0&&o.jsx("p",{className:"text-sm text-destructive",children:"No valid rows to import. Please fix the data or adjust the schema."}),y.invalidCount>0&&o.jsx(STn,{result:y})]}):null;case"importing":return o.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[o.jsx(Dt,{size:"lg"}),o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"text-lg font-medium text-neutral1",children:"Importing items..."}),o.jsxs("div",{className:"text-sm text-neutral4 mt-1",children:[d.current," of ",d.total]})]})]});case"complete":return o.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[o.jsx("div",{className:"text-4xl",children:h&&h.errors===0?"✓":"⚠"}),o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"text-lg font-medium text-neutral1",children:"Import Complete"}),o.jsxs("div",{className:"text-sm text-neutral4 mt-1",children:[h?.success??0," item",h?.success!==1?"s":""," imported",h&&h.errors>0&&o.jsxs("span",{className:"text-accent2",children:[" ","(",h.errors," error",h.errors!==1?"s":"",")"]})]})]})]})}},z=()=>{switch(s){case"upload":return o.jsx(ce,{onClick:D,children:"Cancel"});case"preview":return o.jsxs(o.Fragment,{children:[o.jsx(ce,{onClick:()=>a("upload"),children:"Back"}),o.jsx(ce,{variant:"primary",onClick:()=>a("mapping"),children:"Next"})]});case"mapping":return o.jsxs(o.Fragment,{children:[o.jsx(ce,{onClick:()=>a("preview"),children:"Back"}),o.jsx(ce,{variant:"primary",onClick:P,disabled:!T.isInputMapped,children:E?.inputSchema||E?.groundTruthSchema?"Validate":"Next"})]});case"validation":return o.jsxs(o.Fragment,{children:[o.jsx(ce,{onClick:()=>a("mapping"),children:"Back"}),o.jsx(ce,{variant:"primary",onClick:R,disabled:!y||y.validCount===0,children:y?.invalidCount?`Import ${y.validCount} Valid Row${y.validCount!==1?"s":""}`:`Import ${y?.totalRows??0} Row${y?.totalRows!==1?"s":""}`})]});case"importing":return null;case"complete":return o.jsx(ce,{variant:"primary",onClick:B,children:"Done"})}},H={upload:"Import CSV",preview:"Preview Data",mapping:"Map Columns",validation:"Review Validation",importing:"Importing",complete:"Import Complete"};return o.jsx(On,{open:t,onOpenChange:D,children:o.jsxs(vn,{className:"max-w-2xl max-h-[90vh]",children:[o.jsxs(kn,{children:[o.jsx(bn,{children:H[s]}),o.jsx(qs,{children:"Import dataset items from a CSV file."})]}),o.jsx(Bn,{className:"min-h-[200px] max-h-[50vh] overflow-y-auto",children:U()}),o.jsx(uf,{className:"px-6 pt-4 flex justify-end gap-2",children:z()})]})})}const A8e=[{name:"experimentId",label:"ID",size:"6rem"},{name:"status",label:"Status",size:"4rem"},{name:"targetType",label:"Type",size:"4rem"},{name:"target",label:"Target",size:"1fr"},{name:"counts",label:"Counts",size:"7rem"},{name:"date",label:"Created",size:"10rem"}];function ETn(e){const t=xg(e)?"Today":tr(e,"MMM dd"),r=gfe(e)?"":tr(e,"yyyy"),n=tr(e,"'at' h:mm aaa");return`${t} ${r} ${n}`.replace(/\s+/g," ").trim()}function CTn(e){return e.charAt(0).toUpperCase()+e.slice(1)}function jTn({experiments:e,isSelectionActive:t,selectedExperimentIds:r,onRowClick:n,onToggleSelection:s}){if(e.length===0)return o.jsx(TTn,{});const a=[t?"2rem":"",...A8e.map(i=>i.size)].filter(Boolean).join(" ");return o.jsxs(Se,{columns:a,children:[o.jsxs(Se.Top,{children:[t&&o.jsx(Se.TopCell,{children:" "}),A8e.map(i=>o.jsx(Se.TopCell,{children:i.label},i.name))]}),o.jsx(Se.Rows,{children:e.map(i=>{const l=r.includes(i.id),c=new Date(i.createdAt);return o.jsxs(Se.Row,{onClick:()=>n(i.id),selected:l,children:[t&&o.jsx(Se.Cell,{children:o.jsx(fi,{checked:l,onCheckedChange:()=>s(i.id),"aria-label":`Select experiment ${i.id}`})}),o.jsx(Se.TextCell,{children:o.jsx("span",{className:"truncate block font-mono",children:i.id})}),o.jsx(Se.Cell,{children:i.status&&o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx("div",{className:"flex items-center justify-center w-10 relative bg-transparent h-full",children:o.jsx("div",{className:Y("w-2 h-2 rounded-full",{"bg-green-600":["success","completed"].includes(i.status),"bg-red-700":["error","failed"].includes(i.status),"bg-yellow-500":["pending","running"].includes(i.status)})})})}),o.jsx(Wr,{children:CTn(i.status)})]})}),o.jsx(Se.TextCell,{children:i.targetType}),o.jsx(Se.TextCell,{children:o.jsx("span",{className:"truncate block",children:i.targetId})}),o.jsx(Se.Cell,{children:o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsxs("div",{className:"flex gap-1",children:[i.succeededCount>0&&o.jsx(za,{color:"green",children:i.succeededCount}),i.failedCount>0&&o.jsx(za,{color:"red",children:i.failedCount})]})}),o.jsxs(Wr,{children:[i.succeededCount," Succeeded",o.jsx("br",{}),i.failedCount," Failed"]})]})}),o.jsx(Se.TextCell,{children:o.jsx("span",{className:"truncate block text-neutral2",children:ETn(c)})})]},i.id)})})]})}function TTn(){return o.jsx("div",{className:"flex h-full items-center justify-center py-12",children:o.jsx(Ja,{iconSlot:o.jsx(ux,{className:"w-8 h-8 text-neutral3"}),titleSlot:"No experiments yet",descriptionSlot:"Trigger an experiment to evaluate your dataset against an agent, workflow, or scorer."})})}const NTn=[{value:"all",label:"All statuses"},{value:"pending",label:"Pending"},{value:"running",label:"Running"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"}],ATn=[{value:"all",label:"All types"},{value:"agent",label:"Agent"},{value:"workflow",label:"Workflow"},{value:"scorer",label:"Scorer"},{value:"processor",label:"Processor"}];function ITn({hasExperiments:e,onCompareClick:t,isSelectionActive:r,selectedCount:n,onExecuteCompare:s,onCancelSelection:a,filters:i,onFiltersChange:l,targetIds:c}){const u=[{value:"all",label:"All targets"},...c.map(d=>({value:d,label:d}))];return r?o.jsx("div",{className:"flex items-center justify-end gap-4 w-full",children:o.jsxs("div",{className:"flex gap-5",children:[o.jsxs("div",{className:"text-sm text-neutral3 flex items-center gap-2 pl-6",children:[o.jsx(za,{size:"large",color:n<2?"red":"green",children:n}),o.jsx("span",{children:"of 2 experiments selected"}),o.jsx(oce,{})]}),o.jsxs(ps,{children:[o.jsxs(ce,{variant:"primary",disabled:n!==2,onClick:s,children:[o.jsx(zm,{className:"w-4 h-4"}),"Compare Experiments"]}),o.jsx(ce,{onClick:a,children:"Cancel"})]})]})}):o.jsxs("div",{className:"flex items-center justify-between gap-4 w-full",children:[o.jsxs(ps,{children:[o.jsx($o,{label:"Status",labelIsHidden:!0,name:"filter-status",options:NTn,value:i.status??"all",onValueChange:d=>l({...i,status:d==="all"?void 0:d})}),o.jsx($o,{label:"Type",labelIsHidden:!0,name:"filter-target-type",options:ATn,value:i.targetType??"all",onValueChange:d=>l({...i,targetType:d==="all"?void 0:d})}),c.length>0&&o.jsx($o,{label:"Target",labelIsHidden:!0,name:"filter-target-id",options:u,value:i.targetId??"all",onValueChange:d=>l({...i,targetId:d==="all"?void 0:d})}),(i.status||i.targetType||i.targetId)&&o.jsxs(ce,{onClick:()=>l({}),children:[o.jsx(Nn,{}),"Reset"]})]}),e&&o.jsxs(ce,{onClick:t,children:[o.jsx(zm,{}),"Compare"]})]})}function RTn({experiments:e,allExperiments:t,isLoading:r,datasetId:n,filters:s,onFiltersChange:a}){const[i,l]=b.useState([]),[c,u]=b.useState(!1),{navigate:d}=or(),f=b.useMemo(()=>{const y=t??e;return[...new Set(y.map(x=>x.targetId))]},[t,e]),h=y=>{l(x=>x.includes(y)?x.filter(w=>w!==y):x.length>=2?[x[0],y]:[...x,y])},p=()=>{if(i.length===2){const[y,x]=i;d(`/datasets/${n}/experiments?baseline=${y}&contender=${x}`)}},m=()=>{l([]),u(!1)},g=y=>{d(`/datasets/${n}/experiments/${y}`)};return r?o.jsx("div",{children:"Loading..."}):o.jsx(tf,{children:o.jsxs(gr,{children:[o.jsx(ITn,{hasExperiments:e.length>0||Object.values(s).some(Boolean),onCompareClick:()=>u(!0),isSelectionActive:c,selectedCount:i.length,onExecuteCompare:p,onCancelSelection:m,filters:s,onFiltersChange:a,targetIds:f}),o.jsx(jTn,{experiments:e,isSelectionActive:c,selectedExperimentIds:i,onRowClick:g,onToggleSelection:h})]})})}function n8({item:e}){const t=e?.input?JSON.stringify(e.input,null,2):"null",r=e?.groundTruth?JSON.stringify(e.groundTruth,null,2):"null",n=e?.metadata?JSON.stringify(e.metadata,null,2):"null",s=e?.expectedTrajectory?JSON.stringify(e.expectedTrajectory,null,2):null;return o.jsxs(kx,{children:[o.jsx(Vt.CodeSection,{title:"Input",icon:o.jsx(cx,{}),codeStr:t}),o.jsx(Vt.CodeSection,{title:"Ground Truth",icon:o.jsx(Qd,{}),codeStr:r}),s&&o.jsx(Vt.CodeSection,{title:"Expected Trajectory",icon:o.jsx(nLt,{}),codeStr:s}),o.jsx(Vt.CodeSection,{title:"Metadata",icon:o.jsx(NE,{}),codeStr:n})]})}function I8e({field:e,errors:t}){return t.length?o.jsx("div",{className:"mt-2 space-y-1",children:t.map((r,n)=>o.jsxs("p",{className:"text-xs text-destructive",children:[o.jsxs("code",{className:"bg-destructive/10 px-1 rounded",children:[e,r.path!=="/"?r.path:""]}),": ",r.message]},n))}):null}function $1t({inputValue:e,setInputValue:t,groundTruthValue:r,setGroundTruthValue:n,metadataValue:s,setMetadataValue:a,trajectoryValue:i,setTrajectoryValue:l,validationErrors:c,onSave:u,onCancel:d,isSaving:f}){return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"mb-4",children:o.jsxs("h3",{className:"text-lg font-medium flex items-center gap-2",children:[o.jsx(iv,{className:"w-5 h-5"})," Edit Item"]})}),o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(xt,{children:"Input (JSON) *"}),o.jsx(Xn,{value:e,onChange:t,showCopyButton:!1,className:"min-h-[120px]"}),c?.field==="input"&&o.jsx(I8e,{field:"input",errors:c.errors})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(xt,{children:"Ground Truth (JSON, optional)"}),o.jsx(Xn,{value:r,onChange:n,showCopyButton:!1,className:"min-h-[100px]"}),c?.field==="groundTruth"&&o.jsx(I8e,{field:"groundTruth",errors:c.errors})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(xt,{children:"Expected Trajectory (JSON, optional)"}),o.jsx(Xn,{value:i,onChange:l,showCopyButton:!1,className:"min-h-[80px]"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(xt,{children:"Metadata (JSON, optional)"}),o.jsx(Xn,{value:s,onChange:a,showCopyButton:!1,className:"min-h-[80px]"})]}),o.jsxs("div",{className:"flex gap-2 pt-4",children:[o.jsx(ce,{variant:"primary",onClick:u,disabled:f,children:f?"Saving...":"Save Changes"}),o.jsx(ce,{onClick:d,disabled:f,children:"Cancel"})]})]})]})}function F1t({item:e}){return o.jsx(Ir,{withMargins:!1,children:o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(lx,{}),o.jsx("span",{className:"truncate",children:e.id}),o.jsx(ta,{content:e.id,tooltip:`Copy item ID: ${e.id}`})]}),o.jsxs(Ir.Description,{children:[o.jsxs(Zn,{children:[o.jsx(h_,{})," Created ",tr(new Date(e.createdAt),"MMM d, yyyy h:mm aaa")]}),e.datasetVersion!=null&&o.jsxs(Zn,{children:[o.jsx(Vx,{})," Version v",e.datasetVersion]})]})]})})}function PTn({datasetId:e,itemId:t,onPrevious:r,onNext:n,onEdit:s,onDelete:a,onClose:i,isEditing:l=!1}){const{Link:c}=or();return o.jsxs(gr.Toolbar,{children:[o.jsx(xC,{onPrevious:r,onNext:n,previousAriaLabel:"Previous item",nextAriaLabel:"Next item"}),o.jsxs(ps,{children:[!l&&o.jsxs(o.Fragment,{children:[o.jsxs(ce,{href:`/datasets/${e}/items/${t}`,as:c,children:[o.jsx(Vx,{}),"Versions"]}),o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsx(ce,{"aria-label":"Actions menu",children:o.jsx(yVe,{})})}),o.jsxs(yt.Content,{align:"end",className:"w-48",children:[o.jsxs(yt.Item,{onSelect:s,children:[o.jsx(iv,{}),"Edit"]}),o.jsxs(yt.Item,{onSelect:a,className:"text-red-500 focus:text-red-400",children:[o.jsx(ed,{}),"Delete Item"]})]})]})]}),o.jsx(ce,{onClick:i,"aria-label":"Close detail panel",children:o.jsx(Nn,{})})]})]})}function MTn(e){if(!(e instanceof Error))return null;const t=e.message.match(/- ({.*})$/);if(!t)return null;try{const r=JSON.parse(t[1]);if(r.field&&Array.isArray(r.errors))return{field:r.field,errors:r.errors}}catch{}return null}function DTn({datasetId:e,item:t,items:r,onItemChange:n,onClose:s}){const{Link:a}=or(),{updateItem:i,deleteItem:l}=ni(),[c,u]=b.useState(!1),[d,f]=b.useState(""),[h,p]=b.useState(""),[m,g]=b.useState(""),[y,x]=b.useState(""),[w,S]=b.useState(null),[k,_]=b.useState(!1);b.useEffect(()=>{t&&(f(JSON.stringify(t.input,null,2)),p(t.groundTruth?JSON.stringify(t.groundTruth,null,2):""),g(t.metadata?JSON.stringify(t.metadata,null,2):""),x(t.expectedTrajectory?JSON.stringify(t.expectedTrajectory,null,2):""),u(!1),_(!1),S(null))},[t?.id]);const E=()=>{const $=r.findIndex(U=>U.id===t.id);if($>=0&&$<r.length-1)return()=>n(r[$+1].id)},T=()=>{const $=r.findIndex(U=>U.id===t.id);if($>0)return()=>n(r[$-1].id)},j=async()=>{let $;try{$=JSON.parse(d)}catch{ze.error("Input must be valid JSON");return}let U;if(h.trim())try{U=JSON.parse(h)}catch{ze.error("Ground Truth must be valid JSON");return}let z;if(m.trim())try{z=JSON.parse(m)}catch{ze.error("Metadata must be valid JSON");return}let H=null;if(y.trim())try{H=JSON.parse(y)}catch{ze.error("Expected Trajectory must be valid JSON");return}try{await i.mutateAsync({datasetId:e,itemId:t.id,input:$,groundTruth:U,metadata:z,expectedTrajectory:H}),ze.success("Item updated successfully"),u(!1),S(null)}catch(Q){const L=MTn(Q);L?S(L):ze.error(`Failed to update item: ${Q instanceof Error?Q.message:"Unknown error"}`)}},N=()=>{f(JSON.stringify(t.input,null,2)),p(t.groundTruth?JSON.stringify(t.groundTruth,null,2):""),g(t.metadata?JSON.stringify(t.metadata,null,2):""),x(t.expectedTrajectory?JSON.stringify(t.expectedTrajectory,null,2):""),u(!1),S(null)},I=$=>{f($),w?.field==="input"&&S(null)},P=$=>{p($),w?.field==="groundTruth"&&S(null)},R=()=>{u(!0)},B=()=>{_(!0)},D=async()=>{try{await l.mutateAsync({datasetId:e,itemId:t.id}),ze.success("Item deleted successfully"),_(!1),s()}catch($){ze.error(`Failed to delete item: ${$ instanceof Error?$.message:"Unknown error"}`)}};return o.jsxs(o.Fragment,{children:[o.jsxs(gr,{withLeftSeparator:!0,children:[o.jsx(PTn,{datasetId:e,itemId:t.id,onPrevious:T(),onNext:E(),onEdit:R,onDelete:B,onClose:s,isEditing:c}),o.jsx(gr.Content,{children:c?o.jsx($1t,{inputValue:d,setInputValue:I,groundTruthValue:h,setGroundTruthValue:P,metadataValue:m,setMetadataValue:g,trajectoryValue:y,setTrajectoryValue:x,validationErrors:w,onSave:j,onCancel:N,isSaving:i.isPending}):o.jsxs(o.Fragment,{children:[o.jsx(F1t,{item:t}),o.jsx(n8,{item:t,Link:a})]})})]}),o.jsx($t,{open:k,onOpenChange:_,children:o.jsxs($t.Content,{children:[o.jsxs($t.Header,{children:[o.jsx($t.Title,{children:"Delete Item"}),o.jsx($t.Description,{children:"Are you sure you want to delete this item? This action cannot be undone."})]}),o.jsxs($t.Footer,{children:[o.jsx($t.Cancel,{children:"Cancel"}),o.jsx($t.Action,{onClick:D,children:l.isPending?"Deleting...":"Yes, Delete"})]})]})})]})}function R8e(e,t=100){if(e==null)return"-";const r=typeof e=="string"?e:JSON.stringify(e);return!r||r.length<=t?r||"-":r.slice(0,t)+"..."}function LTn(e){const t=xg(e)?"Today":tr(e,"MMM dd"),r=gfe(e)?"":tr(e,"yyyy"),n=tr(e,"'at' h:mm aaa");return`${t} ${r} ${n}`.replace(/\s+/g," ").trim()}function $Tn({items:e,isLoading:t,onItemClick:r,featuredItemId:n,setEndOfListElement:s,isFetchingNextPage:a,hasNextPage:i,columns:l=[],searchQuery:c,isSelectionActive:u,selectedIds:d,onToggleSelection:f,onSelectAll:h,onClearSelection:p,maxSelection:m,onAddClick:g,onImportClick:y,onImportJsonClick:x}){if(e.length===0&&!c&&!t)return o.jsx(FTn,{onAddClick:g,onImportClick:y,onImportJsonClick:x});const w=e.map(N=>N.id),S=d.size,k=e.length>0&&S===e.length,_=S>0&&S<e.length,E=()=>{k?p():h(w)},T=(N,I,P)=>{if(m&&!d.has(N)&&d.size>=m){const[R]=Array.from(d);h([R,N]);return}f(N,I,P)},j=[u?"2rem":"",...l.map(N=>N.size)].filter(Boolean).join(" ");return o.jsxs(o.Fragment,{children:[o.jsxs(Se,{columns:j,children:[o.jsxs(Se.Top,{children:[u&&!m&&o.jsx(Se.TopCell,{children:o.jsx(fi,{checked:_?"indeterminate":k,onCheckedChange:E,"aria-label":"Select all items"})}),u&&m&&o.jsx(Se.TopCell,{children:" "}),l.map(N=>o.jsx(Se.TopCell,{children:N.label||N.name},N.name))]}),e.length===0&&c?o.jsx(Se.NoMatch,{message:"No items match your search"}):o.jsxs(Se.Rows,{children:[e.map(N=>{const I=new Date(N.createdAt),P=n===N.id;return o.jsxs(Se.Row,{onClick:()=>r?.(N.id),selected:P||d.has(N.id),children:[u&&o.jsx(Se.Cell,{children:o.jsx(fi,{checked:d.has(N.id),onCheckedChange:()=>{},onClick:R=>{R.stopPropagation(),T(N.id,R.shiftKey,w)},"aria-label":`Select item ${N.id}`})}),o.jsx(Se.TextCell,{children:o.jsx("span",{className:"truncate block font-mono",children:N.id})}),o.jsx(Se.TextCell,{children:o.jsx("span",{className:"truncate block font-mono",children:R8e(N.input,60)})}),l.some(R=>R.name==="groundTruth")&&o.jsx(Se.TextCell,{children:o.jsx("span",{className:"truncate block font-mono",children:N.groundTruth?R8e(N.groundTruth,40):"-"})}),l.some(R=>R.name==="trajectory")&&o.jsx(Se.TextCell,{children:N.expectedTrajectory?o.jsx("span",{className:"text-xs",children:Array.isArray(N.expectedTrajectory?.steps)?`${N.expectedTrajectory.steps.length} steps`:"Yes"}):o.jsx("span",{className:"text-neutral4",children:"—"})}),o.jsx(Se.TextCell,{children:o.jsx("span",{className:"truncate block text-neutral2",children:LTn(I)})})]},N.id)}),o.jsx("div",{ref:s,className:"h-1 col-span-full",children:a&&o.jsx("div",{className:"flex justify-center py-4",children:o.jsx(Dt,{})})})]})]}),!i&&e.length>0&&o.jsx(me,{variant:"ui-xs",className:"text-icon3 text-center",children:"All items loaded"})]})}function FTn({onAddClick:e,onImportClick:t,onImportJsonClick:r}){return o.jsx("div",{className:"flex h-full items-center justify-center py-12",children:o.jsx(Ja,{iconSlot:o.jsx(us,{className:"w-8 h-8 text-neutral3"}),titleSlot:"No items yet",descriptionSlot:"Add items to this dataset to use them in experiment runs.",actionSlot:o.jsxs(ps,{children:[o.jsxs(ce,{onClick:e,size:"md",children:[o.jsx(us,{}),"Add Single Item"]}),t&&o.jsxs(ce,{onClick:t,size:"md",children:[o.jsx(fF,{}),"Import CSV"]}),r&&o.jsxs(ce,{onClick:r,size:"md",children:[o.jsx(_R,{}),"Import JSON"]})]})})})}function zTn({onExportClick:e,onExportJsonClick:t,onCreateDatasetClick:r,onAddToDatasetClick:n,onDeleteClick:s,onCompareClick:a}){return o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsxs(ce,{"aria-label":"Actions menu",children:["Select ",o.jsx(MPt,{})]})}),o.jsxs(yt.Content,{align:"end",className:"w-72",children:[o.jsxs(yt.Item,{onSelect:a,children:[o.jsx(zm,{}),o.jsx("span",{children:"Compare Items"})]}),o.jsx(yt.Separator,{}),o.jsxs(yt.Item,{onSelect:e,children:[o.jsx(Tk,{}),o.jsx("span",{children:"Export Items as CSV"})]}),o.jsxs(yt.Item,{onSelect:t,children:[o.jsx(Tk,{}),o.jsx("span",{children:"Export Items as JSON"})]}),o.jsx(yt.Separator,{}),o.jsxs(yt.Item,{onSelect:r,children:[o.jsx(lF,{}),o.jsx("span",{children:"Create Dataset from Items"})]}),o.jsxs(yt.Item,{onSelect:n,children:[o.jsx(T2t,{}),o.jsx("span",{children:"Copy Items to Dataset"})]}),o.jsx(yt.Separator,{}),o.jsxs(yt.Item,{onSelect:s,className:"text-red-500 focus:text-red-400",children:[o.jsx(ed,{}),o.jsx("span",{children:"Delete Items"})]})]})]})}function BTn({onAddClick:e,onImportClick:t,onImportJsonClick:r,onExportClick:n,onExportJsonClick:s,onCreateDatasetClick:a,onAddToDatasetClick:i,onDeleteClick:l,onCompareClick:c,hasItems:u,searchQuery:d,isSelectionActive:f,onSearchChange:h,selectedCount:p,onExecuteAction:m,onCancelSelection:g,selectionMode:y,onVersionsClick:x,isItemPanelOpen:w,isVersionsPanelOpen:S,isViewingOldVersion:k}){return f?o.jsxs(gr.Toolbar,{className:"",children:[o.jsx(Ox,{name:"search-items",label:"Search",labelIsHidden:!0,placeholder:"Search items...",value:d??"",onChange:_=>h?.(_.target.value),onReset:()=>h?.(""),disabled:!u&&!d}),o.jsxs("div",{className:"flex gap-5",children:[o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsxs("div",{className:"text-sm text-neutral3 flex items-center gap-2",children:[o.jsx(za,{size:"large",color:y==="compare-items"&&p<2||p===0?"red":"green",children:p}),o.jsx("span",{children:y==="compare-items"?"of 2 items selected":"items selected"}),o.jsx(oce,{})]})}),(y==="compare-items"&&p<2||p===0)&&o.jsx(Wr,{children:y==="compare-items"?p<=2?"Select 2 items to compare":void 0:p===0?"Select at least one item":void 0})]}),o.jsxs(ps,{children:[o.jsxs(ce,{variant:"primary",disabled:y==="compare-items"?p!==2:p===0,onClick:m,children:[y==="compare-items"&&"Compare Items",y==="export"&&"Export Items as CSV",y==="export-json"&&"Export Items as JSON",y==="create-dataset"&&"Create a new Dataset with Items",y==="add-to-dataset"&&"Add Items to a Dataset",y==="delete"&&"Delete Items"]}),o.jsx(ce,{onClick:g,children:"Cancel"})]})]})]}):o.jsxs("div",{className:"flex items-center justify-between gap-4 w-full",children:[o.jsx(Ox,{name:"search-items",label:"Search",labelIsHidden:!0,placeholder:"Search items...",value:d??"",onChange:_=>h?.(_.target.value),onReset:()=>h?.(""),disabled:!u&&!d}),o.jsxs(ps,{children:[!w&&!k&&o.jsxs(ps,{spacing:"close",children:[o.jsxs(ce,{onClick:e,children:[o.jsx(us,{})," Add Item"]}),o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsx(ce,{"aria-label":"Dataset actions menu",children:o.jsx(as,{})})}),o.jsxs(yt.Content,{align:"end",children:[o.jsxs(yt.Item,{onSelect:t,children:[o.jsx(fF,{})," Import CSV"]}),o.jsxs(yt.Item,{onSelect:r,children:[o.jsx(_R,{})," Import JSON"]})]})]})]}),u&&!k&&o.jsx(zTn,{onExportClick:n,onExportJsonClick:s,onCreateDatasetClick:a,onAddToDatasetClick:i,onDeleteClick:l,onCompareClick:c}),!w&&!S&&o.jsxs(ce,{onClick:x,"aria-label":"View versions",children:[o.jsx(Vx,{className:"w-4 h-4"}),"Versions"]})]})]})}function UTn({datasetId:e,onClose:t,onVersionSelect:r,onCompareVersionsClick:n,activeVersion:s}){const{data:a,isLoading:i,fetchNextPage:l,hasNextPage:c,isFetchingNextPage:u}=Nve(e),[d,f]=b.useState(!1),[h,p]=b.useState(new Set),m=k=>{r?.(k)},g=k=>s==null?k.isCurrent:k.version===s,y=k=>{p(_=>{const E=new Set(_);if(E.has(k))E.delete(k);else if(E.size>=2){const[T]=Array.from(E);return new Set([T,k])}else E.add(k);return E})},x=()=>{f(!1),p(new Set)},w=()=>{f(!0)},S=()=>{h.size===2&&n?.(Array.from(h))};return o.jsxs(gr,{withLeftSeparator:!0,className:"w-56",children:[d?o.jsx(gr.Toolbar,{className:"grid justify-stretch gap-3 w-full",children:o.jsxs(ps,{children:[o.jsx(ce,{onClick:x,children:"Cancel"}),o.jsxs(Ln,{variant:"primary",disabled:h.size!==2,onClick:S,tooltipContent:h.size!==2?"Select two versions to enable comparison":void 0,className:"w-full",children:[o.jsx(Dw,{})," Compare"]})]})}):o.jsxs(gr.Toolbar,{children:[o.jsxs(ce,{onClick:w,children:[o.jsx(zm,{})," Compare Ver."]}),o.jsx(Ln,{onClick:t,tooltipContent:"Hide Versions Panel",children:o.jsx(Nn,{})})]}),o.jsx(gr.Content,{children:i?o.jsx(VTn,{}):o.jsxs(Pt,{children:[o.jsx(Pt.Header,{children:o.jsx(Pt.HeaderCol,{children:"Dataset Version History"})}),o.jsxs(Pt.Scroller,{children:[o.jsx(Pt.Items,{children:a?.map(k=>{const _=String(k.version),E=k.createdAt?typeof k.createdAt=="string"?new Date(k.createdAt):k.createdAt:null;return o.jsxs(Pt.Row,{isSelected:d&&h.has(_),children:[d&&o.jsx(Pt.LabelCell,{children:o.jsx(fi,{checked:h.has(_),onCheckedChange:()=>{},onClick:T=>{T.stopPropagation(),y(_)},"aria-label":`Select version ${E?`v${k.version} — ${tr(E,"MMM d, yyyy HH:mm")}`:`v${k.version}`}`})}),o.jsx(Pt.RowButton,{item:k,isFeatured:g(k),columns:[{name:"version",label:"Dataset Version History",size:"1fr"}],onClick:()=>m(k),className:"py-2",children:o.jsx(Pt.VersionCell,{version:k.version,date:E,isLatest:k.isCurrent})})]},String(k.version))})}),c&&o.jsx(ce,{size:"md",onClick:()=>l(),disabled:u,className:"w-full mt-2",children:u?"Loading...":"Load More"})]})]})})]})}function VTn(){return o.jsxs(Pt,{children:[o.jsx(Pt.Header,{children:o.jsx(Pt.HeaderCol,{children:"Dataset Version History"})}),o.jsx(Pt.Items,{children:Array.from({length:3}).map((e,t)=>o.jsx(Pt.Row,{children:o.jsx(Pt.RowButton,{columns:[{name:"version",label:"Dataset Version History",size:"1fr"}],children:o.jsx(Pt.TextCell,{isLoading:!0,children:"Loading..."})})},t))})]})}function qTn({datasetId:e,items:t,isLoading:r,featuredItemId:n,onItemSelect:s,onItemClose:a,onAddClick:i,onImportClick:l,onImportJsonClick:c,onBulkDeleteClick:u,onCreateDatasetClick:d,onAddToDatasetClick:f,onCompareItemsClick:h,datasetName:p,clearSelectionTrigger:m,setEndOfListElement:g,isFetchingNextPage:y,hasNextPage:x,searchQuery:w,onSearchChange:S,activeDatasetVersion:k,currentDatasetVersion:_,onVersionSelect:E,onCompareVersionsClick:T}){const[j,N]=b.useState(!1),[I,P]=b.useState("idle"),R=eTn(),B=t.find(V=>V.id===n)??null;b.useEffect(()=>{m!==void 0&&m>0&&(R.clearSelection(),P("idle"))},[m]);const D=k!=null&&_!=null&&k!==_,$=V=>{V===n?a():s(V)},U=()=>{N(!0)},z=()=>{N(!1)},H=()=>{P("idle"),R.clearSelection()},Q=()=>{if(R.selectedCount===0)return;const V=t.filter(M=>R.selectedIds.has(M.id));if(I==="export"){try{tTn(V,`${p||"dataset"}-items.csv`),ze.success(`Exported ${R.selectedCount} items to CSV`)}catch(M){ze.error("Failed to export items to CSV"),console.error("CSV export error:",M)}H()}else if(I==="export-json"){try{rTn(V,`${p||"dataset"}-items.json`),ze.success(`Exported ${R.selectedCount} items to JSON`)}catch(M){ze.error("Failed to export items to JSON"),console.error("JSON export error:",M)}H()}else I==="create-dataset"?d?.(V):I==="add-to-dataset"?f?.(V):I==="delete"?u?.(Array.from(R.selectedIds)):I==="compare-items"&&h?.(Array.from(R.selectedIds))},L=I!=="idle",Z=[{name:"id",label:"ID",size:"5rem"},{name:"input",label:"Input",size:"1fr"},...B?[]:[{name:"groundTruth",label:"Ground Truth",size:"1fr"}],...B?[]:[{name:"trajectory",label:"Trajectory",size:"6rem"}],{name:"date",label:"Created",size:"10rem"}];return o.jsxs(tf,{className:Y({"grid-cols-[1fr_1fr]":!!B,"grid-cols-[1fr_auto]":j&&!B}),children:[o.jsxs(gr,{children:[o.jsx(BTn,{onAddClick:i,onImportClick:l??(()=>{}),onImportJsonClick:c??(()=>{}),onExportClick:()=>P("export"),onExportJsonClick:()=>P("export-json"),onCreateDatasetClick:()=>P("create-dataset"),onAddToDatasetClick:()=>P("add-to-dataset"),onDeleteClick:()=>P("delete"),onCompareClick:()=>P("compare-items"),hasItems:t.length>0,searchQuery:w,onSearchChange:S,isSelectionActive:L,selectedCount:R.selectedCount,onExecuteAction:Q,onCancelSelection:H,selectionMode:I,onVersionsClick:U,isItemPanelOpen:!!B,isVersionsPanelOpen:j,isViewingOldVersion:D}),D&&k!=null&&o.jsx(cn,{variant:"warning",title:"Previous version",action:o.jsxs(cn.Button,{onClick:()=>E?.({version:_,isCurrent:!0}),children:[o.jsx(fw,{})," Return to the latest version"]}),children:o.jsxs(cn.Message,{children:["Viewing version v",k]})}),o.jsx($Tn,{items:t,isLoading:r,onItemClick:$,featuredItemId:n,columns:Z,setEndOfListElement:g,isFetchingNextPage:y,hasNextPage:x,isSelectionActive:L,selectedIds:R.selectedIds,onToggleSelection:R.toggle,onSelectAll:R.selectAll,onClearSelection:R.clearSelection,maxSelection:I==="compare-items"?2:void 0,onAddClick:i,onImportClick:l,onImportJsonClick:c,searchQuery:w})]}),!!B&&o.jsx(DTn,{datasetId:e,item:B,items:t,onItemChange:s,onClose:a}),!B&&j&&o.jsx(UTn,{datasetId:e,onClose:z,onVersionSelect:E,onCompareVersionsClick:T,activeVersion:k})]})}function P8e(e,t=50){if(e==null)return"-";const r=typeof e=="string"?e:JSON.stringify(e);return r.length<=t?r:r.slice(0,t)+"..."}function HTn({items:e,maxRows:t=5}){const r=e.slice(0,t),n=e.length-t;return o.jsxs("div",{className:"border border-border1 rounded-md overflow-hidden",children:[o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"bg-surface2 border-b border-border1",children:[o.jsx("th",{className:"px-3 py-2 text-left font-medium text-neutral3 w-8",children:"#"}),o.jsx("th",{className:"px-3 py-2 text-left font-medium text-neutral3",children:"Input"}),o.jsx("th",{className:"px-3 py-2 text-left font-medium text-neutral3",children:"Ground Truth"}),o.jsx("th",{className:"px-3 py-2 text-left font-medium text-neutral3 w-24",children:"Metadata"})]})}),o.jsx("tbody",{children:r.map((s,a)=>o.jsxs("tr",{className:"border-b border-border1 last:border-b-0",children:[o.jsx("td",{className:"px-3 py-2 text-neutral4",children:a+1}),o.jsx("td",{className:"px-3 py-2 text-neutral1 font-mono text-xs",children:P8e(s.input)}),o.jsx("td",{className:"px-3 py-2 text-neutral2 font-mono text-xs",children:P8e(s.groundTruth)}),o.jsx("td",{className:"px-3 py-2 text-neutral3 text-xs",children:s.metadata?`${Object.keys(s.metadata).length} keys`:"-"})]},a))})]}),n>0&&o.jsxs("div",{className:"bg-surface2 px-3 py-2 text-xs text-neutral4 text-center border-t border-border1",children:["+",n," more item",n!==1?"s":""]})]})}function QTn({onFileSelect:e,isParsing:t,error:r}){const n=b.useRef(null),[s,a]=b.useState(!1),i=b.useCallback(()=>{t||n.current?.click()},[t]),l=b.useCallback(f=>{const h=f.target.files?.[0];h&&e(h),f.target.value=""},[e]),c=b.useCallback(f=>{f.preventDefault(),f.stopPropagation(),a(!0)},[]),u=b.useCallback(f=>{f.preventDefault(),f.stopPropagation(),a(!1)},[]),d=b.useCallback(f=>{if(f.preventDefault(),f.stopPropagation(),a(!1),t)return;const h=f.dataTransfer.files?.[0];h&&h.name.endsWith(".json")&&e(h)},[t,e]);return o.jsxs("div",{className:"flex flex-col gap-3",children:[o.jsx("input",{ref:n,type:"file",accept:".json",onChange:l,className:"hidden",disabled:t}),o.jsx("div",{onClick:i,onDragOver:c,onDragLeave:u,onDrop:d,className:Y("flex flex-col items-center justify-center gap-3","min-h-[160px] rounded-lg border-2 border-dashed p-6","cursor-pointer transition-colors","border-surface4 bg-surface2",s&&"border-accent1/50 bg-accent1/5",r&&"border-accent2/50 bg-accent2/5",t&&"cursor-wait opacity-60"),children:t?o.jsxs(o.Fragment,{children:[o.jsx(Dt,{size:"lg"}),o.jsx("span",{className:"text-sm text-neutral4",children:"Parsing JSON..."})]}):o.jsxs(o.Fragment,{children:[o.jsx(Ce,{className:"text-neutral4",children:o.jsx(_R,{className:"h-8 w-8"})}),o.jsxs("div",{className:"flex flex-col items-center gap-1",children:[o.jsx("span",{className:"text-sm font-medium text-neutral1",children:"Click to upload or drag and drop"}),o.jsx("span",{className:"text-xs text-neutral4",children:"JSON files only"})]})]})}),r&&o.jsx("div",{className:"text-sm text-accent2",children:r}),o.jsxs("div",{className:"text-xs text-neutral4 bg-surface2 p-3 rounded-md",children:[o.jsx("p",{className:"font-medium mb-1",children:"Expected format:"}),o.jsx("pre",{className:"text-[10px] overflow-x-auto",children:`[
|
|
544
|
+
`,children:[o.jsx("span",{...m.dragHandleProps,className:"text-neutral4 cursor-grab active:cursor-grabbing",children:o.jsx(Ce,{children:o.jsx(uF,{className:"h-3.5 w-3.5"})})}),o.jsx("span",{children:h})]});return g.isDragging?cu.createPortal(y,document.body):y}},h)),d.placeholder]})})]},i.id)}),!a&&o.jsx("div",{className:"text-sm text-warning",children:"At least one column must be mapped to Input"})]})})}function N8e({headers:e,data:t,maxRows:r=5}){const n=t.slice(0,r),s=t.length,a=i=>{if(i==null)return"";const l=typeof i=="object"?JSON.stringify(i):String(i);return l.length>50?l.slice(0,47)+"...":l};return o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("div",{className:"overflow-x-auto rounded-lg border border-border1",children:o.jsxs(qLr,{size:"small",children:[o.jsx(HLr,{children:e.map(i=>o.jsx(QLr,{children:i},i))}),o.jsx(WLr,{children:n.map((i,l)=>o.jsx(GLr,{children:e.map(c=>o.jsx(ZLr,{className:"text-sm max-w-[200px]",children:o.jsx("span",{className:"truncate block",children:a(i[c])})},c))},l))})]})}),o.jsx("div",{className:"text-xs text-neutral4",children:n.length<s?`Showing ${n.length} of ${s} rows`:`${s} row${s!==1?"s":""}`})]})}function wTn({onFileSelect:e,isParsing:t,error:r}){const n=b.useRef(null),[s,a]=b.useState(!1),i=b.useCallback(()=>{t||n.current?.click()},[t]),l=b.useCallback(f=>{const h=f.target.files?.[0];h&&e(h),f.target.value=""},[e]),c=b.useCallback(f=>{f.preventDefault(),f.stopPropagation(),a(!0)},[]),u=b.useCallback(f=>{f.preventDefault(),f.stopPropagation(),a(!1)},[]),d=b.useCallback(f=>{if(f.preventDefault(),f.stopPropagation(),a(!1),t)return;const h=f.dataTransfer.files?.[0];h&&h.name.endsWith(".csv")&&e(h)},[t,e]);return o.jsxs("div",{className:"flex flex-col gap-3",children:[o.jsx("input",{ref:n,type:"file",accept:".csv",onChange:l,className:"hidden",disabled:t}),o.jsx("div",{onClick:i,onDragOver:c,onDragLeave:u,onDrop:d,className:Y("flex flex-col items-center justify-center gap-3","min-h-[160px] rounded-lg border-2 border-dashed p-6","cursor-pointer transition-colors","border-surface4 bg-surface2",s&&"border-accent1/50 bg-accent1/5",r&&"border-accent2/50 bg-accent2/5",t&&"cursor-wait opacity-60"),children:t?o.jsxs(o.Fragment,{children:[o.jsx(Dt,{size:"lg"}),o.jsx("span",{className:"text-sm text-neutral4",children:"Parsing CSV..."})]}):o.jsxs(o.Fragment,{children:[o.jsx(Ce,{className:"text-neutral4",children:o.jsx(fF,{className:"h-8 w-8"})}),o.jsxs("div",{className:"flex flex-col items-center gap-1",children:[o.jsx("span",{className:"text-sm font-medium text-neutral1",children:"Click to upload or drag and drop"}),o.jsx("span",{className:"text-xs text-neutral4",children:"CSV files only"})]})]})}),r&&o.jsx("div",{className:"text-sm text-accent2",children:r})]})}function STn({result:e,className:t}){const{validCount:r,invalidCount:n,totalRows:s,invalidRows:a}=e;return n===0?o.jsxs("div",{className:Y("flex items-center gap-2 text-sm text-success",t),children:[o.jsx(Jw,{className:"w-4 h-4"}),"All ",s," row",s!==1?"s":""," valid"]}):o.jsxs("div",{className:Y("space-y-3",t),children:[o.jsxs("div",{className:"flex items-center gap-2 text-sm text-warning",children:[o.jsx(AE,{className:"w-4 h-4"}),n," of ",s," rows will be skipped (validation failed)"]}),r>0&&o.jsxs("div",{className:"text-sm text-muted-foreground",children:[r," rows will be imported"]}),o.jsx("div",{className:"max-h-48 overflow-y-auto border rounded-md",children:o.jsxs("table",{className:"w-full text-xs",children:[o.jsx("thead",{className:"bg-muted sticky top-0",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-2 py-1 text-left font-medium",children:"Row"}),o.jsx("th",{className:"px-2 py-1 text-left font-medium",children:"Field"}),o.jsx("th",{className:"px-2 py-1 text-left font-medium",children:"Error"})]})}),o.jsxs("tbody",{children:[a.map((i,l)=>o.jsx(OTn,{row:i},l)),n>a.length&&o.jsx("tr",{children:o.jsxs("td",{colSpan:3,className:"px-2 py-1 text-muted-foreground italic",children:["... and ",n-a.length," more"]})})]})]})})]})}function OTn({row:e}){const t=e.errors[0]?.message||"Validation failed",r=e.errors[0]?.path||"/";return o.jsxs("tr",{className:"border-t",children:[o.jsx("td",{className:"px-2 py-1 text-muted-foreground",children:e.rowNumber}),o.jsx("td",{className:"px-2 py-1",children:o.jsxs("code",{className:"text-xs bg-muted px-1 rounded",children:[e.field,r!=="/"?r:""]})}),o.jsx("td",{className:"px-2 py-1 text-destructive",children:t})]})}function kTn({errors:e}){return e.length===0?null:o.jsx(cn,{variant:"destructive",title:`${e.length} validation error${e.length!==1?"s":""} found`,children:o.jsx("div",{className:"max-h-[120px] overflow-y-auto space-y-1 text-sm",children:e.map((t,r)=>o.jsxs("div",{children:["Row ",t.row,": ",o.jsxs("span",{className:"font-medium",children:["[",t.column,"]"]})," - ",t.message]},r))})})}function _Tn({datasetId:e,open:t,onOpenChange:r,onSuccess:n}){const[s,a]=b.useState("upload"),[i,l]=b.useState(null),[c,u]=b.useState([]),[d,f]=b.useState({current:0,total:0}),[h,p]=b.useState(null),[m,g]=b.useState(!1),[y,x]=b.useState(null),{parseFile:w,isParsing:S,error:k}=Yjn(),{batchInsertItems:_}=ni(),{data:E}=Tg(e),T=vTn(i?.headers??[]),j=b.useCallback(async Q=>{try{const L=await w(Q);l(L),T.resetMapping(),a("preview")}catch{}},[w,T]),N=b.useCallback(()=>{if(!i)return[];const Q=[],{data:L,headers:Z}=i,{mapping:V}=T,M=Z.filter(W=>V[W]==="input");return M.length===0?(Q.push({row:0,column:"Input",message:"At least one column must be mapped to Input"}),Q):(L.forEach((W,G)=>{const J=G+2;M.forEach(ae=>{const te=W[ae];(te==null||te==="")&&Q.push({row:J,column:ae,message:"Input value is required"})})}),Q)},[i,T]),I=b.useCallback((Q,L,Z)=>{const V=Z.filter(te=>L[te]==="input"),M=V.length===1?Q[V[0]]:V.reduce((te,re)=>(te[re]=Q[re],te),{}),W=Z.filter(te=>L[te]==="groundTruth");let G;W.length===1?G=Q[W[0]]:W.length>1&&(G=W.reduce((te,re)=>(te[re]=Q[re],te),{}));const J=Z.filter(te=>L[te]==="metadata");let ae;return J.length>0&&(ae=J.reduce((te,re)=>(te[re]=Q[re],te),{})),{input:M,groundTruth:G,metadata:ae}},[]),P=b.useCallback(()=>{const Q=N();if(u(Q),Q.length>0||!i)return;const{data:L,headers:Z}=i,{mapping:V}=T,M=L.map(G=>I(G,V,Z));if(E?.inputSchema||E?.groundTruthSchema){const G=Xjn(M,E?.inputSchema,E?.groundTruthSchema,10);if(x(G),G.validCount===0){u([{row:0,column:"",message:"All rows failed schema validation. Please check your data."}]);return}a("validation")}else x({validCount:M.length,invalidCount:0,validRows:M.map((G,J)=>({rowNumber:J+2,...G})),invalidRows:[],totalRows:M.length}),a("validation")},[N,i,T,I,E]),R=b.useCallback(async()=>{if(!y||y.validCount===0)return;a("importing"),g(!0);const Q=y.validRows;f({current:0,total:Q.length});const L=Q.map(Z=>{const{input:V,groundTruth:M}=Z;let W;if(i){const G=Z.rowNumber-2,{headers:J}=i,{mapping:ae}=T,te=i.data[G];if(te){const re=J.filter(ie=>ae[ie]==="metadata");re.length>0&&(W=re.reduce((ie,he)=>(ie[he]=te[he],ie),{}))}}return{input:V,groundTruth:M,metadata:W}});try{await _.mutateAsync({datasetId:e,items:L}),p({success:L.length,errors:0})}catch{p({success:0,errors:L.length})}f({current:Q.length,total:Q.length}),g(!1),a("complete")},[y,_,e,i,T]),B=b.useCallback(()=>{if(h){const Q=y?.invalidCount??0;Q>0?ze.success(`Imported ${h.success} row${h.success!==1?"s":""} (${Q} skipped)`):ze.success(`Imported ${h.success} row${h.success!==1?"s":""}`)}r(!1),n?.(),setTimeout(()=>{a("upload"),l(null),u([]),x(null),f({current:0,total:0}),p(null)},150)},[r,n,h,y]),D=b.useCallback(()=>{m||(r(!1),setTimeout(()=>{a("upload"),l(null),u([]),x(null),f({current:0,total:0}),p(null)},150))},[m,r]),$=b.useCallback((Q,L)=>{T.setColumnField(Q,L),u([])},[T]),U=()=>{switch(s){case"upload":return o.jsx(wTn,{onFileSelect:j,isParsing:S,error:k?.message});case"preview":return i?o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsx("div",{className:"text-sm text-neutral4",children:"Preview of your CSV data. Click Next to map columns."}),o.jsx(N8e,{headers:i.headers,data:i.data,maxRows:5})]}):null;case"mapping":return i?o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsx(xTn,{headers:i.headers,mapping:T.mapping,onMappingChange:$}),c.length>0&&o.jsx(kTn,{errors:c}),o.jsxs("div",{className:"border-t border-border1 pt-4",children:[o.jsx("div",{className:"text-xs text-neutral4 mb-2",children:"Data Preview"}),o.jsx(N8e,{headers:i.headers,data:i.data,maxRows:3})]})]}):null;case"validation":return y?o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsx("div",{className:"text-sm text-neutral4",children:E?.inputSchema||E?.groundTruthSchema?"Rows have been validated against the dataset schema.":"Ready to import. No schema validation required."}),y.invalidCount>0?o.jsxs("div",{className:"p-3 bg-warning/10 border border-warning/30 rounded-md",children:[o.jsxs("div",{className:"flex items-center gap-2 text-warning font-medium",children:[o.jsx("span",{className:"text-lg",children:"⚠"}),y.invalidCount," row",y.invalidCount!==1?"s":""," will be skipped"]}),o.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[y.validCount," of ",y.totalRows," rows will be imported"]})]}):o.jsx("div",{className:"p-3 bg-success/10 border border-success/30 rounded-md",children:o.jsxs("div",{className:"flex items-center gap-2 text-success font-medium",children:[o.jsx("span",{className:"text-lg",children:"✓"}),"All ",y.totalRows," row",y.totalRows!==1?"s are":" is"," valid"]})}),y.validCount===0&&o.jsx("p",{className:"text-sm text-destructive",children:"No valid rows to import. Please fix the data or adjust the schema."}),y.invalidCount>0&&o.jsx(STn,{result:y})]}):null;case"importing":return o.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[o.jsx(Dt,{size:"lg"}),o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"text-lg font-medium text-neutral1",children:"Importing items..."}),o.jsxs("div",{className:"text-sm text-neutral4 mt-1",children:[d.current," of ",d.total]})]})]});case"complete":return o.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[o.jsx("div",{className:"text-4xl",children:h&&h.errors===0?"✓":"⚠"}),o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"text-lg font-medium text-neutral1",children:"Import Complete"}),o.jsxs("div",{className:"text-sm text-neutral4 mt-1",children:[h?.success??0," item",h?.success!==1?"s":""," imported",h&&h.errors>0&&o.jsxs("span",{className:"text-accent2",children:[" ","(",h.errors," error",h.errors!==1?"s":"",")"]})]})]})]})}},z=()=>{switch(s){case"upload":return o.jsx(ce,{onClick:D,children:"Cancel"});case"preview":return o.jsxs(o.Fragment,{children:[o.jsx(ce,{onClick:()=>a("upload"),children:"Back"}),o.jsx(ce,{variant:"primary",onClick:()=>a("mapping"),children:"Next"})]});case"mapping":return o.jsxs(o.Fragment,{children:[o.jsx(ce,{onClick:()=>a("preview"),children:"Back"}),o.jsx(ce,{variant:"primary",onClick:P,disabled:!T.isInputMapped,children:E?.inputSchema||E?.groundTruthSchema?"Validate":"Next"})]});case"validation":return o.jsxs(o.Fragment,{children:[o.jsx(ce,{onClick:()=>a("mapping"),children:"Back"}),o.jsx(ce,{variant:"primary",onClick:R,disabled:!y||y.validCount===0,children:y?.invalidCount?`Import ${y.validCount} Valid Row${y.validCount!==1?"s":""}`:`Import ${y?.totalRows??0} Row${y?.totalRows!==1?"s":""}`})]});case"importing":return null;case"complete":return o.jsx(ce,{variant:"primary",onClick:B,children:"Done"})}},H={upload:"Import CSV",preview:"Preview Data",mapping:"Map Columns",validation:"Review Validation",importing:"Importing",complete:"Import Complete"};return o.jsx(On,{open:t,onOpenChange:D,children:o.jsxs(vn,{className:"max-w-2xl max-h-[90vh]",children:[o.jsxs(kn,{children:[o.jsx(bn,{children:H[s]}),o.jsx(qs,{children:"Import dataset items from a CSV file."})]}),o.jsx(Bn,{className:"min-h-[200px] max-h-[50vh] overflow-y-auto",children:U()}),o.jsx(uf,{className:"px-6 pt-4 flex justify-end gap-2",children:z()})]})})}const A8e=[{name:"experimentId",label:"ID",size:"6rem"},{name:"status",label:"Status",size:"4rem"},{name:"targetType",label:"Type",size:"4rem"},{name:"target",label:"Target",size:"1fr"},{name:"counts",label:"Counts",size:"7rem"},{name:"date",label:"Created",size:"10rem"}];function ETn(e){const t=xg(e)?"Today":tr(e,"MMM dd"),r=gfe(e)?"":tr(e,"yyyy"),n=tr(e,"'at' h:mm aaa");return`${t} ${r} ${n}`.replace(/\s+/g," ").trim()}function CTn(e){return e.charAt(0).toUpperCase()+e.slice(1)}function jTn({experiments:e,isSelectionActive:t,selectedExperimentIds:r,onRowClick:n,onToggleSelection:s}){if(e.length===0)return o.jsx(TTn,{});const a=[t?"2rem":"",...A8e.map(i=>i.size)].filter(Boolean).join(" ");return o.jsxs(Se,{columns:a,children:[o.jsxs(Se.Top,{children:[t&&o.jsx(Se.TopCell,{children:" "}),A8e.map(i=>o.jsx(Se.TopCell,{children:i.label},i.name))]}),o.jsx(Se.Rows,{children:e.map(i=>{const l=r.includes(i.id),c=new Date(i.createdAt);return o.jsxs(Se.Row,{onClick:()=>t?s(i.id):n(i.id),selected:l,children:[t&&o.jsx(Se.Cell,{children:o.jsx("div",{onClick:u=>u.stopPropagation(),children:o.jsx(fi,{checked:l,onCheckedChange:()=>s(i.id),"aria-label":`Select experiment ${i.id}`})})}),o.jsx(Se.TextCell,{children:o.jsx("span",{className:"truncate block font-mono",children:i.id})}),o.jsx(Se.Cell,{children:i.status&&o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx("div",{className:"flex items-center justify-center w-10 relative bg-transparent h-full",children:o.jsx("div",{className:Y("w-2 h-2 rounded-full",{"bg-green-600":["success","completed"].includes(i.status),"bg-red-700":["error","failed"].includes(i.status),"bg-yellow-500":["pending","running"].includes(i.status)})})})}),o.jsx(Wr,{children:CTn(i.status)})]})}),o.jsx(Se.TextCell,{children:i.targetType}),o.jsx(Se.TextCell,{children:o.jsx("span",{className:"truncate block",children:i.targetId})}),o.jsx(Se.Cell,{children:o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsxs("div",{className:"flex gap-1",children:[i.succeededCount>0&&o.jsx(za,{color:"green",children:i.succeededCount}),i.failedCount>0&&o.jsx(za,{color:"red",children:i.failedCount})]})}),o.jsxs(Wr,{children:[i.succeededCount," Succeeded",o.jsx("br",{}),i.failedCount," Failed"]})]})}),o.jsx(Se.TextCell,{children:o.jsx("span",{className:"truncate block text-neutral2",children:ETn(c)})})]},i.id)})})]})}function TTn(){return o.jsx("div",{className:"flex h-full items-center justify-center py-12",children:o.jsx(Ja,{iconSlot:o.jsx(ux,{className:"w-8 h-8 text-neutral3"}),titleSlot:"No experiments yet",descriptionSlot:"Trigger an experiment to evaluate your dataset against an agent, workflow, or scorer."})})}const NTn=[{value:"all",label:"All statuses"},{value:"pending",label:"Pending"},{value:"running",label:"Running"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"}],ATn=[{value:"all",label:"All types"},{value:"agent",label:"Agent"},{value:"workflow",label:"Workflow"},{value:"scorer",label:"Scorer"},{value:"processor",label:"Processor"}];function ITn({hasExperiments:e,onCompareClick:t,isSelectionActive:r,selectedCount:n,onExecuteCompare:s,onCancelSelection:a,filters:i,onFiltersChange:l,targetIds:c}){const u=[{value:"all",label:"All targets"},...c.map(d=>({value:d,label:d}))];return r?o.jsx("div",{className:"flex items-center justify-end gap-4 w-full",children:o.jsxs("div",{className:"flex gap-5",children:[o.jsxs("div",{className:"text-sm text-neutral3 flex items-center gap-2 pl-6",children:[o.jsx(za,{size:"large",color:n<2?"red":"green",children:n}),o.jsx("span",{children:"of 2 experiments selected"}),o.jsx(oce,{})]}),o.jsxs(ps,{children:[o.jsxs(ce,{variant:"primary",disabled:n!==2,onClick:s,children:[o.jsx(zm,{className:"w-4 h-4"}),"Compare Experiments"]}),o.jsx(ce,{onClick:a,children:"Cancel"})]})]})}):o.jsxs("div",{className:"flex items-center justify-between gap-4 w-full",children:[o.jsxs(ps,{children:[o.jsx($o,{label:"Status",labelIsHidden:!0,name:"filter-status",options:NTn,value:i.status??"all",onValueChange:d=>l({...i,status:d==="all"?void 0:d})}),o.jsx($o,{label:"Type",labelIsHidden:!0,name:"filter-target-type",options:ATn,value:i.targetType??"all",onValueChange:d=>l({...i,targetType:d==="all"?void 0:d})}),c.length>0&&o.jsx($o,{label:"Target",labelIsHidden:!0,name:"filter-target-id",options:u,value:i.targetId??"all",onValueChange:d=>l({...i,targetId:d==="all"?void 0:d})}),(i.status||i.targetType||i.targetId)&&o.jsxs(ce,{onClick:()=>l({}),children:[o.jsx(Nn,{}),"Reset"]})]}),e&&o.jsxs(ce,{onClick:t,children:[o.jsx(zm,{}),"Compare"]})]})}function RTn({experiments:e,allExperiments:t,isLoading:r,datasetId:n,filters:s,onFiltersChange:a}){const[i,l]=b.useState([]),[c,u]=b.useState(!1),{navigate:d}=or(),f=b.useMemo(()=>{const y=t??e;return[...new Set(y.map(x=>x.targetId))]},[t,e]),h=y=>{l(x=>x.includes(y)?x.filter(w=>w!==y):x.length>=2?[x[0],y]:[...x,y])},p=()=>{if(i.length===2){const[y,x]=i;d(`/datasets/${n}/experiments?baseline=${y}&contender=${x}`)}},m=()=>{l([]),u(!1)},g=y=>{d(`/datasets/${n}/experiments/${y}`)};return r?o.jsx("div",{children:"Loading..."}):o.jsx(tf,{children:o.jsxs(gr,{children:[o.jsx(ITn,{hasExperiments:e.length>0||Object.values(s).some(Boolean),onCompareClick:()=>u(!0),isSelectionActive:c,selectedCount:i.length,onExecuteCompare:p,onCancelSelection:m,filters:s,onFiltersChange:a,targetIds:f}),o.jsx(jTn,{experiments:e,isSelectionActive:c,selectedExperimentIds:i,onRowClick:g,onToggleSelection:h})]})})}function n8({item:e}){const t=e?.input?JSON.stringify(e.input,null,2):"null",r=e?.groundTruth?JSON.stringify(e.groundTruth,null,2):"null",n=e?.metadata?JSON.stringify(e.metadata,null,2):"null",s=e?.expectedTrajectory?JSON.stringify(e.expectedTrajectory,null,2):null;return o.jsxs(kx,{children:[o.jsx(Vt.CodeSection,{title:"Input",icon:o.jsx(cx,{}),codeStr:t}),o.jsx(Vt.CodeSection,{title:"Ground Truth",icon:o.jsx(Qd,{}),codeStr:r}),s&&o.jsx(Vt.CodeSection,{title:"Expected Trajectory",icon:o.jsx(nLt,{}),codeStr:s}),o.jsx(Vt.CodeSection,{title:"Metadata",icon:o.jsx(NE,{}),codeStr:n})]})}function I8e({field:e,errors:t}){return t.length?o.jsx("div",{className:"mt-2 space-y-1",children:t.map((r,n)=>o.jsxs("p",{className:"text-xs text-destructive",children:[o.jsxs("code",{className:"bg-destructive/10 px-1 rounded",children:[e,r.path!=="/"?r.path:""]}),": ",r.message]},n))}):null}function $1t({inputValue:e,setInputValue:t,groundTruthValue:r,setGroundTruthValue:n,metadataValue:s,setMetadataValue:a,trajectoryValue:i,setTrajectoryValue:l,validationErrors:c,onSave:u,onCancel:d,isSaving:f}){return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"mb-4",children:o.jsxs("h3",{className:"text-lg font-medium flex items-center gap-2",children:[o.jsx(iv,{className:"w-5 h-5"})," Edit Item"]})}),o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(xt,{children:"Input (JSON) *"}),o.jsx(Xn,{value:e,onChange:t,showCopyButton:!1,className:"min-h-[120px]"}),c?.field==="input"&&o.jsx(I8e,{field:"input",errors:c.errors})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(xt,{children:"Ground Truth (JSON, optional)"}),o.jsx(Xn,{value:r,onChange:n,showCopyButton:!1,className:"min-h-[100px]"}),c?.field==="groundTruth"&&o.jsx(I8e,{field:"groundTruth",errors:c.errors})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(xt,{children:"Expected Trajectory (JSON, optional)"}),o.jsx(Xn,{value:i,onChange:l,showCopyButton:!1,className:"min-h-[80px]"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(xt,{children:"Metadata (JSON, optional)"}),o.jsx(Xn,{value:s,onChange:a,showCopyButton:!1,className:"min-h-[80px]"})]}),o.jsxs("div",{className:"flex gap-2 pt-4",children:[o.jsx(ce,{variant:"primary",onClick:u,disabled:f,children:f?"Saving...":"Save Changes"}),o.jsx(ce,{onClick:d,disabled:f,children:"Cancel"})]})]})]})}function F1t({item:e}){return o.jsx(Ir,{withMargins:!1,children:o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(lx,{}),o.jsx("span",{className:"truncate",children:e.id}),o.jsx(ta,{content:e.id,tooltip:`Copy item ID: ${e.id}`})]}),o.jsxs(Ir.Description,{children:[o.jsxs(Zn,{children:[o.jsx(h_,{})," Created ",tr(new Date(e.createdAt),"MMM d, yyyy h:mm aaa")]}),e.datasetVersion!=null&&o.jsxs(Zn,{children:[o.jsx(Vx,{})," Version v",e.datasetVersion]})]})]})})}function PTn({datasetId:e,itemId:t,onPrevious:r,onNext:n,onEdit:s,onDelete:a,onClose:i,isEditing:l=!1}){const{Link:c}=or();return o.jsxs(gr.Toolbar,{children:[o.jsx(xC,{onPrevious:r,onNext:n,previousAriaLabel:"Previous item",nextAriaLabel:"Next item"}),o.jsxs(ps,{children:[!l&&o.jsxs(o.Fragment,{children:[o.jsxs(ce,{href:`/datasets/${e}/items/${t}`,as:c,children:[o.jsx(Vx,{}),"Versions"]}),o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsx(ce,{"aria-label":"Actions menu",children:o.jsx(yVe,{})})}),o.jsxs(yt.Content,{align:"end",className:"w-48",children:[o.jsxs(yt.Item,{onSelect:s,children:[o.jsx(iv,{}),"Edit"]}),o.jsxs(yt.Item,{onSelect:a,className:"text-red-500 focus:text-red-400",children:[o.jsx(ed,{}),"Delete Item"]})]})]})]}),o.jsx(ce,{onClick:i,"aria-label":"Close detail panel",children:o.jsx(Nn,{})})]})]})}function MTn(e){if(!(e instanceof Error))return null;const t=e.message.match(/- ({.*})$/);if(!t)return null;try{const r=JSON.parse(t[1]);if(r.field&&Array.isArray(r.errors))return{field:r.field,errors:r.errors}}catch{}return null}function DTn({datasetId:e,item:t,items:r,onItemChange:n,onClose:s}){const{Link:a}=or(),{updateItem:i,deleteItem:l}=ni(),[c,u]=b.useState(!1),[d,f]=b.useState(""),[h,p]=b.useState(""),[m,g]=b.useState(""),[y,x]=b.useState(""),[w,S]=b.useState(null),[k,_]=b.useState(!1);b.useEffect(()=>{t&&(f(JSON.stringify(t.input,null,2)),p(t.groundTruth?JSON.stringify(t.groundTruth,null,2):""),g(t.metadata?JSON.stringify(t.metadata,null,2):""),x(t.expectedTrajectory?JSON.stringify(t.expectedTrajectory,null,2):""),u(!1),_(!1),S(null))},[t?.id]);const E=()=>{const $=r.findIndex(U=>U.id===t.id);if($>=0&&$<r.length-1)return()=>n(r[$+1].id)},T=()=>{const $=r.findIndex(U=>U.id===t.id);if($>0)return()=>n(r[$-1].id)},j=async()=>{let $;try{$=JSON.parse(d)}catch{ze.error("Input must be valid JSON");return}let U;if(h.trim())try{U=JSON.parse(h)}catch{ze.error("Ground Truth must be valid JSON");return}let z;if(m.trim())try{z=JSON.parse(m)}catch{ze.error("Metadata must be valid JSON");return}let H=null;if(y.trim())try{H=JSON.parse(y)}catch{ze.error("Expected Trajectory must be valid JSON");return}try{await i.mutateAsync({datasetId:e,itemId:t.id,input:$,groundTruth:U,metadata:z,expectedTrajectory:H}),ze.success("Item updated successfully"),u(!1),S(null)}catch(Q){const L=MTn(Q);L?S(L):ze.error(`Failed to update item: ${Q instanceof Error?Q.message:"Unknown error"}`)}},N=()=>{f(JSON.stringify(t.input,null,2)),p(t.groundTruth?JSON.stringify(t.groundTruth,null,2):""),g(t.metadata?JSON.stringify(t.metadata,null,2):""),x(t.expectedTrajectory?JSON.stringify(t.expectedTrajectory,null,2):""),u(!1),S(null)},I=$=>{f($),w?.field==="input"&&S(null)},P=$=>{p($),w?.field==="groundTruth"&&S(null)},R=()=>{u(!0)},B=()=>{_(!0)},D=async()=>{try{await l.mutateAsync({datasetId:e,itemId:t.id}),ze.success("Item deleted successfully"),_(!1),s()}catch($){ze.error(`Failed to delete item: ${$ instanceof Error?$.message:"Unknown error"}`)}};return o.jsxs(o.Fragment,{children:[o.jsxs(gr,{withLeftSeparator:!0,children:[o.jsx(PTn,{datasetId:e,itemId:t.id,onPrevious:T(),onNext:E(),onEdit:R,onDelete:B,onClose:s,isEditing:c}),o.jsx(gr.Content,{children:c?o.jsx($1t,{inputValue:d,setInputValue:I,groundTruthValue:h,setGroundTruthValue:P,metadataValue:m,setMetadataValue:g,trajectoryValue:y,setTrajectoryValue:x,validationErrors:w,onSave:j,onCancel:N,isSaving:i.isPending}):o.jsxs(o.Fragment,{children:[o.jsx(F1t,{item:t}),o.jsx(n8,{item:t,Link:a})]})})]}),o.jsx($t,{open:k,onOpenChange:_,children:o.jsxs($t.Content,{children:[o.jsxs($t.Header,{children:[o.jsx($t.Title,{children:"Delete Item"}),o.jsx($t.Description,{children:"Are you sure you want to delete this item? This action cannot be undone."})]}),o.jsxs($t.Footer,{children:[o.jsx($t.Cancel,{children:"Cancel"}),o.jsx($t.Action,{onClick:D,children:l.isPending?"Deleting...":"Yes, Delete"})]})]})})]})}function R8e(e,t=100){if(e==null)return"-";const r=typeof e=="string"?e:JSON.stringify(e);return!r||r.length<=t?r||"-":r.slice(0,t)+"..."}function LTn(e){const t=xg(e)?"Today":tr(e,"MMM dd"),r=gfe(e)?"":tr(e,"yyyy"),n=tr(e,"'at' h:mm aaa");return`${t} ${r} ${n}`.replace(/\s+/g," ").trim()}function $Tn({items:e,isLoading:t,onItemClick:r,featuredItemId:n,setEndOfListElement:s,isFetchingNextPage:a,hasNextPage:i,columns:l=[],searchQuery:c,isSelectionActive:u,selectedIds:d,onToggleSelection:f,onSelectAll:h,onClearSelection:p,maxSelection:m,onAddClick:g,onImportClick:y,onImportJsonClick:x}){if(e.length===0&&!c&&!t)return o.jsx(FTn,{onAddClick:g,onImportClick:y,onImportJsonClick:x});const w=e.map(N=>N.id),S=d.size,k=e.length>0&&S===e.length,_=S>0&&S<e.length,E=()=>{k?p():h(w)},T=(N,I,P)=>{if(m&&!d.has(N)&&d.size>=m){const[R]=Array.from(d);h([R,N]);return}f(N,I,P)},j=[u?"2rem":"",...l.map(N=>N.size)].filter(Boolean).join(" ");return o.jsxs(o.Fragment,{children:[o.jsxs(Se,{columns:j,children:[o.jsxs(Se.Top,{children:[u&&!m&&o.jsx(Se.TopCell,{children:o.jsx(fi,{checked:_?"indeterminate":k,onCheckedChange:E,"aria-label":"Select all items"})}),u&&m&&o.jsx(Se.TopCell,{children:" "}),l.map(N=>o.jsx(Se.TopCell,{children:N.label||N.name},N.name))]}),e.length===0&&c?o.jsx(Se.NoMatch,{message:"No items match your search"}):o.jsxs(Se.Rows,{children:[e.map(N=>{const I=new Date(N.createdAt),P=n===N.id;return o.jsxs(Se.Row,{onClick:()=>r?.(N.id),selected:P||d.has(N.id),children:[u&&o.jsx(Se.Cell,{children:o.jsx(fi,{checked:d.has(N.id),onCheckedChange:()=>{},onClick:R=>{R.stopPropagation(),T(N.id,R.shiftKey,w)},"aria-label":`Select item ${N.id}`})}),o.jsx(Se.TextCell,{children:o.jsx("span",{className:"truncate block font-mono",children:N.id})}),o.jsx(Se.TextCell,{children:o.jsx("span",{className:"truncate block font-mono",children:R8e(N.input,60)})}),l.some(R=>R.name==="groundTruth")&&o.jsx(Se.TextCell,{children:o.jsx("span",{className:"truncate block font-mono",children:N.groundTruth?R8e(N.groundTruth,40):"-"})}),l.some(R=>R.name==="trajectory")&&o.jsx(Se.TextCell,{children:N.expectedTrajectory?o.jsx("span",{className:"text-xs",children:Array.isArray(N.expectedTrajectory?.steps)?`${N.expectedTrajectory.steps.length} steps`:"Yes"}):o.jsx("span",{className:"text-neutral4",children:"—"})}),o.jsx(Se.TextCell,{children:o.jsx("span",{className:"truncate block text-neutral2",children:LTn(I)})})]},N.id)}),o.jsx("div",{ref:s,className:"h-1 col-span-full",children:a&&o.jsx("div",{className:"flex justify-center py-4",children:o.jsx(Dt,{})})})]})]}),!i&&e.length>0&&o.jsx(me,{variant:"ui-xs",className:"text-icon3 text-center",children:"All items loaded"})]})}function FTn({onAddClick:e,onImportClick:t,onImportJsonClick:r}){return o.jsx("div",{className:"flex h-full items-center justify-center py-12",children:o.jsx(Ja,{iconSlot:o.jsx(us,{className:"w-8 h-8 text-neutral3"}),titleSlot:"No items yet",descriptionSlot:"Add items to this dataset to use them in experiment runs.",actionSlot:o.jsxs(ps,{children:[o.jsxs(ce,{onClick:e,size:"md",children:[o.jsx(us,{}),"Add Single Item"]}),t&&o.jsxs(ce,{onClick:t,size:"md",children:[o.jsx(fF,{}),"Import CSV"]}),r&&o.jsxs(ce,{onClick:r,size:"md",children:[o.jsx(_R,{}),"Import JSON"]})]})})})}function zTn({onExportClick:e,onExportJsonClick:t,onCreateDatasetClick:r,onAddToDatasetClick:n,onDeleteClick:s,onCompareClick:a}){return o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsxs(ce,{"aria-label":"Actions menu",children:["Select ",o.jsx(MPt,{})]})}),o.jsxs(yt.Content,{align:"end",className:"w-72",children:[o.jsxs(yt.Item,{onSelect:a,children:[o.jsx(zm,{}),o.jsx("span",{children:"Compare Items"})]}),o.jsx(yt.Separator,{}),o.jsxs(yt.Item,{onSelect:e,children:[o.jsx(Tk,{}),o.jsx("span",{children:"Export Items as CSV"})]}),o.jsxs(yt.Item,{onSelect:t,children:[o.jsx(Tk,{}),o.jsx("span",{children:"Export Items as JSON"})]}),o.jsx(yt.Separator,{}),o.jsxs(yt.Item,{onSelect:r,children:[o.jsx(lF,{}),o.jsx("span",{children:"Create Dataset from Items"})]}),o.jsxs(yt.Item,{onSelect:n,children:[o.jsx(T2t,{}),o.jsx("span",{children:"Copy Items to Dataset"})]}),o.jsx(yt.Separator,{}),o.jsxs(yt.Item,{onSelect:s,className:"text-red-500 focus:text-red-400",children:[o.jsx(ed,{}),o.jsx("span",{children:"Delete Items"})]})]})]})}function BTn({onAddClick:e,onImportClick:t,onImportJsonClick:r,onExportClick:n,onExportJsonClick:s,onCreateDatasetClick:a,onAddToDatasetClick:i,onDeleteClick:l,onCompareClick:c,hasItems:u,searchQuery:d,isSelectionActive:f,onSearchChange:h,selectedCount:p,onExecuteAction:m,onCancelSelection:g,selectionMode:y,onVersionsClick:x,isItemPanelOpen:w,isVersionsPanelOpen:S,isViewingOldVersion:k}){return f?o.jsxs(gr.Toolbar,{className:"",children:[o.jsx(Ox,{name:"search-items",label:"Search",labelIsHidden:!0,placeholder:"Search items...",value:d??"",onChange:_=>h?.(_.target.value),onReset:()=>h?.(""),disabled:!u&&!d}),o.jsxs("div",{className:"flex gap-5",children:[o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsxs("div",{className:"text-sm text-neutral3 flex items-center gap-2",children:[o.jsx(za,{size:"large",color:y==="compare-items"&&p<2||p===0?"red":"green",children:p}),o.jsx("span",{children:y==="compare-items"?"of 2 items selected":"items selected"}),o.jsx(oce,{})]})}),(y==="compare-items"&&p<2||p===0)&&o.jsx(Wr,{children:y==="compare-items"?p<=2?"Select 2 items to compare":void 0:p===0?"Select at least one item":void 0})]}),o.jsxs(ps,{children:[o.jsxs(ce,{variant:"primary",disabled:y==="compare-items"?p!==2:p===0,onClick:m,children:[y==="compare-items"&&"Compare Items",y==="export"&&"Export Items as CSV",y==="export-json"&&"Export Items as JSON",y==="create-dataset"&&"Create a new Dataset with Items",y==="add-to-dataset"&&"Add Items to a Dataset",y==="delete"&&"Delete Items"]}),o.jsx(ce,{onClick:g,children:"Cancel"})]})]})]}):o.jsxs("div",{className:"flex items-center justify-between gap-4 w-full",children:[o.jsx(Ox,{name:"search-items",label:"Search",labelIsHidden:!0,placeholder:"Search items...",value:d??"",onChange:_=>h?.(_.target.value),onReset:()=>h?.(""),disabled:!u&&!d}),o.jsxs(ps,{children:[!w&&!k&&o.jsxs(ps,{spacing:"close",children:[o.jsxs(ce,{onClick:e,children:[o.jsx(us,{})," Add Item"]}),o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsx(ce,{"aria-label":"Dataset actions menu",children:o.jsx(as,{})})}),o.jsxs(yt.Content,{align:"end",children:[o.jsxs(yt.Item,{onSelect:t,children:[o.jsx(fF,{})," Import CSV"]}),o.jsxs(yt.Item,{onSelect:r,children:[o.jsx(_R,{})," Import JSON"]})]})]})]}),u&&!k&&o.jsx(zTn,{onExportClick:n,onExportJsonClick:s,onCreateDatasetClick:a,onAddToDatasetClick:i,onDeleteClick:l,onCompareClick:c}),!w&&!S&&o.jsxs(ce,{onClick:x,"aria-label":"View versions",children:[o.jsx(Vx,{className:"w-4 h-4"}),"Versions"]})]})]})}function UTn({datasetId:e,onClose:t,onVersionSelect:r,onCompareVersionsClick:n,activeVersion:s}){const{data:a,isLoading:i,fetchNextPage:l,hasNextPage:c,isFetchingNextPage:u}=Nve(e),[d,f]=b.useState(!1),[h,p]=b.useState(new Set),m=k=>{r?.(k)},g=k=>s==null?k.isCurrent:k.version===s,y=k=>{p(_=>{const E=new Set(_);if(E.has(k))E.delete(k);else if(E.size>=2){const[T]=Array.from(E);return new Set([T,k])}else E.add(k);return E})},x=()=>{f(!1),p(new Set)},w=()=>{f(!0)},S=()=>{h.size===2&&n?.(Array.from(h))};return o.jsxs(gr,{withLeftSeparator:!0,className:"w-56",children:[d?o.jsx(gr.Toolbar,{className:"grid justify-stretch gap-3 w-full",children:o.jsxs(ps,{children:[o.jsx(ce,{onClick:x,children:"Cancel"}),o.jsxs(Ln,{variant:"primary",disabled:h.size!==2,onClick:S,tooltipContent:h.size!==2?"Select two versions to enable comparison":void 0,className:"w-full",children:[o.jsx(Dw,{})," Compare"]})]})}):o.jsxs(gr.Toolbar,{children:[o.jsxs(ce,{onClick:w,children:[o.jsx(zm,{})," Compare Ver."]}),o.jsx(Ln,{onClick:t,tooltipContent:"Hide Versions Panel",children:o.jsx(Nn,{})})]}),o.jsx(gr.Content,{children:i?o.jsx(VTn,{}):o.jsxs(Pt,{children:[o.jsx(Pt.Header,{children:o.jsx(Pt.HeaderCol,{children:"Dataset Version History"})}),o.jsxs(Pt.Scroller,{children:[o.jsx(Pt.Items,{children:a?.map(k=>{const _=String(k.version),E=k.createdAt?typeof k.createdAt=="string"?new Date(k.createdAt):k.createdAt:null;return o.jsxs(Pt.Row,{isSelected:d&&h.has(_),children:[d&&o.jsx(Pt.LabelCell,{children:o.jsx(fi,{checked:h.has(_),onCheckedChange:()=>{},onClick:T=>{T.stopPropagation(),y(_)},"aria-label":`Select version ${E?`v${k.version} — ${tr(E,"MMM d, yyyy HH:mm")}`:`v${k.version}`}`})}),o.jsx(Pt.RowButton,{item:k,isFeatured:g(k),columns:[{name:"version",label:"Dataset Version History",size:"1fr"}],onClick:()=>m(k),className:"py-2",children:o.jsx(Pt.VersionCell,{version:k.version,date:E,isLatest:k.isCurrent})})]},String(k.version))})}),c&&o.jsx(ce,{size:"md",onClick:()=>l(),disabled:u,className:"w-full mt-2",children:u?"Loading...":"Load More"})]})]})})]})}function VTn(){return o.jsxs(Pt,{children:[o.jsx(Pt.Header,{children:o.jsx(Pt.HeaderCol,{children:"Dataset Version History"})}),o.jsx(Pt.Items,{children:Array.from({length:3}).map((e,t)=>o.jsx(Pt.Row,{children:o.jsx(Pt.RowButton,{columns:[{name:"version",label:"Dataset Version History",size:"1fr"}],children:o.jsx(Pt.TextCell,{isLoading:!0,children:"Loading..."})})},t))})]})}function qTn({datasetId:e,items:t,isLoading:r,featuredItemId:n,onItemSelect:s,onItemClose:a,onAddClick:i,onImportClick:l,onImportJsonClick:c,onBulkDeleteClick:u,onCreateDatasetClick:d,onAddToDatasetClick:f,onCompareItemsClick:h,datasetName:p,clearSelectionTrigger:m,setEndOfListElement:g,isFetchingNextPage:y,hasNextPage:x,searchQuery:w,onSearchChange:S,activeDatasetVersion:k,currentDatasetVersion:_,onVersionSelect:E,onCompareVersionsClick:T}){const[j,N]=b.useState(!1),[I,P]=b.useState("idle"),R=eTn(),B=t.find(V=>V.id===n)??null;b.useEffect(()=>{m!==void 0&&m>0&&(R.clearSelection(),P("idle"))},[m]);const D=k!=null&&_!=null&&k!==_,$=V=>{V===n?a():s(V)},U=()=>{N(!0)},z=()=>{N(!1)},H=()=>{P("idle"),R.clearSelection()},Q=()=>{if(R.selectedCount===0)return;const V=t.filter(M=>R.selectedIds.has(M.id));if(I==="export"){try{tTn(V,`${p||"dataset"}-items.csv`),ze.success(`Exported ${R.selectedCount} items to CSV`)}catch(M){ze.error("Failed to export items to CSV"),console.error("CSV export error:",M)}H()}else if(I==="export-json"){try{rTn(V,`${p||"dataset"}-items.json`),ze.success(`Exported ${R.selectedCount} items to JSON`)}catch(M){ze.error("Failed to export items to JSON"),console.error("JSON export error:",M)}H()}else I==="create-dataset"?d?.(V):I==="add-to-dataset"?f?.(V):I==="delete"?u?.(Array.from(R.selectedIds)):I==="compare-items"&&h?.(Array.from(R.selectedIds))},L=I!=="idle",Z=[{name:"id",label:"ID",size:"5rem"},{name:"input",label:"Input",size:"1fr"},...B?[]:[{name:"groundTruth",label:"Ground Truth",size:"1fr"}],...B?[]:[{name:"trajectory",label:"Trajectory",size:"6rem"}],{name:"date",label:"Created",size:"10rem"}];return o.jsxs(tf,{className:Y({"grid-cols-[1fr_1fr]":!!B,"grid-cols-[1fr_auto]":j&&!B}),children:[o.jsxs(gr,{children:[o.jsx(BTn,{onAddClick:i,onImportClick:l??(()=>{}),onImportJsonClick:c??(()=>{}),onExportClick:()=>P("export"),onExportJsonClick:()=>P("export-json"),onCreateDatasetClick:()=>P("create-dataset"),onAddToDatasetClick:()=>P("add-to-dataset"),onDeleteClick:()=>P("delete"),onCompareClick:()=>P("compare-items"),hasItems:t.length>0,searchQuery:w,onSearchChange:S,isSelectionActive:L,selectedCount:R.selectedCount,onExecuteAction:Q,onCancelSelection:H,selectionMode:I,onVersionsClick:U,isItemPanelOpen:!!B,isVersionsPanelOpen:j,isViewingOldVersion:D}),D&&k!=null&&o.jsx(cn,{variant:"warning",title:"Previous version",action:o.jsxs(cn.Button,{onClick:()=>E?.({version:_,isCurrent:!0}),children:[o.jsx(fw,{})," Return to the latest version"]}),children:o.jsxs(cn.Message,{children:["Viewing version v",k]})}),o.jsx($Tn,{items:t,isLoading:r,onItemClick:$,featuredItemId:n,columns:Z,setEndOfListElement:g,isFetchingNextPage:y,hasNextPage:x,isSelectionActive:L,selectedIds:R.selectedIds,onToggleSelection:R.toggle,onSelectAll:R.selectAll,onClearSelection:R.clearSelection,maxSelection:I==="compare-items"?2:void 0,onAddClick:i,onImportClick:l,onImportJsonClick:c,searchQuery:w})]}),!!B&&o.jsx(DTn,{datasetId:e,item:B,items:t,onItemChange:s,onClose:a}),!B&&j&&o.jsx(UTn,{datasetId:e,onClose:z,onVersionSelect:E,onCompareVersionsClick:T,activeVersion:k})]})}function P8e(e,t=50){if(e==null)return"-";const r=typeof e=="string"?e:JSON.stringify(e);return r.length<=t?r:r.slice(0,t)+"..."}function HTn({items:e,maxRows:t=5}){const r=e.slice(0,t),n=e.length-t;return o.jsxs("div",{className:"border border-border1 rounded-md overflow-hidden",children:[o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"bg-surface2 border-b border-border1",children:[o.jsx("th",{className:"px-3 py-2 text-left font-medium text-neutral3 w-8",children:"#"}),o.jsx("th",{className:"px-3 py-2 text-left font-medium text-neutral3",children:"Input"}),o.jsx("th",{className:"px-3 py-2 text-left font-medium text-neutral3",children:"Ground Truth"}),o.jsx("th",{className:"px-3 py-2 text-left font-medium text-neutral3 w-24",children:"Metadata"})]})}),o.jsx("tbody",{children:r.map((s,a)=>o.jsxs("tr",{className:"border-b border-border1 last:border-b-0",children:[o.jsx("td",{className:"px-3 py-2 text-neutral4",children:a+1}),o.jsx("td",{className:"px-3 py-2 text-neutral1 font-mono text-xs",children:P8e(s.input)}),o.jsx("td",{className:"px-3 py-2 text-neutral2 font-mono text-xs",children:P8e(s.groundTruth)}),o.jsx("td",{className:"px-3 py-2 text-neutral3 text-xs",children:s.metadata?`${Object.keys(s.metadata).length} keys`:"-"})]},a))})]}),n>0&&o.jsxs("div",{className:"bg-surface2 px-3 py-2 text-xs text-neutral4 text-center border-t border-border1",children:["+",n," more item",n!==1?"s":""]})]})}function QTn({onFileSelect:e,isParsing:t,error:r}){const n=b.useRef(null),[s,a]=b.useState(!1),i=b.useCallback(()=>{t||n.current?.click()},[t]),l=b.useCallback(f=>{const h=f.target.files?.[0];h&&e(h),f.target.value=""},[e]),c=b.useCallback(f=>{f.preventDefault(),f.stopPropagation(),a(!0)},[]),u=b.useCallback(f=>{f.preventDefault(),f.stopPropagation(),a(!1)},[]),d=b.useCallback(f=>{if(f.preventDefault(),f.stopPropagation(),a(!1),t)return;const h=f.dataTransfer.files?.[0];h&&h.name.endsWith(".json")&&e(h)},[t,e]);return o.jsxs("div",{className:"flex flex-col gap-3",children:[o.jsx("input",{ref:n,type:"file",accept:".json",onChange:l,className:"hidden",disabled:t}),o.jsx("div",{onClick:i,onDragOver:c,onDragLeave:u,onDrop:d,className:Y("flex flex-col items-center justify-center gap-3","min-h-[160px] rounded-lg border-2 border-dashed p-6","cursor-pointer transition-colors","border-surface4 bg-surface2",s&&"border-accent1/50 bg-accent1/5",r&&"border-accent2/50 bg-accent2/5",t&&"cursor-wait opacity-60"),children:t?o.jsxs(o.Fragment,{children:[o.jsx(Dt,{size:"lg"}),o.jsx("span",{className:"text-sm text-neutral4",children:"Parsing JSON..."})]}):o.jsxs(o.Fragment,{children:[o.jsx(Ce,{className:"text-neutral4",children:o.jsx(_R,{className:"h-8 w-8"})}),o.jsxs("div",{className:"flex flex-col items-center gap-1",children:[o.jsx("span",{className:"text-sm font-medium text-neutral1",children:"Click to upload or drag and drop"}),o.jsx("span",{className:"text-xs text-neutral4",children:"JSON files only"})]})]})}),r&&o.jsx("div",{className:"text-sm text-accent2",children:r}),o.jsxs("div",{className:"text-xs text-neutral4 bg-surface2 p-3 rounded-md",children:[o.jsx("p",{className:"font-medium mb-1",children:"Expected format:"}),o.jsx("pre",{className:"text-[10px] overflow-x-auto",children:`[
|
|
545
545
|
{
|
|
546
546
|
"input": "Your input data",
|
|
547
547
|
"groundTruth": "Expected result (optional)",
|
|
548
548
|
"metadata": { "key": "value" } // optional
|
|
549
549
|
}
|
|
550
|
-
]`})]})]})}function WTn({errors:e,maxErrors:t=5}){if(e.length===0)return null;const r=e.slice(0,t),n=e.length-t;return o.jsxs("div",{className:"bg-accent2/10 border border-accent2/30 rounded-md p-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-accent2 mb-2",children:[o.jsx(Ce,{children:o.jsx(AE,{className:"w-4 h-4"})}),o.jsxs("span",{className:"font-medium text-sm",children:[e.length," validation error",e.length!==1?"s":""]})]}),o.jsx("ul",{className:"text-sm text-accent2/80 space-y-1",children:r.map((s,a)=>o.jsxs("li",{className:"flex gap-2",children:[o.jsx("span",{className:"shrink-0",children:"•"}),o.jsx("span",{children:s.message})]},a))}),n>0&&o.jsxs("div",{className:"text-xs text-accent2/60 mt-2",children:["+",n," more error",n!==1?"s":""]})]})}function GTn({datasetId:e,open:t,onOpenChange:r,onSuccess:n}){const[s,a]=b.useState("upload"),[i,l]=b.useState(null),[c,u]=b.useState({current:0,total:0}),[d,f]=b.useState(null),[h,p]=b.useState(!1),{parseFile:m,isParsing:g,error:y}=Jjn(),{batchInsertItems:x}=ni(),w=b.useCallback(async I=>{try{const P=await m(I);l(P),a("preview")}catch{}},[m]),S=b.useCallback(async()=>{if(!i||i.items.length===0)return;a("importing"),p(!0);const{items:I}=i;u({current:0,total:I.length});try{await x.mutateAsync({datasetId:e,items:I.map(P=>({input:P.input,groundTruth:P.groundTruth,metadata:P.metadata}))}),f({success:I.length,errors:0})}catch{f({success:0,errors:I.length})}u({current:I.length,total:I.length}),p(!1),a("complete")},[i,x,e]),k=b.useCallback(()=>{r(!1),n?.(),d&&d.success>0&&ze.success(`Imported ${d.success} item${d.success!==1?"s":""}`),setTimeout(()=>{a("upload"),l(null),u({current:0,total:0}),f(null)},150)},[r,n,d]),_=b.useCallback(()=>{h||(r(!1),setTimeout(()=>{a("upload"),l(null),u({current:0,total:0}),f(null)},150))},[h,r]),E=i&&i.items.length>0&&i.errors.length===0,T=()=>{switch(s){case"upload":return o.jsx(QTn,{onFileSelect:w,isParsing:g,error:y?.message});case"preview":return i?o.jsx("div",{className:"flex flex-col gap-4",children:i.errors.length>0?o.jsxs(o.Fragment,{children:[o.jsx(WTn,{errors:i.errors}),o.jsx("div",{className:"text-sm text-neutral4",children:"Please fix the errors in your JSON file and try again."})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"text-sm text-neutral4",children:["Found ",i.items.length," valid item",i.items.length!==1?"s":""," to import."]}),o.jsx(HTn,{items:i.items,maxRows:5})]})}):null;case"importing":return o.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[o.jsx(Dt,{size:"lg"}),o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"text-lg font-medium text-neutral1",children:"Importing items..."}),o.jsxs("div",{className:"text-sm text-neutral4 mt-1",children:[c.current," of ",c.total]})]})]});case"complete":return o.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[o.jsx("div",{className:"text-4xl",children:d&&d.errors===0?"✓":"⚠"}),o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"text-lg font-medium text-neutral1",children:"Import Complete"}),o.jsxs("div",{className:"text-sm text-neutral4 mt-1",children:[d?.success??0," item",d?.success!==1?"s":""," imported",d&&d.errors>0&&o.jsxs("span",{className:"text-accent2",children:[" ","(",d.errors," error",d.errors!==1?"s":"",")"]})]})]})]})}},j=()=>{switch(s){case"upload":return o.jsx(ce,{onClick:_,children:"Cancel"});case"preview":return o.jsxs(o.Fragment,{children:[o.jsx(ce,{onClick:()=>a("upload"),children:"Back"}),o.jsxs(ce,{variant:"primary",onClick:S,disabled:!E,children:["Import ",i?.items.length??0," Item",i?.items.length!==1?"s":""]})]});case"importing":return null;case"complete":return o.jsx(ce,{variant:"primary",onClick:k,children:"Done"})}},N={upload:"Import JSON",preview:"Preview Data",importing:"Importing",complete:"Import Complete"};return o.jsx(On,{open:t,onOpenChange:_,children:o.jsxs(vn,{className:"max-w-2xl max-h-[90vh]",children:[o.jsxs(kn,{children:[o.jsx(bn,{children:N[s]}),o.jsx(qs,{children:"Import dataset items from a JSON file."})]}),o.jsx(Bn,{className:"min-h-[200px] max-h-[50vh] overflow-y-auto",children:T()}),o.jsx(uf,{className:"px-6 pt-4 flex justify-end gap-2",children:j()})]})})}function ZTn({dataset:e,isLoading:t=!1,onEditClick:r,onDuplicateClick:n,onDeleteClick:s,experimentTriggerSlot:a,disableExperimentTrigger:i=!1,onExperimentClick:l,className:c}){return o.jsxs(Ir,{className:c,children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{isLoading:t,children:[o.jsx(Na,{})," ",e?.name]}),o.jsx(Ir.Description,{isLoading:t,children:e?.description}),o.jsxs(Ir.Description,{isLoading:t,children:[o.jsxs(Zn,{children:[o.jsx(h_,{})," Created at ",e?.createdAt?tr(new Date(e.createdAt),"MMM d, yyyy"):""]}),o.jsxs(Zn,{children:[o.jsx(Vx,{})," Latest version v",e?.version??""]})]})]}),o.jsx(Ir.Column,{children:o.jsxs(ps,{children:[a?i?o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx("span",{className:"cursor-not-allowed",children:o.jsx("div",{className:"pointer-events-none opacity-50",inert:!0,"aria-disabled":"true",children:a})})}),o.jsx(Wr,{children:"Add items to the dataset before running an experiment"})]}):a:l?i?o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx("span",{className:"cursor-not-allowed",children:o.jsxs(ce,{disabled:!0,tabIndex:-1,children:[o.jsx(ux,{}),"Run Experiment"]})})}),o.jsx(Wr,{children:"Add items to the dataset before running an experiment"})]}):o.jsxs(ce,{onClick:l,children:[o.jsx(ux,{}),"Run Experiment"]}):null,o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsx(ce,{size:"default","aria-label":"Dataset actions menu",children:o.jsx(yVe,{})})}),o.jsxs(yt.Content,{align:"end",className:"w-48",children:[o.jsxs(yt.Item,{onSelect:r,children:[o.jsx(iv,{})," Edit Dataset"]}),o.jsxs(yt.Item,{onSelect:n,children:[o.jsx(tu,{})," Duplicate Dataset"]}),o.jsxs(yt.Item,{onSelect:s,className:"text-red-500 focus:text-red-400",children:[o.jsx(ed,{})," Delete Dataset"]})]})]})]})})]})}const z1t=e=>{const t=Ge(),{data:r}=xR(e),n=r?.experiments;return kt({queryKey:["dataset-review-items",e,n?.map(s=>s.id)],queryFn:async()=>!n||n.length===0?[]:(await Promise.all(n.map(async a=>{if(!a.datasetId)return[];try{const{results:i}=await t.listDatasetExperimentResults(a.datasetId,a.id);return i.filter(l=>l.status==="needs-review").map(l=>({id:l.id,input:l.input,output:l.output,error:l.error,itemId:l.itemId,experimentId:l.experimentId,datasetId:a.datasetId??void 0,traceId:l.traceId??void 0,scores:l.scores?Object.fromEntries(l.scores.map(c=>[c.scorerId,c.score??0])):{},tags:l.tags??[],comment:""}))}catch{return[]}}))).flat(),enabled:!!e&&!!n&&n.length>0,refetchOnWindowFocus:!1})},YTn=e=>{const t=Ge(),{data:r}=xR(e),n=r?.experiments;return kt({queryKey:["dataset-completed-items",e,n?.map(s=>s.id)],queryFn:async()=>!n||n.length===0?[]:(await Promise.all(n.map(async a=>{if(!a.datasetId)return[];try{const{results:i}=await t.listDatasetExperimentResults(a.datasetId,a.id);return i.filter(l=>l.status==="complete").map(l=>({id:l.id,input:l.input,output:l.output,error:l.error,itemId:l.itemId,experimentId:l.experimentId,datasetId:a.datasetId??void 0,traceId:l.traceId??void 0,scores:l.scores?Object.fromEntries(l.scores.map(c=>[c.scorerId,c.score??0])):{},tags:l.tags??[],comment:""}))}catch{return[]}}))).flat(),enabled:!!e&&!!n&&n.length>0,refetchOnWindowFocus:!1})};function XTn(e,t){if(typeof e=="string")return e.length>t?e.slice(0,t)+"...":e;try{const r=JSON.stringify(e);return r.length>t?r.slice(0,t)+"...":r}catch{return String(e)}}const KTn=Y("bg-surface5 backdrop-blur-xl z-50 min-w-32 overflow-auto rounded-lg p-2 shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95");function M8e({className:e,children:t,...r}){return o.jsx(aP,{children:o.jsx(fz,{className:Y(KTn,e),...r,children:t})})}function JTn({datasetId:e}){const t=Ge(),{data:r}=Tg(e),{data:n,isLoading:s}=z1t(e),{data:a,isLoading:i}=YTn(e),{updateExperimentResult:l}=ni(),[c,u]=b.useState(null),[d,f]=b.useState(null),[h,p]=b.useState(new Set),[m,g]=b.useState(!1),[y,x]=b.useState(!1),[w,S]=b.useState(!1),[k,_]=b.useState(""),[E,T]=b.useState(""),[j,N]=b.useState(""),[I,P]=b.useState([]),[R,B]=b.useState(!1),[D,$]=b.useState(null),U=D??n??[];b.useEffect(()=>{n&&D===null&&$(n)},[n]);const z=b.useMemo(()=>{const ge=new Set;if(r?.tags)for(const Ee of r.tags)ge.add(Ee);for(const Ee of U)for(const Fe of Ee.tags)ge.add(Fe);return[...ge].sort()},[r,U]),H=b.useCallback(ge=>{!r||!e||(r.tags??[]).includes(ge)},[r,e]),Q=b.useMemo(()=>d?d==="__untagged__"?U.filter(ge=>ge.tags.length===0):U.filter(ge=>ge.tags.includes(d)):U,[U,d]),L=b.useMemo(()=>{const ge=new Map;for(const Ee of U)for(const Fe of Ee.tags)ge.set(Fe,(ge.get(Fe)??0)+1);return[...ge.entries()].sort((Ee,Fe)=>Fe[1]-Ee[1])},[U]),Z=b.useMemo(()=>U.filter(ge=>ge.tags.length===0).length,[U]),V=b.useMemo(()=>{let ge=0;return d&&ge++,m&&ge++,ge},[d,m]),M=b.useCallback((ge,Ee)=>{$(ct=>(ct??[]).map(wt=>wt.id===ge?{...wt,tags:Ee}:wt));const Fe=U.find(ct=>ct.id===ge);Fe?.experimentId&&Fe?.datasetId&&l.mutate({datasetId:Fe.datasetId,experimentId:Fe.experimentId,resultId:Fe.id,tags:Ee})},[U,l]),W=b.useCallback((ge,Ee)=>{const Fe=U.find(ct=>ct.id===ge);Fe?.traceId&&Ee!==void 0&&t.createFeedback({feedback:{traceId:Fe.traceId,source:"studio",feedbackSource:"studio",feedbackType:"rating",value:Ee==="positive"?1:-1,experimentId:Fe.experimentId??void 0,sourceId:Fe.id}}).catch(()=>{}),$(ct=>(ct??[]).map(wt=>wt.id===ge?{...wt,rating:Ee}:wt))},[U,t]),G=b.useCallback((ge,Ee)=>{const Fe=U.find(ct=>ct.id===ge);Fe?.traceId&&t.createFeedback({feedback:{traceId:Fe.traceId,source:"studio",feedbackSource:"studio",feedbackType:"comment",value:Ee,comment:Ee,experimentId:Fe.experimentId??void 0,sourceId:Fe.id}}).catch(()=>{}),$(ct=>(ct??[]).map(wt=>wt.id===ge?{...wt,comment:Ee}:wt))},[U,t]),J=b.useCallback(ge=>{const Ee=U.find(Fe=>Fe.id===ge);$(Fe=>(Fe??[]).filter(ct=>ct.id!==ge)),p(Fe=>{const ct=new Set(Fe);return ct.delete(ge),ct}),c===ge&&u(null),Ee?.experimentId&&Ee?.datasetId&&l.mutate({datasetId:Ee.datasetId,experimentId:Ee.experimentId,resultId:Ee.id,status:null})},[U,l,c]),ae=b.useCallback(ge=>{const Ee=U.find(Fe=>Fe.id===ge);$(Fe=>(Fe??[]).filter(ct=>ct.id!==ge)),p(Fe=>{const ct=new Set(Fe);return ct.delete(ge),ct}),c===ge&&u(null),Ee?.experimentId&&Ee?.datasetId&&l.mutate({datasetId:Ee.datasetId,experimentId:Ee.experimentId,resultId:Ee.id,status:"complete"})},[U,l,c]),te=b.useMemo(()=>{const ge=m?a??[]:Q;return!m||!d?ge:d==="__untagged__"?ge.filter(Ee=>Ee.tags.length===0):ge.filter(Ee=>Ee.tags.includes(d))},[m,a,Q,d]),re=m?i:!1,ie=b.useMemo(()=>new Set(te.map(ge=>ge.id)),[te]),he=b.useMemo(()=>[...h].filter(ge=>ie.has(ge)).length,[h,ie]),X=te.length>0&&he===te.length,se=he>0&&!X,le=b.useCallback(ge=>{p(Ee=>{const Fe=new Set(Ee);return Fe.has(ge)?Fe.delete(ge):Fe.add(ge),Fe})},[]),xe=b.useCallback(()=>{p(X?new Set:new Set(te.map(ge=>ge.id)))},[X,te]),de=b.useCallback(ge=>{for(const Ee of h){const Fe=U.find(ct=>ct.id===Ee);Fe&&!Fe.tags.includes(ge)&&M(Ee,[...Fe.tags,ge])}},[U,h,M]),ue=b.useCallback(ge=>{for(const Ee of h){const Fe=U.find(ct=>ct.id===Ee);Fe&&Fe.tags.includes(ge)&&M(Ee,Fe.tags.filter(ct=>ct!==ge))}},[U,h,M]),ve=b.useCallback(()=>{for(const ge of h)ae(ge);p(new Set)},[h,ae]),we=b.useCallback(()=>{for(const ge of h)J(ge);p(new Set)},[h,J]),Ne=b.useCallback(()=>{_(""),S(!0)},[]),K=b.useCallback(async()=>{if(!(!E||!j)){x(!0),S(!1);try{const ge=U.filter(Fe=>h.has(Fe.id));if(ge.length===0){x(!1);return}const Ee=await t.clusterFailures({modelId:`${E}/${j}`,items:ge.map(Fe=>({id:Fe.id,input:Fe.input,output:Fe.output??void 0,error:typeof Fe.error=="string"?Fe.error:Fe.error?String(Fe.error):void 0,scores:Fe.scores,existingTags:Fe.tags.length>0?Fe.tags:void 0})),availableTags:z.length>0?z:void 0,prompt:k||void 0});Ee.proposedTags&&Ee.proposedTags.length>0&&(P(Ee.proposedTags.map(Fe=>({...Fe,accepted:!0}))),B(!0))}catch(ge){console.error("Analysis failed:",ge)}finally{x(!1)}}},[E,j,U,h,t,z,k]),oe=b.useCallback(()=>{for(const ge of I){if(!ge.accepted)continue;const Ee=U.find(Fe=>Fe.id===ge.itemId);if(Ee){const Fe=[...new Set([...Ee.tags,...ge.tags])];M(Ee.id,Fe)}}B(!1)},[I,U,M]),be=b.useCallback(ge=>{u(Ee=>Ee===ge?null:ge)},[]),Ae=b.useMemo(()=>c?te.find(ge=>ge.id===c)??null:null,[c,te]),$e=b.useCallback(()=>{if(!c||te.length===0)return;const ge=te.findIndex(Ee=>Ee.id===c);ge<te.length-1&&u(te[ge+1].id)},[c,te]),ye=b.useCallback(()=>{if(!c||te.length===0)return;const ge=te.findIndex(Ee=>Ee.id===c);ge>0&&u(te[ge-1].id)},[c,te]),ke=Ae?"2rem 1fr 10rem 8rem":"2rem 1fr 10rem 8rem 6rem 6rem";return s?o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(Dt,{className:"w-6 h-6"})}):o.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[o.jsx(On,{open:w,onOpenChange:S,children:o.jsxs(vn,{children:[o.jsxs(kn,{children:[o.jsx(bn,{children:"Analyze Items"}),o.jsx(qs,{children:"Use an LLM to automatically suggest tags for the selected items."})]}),o.jsxs("div",{className:"space-y-4 py-2",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsxs("div",{children:[o.jsx(xt,{className:"text-xs mb-1 block",children:"Provider"}),o.jsx(Ng,{value:E,onValueChange:T})]}),o.jsxs("div",{children:[o.jsx(xt,{className:"text-xs mb-1 block",children:"Model"}),o.jsx(Ag,{llmId:E,value:j,onValueChange:N})]})]}),o.jsxs(me,{variant:"ui-xs",className:"text-neutral3",children:[h.size," item",h.size!==1?"s":""," will be analyzed"]}),o.jsxs("div",{children:[o.jsx(xt,{className:"text-xs",children:"Instructions (optional)"}),o.jsx(gc,{value:k,onChange:ge=>_(ge.target.value),placeholder:"E.g., Focus on safety issues and factual errors...",rows:3,className:"text-xs mt-1"})]})]}),o.jsxs(uf,{children:[o.jsx(ce,{variant:"outline",onClick:()=>S(!1),children:"Cancel"}),o.jsxs(ce,{onClick:K,disabled:!E||!j||y,children:[y?o.jsx(Dt,{className:"w-4 h-4 mr-1"}):null,"Analyze"]})]})]})}),o.jsx(On,{open:R,onOpenChange:B,children:o.jsxs(vn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(kn,{children:[o.jsx(bn,{children:"Review Proposed Tags"}),o.jsxs(qs,{children:[I.filter(ge=>ge.accepted).length," of ",I.length," proposals selected"]})]}),o.jsx("div",{className:"space-y-3 py-2",children:I.map((ge,Ee)=>{const Fe=U.find(ct=>ct.id===ge.itemId);return o.jsx("div",{className:Y("p-3 border rounded-lg",!ge.accepted&&"opacity-50"),children:o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(fi,{checked:ge.accepted,onCheckedChange:ct=>P(wt=>wt.map((lr,Ve)=>Ve===Ee?{...lr,accepted:!!ct}:lr))}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx(me,{variant:"ui-xs",className:"text-neutral4 truncate block",children:Fe?typeof Fe.input=="string"?Fe.input.slice(0,100):JSON.stringify(Fe.input).slice(0,100):ge.itemId}),o.jsx("div",{className:"flex gap-1 flex-wrap mt-1.5",children:ge.tags.map((ct,wt)=>o.jsx(I1t,{tag:ct,onRename:lr=>P(Ve=>Ve.map((qe,Ie)=>Ie===Ee?{...qe,tags:qe.tags.map((Le,Re)=>Re===wt?lr:Le)}:qe)),onRemove:()=>P(lr=>lr.map((Ve,qe)=>qe===Ee?{...Ve,tags:Ve.tags.filter((Ie,Le)=>Le!==wt)}:Ve))},`${ct}-${wt}`))}),ge.reason&&o.jsx(me,{variant:"ui-xs",className:"text-neutral3 mt-1 block italic",children:ge.reason})]})]})},ge.itemId)})}),o.jsxs(uf,{children:[o.jsx(ce,{variant:"outline",onClick:()=>B(!1),children:"Cancel"}),o.jsxs(ce,{onClick:oe,disabled:I.filter(ge=>ge.accepted).length===0,children:["Accept ",I.filter(ge=>ge.accepted).length," proposals"]})]})]})}),o.jsxs(tf,{className:Ae?"grid-cols-[1fr_1fr]":"",children:[o.jsxs(gr,{children:[o.jsxs(gr.Toolbar,{children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsxs(ce,{variant:"outline",size:"md",children:[o.jsx(vVe,{}),"Filter",V>0&&o.jsx("span",{className:Y("ml-0.5 inline-flex items-center justify-center rounded-full bg-accent1/50 text-neutral5 text-ui-sm w-5 h-5"),children:V})]})}),o.jsxs(yt.Content,{align:"start",className:Y("min-w-48"),children:[o.jsxs(yt.Sub,{children:[o.jsxs(yt.SubTrigger,{children:["Status",m&&o.jsx("span",{className:Y("ml-auto text-ui-sm text-accent1"),children:"1"})]}),o.jsxs(M8e,{children:[o.jsx(yt.CheckboxItem,{checked:!m,onCheckedChange:()=>{g(!1),u(null)},onSelect:ge=>ge.preventDefault(),children:"Review Queue"}),o.jsx(yt.CheckboxItem,{checked:m,onCheckedChange:()=>{g(!0),u(null)},onSelect:ge=>ge.preventDefault(),children:"Completed"})]})]}),o.jsxs(yt.Sub,{children:[o.jsxs(yt.SubTrigger,{children:["Tags",d&&o.jsx("span",{className:Y("ml-auto text-ui-sm text-accent1"),children:"1"})]}),o.jsxs(M8e,{children:[o.jsx(yt.CheckboxItem,{checked:!d,onCheckedChange:()=>f(null),onSelect:ge=>ge.preventDefault(),children:"All"}),Z>0&&o.jsx(yt.CheckboxItem,{checked:d==="__untagged__",onCheckedChange:()=>f(d==="__untagged__"?null:"__untagged__"),onSelect:ge=>ge.preventDefault(),children:"Untagged"}),L.length>0&&o.jsx(yt.Separator,{}),L.map(([ge])=>o.jsx(yt.CheckboxItem,{checked:d===ge,onCheckedChange:()=>f(d===ge?null:ge),onSelect:Ee=>Ee.preventDefault(),children:ge},ge))]})]}),V>0&&o.jsxs(o.Fragment,{children:[o.jsx(yt.Separator,{}),o.jsxs(yt.Item,{onSelect:()=>{f(null),g(!1),u(null)},children:[o.jsx(Nn,{}),"Clear all filters"]})]})]})]}),V>0&&o.jsxs(ce,{variant:"outline",size:"md",onClick:()=>{f(null),g(!1),u(null)},children:[o.jsx(Nn,{}),"Reset"]})]}),!m&&h.size>0&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(A1t,{selectedCount:h.size,vocabulary:z,onApplyTag:de,onRemoveTag:ue,onNewTag:ge=>de(ge)}),o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsxs(ce,{disabled:y,children:[y?o.jsx(Dt,{className:"w-4 h-4"}):o.jsx(Ce,{size:"sm",children:o.jsx(as,{})}),"Actions"]})}),o.jsxs(yt.Content,{align:"end",children:[o.jsxs(yt.Item,{onSelect:ve,children:[o.jsx(Ce,{size:"sm",children:o.jsx(Jw,{})}),"Complete"]}),o.jsxs(yt.Item,{onSelect:we,children:[o.jsx(Ce,{size:"sm",children:o.jsx(ed,{})}),"Remove"]}),o.jsx(yt.Separator,{}),o.jsxs(yt.Item,{onSelect:Ne,children:[o.jsx(Ce,{size:"sm",children:o.jsx(g_,{})}),"Analyze"]})]})]})]})]}),re?o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(Dt,{className:"w-6 h-6"})}):te.length===0?o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsxs("div",{className:"text-center px-8",children:[o.jsx(me,{variant:"ui-sm",className:"text-neutral3 block",children:m?"No completed reviews yet":"No items to review"}),o.jsx(me,{variant:"ui-xs",className:"text-neutral3 mt-2 block",children:m?"Items marked as complete will appear here for auditing.":"When experiment results are flagged for review, they will appear here."})]})}):o.jsxs(Se,{columns:ke,children:[o.jsxs(Se.Top,{children:[!m&&o.jsx(Se.TopCell,{children:o.jsx(fi,{checked:X?!0:se?"indeterminate":!1,onCheckedChange:()=>xe(),"aria-label":"Select all"})}),m&&o.jsx(Se.TopCell,{children:" "}),o.jsx(Se.TopCell,{children:"Input"}),o.jsx(Se.TopCell,{children:"Comment"}),o.jsx(Se.TopCell,{children:"Tags"}),!Ae&&o.jsx(Se.TopCell,{children:"Rating"}),!Ae&&o.jsx(Se.TopCell,{children:"Scores"})]}),o.jsx(Se.Rows,{children:te.map(ge=>{const Ee=ge.scores?Object.entries(ge.scores):[];return o.jsxs(Se.Row,{onClick:()=>be(ge.id),selected:c===ge.id,children:[o.jsx(Se.Cell,{children:m?ge.error?o.jsx("div",{className:"w-2 h-2 rounded-full bg-red-700",title:"Error"}):o.jsx("div",{className:"w-2 h-2 rounded-full bg-green-600",title:"Success"}):o.jsx(fi,{checked:h.has(ge.id),onCheckedChange:()=>le(ge.id),onClick:Fe=>Fe.stopPropagation(),"aria-label":`Select item ${ge.id}`})}),o.jsx(Se.NameCell,{children:XTn(ge.input,80)}),o.jsx(Se.Cell,{children:ge.comment?o.jsx(me,{variant:"ui-xs",className:"text-neutral3 truncate",children:ge.comment}):o.jsx(me,{variant:"ui-xs",className:"text-neutral2",children:"—"})}),o.jsx(Se.Cell,{children:ge.tags.length>0?o.jsx(me,{variant:"ui-xs",className:"text-neutral4 truncate",children:ge.tags.join(", ")}):o.jsx(me,{variant:"ui-xs",className:"text-neutral2",children:"—"})}),!Ae&&o.jsxs(Se.Cell,{children:[ge.rating==="positive"&&o.jsx(Ce,{size:"sm",className:"text-positive1",children:o.jsx(uce,{})}),ge.rating==="negative"&&o.jsx(Ce,{size:"sm",className:"text-negative1",children:o.jsx(cce,{})}),!ge.rating&&o.jsx(me,{variant:"ui-xs",className:"text-neutral2",children:"—"})]}),!Ae&&o.jsx(Se.Cell,{children:Ee.length>0?o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Ce,{size:"sm",className:"text-neutral3",children:o.jsx(La,{})}),o.jsx(me,{variant:"ui-xs",className:"text-neutral4 font-mono",children:Ee[0][1].toFixed(2)}),Ee.length>1&&o.jsxs(vt,{variant:"default",children:["+",Ee.length-1]})]}):o.jsx(me,{variant:"ui-xs",className:"text-neutral2",children:"—"})})]},ge.id)})})]})]}),Ae&&o.jsx(N1t,{item:Ae,isCompleted:m,tagVocabulary:z,onRate:ge=>W(Ae.id,ge),onSetTags:ge=>{M(Ae.id,ge);for(const Ee of ge)z.includes(Ee)||H(Ee)},onComment:ge=>G(Ae.id,ge),onRemove:()=>J(Ae.id),onComplete:m?void 0:()=>ae(Ae.id),onPrevious:ye,onNext:$e,onClose:()=>u(null)})]})]})}function eNn({datasetId:e,onExperimentClick:t,onEditClick:r,onDeleteClick:n,onAddItemClick:s,experimentTriggerSlot:a,onNavigateToDataset:i,activeDatasetVersion:l,onVersionSelect:c,initialTab:u,onTabChange:d}){const{navigate:f}=or(),[h,p]=b.useState(u??"items"),m=Ut=>{p(Ut),d?.(Ut)},[g,y]=b.useState(!1),[x,w]=b.useState(!1),[S,k]=b.useState(!1),[_,E]=b.useState([]),[T,j]=b.useState(!1),[N,I]=b.useState([]),[P,R]=b.useState(!1),[B,D]=b.useState([]),[$,U]=b.useState(!1),[z,H]=b.useState(0),[Q,L]=b.useState(null),[Z,V]=b.useState(""),[M]=aur(Z,300),[W,G]=b.useState(null),ae=l!==void 0?l:W,{data:te,isLoading:re}=Tg(e),{data:ie=[],total:he,isLoading:X,setEndOfListElement:se,isFetchingNextPage:le,hasNextPage:xe}=OE(e,M||void 0,ae),{data:de=[],total:ue,isLoading:ve}=OE(e,void 0,ae),[we,Ne]=b.useState({}),{data:K,isLoading:oe}=xR(e,void 0,we),{data:be}=xR(e),{deleteItems:Ae}=ni(),$e=K?.experiments??[],ye=be?.experiments??[],ke=yTn({hasSearchQuery:!!M,filteredItemsLength:ie.length,unfilteredItemsTotal:ue,itemsTotal:he}),{data:ge}=z1t(e),Ee=ge?.length??0,Fe=Ut=>{L(Ut)},ct=()=>{L(null)},wt=Ut=>{const $r=Ut.isCurrent?null:Ut;c?c($r):G(Ut.isCurrent?null:Ut.version)},lr=Ut=>{E(Ut),k(!0)},Ve=Ut=>{I(Ut),j(!0)},qe=Ut=>{j(Ut),Ut||(I([]),H($r=>$r+1))},Ie=Ut=>{f(`/datasets/${e}/items?items=${Ut.join(",")}`)},Le=Ut=>{f(`/datasets/${e}/versions?ids=${Ut.join(",")}`)},Re=Ut=>{D(Ut),R(!0)},it=async()=>{await Ae.mutateAsync({datasetId:e,itemIds:B}),ze.success(`Deleted ${B.length} items`),R(!1),D([]),H(Ut=>Ut+1)},rt=Ut=>{k(!1),E([]),H($r=>$r+1),i?.(Ut)},ht=Ut=>{k(Ut),Ut||(E([]),H($r=>$r+1))};return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsx("div",{className:Y("h-full w-full",ln.allSlow),children:o.jsxs("div",{className:Y("grid grid-rows-[auto_1fr] mx-auto h-full w-full m-auto",Q?"max-w-[120rem]":"max-w-[90rem]"),children:[o.jsx(ZTn,{dataset:te,isLoading:re,onEditClick:r,onDuplicateClick:()=>U(!0),onDeleteClick:n,experimentTriggerSlot:a,disableExperimentTrigger:!ve&&de.length===0,onExperimentClick:t}),o.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:o.jsxs(Ef,{defaultTab:"items",value:h,onValueChange:m,className:"grid grid-rows-[auto_1fr] h-full",children:[o.jsxs(Cf,{children:[o.jsxs(hs,{value:"items",children:["Items ",o.jsx(za,{color:"gray",children:ke})]}),o.jsxs(hs,{value:"experiments",children:["Experiments",o.jsx(za,{color:"gray",children:$e.length})]}),o.jsxs(hs,{value:"review",children:["Review",Ee>0&&o.jsx(za,{color:"orange",children:Ee})]})]}),o.jsx(Ns,{value:"items",className:"grid overflow-auto mt-5",children:o.jsx(qTn,{datasetId:e,items:ie,isLoading:X,featuredItemId:Q,onItemSelect:Fe,onItemClose:ct,onAddClick:s??(()=>{}),onImportClick:()=>y(!0),onImportJsonClick:()=>w(!0),onBulkDeleteClick:Re,onCreateDatasetClick:lr,onAddToDatasetClick:Ve,onCompareItemsClick:Ie,datasetName:te?.name,clearSelectionTrigger:z,setEndOfListElement:se,isFetchingNextPage:le,hasNextPage:xe,searchQuery:Z,onSearchChange:V,activeDatasetVersion:ae,currentDatasetVersion:te?.version,onVersionSelect:wt,onCompareVersionsClick:Le})}),o.jsx(Ns,{value:"experiments",className:"grid overflow-auto mt-5",children:o.jsx(RTn,{experiments:$e,allExperiments:ye,isLoading:oe,datasetId:e,filters:we,onFiltersChange:Ne})}),o.jsx(Ns,{value:"review",className:"overflow-auto mt-0",children:o.jsx(JTn,{datasetId:e})})]})})]})})}),o.jsx(_Tn,{datasetId:e,open:g,onOpenChange:y}),o.jsx(GTn,{datasetId:e,open:x,onOpenChange:w}),o.jsx(dTn,{open:S,onOpenChange:ht,items:_,onSuccess:rt}),o.jsx(fTn,{open:T,onOpenChange:qe,items:N,currentDatasetId:e}),o.jsx(hTn,{open:$,onOpenChange:U,sourceDatasetId:e,sourceDatasetName:te?.name||"",sourceDatasetDescription:te?.description,onSuccess:i}),o.jsx($t,{open:P,onOpenChange:R,children:o.jsxs($t.Content,{children:[o.jsxs($t.Header,{children:[o.jsx($t.Title,{children:"Delete Items"}),o.jsxs($t.Description,{children:["Are you sure you want to delete ",B.length," item",B.length!==1?"s":"","? This action cannot be undone."]})]}),o.jsxs($t.Footer,{children:[o.jsx($t.Cancel,{children:"Cancel"}),o.jsx($t.Action,{onClick:it,children:Ae.isPending?"Deleting...":"Delete"})]})]})})]})}function tNn(e){if(!(e instanceof Error))return null;const t=e.message.match(/- ({.*})$/);if(!t)return null;try{const r=JSON.parse(t[1]);if(r.field&&Array.isArray(r.errors))return{field:r.field,errors:r.errors}}catch{}return null}function D8e({field:e,errors:t}){return t.length?o.jsx("div",{className:"mt-2 space-y-1",children:t.map((r,n)=>o.jsxs("p",{className:"text-xs text-destructive",children:[o.jsxs("code",{className:"bg-destructive/10 px-1 rounded",children:[e,r.path!=="/"?r.path:""]}),": ",r.message]},n))}):null}function rNn({datasetId:e,open:t,onOpenChange:r,onSuccess:n}){const[s,a]=b.useState("{}"),[i,l]=b.useState(""),[c,u]=b.useState(""),[d,f]=b.useState(null),{addItem:h}=ni(),p=async x=>{x.preventDefault();let w;try{w=JSON.parse(s)}catch{ze.error("Input must be valid JSON");return}let S;if(i.trim())try{S=JSON.parse(i)}catch{ze.error("Ground Truth must be valid JSON");return}let k;if(c.trim())try{k=JSON.parse(c)}catch{ze.error("Expected Trajectory must be valid JSON");return}try{await h.mutateAsync({datasetId:e,input:w,groundTruth:S,expectedTrajectory:k}),ze.success("Item added successfully"),f(null),a("{}"),l(""),u(""),r(!1),n?.()}catch(_){const E=tNn(_);E?f(E):ze.error(`Failed to add item: ${_ instanceof Error?_.message:"Unknown error"}`)}},m=x=>{a(x),d?.field==="input"&&f(null)},g=x=>{l(x),d?.field==="groundTruth"&&f(null)},y=()=>{a("{}"),l(""),u(""),f(null),r(!1)};return o.jsx(On,{open:t,onOpenChange:r,children:o.jsxs(vn,{className:"max-w-lg",children:[o.jsx(kn,{children:o.jsx(bn,{children:"Add Item"})}),o.jsx(Bn,{children:o.jsxs("form",{onSubmit:p,className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(xt,{htmlFor:"item-input",children:"Input (JSON) *"}),o.jsx(Xn,{value:s,onChange:m,showCopyButton:!1,className:"min-h-[120px]"}),d?.field==="input"&&o.jsx(D8e,{field:"input",errors:d.errors})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(xt,{htmlFor:"item-ground-truth",children:"Ground Truth (JSON, optional)"}),o.jsx(Xn,{value:i,onChange:g,showCopyButton:!1,className:"min-h-[80px]"}),d?.field==="groundTruth"&&o.jsx(D8e,{field:"groundTruth",errors:d.errors})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(xt,{htmlFor:"item-trajectory",children:"Expected Trajectory (JSON, optional)"}),o.jsx(Xn,{value:c,onChange:u,showCopyButton:!1,className:"min-h-[80px]"})]}),o.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[o.jsx(ce,{type:"button",onClick:y,children:"Cancel"}),o.jsx(ce,{type:"submit",variant:"primary",disabled:h.isPending,children:h.isPending?"Adding...":"Add Item"})]})]})})]})})}function nNn({selectedScorers:e,setSelectedScorers:t,disabled:r=!1,container:n}){const{data:s,isLoading:a}=cd(),i=b.useMemo(()=>s?Object.entries(s).map(([l,c])=>({value:l,label:c.scorer?.config?.name||l,description:c.scorer?.config?.description||""})):[],[s]);return o.jsxs("div",{className:"grid gap-2",children:[o.jsx(xt,{children:"Scorers (Optional)"}),o.jsx(Ddt,{options:i,value:e,onValueChange:t,placeholder:"Select scorers...",searchPlaceholder:"Search scorers...",emptyText:"No scorers available",disabled:r||a,container:n})]})}const sNn=[{value:"agent",label:"Agent"},{value:"workflow",label:"Workflow"},{value:"scorer",label:"Scorer"}];function aNn({targetType:e,setTargetType:t,targetId:r,setTargetId:n,container:s}){const{data:a,isLoading:i}=Eg(),{data:l,isLoading:c}=c0(),{data:u,isLoading:d}=cd(),f=e==="agent"?Object.entries(a??{}).map(([g,y])=>({value:g,label:y.name??g})):e==="workflow"?Object.entries(l??{}).map(([g,y])=>({value:g,label:y.name??g})):e==="scorer"?Object.entries(u??{}).map(([g,y])=>({value:g,label:y.scorer?.config?.name??g})):[],h=e==="agent"&&i||e==="workflow"&&c||e==="scorer"&&d,p=g=>{t(g),n("")},m=e==="agent"?"Agent":e==="workflow"?"Workflow":"Scorer";return o.jsxs("div",{className:"grid gap-6",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(xt,{children:"Target Type"}),o.jsx(Gl,{options:sNn,value:e,onValueChange:p,placeholder:"Select target type",searchPlaceholder:"Search types...",emptyText:"No types available",container:s})]}),e&&o.jsxs("div",{className:"grid gap-2",children:[o.jsx(xt,{children:m}),o.jsx(Gl,{options:f,value:r,onValueChange:n,placeholder:`Select ${e}`,searchPlaceholder:"Search...",emptyText:"No targets available",disabled:h,container:s})]})]})}function iNn({datasetId:e,version:t,open:r,onOpenChange:n,onSuccess:s}){const a=b.useRef(null),[i,l]=b.useState(""),[c,u]=b.useState(""),[d,f]=b.useState([]),{triggerExperiment:h}=ni(),p=i&&c,m=h.isPending,g=async()=>{if(p)try{const x=await h.mutateAsync({datasetId:e,targetType:i,targetId:c,scorerIds:d.length>0?d:void 0,version:t});mc.success("Experiment triggered successfully"),n(!1),s?.(x.experimentId),l(""),u(""),f([])}catch(x){const w=x instanceof Error?x.message:"Failed to trigger experiment";mc.error(w)}},y=()=>{m||(n(!1),l(""),u(""),f([]))};return o.jsx(On,{open:r,onOpenChange:y,children:o.jsxs(vn,{ref:a,children:[o.jsxs(kn,{children:[o.jsx(bn,{children:"Run Experiment"}),o.jsx(qs,{children:t?`Execute items from ${tr(new Date(t),"MMM d, yyyy")} version against a target.`:"Execute all items in this dataset against a target."})]}),o.jsxs(Bn,{className:"grid gap-6",children:[o.jsx(aNn,{targetType:i,setTargetType:l,targetId:c,setTargetId:u,container:a}),i&&i!=="scorer"&&o.jsx(nNn,{selectedScorers:d,setSelectedScorers:f,disabled:m,container:a})]}),o.jsxs(uf,{className:"px-6 pt-4",children:[o.jsx(ce,{onClick:y,disabled:m,children:"Cancel"}),o.jsx(ce,{variant:"primary",onClick:g,disabled:!p||m,children:m?o.jsxs(o.Fragment,{children:[o.jsx(Dt,{className:"w-4 h-4"}),"Running..."]}):"Run"})]})]})})}const B1t=e=>{const t=Ge();return kt({queryKey:["experiment-trace-light",e],queryFn:async()=>{if(!e)throw new Error("Trace ID is required");return t.getTraceLight(e)},enabled:!!e})},L8e=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"score",label:"Score",size:"1fr"}];function oNn({result:e,scores:t,onPrevious:r,onNext:n,onClose:s,onShowTrace:a,onScoreClick:i,featuredScoreId:l}){const c=!!e?.error,u=nre(e?.input),d=nre(e?.output);return o.jsxs(o.Fragment,{children:[o.jsxs(gr.Toolbar,{children:[o.jsx(xC,{onPrevious:r,onNext:n,previousAriaLabel:"View previous result details",nextAriaLabel:"View next result details"}),o.jsxs(ps,{children:[o.jsxs(ce,{onClick:a,disabled:!e.traceId,children:[o.jsx(lce,{}),"Show Trace"]}),o.jsx(ce,{onClick:s,"aria-label":"Close result details panel",children:o.jsx(Nn,{})})]})]}),o.jsxs(gr.Content,{children:[o.jsx(Ir,{withMargins:!1,children:o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(ux,{})," ",e.id]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:[o.jsx(lx,{})," ",e.itemId]})})]})}),c&&o.jsx(cn,{variant:"destructive",title:"Error",children:o.jsx(cn.Message,{children:nre(e?.error&&typeof e.error=="object"?e.error.message:e?.error)})}),t&&t.length>0&&o.jsxs(Pt,{className:"grid-rows-[auto_auto] overflow-visible",children:[o.jsxs(Pt.Header,{columns:L8e,children:[o.jsx(Pt.HeaderCol,{children:"Scorer"}),o.jsx(Pt.HeaderCol,{children:"Score"})]}),o.jsx(Pt.Items,{children:t.map(f=>o.jsx(Pt.Row,{children:o.jsxs(Pt.RowButton,{item:{id:f.id},columns:L8e,isFeatured:l===f.id,onClick:i,children:[o.jsx(Pt.TextCell,{children:f.scorerId}),o.jsx(Pt.TextCell,{className:"font-mono",children:f.score.toFixed(3)})]})},f.id))})]}),(e.status||Array.isArray(e.tags)&&e.tags.length>0)&&o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("h4",{className:"text-sm font-medium text-neutral5 flex items-center gap-2",children:[o.jsx(NE,{className:"w-4 h-4"})," Review Status"]}),o.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[e.status&&o.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full font-medium ${e.status==="needs-review"?"bg-warning/10 text-warning":e.status==="complete"?"bg-accent1/10 text-accent1":"bg-neutral3/10 text-neutral4"}`,children:e.status}),Array.isArray(e.tags)&&e.tags.length>0&&e.tags.map(f=>o.jsx("span",{className:"text-xs px-2 py-0.5 rounded bg-surface4 text-neutral4",children:f},f))]})]}),o.jsx(Vt.CodeSection,{title:"Input",icon:o.jsx(lx,{}),codeStr:u}),o.jsx(Vt.CodeSection,{title:"Output",icon:o.jsx(Qd,{}),codeStr:d}),o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("h4",{className:"text-sm font-medium text-neutral5 flex items-center gap-2",children:[o.jsx(h_,{className:"w-4 h-4"})," Created"]}),o.jsx("p",{className:"text-sm text-neutral4",children:tr(new Date(e.createdAt),"MMM d, yyyy 'at' h:mm a")})]})]})]})}function nre(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function lNn({span:e}){return e?o.jsxs(o.Fragment,{children:[o.jsx(Vt.CodeSection,{title:"Input",icon:o.jsx(cx,{}),codeStr:JSON.stringify(e.input||null,null,2)}),o.jsx(Vt.CodeSection,{title:"Output",icon:o.jsx(Qd,{}),codeStr:JSON.stringify(e.output||null,null,2)}),o.jsx(Vt.CodeSection,{title:"Metadata",icon:o.jsx(wh,{}),codeStr:JSON.stringify(e.metadata||null,null,2)}),o.jsx(Vt.CodeSection,{title:"Attributes",icon:o.jsx(wh,{}),codeStr:JSON.stringify(e.attributes||null,null,2)})]}):null}function cNn({traceId:e,spanId:t,onNext:r,onPrevious:n,onClose:s}){const{data:a}=MS(e,t),i=a?.span;return o.jsxs(o.Fragment,{children:[o.jsxs(gr.Toolbar,{children:[o.jsx(xC,{onPrevious:n,onNext:r,previousAriaLabel:"View previous span details",nextAriaLabel:"View next span details"}),o.jsx(ce,{onClick:s,"aria-label":"Close span details",children:o.jsx(Nn,{})})]}),o.jsxs(gr.Content,{children:[o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(wh,{})," Span ",ef(t)]})})}),o.jsx(lNn,{span:i})]})]})}const uNn=e=>{if(!e||e.length===0)return[];const t=e.reduce((l,c)=>{const u=c?.endedAt?new Date(c.endedAt):void 0;return u&&(!l||u>l)?u:l},null),r=new Map,n=[];e.forEach(l=>{const c=new Date(l.startedAt),u=l.endedAt?new Date(l.endedAt):void 0,d={id:l.spanId,name:l.name,type:l.spanType,latency:u?u.getTime()-c.getTime():0,startTime:c.toISOString(),endTime:u?u.toISOString():void 0,spans:[],parentSpanId:l.parentSpanId};r.set(l.spanId,d)}),e.forEach(l=>{const c=r.get(l.spanId);if(l?.parentSpanId==null){if(t&&c.endTime&&t>new Date(c.endTime)){c.endTime=t.toISOString();const u=new Date(t).getTime(),d=new Date(c.startTime).getTime();c.latency=u-d}n.push(c)}else{const u=r.get(l.parentSpanId);u?u.spans.push(c):n.push(c)}});const s=l=>l.sort((c,u)=>new Date(c.startTime).getTime()-new Date(u.startTime).getTime()),a=s(n),i=l=>{l.forEach(c=>{c.spans&&c.spans.length>0&&(c.spans=s(c.spans),i(c.spans))})};return i(a),a};function U1t(e){if(!e.spans||e.spans.length===0)return[];const t=[];return e.spans.forEach(r=>{t.push(r.id),t.push(...U1t(r))}),t}const $8e=["agent","workflow","model","mcp","tool","workspace","other"];function V1t(e){const t=e?.toLowerCase().split("_")[0],r={agent:{icon:o.jsx(ga,{}),color:"oklch(0.75 0.15 250)",label:"Agent",bgColor:"bg-oklch(0.75 0.15 250 / 0.1)",typePrefix:"agent"},workflow:{icon:o.jsx(Di,{}),color:"oklch(0.75 0.15 200)",label:"Workflow",bgColor:"bg-oklch(0.75 0.15 200 / 0.1)",typePrefix:"workflow"},model:{icon:o.jsx(Em,{}),color:"oklch(0.75 0.15 320)",label:"Model",bgColor:"bg-oklch(0.75 0.15 320 / 0.1)",typePrefix:"model"},mcp:{icon:o.jsx(gl,{}),color:"oklch(0.75 0.15 160)",label:"MCP",bgColor:"bg-oklch(0.75 0.15 160 / 0.1)",typePrefix:"mcp"},tool:{icon:o.jsx(Mi,{}),color:"oklch(0.75 0.15 100)",label:"Tool",bgColor:"bg-oklch(0.75 0.15 100 / 0.1)",typePrefix:"tool"},workspace:{icon:o.jsx(B9,{}),color:"oklch(0.75 0.15 40)",label:"Workspace",bgColor:"bg-oklch(0.75 0.15 40 / 0.1)",typePrefix:"workspace"}};return t in r?r[t]:{typePrefix:"other"}}function dNn({isSelected:e,isFaded:t,isExpanded:r,toggleChildren:n,expandAllDescendants:s,totalDescendants:a=0,allDescendantsExpanded:i,numOfChildren:l}){return o.jsx("div",{className:Y("flex items-center justify-end h-full px-3",{"opacity-30 [&:hover]:opacity-60":t,"bg-surface4":e}),children:l&&l>0?o.jsxs("div",{className:"flex gap-1",children:[o.jsxs(F8e,{onClick:()=>n?.(),children:[i?a:l," ",r?i?o.jsx(oVe,{}):o.jsx(Ux,{}):o.jsx(as,{})]}),a>(l??0)&&!i&&o.jsxs(F8e,{onClick:()=>s?.(),children:[a," ",o.jsx(iVe,{})]})]}):null})}function F8e({onClick:e,children:t,className:r}){return o.jsx("button",{onClick:e,className:Y("h-full",r),children:o.jsx("div",{className:Y("flex items-center gap-[0.1rem] text-ui-sm text-neutral5 border border-border1 pl-2 pr-1 rounded-lg transition-all","hover:text-yellow-500","[&>svg]:shrink-0 [&>svg]:opacity-80 [&>svg]:w-4 [&>svg]:h-4 [&>svg]:transition-all"),children:t})})}function fNn({isLastChild:e,hasChildren:t=!1,expanded:r=!1}){return o.jsx("div",{className:Y("w-12 h-[2.8rem] relative opacity-100",'after:content-[""] after:absolute after:left-[-1px] after:top-0 after:bottom-0 after:w-0 after:border-l after:border-neutral3 after:border-dashed ','before:content-[""] before:absolute before:left-0 before:top-[50%] before:w-full before:h-0 before:border-b before:border-neutral3 before:border-dashed',"[&_svg]:transition-all","[&:hover_svg]:text-yellow-500 [&:hover_svg]:scale-[1.3] [&:hover_svg]:opacity-100",{"after:bottom-[50%]":e}),children:t&&o.jsx("span",{className:Y("flex absolute left-[50%] top-[50%] translate-y-[-50%] translate-x-[-50%] items-center justify-center bg-surface2 p-1","[&>svg]:shrink-0 [&>svg]:opacity-60 [&>svg]:w-[0.8rem] [&>svg]:h-[0.8rem]"),children:r?o.jsx(uVe,{}):o.jsx(cVe,{})})})}function hNn({span:e,spanUI:t,isFaded:r,depth:n=0,onSpanClick:s,selectedSpanId:a,isLastChild:i,hasChildren:l,isRootSpan:c,isExpanded:u,toggleChildren:d}){return o.jsxs("div",{className:"flex overflow-x-auto",style:{paddingLeft:`${n*1.5}rem`},children:[!c&&o.jsx("button",{onClick:()=>d?.(),disabled:!l,className:Y({"cursor-default":!l,"cursor-pointer":l}),children:o.jsx(fNn,{isLastChild:i,hasChildren:!!l,expanded:u})}),o.jsx("button",{className:"truncate",onClick:()=>s?.(e.id),children:e.name})]})}function q1t({span:e,depth:t=0,onSpanClick:r,selectedSpanId:n,isLastChild:s,overallLatency:a,overallStartTime:i,overallEndTime:l,fadedTypes:c,searchPhrase:u,featuredSpanIds:d,expandedSpanIds:f,setExpandedSpanIds:h}){const p=e.spans&&e.spans.length>0,m=e.spans?e.spans.length:0,g=U1t(e),y=g.length,x=t===0,w=V1t(e?.type),S=f?f.includes(e.id):!1,k=d&&d.length>0?!d.includes(e.id):!1,E=(c&&c.length>0?c.includes(w?.typePrefix||""):!1)||k;b.useEffect(()=>{x&&h?.([e.id])},[x,e.id,h]),b.useEffect(()=>{if(!d||!e.spans||e.spans.length===0)return;const I=e.spans.some(P=>d.includes(P.id));!S&&I&&T()},[d,e.spans,e.id,S,h,f]);const T=()=>{if(!(!h||!f))if(S){const I=[e.id,...g];h(f.filter(P=>!I.includes(P)))}else h([...f,e.id])},j=()=>{!h||!f||h([...f,e.id,...g])},N=g.every(I=>f?.includes(I));return o.jsxs(o.Fragment,{children:[o.jsx(hNn,{span:e,spanUI:w,isFaded:E,depth:t,onSpanClick:r,selectedSpanId:n,isLastChild:s,hasChildren:p,isRootSpan:x,isExpanded:S,toggleChildren:T}),o.jsx(dNn,{isSelected:n===e.id,isFaded:E,isExpanded:S,toggleChildren:T,expandAllDescendants:j,totalDescendants:y,allDescendantsExpanded:N,numOfChildren:m}),p&&S&&e.spans?.map((I,P,R)=>{const B=P===R.length-1;return o.jsx(q1t,{span:I,depth:t+1,onSpanClick:r,selectedSpanId:n,isLastChild:B,overallLatency:a,overallStartTime:i,fadedTypes:c,searchPhrase:u,expandedSpanIds:f,setExpandedSpanIds:h,featuredSpanIds:d},I.id)})]})}function pNn({hierarchicalSpans:e=[],onSpanClick:t,selectedSpanId:r,isLoading:n,fadedTypes:s,expandedSpanIds:a,setExpandedSpanIds:i,featuredSpanIds:l}){const c=e?.[0]?.latency||0,u=e?.[0]?.startTime||"",d=e?.[0]?.endTime||"";return o.jsx(o.Fragment,{children:n?o.jsxs("div",{className:Y("flex items-center text-ui-md gap-4 bg-surface3/50 rounded-md p-6 justify-center text-neutral3","[&_svg]:w-[1.25em] [&_svg]:h-[1.25em] [&_svg]:opacity-50"),children:[o.jsx(Dt,{})," Loading Trace Timeline ..."]}):o.jsx("div",{className:"grid grid-cols-[1fr_auto]",children:e?.map(f=>o.jsx(q1t,{span:f,onSpanClick:t,selectedSpanId:r,overallLatency:c,overallStartTime:u,overallEndTime:d,fadedTypes:s,featuredSpanIds:l,expandedSpanIds:a,setExpandedSpanIds:i},f.id))})})}function mNn({spans:e=[],fadedTypes:t,onLegendClick:r,onLegendReset:n,onSearchPhraseChange:s,traceId:a}){const[i,l]=b.useState("");b.useEffect(()=>{l("")},[a]);const c=$8e.filter(h=>e.some(p=>p?.spanType?.startsWith(h)))||[],u=e.some(h=>!$8e.some(m=>h?.spanType?.startsWith(m))),d=h=>{r?.(h)};b.useEffect(()=>{f(i)},[i,s]);const f=ert(h=>{s?.(h)},1e3);return o.jsxs("div",{className:"flex gap-3 items-center justify-between",children:[o.jsx("div",{className:"flex",children:o.jsx(Ox,{name:"search-spans",label:"Find span by name",labelIsHidden:!0,placeholder:"Look for span name",value:i,onChange:h=>{l(h.target.value)},onReset:()=>l("")})}),o.jsxs(pft,{children:[c.map(h=>{const p=V1t(h),m=t?.includes(h);return o.jsx(b.Fragment,{children:o.jsxs(ce,{onClick:()=>d(h),className:m?"opacity-40":"",style:{color:m?void 0:p?.color,backgroundColor:p?.bgColor},children:[p?.icon&&o.jsx(Ce,{children:p.icon}),p?.label]})},h)}),u&&o.jsxs(ce,{onClick:()=>d("other"),className:t?.includes("other")?"opacity-40":"",children:[o.jsx(Ce,{children:o.jsx(oF,{})}),"Other"]}),o.jsx(ce,{onClick:n,disabled:t?.length===0,children:o.jsx(Ce,{children:o.jsx(Nn,{})})})]})]})}function gNn({traceId:e,selectedSpanId:t,onSpanSelect:r,onClose:n}){const{data:s,isLoading:a}=B1t(e),i=s?.spans??[],[l,c]=b.useState(""),[u,d]=b.useState([]),[f,h]=b.useState([]),[p,m]=b.useState([]),g=b.useMemo(()=>uNn(i),[i]);b.useEffect(()=>{if(l.trim()===""){h([]);return}const S=l.toLowerCase(),k=i.filter(_=>_.name.toLowerCase().includes(S)).map(_=>_.spanId);h(k)},[l,i]),b.useEffect(()=>{c(""),d([]),h([]),m([])},[e]);const y=S=>{r?.(t===S?void 0:S)},x=S=>{d(k=>k.includes(S)?k.filter(_=>_!==S):[...k,S])},w=()=>{d([])};return o.jsxs(o.Fragment,{children:[o.jsx(gr.Toolbar,{children:o.jsx(ce,{onClick:n,"aria-label":"Close trace panel",children:o.jsx(Nn,{})})}),o.jsxs(gr.Content,{children:[o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(xo,{})," Trace ",ef(e)]})})}),o.jsx(mNn,{spans:i,fadedTypes:u,onLegendClick:x,onLegendReset:w,searchPhrase:l,onSearchPhraseChange:c,traceId:e}),o.jsx(pNn,{hierarchicalSpans:g,onSpanClick:y,selectedSpanId:t,isLoading:a,fadedTypes:u,expandedSpanIds:p,setExpandedSpanIds:m,featuredSpanIds:f})]})]})}function yNn({results:e,isLoading:t,featuredResultId:r,onResultClick:n,columns:s,scoresByItemId:a,scorerIds:i,setEndOfListElement:l,isFetchingNextPage:c,hasNextPage:u}){const d=s.map(f=>f.size).join(" ");return t?o.jsxs(Se,{columns:d,children:[o.jsx(Se.Top,{children:s.map(f=>o.jsx(Se.TopCell,{children:f.label},f.name))}),o.jsx("div",{className:"flex items-center justify-center py-20 col-span-full",children:o.jsx(Dt,{})})]}):e.length===0?o.jsxs(Se,{columns:d,children:[o.jsx(Se.Top,{children:s.map(f=>o.jsx(Se.TopCell,{children:f.label},f.name))}),o.jsx(Se.NoMatch,{message:"No results yet"})]}):o.jsxs(Se,{columns:d,children:[o.jsx(Se.Top,{children:s.map(f=>o.jsx(Se.TopCell,{children:f.label},f.name))}),o.jsxs(Se.Rows,{children:[e.map(f=>{const h=!!f.error,p=f.id===r;return o.jsxs(Se.Row,{onClick:()=>n(f.id),selected:p,children:[o.jsx(Se.TextCell,{children:o.jsx("span",{className:"truncate block font-mono",children:f.itemId})}),o.jsx(Se.Cell,{children:o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx("div",{className:"flex items-center justify-center w-10 relative bg-transparent h-full",children:o.jsx("div",{className:Y("w-2 h-2 rounded-full",h?"bg-red-700":"bg-green-600")})})}),o.jsx(Wr,{children:h?"Error":"Success"})]})}),s.some(m=>m.name==="input")&&o.jsx(Se.TextCell,{children:o.jsx("span",{className:"truncate block font-mono",children:bNn(vNn(f.input),200)})}),i?.map(m=>{const y=a?.[f.itemId]?.find(x=>x.scorerId===m);return o.jsx(Se.TextCell,{children:o.jsx("span",{className:"font-mono",children:y!=null?y.score.toFixed(3):"-"})},m)})]},f.id)}),o.jsxs("div",{ref:l,className:"h-1 col-span-full",children:[c&&o.jsx("div",{className:"flex justify-center py-4",children:o.jsx(Dt,{})}),!u&&e.length>0&&o.jsx(me,{variant:"ui-xs",className:"text-icon3 text-center py-4 block",children:"All results loaded"})]})]})]})}function vNn(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function bNn(e,t){return e.length<=t?e:e.slice(0,t-1)+"..."}function xNn(e){const t=e.scorer;return t?.hasJudge===!1?!0:t?.hasJudge===!0?!1:!e.preprocessPrompt&&!e.analyzePrompt&&!e.generateScorePrompt&&!e.generateReasonPrompt}function wNn({score:e,onNext:t,onPrevious:r,onClose:n}){const s=xNn(e),a=s?"N/A — code-based scorer":"N/A — step not configured";return o.jsxs(o.Fragment,{children:[o.jsxs(gr.Toolbar,{children:[o.jsx(xC,{onPrevious:r,onNext:t,previousAriaLabel:"View previous score details",nextAriaLabel:"View next score details"}),o.jsx(ce,{onClick:n,"aria-label":"Close score details",children:o.jsx(Nn,{})})]}),o.jsxs(gr.Content,{children:[o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(La,{})," ",e.scorerId]})})}),o.jsxs(kx,{children:[o.jsx(Vt.CodeSection,{title:`Score: ${e.score}`,icon:o.jsx(La,{}),codeStr:e.reason||a,simplified:!0}),o.jsx(Vt.CodeSection,{title:"Input",icon:o.jsx(lx,{}),codeStr:JSON.stringify(e.input??null,null,2)}),o.jsx(Vt.CodeSection,{title:"Output",icon:o.jsx(Qd,{}),codeStr:JSON.stringify(e.output??null,null,2)}),!s&&o.jsxs(o.Fragment,{children:[o.jsx(Vt.CodeSection,{title:"Preprocess Prompt",icon:o.jsx(sc,{}),codeStr:e.preprocessPrompt||a,simplified:!0}),o.jsx(Vt.CodeSection,{title:"Analyze Prompt",icon:o.jsx(sc,{}),codeStr:e.analyzePrompt||a,simplified:!0}),o.jsx(Vt.CodeSection,{title:"Generate Score Prompt",icon:o.jsx(sc,{}),codeStr:e.generateScorePrompt||a,simplified:!0}),o.jsx(Vt.CodeSection,{title:"Generate Reason Prompt",icon:o.jsx(sc,{}),codeStr:e.generateReasonPrompt||a,simplified:!0})]})]})]})]})}const z8e=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"avg",label:"Avg Score",size:"1fr"},{name:"count",label:"Items Scored",size:"1fr"}];function SNn({scoresByItemId:e,experimentStatus:t}){const r=b.useMemo(()=>{if(!e)return[];const n={};for(const s of Object.values(e))for(const a of s)n[a.scorerId]||(n[a.scorerId]={sum:0,count:0}),n[a.scorerId].sum+=a.score,n[a.scorerId].count++;return Object.entries(n).map(([s,{sum:a,count:i}])=>({scorerId:s,avg:a/i,count:i})).sort((s,a)=>s.scorerId.localeCompare(a.scorerId))},[e]);if(r.length===0){const n=t==="running"||t==="pending",s=e!==void 0;let a,i;return n?(a="Experiment in progress",i="Summary metrics will appear here once the experiment completes."):s?(a="No scorers configured",i="Add scorers when triggering an experiment to evaluate results and see summary metrics here."):(a="Loading scores",i="Fetching scorer results…"),o.jsx("div",{className:"flex h-full items-center justify-center py-12",children:o.jsx(Ja,{iconSlot:o.jsx(La,{className:"w-8 h-8 text-neutral3"}),titleSlot:a,descriptionSlot:i})})}return o.jsxs(Pt,{children:[o.jsxs(Pt.Header,{columns:z8e,children:[o.jsx(Pt.HeaderCol,{children:"Scorer"}),o.jsx(Pt.HeaderCol,{children:"Avg Score"}),o.jsx(Pt.HeaderCol,{children:"Items Scored"})]}),o.jsx(Pt.Scroller,{children:o.jsx(Pt.Items,{children:r.map(({scorerId:n,avg:s,count:a})=>o.jsxs(Pt.Row,{columns:z8e,children:[o.jsx(Pt.TextCell,{children:n}),o.jsx(Pt.TextCell,{className:"font-mono",children:s.toFixed(3)}),o.jsx(Pt.TextCell,{className:"font-mono",children:a})]},n))})})]})}function H1t({experimentId:e,experimentStatus:t,results:r,isLoading:n,setEndOfListElement:s,isFetchingNextPage:a,hasNextPage:i}){const[l,c]=b.useState(null),[u,d]=b.useState(null),[f,h]=b.useState(void 0),[p,m]=b.useState(null),g=r.find(z=>z.id===l)??null,{data:y}=w1t(e,t),x=b.useMemo(()=>{if(!y)return[];const z=new Set;for(const H of Object.values(y))for(const Q of H)z.add(Q.scorerId);return[...z].sort()},[y]),{data:w}=B1t(u),S=w?.spans??[],k=()=>{if(!f)return;const z=S.findIndex(H=>H.spanId===f);if(z>=0&&z<S.length-1)return()=>h(S[z+1].spanId)},_=()=>{if(!f)return;const z=S.findIndex(H=>H.spanId===f);if(z>0)return()=>h(S[z-1].spanId)},E=z=>{c(z),d(null),h(void 0),m(null)},T=z=>{E(z===l?null:z)},j=()=>{E(null)},N=()=>{if(!g)return;const z=r.findIndex(H=>H.id===g.id);if(z>=0&&z<r.length-1)return()=>E(r[z+1].id)},I=()=>{if(!g)return;const z=r.findIndex(H=>H.id===g.id);if(z>0)return()=>E(r[z-1].id)},P=g?y?.[g.itemId]:void 0,R=P?.find(z=>z.id===p)??null,B=z=>{m(z===p?null:z),d(null),h(void 0)},D=()=>{if(!p||!P)return;const z=P.findIndex(H=>H.id===p);if(z>=0&&z<P.length-1)return()=>m(P[z+1].id)},$=()=>{if(!p||!P)return;const z=P.findIndex(H=>H.id===p);if(z>0)return()=>m(P[z-1].id)},U=b.useMemo(()=>[{name:"itemId",label:"Item ID",size:"5rem"},{name:"status",label:"Status",size:"3rem"},{name:"input",label:"Input",size:"1fr"},...l?[]:x.map(z=>({name:z,label:z,size:"1fr"}))],[l,x]);return o.jsxs(Ef,{defaultTab:"summary",className:"grid grid-rows-[auto_1fr] h-full overflow-hidden",children:[o.jsxs(Cf,{children:[o.jsx(hs,{value:"summary",children:"Summary"}),o.jsx(hs,{value:"results",children:"Results"})]}),o.jsx(Ns,{value:"summary",className:"overflow-y-auto mt-5",children:o.jsx(SNn,{scoresByItemId:y,experimentStatus:t})}),o.jsx(Ns,{value:"results",className:"grid overflow-hidden mt-5",children:o.jsxs(tf,{className:g?"grid-cols-[1fr_2fr]":void 0,children:[o.jsx(gr,{children:o.jsx(yNn,{results:r,isLoading:n,featuredResultId:l,onResultClick:T,columns:U,scoresByItemId:y,scorerIds:l?void 0:x,setEndOfListElement:s,isFetchingNextPage:a,hasNextPage:i})}),g&&o.jsxs(Y3r,{numOfColumns:1+(!u&&p?1:0)+(u?1:0)+(f?1:0),minColumnWidth:"35rem",children:[g&&o.jsx(gr,{withLeftSeparator:!0,children:o.jsx(oNn,{result:g,scores:P,onPrevious:I(),onNext:N(),onClose:j,onScoreClick:B,featuredScoreId:p,onShowTrace:()=>{d(g.traceId??null),h(void 0),m(null)}})}),g&&!u&&R&&o.jsx(gr,{withLeftSeparator:!0,children:o.jsx(wNn,{score:R,onNext:D(),onPrevious:$(),onClose:()=>m(null)})}),g&&u&&o.jsx(gr,{withLeftSeparator:!0,children:o.jsx(gNn,{traceId:u,selectedSpanId:f,onSpanSelect:h,onClose:()=>{d(null),h(void 0)}})}),g&&u&&f&&o.jsx(gr,{withLeftSeparator:!0,children:o.jsx(cNn,{traceId:u,spanId:f,onNext:k(),onPrevious:_(),onClose:()=>h(void 0)})})]})]})})]})}const ONn={pending:o.jsx(EE,{}),running:o.jsx(g3,{}),completed:o.jsx(ra,{}),failed:o.jsx(Nn,{})};function kNn({experiment:e,className:t}){const r=e.status,n=e.totalItems-e.succeededCount-e.failedCount;return o.jsxs("div",{className:Y("grid justify-items-end gap-3",t),children:[o.jsxs("div",{className:"flex p-1 px-3 text-ui-lg capitalize text-neutral4 gap-2 items-center bg-surface5 rounded-lg ",children:[o.jsx("span",{className:Y("w-5 h-5 flex items-center justify-center rounded-full text-black","[&>svg]:w-4 [&>svg]:h-4",{"bg-green-700":r==="completed","bg-red-700":r==="failed","bg-cyan-600":r==="running","bg-yellow-600":r==="pending"}),children:ONn[r]}),e.status]}),o.jsxs("div",{className:Y("flex items-center gap-3 text-neutral3 text-ui-md ","[&>span]:flex [&>span]:gap-1 [&>span]:items-center ","[&_b]:text-neutral4 [&_b]:font-semibold"),children:[o.jsxs("span",{children:["Total: ",o.jsx("b",{children:e.totalItems})]}),o.jsxs("span",{children:["Succeeded: ",o.jsx("b",{children:e.succeededCount})]}),o.jsxs("span",{children:["Failed: ",o.jsx("b",{children:e.failedCount})]}),(r==="pending"||r==="running")&&o.jsxs("span",{children:["Pending: ",o.jsx("b",{children:n})]})]})]})}function Q1t({experimentId:e,experiment:t}){const{Link:r,paths:n}=or(),{data:s}=Eg(),{data:a}=c0(),{data:i}=cd(),l=()=>{switch(t.targetType){case"agent":return n.agentLink(t.targetId);case"workflow":return n.workflowLink(t.targetId);case"scorer":return n.scorerLink(t.targetId);default:return"#"}},c=()=>{const u=t.targetId;if(!u)return u;switch(t.targetType){case"agent":return s?.[u]?.name??u;case"workflow":return a?.[u]?.name??u;case"scorer":return i?.[u]?.scorer?.config?.name??u;default:return u}};return o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(fVe,{}),e," ",e&&o.jsx(ta,{content:e})]}),o.jsxs(Ir.Description,{children:[o.jsxs(Zn,{children:[o.jsx(h_,{})," Created at ",tr(new Date(t.createdAt),"MMM d, yyyy 'at' h:mm a")]}),t.completedAt&&o.jsxs(Zn,{children:[o.jsx(h_,{})," Completed at ",tr(new Date(t.completedAt),"MMM d, yyyy 'at' h:mm a")]})]}),o.jsxs(Ir.Description,{children:[o.jsxs(Zn,{children:[o.jsx(r2t,{})," Target",o.jsx(r,{href:l(),children:c()})]}),t.agentVersion&&o.jsxs(Zn,{children:[o.jsx(cF,{})," Version",t.targetType==="agent"&&t.targetId?o.jsx(r,{href:`${n.agentLink(t.targetId)}/editor?version=${encodeURIComponent(t.agentVersion)}`,className:"font-mono text-xs underline hover:text-accent1",children:t.agentVersion}):o.jsx("span",{className:"font-mono text-xs",children:t.agentVersion}),o.jsx(ta,{content:t.agentVersion})]})]})]}),o.jsx(Ir.Column,{children:o.jsx(kNn,{experiment:t})})]})}function Rve({delta:e}){const t=e>0?o.jsx(za,{size:"small",color:"green",intensity:"muted",children:o.jsx(nce,{})}):e<0?o.jsx(za,{size:"small",color:"red",intensity:"muted",children:o.jsx(nVe,{})}):null;return o.jsxs("span",{className:Y("font-mono text-sm text-neutral4 min-w-20"),children:[o.jsx("span",{className:"w-3 inline-block",children:e>0?"+ ":e<0?"- ":""}),Math.abs(e).toFixed(2)," ",t]})}function zL(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function _Nn({item:e,baselineId:t,contenderId:r,baselineVersion:n,contenderVersion:s,onPrevious:a,onNext:i,onClose:l}){const c=e.results[t],u=e.results[r],d=!!(c&&u),f=new Set;if(c)for(const p of Object.keys(c.scores))f.add(p);if(u)for(const p of Object.keys(u.scores))f.add(p);const h=[...f].sort();return o.jsxs(gr,{withLeftSeparator:!0,children:[o.jsxs(gr.Toolbar,{children:[o.jsx(xC,{onPrevious:a,onNext:i,previousAriaLabel:"Previous comparison item",nextAriaLabel:"Next comparison item"}),o.jsx(ps,{children:o.jsx(ce,{onClick:l,"aria-label":"Close comparison detail panel",children:o.jsx(Nn,{})})})]}),o.jsxs(gr.Content,{className:"pb-6",children:[o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(lx,{})," ",e.itemId]})})}),d?o.jsx(o.Fragment,{children:o.jsxs(kx,{children:[h.length>0&&o.jsxs("div",{className:"grid gap-3",children:[o.jsx("h4",{className:"text-sm font-medium text-neutral5",children:"Scores"}),o.jsx("div",{className:"grid gap-2",children:h.map(p=>{const m=c?.scores[p]??null,g=u?.scores[p]??null,y=m!=null&&g!=null?g-m:null;return o.jsxs("div",{className:"flex items-center justify-between gap-4 px-3 py-2 rounded-lg bg-surface2",children:[o.jsx("span",{className:"text-sm text-neutral5 font-medium",children:p}),o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsxs("span",{className:"text-sm text-neutral3",children:[m!=null?m.toFixed(3):"-"," →"," ",g!=null?g.toFixed(3):"-"]}),y!=null&&o.jsx(Rve,{delta:y})]})]},p)})})]}),o.jsx(Vt.CodeSection,{title:o.jsxs(o.Fragment,{children:[o.jsx(za,{color:"purple",children:"Baseline "})," Experiment Output"]}),icon:o.jsx(Qd,{}),codeStr:zL(c?.output)}),o.jsx(Vt.CodeSection,{title:o.jsxs(o.Fragment,{children:[o.jsx(za,{color:"cyan",children:"Contender "})," Experiment Output"]}),icon:o.jsx(Qd,{}),codeStr:zL(u?.output)}),o.jsx(Vt.CodeSection,{title:"Item Input",icon:o.jsx(cx,{}),codeStr:zL(e.input)}),o.jsx(Vt.CodeSection,{title:"Item Ground Truth",icon:o.jsx(NVe,{}),codeStr:zL(e.groundTruth)})]})}):o.jsx(cn,{variant:"warning",title:"Comparison not available",children:o.jsx(cn.Message,{children:(()=>{const p=c?"Contender":"Baseline",m=c?s:n;return o.jsxs(o.Fragment,{children:["The ",p," experiment was run against dataset",m!=null?` v. ${m}`:"",", which does not contain this item."]})})()})})]})]})}function ENn({items:e,baselineId:t,contenderId:r,scorerIds:n,featuredItemId:s,columns:a,onItemClick:i}){return o.jsx(gr,{children:o.jsxs(Pt,{children:[o.jsxs(Pt.Header,{columns:a,children:[o.jsx(Pt.HeaderCol,{children:"Item ID"}),!s&&n.map(l=>o.jsx(Pt.HeaderCol,{className:"flex justify-center",children:l},l))]}),o.jsx(Pt.Scroller,{children:o.jsx(Pt.Items,{children:e.map(l=>{const c=l.results[t],u=l.results[r],d=!!(c&&u);return o.jsx(Pt.Row,{children:o.jsxs(Pt.RowButton,{item:{id:l.itemId},columns:a,isFeatured:s===l.itemId,onClick:i,children:[o.jsx(Pt.IdCell,{id:l.itemId,className:d?"":"text-neutral1"}),!s&&o.jsx(o.Fragment,{children:n.map(f=>{const h=c?.scores[f]??null,p=u?.scores[f]??null,m=h!=null&&p!=null?p-h:null;return o.jsx(Pt.Cell,{className:"flex items-center gap-5 justify-center font-mono",children:m!=null?o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"flex items-center text-neutral2 min-w-24",children:[h?.toFixed(2)," → ",p?.toFixed(2)]}),o.jsx(Rve,{delta:m})]}):o.jsx("span",{className:"text-neutral1",children:"-"})},f)})})]})},l.itemId)})})})]})})}const CNn={baseline:{label:"Baseline",color:"purple",customStyle:"items-end justify-items-end [&>div]:justify-end border-r-0 rounded-r-none"},contender:{label:"Contender",color:"cyan",customStyle:"items-start justify-items-start [&>div]:justify-start border-l-0 rounded-l-none"}};function B8e({datasetId:e,experiment:t,type:r}){const{Link:n}=or(),{label:s,color:a,customStyle:i}=CNn[r];if(!t)return null;const l=t.createdAt?new Date(t.createdAt):null;return o.jsxs("div",{className:`grid border-2 border-border1 rounded-lg p-5 gap-3 ${i}`,children:[o.jsxs("div",{className:"flex items-center gap-3 w-full overflow-clip",children:[r==="contender"&&o.jsxs(za,{size:"small",color:a,children:[s,o.jsx(Dw,{})]}),o.jsx(ce,{as:n,href:`/datasets/${e}/experiments/${t.id}`,children:o.jsx("span",{className:"truncate min-w-0",children:t.id})}),r==="baseline"&&o.jsxs(za,{size:"small",color:a,children:[o.jsx(wp,{})," ",s]})]}),o.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-ui-sm text-neutral3",children:[o.jsxs(Zn,{children:[o.jsx(NVe,{})," ",t.targetType," / ",t.targetId]}),o.jsxs(Zn,{children:[o.jsx(bVe,{})," v",t.datasetVersion??"—"]}),l&&o.jsxs(Zn,{children:[o.jsx(sVe,{})," ",tr(l,"MMM d, yyyy HH:mm")]})]})]})}function jNn({datasetId:e,experimentIdA:t,experimentIdB:r,onSwap:n}){const[s,a]=b.useState(null),{data:i,isLoading:l,error:c}=Vjn(e,t,r),{data:u}=G6(e,t),{data:d}=G6(e,r),f=u&&d&&u.datasetVersion!==d.datasetVersion,h=b.useMemo(()=>{if(!i)return[];const T=new Set;for(const j of i.items)for(const N of Object.values(j.results))if(N)for(const I of Object.keys(N.scores))T.add(I);return[...T].sort()},[i]),p=b.useMemo(()=>{if(!i||h.length===0)return[];const T=i.baselineId,j=t===T?r:t;return h.map(N=>{let I=0,P=0,R=0,B=0;for(const z of i.items){const H=z.results[T]?.scores[N],Q=z.results[j]?.scores[N];H!=null&&(I+=H,R++),Q!=null&&(P+=Q,B++)}const D=R>0?I/R:null,$=B>0?P/B:null,U=D!=null&&$!=null?$-D:null;return{scorerId:N,avgA:D,avgB:$,delta:U}})},[i,h,t,r]),m=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"baselineAvg",label:"Baseline Avg",size:"1fr"},{name:"comparisonAvg",label:"Comparison Avg",size:"1fr"},{name:"delta",label:"Delta",size:"1fr"}],g=b.useMemo(()=>[{name:"itemId",label:"Item ID",size:"8rem"},...s?[]:h.map(T=>({name:T,label:T,size:"1fr"}))],[h,s]),y=i?.items.find(T=>T.itemId===s)??null,x=T=>{a(T===s?null:T)},w=()=>{a(null)},S=()=>{if(!i||!s)return;const T=i.items.findIndex(j=>j.itemId===s);if(T>=0&&T<i.items.length-1)return()=>a(i.items[T+1].itemId)},k=()=>{if(!i||!s)return;const T=i.items.findIndex(j=>j.itemId===s);if(T>0)return()=>a(i.items[T-1].itemId)};if(l)return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx(Dt,{})});if(c)return o.jsx(cn,{variant:"warning",title:"Error loading comparison",children:o.jsx(cn.Message,{children:c instanceof Error?c.message:"Unknown error"})});if(!i||i.items.length===0)return o.jsx("div",{className:"text-neutral4 text-sm text-center py-8",children:"No comparison data"});const _=i.baselineId,E=t===_?r:t;return o.jsxs("div",{className:"grid gap-10",children:[u&&d&&o.jsxs("div",{className:Y("relative grid xl:grid-cols-[1fr_auto_1fr] gap-4 xl:gap-0"),children:[o.jsx(B8e,{datasetId:e,experiment:u,type:"baseline"}),o.jsx("div",{className:"relative flex items-center justify-center px-[2vw] before:absolute before:inset-y-0 before:left-1/2 before:-translate-x-1/2 before:w-[2px] before:bg-border1",children:o.jsx("div",{className:"relative z-1 bg-surface2 rounded-lg p-2",children:o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(ce,{onClick:n,children:"VS"})}),o.jsx(Wr,{children:"Switch the order"})]})})}),o.jsx(B8e,{datasetId:e,experiment:d,type:"contender"})]}),f&&o.jsx(cn,{variant:"warning",title:"Version mismatch",children:o.jsxs(cn.Message,{children:["These experiments used different dataset versions (v",u.datasetVersion," vs v",d.datasetVersion,"). Results may not be directly comparable."]})}),p.length>0&&o.jsxs(Pt,{children:[o.jsxs(Pt.Header,{columns:m,children:[o.jsx(Pt.HeaderCol,{children:"Scorer"}),o.jsx(Pt.HeaderCol,{className:"flex justify-center",children:o.jsxs(fRe,{children:[o.jsx(za,{color:"purple",size:"small",intensity:"muted",children:"Baseline"}),o.jsx(za,{color:"purple",size:"small",children:"Avg"})]})}),o.jsx(Pt.HeaderCol,{className:"flex justify-center",children:o.jsxs(fRe,{children:[o.jsx(za,{color:"cyan",size:"small",intensity:"muted",children:"Contender"}),o.jsx(za,{color:"cyan",size:"small",children:"Avg"})]})}),o.jsx(Pt.HeaderCol,{className:"flex justify-center",children:"Delta"})]}),o.jsx(Pt.Scroller,{children:o.jsx(Pt.Items,{children:p.map(({scorerId:T,avgA:j,avgB:N,delta:I})=>o.jsxs(Pt.Row,{columns:m,children:[o.jsx(Pt.TextCell,{children:T}),o.jsx(Pt.TextCell,{className:"text-center font-mono",children:j!=null?j.toFixed(3):"-"}),o.jsx(Pt.TextCell,{className:"text-center font-mono",children:N!=null?N.toFixed(3):"-"}),o.jsx(Pt.TextCell,{className:"flex justify-center",children:I!=null?o.jsx(Rve,{delta:I}):"-"})]},T))})})]}),o.jsxs(tf,{className:Y({"grid-cols-[1fr_2fr]":!!y}),children:[o.jsx(ENn,{items:i.items,baselineId:_,contenderId:E,scorerIds:h,featuredItemId:s,columns:g,onItemClick:x}),!!y&&o.jsx(_Nn,{item:y,baselineId:_,contenderId:E,baselineVersion:u?.datasetVersion,contenderVersion:d?.datasetVersion,onPrevious:k(),onNext:S(),onClose:w})]})]})}function TNn({datasetId:e,itemId:t,onVersionSelect:r,onCompareVersionsClick:n,activeVersion:s}){const{data:a,isLoading:i}=Ive(e,t),[l,c]=b.useState(!1),[u,d]=b.useState(new Set),f=x=>{r?.(x)},h=x=>s==null?x.isLatest:x.datasetVersion===s,p=x=>{d(w=>{const S=new Set(w);if(S.has(x))S.delete(x);else if(S.size>=2){const[k]=Array.from(S);return new Set([k,x])}else S.add(x);return S})},m=()=>{c(!1),d(new Set)},g=()=>{c(!0)},y=()=>{u.size===2&&n?.([...u])};return o.jsxs(gr,{className:"min-w-56",children:[l?o.jsx(gr.Toolbar,{className:"grid justify-stretch gap-3 w-full",children:o.jsxs(ps,{children:[o.jsx(ce,{onClick:m,children:"Cancel"}),o.jsx(Ln,{variant:"primary",disabled:u.size!==2,onClick:y,tooltipContent:u.size!==2?"Check 2 versions to compare":void 0,className:"grow",children:"Compare"})]})}):o.jsx(o.Fragment,{children:(a||[]).length>1&&o.jsx(gr.Toolbar,{children:o.jsxs(ce,{onClick:g,className:"w-full",children:[o.jsx(zm,{})," Compare Ver."]})})}),i?o.jsx(NNn,{}):o.jsxs(Pt,{children:[o.jsx(Pt.Header,{children:o.jsx(Pt.HeaderCol,{children:"Item Version History"})}),o.jsx(Pt.Scroller,{children:o.jsx(Pt.Items,{children:a?.map(x=>{const w=String(x.datasetVersion),S=typeof x.updatedAt=="string"?new Date(x.updatedAt):x.updatedAt;return o.jsxs(Pt.Row,{isSelected:l&&u.has(w),children:[l&&o.jsx(Pt.LabelCell,{children:o.jsx(fi,{checked:u.has(w),disabled:x.isDeleted,onCheckedChange:()=>{},onClick:k=>{k.stopPropagation(),x.isDeleted||p(w)},"aria-label":`Select version ${x.datasetVersion}`})}),o.jsx(Pt.RowButton,{item:x,columns:[{name:"version",label:"Item Version History",size:"1fr"}],isFeatured:h(x),onClick:()=>f(x),className:"py-2",children:o.jsx(Pt.VersionCell,{version:x.datasetVersion,date:S,isLatest:x.isLatest,isDeleted:x.isDeleted})})]},String(x.datasetVersion))})})})]})]})}function NNn(){return o.jsxs(Pt,{children:[o.jsx(Pt.Header,{columns:[{name:"version",label:"Item Version History",size:"1fr"}],children:o.jsx(Pt.HeaderCol,{children:"Item Version History"})}),o.jsx(Pt.Items,{children:Array.from({length:3}).map((e,t)=>o.jsx(Pt.Row,{children:o.jsx(Pt.RowButton,{columns:[{name:"version",label:"Item Version History",size:"1fr"}],children:o.jsx(Pt.TextCell,{isLoading:!0,children:"Loading..."})})},t))})]})}function ANn(e,t){if(t){const r=typeof t=="string"?new Date(t):t;return`v${e} ${tr(r,"MMM dd 'at' H:mm:ss a")}`}return`v${e}`}function INn({datasetId:e,versionA:t,versionB:r,onVersionChange:n}){const{data:s}=Nve(e),a=(s??[]).map(i=>({value:String(i.version),label:`${ANn(i.version,i.createdAt)}${i.isCurrent?" (current)":""}`}));return o.jsxs(gr.Toolbar,{className:"grid grid-cols-[1fr_1fr_1fr_10rem] gap-4 w-full",children:[o.jsx("div",{}),o.jsx($o,{label:"Version A",labelIsHidden:!0,name:"version-a",placeholder:"Select version",options:a,value:t??"",onValueChange:i=>n?.(i,r??"")}),o.jsx($o,{label:"Version B",labelIsHidden:!0,name:"version-b",options:a,value:r??"",onValueChange:i=>n?.(t??"",i)}),o.jsx("div",{})]})}const RNn=[{name:"id",label:"ID",size:"1fr"},{name:"versionA",label:"Version A",size:"1fr"},{name:"versionB",label:"Version B",size:"1fr"},{name:"compare",label:"Compare",size:"10rem"}],PNn={added:{color:"blue",borderColor:"border-blue-900",icon:o.jsx(us,{}),tooltip:"Added in this version"},changed:{color:"orange",borderColor:"border-yellow-900",icon:o.jsx(jVe,{}),tooltip:"Changed in this version"},same:{color:"green",borderColor:"border-green-900",icon:o.jsx(h2t,{}),tooltip:"Same in both versions"}};function sre({red:e=!1,tooltip:t}){return o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(QPt,{className:Y("text-neutral3/40 w-5 h-5 ",{"text-red-900":e})})}),t&&o.jsx(Wr,{children:t})]})}function J0({variant:e,version:t}){if(!e)return o.jsxs("span",{className:"text-ui-md text-neutral4",children:["v. ",t]});const{color:r,icon:n,tooltip:s}=PNn[e];return o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsxs("div",{className:"grid grid-cols-[1fr_auto]",children:[t!==void 0&&o.jsxs("span",{className:"pr-3 text-ui-md text-neutral4 min-w-16 flex justify-end",children:["v. ",t]}),o.jsx(za,{color:r,size:"small",children:n})]})}),o.jsx(Wr,{children:s})]})}function MNn(e,t){return e&&t&&e.datasetVersion===t.datasetVersion?"same":e&&t&&e.datasetVersion!==t.datasetVersion?"changed":e?"added":"removed"}function DNn({datasetId:e,versionA:t,versionB:r,allItems:n,itemsAMap:s,itemsBMap:a}){const{Link:i}=or(),l=t>r;return o.jsx(Pt,{children:o.jsx(Pt.Scroller,{children:o.jsx(Pt.Items,{children:n.map(({id:c})=>{const u=s.get(c),d=a.get(c),f=MNn(u,d);return o.jsxs(Pt.Row,{columns:RNn,children:[o.jsx(Pt.IdCell,{id:c,isShortened:!1}),f!=="same"?o.jsxs(o.Fragment,{children:[u?.datasetVersion?o.jsx(Pt.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}`,className:"gap-2",children:!d&&l?o.jsx(J0,{variant:"added",version:u.datasetVersion}):f==="changed"&&l?o.jsx(J0,{variant:"changed",version:u.datasetVersion}):o.jsx(J0,{version:u.datasetVersion})}):o.jsx(Pt.Cell,{className:"justify-center flex items-center",children:o.jsx(sre,{red:l,tooltip:l?"Deleted in this version":"Not present in this version"})}),d?.datasetVersion?o.jsx(Pt.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}`,className:"gap-2",children:!u&&!l?o.jsx(J0,{variant:"added",version:d.datasetVersion}):f==="changed"&&!l?o.jsx(J0,{variant:"changed",version:d.datasetVersion}):o.jsx(J0,{version:d.datasetVersion})}):o.jsx(Pt.Cell,{className:"justify-center flex items-center",children:o.jsx(sre,{red:!l,tooltip:l?"Not present in this version":"Deleted in this version"})})]}):o.jsx(Pt.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}`,className:"col-span-2 gap-2",children:o.jsx(J0,{variant:"same",version:d?.datasetVersion})}),f==="changed"?o.jsx(Pt.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}/versions?ids=${u?.datasetVersion},${d?.datasetVersion}`,children:"Compare"}):o.jsx(Pt.Cell,{children:o.jsx(sre,{tooltip:o.jsxs(o.Fragment,{children:["Comparing is available",o.jsx("br",{})," only for changed items"]})})})]},c)})})})})}const U8e={needsReview:"#facc15",complete:"#22c55e"},LNn=[{label:"Needs Review",color:U8e.needsReview},{label:"Reviewed",color:U8e.complete}];function $Nn({reviewSummary:e,experiments:t,datasets:r,isLoading:n,isError:s}){const{data:a,maxVal:i,totalInPipeline:l}=b.useMemo(()=>{if(!e?.counts||!t)return{data:[],maxVal:0,totalInPipeline:0};const u=new Map;for(const m of t)u.set(m.id,m);const d=new Map;if(r)for(const m of r)d.set(m.id,m.name);let f=0,h=0;const p=[];for(const m of e.counts){const g=m.needsReview+m.complete;if(g===0)continue;h+=g,g>f&&(f=g);const y=u.get(m.experimentId),x=y?.datasetId?d.get(y.datasetId):void 0,w=x?`${x} · ${m.experimentId.slice(0,8)}`:m.experimentId.slice(0,8);p.push({name:w,values:[m.needsReview,m.complete]})}return{data:p,maxVal:f,totalInPipeline:h}},[e,t,r]),c=a.length>0;return o.jsxs(Wt,{children:[o.jsxs(Wt.TopBar,{children:[o.jsx(Wt.TitleAndDescription,{title:"Review Pipeline",description:"Items in review across experiments."}),c&&o.jsx(Wt.Summary,{value:String(l),label:"Items in pipeline"})]}),n?o.jsx(Wt.Loading,{}):s?o.jsx(Wt.Error,{message:"Failed to load review data"}):o.jsx(Wt.Content,{children:c?o.jsx(K_,{data:a,segments:LNn,maxVal:i,fmt:u=>String(u)}):o.jsx(Wt.NoData,{message:"No items have been sent to review yet"})})]})}function Pve(){const e=Ge();return kt({queryKey:["experiment-review-summary"],queryFn:()=>e.getExperimentReviewSummary()})}function W1t(e){const t=new Map;if(!e?.counts)return t;for(const r of e.counts)t.set(r.experimentId,{needsReview:r.needsReview,complete:r.complete,total:r.total});return t}function FNn(e,t){const r=new Map,n=W1t(e);if(!n.size||!t)return r;for(const s of t){const a=n.get(s.id);if(!a||!s.datasetId||a.needsReview+a.complete===0)continue;const l=r.get(s.datasetId)??{needsReview:0,complete:0};l.needsReview+=a.needsReview,l.complete+=a.complete,r.set(s.datasetId,l)}return r}function zNn(e){return e?.counts?e.counts.reduce((t,r)=>({needsReview:t.needsReview+r.needsReview,complete:t.complete+r.complete,inPipeline:t.inPipeline+r.needsReview+r.complete}),{needsReview:0,complete:0,inPipeline:0}):{needsReview:0,complete:0,inPipeline:0}}const BNn=10;function UNn(){const[e,t]=b.useState(!1),[r,n]=b.useState(""),[s,a]=b.useState("all"),[i,l]=b.useState("all"),[c,u]=b.useState("all"),[d,f]=b.useState(0),{data:h,isLoading:p,error:m}=Lh({page:d,perPage:BNn}),{data:g,isLoading:y,error:x}=r8(),{data:w}=Pve(),S=b.useMemo(()=>h?.datasets??[],[h?.datasets]),k=h?.pagination?.hasMore??!1,_=b.useMemo(()=>g?.experiments??[],[g?.experiments]),E=b.useMemo(()=>oTn(S),[S]),T=b.useMemo(()=>FNn(w,_),[w,_]),j=p||y,N=m||x,I=()=>t(!0),P=b.useCallback(()=>f(Q=>Q+1),[]),R=b.useCallback(()=>f(Q=>Math.max(0,Q-1)),[]),B=b.useCallback(Q=>{n(Q),f(0)},[]),D=b.useCallback(Q=>{a(Q),f(0)},[]),$=b.useCallback(Q=>{l(Q),f(0)},[]),U=b.useCallback(Q=>{u(Q),f(0)},[]);if(N&&Ps(N))return o.jsx(Jr,{title:"Datasets",icon:o.jsx(Na,{}),children:o.jsx(sa,{})});if(N&&Os(N))return o.jsx(Jr,{title:"Datasets",icon:o.jsx(Na,{}),children:o.jsx(Zs,{resource:"datasets"})});if(N)return o.jsx(Jr,{title:"Datasets",icon:o.jsx(Na,{}),children:o.jsx(pu,{title:"Failed to load datasets",message:N.message})});if(S.length===0&&!j&&d===0)return o.jsxs(o.Fragment,{children:[o.jsx(Jr,{title:"Datasets",icon:o.jsx(Na,{}),children:o.jsx(lTn,{onCreateClick:I})}),o.jsx(Rle,{open:e,onOpenChange:t})]});const z=s!=="all"||i!=="all"||c!=="all"||r!=="",H=()=>{n(""),a("all"),l("all"),u("all"),f(0)};return o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:j,children:[o.jsx(Na,{})," Datasets"]})})}),o.jsxs(bt.Column,{className:"flex justify-end gap-2",children:[o.jsx(Ln,{onClick:I,tooltipContent:"Create a dataset",children:o.jsx(us,{})}),o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/evals/datasets/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Datasets documentation",children:o.jsx(Li,{})})]})]}),o.jsx(uTn,{search:r,onSearchChange:B,targetFilter:s,onTargetFilterChange:D,experimentFilter:i,onExperimentFilterChange:$,tagFilter:c,onTagFilterChange:U,tagOptions:E,onReset:H,hasActiveFilters:z})]}),o.jsx(sTn,{datasets:S,experiments:_,reviewByDataset:T,isLoading:j,search:r,targetFilter:s,experimentFilter:i,tagFilter:c,currentPage:d,hasMore:k,onNextPage:P,onPrevPage:R}),o.jsx(Rle,{open:e,onOpenChange:t})]})}const VNn=new Set(["items","experiments","review"]);function qNn(){const{datasetId:e}=na(),t=uu(),[r,n]=ao(),s=r.get("tab"),a=s&&VNn.has(s)?s:"items",i=E=>{n(E==="items"?{}:{tab:E},{replace:!0})},[l,c]=b.useState(!1),[u,d]=b.useState(!1),[f,h]=b.useState(!1),[p,m]=b.useState(!1),[g,y]=b.useState(null),{data:x,error:w}=Tg(e??"");if(!e)return o.jsx(zr,{children:o.jsx(df,{children:o.jsx("div",{className:"text-neutral3 p-4",children:"Dataset not found"})})});if(w&&Ps(w))return o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(sa,{})})});if(w&&Os(w))return o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})});const S=E=>{t(`/datasets/${e}/experiments/${E}`)},k=()=>{t("/datasets")},_=E=>{y(E?.version??null)};return o.jsxs(zr,{children:[o.jsx(Cn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(gTn,{value:e,variant:"ghost"})})]})}),o.jsxs(df,{className:"content-stretch",children:[o.jsx(eNn,{datasetId:e,onAddItemClick:()=>d(!0),onEditClick:()=>h(!0),onDeleteClick:()=>m(!0),activeDatasetVersion:g,onVersionSelect:_,initialTab:a,onTabChange:i,experimentTriggerSlot:o.jsxs(ce,{variant:"primary",onClick:()=>c(!0),children:[o.jsx(ux,{}),g!=null?`Run on v${g}`:"Run Experiment"]})}),o.jsx(iNn,{datasetId:e,version:g??void 0,open:l,onOpenChange:c,onSuccess:S}),o.jsx(rNn,{datasetId:e,open:u,onOpenChange:d}),x&&o.jsx(pTn,{open:f,onOpenChange:h,dataset:{id:x.id,name:x.name,description:x?.description||"",inputSchema:x.inputSchema,groundTruthSchema:x.groundTruthSchema}}),x&&o.jsx(mTn,{open:p,onOpenChange:m,datasetId:x.id,datasetName:x.name,onSuccess:k})]})]})}function HNn(){const{datasetId:e,experimentId:t}=na(),{data:r}=Tg(e??""),{data:n,isLoading:s,error:a}=G6(e,t),{data:i,isLoading:l,setEndOfListElement:c,isFetchingNextPage:u,hasNextPage:d}=t8({datasetId:e,experimentId:t,experimentStatus:n?.status});return!e||!t?null:s?o.jsx(zr,{children:o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx(Dt,{})})}):a&&Ps(a)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(sa,{})})}):a&&Os(a)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):a||!n?o.jsx(zr,{children:o.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",a instanceof Error?a.message:"Unknown error"]})}):o.jsxs(zr,{children:[o.jsx(Cn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:fr,to:`/datasets/${e}`,children:r?.name}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Experiment"})]})}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:"grid gap-1 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[o.jsx(Q1t,{experimentId:t,experiment:n}),o.jsx(H1t,{experimentId:t,experimentStatus:n?.status,results:i??[],isLoading:l,setEndOfListElement:c,isFetchingNextPage:u,hasNextPage:d})]})})]})}function QNn(){const{datasetId:e}=na(),[t,r]=ao(),{data:n,error:s}=Tg(e??""),a=t.get("baseline")??"",i=t.get("contender")??"";return s&&Ps(s)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(sa,{})})}):s&&Os(s)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):!e||!a||!i?o.jsxs(zr,{children:[o.jsx(Cn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsxs(jr,{isCurrent:!0,as:"span",children:[o.jsx(Ce,{children:o.jsx(zm,{})}),"Compare Experiments"]})]})}),o.jsx(df,{children:o.jsxs("div",{className:"text-neutral4 text-center py-8",children:[o.jsx("p",{children:"Select two experiments to compare."}),o.jsxs("p",{className:"text-sm mt-2",children:["Use the URL format: /datasets/","{datasetId}","/experiments?baseline=","{experimentIdA}","&contender=","{experimentIdB}"]})]})})]}):o.jsxs(zr,{children:[o.jsx(Cn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:fr,to:`/datasets/${e}`,children:n?.name??e?.slice(0,8)}),o.jsxs(jr,{isCurrent:!0,as:"span",children:[o.jsx(Ce,{children:o.jsx(zm,{})}),"Experiments Comparison"]})]})}),o.jsx(df,{children:o.jsxs("div",{className:"max-w-[100rem] w-full px-12 mx-auto grid content-start ",children:[o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(zm,{})," Dataset Experiments Comparison"]}),o.jsxs(Ir.Description,{children:["Comparing"," ",o.jsx(fr,{to:`/datasets/${e}/experiments/${a}`,children:a.slice(0,8)})," vs"," ",o.jsx(fr,{to:`/datasets/${e}/experiments/${i}`,children:i.slice(0,8)})]})]}),o.jsx(Ir.Column,{children:o.jsxs(ce,{as:fr,to:`/datasets/${e}`,children:[o.jsx(wp,{}),"Back to Dataset"]})})]}),o.jsx(jNn,{datasetId:e,experimentIdA:a,experimentIdB:i,onSwap:()=>{r({baseline:i,contender:a})}})]})})]})}function WNn(){const{datasetId:e,itemId:t}=na(),{Link:r}=or(),n=uu(),{data:s,isLoading:a,error:i}=Ive(e??"",t??""),{updateItem:l,deleteItem:c}=ni(),{data:u}=Tg(e??""),d=s?.[0]??null,f=d?.isDeleted??!1,[h,p]=b.useState(null),m=b.useMemo(()=>!d||f?{input:"",groundTruth:"",metadata:""}:{input:JSON.stringify(d.input,null,2),groundTruth:d.groundTruth?JSON.stringify(d.groundTruth,null,2):"",metadata:d.metadata?JSON.stringify(d.metadata,null,2):""},[d,f]),g=d?.datasetVersion??0,[y,x]=b.useState(!1),[w,S]=b.useState(m.input),[k,_]=b.useState(m.groundTruth),[E,T]=b.useState(m.metadata),[j,N]=b.useState(g);g!==j&&(N(g),S(m.input),_(m.groundTruth),T(m.metadata));const[I,P]=b.useState(!1),R=V=>{p(f?V:V.isLatest?null:V)},B=()=>{p(null)},D=!f&&h!=null,$=()=>{D||x(!0)},U=()=>{D||P(!0)},z=async()=>{if(!e||!t)return;let V;try{V=JSON.parse(w)}catch{ze.error("Input must be valid JSON");return}let M;if(k.trim())try{M=JSON.parse(k)}catch{ze.error("Ground Truth must be valid JSON");return}let W;if(E.trim())try{W=JSON.parse(E)}catch{ze.error("Metadata must be valid JSON");return}try{await l.mutateAsync({datasetId:e,itemId:t,input:V,groundTruth:M,metadata:W}),ze.success("Item updated successfully"),x(!1)}catch(G){ze.error(`Failed to update item: ${G instanceof Error?G.message:"Unknown error"}`)}},H=()=>{d&&(S(JSON.stringify(d.input,null,2)),_(d.groundTruth?JSON.stringify(d.groundTruth,null,2):""),T(d.metadata?JSON.stringify(d.metadata,null,2):"")),x(!1)},Q=async()=>{if(!(!e||!t))try{await c.mutateAsync({datasetId:e,itemId:t}),ze.success("Item deleted successfully"),P(!1),n(`/datasets/${e}`)}catch(V){ze.error(`Failed to delete item: ${V instanceof Error?V.message:"Unknown error"}`)}},L=h??d,Z=L?{id:t??"",datasetId:e??"",datasetVersion:L.datasetVersion,input:L.input,groundTruth:L.groundTruth,metadata:L.metadata,createdAt:L.createdAt,updatedAt:L.updatedAt}:null;return i&&Ps(i)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(sa,{})})}):i&&Os(i)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):a?null:!e||!t||!s||s.length===0?o.jsx(zr,{children:o.jsx(df,{children:o.jsx("div",{className:"text-neutral3 p-4",children:"Item not found"})})}):o.jsxs(o.Fragment,{children:[o.jsxs(zr,{children:[o.jsx(Cn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:fr,to:`/datasets/${e}`,children:u?.name}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Item"})]})}),o.jsx("div",{className:"h-full overflow-hidden px-6 pb-4",children:o.jsxs("div",{className:"grid gap-6 max-w-[60rem] mx-auto grid-rows-[auto_1fr] h-full",children:[o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(lx,{}),t," ",o.jsx(ta,{content:t})]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:["Item of ",o.jsx(Na,{})," ",u?.name]})}),o.jsxs(Ir.Description,{children:[o.jsxs(Zn,{children:[o.jsx(h_,{})," Created at"," ",d?.createdAt?tr(new Date(d.createdAt),"MMM d, yyyy"):""]}),o.jsxs(Zn,{children:[o.jsx(Vx,{})," Latest version v",d?.datasetVersion??""]})]})]}),o.jsx(Ir.Column,{children:!y&&!f&&o.jsxs(ps,{children:[o.jsxs(ce,{onClick:$,disabled:D,title:D?"Return to latest version to edit":void 0,children:[o.jsx(jVe,{})," Edit"]}),o.jsxs(ce,{onClick:U,disabled:D,title:D?"Return to latest version to delete":void 0,children:[o.jsx(ed,{})," Delete"]})]})})]}),o.jsxs(tf,{className:y?"grid-cols-1":"grid-cols-[1fr_auto]",children:[o.jsxs(gr,{withRightSeparator:!y,children:[f&&d&&o.jsx(cn,{variant:"destructive",title:"Item deleted",children:o.jsxs(cn.Message,{children:["This item was deleted at version v",d.datasetVersion]})}),!f&&D&&h&&o.jsx(cn,{variant:"warning",title:"Previous version",action:o.jsxs(cn.Button,{onClick:B,children:[o.jsx(fw,{})," Return to the latest version"]}),children:o.jsxs(cn.Message,{children:["Viewing version v",h.datasetVersion]})}),y?o.jsx($1t,{inputValue:w,setInputValue:S,groundTruthValue:k,setGroundTruthValue:_,metadataValue:E,setMetadataValue:T,validationErrors:null,onSave:z,onCancel:H,isSaving:l.isPending}):Z?o.jsx(n8,{item:Z,Link:r}):o.jsx("div",{className:"text-neutral4 text-sm",children:"Item data not available"})]}),!y&&o.jsx(gr,{children:o.jsx(TNn,{datasetId:e,itemId:t,onClose:()=>{},onVersionSelect:R,onCompareVersionsClick:V=>{n(`/datasets/${e}/items/${t}/versions?ids=${V.join(",")}`)},activeVersion:h?.datasetVersion??null})})]})]})})]}),o.jsx($t,{open:I,onOpenChange:P,children:o.jsxs($t.Content,{children:[o.jsxs($t.Header,{children:[o.jsx($t.Title,{children:"Delete Item"}),o.jsx($t.Description,{children:"Are you sure you want to delete this item? This action cannot be undone."})]}),o.jsxs($t.Footer,{children:[o.jsx($t.Cancel,{children:"Cancel"}),o.jsx($t.Action,{onClick:Q,children:c.isPending?"Deleting...":"Delete"})]})]})})]})}function V8e(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function GNn(){const{datasetId:e}=na(),[t,r]=ao(),n=t.get("items")?.split(",").filter(Boolean)??[],{data:s,error:a}=Tg(e??""),{Link:i}=or(),[l,c]=b.useState(!1),{data:u}=Nle(e??"",n[0]??""),{data:d}=Nle(e??"",n[1]??"");return a&&Ps(a)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(sa,{})})}):a&&Os(a)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):!e||n.length<2?o.jsxs(zr,{children:[o.jsx(Cn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Items"})]})}),o.jsx(df,{children:o.jsx("div",{className:"text-neutral4 text-center py-8",children:o.jsx("p",{children:"Select at least two items to compare."})})})]}):o.jsxs(zr,{children:[o.jsxs(Cn,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:fr,to:`/datasets/${e}`,children:s?.name||e?.slice(0,8)}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Items"})]}),o.jsx(fu,{children:o.jsxs(ce,{as:fr,to:`/datasets/${e}`,variant:"outline",children:[o.jsx(Ce,{children:o.jsx(wp,{})}),"Back to Dataset"]})})]}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:Y("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":l}),children:[o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(zm,{}),"Compare Dataset Items"]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:["Comparing ",n.length," items of"," ",o.jsx(fr,{to:`/datasets/${e}`,className:"text-info1 hover:underline",children:s?.name||e?.slice(0,8)})]})})]}),o.jsx(Ir.Column,{children:o.jsxs(ps,{children:[o.jsxs(ce,{as:fr,to:`/datasets/${e}`,children:[o.jsx(wp,{}),"Back to Dataset"]}),o.jsx(ce,{variant:"primary",onClick:()=>c(f=>!f),children:l?o.jsxs(o.Fragment,{children:[o.jsx(gVe,{})," Default View"]}):o.jsxs(o.Fragment,{children:[o.jsx(a2t,{})," Diff View"]})})]})})]}),o.jsx(tf,{className:"grid-cols-[1fr_3vw_1fr]",children:n.map((f,h)=>o.jsxs(b.Fragment,{children:[o.jsx(ZNn,{datasetId:e,itemId:f,Link:i,idx:h,itemIds:n,showContent:!l,onItemChange:p=>{const m=[...n];m[h]=p,r({items:m.join(",")})}}),h==0&&o.jsx("div",{className:Y("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},f))}),l&&u&&d&&o.jsx(Fft,{codeA:V8e(u),codeB:V8e(d)})]})})]})}function ZNn({datasetId:e,itemId:t,Link:r,idx:n,itemIds:s,onItemChange:a,showContent:i=!0}){const{data:l,isLoading:c}=Nle(e,t),{data:u}=OE(e),d=new Set(s.filter((h,p)=>p!==n)),f=(u??[]).map(h=>({value:h.id,label:h.id,disabled:d.has(h.id)}));return o.jsxs(gr,{children:[o.jsxs(gr.Toolbar,{className:"flex gap-4",children:[o.jsx(sge,{label:"Item",name:`compare-item-${n}`,value:t,onValueChange:a,options:f,placeholder:"Select item",labelIsHidden:!0}),o.jsxs(ce,{as:r,to:`/datasets/${e}/items/${t}`,children:[o.jsx(Vx,{}),"Versions"]})]}),i&&o.jsx(gr.Content,{children:c?o.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):l?o.jsxs(o.Fragment,{children:[o.jsx(F1t,{item:l}),o.jsx(n8,{item:l,Link:r})]}):o.jsxs("div",{className:"text-neutral4 text-sm",children:["Item ",t.slice(0,8)," not found"]})})]})}function q8e(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function YNn(){const{datasetId:e,itemId:t}=na(),[r,n]=ao(),[s,a]=b.useState(!1),i=r.get("ids")?.split(",").map(Number).filter(p=>!isNaN(p)&&p>0)??[],{data:l,error:c}=Tg(e??""),{Link:u}=or(),{data:d}=Ive(e??"",t??""),{data:f}=Mle(e??"",t??"",i[0]??0,l?.version),{data:h}=Mle(e??"",t??"",i[1]??0,l?.version);return c&&Ps(c)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(sa,{})})}):c&&Os(c)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):!e||!t||i.length<2?o.jsxs(zr,{children:[o.jsx(Cn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),o.jsx(df,{children:o.jsx("div",{className:"text-neutral4 text-center py-8",children:o.jsx("p",{children:"Select at least two versions to compare."})})})]}):o.jsxs(zr,{children:[o.jsxs(Cn,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:fr,to:`/datasets/${e}`,children:l?.name}),o.jsx(jr,{as:fr,to:`/datasets/${e}/items/${t}`,children:"Item"}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Versions"})]}),o.jsx(fu,{children:o.jsxs(ce,{as:fr,to:`/datasets/${e}/items/${t}`,variant:"outline",children:[o.jsx(Ce,{children:o.jsx(wp,{})}),"Back to Item"]})})]}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:Y("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":s}),children:[o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(zm,{}),"Compare Dataset Item Versions"]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:["Comparing ",i.length," versions of"," ",o.jsx(fr,{to:`/datasets/${e}/items/${t}`,className:"text-info1 hover:underline",children:t})]})})]}),o.jsx(Ir.Column,{children:o.jsxs(ps,{children:[o.jsxs(ce,{as:fr,to:`/datasets/${e}/items/${t}`,children:[o.jsx(wp,{}),"Back to Item"]}),o.jsx(ce,{variant:"primary",onClick:()=>a(p=>!p),children:s?o.jsxs(o.Fragment,{children:[o.jsx(gVe,{})," Default View"]}):o.jsxs(o.Fragment,{children:[o.jsx(U2t,{})," Diff View"]})})]})})]}),o.jsx(tf,{className:"grid-cols-[1fr_3vw_1fr]",children:i.map((p,m)=>o.jsxs(b.Fragment,{children:[o.jsx(XNn,{datasetId:e,itemId:t,datasetVersion:p,latestVersion:l?.version,allVersions:d??[],versionNumbers:i,Link:u,idx:m,showContent:!s,onVersionChange:g=>{const y=[...i];y[m]=g,n({ids:y.join(",")})}}),m===0&&o.jsx("div",{className:Y("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},p))}),s&&f&&h&&o.jsx(Fft,{codeA:q8e(f),codeB:q8e(h)})]})})]})}function XNn({datasetId:e,itemId:t,datasetVersion:r,latestVersion:n,allVersions:s,versionNumbers:a,Link:i,idx:l,showContent:c=!0,onVersionChange:u}){const{data:d,isLoading:f}=Mle(e,t,r,n),h=new Set(a.filter((g,y)=>y!==l)),p=s.map(g=>{const y=typeof g.updatedAt=="string"?new Date(g.updatedAt):g.updatedAt;return{value:String(g.datasetVersion),label:o.jsxs(o.Fragment,{children:[o.jsxs("b",{children:["v. ",g.datasetVersion]})," - ",tr(y,"MMM d, yyyy h:mm a"),g.isLatest?o.jsx(za,{color:"blue",size:"small",children:"Latest"}):null]}),disabled:h.has(g.datasetVersion)}}),m=d?{id:d.id,datasetId:e,datasetVersion:d.datasetVersion,input:d.input,groundTruth:d.groundTruth,metadata:d.metadata,createdAt:d.createdAt,updatedAt:d.updatedAt}:null;return o.jsxs(gr,{children:[o.jsxs(gr.Toolbar,{className:"grid gap-4 grid-cols-[auto_1fr]",children:[o.jsx(Vx,{className:"w-6 h-6 opacity-50"}),o.jsx(sge,{label:"Version",name:`compare-version-${l}`,value:String(r),onValueChange:g=>u(Number(g)),options:p,placeholder:"Select version",labelIsHidden:!0,className:"w-full"})]}),c&&o.jsx(gr.Content,{children:f?o.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):!d||!m?o.jsxs("div",{className:"text-neutral4 text-sm",children:["Version ",r," not found"]}):o.jsx(n8,{item:m,Link:i})})]})}function KNn(){const{datasetId:e}=na(),[t]=ao(),r=t.get("ids")?.split(",").map(Number).filter(g=>!isNaN(g)&&g>0)??[],n=uu(),{data:s,error:a}=Tg(e??""),i=OE(e??"",void 0,r[0]??null),l=OE(e??"",void 0,r[1]??null),c=b.useMemo(()=>i.data??[],[i.data]),u=b.useMemo(()=>l.data??[],[l.data]),d=b.useMemo(()=>{const g=new Map;for(const y of[...c,...u])g.has(y.id)||g.set(y.id,{id:y.id,createdAt:new Date(y.createdAt)});return[...g.values()].sort((y,x)=>x.createdAt.getTime()-y.createdAt.getTime())},[c,u]),f=b.useMemo(()=>new Map(c.map(g=>[g.id,g])),[c]),h=b.useMemo(()=>new Map(u.map(g=>[g.id,g])),[u]);if(a&&Ps(a))return o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(sa,{})})});if(a&&Os(a))return o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})});if(!e||r.length<2)return o.jsxs(zr,{children:[o.jsx(Cn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),o.jsx(df,{children:o.jsx("div",{className:"text-neutral4 text-center py-8",children:o.jsx("p",{children:"Select at least two versions to compare."})})})]});const p=(g,y,x)=>{n(`/datasets/${e}/items/${g}/versions?ids=${y?.datasetVersion??""},${x?.datasetVersion??""}`)},m=(g,y)=>{n(`/datasets/${e}/versions?ids=${g},${y}`,{replace:!0})};return o.jsxs(zr,{children:[o.jsx(Cn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:fr,to:`/datasets/${e}`,children:s?.name||e?.slice(0,8)}),o.jsxs(jr,{isCurrent:!0,as:"span",children:[o.jsx(Ce,{children:o.jsx(gSe,{})}),"Compare Versions"]})]})}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:"grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(gSe,{})," Compare Dataset Versions"]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:[o.jsx(Vx,{})," Comparing ",r.length," versions of"," ",s?.name||e?.slice(0,8)]})})]}),o.jsx(Ir.Column,{children:o.jsxs(ce,{as:fr,to:`/datasets/${e}`,children:[o.jsx(wp,{}),"Back to Dataset"]})})]}),o.jsx(tf,{children:o.jsxs(gr,{children:[o.jsx(INn,{datasetId:e,versionA:String(r[0]),versionB:String(r[1]),onVersionChange:m}),o.jsx(DNn,{datasetId:e,versionA:r[0],versionB:r[1],allItems:d,itemsAMap:f,itemsBMap:h,onItemClick:p})]})})]})})]})}function JNn(e){if(!e||e.length<2)return null;const t=[...e].sort((i,l)=>new Date(i.createdAt).getTime()-new Date(l.createdAt).getTime()),r=Math.floor(t.length/2),n=r,s=t.length-r;if(n===0)return null;const a=(s-n)/n*100;return{changePct:Math.round(a*10)/10,prevValue:String(n)}}function eAn({scorers:e,datasets:t,experiments:r,avgScore:n,prevAvgScore:s,totalNeedsReview:a,isLoadingScorers:i,isLoadingDatasets:l,isLoadingExperiments:c,isLoadingScores:u,isLoadingReview:d}){const f=e?Object.keys(e).length:void 0,h=t?.length,p=r?.length,m=n!=null&&s!=null&&s!==0?{changePct:Math.round((n-s)/s*100*10)/10,prevValue:String(s)}:null,g=JNn(r);return o.jsxs(o.Fragment,{children:[o.jsxs(En,{children:[o.jsx(En.Label,{children:"Total Scorers"}),i?o.jsx(En.Loading,{}):f!=null?o.jsxs(o.Fragment,{children:[o.jsx(En.Value,{children:String(f)}),o.jsx(En.NoChange,{message:"Static count"})]}):o.jsx(En.NoData,{})]}),o.jsxs(En,{children:[o.jsx(En.Label,{children:"Total Datasets"}),l?o.jsx(En.Loading,{}):h!=null?o.jsxs(o.Fragment,{children:[o.jsx(En.Value,{children:String(h)}),o.jsx(En.NoChange,{message:"Static count"})]}):o.jsx(En.NoData,{})]}),o.jsxs(En,{children:[o.jsx(En.Label,{children:"Avg Score"}),u?o.jsx(En.Loading,{}):n!=null?o.jsxs(o.Fragment,{children:[o.jsx(En.Value,{children:String(n)}),m?o.jsx(En.Change,{changePct:m.changePct,prevValue:m.prevValue}):o.jsx(En.NoChange,{})]}):o.jsx(En.NoData,{})]}),o.jsxs(En,{children:[o.jsx(En.Label,{children:"Total Experiments"}),c?o.jsx(En.Loading,{}):p!=null?o.jsxs(o.Fragment,{children:[o.jsx(En.Value,{children:String(p)}),g?o.jsx(En.Change,{changePct:g.changePct,prevValue:g.prevValue}):o.jsx(En.NoChange,{})]}):o.jsx(En.NoData,{})]}),o.jsxs(En,{children:[o.jsx(En.Label,{children:"Needs Review"}),d?o.jsx(En.Loading,{}):a!=null?o.jsxs(o.Fragment,{children:[o.jsx(En.Value,{children:String(a)}),a>0?o.jsx(En.NoChange,{message:"items pending review"}):o.jsx(En.NoChange,{message:"All caught up"})]}):o.jsx(En.NoData,{})]})]})}const tAn=[{value:"all",label:"All statuses"},{value:"completed",label:"Completed"},{value:"running",label:"Running"},{value:"failed",label:"Failed"},{value:"pending",label:"Pending"}],H8e="auto 1fr auto auto auto auto auto auto auto";function rAn(e){return e?(typeof e=="string"?new Date(e):e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}const nAn={completed:"success",running:"warning",failed:"error",pending:"neutral"};function sAn({experiments:e,datasets:t,reviewByExperiment:r,isLoading:n,search:s="",statusFilter:a="all",datasetFilter:i="all"}){const{paths:l,Link:c}=or(),u=b.useMemo(()=>{const h=new Map;return t?.forEach(p=>h.set(p.id,p.name)),h},[t]),d=b.useMemo(()=>[...e].sort((h,p)=>{const m=h.createdAt?new Date(h.createdAt).getTime():0;return(p.createdAt?new Date(p.createdAt).getTime():0)-m}),[e]),f=b.useMemo(()=>{const h=s.toLowerCase();return d.filter(p=>{const m=p.datasetId?u.get(p.datasetId)??"":"",g=!h||p.id.toLowerCase().includes(h)||m.toLowerCase().includes(h)||(p.targetId??"").toLowerCase().includes(h),y=a==="all"||p.status===a,x=i==="all"||p.datasetId===i;return g&&y&&x})},[d,s,u,a,i]);return n?o.jsx(yh,{columns:H8e}):o.jsxs(Se,{columns:H8e,children:[o.jsxs(Se.Top,{children:[o.jsx(Se.TopCell,{children:"Experiment"}),o.jsx(Se.TopCell,{children:"Dataset"}),o.jsx(Se.TopCell,{children:"Target"}),o.jsx(Se.TopCell,{children:"Status"}),o.jsx(Se.TopCell,{className:"text-center",children:"Items"}),o.jsx(Se.TopCell,{className:"text-center",children:"Succeeded"}),o.jsx(Se.TopCell,{className:"text-center",children:"Failed"}),o.jsx(Se.TopCell,{className:"text-center",children:"Review"}),o.jsx(Se.TopCell,{children:"Date"})]}),f.map(h=>{const p=h.datasetId?u.get(h.datasetId)??h.datasetId.slice(0,8):"—",m=h.status??"pending",g=h.succeededCount??0,y=h.failedCount??0,x=h.totalItems??0,w=x>0?Math.round(g/x*100):0;return o.jsxs(Se.RowLink,{to:l.experimentLink(h.id),LinkComponent:c,children:[o.jsx(Se.NameCell,{className:"font-mono",children:h.id.slice(0,8)}),o.jsx(Se.TextCell,{children:p}),o.jsx(Se.Cell,{children:o.jsxs("span",{className:"truncate",children:[h.targetType," ",h.targetId]})}),o.jsx(Se.Cell,{children:o.jsx(DP,{variant:nAn[m]??"neutral",withDot:!0,children:m})}),o.jsx(Se.TextCell,{className:"text-center",children:x}),o.jsx(Se.TextCell,{className:"text-center",children:o.jsxs("span",{className:g>0?"text-accent1":"",children:[g," (",w,"%)"]})}),o.jsx(Se.TextCell,{className:"text-center",children:o.jsx("span",{className:y>0?"text-accent2":"",children:y})}),o.jsx(Se.Cell,{className:"text-center",children:(()=>{const S=r?.get(h.id);if(!S)return o.jsx("span",{className:"text-neutral2",children:"—"});const k=S.needsReview+S.complete;return k===0?o.jsx("span",{className:"text-neutral2",children:"—"}):S.needsReview>0?o.jsxs(vt,{variant:"warning",children:[S.needsReview," pending"]}):o.jsxs(vt,{variant:"success",children:[S.complete,"/",k," reviewed"]})})()}),o.jsx(Se.TextCell,{children:rAn(h.createdAt)})]},h.id)})]})}function aAn(e){return[{value:"all",label:"All datasets"},...(e??[]).map(t=>({value:t.id,label:t.name}))]}const BL={completed:"#22c55e",running:"#facc15",pending:"#fb923c",failed:"#f87171"},iAn=[{label:"Completed",color:BL.completed},{label:"Running",color:BL.running},{label:"Pending",color:BL.pending},{label:"Failed",color:BL.failed}];function oAn({experiments:e,datasets:t,isLoading:r,isError:n}){const{data:s,maxVal:a}=b.useMemo(()=>{if(!e||e.length===0)return{data:[],maxVal:0};const l=new Map;if(t)for(const f of t)l.set(f.id,f.name);const c=new Map;for(const f of e){const h=f.datasetId??"unknown";c.has(h)||c.set(h,{completed:0,running:0,pending:0,failed:0});const p=c.get(h),m=f.status;m in p&&p[m]++}let u=0;return{data:Array.from(c.entries()).map(([f,h])=>{const p=h.completed+h.running+h.pending+h.failed;return p>u&&(u=p),{name:l.get(f)??f.slice(0,12),values:[h.completed,h.running,h.pending,h.failed]}}),maxVal:u}},[e,t]),i=s.length>0;return o.jsxs(Wt,{children:[o.jsxs(Wt.TopBar,{children:[o.jsx(Wt.TitleAndDescription,{title:"Experiments by Dataset",description:"Experiment status breakdown per dataset."}),i&&o.jsx(Wt.Summary,{value:String(e?.length??0),label:"Total experiments"})]}),r?o.jsx(Wt.Loading,{}):n?o.jsx(Wt.Error,{message:"Failed to load experiments data"}):o.jsx(Wt.Content,{children:i?o.jsx(K_,{data:s,segments:iAn,maxVal:a,fmt:l=>String(l)}):o.jsx(Wt.NoData,{message:"No experiments have been run yet"})})]})}const lAn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(yf,{}),titleSlot:"No Experiments yet",descriptionSlot:o.jsxs(o.Fragment,{children:["Run an experiment from a dataset to evaluate ",o.jsx("br",{}),"your agents and workflows."]}),actionSlot:o.jsx("div",{className:"flex flex-col items-center gap-2",children:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/evals/datasets/running-experiments",target:"_blank",rel:"noopener noreferrer",children:["Experiments Documentation ",o.jsx(ba,{})]})})})});function cAn({search:e,onSearchChange:t,statusFilter:r,onStatusFilterChange:n,datasetFilter:s,onDatasetFilterChange:a,datasetOptions:i,onReset:l,hasActiveFilters:c}){return o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(Sg,{label:"Search experiments",placeholder:"Filter by experiment, dataset, or target",value:e,onSearch:t}),o.jsxs(ps,{children:[o.jsx($o,{label:"Status",labelIsHidden:!0,name:"filter-status",options:[...tAn],value:r,onValueChange:n,className:"whitespace-nowrap"}),o.jsx($o,{label:"Dataset",labelIsHidden:!0,name:"filter-dataset",options:i,value:s,onValueChange:a,className:"whitespace-nowrap"}),l&&c&&o.jsxs(ce,{onClick:l,size:"sm",variant:"default",children:[o.jsx(Nn,{className:"size-3"})," Reset"]})]})]})}function uAn(){const{data:e,isLoading:t,error:r}=cd(),{data:n,isLoading:s,error:a}=Lh(),{data:i,isLoading:l,error:c}=r8(),{data:u,isLoading:d,isError:f,error:h}=mOn(),{data:p,isLoading:m,isError:g,error:y}=Pve(),x=n?.datasets,w=i?.experiments,S=b.useMemo(()=>zNn(p),[p]),k=r||a||c||h||y;return k&&Ps(k)?o.jsx(Jr,{title:"Evaluation",icon:o.jsx(Tu,{}),children:o.jsx(sa,{})}):k&&Os(k)?o.jsx(Jr,{title:"Evaluation",icon:o.jsx(Tu,{}),children:o.jsx(Zs,{resource:"evaluation"})}):k?o.jsx(Jr,{title:"Evaluation",icon:o.jsx(Tu,{}),children:o.jsx(pu,{title:"Failed to load evaluation data",message:k.message})}):o.jsxs(bt,{width:"wide",height:"full",children:[o.jsx(bt.TopArea,{className:"sticky top-0 z-100 bg-surface1 ",children:o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{children:[o.jsx(Tu,{})," Evaluation"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/evals/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Evaluation documentation",children:o.jsx(Li,{})})})]})}),o.jsxs("div",{className:"flex flex-col gap-6 pt-4",children:[o.jsx(pie,{children:o.jsx(eAn,{scorers:e,datasets:x,experiments:w,avgScore:u?.avgScore??null,prevAvgScore:u?.prevAvgScore??null,totalNeedsReview:S.needsReview,isLoadingScorers:t,isLoadingDatasets:s,isLoadingExperiments:l,isLoadingScores:d,isLoadingReview:m})}),o.jsx(sOn,{summaryData:u?.summaryData??[],overTimeData:u?.overTimeData??[],scorerNames:u?.scorerNames??[],avgScore:u?.avgScore??null,isLoading:d,isError:f}),o.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2",children:[o.jsx(cTn,{experiments:w,isLoading:l,isError:!!c}),o.jsx(oAn,{experiments:w,datasets:x,isLoading:l,isError:!!c})]}),o.jsx($Nn,{reviewSummary:p,experiments:w,datasets:x,isLoading:m,isError:!!g})]})]})}function dAn(){const[e,t]=b.useState(""),[r,n]=b.useState("all"),[s,a]=b.useState("all"),{data:i,isLoading:l,error:c}=Lh(),{data:u,isLoading:d,error:f}=r8(),{data:h}=Pve(),p=b.useMemo(()=>i?.datasets??[],[i?.datasets]),m=b.useMemo(()=>u?.experiments??[],[u?.experiments]),g=b.useMemo(()=>aAn(p),[p]),y=b.useMemo(()=>W1t(h),[h]),x=l||d,w=f||c;if(w&&Ps(w))return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Tu,{}),children:o.jsx(sa,{})});if(f&&Os(f))return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Tu,{}),children:o.jsx(Zs,{resource:"experiments"})});if(c&&Os(c))return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Tu,{}),children:o.jsx(Zs,{resource:"datasets"})});if(w)return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Tu,{}),children:o.jsx(pu,{title:"Failed to load experiments",message:w.message})});if(m.length===0&&!x)return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Tu,{}),children:o.jsx(lAn,{})});const S=r!=="all"||s!=="all"||e!=="",k=()=>{t(""),n("all"),a("all")};return o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:x,children:[o.jsx(Tu,{})," Experiments"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/evals/datasets/running-experiments",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Experiments documentation",children:o.jsx(Li,{})})})]}),o.jsx(cAn,{search:e,onSearchChange:t,statusFilter:r,onStatusFilterChange:n,datasetFilter:s,onDatasetFilterChange:a,datasetOptions:g,onReset:k,hasActiveFilters:S})]}),o.jsx(sAn,{experiments:m,datasets:p,reviewByExperiment:y,isLoading:x,search:e,statusFilter:r,datasetFilter:s})]})}function fAn(){const{experimentId:e}=na(),{data:t,isLoading:r}=r8(),s=t?.experiments?.find(p=>p.id===e)?.datasetId??"",{data:a,isLoading:i,error:l}=G6(s,e??""),{data:c,isLoading:u,setEndOfListElement:d,isFetchingNextPage:f,hasNextPage:h}=t8({datasetId:s,experimentId:e??"",experimentStatus:a?.status});return e?r||i||!s?o.jsx(zr,{children:o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx(Dt,{})})}):l&&Ps(l)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(sa,{})})}):l&&Os(l)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):l||!a?o.jsx(zr,{children:o.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",l instanceof Error?l.message:"Unknown error"]})}):o.jsxs(zr,{children:[o.jsx(Cn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/experiments",children:[o.jsx(Ce,{children:o.jsx(Tu,{})}),"Experiments"]}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Experiment"})]})}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:"grid gap-1 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[o.jsx(Q1t,{experimentId:e,experiment:a}),o.jsx(H1t,{experimentId:e,experimentStatus:a?.status,results:c??[],isLoading:u,setEndOfListElement:d,isFetchingNextPage:f,hasNextPage:h})]})})]}):null}function G1t({redirectUri:e,onSuccess:t,initialMode:r="signin",errorMessage:n}){const{data:s,isLoading:a}=wC(),{mutate:i,isPending:l,error:c}=vjn(),{mutate:u,isPending:d,error:f}=bjn(),{mutate:h,isPending:p}=M1t(),[m,g]=b.useState(r),[y,x]=b.useState(""),[w,S]=b.useState(""),[k,_]=b.useState("");if(a)return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface1",children:o.jsx("div",{className:"text-neutral3",children:"Loading..."})});if(!s?.enabled||!s?.login)return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface1",children:o.jsx("div",{className:"text-neutral3",children:"Authentication is not configured"})});const{login:E}=s,T=E.type==="sso"||E.type==="both",j=E.type==="credentials"||E.type==="both",N=E.sso,I=E.signUpEnabled!==!1,P=m==="signin"||!I,R=P?l:d,B=P?c:f,D=()=>{t?t():e?window.location.href=e:window.location.href="/"},$=H=>{H.preventDefault(),P?i({email:w,password:k},{onSuccess:D}):u({email:w,password:k,name:y||void 0},{onSuccess:D})},U=()=>{h({redirectUri:e},{onSuccess:H=>{window.location.href=H.url}})},z=()=>{g(P?"signup":"signin")};return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface1",children:o.jsxs("div",{className:"w-full max-w-sm space-y-6 rounded-lg border border-border1 bg-surface2 p-8",children:[o.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[o.jsx(Yb,{className:"h-10 w-10"}),o.jsx("h1",{className:"text-xl font-semibold text-neutral6",children:P?"Sign in to Mastra Studio":"Create your account"})]}),E.description&&o.jsxs("div",{className:"flex items-start gap-2.5 rounded-md border border-border1 bg-surface1 p-3",children:[o.jsx(wVe,{className:"mt-0.5 h-4 w-4 shrink-0 text-neutral4"}),o.jsx("p",{className:"text-sm text-neutral3",children:E.description})]}),n&&o.jsx("div",{className:"rounded-md bg-red-500/10 p-3 text-sm text-red-400",children:n}),j&&o.jsxs("form",{onSubmit:$,className:"space-y-4",children:[!P&&o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{htmlFor:"name",className:"block text-sm text-neutral4",children:"Name"}),o.jsx(ar,{id:"name",type:"text",value:y,onChange:H=>x(H.target.value),placeholder:"Your name",variant:"default",size:"lg"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{htmlFor:"email",className:"block text-sm text-neutral4",children:"Email"}),o.jsx(ar,{id:"email",type:"email",value:w,onChange:H=>S(H.target.value),placeholder:"you@example.com",required:!0,variant:"default",size:"lg"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{htmlFor:"password",className:"block text-sm text-neutral4",children:"Password"}),o.jsx(ar,{id:"password",type:"password",value:k,onChange:H=>_(H.target.value),placeholder:P?"Enter your password":"Create a password",required:!0,variant:"default",size:"lg"})]}),B&&o.jsx("div",{className:"rounded-md bg-red-500/10 p-3 text-sm text-red-400",children:B.message}),o.jsx(ce,{type:"submit",disabled:R,className:"w-full",size:"lg",children:R?P?"Signing in...":"Creating account...":P?"Sign in":"Create account"}),I&&o.jsxs("div",{className:"text-center text-sm",children:[o.jsx("span",{className:"text-neutral3",children:P?"Don't have an account? ":"Already have an account? "}),o.jsx("button",{type:"button",onClick:z,className:"text-neutral6 hover:underline",children:P?"Sign up":"Sign in"})]})]}),T&&j&&o.jsxs("div",{className:"relative",children:[o.jsx("div",{className:"absolute inset-0 flex items-center",children:o.jsx("div",{className:"w-full border-t border-border1"})}),o.jsx("div",{className:"relative flex justify-center text-sm",children:o.jsx("span",{className:"bg-surface2 px-2 text-neutral3",children:"or continue with"})})]}),T&&N&&o.jsxs(ce,{onClick:U,disabled:p,className:"w-full",size:"lg",variant:"outline",children:[N.icon&&o.jsx("span",{className:"mr-2",children:N.icon}),p?"Redirecting...":N.text||"Sign in"]})]})})}function hAn(){const[e]=ao(),t=uu(),r=e.get("redirect")||"/",s=e.get("mode")==="signup"?"signup":"signin",a=e.get("error_description")||e.get("error")||null,i=()=>{r.startsWith("http")?window.location.href=r:t(r,{replace:!0})};return o.jsx(G1t,{redirectUri:r,onSuccess:i,initialMode:s,errorMessage:a})}function pAn(){const[e,t]=ao(),r=Ezr(e,t),n=Tzr(e,t),[s,a]=b.useState(),[i,l]=b.useState(!1),{data:c=[],isPending:u}=Tht(),{data:d=[],isPending:f}=Nht({entityType:r.selectedEntityOption?.entityType,rootOnly:!0}),{data:h=[],isPending:p}=Aht(),{data:m=[],isPending:g}=Iht(),y=b.useMemo(()=>bzr({availableTags:c,availableRootEntityNames:d,availableServiceNames:m,availableEnvironments:h,loading:{tags:u,entityNames:f,serviceNames:g,environments:p}}),[c,d,m,h,u,f,g,p]),x=b.useMemo(()=>Ozr({rootEntityType:r.selectedEntityOption?.entityType,dateFrom:r.selectedDateFrom,dateTo:r.selectedDateTo,tokens:r.filterTokens}),[r.filterTokens,r.selectedDateFrom,r.selectedDateTo,r.selectedEntityOption]),{data:w=[],isLoading:S,error:k,isFetchingNextPage:_,hasNextPage:E,setEndOfListElement:T}=hzr({filters:x}),{logIdMap:j,featuredLog:N,handleLogClick:I,handlePreviousLog:P,handleNextLog:R}=Izr(w,r.featuredLogId,r.handleFeaturedChange,r.featuredTraceId),{data:B,isLoading:D}=Mme(r.featuredTraceId??null),{data:$,isLoading:U}=MS(r.featuredTraceId??"",r.featuredSpanId??""),z=b.useCallback(()=>r.applyFilterTokens(kzr(y,r.filterTokens)),[y,r]),H=b.useCallback(()=>r.handleFeaturedChange({logId:null}),[r]),Q=b.useCallback(G=>r.handleFeaturedChange({traceId:G,spanId:null}),[r]),L=b.useCallback((G,J)=>r.handleFeaturedChange({traceId:G,spanId:J}),[r]),Z=b.useCallback(()=>{r.handleFeaturedChange({traceId:null,spanId:null}),l(!1)},[r]),V=b.useCallback(()=>r.handleFeaturedChange({spanId:null}),[r]),M=b.useCallback(G=>r.handleFeaturedChange({spanId:G??null}),[r]);if(k)return o.jsx(Jr,{title:"Logs",icon:o.jsx(YL,{}),children:o.jsx(szr,{error:k,resource:"logs",errorTitle:"Failed to load logs"})});const W=r.filterTokens.length>0||r.datePreset!=="last-24h"||!!r.selectedDateTo;return w.length===0&&!S&&!W?o.jsx(Jr,{title:"Logs",icon:o.jsx(YL,{}),children:o.jsx(czr,{})}):o.jsxs(bt,{width:"wide",height:"full",children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:S,children:[o.jsx(YL,{})," Logs"]})})}),o.jsxs(bt.Column,{className:"flex justify-end items-center gap-2",children:[o.jsx(lht,{preset:r.datePreset,onPresetChange:r.handleDatePresetChange,dateFrom:r.selectedDateFrom,dateTo:r.selectedDateTo,onDateChange:r.handleDateChange,disabled:S,presets:["last-24h","last-3d","last-7d","last-14d","last-30d","custom"]}),o.jsx(dft,{fields:y,tokens:r.filterTokens,onTokensChange:r.handleFilterTokensChange,disabled:S,onStartTextFilter:a}),o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/observability/logs/overview",target:"_blank",rel:"noopener noreferrer","aria-label":"Logs documentation",tooltipContent:"Go to Logs documentation",children:o.jsx(Li,{})})]})]}),o.jsx(ozr,{isLoading:S,filterFields:y,filterTokens:r.filterTokens,onFilterTokensChange:r.handleFilterTokensChange,onClear:z,onRemoveAll:r.handleRemoveAll,onSave:n.handleSave,onRemoveSaved:n.hasSavedFilters?n.handleRemoveSaved:void 0,autoFocusFilterFieldId:s})]}),o.jsx(azr,{logCollapsed:i,listSlot:o.jsx(izr,{logs:w,isLoading:S,isFetchingNextPage:_,hasNextPage:E,setEndOfListElement:T,logIdMap:j,featuredLogId:r.featuredLogId,onLogClick:I}),logPanelSlot:N?o.jsx(nzr,{log:N,onClose:H,onTraceClick:Q,onSpanClick:L,onPrevious:P,onNext:R,collapsed:i,onCollapsedChange:l}):null,tracePanelSlot:r.featuredTraceId?o.jsx(CFr,{traceId:r.featuredTraceId,spans:B?.spans,isLoading:D,onClose:Z,onSpanSelect:M,selectedSpanId:r.featuredSpanId}):null,spanPanelSlot:r.featuredTraceId&&r.featuredSpanId?o.jsx(EFr,{spanId:r.featuredSpanId,span:$?.span,isLoading:U,onClose:V}):null})]})}const Z1t=e=>{const t=Ge();return kt({queryKey:["mcpserver-tools",e?.id],queryFn:async()=>{const n=(await t.getMcpServerTools(e?.id)).tools,s={};return n.forEach(a=>{s[a.id]=a}),s},retry:!1,refetchOnWindowFocus:!1})};function mAn({server:e}){const{paths:t,Link:r}=or(),s=Ge().options.baseUrl,a=s?`${s}/api/mcp/${e.id}/sse`:"",{data:i}=Z1t(e),l=Object.values(i||{}),c=l.length,u=l.filter(h=>h.toolType==="agent").length,d=l.filter(h=>h.toolType==="workflow").length,f=Ch(e.name,50);return o.jsxs(Se.RowLink,{to:t.mcpServerLink(e.id),LinkComponent:r,children:[o.jsx(Se.NameCell,{children:f}),o.jsx(Se.DescriptionCell,{children:a}),o.jsx(Se.TextCell,{className:"text-center",children:u||""}),o.jsx(Se.TextCell,{className:"text-center",children:c||""}),o.jsx(Se.TextCell,{className:"text-center",children:d||""})]})}function gAn({mcpServers:e,isLoading:t,search:r=""}){const n=b.useMemo(()=>{const s=r.toLowerCase();return e.filter(a=>a.name?.toLowerCase().includes(s)||a.id?.toLowerCase().includes(s))},[e,r]);return t?o.jsx(yh,{columns:"auto 1fr auto auto auto"}):o.jsxs(Se,{columns:"auto 1fr auto auto auto",children:[o.jsxs(Se.Top,{children:[o.jsx(Se.TopCell,{children:"Name"}),o.jsx(Se.TopCell,{children:"URL"}),o.jsx(Se.TopCellSmart,{long:"Agents",short:o.jsx(ga,{}),tooltip:"Agent Tools",className:"text-center"}),o.jsx(Se.TopCellSmart,{long:"Tools",short:o.jsx(Mi,{}),tooltip:"Tools",className:"text-center"}),o.jsx(Se.TopCellSmart,{long:"Workflows",short:o.jsx(Di,{}),tooltip:"Workflow Tools",className:"text-center"})]}),n.length===0&&r?o.jsx(Se.NoMatch,{message:"No MCP Servers match your search"}):null,n.map(s=>o.jsx(mAn,{server:s},s.id))]})}const yAn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(yf,{}),titleSlot:"No MCP Servers yet",descriptionSlot:o.jsxs(o.Fragment,{children:["MCP servers are not configured yet. ",o.jsx("br",{}),"More information in the documentation."]}),actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/tools-mcp/mcp-overview",target:"_blank",rel:"noopener noreferrer",children:["MCP Documentation ",o.jsx(ba,{})]})})}),vAn=()=>{const{data:e=[],isLoading:t,error:r}=uM(),[n,s]=b.useState("");return r&&Ps(r)?o.jsx(Jr,{title:"MCP Servers",icon:o.jsx(gl,{}),children:o.jsx(sa,{})}):r&&Os(r)?o.jsx(Jr,{title:"MCP Servers",icon:o.jsx(gl,{}),children:o.jsx(Zs,{resource:"MCP servers"})}):r?o.jsx(Jr,{title:"MCP Servers",icon:o.jsx(gl,{}),children:o.jsx(pu,{title:"Failed to load MCP servers",message:r.message})}):e.length===0&&!t?o.jsx(Jr,{title:"MCP Servers",icon:o.jsx(gl,{}),children:o.jsx(yAn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:t,children:[o.jsx(gl,{})," MCP Servers"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to MCP documentation",children:o.jsx(Li,{})})})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Sg,{onSearch:s,label:"Filter MCP servers",placeholder:"Filter by name"})})]}),o.jsx(gAn,{mcpServers:e,isLoading:t,search:n})]})},bAn=(e,t)=>{const r=new Map,n=Object.keys(t);for(const s of n){const a=t[s],i=a.tools,l=Object.keys(i);for(const c of l){const u=i[c];r.has(u.id)||r.set(u.id,{...u,agents:[]}),r.get(u.id).agents.push({...a,id:s})}}for(const[s,a]of Object.entries(e))r.has(a.id)||r.set(a.id,{...a,agents:[]});return Array.from(r.values())};function xAn({tools:e,agents:t,isLoading:r,search:n=""}){const{paths:s,Link:a}=or(),i=b.useMemo(()=>bAn(e,t),[e,t]),l=b.useMemo(()=>i.filter(c=>c.id.toLowerCase().includes(n.toLowerCase())),[i,n]);return r?o.jsx(yh,{columns:"auto 1fr auto"}):o.jsxs(Se,{columns:"auto 1fr auto",children:[o.jsxs(Se.Top,{children:[o.jsx(Se.TopCell,{children:"Name"}),o.jsx(Se.TopCell,{children:"Description"}),o.jsx(Se.TopCellSmart,{long:"Agents",short:o.jsx(ga,{}),tooltip:"Attached Agents",className:"text-center"})]}),l.length===0&&n?o.jsx(Se.NoMatch,{message:"No Tools match your search"}):null,l.map(c=>{const u=Ch(c.id,50),d=Ch(c.description??"",200),f=c.agents.length;return o.jsxs(Se.RowLink,{to:s.toolLink(c.id),LinkComponent:a,children:[o.jsx(Se.NameCell,{children:u}),o.jsx(Se.DescriptionCell,{children:d}),o.jsx(Se.TextCell,{className:"text-center",children:f||""})]},c.id)})]})}const wAn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(yf,{}),titleSlot:"No Tools yet",descriptionSlot:o.jsxs(o.Fragment,{children:["Mastra tools are not configured yet. ",o.jsx("br",{}),"More information in the documentation."]}),actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/agents/using-tools-and-mcp",target:"_blank",rel:"noopener noreferrer",children:["Tools Documentation ",o.jsx(ba,{})]})})}),SAn=()=>{const e=Ge();return Kr({mutationFn:async({toolId:t,input:r,requestContext:n})=>{const s=new f_;Object.entries(n??{}).forEach(([a,i])=>{s.set(a,i)});try{return await e.getTool(t).execute({data:r,requestContext:s})}catch(a){throw ze.error("Error executing dev tool"),console.error("Error executing dev tool:",a),a}}})},OAn=({toolId:e})=>{const{canExecute:t}=Sv(),r=t("tools"),{data:n={}}=Eg(),s=b.useMemo(()=>{for(const g of Object.values(n))if(g.tools){const y=Object.values(g.tools).find(x=>x.id===e);if(y)return y}return null},[n,e]),{data:a,isLoading:i,error:l}=zkn(e,{enabled:!s}),c=s||a,{mutateAsync:u,isPending:d,data:f}=SAn(),{requestContext:h}=ks();b.useEffect(()=>{if(l){const g=l instanceof Error?l.message:"Failed to load tool";ze.error(`Error loading tool: ${g}`)}},[l]);const p=async(g,y)=>{if(!c)return;const x={...h??{},...y??{}};return u({toolId:c.id,input:g,requestContext:x})},m=c?.inputSchema?lg(ag(ev(c?.inputSchema))):Gn({});return i?o.jsxs("div",{className:"p-6",children:[o.jsx(Dn,{className:"h-8 w-48 mb-4"}),o.jsx(Dn,{className:"h-32 w-full"})]}):l?null:c?r?o.jsx(xve,{executionResult:f,isExecutingTool:d,zodInputSchema:m,handleExecuteTool:p,toolDescription:c.description,toolId:c.id,requestContextSchema:c.requestContextSchema}):o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(me,{variant:"ui-sm",className:"text-neutral3",children:"You don't have permission to execute tools."})}):o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(me,{variant:"header-md",className:"text-neutral3",children:"Tool not found"})})};function kAn({value:e,onValueChange:t,placeholder:r="Select a tool...",searchPlaceholder:n="Search tools...",emptyText:s="No tools found.",className:a,disabled:i=!1,variant:l="default"}){const{data:c={},isLoading:u,isError:d,error:f}=JB(),{data:h={},isLoading:p,isError:m,error:g}=Eg(),{navigate:y,paths:x}=or();b.useEffect(()=>{if(d){const _=f instanceof Error?f.message:"Failed to load tools";ze.error(`Error loading tools: ${_}`)}},[d,f]),b.useEffect(()=>{if(m){const _=g instanceof Error?g.message:"Failed to load agents";ze.error(`Error loading agents: ${_}`)}},[m,g]);const w=new Map;Object.values(h).forEach(_=>{_.tools&&Object.values(_.tools).forEach(E=>{w.has(E.id)||w.set(E.id,E)})}),Object.values(c).forEach(_=>{w.has(_.id)||w.set(_.id,_)});const S=Array.from(w.values()).map(_=>({label:_.id,value:_.id})),k=_=>{t?t(_):_&&_!==e&&y(x.toolLink(_))};return o.jsx(Gl,{options:S,value:e,onValueChange:k,placeholder:u||p?"Loading tools...":r,searchPlaceholder:n,emptyText:s,className:a,disabled:i||u||p||d||m,variant:l})}const _An=({isLoading:e,server:t})=>{const[{sseUrl:r,httpStreamUrl:n},s]=b.useState({sseUrl:"",httpStreamUrl:""});if(b.useEffect(()=>{if(!t)return;const i=window.MASTRA_SERVER_HOST,l=window.MASTRA_SERVER_PORT;let c=null;i&&l&&(c=`http://${i}:${l}`);const u=c||"http://localhost:4111",d=`${u}/api/mcp/${t.id}/sse`,f=`${u}/api/mcp/${t.id}/mcp`;s({sseUrl:d,httpStreamUrl:f})},[t]),e)return null;if(!t)return o.jsx(df,{children:o.jsx(me,{as:"h1",variant:"header-md",className:"text-neutral3 font-medium py-20 text-center",children:"Server not found"})});const a=`npx -y mcp-remote ${r}`;return o.jsxs(df,{isDivided:!0,children:[o.jsxs("div",{className:"px-8 py-12 mx-auto max-w-2xl w-full",children:[o.jsx(me,{as:"h1",variant:"header-md",className:"text-neutral6 font-medium pb-4",children:t.name}),o.jsxs("div",{className:"flex items-center gap-1 pb-6",children:[o.jsx(vt,{icon:o.jsx(B9,{className:"text-neutral6"}),className:"rounded-r-sm text-neutral4!",children:"Version"}),o.jsx(vt,{className:"rounded-l-sm text-neutral4!",children:t.version_detail.version})]}),o.jsx(me,{className:"text-neutral3 pb-4",children:"This MCP server can be accessed through multiple transport methods. Choose the one that best fits your use case."}),o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[o.jsx(vt,{icon:o.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"HTTP"}),children:"Regular HTTP Endpoint"}),o.jsx(me,{className:"text-neutral3 pt-1 pb-2",children:"Use for stateless HTTP transport with streamable responses."}),o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(me,{className:"px-2 py-1 bg-surface4 rounded-lg",children:n}),o.jsx("div",{className:"pt-1",children:o.jsx(ta,{tooltip:"Copy HTTP Stream URL",content:n})})]})]}),o.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[o.jsx(vt,{icon:o.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"SSE"}),children:"Server-Sent Events"}),o.jsx(me,{className:"text-neutral3 pt-1 pb-2",children:"Use for real-time communication via SSE."}),o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(me,{className:"px-2 py-1 bg-surface4 rounded-lg",children:r}),o.jsx("div",{className:"pt-1",children:o.jsx(ta,{tooltip:"Copy SSE URL",content:r})})]})]}),o.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[o.jsx(vt,{icon:o.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"CLI"}),children:"Command Line"}),o.jsx(me,{className:"text-neutral3 pt-1 pb-2",children:"Use for local command-line access via npx and mcp-remote."}),o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(me,{className:"px-2 py-1 bg-surface4 rounded-lg",children:a}),o.jsx("div",{className:"pt-1",children:o.jsx(ta,{tooltip:"Copy Command Line Config",content:a})})]})]})]})]}),o.jsx("div",{className:"h-full overflow-y-scroll border-l border-border1",children:o.jsx(EAn,{server:t})})]})},EAn=({server:e})=>{const{data:t={},isLoading:r}=Z1t(e);if(r)return null;const n=Object.keys(t);return o.jsxs("div",{className:"p-5 overflow-y-scroll",children:[o.jsxs("div",{className:"text-neutral6 flex gap-2 items-center",children:[o.jsx(Ce,{size:"lg",className:"bg-surface4 rounded-md p-1",children:o.jsx(gl,{})}),o.jsx(me,{variant:"header-md",as:"h2",className:"font-medium",children:"Available Tools"})]}),o.jsx("div",{className:"flex flex-col gap-2 pt-6",children:n.map(s=>{const a=t[s];return o.jsx(CAn,{tool:a,serverId:e.id},s)})})]})},CAn=({tool:e,serverId:t})=>{const r=b.useRef(null),{Link:n,paths:s}=or(),a=$St[e.toolType||"tool"];return o.jsxs(wf,{onClick:()=>r.current?.click(),children:[o.jsx(Edt,{children:o.jsx(a,{className:"group-hover/entity:text-accent6"})}),o.jsxs(kf,{children:[o.jsx(Sf,{children:o.jsx(n,{ref:r,href:s.mcpServerToolLink(t,e.id),children:e.id})}),o.jsx(Of,{children:e.description})]})]})},jAn=()=>{const{serverId:e}=na(),{data:t=[],isLoading:r}=uM(),n=t.find(s=>s.id===e);return o.jsxs(zr,{children:[o.jsxs(Cn,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/mcps",children:[o.jsx(Ce,{children:o.jsx(gl,{})}),"MCP Servers"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(e1t,{value:e,variant:"ghost"})})]}),o.jsx(fu,{children:o.jsxs(ce,{as:fr,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(o0,{}),"MCP documentation"]})})]}),o.jsx(_An,{isLoading:r,server:n})]})},Y1t=(e,t)=>{const{requestContext:r}=ks(),n=Ge();return kt({queryKey:["mcp-server-tool",e,t],queryFn:()=>n.getMcpServerTool(e,t).details(r)})},TAn=(e,t)=>{const{requestContext:r}=ks(),n=Ge();return Kr({mutationFn:s=>n.getMcpServerTool(e,t).execute({data:s,requestContext:r})})},NAn=({toolId:e,serverId:t})=>{const{canExecute:r}=Sv(),n=r("tools"),{data:s,isLoading:a,error:i}=Y1t(t,e),{mutateAsync:l,isPending:c,data:u}=TAn(t,e);b.useEffect(()=>{if(i){const h=i instanceof Error?i.message:"Failed to load tool";ze.error(`Error loading tool: ${h}`)}},[i]);const d=async h=>{if(s)return await l(h)};if(a)return o.jsxs("div",{className:"p-6",children:[o.jsx(Dn,{className:"h-8 w-48 mb-4"}),o.jsx(Dn,{className:"h-32 w-full"})]});if(i)return null;if(!s)return o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(me,{variant:"header-md",className:"text-neutral3",children:"Tool not found"})});if(!n)return o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(me,{variant:"ui-sm",className:"text-neutral3",children:"You don't have permission to execute tools."})});let f;try{f=lg(ag(s.inputSchema))}catch(h){console.error("Error processing input schema:",h),ze.error("Failed to process tool input schema."),f=Gn({})}return o.jsx(xve,{executionResult:u,isExecutingTool:c,zodInputSchema:f,handleExecuteTool:d,toolDescription:s.description||"",toolId:s.id})},AAn=()=>{const{data:e}=uM(),{serverId:t,toolId:r}=na(),{data:n,isLoading:s}=Y1t(t,r),a=e?.find(c=>c.id===t),i=n?.name,l=a?.name||"";return s||!n?null:o.jsxs("div",{className:"h-full w-full bg-surface2 overflow-y-hidden",children:[o.jsxs(Cn,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/mcps",children:[o.jsx(Ce,{children:o.jsx(gl,{})}),"MCP Servers"]}),o.jsx(jr,{as:fr,to:`/mcps/${t}`,children:l}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:i})]}),o.jsx(fu,{children:o.jsxs(ce,{as:fr,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(o0,{}),"MCP documentation"]})})]}),o.jsx(NAn,{toolId:r,serverId:t})]})};function IAn(){const{data:e,isLoading:t,isError:r}=oFr();return o.jsx(X6r,{data:e,isLoading:t,isError:r})}function RAn(){const{data:e,isLoading:t,isError:r}=wht();return o.jsx(Ame,{label:"Total Agent Runs",value:e?.value!=null?e.value.toLocaleString():null,prevValue:e?.previousValue!=null?e.previousValue.toLocaleString():void 0,changePct:e?.changePercent??null,isLoading:t,isError:r})}function PAn(){const{data:e,isLoading:t,isError:r}=sFr();return o.jsx(Ame,{label:"Total Model Cost",value:e?.cost!=null?Vw(e.cost,e.costUnit):null,prevValue:e?.previousCost!=null?Vw(e.previousCost,e.costUnit):void 0,changePct:e?.costChangePercent??null,isLoading:t,isError:r})}function MAn(){const{data:e,isLoading:t,isError:r}=aFr();return o.jsx(Ame,{label:"Total Tokens",value:e?.value!=null?Mm(e.value):null,prevValue:e?.previousValue!=null?Mm(e.previousValue):void 0,changePct:e?.changePercent??null,isLoading:t,isError:r})}function DAn(){const{data:e,isLoading:t,isError:r}=iFr();return o.jsx(K6r,{rows:e,isLoading:t,isError:r})}function LAn(){const{data:e,isLoading:t,isError:r}=cFr();return o.jsx(J6r,{data:e,isLoading:t,isError:r})}function $An(){const{data:e,isLoading:t,isError:r}=uFr();return o.jsx(tFr,{data:e,isLoading:t,isError:r})}function FAn(){const{data:e,isLoading:t,isError:r}=lFr();return o.jsx(rFr,{data:e,isLoading:t,isError:r})}const zAn=new Set(["ObservabilityStorageClickhouseVNext","ObservabilityStorageDuckDB","ObservabilityInMemory"]),are="period";function BAn(){const[e,t]=ao(),r=e.get(are),n=vht(r)?r:"24h",s=b.useCallback(a=>{t(i=>{const l=new URLSearchParams(i);return a==="24h"?l.delete(are):l.set(are,a),l},{replace:!0})},[t]);return o.jsx(G6r,{initialPreset:n,onPresetChange:s,children:o.jsx(UAn,{})})}function UAn(){const{error:e}=wht(),{data:t,isLoading:r}=HB(),n=t?.observabilityStorageType,s=n?zAn.has(n):!1,a=n==="ObservabilityInMemory";return e&&Ps(e)?o.jsx(Jr,{title:"Metrics",icon:o.jsx(nk,{}),children:o.jsx(sa,{})}):e&&Os(e)?o.jsx(Jr,{title:"Metrics",icon:o.jsx(nk,{}),children:o.jsx(Zs,{resource:"metrics"})}):e?o.jsx(Jr,{title:"Metrics",icon:o.jsx(nk,{}),children:o.jsx(pu,{title:"Failed to load metrics",message:e.message})}):o.jsxs(bt,{width:"wide",height:"full",children:[o.jsx(bt.TopArea,{className:"sticky top-0 z-100 bg-surface1 ",children:o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{children:[o.jsx(nk,{})," Metrics"]})})}),o.jsxs(bt.Column,{className:"flex justify-end gap-2",children:[o.jsx(Z6r,{}),o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/observability/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Metrics documentation",children:o.jsx(Li,{})})]})]})}),r?null:s?o.jsxs("div",{className:"grid gap-8 content-start pb-10",children:[a&&o.jsx(cn,{variant:"info",title:"Metrics are not persisted",children:o.jsx(cn.Message,{children:"This project uses in-memory storage for observability. Metrics will be lost on every server restart. For persistent metrics, switch the observability storage to ClickHouse or DuckDB."})}),o.jsxs(pie,{children:[o.jsx(RAn,{}),o.jsx(PAn,{}),o.jsx(MAn,{})]}),o.jsxs(pie,{children:[o.jsx(DAn,{}),o.jsx($An,{}),o.jsx(LAn,{}),o.jsx(FAn,{}),o.jsx(IAn,{})]})]}):o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(yf,{}),titleSlot:"Metrics are not available with your current storage",descriptionSlot:"Metrics require ClickHouse, DuckDB, or in-memory storage for observability. Relational databases (PostgreSQL, LibSQL) do not support metrics collection. To enable metrics on an existing project, switch the observability storage in the Mastra configuration.",actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/observability/metrics/overview",target:"_blank",rel:"noopener noreferrer",children:["Metrics Documentation ",o.jsx(ba,{})]})})})]})}const VAn=[{title:"Metrics",description:"View system performance metrics, request latencies, and throughput across your agents and workflows.",icon:nk,href:"/metrics"},{title:"Traces",description:"Explore distributed traces to debug and understand the execution flow of your AI operations.",icon:xo,href:"/observability"}];function qAn(){return o.jsxs(pk,{children:[o.jsx(pk.Top,{children:o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{children:[o.jsx(xo,{})," Observability"]})})})}),o.jsx("div",{className:"px-6 pt-6 overflow-y-auto",children:o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 max-w-3xl",children:VAn.map(e=>o.jsxs(fr,{to:e.href,className:"group flex flex-col gap-3 rounded-lg border border-border1 bg-surface2 p-5 transition-colors hover:border-accent1 hover:bg-surface3",children:[o.jsxs("div",{className:"flex items-center gap-2.5",children:[o.jsx(e.icon,{className:"h-5 w-5 text-icon3 group-hover:text-accent1 transition-colors"}),o.jsx("span",{className:"text-ui-md font-medium text-text1",children:e.title})]}),o.jsx("p",{className:"text-ui-sm text-text3 leading-relaxed",children:e.description})]},e.href))})})]})}const HAn=[{title:"Agents",description:"Create and manage AI agents with tools, memory, and custom instructions.",icon:ga,href:"/agents"},{title:"Prompts",description:"Design and version reusable prompt templates for your agents.",icon:Yi,href:"/prompts"},{title:"Workflows",description:"Build step-based execution flows with suspend, resume, and branching.",icon:Di,href:"/workflows"},{title:"Processors",description:"Configure data processors for transforming and routing information.",icon:eS,href:"/processors"},{title:"MCP Servers",description:"Connect to Model Context Protocol servers for external tool access.",icon:gl,href:"/mcps"},{title:"Tools",description:"Browse and test the tools available to your agents and workflows.",icon:Mi,href:"/tools"},{title:"Workspaces",description:"Organize your projects and resources into isolated workspaces.",icon:nc,href:"/workspaces"},{title:"Request Context",description:"Inspect request-scoped context propagation for dynamic configuration.",icon:jE,href:"/request-context"}];function QAn(){return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{children:[o.jsx(Z2t,{})," Primitives"]})})}),o.jsx(bt.MainArea,{children:o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:HAn.map(e=>o.jsxs(fr,{to:e.href,className:"group flex flex-col gap-3 rounded-lg border border-border1 bg-surface2 p-5 transition-colors hover:border-accent1 hover:bg-surface3",children:[o.jsxs("div",{className:"flex items-center gap-2.5",children:[o.jsx(e.icon,{className:"h-5 w-5 text-icon3 group-hover:text-accent1 transition-colors"}),o.jsx("span",{className:"text-ui-md font-medium text-text1",children:e.title})]}),o.jsx("p",{className:"text-ui-sm text-text3 leading-relaxed",children:e.description})]},e.href))})})]})}function WAn(){const{paths:e}=or(),{data:t,isLoading:r,error:n}=qSt(),{isCmsAvailable:s}=cM(),[a,i]=b.useState(""),l=t?.promptBlocks??[];return n&&Ps(n)?o.jsx(Jr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(sa,{})}):n&&Os(n)?o.jsx(Jr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(Zs,{resource:"prompt blocks"})}):n?o.jsx(Jr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(pu,{title:"Failed to load prompt blocks",message:n.message})}):l.length===0&&!r?o.jsx(Jr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(Nkn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:r,children:[o.jsx(Yi,{})," Prompts"]})})}),o.jsxs(bt.Column,{className:"flex justify-end gap-2",children:[o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/agents/agent-instructions#prompt-blocks",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Prompts documentation",children:o.jsx(Li,{})}),s&&o.jsxs(ce,{as:fr,to:e.cmsPromptBlockCreateLink(),variant:"primary",children:[o.jsx(us,{}),"Create Prompt"]})]})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Sg,{onSearch:i,label:"Filter prompts",placeholder:"Filter by name or description"})})]}),o.jsx(Tkn,{promptBlocks:l,isLoading:r,search:a})]})}function GAn(){return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{children:[o.jsx(jE,{})," Request Context"]})})}),o.jsx(bt.MainArea,{children:o.jsx(WSn,{children:o.jsx(SSt,{})})})]})}const ZAn=[{title:"Mastra APIs",description:"Explore and test the available REST API endpoints with the interactive Swagger UI.",icon:u2t,href:"/swagger-ui",external:!1},{title:"Documentation",description:"Read the official Mastra documentation for guides, references, and tutorials.",icon:Li,href:"https://mastra.ai/en/docs",external:!0},{title:"Github",description:"Browse the source code, report issues, and contribute to the Mastra project.",icon:ba,href:"https://github.com/mastra-ai/mastra",external:!0},{title:"Community",description:"Join the Mastra Discord community for help, discussion, and collaboration.",icon:tA,href:"https://discord.gg/BTYqqHKUrf",external:!0},{title:"Share with your team",description:"Running Mastra Studio locally? Deploy to the cloud so your team can collaborate.",icon:mVe,href:"https://mastra.ai/cloud",external:!0},{title:"Talk to our Sales team",description:"Get a custom demo, discuss on-prem deployments, and how we can help you accelerate getting agents into production.",icon:sMt,href:"https://mastra.ai/contact?ref=studio",external:!0}];function YAn(){return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{children:[o.jsx(Li,{})," Resources"]})})}),o.jsx(bt.MainArea,{children:o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 max-w-3xl",children:ZAn.map(e=>o.jsxs("a",{href:e.href,...e.external?{target:"_blank",rel:"noreferrer"}:{},className:"group flex flex-col gap-3 rounded-lg border border-border1 bg-surface2 p-5 transition-colors hover:border-accent1 hover:bg-surface3",children:[o.jsxs("div",{className:"flex items-center gap-2.5",children:[o.jsx(e.icon,{className:"h-5 w-5 text-icon3 group-hover:text-accent1 transition-colors"}),o.jsx("span",{className:"text-ui-md font-medium text-text1",children:e.title}),e.external&&o.jsx(ba,{className:"h-3.5 w-3.5 text-icon3 ml-auto opacity-0 group-hover:opacity-100 transition-opacity"})]}),o.jsx("p",{className:"text-ui-sm text-text3 leading-relaxed",children:e.description})]},e.href))})})]})}function XAn(){const{data:e={},isLoading:t,error:r}=cd(),[n,s]=b.useState(""),[a,i]=b.useState("all");if(r&&Ps(r))return o.jsx(Jr,{title:"Scorers",icon:o.jsx(La,{}),children:o.jsx(sa,{})});if(r&&Os(r))return o.jsx(Jr,{title:"Scorers",icon:o.jsx(La,{}),children:o.jsx(Zs,{resource:"scorers"})});if(r)return o.jsx(Jr,{title:"Scorers",icon:o.jsx(La,{}),children:o.jsx(pu,{title:"Failed to load scorers",message:r.message})});if(Object.keys(e).length===0&&!t)return o.jsx(Jr,{title:"Scorers",icon:o.jsx(La,{}),children:o.jsx(iOn,{})});const l=a!=="all"||n!=="",c=()=>{s(""),i("all")};return o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:t,children:[o.jsx(La,{})," Scorers"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/evals/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Scorers documentation",children:o.jsx(Li,{})})})]}),o.jsx(lOn,{search:n,onSearchChange:s,sourceFilter:a,onSourceFilterChange:i,onReset:c,hasActiveFilters:l})]}),o.jsx(aOn,{scorers:e,isLoading:t,search:n,sourceFilter:a})]})}function KAn(){const{scorerId:e}=na(),[t,r]=ao(),n=t.get("scoreId")??void 0,[s,a]=b.useState(n),[i,l]=b.useState({value:"all",label:"All Entities",type:"ALL"}),{scorer:c,isLoading:u,error:d}=rOn(e),{data:f={},isLoading:h,error:p}=Eg(),{isLoading:m,error:g}=c0(),{data:y=[],isLoading:x,error:w,isFetchingNextPage:S,hasNextPage:k,setEndOfListElement:_}=tOn({scorerId:e,entityId:i?.value==="all"?void 0:i?.value,entityType:i?.type==="ALL"?void 0:i?.type}),E=b.useMemo(()=>c?.agentIds?.filter(L=>f[L]).map(L=>({value:L,label:f[L].name,type:"AGENT"}))||[],[c?.agentIds,f]),T=b.useMemo(()=>c?.workflowIds?.map(L=>({value:L,label:L,type:"WORKFLOW"}))||[],[c?.workflowIds]),j=b.useMemo(()=>[{value:"all",label:"All Entities",type:"ALL"},...E,...T],[E,T]),N=t.get("entity")??"all",I=j.find(L=>L.value===N);I&&I.value!==i?.value&&l(I),b.useEffect(()=>{if(d){const L=d instanceof Error?d.message:"Failed to load scorer";ze.error(`Error loading scorer: ${L}`)}},[d]),b.useEffect(()=>{if(p){const L=p instanceof Error?p.message:"Failed to load agents";ze.error(`Error loading agents: ${L}`)}},[p]),b.useEffect(()=>{if(g){const L=g instanceof Error?g.message:"Failed to load workflows";ze.error(`Error loading workflows: ${L}`)}},[g]);const P=L=>{L?.value&&r(Z=>{const V=new URLSearchParams(Z);return V.set("entity",L.value),V})};b.useEffect(()=>{const L=t.get("scoreId")??void 0;if(L===s)return;if(!L){a(void 0);return}y.find(V=>V.id===L)&&a(L)},[t,y]);const R=b.useCallback(L=>{a(L||void 0),r(Z=>{const V=new URLSearchParams(Z);return L?V.set("scoreId",L):V.delete("scoreId"),V})},[r]);if(!c)return null;const B=Ps(d)||Ps(p)||Ps(g),D=d&&Os(d),$=!B&&!D&&(d||p||g),U=!x&&y.length===0,z=i?.value!=="all",H=o.jsxs(o.Fragment,{children:[o.jsxs(Xa,{children:[o.jsx(jr,{as:fr,to:"/scorers",children:"Scorers"}),o.jsx(nOn,{value:e,variant:"link"})]}),o.jsxs(bt.Row,{children:[o.jsxs(xn,{children:[o.jsxs(xn.Title,{isLoading:u,children:[o.jsx(La,{})," ",c?.scorer?.config?.name||e]}),(u||c?.scorer?.config?.description)&&o.jsx(xn.Description,{isLoading:u,children:c?.scorer?.config?.description})]}),o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/evals/overview",target:"_blank",rel:"noopener noreferrer","aria-label":"Scorers documentation",tooltipContent:"Go to Scorers documentation",children:o.jsx(Li,{})}),c?.scorer?.source==="stored"&&o.jsxs(ce,{variant:"default",as:fr,to:`/cms/scorers/${e}/edit`,children:[o.jsx(iv,{})," Edit"]})]})]})]});if(B||D||$||U&&!z){const L=(d instanceof Error?d.message:void 0)??(p instanceof Error?p.message:void 0)??(g instanceof Error?g.message:void 0)??"An unexpected error occurred";return o.jsxs(bt,{width:"wide",height:"full",children:[o.jsx(bt.TopArea,{children:H}),o.jsx(bt.MainArea,{isCentered:!0,children:B?o.jsx(sa,{}):D?o.jsx(Zs,{resource:"scorers"}):$?o.jsx(pu,{title:"Failed to load scorer",message:L}):o.jsx(G1n,{})})]})}return o.jsxs(bt,{width:"wide",children:[o.jsxs(bt.TopArea,{children:[H,o.jsx(X1n,{selectedEntity:i,entityOptions:j,onEntityChange:P,onReset:()=>{r(L=>{const Z=new URLSearchParams(L);return Z.set("entity","all"),Z})},isLoading:x||h||m})]}),o.jsx(W1n,{scores:y,isLoading:x,selectedScoreId:s,isFetchingNextPage:S,hasNextPage:k,setEndOfListElement:_,onScoreClick:R,errorMsg:w?.message})]})}const JAn=[{value:"dark",label:"Dark"},{value:"light",label:"Light"},{value:"system",label:"System"}],eIn=()=>{const{baseUrl:e,headers:t,apiPrefix:r}=cve(),{theme:n,setTheme:s}=gC();return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{children:[o.jsx(hme,{})," Settings"]})})}),o.jsxs(bt.MainArea,{className:"grid gap-8 mt-6",children:[o.jsx("section",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:o.jsxs("div",{className:"space-y-3",children:[o.jsx("h2",{className:"text-icon6 font-medium",children:"Theme"}),o.jsx(Oft,{name:"theme",label:"Theme mode",value:n,onValueChange:a=>s(a),options:JAn.map(a=>({...a}))})]})}),o.jsx(_St,{initialConfig:{baseUrl:e,headers:t,apiPrefix:r}})]})]})};function tIn(){const[e]=ao(),t=uu(),r=e.get("redirect")||"/",n=()=>{r.startsWith("http")?window.location.href=r:t(r,{replace:!0})};return o.jsx(G1t,{redirectUri:r,onSuccess:n,initialMode:"signup"})}function rIn(e){return e.replace(/\/$/,"").split("/").pop()}function s8({children:e,className:t}){return o.jsx("div",{className:Y("border border-border1 rounded-lg mt-12 py-8 lg:min-h-[25rem] transition-height px-4 lg:px-12",t),children:e})}function nIn({templates:e,linkComponent:t,className:r,isLoading:n}){const s=t||"a";return n?o.jsx("div",{className:Y("grid gap-y-4",r),children:Array.from({length:5}).map((a,i)=>o.jsx("div",{className:"h-16 bg-surface3 animate-pulse rounded-lg"},i))}):o.jsx("div",{className:Y("grid gap-y-4",r),children:e.map(a=>{const i=a?.agents||a?.tools||a?.networks||a?.workflows||a?.mcp;return o.jsxs("article",{className:Y("border border-border1 rounded-lg overflow-hidden w-full grid grid-cols-[1fr_auto] bg-surface3 transition-colors hover:bg-surface4"),children:[o.jsxs(s,{to:`/templates/${a.slug}`,className:Y("grid [&:hover_p]:text-neutral5",{"grid-cols-[8rem_1fr] lg:grid-cols-[12rem_1fr]":a.imageURL}),children:[a.imageURL&&o.jsx("div",{className:Y("overflow-hidden"),children:o.jsx("div",{className:"w-full h-full bg-cover thumb transition-scale duration-150",style:{backgroundImage:`url(${a.imageURL})`}})}),o.jsxs("div",{className:Y("grid py-3 px-6 w-full gap-0.5","[&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:text-neutral3"),children:[o.jsx("h2",{className:"text-ui-lg text-neutral5",children:a.title}),o.jsx("p",{className:"text-ui-md text-neutral4 transition-colors duration-500",children:a.description}),o.jsxs("div",{className:"hidden 2xl:flex text-neutral3 text-ui-md flex-wrap items-center gap-4 mt-3",children:[i&&o.jsxs("ul",{className:Y("flex gap-4 text-ui-md text-neutral3 m-0 p-0 list-none","[&>li]:flex [&>li]:items-center [&>li]:gap-0.5 text-neutral4"),children:[a?.agents&&a.agents.length>0&&o.jsxs("li",{children:[o.jsx(ga,{})," ",a.agents.length]}),a?.tools&&a.tools.length>0&&o.jsxs("li",{children:[o.jsx(Mi,{})," ",a.tools.length]}),a?.networks&&a.networks.length>0&&o.jsxs("li",{children:[o.jsx(kVe,{})," ",a.networks.length]}),a?.workflows&&a.workflows.length>0&&o.jsxs("li",{children:[o.jsx(hF,{})," ",a.workflows.length]}),a?.mcp&&a.mcp.length>0&&o.jsxs("li",{children:[o.jsx(gl,{})," ",a.mcp.length]})]}),i&&a.supportedProviders&&o.jsx("small",{children:"|"}),o.jsx("div",{className:"flex items-center text-neutral3 gap-4",children:a.supportedProviders.map(l=>o.jsx("span",{className:"",children:l},l))})]})]})]}),o.jsx("a",{href:a.githubUrl,className:Y("group items-center gap-2 text-ui-md ml-auto pr-4 hidden","lg:flex"),target:"_blank",rel:"noopener noreferrer",children:o.jsxs("span",{className:"flex items-center gap-2 px-2 py-1 rounded bg-surface1 group-hover:bg-surface2 text-neutral3 transition-colors group-hover:text-neutral5",children:[o.jsx(ydt,{})," ",rIn(a.githubUrl)]})})]},a.slug)})})}function sIn({tagOptions:e,selectedTag:t,providerOptions:r,selectedProvider:n,onTagChange:s,onProviderChange:a,searchTerm:i,onSearchChange:l,onReset:c,className:u,isLoading:d}){return d?o.jsxs("div",{className:Y("h-[6.5rem] flex items-center gap-8","[&>div]:bg-surface3 [&>div]:w-48 [&>div]:h-8 [&>div]:animate-pulse",u),children:[o.jsx("div",{})," ",o.jsx("div",{})," ",o.jsx("div",{})]}):o.jsxs("div",{className:Y("flex flex-wrap mx-auto sticky top-0 gap-4 bg-surface2 py-8",u),children:[o.jsx(Ox,{name:"search-templates",label:"Search templates",labelIsHidden:!0,value:i,onChange:f=>l?.(f.target.value),placeholder:"Search Template"}),o.jsx($o,{label:"Filter by tag",labelIsHidden:!0,name:"filter-tag",value:t,onValueChange:s,options:e}),o.jsx($o,{label:"Filter by provider",labelIsHidden:!0,name:"filter-provider",value:n,onValueChange:a,options:r}),c&&o.jsxs(ce,{onClick:c,children:["Reset ",o.jsx(Nn,{})]})]})}function aIn(){const{data:e,isLoading:t}=zzr(),{templates:r,tags:n,providers:s}=e??{templates:[],tags:[],providers:[]},[a,i]=b.useState("all"),[l,c]=b.useState("all"),[u,d]=b.useState(""),f=[{value:"all",label:"Any tag"}];(n||[]).forEach(w=>{f.push({value:w,label:w})});const h=[{value:"all",label:"Any provider"}];(s||[]).forEach(w=>{h.push({value:w,label:w})});const p=(w,S)=>{S==="tag"?i(w):S==="provider"&&c(w)},m=w=>{d(w)},g=()=>{i("all"),c("all"),d("")},y=r.filter(w=>!(u&&!w.title.toLowerCase().includes(u)&&!w.description.toLowerCase().includes(u)||a!=="all"&&!w.tags.includes(a)||l!=="all"&&!w.supportedProviders.includes(l))),x=u||a!=="all"||l!=="all";return o.jsxs(zr,{children:[o.jsx(Cn,{children:o.jsxs(Qu,{children:[o.jsx(Ce,{children:o.jsx(Fb,{})}),"Templates"]})}),o.jsxs("div",{className:Y("overflow-y-auto w-full h-full px-8 pb-12 z-10"),children:[o.jsx(sIn,{selectedTag:a,onTagChange:w=>p(w,"tag"),tagOptions:f,selectedProvider:l,onProviderChange:w=>p(w,"provider"),providerOptions:h,searchTerm:u,onSearchChange:m,onReset:x?g:void 0,className:"max-w-[80rem]",isLoading:t}),o.jsx(nIn,{templates:y,linkComponent:fr,className:"max-w-[80rem] mx-auto",isLoading:t})]})]})}const iIn="1.31.0-alpha.1";function oIn({errorMsg:e,validationErrors:t}){const r=typeof e=="string"?e:e!=null?String(e):void 0,n=r?.includes("Invalid schema for function"),s=r?.includes("validation issue")||t&&t.length>0,a=()=>s?"Template installation completed but some validation issues remain. The template may still be functional, but you should review and fix these issues.":n?"There was an issue with the AI model configuration. This may be related to the selected model or AI SDK version compatibility.":"An unexpected error occurred during template installation.",i=()=>s?{icon:o.jsx(AE,{className:"text-yellow-500"}),title:"Template Installed with Warnings"}:{icon:o.jsx(L2t,{}),title:"Template Installation Failed"},{icon:l,title:c}=i();return o.jsxs(s8,{className:"space-y-4 text-neutral3 mb-8 content-center",children:[o.jsxs("div",{className:Y("grid items-center justify-items-center gap-4 content-center","[&>svg]:w-8 [&>svg]:h-8"),children:[l,o.jsxs("div",{className:"text-center space-y-2",children:[o.jsx("p",{className:"text-ui-md font-medium text-neutral5",children:c}),o.jsx("p",{className:"text-ui-md text-neutral3",children:a()})]})]}),t&&t.length>0&&o.jsxs("details",{className:"text-xs",children:[o.jsxs("summary",{className:"cursor-pointer text-neutral3 hover:text-neutral4 select-none text-center",children:["Show Validation Issues (",t.length,")"]}),o.jsx("div",{className:"mt-4 p-3 bg-gray-100 dark:bg-gray-800 rounded text-xs overflow-auto max-h-60 text-left space-y-2",children:t.map((u,d)=>o.jsxs("div",{className:"border-l-2 border-red-400 pl-2",children:[o.jsx("div",{className:"font-medium text-red-600 dark:text-red-400",children:u.type==="typescript"?"🔴 TypeScript Error":"⚠️ Lint Error"}),o.jsx("div",{className:"text-xs font-mono text-gray-700 dark:text-gray-300 mt-1 whitespace-pre-wrap wrap-break-word",children:u.message})]},d))})]}),r&&!s&&o.jsxs("details",{className:"text-xs",children:[o.jsx("summary",{className:"cursor-pointer text-neutral3 hover:text-neutral4 select-none text-center",children:"Show Details"}),o.jsx("div",{className:"mt-4 p-3 bg-gray-100 dark:bg-gray-800 rounded text-xs font-mono overflow-auto max-h-60 text-left",children:o.jsx("div",{className:"whitespace-pre-wrap wrap-break-word",children:r})})]})]})}function lIn({providerOptions:e,selectedProvider:t,onProviderChange:r,variables:n,errors:s,handleInstallTemplate:a,handleVariableChange:i,isLoadingEnvVars:l,isInstalling:c,defaultModelProvider:u,defaultModelId:d,onModelUpdate:f}){return o.jsx(s8,{children:o.jsxs("div",{className:"max-w-[40rem] my-4 p-4 lg:p-8 mx-auto gap-8 grid",children:[o.jsxs("h2",{className:Y("text-neutral4 text-header-sm font-semibold flex items-center gap-2","[&>svg]:w-[1.2em] [&_svg]:h-[1.2em] [&_svg]:opacity-70"),children:["Install Template ",o.jsx(_Ve,{})]}),o.jsx($o,{name:"template-provider",options:e,label:"Template AI Model Provider",onValueChange:r,value:t,placeholder:"Select",layout:"horizontal"}),t&&Object.entries(n||{}).length>0&&o.jsxs(o.Fragment,{children:[o.jsx("h3",{className:"text-neutral3 text-ui-md",children:"Set required Environmental Variables"}),o.jsx("div",{className:"grid grid-cols-[1fr_1fr] gap-4 items-start",children:l?o.jsxs("div",{className:Y("flex items-center justify-center col-span-2 text-neutral3 text-ui-sm gap-4","[&_svg]:opacity-50 [&_svg]:w-[1.1em] [&_svg]:h-[1.1em]","animate-in fade-in duration-300"),children:[o.jsx(Dt,{})," Loading variables..."]}):Object.entries(n).map(([h,p])=>o.jsxs(b.Fragment,{children:[o.jsx(Sx,{name:`env-${h}`,labelIsHidden:!0,label:"Key",value:h,disabled:!0,className:"w-full"}),o.jsx(Sx,{name:h,labelIsHidden:!0,label:"Value",value:p,onChange:i,errorMsg:s.includes(h)?"Value is required.":"",autoComplete:"off",className:"w-full"})]},h))}),o.jsxs("div",{className:"border-t border-border1 pt-12 mt-3.5 relative",children:[o.jsx("div",{className:"absolute w-8 h-8 rounded-full bg-surface2 top-0 left-1/2 -translate-x-1/2 -translate-y-4 text-ui-sm text-neutral3 flex items-center justify-center",children:"And"}),o.jsx("h3",{className:"text-neutral4 text-ui-lg",children:"Set AI Model for Template Installation"}),o.jsx("p",{className:"text-neutral3 text-ui-md mt-2 mb-8",children:"This model will be used by the workflow to process and install the template"}),o.jsx(OSt,{defaultProvider:u||"",defaultModel:d||"",updateModel:f||(()=>Promise.resolve({message:"Updated"})),closeEditor:()=>{},autoSave:!0,selectProviderPlaceholder:"Provider"})]})]}),t&&!l&&o.jsx(ce,{className:Y("flex items-center gap-2 mt-4 justify-center text-ui-md w-full bg-surface5 min-h-10 rounded-lg text-neutral5 hover:bg-surface6 transition-colors","[&>svg]:w-[1.1em] [&_svg]:h-[1.1em] [&_svg]:text-neutral5"),onClick:a,disabled:!t||!u||!d||s.length>0||c,children:c?o.jsxs(o.Fragment,{children:[o.jsx(Dt,{className:"w-4 h-4"})," Installing..."]}):o.jsxs(o.Fragment,{children:["Install ",o.jsx(Dw,{})]})})]})})}function cIn({title:e,description:t,githubUrl:r,isLoading:n,infoData:s,templateSlug:a}){const i=a?`feat/install-template-${a}`:"feat/install-template-[slug]";return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:Y("grid mt-8 items-center"),children:o.jsxs("div",{className:Y("text-header-lg flex items-center gap-3","[&>svg]:w-[1.2em] [&>svg]:h-[1.2em] [&>svg]:opacity-50",{"[&>svg]:opacity-20":n}),children:[o.jsx(Fb,{}),o.jsx("h2",{className:Y({"bg-surface4 flex rounded-lg min-w-[50%]":n}),children:n?o.jsx(o.Fragment,{children:" "}):e})]})}),o.jsxs("div",{className:"grid lg:grid-cols-[1fr_1fr] gap-x-24",children:[o.jsxs("div",{className:"grid",children:[o.jsx("p",{className:Y("mb-4 text-ui-md text-neutral4 mt-2 leading-7",{"bg-surface4 rounded-lg ":n}),children:n?o.jsx(o.Fragment,{children:" "}):t}),!n&&a&&o.jsxs("div",{className:Y("bg-surface2 border border-surface4 rounded-lg p-4 mb-4","flex items-start gap-3"),children:[o.jsx("div",{className:"shrink-0 mt-0.5",children:o.jsx(zy,{className:"w-[1.1em] h-[1.1em] text-blue-500"})}),o.jsxs("div",{className:"flex-1 space-y-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(cF,{className:"w-[1em] h-[1em] text-neutral4"}),o.jsx("span",{className:"text-ui-md font-medium text-neutral5",children:"A new Git branch will be created"})]}),o.jsxs("div",{className:"text-ui-sm text-neutral4 space-y-1",children:[o.jsxs("div",{children:[o.jsx("span",{className:"font-medium",children:"Branch name:"})," ",o.jsx("code",{className:"bg-surface3 px-1.5 py-0.5 rounded text-ui-sm font-mono",children:i})]}),o.jsx("div",{children:"This ensures safe installation with easy rollback if needed. Your main branch remains unchanged."})]})]})]}),r&&o.jsxs("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 mt-auto text-neutral3 text-ui-md hover:text-neutral5",children:[o.jsx(ydt,{}),r?.split("/")?.pop()]})]}),s&&o.jsx(S1,{data:s,labelsAreHidden:!0,isLoading:n})]})]})}function uIn({name:e,streamResult:t,workflowInfo:r}){const n=t?.phase||"initializing",s=t?.payload?.workflowState,a=t?.payload?.currentStep,i=t?.error,l=s?.steps||{},c=Object.keys(l).length>0,u=m=>m==="input"||m.endsWith(".input")||m.startsWith("Mapping_")&&/[0-9a-f]{8}/.test(m)||/[0-9a-f]{8,}/.test(m)?!1:r?.allSteps?m in r.allSteps:!0,d=Object.entries(l).filter(([m,g])=>u(m)),f=d.length,h=()=>{switch(n){case"initializing":return"Preparing template installation...";case"processing":return`Installing ${e} template`;case"completed":return"Template installation completed!";case"error":return"Template installation failed";default:return"Installing template..."}},p=d.map(([m,g])=>({id:m,status:g?.status,description:g?.description,title:m.charAt(0).toUpperCase()+m.slice(1).replace(/-/g," "),isActive:a?.id===m}));return o.jsxs(s8,{className:"space-y-6 text-neutral3 mb-8 content-center",children:[o.jsxs("div",{className:"text-center",children:[o.jsx("h3",{className:"text-lg font-semibold text-neutral5",children:h()}),t?.runId&&o.jsxs("div",{className:"mt-2 text-ui-sm text-neutral3",children:["Run ID: ",t.runId]})]}),c&&f>0&&!["error"].includes(n)&&o.jsx("div",{className:"max-w-[30rem] w-full mx-auto px-6",children:o.jsx(q3r,{steps:p})}),i&&n==="error"&&o.jsxs("div",{className:Y("rounded-lg text-neutral5 p-6 flex items-center gap-3 text-ui-md bg-red-500/10","[&>svg]:w-6 [&>svg]:h-6 [&>svg]:opacity-70 [&>svg]:text-red-500"),children:[o.jsx(TDt,{}),i||"Something went wrong"]}),c&&o.jsx(V3r,{steps:p,currentStep:a,className:"pb-4"}),!c&&n==="initializing"&&o.jsxs("div",{className:"text-center text-sm text-neutral3 grid gap-4 justify-items-center",children:[o.jsx(Dt,{}),o.jsx("p",{children:"This may take some time..."})]})]})}function dIn({name:e,installedEntities:t}){return o.jsxs(s8,{className:Y("grid items-center justify-items-center gap-4 content-center","[&>svg]:w-8 [&>svg]:h-8"),children:[o.jsx(_Ve,{}),o.jsx("h2",{className:"text-header-md",children:"Done!"}),o.jsxs("p",{className:"text-ui-md text-center text-neutral3 ",children:["The ",o.jsx("b",{className:"text-neutral4",children:e})," template has been successfully installed.",t&&t.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("br",{})," Installed entities are listed below."]})]}),t&&t.length>0&&o.jsx(S1,{data:t})]})}function fIn(){const{templateSlug:e}=na(),[t,r]=ao(),[n,s]=b.useState(""),[a,i]=b.useState(""),[l,c]=b.useState(""),[u,d]=b.useState({}),[f,h]=b.useState([]),[p,m]=b.useState(null),[g,y]=b.useState(!1),[x,w]=b.useState(""),[S,k]=b.useState(!1),[_,E]=b.useState(!1),[T,j]=b.useState([]),{data:N,isLoading:I}=Bzr({repoOrSlug:e,owner:"mastra-ai"}),R=iIn?.includes("beta")??!1?"beta":"main",{data:B,isLoading:D}=Uzr({repo:N?.githubUrl?new URL(N.githubUrl).pathname.split("/")[2]:`template-${e}`,owner:"mastra-ai",branch:R}),{data:$,isLoading:U}=Vzr(),{mutateAsync:z,isPending:H}=qzr(),{mutateAsync:Q}=Hzr(),{streamInstall:L,streamResult:Z,isStreaming:V}=Wzr($),{observeInstall:M,streamResult:W,isStreaming:G}=Gzr($);b.useEffect(()=>{const se=t.get("runId");se&&!g&&!p&&!V&&!G&&(console.info("🔄 Checking completed run after hot reload:",{runId:se}),w(se),Q({runId:se}).then(le=>{const xe=le.snapshot;if(xe?.status==="success"&&xe?.result?.success)y(!0);else if(xe?.result?.success===!1)if(xe?.result?.validationResults&&!xe?.result?.validationResults?.valid&&xe?.result?.validationResults?.remainingErrors>0){const{remainingErrors:ue,errors:ve}=xe.result.validationResults,we=`Template installation completed but ${ue} validation issue${ue>1?"s":""} remain unresolved.`;m(we),j(ve||[])}else{const ue=xe?.result?.message||xe?.result?.error||"Template installation failed";m(typeof ue=="string"?ue:String(ue))}}).catch(le=>{console.error("❌ Failed to fetch run details:",le),m("Failed to retrieve installation status after reload")}))},[t,g,p,V,G,Q]),b.useEffect(()=>{const se=t.get("runId"),le=t.get("resume"),xe=t.get("provider");if(se&&le==="true"&&xe&&!V&&!G&&!S&&!_&&$){w(se),k(!0);try{Q({runId:se}).then(de=>{if(de.snapshot?.status==="running")return M.mutateAsync({runId:se})}).then(()=>{r(de=>{const ue=new URLSearchParams(de);return ue.delete("resume"),ue})}).catch(de=>{console.error("❌ Failed to resume template installation:",de),de.message?.includes("404")||de.message?.includes("not found")?m("Template installation run not found. It may have expired or been completed."):m("Failed to resume template installation. Please try again.")})}catch(de){console.error("❌ Auto-resume failed with error:",de),m("Failed to resume template installation. Please refresh and try again.")}}},[t,e,V,G,S,_,$,Q,M,r]);const J=[{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"groq",label:"Groq"},{value:"google",label:"Google"}],ae=[{key:"tools",label:"Tools",value:N?.tools?.length?N.tools.map(se=>se).join(", "):"n/a",icon:o.jsx(Mi,{})},{key:"agents",label:"Agents",value:N?.agents?.length?N.agents.map(se=>se).join(", "):"n/a",icon:o.jsx(ga,{})},{key:"workflows",label:"Workflows",value:N?.workflows?.length?N.workflows.map(se=>se).join(", "):"n/a",icon:o.jsx(hF,{})},{key:"providers",label:"Providers",value:N?.supportedProviders?.length?N.supportedProviders.join(", "):"n/a",icon:o.jsx(Em,{})},{key:"tags",label:"Tags",value:N?.tags?.length?N.tags.join(", "):"n/a",icon:o.jsx(NE,{})}],te=[{...ae[0]},{...ae[1]},{...ae[2]}].filter(se=>se.value!=="n/a");b.useEffect(()=>{B&&d(B)},[B]),b.useEffect(()=>{const se=Z||W;se?.phase==="error"&&se?.error&&m(typeof se.error=="string"?se.error:String(se.error))},[Z?.phase,Z?.error,W?.phase,W?.error]);const re=se=>{s(se)},ie=async se=>(i(se.provider),c(se.modelId),{message:"Model updated successfully"}),he=async()=>{const se=Object.entries(u).reduce((le,[xe,de])=>(de===""&&le.push(xe),le),[]);if(se.length>0){h(se);return}if(N){m(null),y(!1),w(""),E(!0);try{const xe={repo:N.githubUrl||`https://github.com/mastra-ai/template-${N.slug}`,ref:R,slug:N.slug,variables:u},{runId:de}=await z({});w(de),r(ue=>{const ve=new URLSearchParams(ue);return ve.set("runId",de),ve.set("resume","true"),ve.set("provider",n||"openai"),ve}),await L.mutateAsync({inputData:xe,selectedModel:{provider:a,modelId:l},runId:de})}catch(le){E(!1),m(le?.message||"Template installation failed"),console.error("Template installation failed",le)}}},X=se=>{const{name:le,value:xe}=se.target;xe.trim()===""?h(de=>[...de,le]):h(de=>de.filter(ue=>ue!==le)),d(de=>({...de,[le]:xe}))};return o.jsxs(zr,{children:[o.jsx(Cn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/templates",children:[o.jsx(Ce,{children:o.jsx(Fb,{})}),"Templates"]}),o.jsx(jr,{as:fr,to:`/templates/${N?.slug}`,isCurrent:!0,children:N?.title&&N.title})]})}),o.jsx("div",{className:Y("w-full lg:px-12 h-full overflow-y-scroll"),children:o.jsxs("div",{className:"p-6 w-full max-w-[80rem] mx-auto grid gap-y-4",children:[o.jsx(cIn,{isLoading:I,title:N?.title,description:N?.longDescription,imageURL:N?.imageURL,githubUrl:N?.githubUrl,infoData:ae,templateSlug:e}),N&&o.jsxs(o.Fragment,{children:[(V||G)&&o.jsx(uIn,{name:N.title,streamResult:G?W:Z,runId:x,workflowInfo:$}),g&&o.jsx(dIn,{name:N.title,installedEntities:te,linkComponent:fr}),p&&o.jsx(oIn,{errorMsg:p,validationErrors:T.length>0?T:Z?.validationResults?.errors||W?.validationResults?.errors}),!V&&!G&&!g&&!p&&o.jsx(lIn,{providerOptions:J,selectedProvider:n,onProviderChange:re,variables:u,setVariables:d,errors:f,setErrors:h,handleInstallTemplate:he,handleVariableChange:X,isLoadingEnvVars:D||U,isInstalling:H,defaultModelProvider:a,defaultModelId:l,onModelUpdate:ie})]})]})})]})}const hIn=()=>{const{toolId:e,agentId:t}=na();return o.jsxs(zr,{children:[o.jsxs(Cn,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/agents",children:[o.jsx(Ce,{children:o.jsx(ga,{})}),"Agents"]}),o.jsx(jr,{as:fr,to:`/agents/${t}/chat`,children:t}),o.jsx(jr,{as:fr,to:`/tools/${t}/${e}`,isCurrent:!0,children:e})]}),o.jsx(fu,{children:o.jsxs(ce,{as:fr,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",children:[o.jsx(Ce,{children:o.jsx(o0,{})}),"Tools documentation"]})})]}),o.jsx(MOn,{toolId:e,agentId:t})]})},pIn=()=>{const{toolId:e}=na();return o.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[o.jsxs(Cn,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/tools",children:[o.jsx(Ce,{children:o.jsx(Mi,{})}),"Tools"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(kAn,{value:e,variant:"ghost"})})]}),o.jsx(fu,{children:o.jsxs(ce,{as:fr,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(o0,{}),"Tools documentation"]})})]}),o.jsx(OAn,{toolId:e})]})};function mIn(e){return e.feedbackType==="thumbs"?e.value===1?"👍 Positive (1)":e.value===0||e.value===-1?"👎 Negative":String(e.value):e.feedbackType==="rating"?String(e.value):e.feedbackType==="comment"?String(e.value??e.comment??"-"):String(e.value??"-")}function gIn({feedback:e,isOpen:t,onClose:r,onNext:n,onPrevious:s}){const a=e?.metadata&&Object.keys(e.metadata).length>0?JSON.stringify(e.metadata,null,2):void 0;return o.jsxs(Vt,{dialogTitle:"Feedback Detail",dialogDescription:"View feedback details",isOpen:t,onClose:r,level:3,children:[o.jsxs(Vt.Top,{children:[o.jsxs(Zn,{children:[o.jsx(tA,{})," Feedback"]}),"|",o.jsx(Vt.Nav,{onNext:n,onPrevious:s})]}),o.jsxs(Vt.Content,{children:[o.jsxs(Vt.Header,{children:[o.jsxs(Vt.Heading,{children:[o.jsx(tA,{})," Feedback"]}),e?.traceId&&o.jsxs(Zn,{children:[o.jsx(m_,{})," ",e.traceId]})]}),o.jsxs(kx,{children:[o.jsx(S1,{data:[{label:"Created at",value:e?.timestamp?tr(new Date(e.timestamp),"MMM d, h:mm:ss aaa"):"n/a",key:"timestamp"},{label:"Type",value:e?.feedbackType??"n/a",key:"type"},{label:"Value",value:e?mIn(e):"n/a",key:"value"},...e?.comment?[{label:"Comment",value:e.comment,key:"comment"}]:[],{label:"Source",value:e?.feedbackSource??e?.source??"n/a",key:"source"},...e?.feedbackUserId?[{label:"User",value:e.feedbackUserId,key:"userId"}]:[],...e?.traceId?[{label:"Trace ID",value:e.traceId,key:"traceId"}]:[],...e?.spanId?[{label:"Span ID",value:e.spanId,key:"spanId"}]:[]]}),a&&o.jsx(Vt.CodeSection,{title:"Metadata",icon:o.jsx(m_,{}),codeStr:a,simplified:!0})]})]})]})}const UL=[{name:"source",label:"Source",size:"1fr"},{name:"date",label:"Date",size:"0.8fr"},{name:"time",label:"Time",size:"0.8fr"},{name:"value",label:"Value",size:"0.6fr"},{name:"comment",label:"Comment",size:"2fr"}];function yIn(e){return e.feedbackType==="thumbs"?e.value===1?"👍":e.value===0||e.value===-1?"👎":String(e.value):typeof e.value=="number"?String(e.value):"—"}function vIn(e){const t=e.comment||(typeof e.value=="string"?e.value:"");return t?t.length>60?t.slice(0,60)+"…":t:"—"}function X1t({feedbackData:e,isLoadingFeedbackData:t,onPageChange:r}){const[n,s]=b.useState(!1),[a,i]=b.useState(),l=e?.feedback??[],c=h=>{i(l[h]),s(!0)};if(t)return o.jsx(xft,{columns:UL});const u=a?l.indexOf(a):-1,d=u>=0&&u<l.length-1?()=>i(l[u+1]):void 0,f=u>0?()=>i(l[u-1]):void 0;return o.jsxs(o.Fragment,{children:[o.jsxs(ha,{children:[o.jsxs(ha.Trim,{children:[o.jsx(ha.Header,{columns:UL}),l.length>0?o.jsx(ha.Entries,{children:l.map((h,p)=>{const m=new Date(h.timestamp),g=xg(m),y={id:`${h.traceId}-${p}`,source:h.feedbackUserId||h.feedbackSource||"unknown",date:g?"Today":tr(m,"MMM dd"),time:tr(m,"h:mm:ss aaa"),value:yIn(h),comment:vIn(h)};return o.jsx(ha.Entry,{columns:UL,onClick:()=>c(p),entry:y,children:UL.map(x=>o.jsx(ha.EntryText,{children:String(y[x.name]??"")},`col-${x.name}`))},y.id)})}):o.jsx(ha.Message,{message:"No feedback found",type:"info"})]}),o.jsx(ha.Pagination,{currentPage:e?.pagination?.page||0,hasMore:e?.pagination?.hasMore,onNextPage:()=>r?.((e?.pagination?.page||0)+1),onPrevPage:()=>{const h=e?.pagination?.page||0;h>0&&r?.(h-1)}})]}),o.jsx(gIn,{feedback:a,isOpen:n,onClose:()=>s(!1),onNext:d,onPrevious:f})]})}const Q8e="auto auto auto auto 1fr";function K1t({scoresData:e,isLoadingScoresData:t,onPageChange:r,onScoreSelect:n}){return t?o.jsx(Y9,{columns:Q8e}):o.jsxs("div",{className:"grid gap-2",children:[o.jsxs(Ac,{columns:Q8e,className:"min-w-0",children:[o.jsxs(Ac.Top,{children:[o.jsx(Ac.TopCell,{children:"ID"}),o.jsx(Ac.TopCell,{children:"Date"}),o.jsx(Ac.TopCell,{children:"Time"}),o.jsx(Ac.TopCell,{children:"Score"}),o.jsx(Ac.TopCell,{children:"Scorer"})]}),e?.scores&&e.scores.length>0?e.scores.map(s=>{const a=new Date(s.createdAt),i=xg(a);return o.jsxs(Ac.RowButton,{onClick:()=>n?.(s),children:[o.jsx(Ac.Cell,{height:"compact",className:"font-mono text-neutral3 text-ui-smd",children:ef(s?.id)||"n/a"}),o.jsx(Ac.Cell,{height:"compact",className:"text-neutral2 text-ui-smd",children:i?"Today":tr(a,"MMM dd")}),o.jsx(Ac.Cell,{height:"compact",className:"font-mono text-neutral3 text-ui-smd",children:tr(a,"h:mm:ss aaa")}),o.jsx(Ac.Cell,{height:"compact",className:"text-ui-smd",children:String(s?.score??"")}),o.jsx(Ac.Cell,{height:"compact",className:"text-ui-smd",children:String(s?.scorer?.name||s?.scorer?.id||"")})]},s.id)}):o.jsx(Ac.NoMatch,{message:"No scores found"})]}),o.jsx(Ac.Pagination,{currentPage:e?.pagination?.page||0,hasMore:e?.pagination?.hasMore,onNextPage:()=>r?.((e?.pagination?.page||0)+1),onPrevPage:()=>r?.((e?.pagination?.page||0)-1)})]})}const J1t=({traceId:e="",page:t})=>{const r=Ge(),n=t??0;return kt({queryKey:["trace-feedback",e,n],queryFn:()=>r.listFeedback({filters:{traceId:e},pagination:{page:n,perPage:10}}),enabled:!!e,refetchInterval:3e3,gcTime:0,staleTime:0})};function bIn(){const[e,t]=ao(),[r,n]=b.useState(!1),s=KFr(e,t,{onRemoveAll:()=>n(!1)}),[a,i]=b.useState(),[l,c]=b.useState(0),[u,d]=b.useState(!1),[f,h]=b.useState(null);b.useEffect(()=>c(0),[s.traceIdParam,s.spanIdParam]);const{data:p,isLoading:m}=cd(),{data:g,isLoading:y}=vve({traceId:s.traceIdParam,spanId:s.spanIdParam,page:l}),[x,w]=b.useState(0);b.useEffect(()=>w(0),[s.traceIdParam,s.spanIdParam]);const{data:S,isLoading:k}=J1t({traceId:s.traceIdParam,page:x}),{data:_,isLoading:E}=Mme(s.traceIdParam??null),T=b.useMemo(()=>_?.spans,[_?.spans]),{data:j,isLoading:N}=MS(s.traceIdParam??"",s.spanIdParam??""),I=s.scoreIdParam?g?.scores?.find(ue=>ue.id===s.scoreIdParam):void 0,{data:P=[],isPending:R}=Tht(),{data:B=[],isPending:D}=Nht({entityType:s.selectedEntityOption?.entityType,rootOnly:!0}),{data:$=[],isPending:U}=Aht(),{data:z=[],isPending:H}=Iht(),Q=b.useMemo(()=>qFr({availableTags:P,availableRootEntityNames:B,availableServiceNames:z,availableEnvironments:$,loading:{tags:R,entityNames:D,serviceNames:H,environments:U}}),[P,B,z,$,R,D,H,U]),L=b.useMemo(()=>GFr({rootEntityType:s.selectedEntityOption?.entityType,status:s.selectedStatus,dateFrom:s.selectedDateFrom,dateTo:s.selectedDateTo,tokens:s.filterTokens}),[s.filterTokens,s.selectedDateFrom,s.selectedDateTo,s.selectedEntityOption,s.selectedStatus]),{data:Z,isLoading:V,isFetchingNextPage:M,hasNextPage:W,setEndOfListElement:G,error:J}=LFr({filters:L}),ae=b.useMemo(()=>Z?.spans??[],[Z?.spans]),te=Z?.threadTitles??{},{handlePreviousSpan:re,handleNextSpan:ie}=Rht(T,s.spanIdParam??null,ue=>s.handleSpanChange(ue)),he=tzr(e,t),X=b.useCallback(()=>s.applyFilterTokens(ZFr(Q,s.filterTokens)),[Q,s]),{handlePreviousTrace:se,handleNextTrace:le}=YFr(ae,s.traceIdParam,s.handleTraceClick),xe=b.useCallback(()=>{const ue=T?.find(ve=>ve.parentSpanId==null);ue&&(s.handleSpanChange(ue.spanId),s.handleSpanTabChange("scoring"))},[T,s]);if(J)return o.jsx(Jr,{title:"Traces",icon:o.jsx(xo,{}),children:o.jsx(jht,{error:J,resource:"traces",errorTitle:"Failed to load traces"})});const de=!!s.selectedEntityOption||!!s.selectedStatus||s.filterTokens.length>0||s.datePreset!=="last-24h"||!!s.selectedDateTo;return o.jsxs(bt,{width:"wide",height:"full",children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:V,children:[o.jsx(xo,{})," Traces"]})})}),o.jsxs(bt.Column,{className:"flex justify-end items-center gap-2",children:[o.jsx(lht,{preset:s.datePreset,onPresetChange:s.handleDatePresetChange,dateFrom:s.selectedDateFrom,dateTo:s.selectedDateTo,onDateChange:s.handleDateChange,disabled:V,presets:["last-24h","last-3d","last-7d","last-14d","last-30d","custom"]}),o.jsx(dft,{fields:Q,tokens:s.filterTokens,onTokensChange:s.handleFilterTokensChange,disabled:V,onStartTextFilter:i}),o.jsx(Ln,{disabled:V,"aria-pressed":r,"aria-label":r?"Ungroup traces":"Group traces by thread",tooltipContent:r?"Ungroup traces":"Group traces by thread",onClick:()=>n(ue=>!ue),children:r?o.jsx(m3,{}):o.jsx(xVe,{})}),o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/observability/tracing/overview",target:"_blank",rel:"noopener noreferrer","aria-label":"Traces documentation",tooltipContent:"Go to Traces documentation",children:o.jsx(Li,{})})]})]}),o.jsx(xFr,{isLoading:V,filterFields:Q,filterTokens:s.filterTokens,onFilterTokensChange:s.handleFilterTokensChange,onClear:X,onRemoveAll:s.handleRemoveAll,onSave:he.handleSave,onRemoveSaved:he.hasSavedFilters?he.handleRemoveSaved:void 0,autoFocusFilterFieldId:a})]}),o.jsx(jFr,{traceCollapsed:u,listSlot:o.jsx(NFr,{traces:ae,isLoading:V,isFetchingNextPage:M,hasNextPage:W,setEndOfListElement:G,filtersApplied:de,featuredTraceId:s.traceIdParam,onTraceClick:ue=>s.handleTraceClick(s.traceIdParam===ue.traceId?"":ue.traceId),groupByThread:r,threadTitles:te}),tracePanelSlot:s.traceIdParam?o.jsx(Eht,{traceId:s.traceIdParam,spans:T,isLoading:E,onClose:s.handleTraceClose,onSpanSelect:ue=>s.handleSpanChange(ue??null),onEvaluateTrace:xe,onSaveAsDatasetItem:ue=>h(ue),initialSpanId:s.spanIdParam,onPrevious:se,onNext:le,collapsed:u,onCollapsedChange:d,placement:"traces-list",LinkComponent:EB,traceHref:`/traces/${s.traceIdParam}`}):null,spanPanelSlot:s.traceIdParam&&s.spanIdParam?o.jsx(Cht,{traceId:s.traceIdParam,spanId:s.spanIdParam,span:j?.span,isLoading:N,onClose:s.handleSpanClose,onPrevious:re,onNext:ie,activeTab:s.spanTabParam??"details",onTabChange:ue=>s.handleSpanTabChange(ue),feedbackTabBadge:S?.pagination?.total??void 0,feedbackTabSlot:()=>o.jsx(X1t,{feedbackData:S,onPageChange:w,isLoadingFeedbackData:k}),scoringTabBadge:g?.pagination?.total??void 0,scoringTabSlot:({span:ue,traceId:ve,spanId:we})=>o.jsxs("div",{className:"grid gap-6",children:[o.jsx(Cve,{traceId:ve,isTopLevelSpan:!ue.parentSpanId,spanId:we,entityType:ue.attributes?.agentId||ue.entityType===Do.AGENT?"Agent":ue.attributes?.workflowId||ue.entityType===Do.WORKFLOW_RUN?"Workflow":void 0,scorers:p,isLoadingScorers:m}),o.jsx(K1t,{scoresData:g,onPageChange:c,isLoadingScoresData:y,onScoreSelect:Ne=>s.handleScoreChange(Ne.id)})]})}):null,scorePanelSlot:I?o.jsx(gve,{score:I,onClose:()=>s.handleScoreChange(null)}):null}),f&&o.jsx(jve,{rootSpanId:f.rootSpanId,traceId:f.traceId,isOpen:!0,onClose:()=>h(null)})]})}function xIn(){const{traceId:e}=na(),[t,r]=ao(),n=uu(),s=t.get("spanId")||void 0,a=t.get("tab"),i=a==="scoring"?"scoring":a==="feedback"?"feedback":"details",l=t.get("scoreId")||void 0,[c,u]=b.useState(s??null),[d,f]=b.useState(),[h,p]=b.useState(i),[m,g]=b.useState(0),[y,x]=b.useState(!1),{data:w,isLoading:S,error:k}=Mme(e),_=b.useMemo(()=>w?.spans??[],[w?.spans]),E=b.useMemo(()=>_.find(re=>re.parentSpanId==null),[_]),{data:T,isLoading:j}=MS(e,c??"");b.useEffect(()=>g(0),[e,c]);const{data:N,isLoading:I}=cd(),{data:P,isLoading:R}=vve({traceId:e,spanId:c??void 0,page:m}),[B,D]=b.useState(0);b.useEffect(()=>D(0),[e,c]);const{data:$,isLoading:U}=J1t({traceId:e,page:B});b.useEffect(()=>{if(l&&P?.scores&&!d){const re=P.scores.find(ie=>ie.id===l);re&&f(re)}},[l,P?.scores,d]);const z=b.useCallback(re=>{const ie=new URLSearchParams(t);for(const[he,X]of Object.entries(re))X===null||X===""?ie.delete(he):ie.set(he,X);r(ie,{replace:!0})},[t,r]),H=b.useCallback(re=>{const ie=re??null,he=ie===c;u(ie),he||(f(void 0),p("details"),z({spanId:ie,tab:null,scoreId:null}))},[c,z]),Q=b.useCallback(()=>{u(null),f(void 0),p("details"),z({spanId:null,tab:null,scoreId:null})},[z]),L=b.useCallback(re=>{u(re),f(void 0),p("details"),z({spanId:re,tab:null,scoreId:null})},[z]),{handlePreviousSpan:Z,handleNextSpan:V}=Rht(_,c,L),M=b.useCallback(re=>{const ie=re;p(ie),f(void 0),z({tab:ie==="details"?null:ie,scoreId:null})},[z]),W=b.useCallback(re=>{f(re),z({scoreId:re.id})},[z]),G=b.useCallback(()=>{f(void 0),z({scoreId:null})},[z]),J=b.useCallback(()=>{n("/observability")},[n]),ae=b.useCallback(()=>{p("scoring"),E&&c!==E.spanId?(u(E.spanId),f(void 0),z({spanId:E.spanId,tab:"scoring",scoreId:null})):z({tab:"scoring"})},[E,c,z]),te=o.jsxs(o.Fragment,{children:[o.jsxs(ce,{as:EB,href:"/observability",variant:"link",size:"md",className:"text-neutral2",children:[o.jsx(wp,{}),"Back to Traces"]}),o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:S,children:[o.jsx(xo,{})," Trace ",o.jsx("span",{className:"text-neutral3",children:e})]})})}),o.jsx(bt.Column,{children:o.jsxs(ps,{children:[o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/observability/tracing/overview",target:"_blank",rel:"noopener noreferrer","aria-label":"Traces documentation",tooltipContent:"Go to Traces documentation",children:o.jsx(Li,{})}),E&&o.jsxs(o.Fragment,{children:[o.jsxs(Ln,{tooltipContent:"Evaluate Trace","aria-label":"Evaluate Trace",onClick:ae,children:[o.jsx(p3,{}),"Evaluate"]}),o.jsxs(Ln,{tooltipContent:"Save as Dataset Item","aria-label":"Save as Dataset Item",onClick:()=>x(!0),children:[o.jsx(yc,{}),"Save"]})]})]})})]}),E&&o.jsx(bt.Row,{children:o.jsx(bt.Column,{children:o.jsx(Oht,{rootSpan:E,numOfCol:3})})})]});return k?o.jsxs(bt,{height:"full",children:[o.jsx(bt.TopArea,{children:te}),o.jsx(bt.MainArea,{isCentered:!0,children:o.jsx(jht,{error:k,resource:"traces",errorTitle:"Failed to load trace"})})]}):o.jsxs(bt,{children:[o.jsx(bt.TopArea,{children:te}),o.jsx(jve,{rootSpanId:E?.spanId,traceId:e,isOpen:y,onClose:()=>x(!1)}),o.jsxs("div",{className:Y("grid h-full min-h-0 gap-4 overflow-hidden items-start mt-4",c?"grid-cols-[2fr_3fr]":"grid-cols-[1fr]"),children:[o.jsx(Eht,{traceId:e,spans:_,isLoading:S,onClose:J,onSpanSelect:H,onEvaluateTrace:ae,initialSpanId:c,placement:"trace-page",timelineChartWidth:c?"default":"wide"}),c&&!S&&o.jsxs("div",{className:Y("grid gap-4 max-h-full min-h-0 overflow-auto",d?"grid-rows-[1fr_1fr]":"grid-rows-[1fr]"),children:[o.jsx(Cht,{traceId:e,spanId:c,span:T?.span,isLoading:j,onClose:Q,onPrevious:Z,onNext:V,activeTab:h,onTabChange:M,feedbackTabBadge:$?.pagination?.total??void 0,feedbackTabSlot:()=>o.jsx(X1t,{feedbackData:$,onPageChange:D,isLoadingFeedbackData:U}),scoringTabBadge:P?.pagination?.total??void 0,scoringTabSlot:({span:re,traceId:ie,spanId:he})=>o.jsxs("div",{className:"grid gap-6",children:[o.jsx(Cve,{traceId:ie,isTopLevelSpan:!re.parentSpanId,spanId:he,entityType:re.attributes?.agentId||re.entityType===Do.AGENT?"Agent":re.attributes?.workflowId||re.entityType===Do.WORKFLOW_RUN?"Workflow":void 0,scorers:N,isLoadingScorers:I}),o.jsx(K1t,{scoresData:P,onPageChange:g,isLoadingScoresData:R,onScoreSelect:W})]})}),d&&o.jsx(gve,{score:d,onClose:G})]})]})]})}function wIn(){const{data:e,isLoading:t,error:r}=c0(),[n,s]=b.useState("");return r&&Ps(r)?o.jsx(Jr,{title:"Workflows",icon:o.jsx(Di,{}),children:o.jsx(sa,{})}):r&&Os(r)?o.jsx(Jr,{title:"Workflows",icon:o.jsx(Di,{}),children:o.jsx(Zs,{resource:"workflows"})}):r?o.jsx(Jr,{title:"Workflows",icon:o.jsx(Di,{}),children:o.jsx(pu,{title:"Failed to load workflows",message:r.message})}):Object.keys(e||{}).length===0&&!t?o.jsx(Jr,{title:"Workflows",icon:o.jsx(Di,{}),children:o.jsx(ipn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:t,children:[o.jsx(Di,{})," Workflows"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/workflows/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Workflows documentation",children:o.jsx(Li,{})})})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Sg,{onSearch:s,label:"Filter workflows",placeholder:"Filter by name or description"})})]}),o.jsx(apn,{workflows:e||{},isLoading:t,search:n})]})}const W8e=()=>{const{workflowId:e}=na(),{data:t,isLoading:r,error:n}=zP(e);return n&&Ps(n)?o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(sa,{})}):n&&Os(n)?o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"workflows"})}):o.jsx(Rwt,{workflowId:e,workflow:t??void 0,isLoading:r})};function SIn(e){if(!e)return null;switch(e.icon||e.provider){case"aws-s3":case"s3":return o.jsx(bdt,{className:"h-4 w-4 text-[#FF9900]"});case"google-cloud":case"google-cloud-storage":case"gcs":return o.jsx(vdt,{className:"h-4 w-4"});case"azure-blob":case"azure":return o.jsx(xdt,{className:"h-4 w-4 text-[#0078D4]"});case"cloudflare":case"cloudflare-r2":case"r2":return o.jsx(yU,{className:"h-4 w-4 text-[#F38020]"});case"minio":return o.jsx(Fre,{className:"h-4 w-4 text-red-400"});case"database":return o.jsx(Na,{className:"h-4 w-4 text-emerald-400"});case"local":case"folder":return o.jsx(nc,{className:"h-4 w-4 text-amber-400"});case"hard-drive":return o.jsx(Fre,{className:"h-4 w-4 text-slate-400"});case"cloud":return o.jsx(yU,{className:"h-4 w-4 text-sky-400"});default:return o.jsx(yU,{className:"h-4 w-4 text-neutral4"})}}function eOt(e,t=!1){const{name:r,type:n,mount:s}=e;if(n==="directory")return s?SIn(s):t?o.jsx(CE,{className:"h-4 w-4 text-amber-400"}):o.jsx(nc,{className:"h-4 w-4 text-amber-400"});switch(r.split(".").pop()?.toLowerCase()){case"ts":case"tsx":case"js":case"jsx":return o.jsx(lx,{className:"h-4 w-4 text-blue-400"});case"json":return o.jsx(_R,{className:"h-4 w-4 text-yellow-400"});case"md":case"mdx":return o.jsx(Yi,{className:"h-4 w-4 text-neutral4"});case"png":case"jpg":case"jpeg":case"gif":case"svg":case"webp":return o.jsx(ice,{className:"h-4 w-4 text-purple-400"});default:return o.jsx(sce,{className:"h-4 w-4 text-neutral4"})}}function tOt(e){if(e==null||Number.isNaN(e))return"";if(e<0)return"-"+tOt(-e);if(e===0)return"0 B";const t=1024,r=["B","KB","MB","GB","TB"],n=Math.min(Math.floor(Math.log(e)/Math.log(t)),r.length-1);return parseFloat((e/Math.pow(t,n)).toFixed(1))+" "+r[n]}function OIn(e){if("body"in e&&e.body&&typeof e.body=="object"){const n=e.body;if(typeof n.error=="string")return n.error;if(typeof n.message=="string")return n.message}const t=e.message,r=t.lastIndexOf(" - {");if(r!==-1)try{const n=t.slice(r+3),s=JSON.parse(n);if(s.error)return s.error;if(s.message)return s.message}catch{}return t.includes("status: 404")?"Directory not found":t}function rOt(e){return e==="."||e===""}function kIn({path:e,onNavigate:t}){const n=rOt(e)?[]:e.split("/").filter(Boolean);return o.jsxs("div",{className:"flex items-center gap-1 text-sm overflow-x-auto",children:[o.jsx("button",{onClick:()=>t("."),className:"p-1 rounded hover:bg-surface4 text-neutral5 hover:text-neutral6 transition-colors","aria-label":"Workspace root",children:o.jsx(CE,{className:"h-4 w-4"})}),n.map((s,a)=>{const i=n.slice(0,a+1).join("/");return o.jsxs("div",{className:"flex items-center",children:[o.jsx(Vs,{className:"h-4 w-4 text-neutral3"}),o.jsx("button",{onClick:()=>t(i),className:"px-2 py-1 rounded hover:bg-surface4 text-neutral5 hover:text-neutral6 transition-colors truncate max-w-[150px]",title:s,children:s})]},i)})]})}function _In({entries:e,currentPath:t,isLoading:r,error:n,onNavigate:s,onFileSelect:a,onRefresh:i,onUpload:l,onCreateDirectory:c,onDelete:u,isCreatingDirectory:d,isDeleting:f}){const[h,p]=b.useState(null),m=[...e].sort((w,S)=>w.type==="directory"&&S.type!=="directory"?-1:w.type!=="directory"&&S.type==="directory"?1:w.name.localeCompare(S.name)),g=rOt(t),y=w=>{const S=g?w.name:`${t}/${w.name}`;w.type==="directory"?s(S):a?.(S)},x=w=>{const S=g?w.name:`${t}/${w.name}`;p(S)};return o.jsxs("div",{className:"rounded-lg border border-border1 overflow-hidden",children:[o.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-surface3 border-b border-border1",children:[o.jsx(kIn,{path:t,onNavigate:s}),o.jsxs("div",{className:"flex items-center gap-1",children:[i&&o.jsx(ce,{variant:"ghost",size:"md",onClick:i,disabled:r,"aria-label":"Refresh files",children:o.jsx(ER,{className:`h-4 w-4 ${r?"animate-spin":""}`})}),c&&o.jsx(ce,{variant:"ghost",size:"md",disabled:d,"aria-label":"Create directory",onClick:()=>{const w=prompt("Directory name:");if(w){const S=g?w:`${t}/${w}`;c(S)}},children:d?o.jsx(Aa,{className:"h-4 w-4 animate-spin"}):o.jsx(lF,{className:"h-4 w-4"})}),l&&o.jsx(ce,{variant:"ghost",size:"md",onClick:l,"aria-label":"Upload files",children:o.jsx(fF,{className:"h-4 w-4"})})]})]}),o.jsx("div",{className:"max-h-[400px] overflow-auto",children:r?o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx(Aa,{className:"h-6 w-6 animate-spin text-neutral3"})}):n?o.jsxs("div",{className:"py-12 px-4 text-center",children:[o.jsx("div",{className:"inline-flex items-center justify-center w-12 h-12 rounded-full bg-red-500/10 mb-4",children:o.jsx(eA,{className:"h-6 w-6 text-red-400"})}),o.jsx("p",{className:"text-sm text-neutral6 font-medium mb-1",children:"Failed to load directory"}),o.jsx("p",{className:"text-xs text-neutral4 max-w-sm mx-auto",children:OIn(n)})]}):m.length===0?o.jsx("div",{className:"py-12 text-center text-neutral4 text-sm",children:g?"Workspace is empty":"Directory is empty"}):o.jsx(ad,{children:o.jsxs("ul",{children:[!g&&o.jsx("li",{children:o.jsxs("button",{onClick:()=>{const w=t.split("/").slice(0,-1).join("/")||".";s(w)},className:"w-full flex items-center gap-3 px-4 py-2 hover:bg-surface4 transition-colors text-left",children:[o.jsx(CE,{className:"h-4 w-4 text-amber-400"}),o.jsx("span",{className:"text-sm text-neutral5",children:".."})]})}),m.map(w=>{const S=w.mount?.displayName||w.mount?.provider,k=w.mount?.status==="error";return o.jsx("li",{className:"group",children:o.jsxs("div",{className:"flex items-center hover:bg-surface4 transition-colors",children:[o.jsxs("button",{onClick:()=>y(w),className:"flex-1 flex items-center gap-3 px-4 py-2 text-left",children:[eOt(w),o.jsx("span",{className:"text-sm text-neutral6 flex-1 truncate",children:w.name}),w.mount&&k&&o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx("span",{tabIndex:0,className:"flex items-center",children:o.jsx(eA,{className:"h-4 w-4 text-red-400"})})}),o.jsxs(Wr,{className:"max-w-xs",children:[o.jsx("span",{className:"text-red-400",children:"Error:"})," ",w.mount.error||"Failed to connect to this filesystem"]})]}),w.mount&&S&&(w.mount.description?o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx("span",{tabIndex:0,className:`text-xs px-1.5 py-0.5 rounded ${k?"text-red-400 bg-red-400/10":"text-neutral3 bg-surface4"}`,children:S})}),o.jsx(Wr,{children:w.mount.description})]}):o.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${k?"text-red-400 bg-red-400/10":"text-neutral3 bg-surface4"}`,children:S})),w.type==="file"&&w.size!==void 0&&o.jsx("span",{className:"text-xs text-neutral3 tabular-nums",children:tOt(w.size)})]}),u&&!w.mount&&o.jsx("button",{onClick:()=>x(w),"aria-label":`Delete ${w.name}`,className:"p-2 opacity-0 group-hover:opacity-100 hover:text-red-400 text-neutral3 transition-all",children:o.jsx(ed,{className:"h-3.5 w-3.5"})})]})},w.name)})]})})}),o.jsx($t,{open:!!h,onOpenChange:w=>!f&&!w&&p(null),children:o.jsxs($t.Content,{children:[o.jsxs($t.Header,{children:[o.jsx($t.Title,{children:"Delete Item"}),o.jsxs($t.Description,{children:['Are you sure you want to delete "',h,'"? This action cannot be undone.']})]}),o.jsxs($t.Footer,{children:[o.jsx($t.Cancel,{disabled:f,children:"Cancel"}),o.jsxs($t.Action,{disabled:f,onClick:async()=>{try{h&&u&&await u(h)}finally{p(null)}},children:[f?o.jsx(Aa,{className:"h-4 w-4 animate-spin mr-2"}):null,"Delete"]})]})]})})]})}function EIn(e){return e&&{js:"javascript",jsx:"jsx",ts:"typescript",tsx:"tsx",json:"json",md:"markdown",mdx:"mdx",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",c:"c",cpp:"cpp",h:"c",hpp:"cpp",css:"css",scss:"scss",less:"less",html:"html",xml:"xml",yaml:"yaml",yml:"yaml",toml:"toml",sh:"bash",bash:"bash",zsh:"bash",sql:"sql",graphql:"graphql",gql:"graphql",dockerfile:"dockerfile",makefile:"makefile",vue:"vue",svelte:"svelte"}[e.toLowerCase()]||null}function CIn({content:e,language:t}){return o.jsx(nve,{language:t,style:sve.coldarkDark,customStyle:{margin:0,padding:"1rem",backgroundColor:"transparent",fontSize:"0.875rem"},codeTagProps:{style:{fontFamily:"var(--geist-mono), ui-monospace, monospace"}},children:e})}function jIn({path:e,content:t,isLoading:r,mimeType:n,onClose:s}){const a=e.split("/").pop()||e,i=a.split(".").pop()?.toLowerCase(),l=n?.startsWith("image/")||["png","jpg","jpeg","gif","svg","webp"].includes(i||""),c=EIn(i);return o.jsxs("div",{className:"rounded-lg border border-border1 overflow-hidden",children:[o.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-surface3 border-b border-border1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[eOt({name:a,type:"file"}),o.jsx("span",{className:"text-sm font-medium text-neutral6",children:a})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ta,{content:t,copyMessage:"Copied file content"}),s&&o.jsx(ce,{variant:"ghost",size:"md",onClick:s,children:"Close"})]})]}),o.jsx("div",{className:"max-h-[500px] overflow-auto h-full",style:{backgroundColor:"black"},children:r?o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx(Aa,{className:"h-6 w-6 animate-spin text-neutral3"})}):l?o.jsx("div",{className:"p-4 flex items-center justify-center",children:o.jsx("img",{src:`data:${n||"image/png"};base64,${btoa(t)}`,alt:a,className:"max-w-full max-h-[400px] object-contain"})}):c?o.jsx(CIn,{content:t,language:c}):o.jsx("pre",{className:"p-4 text-sm text-neutral5 whitespace-pre-wrap font-mono overflow-x-auto",children:t})})]})}const TIn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(yf,{}),titleSlot:"No Workspaces yet",descriptionSlot:o.jsxs(o.Fragment,{children:["Add a workspace to your Mastra configuration to ",o.jsx("br",{}),"manage files, skills, and enable semantic search."]}),actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",o.jsx(ba,{})]})})}),NIn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(WMt,{}),titleSlot:"Workspace Not Configured",descriptionSlot:o.jsxs(o.Fragment,{children:["No workspace is configured. Add a workspace to your ",o.jsx("br",{}),"Mastra configuration to manage files, skills, and enable semantic search."]}),actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",o.jsx(ba,{})]})})}),AIn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(eA,{}),titleSlot:"Workspace Not Supported",descriptionSlot:o.jsxs(o.Fragment,{children:["The workspace feature requires a newer version of ",o.jsx("code",{className:"text-neutral5",children:"@mastra/core"}),".",o.jsx("br",{}),"Please upgrade your dependencies to enable workspace functionality."]}),actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",o.jsx(ba,{})]})})}),ire={bm25:{label:"Keyword",icon:o.jsx(Yi,{className:"h-3.5 w-3.5"}),color:"bg-blue-500/10 text-blue-400 border-blue-500/30"},vector:{label:"Semantic",icon:o.jsx(g_,{className:"h-3.5 w-3.5"}),color:"bg-purple-500/10 text-purple-400 border-purple-500/30"},hybrid:{label:"Hybrid",icon:o.jsx(ALt,{className:"h-3.5 w-3.5"}),color:"bg-amber-500/10 text-amber-400 border-amber-500/30"}};function nOt(e){return e.id.replace(/#chunk-\d+$/,"")}function IIn({onSearch:e,isSearching:t,searchResults:r,canBM25:n,canVector:s,onViewResult:a}){const[i,l]=b.useState(""),[c,u]=b.useState(5),d=()=>n&&s?"hybrid":n?"bm25":s?"vector":"bm25",[f,h]=b.useState(d()),p=g=>{g.preventDefault(),i.trim()&&e({query:i.trim(),topK:c,mode:f})},m=[...n?["bm25"]:[],...s?["vector"]:[],...n&&s?["hybrid"]:[]];return o.jsxs("div",{className:"rounded-lg bg-surface4",children:[o.jsxs("form",{onSubmit:p,className:"p-4",children:[o.jsxs("div",{className:"flex gap-3 items-center",children:[o.jsxs("div",{className:"flex-1 relative",children:[o.jsx(TE,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-neutral3"}),o.jsx(ar,{value:i,onChange:g=>l(g.target.value),placeholder:"Search workspace files...",className:"pl-9 h-10 bg-surface2 border-border1"})]}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"text-xs text-neutral4",children:"Top"}),o.jsx(ar,{type:"number",min:1,max:50,value:c,onChange:g=>u(parseInt(g.target.value)||5),className:"w-14 h-10 text-center bg-surface2 border-border1",title:"Number of results"})]}),o.jsx(ce,{type:"submit",disabled:t||!i.trim(),size:"lg",className:"h-10 px-4",children:t?o.jsx(Aa,{className:"h-4 w-4 animate-spin"}):"Search"})]}),m.length>0&&o.jsx("div",{className:"flex gap-2 mt-3",children:m.map(g=>{const y=ire[g],x=f===g;return o.jsxs("button",{type:"button",onClick:()=>h(g),className:`
|
|
550
|
+
]`})]})]})}function WTn({errors:e,maxErrors:t=5}){if(e.length===0)return null;const r=e.slice(0,t),n=e.length-t;return o.jsxs("div",{className:"bg-accent2/10 border border-accent2/30 rounded-md p-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-accent2 mb-2",children:[o.jsx(Ce,{children:o.jsx(AE,{className:"w-4 h-4"})}),o.jsxs("span",{className:"font-medium text-sm",children:[e.length," validation error",e.length!==1?"s":""]})]}),o.jsx("ul",{className:"text-sm text-accent2/80 space-y-1",children:r.map((s,a)=>o.jsxs("li",{className:"flex gap-2",children:[o.jsx("span",{className:"shrink-0",children:"•"}),o.jsx("span",{children:s.message})]},a))}),n>0&&o.jsxs("div",{className:"text-xs text-accent2/60 mt-2",children:["+",n," more error",n!==1?"s":""]})]})}function GTn({datasetId:e,open:t,onOpenChange:r,onSuccess:n}){const[s,a]=b.useState("upload"),[i,l]=b.useState(null),[c,u]=b.useState({current:0,total:0}),[d,f]=b.useState(null),[h,p]=b.useState(!1),{parseFile:m,isParsing:g,error:y}=Jjn(),{batchInsertItems:x}=ni(),w=b.useCallback(async I=>{try{const P=await m(I);l(P),a("preview")}catch{}},[m]),S=b.useCallback(async()=>{if(!i||i.items.length===0)return;a("importing"),p(!0);const{items:I}=i;u({current:0,total:I.length});try{await x.mutateAsync({datasetId:e,items:I.map(P=>({input:P.input,groundTruth:P.groundTruth,metadata:P.metadata}))}),f({success:I.length,errors:0})}catch{f({success:0,errors:I.length})}u({current:I.length,total:I.length}),p(!1),a("complete")},[i,x,e]),k=b.useCallback(()=>{r(!1),n?.(),d&&d.success>0&&ze.success(`Imported ${d.success} item${d.success!==1?"s":""}`),setTimeout(()=>{a("upload"),l(null),u({current:0,total:0}),f(null)},150)},[r,n,d]),_=b.useCallback(()=>{h||(r(!1),setTimeout(()=>{a("upload"),l(null),u({current:0,total:0}),f(null)},150))},[h,r]),E=i&&i.items.length>0&&i.errors.length===0,T=()=>{switch(s){case"upload":return o.jsx(QTn,{onFileSelect:w,isParsing:g,error:y?.message});case"preview":return i?o.jsx("div",{className:"flex flex-col gap-4",children:i.errors.length>0?o.jsxs(o.Fragment,{children:[o.jsx(WTn,{errors:i.errors}),o.jsx("div",{className:"text-sm text-neutral4",children:"Please fix the errors in your JSON file and try again."})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"text-sm text-neutral4",children:["Found ",i.items.length," valid item",i.items.length!==1?"s":""," to import."]}),o.jsx(HTn,{items:i.items,maxRows:5})]})}):null;case"importing":return o.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[o.jsx(Dt,{size:"lg"}),o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"text-lg font-medium text-neutral1",children:"Importing items..."}),o.jsxs("div",{className:"text-sm text-neutral4 mt-1",children:[c.current," of ",c.total]})]})]});case"complete":return o.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[o.jsx("div",{className:"text-4xl",children:d&&d.errors===0?"✓":"⚠"}),o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"text-lg font-medium text-neutral1",children:"Import Complete"}),o.jsxs("div",{className:"text-sm text-neutral4 mt-1",children:[d?.success??0," item",d?.success!==1?"s":""," imported",d&&d.errors>0&&o.jsxs("span",{className:"text-accent2",children:[" ","(",d.errors," error",d.errors!==1?"s":"",")"]})]})]})]})}},j=()=>{switch(s){case"upload":return o.jsx(ce,{onClick:_,children:"Cancel"});case"preview":return o.jsxs(o.Fragment,{children:[o.jsx(ce,{onClick:()=>a("upload"),children:"Back"}),o.jsxs(ce,{variant:"primary",onClick:S,disabled:!E,children:["Import ",i?.items.length??0," Item",i?.items.length!==1?"s":""]})]});case"importing":return null;case"complete":return o.jsx(ce,{variant:"primary",onClick:k,children:"Done"})}},N={upload:"Import JSON",preview:"Preview Data",importing:"Importing",complete:"Import Complete"};return o.jsx(On,{open:t,onOpenChange:_,children:o.jsxs(vn,{className:"max-w-2xl max-h-[90vh]",children:[o.jsxs(kn,{children:[o.jsx(bn,{children:N[s]}),o.jsx(qs,{children:"Import dataset items from a JSON file."})]}),o.jsx(Bn,{className:"min-h-[200px] max-h-[50vh] overflow-y-auto",children:T()}),o.jsx(uf,{className:"px-6 pt-4 flex justify-end gap-2",children:j()})]})})}function ZTn({dataset:e,isLoading:t=!1,onEditClick:r,onDuplicateClick:n,onDeleteClick:s,experimentTriggerSlot:a,disableExperimentTrigger:i=!1,onExperimentClick:l,className:c}){return o.jsxs(Ir,{className:c,children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{isLoading:t,children:[o.jsx(Na,{})," ",e?.name]}),o.jsx(Ir.Description,{isLoading:t,children:e?.description}),o.jsxs(Ir.Description,{isLoading:t,children:[o.jsxs(Zn,{children:[o.jsx(h_,{})," Created at ",e?.createdAt?tr(new Date(e.createdAt),"MMM d, yyyy"):""]}),o.jsxs(Zn,{children:[o.jsx(Vx,{})," Latest version v",e?.version??""]})]})]}),o.jsx(Ir.Column,{children:o.jsxs(ps,{children:[a?i?o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx("span",{className:"cursor-not-allowed",children:o.jsx("div",{className:"pointer-events-none opacity-50",inert:!0,"aria-disabled":"true",children:a})})}),o.jsx(Wr,{children:"Add items to the dataset before running an experiment"})]}):a:l?i?o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx("span",{className:"cursor-not-allowed",children:o.jsxs(ce,{disabled:!0,tabIndex:-1,children:[o.jsx(ux,{}),"Run Experiment"]})})}),o.jsx(Wr,{children:"Add items to the dataset before running an experiment"})]}):o.jsxs(ce,{onClick:l,children:[o.jsx(ux,{}),"Run Experiment"]}):null,o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsx(ce,{size:"default","aria-label":"Dataset actions menu",children:o.jsx(yVe,{})})}),o.jsxs(yt.Content,{align:"end",className:"w-48",children:[o.jsxs(yt.Item,{onSelect:r,children:[o.jsx(iv,{})," Edit Dataset"]}),o.jsxs(yt.Item,{onSelect:n,children:[o.jsx(tu,{})," Duplicate Dataset"]}),o.jsxs(yt.Item,{onSelect:s,className:"text-red-500 focus:text-red-400",children:[o.jsx(ed,{})," Delete Dataset"]})]})]})]})})]})}const z1t=e=>{const t=Ge(),{data:r}=xR(e),n=r?.experiments;return kt({queryKey:["dataset-review-items",e,n?.map(s=>s.id)],queryFn:async()=>!n||n.length===0?[]:(await Promise.all(n.map(async a=>{if(!a.datasetId)return[];try{const{results:i}=await t.listDatasetExperimentResults(a.datasetId,a.id);return i.filter(l=>l.status==="needs-review").map(l=>({id:l.id,input:l.input,output:l.output,error:l.error,itemId:l.itemId,experimentId:l.experimentId,datasetId:a.datasetId??void 0,traceId:l.traceId??void 0,scores:l.scores?Object.fromEntries(l.scores.map(c=>[c.scorerId,c.score??0])):{},tags:l.tags??[],comment:""}))}catch{return[]}}))).flat(),enabled:!!e&&!!n&&n.length>0,refetchOnWindowFocus:!1})},YTn=e=>{const t=Ge(),{data:r}=xR(e),n=r?.experiments;return kt({queryKey:["dataset-completed-items",e,n?.map(s=>s.id)],queryFn:async()=>!n||n.length===0?[]:(await Promise.all(n.map(async a=>{if(!a.datasetId)return[];try{const{results:i}=await t.listDatasetExperimentResults(a.datasetId,a.id);return i.filter(l=>l.status==="complete").map(l=>({id:l.id,input:l.input,output:l.output,error:l.error,itemId:l.itemId,experimentId:l.experimentId,datasetId:a.datasetId??void 0,traceId:l.traceId??void 0,scores:l.scores?Object.fromEntries(l.scores.map(c=>[c.scorerId,c.score??0])):{},tags:l.tags??[],comment:""}))}catch{return[]}}))).flat(),enabled:!!e&&!!n&&n.length>0,refetchOnWindowFocus:!1})};function XTn(e,t){if(typeof e=="string")return e.length>t?e.slice(0,t)+"...":e;try{const r=JSON.stringify(e);return r.length>t?r.slice(0,t)+"...":r}catch{return String(e)}}const KTn=Y("bg-surface5 backdrop-blur-xl z-50 min-w-32 overflow-auto rounded-lg p-2 shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95");function M8e({className:e,children:t,...r}){return o.jsx(aP,{children:o.jsx(fz,{className:Y(KTn,e),...r,children:t})})}function JTn({datasetId:e}){const t=Ge(),{data:r}=Tg(e),{data:n,isLoading:s}=z1t(e),{data:a,isLoading:i}=YTn(e),{updateExperimentResult:l}=ni(),[c,u]=b.useState(null),[d,f]=b.useState(null),[h,p]=b.useState(new Set),[m,g]=b.useState(!1),[y,x]=b.useState(!1),[w,S]=b.useState(!1),[k,_]=b.useState(""),[E,T]=b.useState(""),[j,N]=b.useState(""),[I,P]=b.useState([]),[R,B]=b.useState(!1),[D,$]=b.useState(null),U=D??n??[];b.useEffect(()=>{n&&D===null&&$(n)},[n]);const z=b.useMemo(()=>{const ge=new Set;if(r?.tags)for(const Ee of r.tags)ge.add(Ee);for(const Ee of U)for(const Fe of Ee.tags)ge.add(Fe);return[...ge].sort()},[r,U]),H=b.useCallback(ge=>{!r||!e||(r.tags??[]).includes(ge)},[r,e]),Q=b.useMemo(()=>d?d==="__untagged__"?U.filter(ge=>ge.tags.length===0):U.filter(ge=>ge.tags.includes(d)):U,[U,d]),L=b.useMemo(()=>{const ge=new Map;for(const Ee of U)for(const Fe of Ee.tags)ge.set(Fe,(ge.get(Fe)??0)+1);return[...ge.entries()].sort((Ee,Fe)=>Fe[1]-Ee[1])},[U]),Z=b.useMemo(()=>U.filter(ge=>ge.tags.length===0).length,[U]),V=b.useMemo(()=>{let ge=0;return d&&ge++,m&&ge++,ge},[d,m]),M=b.useCallback((ge,Ee)=>{$(ct=>(ct??[]).map(wt=>wt.id===ge?{...wt,tags:Ee}:wt));const Fe=U.find(ct=>ct.id===ge);Fe?.experimentId&&Fe?.datasetId&&l.mutate({datasetId:Fe.datasetId,experimentId:Fe.experimentId,resultId:Fe.id,tags:Ee})},[U,l]),W=b.useCallback((ge,Ee)=>{const Fe=U.find(ct=>ct.id===ge);Fe?.traceId&&Ee!==void 0&&t.createFeedback({feedback:{traceId:Fe.traceId,source:"studio",feedbackSource:"studio",feedbackType:"rating",value:Ee==="positive"?1:-1,experimentId:Fe.experimentId??void 0,sourceId:Fe.id}}).catch(()=>{}),$(ct=>(ct??[]).map(wt=>wt.id===ge?{...wt,rating:Ee}:wt))},[U,t]),G=b.useCallback((ge,Ee)=>{const Fe=U.find(ct=>ct.id===ge);Fe?.traceId&&t.createFeedback({feedback:{traceId:Fe.traceId,source:"studio",feedbackSource:"studio",feedbackType:"comment",value:Ee,comment:Ee,experimentId:Fe.experimentId??void 0,sourceId:Fe.id}}).catch(()=>{}),$(ct=>(ct??[]).map(wt=>wt.id===ge?{...wt,comment:Ee}:wt))},[U,t]),J=b.useCallback(ge=>{const Ee=U.find(Fe=>Fe.id===ge);$(Fe=>(Fe??[]).filter(ct=>ct.id!==ge)),p(Fe=>{const ct=new Set(Fe);return ct.delete(ge),ct}),c===ge&&u(null),Ee?.experimentId&&Ee?.datasetId&&l.mutate({datasetId:Ee.datasetId,experimentId:Ee.experimentId,resultId:Ee.id,status:null})},[U,l,c]),ae=b.useCallback(ge=>{const Ee=U.find(Fe=>Fe.id===ge);$(Fe=>(Fe??[]).filter(ct=>ct.id!==ge)),p(Fe=>{const ct=new Set(Fe);return ct.delete(ge),ct}),c===ge&&u(null),Ee?.experimentId&&Ee?.datasetId&&l.mutate({datasetId:Ee.datasetId,experimentId:Ee.experimentId,resultId:Ee.id,status:"complete"})},[U,l,c]),te=b.useMemo(()=>{const ge=m?a??[]:Q;return!m||!d?ge:d==="__untagged__"?ge.filter(Ee=>Ee.tags.length===0):ge.filter(Ee=>Ee.tags.includes(d))},[m,a,Q,d]),re=m?i:!1,ie=b.useMemo(()=>new Set(te.map(ge=>ge.id)),[te]),he=b.useMemo(()=>[...h].filter(ge=>ie.has(ge)).length,[h,ie]),X=te.length>0&&he===te.length,se=he>0&&!X,le=b.useCallback(ge=>{p(Ee=>{const Fe=new Set(Ee);return Fe.has(ge)?Fe.delete(ge):Fe.add(ge),Fe})},[]),xe=b.useCallback(()=>{p(X?new Set:new Set(te.map(ge=>ge.id)))},[X,te]),de=b.useCallback(ge=>{for(const Ee of h){const Fe=U.find(ct=>ct.id===Ee);Fe&&!Fe.tags.includes(ge)&&M(Ee,[...Fe.tags,ge])}},[U,h,M]),ue=b.useCallback(ge=>{for(const Ee of h){const Fe=U.find(ct=>ct.id===Ee);Fe&&Fe.tags.includes(ge)&&M(Ee,Fe.tags.filter(ct=>ct!==ge))}},[U,h,M]),ve=b.useCallback(()=>{for(const ge of h)ae(ge);p(new Set)},[h,ae]),we=b.useCallback(()=>{for(const ge of h)J(ge);p(new Set)},[h,J]),Ne=b.useCallback(()=>{_(""),S(!0)},[]),K=b.useCallback(async()=>{if(!(!E||!j)){x(!0),S(!1);try{const ge=U.filter(Fe=>h.has(Fe.id));if(ge.length===0){x(!1);return}const Ee=await t.clusterFailures({modelId:`${E}/${j}`,items:ge.map(Fe=>({id:Fe.id,input:Fe.input,output:Fe.output??void 0,error:typeof Fe.error=="string"?Fe.error:Fe.error?String(Fe.error):void 0,scores:Fe.scores,existingTags:Fe.tags.length>0?Fe.tags:void 0})),availableTags:z.length>0?z:void 0,prompt:k||void 0});Ee.proposedTags&&Ee.proposedTags.length>0&&(P(Ee.proposedTags.map(Fe=>({...Fe,accepted:!0}))),B(!0))}catch(ge){console.error("Analysis failed:",ge)}finally{x(!1)}}},[E,j,U,h,t,z,k]),oe=b.useCallback(()=>{for(const ge of I){if(!ge.accepted)continue;const Ee=U.find(Fe=>Fe.id===ge.itemId);if(Ee){const Fe=[...new Set([...Ee.tags,...ge.tags])];M(Ee.id,Fe)}}B(!1)},[I,U,M]),be=b.useCallback(ge=>{u(Ee=>Ee===ge?null:ge)},[]),Ae=b.useMemo(()=>c?te.find(ge=>ge.id===c)??null:null,[c,te]),$e=b.useCallback(()=>{if(!c||te.length===0)return;const ge=te.findIndex(Ee=>Ee.id===c);ge<te.length-1&&u(te[ge+1].id)},[c,te]),ye=b.useCallback(()=>{if(!c||te.length===0)return;const ge=te.findIndex(Ee=>Ee.id===c);ge>0&&u(te[ge-1].id)},[c,te]),ke=Ae?"2rem 1fr 10rem 8rem":"2rem 1fr 10rem 8rem 6rem 6rem";return s?o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(Dt,{className:"w-6 h-6"})}):o.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[o.jsx(On,{open:w,onOpenChange:S,children:o.jsxs(vn,{children:[o.jsxs(kn,{children:[o.jsx(bn,{children:"Analyze Items"}),o.jsx(qs,{children:"Use an LLM to automatically suggest tags for the selected items."})]}),o.jsxs("div",{className:"space-y-4 py-2",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsxs("div",{children:[o.jsx(xt,{className:"text-xs mb-1 block",children:"Provider"}),o.jsx(Ng,{value:E,onValueChange:T})]}),o.jsxs("div",{children:[o.jsx(xt,{className:"text-xs mb-1 block",children:"Model"}),o.jsx(Ag,{llmId:E,value:j,onValueChange:N})]})]}),o.jsxs(me,{variant:"ui-xs",className:"text-neutral3",children:[h.size," item",h.size!==1?"s":""," will be analyzed"]}),o.jsxs("div",{children:[o.jsx(xt,{className:"text-xs",children:"Instructions (optional)"}),o.jsx(gc,{value:k,onChange:ge=>_(ge.target.value),placeholder:"E.g., Focus on safety issues and factual errors...",rows:3,className:"text-xs mt-1"})]})]}),o.jsxs(uf,{children:[o.jsx(ce,{variant:"outline",onClick:()=>S(!1),children:"Cancel"}),o.jsxs(ce,{onClick:K,disabled:!E||!j||y,children:[y?o.jsx(Dt,{className:"w-4 h-4 mr-1"}):null,"Analyze"]})]})]})}),o.jsx(On,{open:R,onOpenChange:B,children:o.jsxs(vn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(kn,{children:[o.jsx(bn,{children:"Review Proposed Tags"}),o.jsxs(qs,{children:[I.filter(ge=>ge.accepted).length," of ",I.length," proposals selected"]})]}),o.jsx("div",{className:"space-y-3 py-2",children:I.map((ge,Ee)=>{const Fe=U.find(ct=>ct.id===ge.itemId);return o.jsx("div",{className:Y("p-3 border rounded-lg",!ge.accepted&&"opacity-50"),children:o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(fi,{checked:ge.accepted,onCheckedChange:ct=>P(wt=>wt.map((lr,Ve)=>Ve===Ee?{...lr,accepted:!!ct}:lr))}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx(me,{variant:"ui-xs",className:"text-neutral4 truncate block",children:Fe?typeof Fe.input=="string"?Fe.input.slice(0,100):JSON.stringify(Fe.input).slice(0,100):ge.itemId}),o.jsx("div",{className:"flex gap-1 flex-wrap mt-1.5",children:ge.tags.map((ct,wt)=>o.jsx(I1t,{tag:ct,onRename:lr=>P(Ve=>Ve.map((qe,Ie)=>Ie===Ee?{...qe,tags:qe.tags.map((Le,Re)=>Re===wt?lr:Le)}:qe)),onRemove:()=>P(lr=>lr.map((Ve,qe)=>qe===Ee?{...Ve,tags:Ve.tags.filter((Ie,Le)=>Le!==wt)}:Ve))},`${ct}-${wt}`))}),ge.reason&&o.jsx(me,{variant:"ui-xs",className:"text-neutral3 mt-1 block italic",children:ge.reason})]})]})},ge.itemId)})}),o.jsxs(uf,{children:[o.jsx(ce,{variant:"outline",onClick:()=>B(!1),children:"Cancel"}),o.jsxs(ce,{onClick:oe,disabled:I.filter(ge=>ge.accepted).length===0,children:["Accept ",I.filter(ge=>ge.accepted).length," proposals"]})]})]})}),o.jsxs(tf,{className:Ae?"grid-cols-[1fr_1fr]":"",children:[o.jsxs(gr,{children:[o.jsxs(gr.Toolbar,{children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsxs(ce,{variant:"outline",size:"md",children:[o.jsx(vVe,{}),"Filter",V>0&&o.jsx("span",{className:Y("ml-0.5 inline-flex items-center justify-center rounded-full bg-accent1/50 text-neutral5 text-ui-sm w-5 h-5"),children:V})]})}),o.jsxs(yt.Content,{align:"start",className:Y("min-w-48"),children:[o.jsxs(yt.Sub,{children:[o.jsxs(yt.SubTrigger,{children:["Status",m&&o.jsx("span",{className:Y("ml-auto text-ui-sm text-accent1"),children:"1"})]}),o.jsxs(M8e,{children:[o.jsx(yt.CheckboxItem,{checked:!m,onCheckedChange:()=>{g(!1),u(null)},onSelect:ge=>ge.preventDefault(),children:"Review Queue"}),o.jsx(yt.CheckboxItem,{checked:m,onCheckedChange:()=>{g(!0),u(null)},onSelect:ge=>ge.preventDefault(),children:"Completed"})]})]}),o.jsxs(yt.Sub,{children:[o.jsxs(yt.SubTrigger,{children:["Tags",d&&o.jsx("span",{className:Y("ml-auto text-ui-sm text-accent1"),children:"1"})]}),o.jsxs(M8e,{children:[o.jsx(yt.CheckboxItem,{checked:!d,onCheckedChange:()=>f(null),onSelect:ge=>ge.preventDefault(),children:"All"}),Z>0&&o.jsx(yt.CheckboxItem,{checked:d==="__untagged__",onCheckedChange:()=>f(d==="__untagged__"?null:"__untagged__"),onSelect:ge=>ge.preventDefault(),children:"Untagged"}),L.length>0&&o.jsx(yt.Separator,{}),L.map(([ge])=>o.jsx(yt.CheckboxItem,{checked:d===ge,onCheckedChange:()=>f(d===ge?null:ge),onSelect:Ee=>Ee.preventDefault(),children:ge},ge))]})]}),V>0&&o.jsxs(o.Fragment,{children:[o.jsx(yt.Separator,{}),o.jsxs(yt.Item,{onSelect:()=>{f(null),g(!1),u(null)},children:[o.jsx(Nn,{}),"Clear all filters"]})]})]})]}),V>0&&o.jsxs(ce,{variant:"outline",size:"md",onClick:()=>{f(null),g(!1),u(null)},children:[o.jsx(Nn,{}),"Reset"]})]}),!m&&h.size>0&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(A1t,{selectedCount:h.size,vocabulary:z,onApplyTag:de,onRemoveTag:ue,onNewTag:ge=>de(ge)}),o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsxs(ce,{disabled:y,children:[y?o.jsx(Dt,{className:"w-4 h-4"}):o.jsx(Ce,{size:"sm",children:o.jsx(as,{})}),"Actions"]})}),o.jsxs(yt.Content,{align:"end",children:[o.jsxs(yt.Item,{onSelect:ve,children:[o.jsx(Ce,{size:"sm",children:o.jsx(Jw,{})}),"Complete"]}),o.jsxs(yt.Item,{onSelect:we,children:[o.jsx(Ce,{size:"sm",children:o.jsx(ed,{})}),"Remove"]}),o.jsx(yt.Separator,{}),o.jsxs(yt.Item,{onSelect:Ne,children:[o.jsx(Ce,{size:"sm",children:o.jsx(g_,{})}),"Analyze"]})]})]})]})]}),re?o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(Dt,{className:"w-6 h-6"})}):te.length===0?o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsxs("div",{className:"text-center px-8",children:[o.jsx(me,{variant:"ui-sm",className:"text-neutral3 block",children:m?"No completed reviews yet":"No items to review"}),o.jsx(me,{variant:"ui-xs",className:"text-neutral3 mt-2 block",children:m?"Items marked as complete will appear here for auditing.":"When experiment results are flagged for review, they will appear here."})]})}):o.jsxs(Se,{columns:ke,children:[o.jsxs(Se.Top,{children:[!m&&o.jsx(Se.TopCell,{children:o.jsx(fi,{checked:X?!0:se?"indeterminate":!1,onCheckedChange:()=>xe(),"aria-label":"Select all"})}),m&&o.jsx(Se.TopCell,{children:" "}),o.jsx(Se.TopCell,{children:"Input"}),o.jsx(Se.TopCell,{children:"Comment"}),o.jsx(Se.TopCell,{children:"Tags"}),!Ae&&o.jsx(Se.TopCell,{children:"Rating"}),!Ae&&o.jsx(Se.TopCell,{children:"Scores"})]}),o.jsx(Se.Rows,{children:te.map(ge=>{const Ee=ge.scores?Object.entries(ge.scores):[];return o.jsxs(Se.Row,{onClick:()=>be(ge.id),selected:c===ge.id,children:[o.jsx(Se.Cell,{children:m?ge.error?o.jsx("div",{className:"w-2 h-2 rounded-full bg-red-700",title:"Error"}):o.jsx("div",{className:"w-2 h-2 rounded-full bg-green-600",title:"Success"}):o.jsx(fi,{checked:h.has(ge.id),onCheckedChange:()=>le(ge.id),onClick:Fe=>Fe.stopPropagation(),"aria-label":`Select item ${ge.id}`})}),o.jsx(Se.NameCell,{children:XTn(ge.input,80)}),o.jsx(Se.Cell,{children:ge.comment?o.jsx(me,{variant:"ui-xs",className:"text-neutral3 truncate",children:ge.comment}):o.jsx(me,{variant:"ui-xs",className:"text-neutral2",children:"—"})}),o.jsx(Se.Cell,{children:ge.tags.length>0?o.jsx(me,{variant:"ui-xs",className:"text-neutral4 truncate",children:ge.tags.join(", ")}):o.jsx(me,{variant:"ui-xs",className:"text-neutral2",children:"—"})}),!Ae&&o.jsxs(Se.Cell,{children:[ge.rating==="positive"&&o.jsx(Ce,{size:"sm",className:"text-positive1",children:o.jsx(uce,{})}),ge.rating==="negative"&&o.jsx(Ce,{size:"sm",className:"text-negative1",children:o.jsx(cce,{})}),!ge.rating&&o.jsx(me,{variant:"ui-xs",className:"text-neutral2",children:"—"})]}),!Ae&&o.jsx(Se.Cell,{children:Ee.length>0?o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Ce,{size:"sm",className:"text-neutral3",children:o.jsx(La,{})}),o.jsx(me,{variant:"ui-xs",className:"text-neutral4 font-mono",children:Ee[0][1].toFixed(2)}),Ee.length>1&&o.jsxs(vt,{variant:"default",children:["+",Ee.length-1]})]}):o.jsx(me,{variant:"ui-xs",className:"text-neutral2",children:"—"})})]},ge.id)})})]})]}),Ae&&o.jsx(N1t,{item:Ae,isCompleted:m,tagVocabulary:z,onRate:ge=>W(Ae.id,ge),onSetTags:ge=>{M(Ae.id,ge);for(const Ee of ge)z.includes(Ee)||H(Ee)},onComment:ge=>G(Ae.id,ge),onRemove:()=>J(Ae.id),onComplete:m?void 0:()=>ae(Ae.id),onPrevious:ye,onNext:$e,onClose:()=>u(null)})]})]})}function eNn({datasetId:e,onExperimentClick:t,onEditClick:r,onDeleteClick:n,onAddItemClick:s,experimentTriggerSlot:a,onNavigateToDataset:i,activeDatasetVersion:l,onVersionSelect:c,initialTab:u,onTabChange:d}){const{navigate:f}=or(),[h,p]=b.useState(u??"items"),m=Ut=>{p(Ut),d?.(Ut)},[g,y]=b.useState(!1),[x,w]=b.useState(!1),[S,k]=b.useState(!1),[_,E]=b.useState([]),[T,j]=b.useState(!1),[N,I]=b.useState([]),[P,R]=b.useState(!1),[B,D]=b.useState([]),[$,U]=b.useState(!1),[z,H]=b.useState(0),[Q,L]=b.useState(null),[Z,V]=b.useState(""),[M]=aur(Z,300),[W,G]=b.useState(null),ae=l!==void 0?l:W,{data:te,isLoading:re}=Tg(e),{data:ie=[],total:he,isLoading:X,setEndOfListElement:se,isFetchingNextPage:le,hasNextPage:xe}=OE(e,M||void 0,ae),{data:de=[],total:ue,isLoading:ve}=OE(e,void 0,ae),[we,Ne]=b.useState({}),{data:K,isLoading:oe}=xR(e,void 0,we),{data:be}=xR(e),{deleteItems:Ae}=ni(),$e=K?.experiments??[],ye=be?.experiments??[],ke=yTn({hasSearchQuery:!!M,filteredItemsLength:ie.length,unfilteredItemsTotal:ue,itemsTotal:he}),{data:ge}=z1t(e),Ee=ge?.length??0,Fe=Ut=>{L(Ut)},ct=()=>{L(null)},wt=Ut=>{const $r=Ut.isCurrent?null:Ut;c?c($r):G(Ut.isCurrent?null:Ut.version)},lr=Ut=>{E(Ut),k(!0)},Ve=Ut=>{I(Ut),j(!0)},qe=Ut=>{j(Ut),Ut||(I([]),H($r=>$r+1))},Ie=Ut=>{f(`/datasets/${e}/items?items=${Ut.join(",")}`)},Le=Ut=>{f(`/datasets/${e}/versions?ids=${Ut.join(",")}`)},Re=Ut=>{D(Ut),R(!0)},it=async()=>{await Ae.mutateAsync({datasetId:e,itemIds:B}),ze.success(`Deleted ${B.length} items`),R(!1),D([]),H(Ut=>Ut+1)},rt=Ut=>{k(!1),E([]),H($r=>$r+1),i?.(Ut)},ht=Ut=>{k(Ut),Ut||(E([]),H($r=>$r+1))};return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsx("div",{className:Y("h-full w-full",ln.allSlow),children:o.jsxs("div",{className:Y("grid grid-rows-[auto_1fr] mx-auto h-full w-full m-auto",Q?"max-w-[120rem]":"max-w-[90rem]"),children:[o.jsx(ZTn,{dataset:te,isLoading:re,onEditClick:r,onDuplicateClick:()=>U(!0),onDeleteClick:n,experimentTriggerSlot:a,disableExperimentTrigger:!ve&&de.length===0,onExperimentClick:t}),o.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:o.jsxs(Ef,{defaultTab:"items",value:h,onValueChange:m,className:"grid grid-rows-[auto_1fr] h-full",children:[o.jsxs(Cf,{children:[o.jsxs(hs,{value:"items",children:["Items ",o.jsx(za,{color:"gray",children:ke})]}),o.jsxs(hs,{value:"experiments",children:["Experiments",o.jsx(za,{color:"gray",children:$e.length})]}),o.jsxs(hs,{value:"review",children:["Review",Ee>0&&o.jsx(za,{color:"orange",children:Ee})]})]}),o.jsx(Ns,{value:"items",className:"grid overflow-auto mt-5",children:o.jsx(qTn,{datasetId:e,items:ie,isLoading:X,featuredItemId:Q,onItemSelect:Fe,onItemClose:ct,onAddClick:s??(()=>{}),onImportClick:()=>y(!0),onImportJsonClick:()=>w(!0),onBulkDeleteClick:Re,onCreateDatasetClick:lr,onAddToDatasetClick:Ve,onCompareItemsClick:Ie,datasetName:te?.name,clearSelectionTrigger:z,setEndOfListElement:se,isFetchingNextPage:le,hasNextPage:xe,searchQuery:Z,onSearchChange:V,activeDatasetVersion:ae,currentDatasetVersion:te?.version,onVersionSelect:wt,onCompareVersionsClick:Le})}),o.jsx(Ns,{value:"experiments",className:"grid overflow-auto mt-5",children:o.jsx(RTn,{experiments:$e,allExperiments:ye,isLoading:oe,datasetId:e,filters:we,onFiltersChange:Ne})}),o.jsx(Ns,{value:"review",className:"overflow-auto mt-0",children:o.jsx(JTn,{datasetId:e})})]})})]})})}),o.jsx(_Tn,{datasetId:e,open:g,onOpenChange:y}),o.jsx(GTn,{datasetId:e,open:x,onOpenChange:w}),o.jsx(dTn,{open:S,onOpenChange:ht,items:_,onSuccess:rt}),o.jsx(fTn,{open:T,onOpenChange:qe,items:N,currentDatasetId:e}),o.jsx(hTn,{open:$,onOpenChange:U,sourceDatasetId:e,sourceDatasetName:te?.name||"",sourceDatasetDescription:te?.description,onSuccess:i}),o.jsx($t,{open:P,onOpenChange:R,children:o.jsxs($t.Content,{children:[o.jsxs($t.Header,{children:[o.jsx($t.Title,{children:"Delete Items"}),o.jsxs($t.Description,{children:["Are you sure you want to delete ",B.length," item",B.length!==1?"s":"","? This action cannot be undone."]})]}),o.jsxs($t.Footer,{children:[o.jsx($t.Cancel,{children:"Cancel"}),o.jsx($t.Action,{onClick:it,children:Ae.isPending?"Deleting...":"Delete"})]})]})})]})}function tNn(e){if(!(e instanceof Error))return null;const t=e.message.match(/- ({.*})$/);if(!t)return null;try{const r=JSON.parse(t[1]);if(r.field&&Array.isArray(r.errors))return{field:r.field,errors:r.errors}}catch{}return null}function D8e({field:e,errors:t}){return t.length?o.jsx("div",{className:"mt-2 space-y-1",children:t.map((r,n)=>o.jsxs("p",{className:"text-xs text-destructive",children:[o.jsxs("code",{className:"bg-destructive/10 px-1 rounded",children:[e,r.path!=="/"?r.path:""]}),": ",r.message]},n))}):null}function rNn({datasetId:e,open:t,onOpenChange:r,onSuccess:n}){const[s,a]=b.useState("{}"),[i,l]=b.useState(""),[c,u]=b.useState(""),[d,f]=b.useState(null),{addItem:h}=ni(),p=async x=>{x.preventDefault();let w;try{w=JSON.parse(s)}catch{ze.error("Input must be valid JSON");return}let S;if(i.trim())try{S=JSON.parse(i)}catch{ze.error("Ground Truth must be valid JSON");return}let k;if(c.trim())try{k=JSON.parse(c)}catch{ze.error("Expected Trajectory must be valid JSON");return}try{await h.mutateAsync({datasetId:e,input:w,groundTruth:S,expectedTrajectory:k}),ze.success("Item added successfully"),f(null),a("{}"),l(""),u(""),r(!1),n?.()}catch(_){const E=tNn(_);E?f(E):ze.error(`Failed to add item: ${_ instanceof Error?_.message:"Unknown error"}`)}},m=x=>{a(x),d?.field==="input"&&f(null)},g=x=>{l(x),d?.field==="groundTruth"&&f(null)},y=()=>{a("{}"),l(""),u(""),f(null),r(!1)};return o.jsx(On,{open:t,onOpenChange:r,children:o.jsxs(vn,{className:"max-w-lg",children:[o.jsx(kn,{children:o.jsx(bn,{children:"Add Item"})}),o.jsx(Bn,{children:o.jsxs("form",{onSubmit:p,className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(xt,{htmlFor:"item-input",children:"Input (JSON) *"}),o.jsx(Xn,{value:s,onChange:m,showCopyButton:!1,className:"min-h-[120px]"}),d?.field==="input"&&o.jsx(D8e,{field:"input",errors:d.errors})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(xt,{htmlFor:"item-ground-truth",children:"Ground Truth (JSON, optional)"}),o.jsx(Xn,{value:i,onChange:g,showCopyButton:!1,className:"min-h-[80px]"}),d?.field==="groundTruth"&&o.jsx(D8e,{field:"groundTruth",errors:d.errors})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(xt,{htmlFor:"item-trajectory",children:"Expected Trajectory (JSON, optional)"}),o.jsx(Xn,{value:c,onChange:u,showCopyButton:!1,className:"min-h-[80px]"})]}),o.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[o.jsx(ce,{type:"button",onClick:y,children:"Cancel"}),o.jsx(ce,{type:"submit",variant:"primary",disabled:h.isPending,children:h.isPending?"Adding...":"Add Item"})]})]})})]})})}function nNn({selectedScorers:e,setSelectedScorers:t,disabled:r=!1,container:n}){const{data:s,isLoading:a}=cd(),i=b.useMemo(()=>s?Object.entries(s).map(([l,c])=>({value:l,label:c.scorer?.config?.name||l,description:c.scorer?.config?.description||""})):[],[s]);return o.jsxs("div",{className:"grid gap-2",children:[o.jsx(xt,{children:"Scorers (Optional)"}),o.jsx(Ddt,{options:i,value:e,onValueChange:t,placeholder:"Select scorers...",searchPlaceholder:"Search scorers...",emptyText:"No scorers available",disabled:r||a,container:n})]})}const sNn=[{value:"agent",label:"Agent"},{value:"workflow",label:"Workflow"},{value:"scorer",label:"Scorer"}];function aNn({targetType:e,setTargetType:t,targetId:r,setTargetId:n,container:s}){const{data:a,isLoading:i}=Eg(),{data:l,isLoading:c}=c0(),{data:u,isLoading:d}=cd(),f=e==="agent"?Object.entries(a??{}).map(([g,y])=>({value:g,label:y.name??g})):e==="workflow"?Object.entries(l??{}).map(([g,y])=>({value:g,label:y.name??g})):e==="scorer"?Object.entries(u??{}).map(([g,y])=>({value:g,label:y.scorer?.config?.name??g})):[],h=e==="agent"&&i||e==="workflow"&&c||e==="scorer"&&d,p=g=>{t(g),n("")},m=e==="agent"?"Agent":e==="workflow"?"Workflow":"Scorer";return o.jsxs("div",{className:"grid gap-6",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(xt,{children:"Target Type"}),o.jsx(Gl,{options:sNn,value:e,onValueChange:p,placeholder:"Select target type",searchPlaceholder:"Search types...",emptyText:"No types available",container:s})]}),e&&o.jsxs("div",{className:"grid gap-2",children:[o.jsx(xt,{children:m}),o.jsx(Gl,{options:f,value:r,onValueChange:n,placeholder:`Select ${e}`,searchPlaceholder:"Search...",emptyText:"No targets available",disabled:h,container:s})]})]})}function iNn({datasetId:e,version:t,open:r,onOpenChange:n,onSuccess:s}){const a=b.useRef(null),[i,l]=b.useState(""),[c,u]=b.useState(""),[d,f]=b.useState([]),{triggerExperiment:h}=ni(),p=i&&c,m=h.isPending,g=async()=>{if(p)try{const x=await h.mutateAsync({datasetId:e,targetType:i,targetId:c,scorerIds:d.length>0?d:void 0,version:t});mc.success("Experiment triggered successfully"),n(!1),s?.(x.experimentId),l(""),u(""),f([])}catch(x){const w=x instanceof Error?x.message:"Failed to trigger experiment";mc.error(w)}},y=()=>{m||(n(!1),l(""),u(""),f([]))};return o.jsx(On,{open:r,onOpenChange:y,children:o.jsxs(vn,{ref:a,children:[o.jsxs(kn,{children:[o.jsx(bn,{children:"Run Experiment"}),o.jsx(qs,{children:t?`Execute items from ${tr(new Date(t),"MMM d, yyyy")} version against a target.`:"Execute all items in this dataset against a target."})]}),o.jsxs(Bn,{className:"grid gap-6",children:[o.jsx(aNn,{targetType:i,setTargetType:l,targetId:c,setTargetId:u,container:a}),i&&i!=="scorer"&&o.jsx(nNn,{selectedScorers:d,setSelectedScorers:f,disabled:m,container:a})]}),o.jsxs(uf,{className:"px-6 pt-4",children:[o.jsx(ce,{onClick:y,disabled:m,children:"Cancel"}),o.jsx(ce,{variant:"primary",onClick:g,disabled:!p||m,children:m?o.jsxs(o.Fragment,{children:[o.jsx(Dt,{className:"w-4 h-4"}),"Running..."]}):"Run"})]})]})})}const B1t=e=>{const t=Ge();return kt({queryKey:["experiment-trace-light",e],queryFn:async()=>{if(!e)throw new Error("Trace ID is required");return t.getTraceLight(e)},enabled:!!e})},L8e=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"score",label:"Score",size:"1fr"}];function oNn({result:e,scores:t,onPrevious:r,onNext:n,onClose:s,onShowTrace:a,onScoreClick:i,featuredScoreId:l}){const c=!!e?.error,u=nre(e?.input),d=nre(e?.output);return o.jsxs(o.Fragment,{children:[o.jsxs(gr.Toolbar,{children:[o.jsx(xC,{onPrevious:r,onNext:n,previousAriaLabel:"View previous result details",nextAriaLabel:"View next result details"}),o.jsxs(ps,{children:[o.jsxs(ce,{onClick:a,disabled:!e.traceId,children:[o.jsx(lce,{}),"Show Trace"]}),o.jsx(ce,{onClick:s,"aria-label":"Close result details panel",children:o.jsx(Nn,{})})]})]}),o.jsxs(gr.Content,{children:[o.jsx(Ir,{withMargins:!1,children:o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(ux,{})," ",e.id]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:[o.jsx(lx,{})," ",e.itemId]})})]})}),c&&o.jsx(cn,{variant:"destructive",title:"Error",children:o.jsx(cn.Message,{children:nre(e?.error&&typeof e.error=="object"?e.error.message:e?.error)})}),t&&t.length>0&&o.jsxs(Pt,{className:"grid-rows-[auto_auto] overflow-visible",children:[o.jsxs(Pt.Header,{columns:L8e,children:[o.jsx(Pt.HeaderCol,{children:"Scorer"}),o.jsx(Pt.HeaderCol,{children:"Score"})]}),o.jsx(Pt.Items,{children:t.map(f=>o.jsx(Pt.Row,{children:o.jsxs(Pt.RowButton,{item:{id:f.id},columns:L8e,isFeatured:l===f.id,onClick:i,children:[o.jsx(Pt.TextCell,{children:f.scorerId}),o.jsx(Pt.TextCell,{className:"font-mono",children:f.score.toFixed(3)})]})},f.id))})]}),(e.status||Array.isArray(e.tags)&&e.tags.length>0)&&o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("h4",{className:"text-sm font-medium text-neutral5 flex items-center gap-2",children:[o.jsx(NE,{className:"w-4 h-4"})," Review Status"]}),o.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[e.status&&o.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full font-medium ${e.status==="needs-review"?"bg-warning/10 text-warning":e.status==="complete"?"bg-accent1/10 text-accent1":"bg-neutral3/10 text-neutral4"}`,children:e.status}),Array.isArray(e.tags)&&e.tags.length>0&&e.tags.map(f=>o.jsx("span",{className:"text-xs px-2 py-0.5 rounded bg-surface4 text-neutral4",children:f},f))]})]}),o.jsx(Vt.CodeSection,{title:"Input",icon:o.jsx(lx,{}),codeStr:u}),o.jsx(Vt.CodeSection,{title:"Output",icon:o.jsx(Qd,{}),codeStr:d}),o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("h4",{className:"text-sm font-medium text-neutral5 flex items-center gap-2",children:[o.jsx(h_,{className:"w-4 h-4"})," Created"]}),o.jsx("p",{className:"text-sm text-neutral4",children:tr(new Date(e.createdAt),"MMM d, yyyy 'at' h:mm a")})]})]})]})}function nre(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function lNn({span:e}){return e?o.jsxs(o.Fragment,{children:[o.jsx(Vt.CodeSection,{title:"Input",icon:o.jsx(cx,{}),codeStr:JSON.stringify(e.input||null,null,2)}),o.jsx(Vt.CodeSection,{title:"Output",icon:o.jsx(Qd,{}),codeStr:JSON.stringify(e.output||null,null,2)}),o.jsx(Vt.CodeSection,{title:"Metadata",icon:o.jsx(wh,{}),codeStr:JSON.stringify(e.metadata||null,null,2)}),o.jsx(Vt.CodeSection,{title:"Attributes",icon:o.jsx(wh,{}),codeStr:JSON.stringify(e.attributes||null,null,2)})]}):null}function cNn({traceId:e,spanId:t,onNext:r,onPrevious:n,onClose:s}){const{data:a}=MS(e,t),i=a?.span;return o.jsxs(o.Fragment,{children:[o.jsxs(gr.Toolbar,{children:[o.jsx(xC,{onPrevious:n,onNext:r,previousAriaLabel:"View previous span details",nextAriaLabel:"View next span details"}),o.jsx(ce,{onClick:s,"aria-label":"Close span details",children:o.jsx(Nn,{})})]}),o.jsxs(gr.Content,{children:[o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(wh,{})," Span ",ef(t)]})})}),o.jsx(lNn,{span:i})]})]})}const uNn=e=>{if(!e||e.length===0)return[];const t=e.reduce((l,c)=>{const u=c?.endedAt?new Date(c.endedAt):void 0;return u&&(!l||u>l)?u:l},null),r=new Map,n=[];e.forEach(l=>{const c=new Date(l.startedAt),u=l.endedAt?new Date(l.endedAt):void 0,d={id:l.spanId,name:l.name,type:l.spanType,latency:u?u.getTime()-c.getTime():0,startTime:c.toISOString(),endTime:u?u.toISOString():void 0,spans:[],parentSpanId:l.parentSpanId};r.set(l.spanId,d)}),e.forEach(l=>{const c=r.get(l.spanId);if(l?.parentSpanId==null){if(t&&c.endTime&&t>new Date(c.endTime)){c.endTime=t.toISOString();const u=new Date(t).getTime(),d=new Date(c.startTime).getTime();c.latency=u-d}n.push(c)}else{const u=r.get(l.parentSpanId);u?u.spans.push(c):n.push(c)}});const s=l=>l.sort((c,u)=>new Date(c.startTime).getTime()-new Date(u.startTime).getTime()),a=s(n),i=l=>{l.forEach(c=>{c.spans&&c.spans.length>0&&(c.spans=s(c.spans),i(c.spans))})};return i(a),a};function U1t(e){if(!e.spans||e.spans.length===0)return[];const t=[];return e.spans.forEach(r=>{t.push(r.id),t.push(...U1t(r))}),t}const $8e=["agent","workflow","model","mcp","tool","workspace","other"];function V1t(e){const t=e?.toLowerCase().split("_")[0],r={agent:{icon:o.jsx(ga,{}),color:"oklch(0.75 0.15 250)",label:"Agent",bgColor:"bg-oklch(0.75 0.15 250 / 0.1)",typePrefix:"agent"},workflow:{icon:o.jsx(Di,{}),color:"oklch(0.75 0.15 200)",label:"Workflow",bgColor:"bg-oklch(0.75 0.15 200 / 0.1)",typePrefix:"workflow"},model:{icon:o.jsx(Em,{}),color:"oklch(0.75 0.15 320)",label:"Model",bgColor:"bg-oklch(0.75 0.15 320 / 0.1)",typePrefix:"model"},mcp:{icon:o.jsx(gl,{}),color:"oklch(0.75 0.15 160)",label:"MCP",bgColor:"bg-oklch(0.75 0.15 160 / 0.1)",typePrefix:"mcp"},tool:{icon:o.jsx(Mi,{}),color:"oklch(0.75 0.15 100)",label:"Tool",bgColor:"bg-oklch(0.75 0.15 100 / 0.1)",typePrefix:"tool"},workspace:{icon:o.jsx(B9,{}),color:"oklch(0.75 0.15 40)",label:"Workspace",bgColor:"bg-oklch(0.75 0.15 40 / 0.1)",typePrefix:"workspace"}};return t in r?r[t]:{typePrefix:"other"}}function dNn({isSelected:e,isFaded:t,isExpanded:r,toggleChildren:n,expandAllDescendants:s,totalDescendants:a=0,allDescendantsExpanded:i,numOfChildren:l}){return o.jsx("div",{className:Y("flex items-center justify-end h-full px-3",{"opacity-30 [&:hover]:opacity-60":t,"bg-surface4":e}),children:l&&l>0?o.jsxs("div",{className:"flex gap-1",children:[o.jsxs(F8e,{onClick:()=>n?.(),children:[i?a:l," ",r?i?o.jsx(oVe,{}):o.jsx(Ux,{}):o.jsx(as,{})]}),a>(l??0)&&!i&&o.jsxs(F8e,{onClick:()=>s?.(),children:[a," ",o.jsx(iVe,{})]})]}):null})}function F8e({onClick:e,children:t,className:r}){return o.jsx("button",{onClick:e,className:Y("h-full",r),children:o.jsx("div",{className:Y("flex items-center gap-[0.1rem] text-ui-sm text-neutral5 border border-border1 pl-2 pr-1 rounded-lg transition-all","hover:text-yellow-500","[&>svg]:shrink-0 [&>svg]:opacity-80 [&>svg]:w-4 [&>svg]:h-4 [&>svg]:transition-all"),children:t})})}function fNn({isLastChild:e,hasChildren:t=!1,expanded:r=!1}){return o.jsx("div",{className:Y("w-12 h-[2.8rem] relative opacity-100",'after:content-[""] after:absolute after:left-[-1px] after:top-0 after:bottom-0 after:w-0 after:border-l after:border-neutral3 after:border-dashed ','before:content-[""] before:absolute before:left-0 before:top-[50%] before:w-full before:h-0 before:border-b before:border-neutral3 before:border-dashed',"[&_svg]:transition-all","[&:hover_svg]:text-yellow-500 [&:hover_svg]:scale-[1.3] [&:hover_svg]:opacity-100",{"after:bottom-[50%]":e}),children:t&&o.jsx("span",{className:Y("flex absolute left-[50%] top-[50%] translate-y-[-50%] translate-x-[-50%] items-center justify-center bg-surface2 p-1","[&>svg]:shrink-0 [&>svg]:opacity-60 [&>svg]:w-[0.8rem] [&>svg]:h-[0.8rem]"),children:r?o.jsx(uVe,{}):o.jsx(cVe,{})})})}function hNn({span:e,spanUI:t,isFaded:r,depth:n=0,onSpanClick:s,selectedSpanId:a,isLastChild:i,hasChildren:l,isRootSpan:c,isExpanded:u,toggleChildren:d}){return o.jsxs("div",{className:"flex overflow-x-auto",style:{paddingLeft:`${n*1.5}rem`},children:[!c&&o.jsx("button",{onClick:()=>d?.(),disabled:!l,className:Y({"cursor-default":!l,"cursor-pointer":l}),children:o.jsx(fNn,{isLastChild:i,hasChildren:!!l,expanded:u})}),o.jsx("button",{className:"truncate",onClick:()=>s?.(e.id),children:e.name})]})}function q1t({span:e,depth:t=0,onSpanClick:r,selectedSpanId:n,isLastChild:s,overallLatency:a,overallStartTime:i,overallEndTime:l,fadedTypes:c,searchPhrase:u,featuredSpanIds:d,expandedSpanIds:f,setExpandedSpanIds:h}){const p=e.spans&&e.spans.length>0,m=e.spans?e.spans.length:0,g=U1t(e),y=g.length,x=t===0,w=V1t(e?.type),S=f?f.includes(e.id):!1,k=d&&d.length>0?!d.includes(e.id):!1,E=(c&&c.length>0?c.includes(w?.typePrefix||""):!1)||k;b.useEffect(()=>{x&&h?.([e.id])},[x,e.id,h]),b.useEffect(()=>{if(!d||!e.spans||e.spans.length===0)return;const I=e.spans.some(P=>d.includes(P.id));!S&&I&&T()},[d,e.spans,e.id,S,h,f]);const T=()=>{if(!(!h||!f))if(S){const I=[e.id,...g];h(f.filter(P=>!I.includes(P)))}else h([...f,e.id])},j=()=>{!h||!f||h([...f,e.id,...g])},N=g.every(I=>f?.includes(I));return o.jsxs(o.Fragment,{children:[o.jsx(hNn,{span:e,spanUI:w,isFaded:E,depth:t,onSpanClick:r,selectedSpanId:n,isLastChild:s,hasChildren:p,isRootSpan:x,isExpanded:S,toggleChildren:T}),o.jsx(dNn,{isSelected:n===e.id,isFaded:E,isExpanded:S,toggleChildren:T,expandAllDescendants:j,totalDescendants:y,allDescendantsExpanded:N,numOfChildren:m}),p&&S&&e.spans?.map((I,P,R)=>{const B=P===R.length-1;return o.jsx(q1t,{span:I,depth:t+1,onSpanClick:r,selectedSpanId:n,isLastChild:B,overallLatency:a,overallStartTime:i,fadedTypes:c,searchPhrase:u,expandedSpanIds:f,setExpandedSpanIds:h,featuredSpanIds:d},I.id)})]})}function pNn({hierarchicalSpans:e=[],onSpanClick:t,selectedSpanId:r,isLoading:n,fadedTypes:s,expandedSpanIds:a,setExpandedSpanIds:i,featuredSpanIds:l}){const c=e?.[0]?.latency||0,u=e?.[0]?.startTime||"",d=e?.[0]?.endTime||"";return o.jsx(o.Fragment,{children:n?o.jsxs("div",{className:Y("flex items-center text-ui-md gap-4 bg-surface3/50 rounded-md p-6 justify-center text-neutral3","[&_svg]:w-[1.25em] [&_svg]:h-[1.25em] [&_svg]:opacity-50"),children:[o.jsx(Dt,{})," Loading Trace Timeline ..."]}):o.jsx("div",{className:"grid grid-cols-[1fr_auto]",children:e?.map(f=>o.jsx(q1t,{span:f,onSpanClick:t,selectedSpanId:r,overallLatency:c,overallStartTime:u,overallEndTime:d,fadedTypes:s,featuredSpanIds:l,expandedSpanIds:a,setExpandedSpanIds:i},f.id))})})}function mNn({spans:e=[],fadedTypes:t,onLegendClick:r,onLegendReset:n,onSearchPhraseChange:s,traceId:a}){const[i,l]=b.useState("");b.useEffect(()=>{l("")},[a]);const c=$8e.filter(h=>e.some(p=>p?.spanType?.startsWith(h)))||[],u=e.some(h=>!$8e.some(m=>h?.spanType?.startsWith(m))),d=h=>{r?.(h)};b.useEffect(()=>{f(i)},[i,s]);const f=ert(h=>{s?.(h)},1e3);return o.jsxs("div",{className:"flex gap-3 items-center justify-between",children:[o.jsx("div",{className:"flex",children:o.jsx(Ox,{name:"search-spans",label:"Find span by name",labelIsHidden:!0,placeholder:"Look for span name",value:i,onChange:h=>{l(h.target.value)},onReset:()=>l("")})}),o.jsxs(pft,{children:[c.map(h=>{const p=V1t(h),m=t?.includes(h);return o.jsx(b.Fragment,{children:o.jsxs(ce,{onClick:()=>d(h),className:m?"opacity-40":"",style:{color:m?void 0:p?.color,backgroundColor:p?.bgColor},children:[p?.icon&&o.jsx(Ce,{children:p.icon}),p?.label]})},h)}),u&&o.jsxs(ce,{onClick:()=>d("other"),className:t?.includes("other")?"opacity-40":"",children:[o.jsx(Ce,{children:o.jsx(oF,{})}),"Other"]}),o.jsx(ce,{onClick:n,disabled:t?.length===0,children:o.jsx(Ce,{children:o.jsx(Nn,{})})})]})]})}function gNn({traceId:e,selectedSpanId:t,onSpanSelect:r,onClose:n}){const{data:s,isLoading:a}=B1t(e),i=s?.spans??[],[l,c]=b.useState(""),[u,d]=b.useState([]),[f,h]=b.useState([]),[p,m]=b.useState([]),g=b.useMemo(()=>uNn(i),[i]);b.useEffect(()=>{if(l.trim()===""){h([]);return}const S=l.toLowerCase(),k=i.filter(_=>_.name.toLowerCase().includes(S)).map(_=>_.spanId);h(k)},[l,i]),b.useEffect(()=>{c(""),d([]),h([]),m([])},[e]);const y=S=>{r?.(t===S?void 0:S)},x=S=>{d(k=>k.includes(S)?k.filter(_=>_!==S):[...k,S])},w=()=>{d([])};return o.jsxs(o.Fragment,{children:[o.jsx(gr.Toolbar,{children:o.jsx(ce,{onClick:n,"aria-label":"Close trace panel",children:o.jsx(Nn,{})})}),o.jsxs(gr.Content,{children:[o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(xo,{})," Trace ",ef(e)]})})}),o.jsx(mNn,{spans:i,fadedTypes:u,onLegendClick:x,onLegendReset:w,searchPhrase:l,onSearchPhraseChange:c,traceId:e}),o.jsx(pNn,{hierarchicalSpans:g,onSpanClick:y,selectedSpanId:t,isLoading:a,fadedTypes:u,expandedSpanIds:p,setExpandedSpanIds:m,featuredSpanIds:f})]})]})}function yNn({results:e,isLoading:t,featuredResultId:r,onResultClick:n,columns:s,scoresByItemId:a,scorerIds:i,setEndOfListElement:l,isFetchingNextPage:c,hasNextPage:u}){const d=s.map(f=>f.size).join(" ");return t?o.jsxs(Se,{columns:d,children:[o.jsx(Se.Top,{children:s.map(f=>o.jsx(Se.TopCell,{children:f.label},f.name))}),o.jsx("div",{className:"flex items-center justify-center py-20 col-span-full",children:o.jsx(Dt,{})})]}):e.length===0?o.jsxs(Se,{columns:d,children:[o.jsx(Se.Top,{children:s.map(f=>o.jsx(Se.TopCell,{children:f.label},f.name))}),o.jsx(Se.NoMatch,{message:"No results yet"})]}):o.jsxs(Se,{columns:d,children:[o.jsx(Se.Top,{children:s.map(f=>o.jsx(Se.TopCell,{children:f.label},f.name))}),o.jsxs(Se.Rows,{children:[e.map(f=>{const h=!!f.error,p=f.id===r;return o.jsxs(Se.Row,{onClick:()=>n(f.id),selected:p,children:[o.jsx(Se.TextCell,{children:o.jsx("span",{className:"truncate block font-mono",children:f.itemId})}),o.jsx(Se.Cell,{children:o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx("div",{className:"flex items-center justify-center w-10 relative bg-transparent h-full",children:o.jsx("div",{className:Y("w-2 h-2 rounded-full",h?"bg-red-700":"bg-green-600")})})}),o.jsx(Wr,{children:h?"Error":"Success"})]})}),s.some(m=>m.name==="input")&&o.jsx(Se.TextCell,{children:o.jsx("span",{className:"truncate block font-mono",children:bNn(vNn(f.input),200)})}),i?.map(m=>{const y=a?.[f.itemId]?.find(x=>x.scorerId===m);return o.jsx(Se.TextCell,{children:o.jsx("span",{className:"font-mono",children:y!=null?y.score.toFixed(3):"-"})},m)})]},f.id)}),o.jsxs("div",{ref:l,className:"h-1 col-span-full",children:[c&&o.jsx("div",{className:"flex justify-center py-4",children:o.jsx(Dt,{})}),!u&&e.length>0&&o.jsx(me,{variant:"ui-xs",className:"text-icon3 text-center py-4 block",children:"All results loaded"})]})]})]})}function vNn(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function bNn(e,t){return e.length<=t?e:e.slice(0,t-1)+"..."}function xNn(e){const t=e.scorer;return t?.hasJudge===!1?!0:t?.hasJudge===!0?!1:!e.preprocessPrompt&&!e.analyzePrompt&&!e.generateScorePrompt&&!e.generateReasonPrompt}function wNn({score:e,onNext:t,onPrevious:r,onClose:n}){const s=xNn(e),a=s?"N/A — code-based scorer":"N/A — step not configured";return o.jsxs(o.Fragment,{children:[o.jsxs(gr.Toolbar,{children:[o.jsx(xC,{onPrevious:r,onNext:t,previousAriaLabel:"View previous score details",nextAriaLabel:"View next score details"}),o.jsx(ce,{onClick:n,"aria-label":"Close score details",children:o.jsx(Nn,{})})]}),o.jsxs(gr.Content,{children:[o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(La,{})," ",e.scorerId]})})}),o.jsxs(kx,{children:[o.jsx(Vt.CodeSection,{title:`Score: ${e.score}`,icon:o.jsx(La,{}),codeStr:e.reason||a,simplified:!0}),o.jsx(Vt.CodeSection,{title:"Input",icon:o.jsx(lx,{}),codeStr:JSON.stringify(e.input??null,null,2)}),o.jsx(Vt.CodeSection,{title:"Output",icon:o.jsx(Qd,{}),codeStr:JSON.stringify(e.output??null,null,2)}),!s&&o.jsxs(o.Fragment,{children:[o.jsx(Vt.CodeSection,{title:"Preprocess Prompt",icon:o.jsx(sc,{}),codeStr:e.preprocessPrompt||a,simplified:!0}),o.jsx(Vt.CodeSection,{title:"Analyze Prompt",icon:o.jsx(sc,{}),codeStr:e.analyzePrompt||a,simplified:!0}),o.jsx(Vt.CodeSection,{title:"Generate Score Prompt",icon:o.jsx(sc,{}),codeStr:e.generateScorePrompt||a,simplified:!0}),o.jsx(Vt.CodeSection,{title:"Generate Reason Prompt",icon:o.jsx(sc,{}),codeStr:e.generateReasonPrompt||a,simplified:!0})]})]})]})]})}const z8e=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"avg",label:"Avg Score",size:"1fr"},{name:"count",label:"Items Scored",size:"1fr"}];function SNn({scoresByItemId:e,experimentStatus:t}){const r=b.useMemo(()=>{if(!e)return[];const n={};for(const s of Object.values(e))for(const a of s)n[a.scorerId]||(n[a.scorerId]={sum:0,count:0}),n[a.scorerId].sum+=a.score,n[a.scorerId].count++;return Object.entries(n).map(([s,{sum:a,count:i}])=>({scorerId:s,avg:a/i,count:i})).sort((s,a)=>s.scorerId.localeCompare(a.scorerId))},[e]);if(r.length===0){const n=t==="running"||t==="pending",s=e!==void 0;let a,i;return n?(a="Experiment in progress",i="Summary metrics will appear here once the experiment completes."):s?(a="No scorers configured",i="Add scorers when triggering an experiment to evaluate results and see summary metrics here."):(a="Loading scores",i="Fetching scorer results…"),o.jsx("div",{className:"flex h-full items-center justify-center py-12",children:o.jsx(Ja,{iconSlot:o.jsx(La,{className:"w-8 h-8 text-neutral3"}),titleSlot:a,descriptionSlot:i})})}return o.jsxs(Pt,{children:[o.jsxs(Pt.Header,{columns:z8e,children:[o.jsx(Pt.HeaderCol,{children:"Scorer"}),o.jsx(Pt.HeaderCol,{children:"Avg Score"}),o.jsx(Pt.HeaderCol,{children:"Items Scored"})]}),o.jsx(Pt.Scroller,{children:o.jsx(Pt.Items,{children:r.map(({scorerId:n,avg:s,count:a})=>o.jsxs(Pt.Row,{columns:z8e,children:[o.jsx(Pt.TextCell,{children:n}),o.jsx(Pt.TextCell,{className:"font-mono",children:s.toFixed(3)}),o.jsx(Pt.TextCell,{className:"font-mono",children:a})]},n))})})]})}function H1t({experimentId:e,experimentStatus:t,results:r,isLoading:n,setEndOfListElement:s,isFetchingNextPage:a,hasNextPage:i}){const[l,c]=b.useState(null),[u,d]=b.useState(null),[f,h]=b.useState(void 0),[p,m]=b.useState(null),g=r.find(z=>z.id===l)??null,{data:y}=w1t(e,t),x=b.useMemo(()=>{if(!y)return[];const z=new Set;for(const H of Object.values(y))for(const Q of H)z.add(Q.scorerId);return[...z].sort()},[y]),{data:w}=B1t(u),S=w?.spans??[],k=()=>{if(!f)return;const z=S.findIndex(H=>H.spanId===f);if(z>=0&&z<S.length-1)return()=>h(S[z+1].spanId)},_=()=>{if(!f)return;const z=S.findIndex(H=>H.spanId===f);if(z>0)return()=>h(S[z-1].spanId)},E=z=>{c(z),d(null),h(void 0),m(null)},T=z=>{E(z===l?null:z)},j=()=>{E(null)},N=()=>{if(!g)return;const z=r.findIndex(H=>H.id===g.id);if(z>=0&&z<r.length-1)return()=>E(r[z+1].id)},I=()=>{if(!g)return;const z=r.findIndex(H=>H.id===g.id);if(z>0)return()=>E(r[z-1].id)},P=g?y?.[g.itemId]:void 0,R=P?.find(z=>z.id===p)??null,B=z=>{m(z===p?null:z),d(null),h(void 0)},D=()=>{if(!p||!P)return;const z=P.findIndex(H=>H.id===p);if(z>=0&&z<P.length-1)return()=>m(P[z+1].id)},$=()=>{if(!p||!P)return;const z=P.findIndex(H=>H.id===p);if(z>0)return()=>m(P[z-1].id)},U=b.useMemo(()=>[{name:"itemId",label:"Item ID",size:"5rem"},{name:"status",label:"Status",size:"3rem"},{name:"input",label:"Input",size:"1fr"},...l?[]:x.map(z=>({name:z,label:z,size:"1fr"}))],[l,x]);return o.jsxs(Ef,{defaultTab:"summary",className:"grid grid-rows-[auto_1fr] h-full overflow-hidden",children:[o.jsxs(Cf,{children:[o.jsx(hs,{value:"summary",children:"Summary"}),o.jsx(hs,{value:"results",children:"Results"})]}),o.jsx(Ns,{value:"summary",className:"overflow-y-auto mt-5",children:o.jsx(SNn,{scoresByItemId:y,experimentStatus:t})}),o.jsx(Ns,{value:"results",className:"grid overflow-hidden mt-5",children:o.jsxs(tf,{className:g?"grid-cols-[1fr_2fr]":void 0,children:[o.jsx(gr,{children:o.jsx(yNn,{results:r,isLoading:n,featuredResultId:l,onResultClick:T,columns:U,scoresByItemId:y,scorerIds:l?void 0:x,setEndOfListElement:s,isFetchingNextPage:a,hasNextPage:i})}),g&&o.jsxs(Y3r,{numOfColumns:1+(!u&&p?1:0)+(u?1:0)+(f?1:0),minColumnWidth:"35rem",children:[g&&o.jsx(gr,{withLeftSeparator:!0,children:o.jsx(oNn,{result:g,scores:P,onPrevious:I(),onNext:N(),onClose:j,onScoreClick:B,featuredScoreId:p,onShowTrace:()=>{d(g.traceId??null),h(void 0),m(null)}})}),g&&!u&&R&&o.jsx(gr,{withLeftSeparator:!0,children:o.jsx(wNn,{score:R,onNext:D(),onPrevious:$(),onClose:()=>m(null)})}),g&&u&&o.jsx(gr,{withLeftSeparator:!0,children:o.jsx(gNn,{traceId:u,selectedSpanId:f,onSpanSelect:h,onClose:()=>{d(null),h(void 0)}})}),g&&u&&f&&o.jsx(gr,{withLeftSeparator:!0,children:o.jsx(cNn,{traceId:u,spanId:f,onNext:k(),onPrevious:_(),onClose:()=>h(void 0)})})]})]})})]})}const ONn={pending:o.jsx(EE,{}),running:o.jsx(g3,{}),completed:o.jsx(ra,{}),failed:o.jsx(Nn,{})};function kNn({experiment:e,className:t}){const r=e.status,n=e.totalItems-e.succeededCount-e.failedCount;return o.jsxs("div",{className:Y("grid justify-items-end gap-3",t),children:[o.jsxs("div",{className:"flex p-1 px-3 text-ui-lg capitalize text-neutral4 gap-2 items-center bg-surface5 rounded-lg ",children:[o.jsx("span",{className:Y("w-5 h-5 flex items-center justify-center rounded-full text-black","[&>svg]:w-4 [&>svg]:h-4",{"bg-green-700":r==="completed","bg-red-700":r==="failed","bg-cyan-600":r==="running","bg-yellow-600":r==="pending"}),children:ONn[r]}),e.status]}),o.jsxs("div",{className:Y("flex items-center gap-3 text-neutral3 text-ui-md ","[&>span]:flex [&>span]:gap-1 [&>span]:items-center ","[&_b]:text-neutral4 [&_b]:font-semibold"),children:[o.jsxs("span",{children:["Total: ",o.jsx("b",{children:e.totalItems})]}),o.jsxs("span",{children:["Succeeded: ",o.jsx("b",{children:e.succeededCount})]}),o.jsxs("span",{children:["Failed: ",o.jsx("b",{children:e.failedCount})]}),(r==="pending"||r==="running")&&o.jsxs("span",{children:["Pending: ",o.jsx("b",{children:n})]})]})]})}function Q1t({experimentId:e,experiment:t}){const{Link:r,paths:n}=or(),{data:s}=Eg(),{data:a}=c0(),{data:i}=cd(),l=()=>{switch(t.targetType){case"agent":return n.agentLink(t.targetId);case"workflow":return n.workflowLink(t.targetId);case"scorer":return n.scorerLink(t.targetId);default:return"#"}},c=()=>{const u=t.targetId;if(!u)return u;switch(t.targetType){case"agent":return s?.[u]?.name??u;case"workflow":return a?.[u]?.name??u;case"scorer":return i?.[u]?.scorer?.config?.name??u;default:return u}};return o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(fVe,{}),e," ",e&&o.jsx(ta,{content:e})]}),o.jsxs(Ir.Description,{children:[o.jsxs(Zn,{children:[o.jsx(h_,{})," Created at ",tr(new Date(t.createdAt),"MMM d, yyyy 'at' h:mm a")]}),t.completedAt&&o.jsxs(Zn,{children:[o.jsx(h_,{})," Completed at ",tr(new Date(t.completedAt),"MMM d, yyyy 'at' h:mm a")]})]}),o.jsxs(Ir.Description,{children:[o.jsxs(Zn,{children:[o.jsx(r2t,{})," Target",o.jsx(r,{href:l(),children:c()})]}),t.agentVersion&&o.jsxs(Zn,{children:[o.jsx(cF,{})," Version",t.targetType==="agent"&&t.targetId?o.jsx(r,{href:`${n.agentLink(t.targetId)}/editor?version=${encodeURIComponent(t.agentVersion)}`,className:"font-mono text-xs underline hover:text-accent1",children:t.agentVersion}):o.jsx("span",{className:"font-mono text-xs",children:t.agentVersion}),o.jsx(ta,{content:t.agentVersion})]})]})]}),o.jsx(Ir.Column,{children:o.jsx(kNn,{experiment:t})})]})}function Rve({delta:e}){const t=e>0?o.jsx(za,{size:"small",color:"green",intensity:"muted",children:o.jsx(nce,{})}):e<0?o.jsx(za,{size:"small",color:"red",intensity:"muted",children:o.jsx(nVe,{})}):null;return o.jsxs("span",{className:Y("font-mono text-sm text-neutral4 min-w-20"),children:[o.jsx("span",{className:"w-3 inline-block",children:e>0?"+ ":e<0?"- ":""}),Math.abs(e).toFixed(2)," ",t]})}function zL(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function _Nn({item:e,baselineId:t,contenderId:r,baselineVersion:n,contenderVersion:s,onPrevious:a,onNext:i,onClose:l}){const c=e.results[t],u=e.results[r],d=!!(c&&u),f=new Set;if(c)for(const p of Object.keys(c.scores))f.add(p);if(u)for(const p of Object.keys(u.scores))f.add(p);const h=[...f].sort();return o.jsxs(gr,{withLeftSeparator:!0,children:[o.jsxs(gr.Toolbar,{children:[o.jsx(xC,{onPrevious:a,onNext:i,previousAriaLabel:"Previous comparison item",nextAriaLabel:"Next comparison item"}),o.jsx(ps,{children:o.jsx(ce,{onClick:l,"aria-label":"Close comparison detail panel",children:o.jsx(Nn,{})})})]}),o.jsxs(gr.Content,{className:"pb-6",children:[o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(lx,{})," ",e.itemId]})})}),d?o.jsx(o.Fragment,{children:o.jsxs(kx,{children:[h.length>0&&o.jsxs("div",{className:"grid gap-3",children:[o.jsx("h4",{className:"text-sm font-medium text-neutral5",children:"Scores"}),o.jsx("div",{className:"grid gap-2",children:h.map(p=>{const m=c?.scores[p]??null,g=u?.scores[p]??null,y=m!=null&&g!=null?g-m:null;return o.jsxs("div",{className:"flex items-center justify-between gap-4 px-3 py-2 rounded-lg bg-surface2",children:[o.jsx("span",{className:"text-sm text-neutral5 font-medium",children:p}),o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsxs("span",{className:"text-sm text-neutral3",children:[m!=null?m.toFixed(3):"-"," →"," ",g!=null?g.toFixed(3):"-"]}),y!=null&&o.jsx(Rve,{delta:y})]})]},p)})})]}),o.jsx(Vt.CodeSection,{title:o.jsxs(o.Fragment,{children:[o.jsx(za,{color:"purple",children:"Baseline "})," Experiment Output"]}),icon:o.jsx(Qd,{}),codeStr:zL(c?.output)}),o.jsx(Vt.CodeSection,{title:o.jsxs(o.Fragment,{children:[o.jsx(za,{color:"cyan",children:"Contender "})," Experiment Output"]}),icon:o.jsx(Qd,{}),codeStr:zL(u?.output)}),o.jsx(Vt.CodeSection,{title:"Item Input",icon:o.jsx(cx,{}),codeStr:zL(e.input)}),o.jsx(Vt.CodeSection,{title:"Item Ground Truth",icon:o.jsx(NVe,{}),codeStr:zL(e.groundTruth)})]})}):o.jsx(cn,{variant:"warning",title:"Comparison not available",children:o.jsx(cn.Message,{children:(()=>{const p=c?"Contender":"Baseline",m=c?s:n;return o.jsxs(o.Fragment,{children:["The ",p," experiment was run against dataset",m!=null?` v. ${m}`:"",", which does not contain this item."]})})()})})]})]})}function ENn({items:e,baselineId:t,contenderId:r,scorerIds:n,featuredItemId:s,columns:a,onItemClick:i}){return o.jsx(gr,{children:o.jsxs(Pt,{children:[o.jsxs(Pt.Header,{columns:a,children:[o.jsx(Pt.HeaderCol,{children:"Item ID"}),!s&&n.map(l=>o.jsx(Pt.HeaderCol,{className:"flex justify-center",children:l},l))]}),o.jsx(Pt.Scroller,{children:o.jsx(Pt.Items,{children:e.map(l=>{const c=l.results[t],u=l.results[r],d=!!(c&&u);return o.jsx(Pt.Row,{children:o.jsxs(Pt.RowButton,{item:{id:l.itemId},columns:a,isFeatured:s===l.itemId,onClick:i,children:[o.jsx(Pt.IdCell,{id:l.itemId,className:d?"":"text-neutral1"}),!s&&o.jsx(o.Fragment,{children:n.map(f=>{const h=c?.scores[f]??null,p=u?.scores[f]??null,m=h!=null&&p!=null?p-h:null;return o.jsx(Pt.Cell,{className:"flex items-center gap-5 justify-center font-mono",children:m!=null?o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"flex items-center text-neutral2 min-w-24",children:[h?.toFixed(2)," → ",p?.toFixed(2)]}),o.jsx(Rve,{delta:m})]}):o.jsx("span",{className:"text-neutral1",children:"-"})},f)})})]})},l.itemId)})})})]})})}const CNn={baseline:{label:"Baseline",color:"purple",customStyle:"items-end justify-items-end [&>div]:justify-end border-r-0 rounded-r-none"},contender:{label:"Contender",color:"cyan",customStyle:"items-start justify-items-start [&>div]:justify-start border-l-0 rounded-l-none"}};function B8e({datasetId:e,experiment:t,type:r}){const{Link:n}=or(),{label:s,color:a,customStyle:i}=CNn[r];if(!t)return null;const l=t.createdAt?new Date(t.createdAt):null;return o.jsxs("div",{className:`grid border-2 border-border1 rounded-lg p-5 gap-3 ${i}`,children:[o.jsxs("div",{className:"flex items-center gap-3 w-full overflow-clip",children:[r==="contender"&&o.jsxs(za,{size:"small",color:a,children:[s,o.jsx(Dw,{})]}),o.jsx(ce,{as:n,href:`/datasets/${e}/experiments/${t.id}`,children:o.jsx("span",{className:"truncate min-w-0",children:t.id})}),r==="baseline"&&o.jsxs(za,{size:"small",color:a,children:[o.jsx(wp,{})," ",s]})]}),o.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-ui-sm text-neutral3",children:[o.jsxs(Zn,{children:[o.jsx(NVe,{})," ",t.targetType," / ",t.targetId]}),o.jsxs(Zn,{children:[o.jsx(bVe,{})," v",t.datasetVersion??"—"]}),l&&o.jsxs(Zn,{children:[o.jsx(sVe,{})," ",tr(l,"MMM d, yyyy HH:mm")]})]})]})}function jNn({datasetId:e,experimentIdA:t,experimentIdB:r,onSwap:n}){const[s,a]=b.useState(null),{data:i,isLoading:l,error:c}=Vjn(e,t,r),{data:u}=G6(e,t),{data:d}=G6(e,r),f=u&&d&&u.datasetVersion!==d.datasetVersion,h=b.useMemo(()=>{if(!i)return[];const T=new Set;for(const j of i.items)for(const N of Object.values(j.results))if(N)for(const I of Object.keys(N.scores))T.add(I);return[...T].sort()},[i]),p=b.useMemo(()=>{if(!i||h.length===0)return[];const T=i.baselineId,j=t===T?r:t;return h.map(N=>{let I=0,P=0,R=0,B=0;for(const z of i.items){const H=z.results[T]?.scores[N],Q=z.results[j]?.scores[N];H!=null&&(I+=H,R++),Q!=null&&(P+=Q,B++)}const D=R>0?I/R:null,$=B>0?P/B:null,U=D!=null&&$!=null?$-D:null;return{scorerId:N,avgA:D,avgB:$,delta:U}})},[i,h,t,r]),m=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"baselineAvg",label:"Baseline Avg",size:"1fr"},{name:"comparisonAvg",label:"Comparison Avg",size:"1fr"},{name:"delta",label:"Delta",size:"1fr"}],g=b.useMemo(()=>[{name:"itemId",label:"Item ID",size:"8rem"},...s?[]:h.map(T=>({name:T,label:T,size:"1fr"}))],[h,s]),y=i?.items.find(T=>T.itemId===s)??null,x=T=>{a(T===s?null:T)},w=()=>{a(null)},S=()=>{if(!i||!s)return;const T=i.items.findIndex(j=>j.itemId===s);if(T>=0&&T<i.items.length-1)return()=>a(i.items[T+1].itemId)},k=()=>{if(!i||!s)return;const T=i.items.findIndex(j=>j.itemId===s);if(T>0)return()=>a(i.items[T-1].itemId)};if(l)return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx(Dt,{})});if(c)return o.jsx(cn,{variant:"warning",title:"Error loading comparison",children:o.jsx(cn.Message,{children:c instanceof Error?c.message:"Unknown error"})});if(!i||i.items.length===0)return o.jsx("div",{className:"text-neutral4 text-sm text-center py-8",children:"No comparison data"});const _=i.baselineId,E=t===_?r:t;return o.jsxs("div",{className:"grid gap-10",children:[u&&d&&o.jsxs("div",{className:Y("relative grid xl:grid-cols-[1fr_auto_1fr] gap-4 xl:gap-0"),children:[o.jsx(B8e,{datasetId:e,experiment:u,type:"baseline"}),o.jsx("div",{className:"relative flex items-center justify-center px-[2vw] before:absolute before:inset-y-0 before:left-1/2 before:-translate-x-1/2 before:w-[2px] before:bg-border1",children:o.jsx("div",{className:"relative z-1 bg-surface2 rounded-lg p-2",children:o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(ce,{onClick:n,children:"VS"})}),o.jsx(Wr,{children:"Switch the order"})]})})}),o.jsx(B8e,{datasetId:e,experiment:d,type:"contender"})]}),f&&o.jsx(cn,{variant:"warning",title:"Version mismatch",children:o.jsxs(cn.Message,{children:["These experiments used different dataset versions (v",u.datasetVersion," vs v",d.datasetVersion,"). Results may not be directly comparable."]})}),p.length>0&&o.jsxs(Pt,{children:[o.jsxs(Pt.Header,{columns:m,children:[o.jsx(Pt.HeaderCol,{children:"Scorer"}),o.jsx(Pt.HeaderCol,{className:"flex justify-center",children:o.jsxs(fRe,{children:[o.jsx(za,{color:"purple",size:"small",intensity:"muted",children:"Baseline"}),o.jsx(za,{color:"purple",size:"small",children:"Avg"})]})}),o.jsx(Pt.HeaderCol,{className:"flex justify-center",children:o.jsxs(fRe,{children:[o.jsx(za,{color:"cyan",size:"small",intensity:"muted",children:"Contender"}),o.jsx(za,{color:"cyan",size:"small",children:"Avg"})]})}),o.jsx(Pt.HeaderCol,{className:"flex justify-center",children:"Delta"})]}),o.jsx(Pt.Scroller,{children:o.jsx(Pt.Items,{children:p.map(({scorerId:T,avgA:j,avgB:N,delta:I})=>o.jsxs(Pt.Row,{columns:m,children:[o.jsx(Pt.TextCell,{children:T}),o.jsx(Pt.TextCell,{className:"text-center font-mono",children:j!=null?j.toFixed(3):"-"}),o.jsx(Pt.TextCell,{className:"text-center font-mono",children:N!=null?N.toFixed(3):"-"}),o.jsx(Pt.TextCell,{className:"flex justify-center",children:I!=null?o.jsx(Rve,{delta:I}):"-"})]},T))})})]}),o.jsxs(tf,{className:Y({"grid-cols-[1fr_2fr]":!!y}),children:[o.jsx(ENn,{items:i.items,baselineId:_,contenderId:E,scorerIds:h,featuredItemId:s,columns:g,onItemClick:x}),!!y&&o.jsx(_Nn,{item:y,baselineId:_,contenderId:E,baselineVersion:u?.datasetVersion,contenderVersion:d?.datasetVersion,onPrevious:k(),onNext:S(),onClose:w})]})]})}function TNn({datasetId:e,itemId:t,onVersionSelect:r,onCompareVersionsClick:n,activeVersion:s}){const{data:a,isLoading:i}=Ive(e,t),[l,c]=b.useState(!1),[u,d]=b.useState(new Set),f=x=>{r?.(x)},h=x=>s==null?x.isLatest:x.datasetVersion===s,p=x=>{d(w=>{const S=new Set(w);if(S.has(x))S.delete(x);else if(S.size>=2){const[k]=Array.from(S);return new Set([k,x])}else S.add(x);return S})},m=()=>{c(!1),d(new Set)},g=()=>{c(!0)},y=()=>{u.size===2&&n?.([...u])};return o.jsxs(gr,{className:"min-w-56",children:[l?o.jsx(gr.Toolbar,{className:"grid justify-stretch gap-3 w-full",children:o.jsxs(ps,{children:[o.jsx(ce,{onClick:m,children:"Cancel"}),o.jsx(Ln,{variant:"primary",disabled:u.size!==2,onClick:y,tooltipContent:u.size!==2?"Check 2 versions to compare":void 0,className:"grow",children:"Compare"})]})}):o.jsx(o.Fragment,{children:(a||[]).length>1&&o.jsx(gr.Toolbar,{children:o.jsxs(ce,{onClick:g,className:"w-full",children:[o.jsx(zm,{})," Compare Ver."]})})}),i?o.jsx(NNn,{}):o.jsxs(Pt,{children:[o.jsx(Pt.Header,{children:o.jsx(Pt.HeaderCol,{children:"Item Version History"})}),o.jsx(Pt.Scroller,{children:o.jsx(Pt.Items,{children:a?.map(x=>{const w=String(x.datasetVersion),S=typeof x.updatedAt=="string"?new Date(x.updatedAt):x.updatedAt;return o.jsxs(Pt.Row,{isSelected:l&&u.has(w),children:[l&&o.jsx(Pt.LabelCell,{children:o.jsx(fi,{checked:u.has(w),disabled:x.isDeleted,onCheckedChange:()=>{},onClick:k=>{k.stopPropagation(),x.isDeleted||p(w)},"aria-label":`Select version ${x.datasetVersion}`})}),o.jsx(Pt.RowButton,{item:x,columns:[{name:"version",label:"Item Version History",size:"1fr"}],isFeatured:h(x),onClick:()=>f(x),className:"py-2",children:o.jsx(Pt.VersionCell,{version:x.datasetVersion,date:S,isLatest:x.isLatest,isDeleted:x.isDeleted})})]},String(x.datasetVersion))})})})]})]})}function NNn(){return o.jsxs(Pt,{children:[o.jsx(Pt.Header,{columns:[{name:"version",label:"Item Version History",size:"1fr"}],children:o.jsx(Pt.HeaderCol,{children:"Item Version History"})}),o.jsx(Pt.Items,{children:Array.from({length:3}).map((e,t)=>o.jsx(Pt.Row,{children:o.jsx(Pt.RowButton,{columns:[{name:"version",label:"Item Version History",size:"1fr"}],children:o.jsx(Pt.TextCell,{isLoading:!0,children:"Loading..."})})},t))})]})}function ANn(e,t){if(t){const r=typeof t=="string"?new Date(t):t;return`v${e} ${tr(r,"MMM dd 'at' H:mm:ss a")}`}return`v${e}`}function INn({datasetId:e,versionA:t,versionB:r,onVersionChange:n}){const{data:s}=Nve(e),a=(s??[]).map(i=>({value:String(i.version),label:`${ANn(i.version,i.createdAt)}${i.isCurrent?" (current)":""}`}));return o.jsxs(gr.Toolbar,{className:"grid grid-cols-[1fr_1fr_1fr_10rem] gap-4 w-full",children:[o.jsx("div",{}),o.jsx($o,{label:"Version A",labelIsHidden:!0,name:"version-a",placeholder:"Select version",options:a,value:t??"",onValueChange:i=>n?.(i,r??"")}),o.jsx($o,{label:"Version B",labelIsHidden:!0,name:"version-b",options:a,value:r??"",onValueChange:i=>n?.(t??"",i)}),o.jsx("div",{})]})}const RNn=[{name:"id",label:"ID",size:"1fr"},{name:"versionA",label:"Version A",size:"1fr"},{name:"versionB",label:"Version B",size:"1fr"},{name:"compare",label:"Compare",size:"10rem"}],PNn={added:{color:"blue",borderColor:"border-blue-900",icon:o.jsx(us,{}),tooltip:"Added in this version"},changed:{color:"orange",borderColor:"border-yellow-900",icon:o.jsx(jVe,{}),tooltip:"Changed in this version"},same:{color:"green",borderColor:"border-green-900",icon:o.jsx(h2t,{}),tooltip:"Same in both versions"}};function sre({red:e=!1,tooltip:t}){return o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(QPt,{className:Y("text-neutral3/40 w-5 h-5 ",{"text-red-900":e})})}),t&&o.jsx(Wr,{children:t})]})}function J0({variant:e,version:t}){if(!e)return o.jsxs("span",{className:"text-ui-md text-neutral4",children:["v. ",t]});const{color:r,icon:n,tooltip:s}=PNn[e];return o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsxs("div",{className:"grid grid-cols-[1fr_auto]",children:[t!==void 0&&o.jsxs("span",{className:"pr-3 text-ui-md text-neutral4 min-w-16 flex justify-end",children:["v. ",t]}),o.jsx(za,{color:r,size:"small",children:n})]})}),o.jsx(Wr,{children:s})]})}function MNn(e,t){return e&&t&&e.datasetVersion===t.datasetVersion?"same":e&&t&&e.datasetVersion!==t.datasetVersion?"changed":e?"added":"removed"}function DNn({datasetId:e,versionA:t,versionB:r,allItems:n,itemsAMap:s,itemsBMap:a}){const{Link:i}=or(),l=t>r;return o.jsx(Pt,{children:o.jsx(Pt.Scroller,{children:o.jsx(Pt.Items,{children:n.map(({id:c})=>{const u=s.get(c),d=a.get(c),f=MNn(u,d);return o.jsxs(Pt.Row,{columns:RNn,children:[o.jsx(Pt.IdCell,{id:c,isShortened:!1}),f!=="same"?o.jsxs(o.Fragment,{children:[u?.datasetVersion?o.jsx(Pt.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}`,className:"gap-2",children:!d&&l?o.jsx(J0,{variant:"added",version:u.datasetVersion}):f==="changed"&&l?o.jsx(J0,{variant:"changed",version:u.datasetVersion}):o.jsx(J0,{version:u.datasetVersion})}):o.jsx(Pt.Cell,{className:"justify-center flex items-center",children:o.jsx(sre,{red:l,tooltip:l?"Deleted in this version":"Not present in this version"})}),d?.datasetVersion?o.jsx(Pt.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}`,className:"gap-2",children:!u&&!l?o.jsx(J0,{variant:"added",version:d.datasetVersion}):f==="changed"&&!l?o.jsx(J0,{variant:"changed",version:d.datasetVersion}):o.jsx(J0,{version:d.datasetVersion})}):o.jsx(Pt.Cell,{className:"justify-center flex items-center",children:o.jsx(sre,{red:!l,tooltip:l?"Not present in this version":"Deleted in this version"})})]}):o.jsx(Pt.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}`,className:"col-span-2 gap-2",children:o.jsx(J0,{variant:"same",version:d?.datasetVersion})}),f==="changed"?o.jsx(Pt.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}/versions?ids=${u?.datasetVersion},${d?.datasetVersion}`,children:"Compare"}):o.jsx(Pt.Cell,{children:o.jsx(sre,{tooltip:o.jsxs(o.Fragment,{children:["Comparing is available",o.jsx("br",{})," only for changed items"]})})})]},c)})})})})}const U8e={needsReview:"#facc15",complete:"#22c55e"},LNn=[{label:"Needs Review",color:U8e.needsReview},{label:"Reviewed",color:U8e.complete}];function $Nn({reviewSummary:e,experiments:t,datasets:r,isLoading:n,isError:s}){const{data:a,maxVal:i,totalInPipeline:l}=b.useMemo(()=>{if(!e?.counts||!t)return{data:[],maxVal:0,totalInPipeline:0};const u=new Map;for(const m of t)u.set(m.id,m);const d=new Map;if(r)for(const m of r)d.set(m.id,m.name);let f=0,h=0;const p=[];for(const m of e.counts){const g=m.needsReview+m.complete;if(g===0)continue;h+=g,g>f&&(f=g);const y=u.get(m.experimentId),x=y?.datasetId?d.get(y.datasetId):void 0,w=x?`${x} · ${m.experimentId.slice(0,8)}`:m.experimentId.slice(0,8);p.push({name:w,values:[m.needsReview,m.complete]})}return{data:p,maxVal:f,totalInPipeline:h}},[e,t,r]),c=a.length>0;return o.jsxs(Wt,{children:[o.jsxs(Wt.TopBar,{children:[o.jsx(Wt.TitleAndDescription,{title:"Review Pipeline",description:"Items in review across experiments."}),c&&o.jsx(Wt.Summary,{value:String(l),label:"Items in pipeline"})]}),n?o.jsx(Wt.Loading,{}):s?o.jsx(Wt.Error,{message:"Failed to load review data"}):o.jsx(Wt.Content,{children:c?o.jsx(K_,{data:a,segments:LNn,maxVal:i,fmt:u=>String(u)}):o.jsx(Wt.NoData,{message:"No items have been sent to review yet"})})]})}function Pve(){const e=Ge();return kt({queryKey:["experiment-review-summary"],queryFn:()=>e.getExperimentReviewSummary()})}function W1t(e){const t=new Map;if(!e?.counts)return t;for(const r of e.counts)t.set(r.experimentId,{needsReview:r.needsReview,complete:r.complete,total:r.total});return t}function FNn(e,t){const r=new Map,n=W1t(e);if(!n.size||!t)return r;for(const s of t){const a=n.get(s.id);if(!a||!s.datasetId||a.needsReview+a.complete===0)continue;const l=r.get(s.datasetId)??{needsReview:0,complete:0};l.needsReview+=a.needsReview,l.complete+=a.complete,r.set(s.datasetId,l)}return r}function zNn(e){return e?.counts?e.counts.reduce((t,r)=>({needsReview:t.needsReview+r.needsReview,complete:t.complete+r.complete,inPipeline:t.inPipeline+r.needsReview+r.complete}),{needsReview:0,complete:0,inPipeline:0}):{needsReview:0,complete:0,inPipeline:0}}const BNn=10;function UNn(){const[e,t]=b.useState(!1),[r,n]=b.useState(""),[s,a]=b.useState("all"),[i,l]=b.useState("all"),[c,u]=b.useState("all"),[d,f]=b.useState(0),{data:h,isLoading:p,error:m}=Lh({page:d,perPage:BNn}),{data:g,isLoading:y,error:x}=r8(),{data:w}=Pve(),S=b.useMemo(()=>h?.datasets??[],[h?.datasets]),k=h?.pagination?.hasMore??!1,_=b.useMemo(()=>g?.experiments??[],[g?.experiments]),E=b.useMemo(()=>oTn(S),[S]),T=b.useMemo(()=>FNn(w,_),[w,_]),j=p||y,N=m||x,I=()=>t(!0),P=b.useCallback(()=>f(Q=>Q+1),[]),R=b.useCallback(()=>f(Q=>Math.max(0,Q-1)),[]),B=b.useCallback(Q=>{n(Q),f(0)},[]),D=b.useCallback(Q=>{a(Q),f(0)},[]),$=b.useCallback(Q=>{l(Q),f(0)},[]),U=b.useCallback(Q=>{u(Q),f(0)},[]);if(N&&Ps(N))return o.jsx(Jr,{title:"Datasets",icon:o.jsx(Na,{}),children:o.jsx(sa,{})});if(N&&Os(N))return o.jsx(Jr,{title:"Datasets",icon:o.jsx(Na,{}),children:o.jsx(Zs,{resource:"datasets"})});if(N)return o.jsx(Jr,{title:"Datasets",icon:o.jsx(Na,{}),children:o.jsx(pu,{title:"Failed to load datasets",message:N.message})});if(S.length===0&&!j&&d===0)return o.jsxs(o.Fragment,{children:[o.jsx(Jr,{title:"Datasets",icon:o.jsx(Na,{}),children:o.jsx(lTn,{onCreateClick:I})}),o.jsx(Rle,{open:e,onOpenChange:t})]});const z=s!=="all"||i!=="all"||c!=="all"||r!=="",H=()=>{n(""),a("all"),l("all"),u("all"),f(0)};return o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:j,children:[o.jsx(Na,{})," Datasets"]})})}),o.jsxs(bt.Column,{className:"flex justify-end gap-2",children:[o.jsx(Ln,{onClick:I,tooltipContent:"Create a dataset",children:o.jsx(us,{})}),o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/evals/datasets/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Datasets documentation",children:o.jsx(Li,{})})]})]}),o.jsx(uTn,{search:r,onSearchChange:B,targetFilter:s,onTargetFilterChange:D,experimentFilter:i,onExperimentFilterChange:$,tagFilter:c,onTagFilterChange:U,tagOptions:E,onReset:H,hasActiveFilters:z})]}),o.jsx(sTn,{datasets:S,experiments:_,reviewByDataset:T,isLoading:j,search:r,targetFilter:s,experimentFilter:i,tagFilter:c,currentPage:d,hasMore:k,onNextPage:P,onPrevPage:R}),o.jsx(Rle,{open:e,onOpenChange:t})]})}const VNn=new Set(["items","experiments","review"]);function qNn(){const{datasetId:e}=na(),t=uu(),[r,n]=ao(),s=r.get("tab"),a=s&&VNn.has(s)?s:"items",i=E=>{n(E==="items"?{}:{tab:E},{replace:!0})},[l,c]=b.useState(!1),[u,d]=b.useState(!1),[f,h]=b.useState(!1),[p,m]=b.useState(!1),[g,y]=b.useState(null),{data:x,error:w}=Tg(e??"");if(!e)return o.jsx(zr,{children:o.jsx(df,{children:o.jsx("div",{className:"text-neutral3 p-4",children:"Dataset not found"})})});if(w&&Ps(w))return o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(sa,{})})});if(w&&Os(w))return o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})});const S=E=>{t(`/datasets/${e}/experiments/${E}`)},k=()=>{t("/datasets")},_=E=>{y(E?.version??null)};return o.jsxs(zr,{children:[o.jsx(Cn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(gTn,{value:e,variant:"ghost"})})]})}),o.jsxs(df,{className:"content-stretch",children:[o.jsx(eNn,{datasetId:e,onAddItemClick:()=>d(!0),onEditClick:()=>h(!0),onDeleteClick:()=>m(!0),activeDatasetVersion:g,onVersionSelect:_,initialTab:a,onTabChange:i,experimentTriggerSlot:o.jsxs(ce,{variant:"primary",onClick:()=>c(!0),children:[o.jsx(ux,{}),g!=null?`Run on v${g}`:"Run Experiment"]})}),o.jsx(iNn,{datasetId:e,version:g??void 0,open:l,onOpenChange:c,onSuccess:S}),o.jsx(rNn,{datasetId:e,open:u,onOpenChange:d}),x&&o.jsx(pTn,{open:f,onOpenChange:h,dataset:{id:x.id,name:x.name,description:x?.description||"",inputSchema:x.inputSchema,groundTruthSchema:x.groundTruthSchema}}),x&&o.jsx(mTn,{open:p,onOpenChange:m,datasetId:x.id,datasetName:x.name,onSuccess:k})]})]})}function HNn(){const{datasetId:e,experimentId:t}=na(),{data:r}=Tg(e??""),{data:n,isLoading:s,error:a}=G6(e,t),{data:i,isLoading:l,setEndOfListElement:c,isFetchingNextPage:u,hasNextPage:d}=t8({datasetId:e,experimentId:t,experimentStatus:n?.status});return!e||!t?null:s?o.jsx(zr,{children:o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx(Dt,{})})}):a&&Ps(a)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(sa,{})})}):a&&Os(a)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):a||!n?o.jsx(zr,{children:o.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",a instanceof Error?a.message:"Unknown error"]})}):o.jsxs(zr,{children:[o.jsx(Cn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:fr,to:`/datasets/${e}`,children:r?.name}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Experiment"})]})}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:"grid gap-1 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[o.jsx(Q1t,{experimentId:t,experiment:n}),o.jsx(H1t,{experimentId:t,experimentStatus:n?.status,results:i??[],isLoading:l,setEndOfListElement:c,isFetchingNextPage:u,hasNextPage:d})]})})]})}function QNn(){const{datasetId:e}=na(),[t,r]=ao(),{data:n,error:s}=Tg(e??""),a=t.get("baseline")??"",i=t.get("contender")??"";return s&&Ps(s)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(sa,{})})}):s&&Os(s)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):!e||!a||!i?o.jsxs(zr,{children:[o.jsx(Cn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsxs(jr,{isCurrent:!0,as:"span",children:[o.jsx(Ce,{children:o.jsx(zm,{})}),"Compare Experiments"]})]})}),o.jsx(df,{children:o.jsxs("div",{className:"text-neutral4 text-center py-8",children:[o.jsx("p",{children:"Select two experiments to compare."}),o.jsxs("p",{className:"text-sm mt-2",children:["Use the URL format: /datasets/","{datasetId}","/experiments?baseline=","{experimentIdA}","&contender=","{experimentIdB}"]})]})})]}):o.jsxs(zr,{children:[o.jsx(Cn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:fr,to:`/datasets/${e}`,children:n?.name??e?.slice(0,8)}),o.jsxs(jr,{isCurrent:!0,as:"span",children:[o.jsx(Ce,{children:o.jsx(zm,{})}),"Experiments Comparison"]})]})}),o.jsx(df,{children:o.jsxs("div",{className:"max-w-[100rem] w-full px-12 mx-auto grid content-start ",children:[o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(zm,{})," Dataset Experiments Comparison"]}),o.jsxs(Ir.Description,{children:["Comparing"," ",o.jsx(fr,{to:`/datasets/${e}/experiments/${a}`,children:a.slice(0,8)})," vs"," ",o.jsx(fr,{to:`/datasets/${e}/experiments/${i}`,children:i.slice(0,8)})]})]}),o.jsx(Ir.Column,{children:o.jsxs(ce,{as:fr,to:`/datasets/${e}`,children:[o.jsx(wp,{}),"Back to Dataset"]})})]}),o.jsx(jNn,{datasetId:e,experimentIdA:a,experimentIdB:i,onSwap:()=>{r({baseline:i,contender:a})}})]})})]})}function WNn(){const{datasetId:e,itemId:t}=na(),{Link:r}=or(),n=uu(),{data:s,isLoading:a,error:i}=Ive(e??"",t??""),{updateItem:l,deleteItem:c}=ni(),{data:u}=Tg(e??""),d=s?.[0]??null,f=d?.isDeleted??!1,[h,p]=b.useState(null),m=b.useMemo(()=>!d||f?{input:"",groundTruth:"",metadata:""}:{input:JSON.stringify(d.input,null,2),groundTruth:d.groundTruth?JSON.stringify(d.groundTruth,null,2):"",metadata:d.metadata?JSON.stringify(d.metadata,null,2):""},[d,f]),g=d?.datasetVersion??0,[y,x]=b.useState(!1),[w,S]=b.useState(m.input),[k,_]=b.useState(m.groundTruth),[E,T]=b.useState(m.metadata),[j,N]=b.useState(g);g!==j&&(N(g),S(m.input),_(m.groundTruth),T(m.metadata));const[I,P]=b.useState(!1),R=V=>{p(f?V:V.isLatest?null:V)},B=()=>{p(null)},D=!f&&h!=null,$=()=>{D||x(!0)},U=()=>{D||P(!0)},z=async()=>{if(!e||!t)return;let V;try{V=JSON.parse(w)}catch{ze.error("Input must be valid JSON");return}let M;if(k.trim())try{M=JSON.parse(k)}catch{ze.error("Ground Truth must be valid JSON");return}let W;if(E.trim())try{W=JSON.parse(E)}catch{ze.error("Metadata must be valid JSON");return}try{await l.mutateAsync({datasetId:e,itemId:t,input:V,groundTruth:M,metadata:W}),ze.success("Item updated successfully"),x(!1)}catch(G){ze.error(`Failed to update item: ${G instanceof Error?G.message:"Unknown error"}`)}},H=()=>{d&&(S(JSON.stringify(d.input,null,2)),_(d.groundTruth?JSON.stringify(d.groundTruth,null,2):""),T(d.metadata?JSON.stringify(d.metadata,null,2):"")),x(!1)},Q=async()=>{if(!(!e||!t))try{await c.mutateAsync({datasetId:e,itemId:t}),ze.success("Item deleted successfully"),P(!1),n(`/datasets/${e}`)}catch(V){ze.error(`Failed to delete item: ${V instanceof Error?V.message:"Unknown error"}`)}},L=h??d,Z=L?{id:t??"",datasetId:e??"",datasetVersion:L.datasetVersion,input:L.input,groundTruth:L.groundTruth,metadata:L.metadata,createdAt:L.createdAt,updatedAt:L.updatedAt}:null;return i&&Ps(i)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(sa,{})})}):i&&Os(i)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):a?null:!e||!t||!s||s.length===0?o.jsx(zr,{children:o.jsx(df,{children:o.jsx("div",{className:"text-neutral3 p-4",children:"Item not found"})})}):o.jsxs(o.Fragment,{children:[o.jsxs(zr,{children:[o.jsx(Cn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:fr,to:`/datasets/${e}`,children:u?.name}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Item"})]})}),o.jsx("div",{className:"h-full overflow-hidden px-6 pb-4",children:o.jsxs("div",{className:"grid gap-6 max-w-[60rem] mx-auto grid-rows-[auto_1fr] h-full",children:[o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(lx,{}),t," ",o.jsx(ta,{content:t})]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:["Item of ",o.jsx(Na,{})," ",u?.name]})}),o.jsxs(Ir.Description,{children:[o.jsxs(Zn,{children:[o.jsx(h_,{})," Created at"," ",d?.createdAt?tr(new Date(d.createdAt),"MMM d, yyyy"):""]}),o.jsxs(Zn,{children:[o.jsx(Vx,{})," Latest version v",d?.datasetVersion??""]})]})]}),o.jsx(Ir.Column,{children:!y&&!f&&o.jsxs(ps,{children:[o.jsxs(ce,{onClick:$,disabled:D,title:D?"Return to latest version to edit":void 0,children:[o.jsx(jVe,{})," Edit"]}),o.jsxs(ce,{onClick:U,disabled:D,title:D?"Return to latest version to delete":void 0,children:[o.jsx(ed,{})," Delete"]})]})})]}),o.jsxs(tf,{className:y?"grid-cols-1":"grid-cols-[1fr_auto]",children:[o.jsxs(gr,{withRightSeparator:!y,children:[f&&d&&o.jsx(cn,{variant:"destructive",title:"Item deleted",children:o.jsxs(cn.Message,{children:["This item was deleted at version v",d.datasetVersion]})}),!f&&D&&h&&o.jsx(cn,{variant:"warning",title:"Previous version",action:o.jsxs(cn.Button,{onClick:B,children:[o.jsx(fw,{})," Return to the latest version"]}),children:o.jsxs(cn.Message,{children:["Viewing version v",h.datasetVersion]})}),y?o.jsx($1t,{inputValue:w,setInputValue:S,groundTruthValue:k,setGroundTruthValue:_,metadataValue:E,setMetadataValue:T,validationErrors:null,onSave:z,onCancel:H,isSaving:l.isPending}):Z?o.jsx(n8,{item:Z,Link:r}):o.jsx("div",{className:"text-neutral4 text-sm",children:"Item data not available"})]}),!y&&o.jsx(gr,{children:o.jsx(TNn,{datasetId:e,itemId:t,onClose:()=>{},onVersionSelect:R,onCompareVersionsClick:V=>{n(`/datasets/${e}/items/${t}/versions?ids=${V.join(",")}`)},activeVersion:h?.datasetVersion??null})})]})]})})]}),o.jsx($t,{open:I,onOpenChange:P,children:o.jsxs($t.Content,{children:[o.jsxs($t.Header,{children:[o.jsx($t.Title,{children:"Delete Item"}),o.jsx($t.Description,{children:"Are you sure you want to delete this item? This action cannot be undone."})]}),o.jsxs($t.Footer,{children:[o.jsx($t.Cancel,{children:"Cancel"}),o.jsx($t.Action,{onClick:Q,children:c.isPending?"Deleting...":"Delete"})]})]})})]})}function V8e(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function GNn(){const{datasetId:e}=na(),[t,r]=ao(),n=t.get("items")?.split(",").filter(Boolean)??[],{data:s,error:a}=Tg(e??""),{Link:i}=or(),[l,c]=b.useState(!1),{data:u}=Nle(e??"",n[0]??""),{data:d}=Nle(e??"",n[1]??"");return a&&Ps(a)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(sa,{})})}):a&&Os(a)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):!e||n.length<2?o.jsxs(zr,{children:[o.jsx(Cn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Items"})]})}),o.jsx(df,{children:o.jsx("div",{className:"text-neutral4 text-center py-8",children:o.jsx("p",{children:"Select at least two items to compare."})})})]}):o.jsxs(zr,{children:[o.jsxs(Cn,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:fr,to:`/datasets/${e}`,children:s?.name||e?.slice(0,8)}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Items"})]}),o.jsx(fu,{children:o.jsxs(ce,{as:fr,to:`/datasets/${e}`,variant:"outline",children:[o.jsx(Ce,{children:o.jsx(wp,{})}),"Back to Dataset"]})})]}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:Y("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":l}),children:[o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(zm,{}),"Compare Dataset Items"]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:["Comparing ",n.length," items of"," ",o.jsx(fr,{to:`/datasets/${e}`,className:"text-info1 hover:underline",children:s?.name||e?.slice(0,8)})]})})]}),o.jsx(Ir.Column,{children:o.jsxs(ps,{children:[o.jsxs(ce,{as:fr,to:`/datasets/${e}`,children:[o.jsx(wp,{}),"Back to Dataset"]}),o.jsx(ce,{variant:"primary",onClick:()=>c(f=>!f),children:l?o.jsxs(o.Fragment,{children:[o.jsx(gVe,{})," Default View"]}):o.jsxs(o.Fragment,{children:[o.jsx(a2t,{})," Diff View"]})})]})})]}),o.jsx(tf,{className:"grid-cols-[1fr_3vw_1fr]",children:n.map((f,h)=>o.jsxs(b.Fragment,{children:[o.jsx(ZNn,{datasetId:e,itemId:f,Link:i,idx:h,itemIds:n,showContent:!l,onItemChange:p=>{const m=[...n];m[h]=p,r({items:m.join(",")})}}),h==0&&o.jsx("div",{className:Y("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},f))}),l&&u&&d&&o.jsx(Fft,{codeA:V8e(u),codeB:V8e(d)})]})})]})}function ZNn({datasetId:e,itemId:t,Link:r,idx:n,itemIds:s,onItemChange:a,showContent:i=!0}){const{data:l,isLoading:c}=Nle(e,t),{data:u}=OE(e),d=new Set(s.filter((h,p)=>p!==n)),f=(u??[]).map(h=>({value:h.id,label:h.id,disabled:d.has(h.id)}));return o.jsxs(gr,{children:[o.jsxs(gr.Toolbar,{className:"flex gap-4",children:[o.jsx(sge,{label:"Item",name:`compare-item-${n}`,value:t,onValueChange:a,options:f,placeholder:"Select item",labelIsHidden:!0}),o.jsxs(ce,{as:r,to:`/datasets/${e}/items/${t}`,children:[o.jsx(Vx,{}),"Versions"]})]}),i&&o.jsx(gr.Content,{children:c?o.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):l?o.jsxs(o.Fragment,{children:[o.jsx(F1t,{item:l}),o.jsx(n8,{item:l,Link:r})]}):o.jsxs("div",{className:"text-neutral4 text-sm",children:["Item ",t.slice(0,8)," not found"]})})]})}function q8e(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function YNn(){const{datasetId:e,itemId:t}=na(),[r,n]=ao(),[s,a]=b.useState(!1),i=r.get("ids")?.split(",").map(Number).filter(p=>!isNaN(p)&&p>0)??[],{data:l,error:c}=Tg(e??""),{Link:u}=or(),{data:d}=Ive(e??"",t??""),{data:f}=Mle(e??"",t??"",i[0]??0,l?.version),{data:h}=Mle(e??"",t??"",i[1]??0,l?.version);return c&&Ps(c)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(sa,{})})}):c&&Os(c)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):!e||!t||i.length<2?o.jsxs(zr,{children:[o.jsx(Cn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),o.jsx(df,{children:o.jsx("div",{className:"text-neutral4 text-center py-8",children:o.jsx("p",{children:"Select at least two versions to compare."})})})]}):o.jsxs(zr,{children:[o.jsxs(Cn,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:fr,to:`/datasets/${e}`,children:l?.name}),o.jsx(jr,{as:fr,to:`/datasets/${e}/items/${t}`,children:"Item"}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Versions"})]}),o.jsx(fu,{children:o.jsxs(ce,{as:fr,to:`/datasets/${e}/items/${t}`,variant:"outline",children:[o.jsx(Ce,{children:o.jsx(wp,{})}),"Back to Item"]})})]}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:Y("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":s}),children:[o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(zm,{}),"Compare Dataset Item Versions"]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:["Comparing ",i.length," versions of"," ",o.jsx(fr,{to:`/datasets/${e}/items/${t}`,className:"text-info1 hover:underline",children:t})]})})]}),o.jsx(Ir.Column,{children:o.jsxs(ps,{children:[o.jsxs(ce,{as:fr,to:`/datasets/${e}/items/${t}`,children:[o.jsx(wp,{}),"Back to Item"]}),o.jsx(ce,{variant:"primary",onClick:()=>a(p=>!p),children:s?o.jsxs(o.Fragment,{children:[o.jsx(gVe,{})," Default View"]}):o.jsxs(o.Fragment,{children:[o.jsx(U2t,{})," Diff View"]})})]})})]}),o.jsx(tf,{className:"grid-cols-[1fr_3vw_1fr]",children:i.map((p,m)=>o.jsxs(b.Fragment,{children:[o.jsx(XNn,{datasetId:e,itemId:t,datasetVersion:p,latestVersion:l?.version,allVersions:d??[],versionNumbers:i,Link:u,idx:m,showContent:!s,onVersionChange:g=>{const y=[...i];y[m]=g,n({ids:y.join(",")})}}),m===0&&o.jsx("div",{className:Y("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},p))}),s&&f&&h&&o.jsx(Fft,{codeA:q8e(f),codeB:q8e(h)})]})})]})}function XNn({datasetId:e,itemId:t,datasetVersion:r,latestVersion:n,allVersions:s,versionNumbers:a,Link:i,idx:l,showContent:c=!0,onVersionChange:u}){const{data:d,isLoading:f}=Mle(e,t,r,n),h=new Set(a.filter((g,y)=>y!==l)),p=s.map(g=>{const y=typeof g.updatedAt=="string"?new Date(g.updatedAt):g.updatedAt;return{value:String(g.datasetVersion),label:o.jsxs(o.Fragment,{children:[o.jsxs("b",{children:["v. ",g.datasetVersion]})," - ",tr(y,"MMM d, yyyy h:mm a"),g.isLatest?o.jsx(za,{color:"blue",size:"small",children:"Latest"}):null]}),disabled:h.has(g.datasetVersion)}}),m=d?{id:d.id,datasetId:e,datasetVersion:d.datasetVersion,input:d.input,groundTruth:d.groundTruth,metadata:d.metadata,createdAt:d.createdAt,updatedAt:d.updatedAt}:null;return o.jsxs(gr,{children:[o.jsxs(gr.Toolbar,{className:"grid gap-4 grid-cols-[auto_1fr]",children:[o.jsx(Vx,{className:"w-6 h-6 opacity-50"}),o.jsx(sge,{label:"Version",name:`compare-version-${l}`,value:String(r),onValueChange:g=>u(Number(g)),options:p,placeholder:"Select version",labelIsHidden:!0,className:"w-full"})]}),c&&o.jsx(gr.Content,{children:f?o.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):!d||!m?o.jsxs("div",{className:"text-neutral4 text-sm",children:["Version ",r," not found"]}):o.jsx(n8,{item:m,Link:i})})]})}function KNn(){const{datasetId:e}=na(),[t]=ao(),r=t.get("ids")?.split(",").map(Number).filter(g=>!isNaN(g)&&g>0)??[],n=uu(),{data:s,error:a}=Tg(e??""),i=OE(e??"",void 0,r[0]??null),l=OE(e??"",void 0,r[1]??null),c=b.useMemo(()=>i.data??[],[i.data]),u=b.useMemo(()=>l.data??[],[l.data]),d=b.useMemo(()=>{const g=new Map;for(const y of[...c,...u])g.has(y.id)||g.set(y.id,{id:y.id,createdAt:new Date(y.createdAt)});return[...g.values()].sort((y,x)=>x.createdAt.getTime()-y.createdAt.getTime())},[c,u]),f=b.useMemo(()=>new Map(c.map(g=>[g.id,g])),[c]),h=b.useMemo(()=>new Map(u.map(g=>[g.id,g])),[u]);if(a&&Ps(a))return o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(sa,{})})});if(a&&Os(a))return o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})});if(!e||r.length<2)return o.jsxs(zr,{children:[o.jsx(Cn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),o.jsx(df,{children:o.jsx("div",{className:"text-neutral4 text-center py-8",children:o.jsx("p",{children:"Select at least two versions to compare."})})})]});const p=(g,y,x)=>{n(`/datasets/${e}/items/${g}/versions?ids=${y?.datasetVersion??""},${x?.datasetVersion??""}`)},m=(g,y)=>{n(`/datasets/${e}/versions?ids=${g},${y}`,{replace:!0})};return o.jsxs(zr,{children:[o.jsx(Cn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:fr,to:`/datasets/${e}`,children:s?.name||e?.slice(0,8)}),o.jsxs(jr,{isCurrent:!0,as:"span",children:[o.jsx(Ce,{children:o.jsx(gSe,{})}),"Compare Versions"]})]})}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:"grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(gSe,{})," Compare Dataset Versions"]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:[o.jsx(Vx,{})," Comparing ",r.length," versions of"," ",s?.name||e?.slice(0,8)]})})]}),o.jsx(Ir.Column,{children:o.jsxs(ce,{as:fr,to:`/datasets/${e}`,children:[o.jsx(wp,{}),"Back to Dataset"]})})]}),o.jsx(tf,{children:o.jsxs(gr,{children:[o.jsx(INn,{datasetId:e,versionA:String(r[0]),versionB:String(r[1]),onVersionChange:m}),o.jsx(DNn,{datasetId:e,versionA:r[0],versionB:r[1],allItems:d,itemsAMap:f,itemsBMap:h,onItemClick:p})]})})]})})]})}function JNn(e){if(!e||e.length<2)return null;const t=[...e].sort((i,l)=>new Date(i.createdAt).getTime()-new Date(l.createdAt).getTime()),r=Math.floor(t.length/2),n=r,s=t.length-r;if(n===0)return null;const a=(s-n)/n*100;return{changePct:Math.round(a*10)/10,prevValue:String(n)}}function eAn({scorers:e,datasets:t,experiments:r,avgScore:n,prevAvgScore:s,totalNeedsReview:a,isLoadingScorers:i,isLoadingDatasets:l,isLoadingExperiments:c,isLoadingScores:u,isLoadingReview:d}){const f=e?Object.keys(e).length:void 0,h=t?.length,p=r?.length,m=n!=null&&s!=null&&s!==0?{changePct:Math.round((n-s)/s*100*10)/10,prevValue:String(s)}:null,g=JNn(r);return o.jsxs(o.Fragment,{children:[o.jsxs(En,{children:[o.jsx(En.Label,{children:"Total Scorers"}),i?o.jsx(En.Loading,{}):f!=null?o.jsxs(o.Fragment,{children:[o.jsx(En.Value,{children:String(f)}),o.jsx(En.NoChange,{message:"Static count"})]}):o.jsx(En.NoData,{})]}),o.jsxs(En,{children:[o.jsx(En.Label,{children:"Total Datasets"}),l?o.jsx(En.Loading,{}):h!=null?o.jsxs(o.Fragment,{children:[o.jsx(En.Value,{children:String(h)}),o.jsx(En.NoChange,{message:"Static count"})]}):o.jsx(En.NoData,{})]}),o.jsxs(En,{children:[o.jsx(En.Label,{children:"Avg Score"}),u?o.jsx(En.Loading,{}):n!=null?o.jsxs(o.Fragment,{children:[o.jsx(En.Value,{children:String(n)}),m?o.jsx(En.Change,{changePct:m.changePct,prevValue:m.prevValue}):o.jsx(En.NoChange,{})]}):o.jsx(En.NoData,{})]}),o.jsxs(En,{children:[o.jsx(En.Label,{children:"Total Experiments"}),c?o.jsx(En.Loading,{}):p!=null?o.jsxs(o.Fragment,{children:[o.jsx(En.Value,{children:String(p)}),g?o.jsx(En.Change,{changePct:g.changePct,prevValue:g.prevValue}):o.jsx(En.NoChange,{})]}):o.jsx(En.NoData,{})]}),o.jsxs(En,{children:[o.jsx(En.Label,{children:"Needs Review"}),d?o.jsx(En.Loading,{}):a!=null?o.jsxs(o.Fragment,{children:[o.jsx(En.Value,{children:String(a)}),a>0?o.jsx(En.NoChange,{message:"items pending review"}):o.jsx(En.NoChange,{message:"All caught up"})]}):o.jsx(En.NoData,{})]})]})}const tAn=[{value:"all",label:"All statuses"},{value:"completed",label:"Completed"},{value:"running",label:"Running"},{value:"failed",label:"Failed"},{value:"pending",label:"Pending"}],H8e="auto 1fr auto auto auto auto auto auto auto";function rAn(e){return e?(typeof e=="string"?new Date(e):e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}const nAn={completed:"success",running:"warning",failed:"error",pending:"neutral"};function sAn({experiments:e,datasets:t,reviewByExperiment:r,isLoading:n,search:s="",statusFilter:a="all",datasetFilter:i="all"}){const{paths:l,Link:c}=or(),u=b.useMemo(()=>{const h=new Map;return t?.forEach(p=>h.set(p.id,p.name)),h},[t]),d=b.useMemo(()=>[...e].sort((h,p)=>{const m=h.createdAt?new Date(h.createdAt).getTime():0;return(p.createdAt?new Date(p.createdAt).getTime():0)-m}),[e]),f=b.useMemo(()=>{const h=s.toLowerCase();return d.filter(p=>{const m=p.datasetId?u.get(p.datasetId)??"":"",g=!h||p.id.toLowerCase().includes(h)||m.toLowerCase().includes(h)||(p.targetId??"").toLowerCase().includes(h),y=a==="all"||p.status===a,x=i==="all"||p.datasetId===i;return g&&y&&x})},[d,s,u,a,i]);return n?o.jsx(yh,{columns:H8e}):o.jsxs(Se,{columns:H8e,children:[o.jsxs(Se.Top,{children:[o.jsx(Se.TopCell,{children:"Experiment"}),o.jsx(Se.TopCell,{children:"Dataset"}),o.jsx(Se.TopCell,{children:"Target"}),o.jsx(Se.TopCell,{children:"Status"}),o.jsx(Se.TopCell,{className:"text-center",children:"Items"}),o.jsx(Se.TopCell,{className:"text-center",children:"Succeeded"}),o.jsx(Se.TopCell,{className:"text-center",children:"Failed"}),o.jsx(Se.TopCell,{className:"text-center",children:"Review"}),o.jsx(Se.TopCell,{children:"Date"})]}),f.map(h=>{const p=h.datasetId?u.get(h.datasetId)??h.datasetId.slice(0,8):"—",m=h.status??"pending",g=h.succeededCount??0,y=h.failedCount??0,x=h.totalItems??0,w=x>0?Math.round(g/x*100):0;return o.jsxs(Se.RowLink,{to:l.experimentLink(h.id),LinkComponent:c,children:[o.jsx(Se.NameCell,{className:"font-mono",children:h.id.slice(0,8)}),o.jsx(Se.TextCell,{children:p}),o.jsx(Se.Cell,{children:o.jsxs("span",{className:"truncate",children:[h.targetType," ",h.targetId]})}),o.jsx(Se.Cell,{children:o.jsx(DP,{variant:nAn[m]??"neutral",withDot:!0,children:m})}),o.jsx(Se.TextCell,{className:"text-center",children:x}),o.jsx(Se.TextCell,{className:"text-center",children:o.jsxs("span",{className:g>0?"text-accent1":"",children:[g," (",w,"%)"]})}),o.jsx(Se.TextCell,{className:"text-center",children:o.jsx("span",{className:y>0?"text-accent2":"",children:y})}),o.jsx(Se.Cell,{className:"text-center",children:(()=>{const S=r?.get(h.id);if(!S)return o.jsx("span",{className:"text-neutral2",children:"—"});const k=S.needsReview+S.complete;return k===0?o.jsx("span",{className:"text-neutral2",children:"—"}):S.needsReview>0?o.jsxs(vt,{variant:"warning",children:[S.needsReview," pending"]}):o.jsxs(vt,{variant:"success",children:[S.complete,"/",k," reviewed"]})})()}),o.jsx(Se.TextCell,{children:rAn(h.createdAt)})]},h.id)})]})}function aAn(e){return[{value:"all",label:"All datasets"},...(e??[]).map(t=>({value:t.id,label:t.name}))]}const BL={completed:"#22c55e",running:"#facc15",pending:"#fb923c",failed:"#f87171"},iAn=[{label:"Completed",color:BL.completed},{label:"Running",color:BL.running},{label:"Pending",color:BL.pending},{label:"Failed",color:BL.failed}];function oAn({experiments:e,datasets:t,isLoading:r,isError:n}){const{data:s,maxVal:a}=b.useMemo(()=>{if(!e||e.length===0)return{data:[],maxVal:0};const l=new Map;if(t)for(const f of t)l.set(f.id,f.name);const c=new Map;for(const f of e){const h=f.datasetId??"unknown";c.has(h)||c.set(h,{completed:0,running:0,pending:0,failed:0});const p=c.get(h),m=f.status;m in p&&p[m]++}let u=0;return{data:Array.from(c.entries()).map(([f,h])=>{const p=h.completed+h.running+h.pending+h.failed;return p>u&&(u=p),{name:l.get(f)??f.slice(0,12),values:[h.completed,h.running,h.pending,h.failed]}}),maxVal:u}},[e,t]),i=s.length>0;return o.jsxs(Wt,{children:[o.jsxs(Wt.TopBar,{children:[o.jsx(Wt.TitleAndDescription,{title:"Experiments by Dataset",description:"Experiment status breakdown per dataset."}),i&&o.jsx(Wt.Summary,{value:String(e?.length??0),label:"Total experiments"})]}),r?o.jsx(Wt.Loading,{}):n?o.jsx(Wt.Error,{message:"Failed to load experiments data"}):o.jsx(Wt.Content,{children:i?o.jsx(K_,{data:s,segments:iAn,maxVal:a,fmt:l=>String(l)}):o.jsx(Wt.NoData,{message:"No experiments have been run yet"})})]})}const lAn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(yf,{}),titleSlot:"No Experiments yet",descriptionSlot:o.jsxs(o.Fragment,{children:["Run an experiment from a dataset to evaluate ",o.jsx("br",{}),"your agents and workflows."]}),actionSlot:o.jsx("div",{className:"flex flex-col items-center gap-2",children:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/evals/datasets/running-experiments",target:"_blank",rel:"noopener noreferrer",children:["Experiments Documentation ",o.jsx(ba,{})]})})})});function cAn({search:e,onSearchChange:t,statusFilter:r,onStatusFilterChange:n,datasetFilter:s,onDatasetFilterChange:a,datasetOptions:i,onReset:l,hasActiveFilters:c}){return o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(Sg,{label:"Search experiments",placeholder:"Filter by experiment, dataset, or target",value:e,onSearch:t}),o.jsxs(ps,{children:[o.jsx($o,{label:"Status",labelIsHidden:!0,name:"filter-status",options:[...tAn],value:r,onValueChange:n,className:"whitespace-nowrap"}),o.jsx($o,{label:"Dataset",labelIsHidden:!0,name:"filter-dataset",options:i,value:s,onValueChange:a,className:"whitespace-nowrap"}),l&&c&&o.jsxs(ce,{onClick:l,size:"sm",variant:"default",children:[o.jsx(Nn,{className:"size-3"})," Reset"]})]})]})}function uAn(){const{data:e,isLoading:t,error:r}=cd(),{data:n,isLoading:s,error:a}=Lh(),{data:i,isLoading:l,error:c}=r8(),{data:u,isLoading:d,isError:f,error:h}=mOn(),{data:p,isLoading:m,isError:g,error:y}=Pve(),x=n?.datasets,w=i?.experiments,S=b.useMemo(()=>zNn(p),[p]),k=r||a||c||h||y;return k&&Ps(k)?o.jsx(Jr,{title:"Evaluation",icon:o.jsx(Tu,{}),children:o.jsx(sa,{})}):k&&Os(k)?o.jsx(Jr,{title:"Evaluation",icon:o.jsx(Tu,{}),children:o.jsx(Zs,{resource:"evaluation"})}):k?o.jsx(Jr,{title:"Evaluation",icon:o.jsx(Tu,{}),children:o.jsx(pu,{title:"Failed to load evaluation data",message:k.message})}):o.jsxs(bt,{width:"wide",height:"full",children:[o.jsx(bt.TopArea,{className:"sticky top-0 z-100 bg-surface1 ",children:o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{children:[o.jsx(Tu,{})," Evaluation"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/evals/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Evaluation documentation",children:o.jsx(Li,{})})})]})}),o.jsxs("div",{className:"flex flex-col gap-6 pt-4",children:[o.jsx(pie,{children:o.jsx(eAn,{scorers:e,datasets:x,experiments:w,avgScore:u?.avgScore??null,prevAvgScore:u?.prevAvgScore??null,totalNeedsReview:S.needsReview,isLoadingScorers:t,isLoadingDatasets:s,isLoadingExperiments:l,isLoadingScores:d,isLoadingReview:m})}),o.jsx(sOn,{summaryData:u?.summaryData??[],overTimeData:u?.overTimeData??[],scorerNames:u?.scorerNames??[],avgScore:u?.avgScore??null,isLoading:d,isError:f}),o.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2",children:[o.jsx(cTn,{experiments:w,isLoading:l,isError:!!c}),o.jsx(oAn,{experiments:w,datasets:x,isLoading:l,isError:!!c})]}),o.jsx($Nn,{reviewSummary:p,experiments:w,datasets:x,isLoading:m,isError:!!g})]})]})}function dAn(){const[e,t]=b.useState(""),[r,n]=b.useState("all"),[s,a]=b.useState("all"),{data:i,isLoading:l,error:c}=Lh(),{data:u,isLoading:d,error:f}=r8(),{data:h}=Pve(),p=b.useMemo(()=>i?.datasets??[],[i?.datasets]),m=b.useMemo(()=>u?.experiments??[],[u?.experiments]),g=b.useMemo(()=>aAn(p),[p]),y=b.useMemo(()=>W1t(h),[h]),x=l||d,w=f||c;if(w&&Ps(w))return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Tu,{}),children:o.jsx(sa,{})});if(f&&Os(f))return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Tu,{}),children:o.jsx(Zs,{resource:"experiments"})});if(c&&Os(c))return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Tu,{}),children:o.jsx(Zs,{resource:"datasets"})});if(w)return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Tu,{}),children:o.jsx(pu,{title:"Failed to load experiments",message:w.message})});if(m.length===0&&!x)return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Tu,{}),children:o.jsx(lAn,{})});const S=r!=="all"||s!=="all"||e!=="",k=()=>{t(""),n("all"),a("all")};return o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:x,children:[o.jsx(Tu,{})," Experiments"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/evals/datasets/running-experiments",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Experiments documentation",children:o.jsx(Li,{})})})]}),o.jsx(cAn,{search:e,onSearchChange:t,statusFilter:r,onStatusFilterChange:n,datasetFilter:s,onDatasetFilterChange:a,datasetOptions:g,onReset:k,hasActiveFilters:S})]}),o.jsx(sAn,{experiments:m,datasets:p,reviewByExperiment:y,isLoading:x,search:e,statusFilter:r,datasetFilter:s})]})}function fAn(){const{experimentId:e}=na(),{data:t,isLoading:r}=r8(),s=t?.experiments?.find(p=>p.id===e)?.datasetId??"",{data:a,isLoading:i,error:l}=G6(s,e??""),{data:c,isLoading:u,setEndOfListElement:d,isFetchingNextPage:f,hasNextPage:h}=t8({datasetId:s,experimentId:e??"",experimentStatus:a?.status});return e?r||i||!s?o.jsx(zr,{children:o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx(Dt,{})})}):l&&Ps(l)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(sa,{})})}):l&&Os(l)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):l||!a?o.jsx(zr,{children:o.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",l instanceof Error?l.message:"Unknown error"]})}):o.jsxs(zr,{children:[o.jsx(Cn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/experiments",children:[o.jsx(Ce,{children:o.jsx(Tu,{})}),"Experiments"]}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Experiment"})]})}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:"grid gap-1 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[o.jsx(Q1t,{experimentId:e,experiment:a}),o.jsx(H1t,{experimentId:e,experimentStatus:a?.status,results:c??[],isLoading:u,setEndOfListElement:d,isFetchingNextPage:f,hasNextPage:h})]})})]}):null}function G1t({redirectUri:e,onSuccess:t,initialMode:r="signin",errorMessage:n}){const{data:s,isLoading:a}=wC(),{mutate:i,isPending:l,error:c}=vjn(),{mutate:u,isPending:d,error:f}=bjn(),{mutate:h,isPending:p}=M1t(),[m,g]=b.useState(r),[y,x]=b.useState(""),[w,S]=b.useState(""),[k,_]=b.useState("");if(a)return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface1",children:o.jsx("div",{className:"text-neutral3",children:"Loading..."})});if(!s?.enabled||!s?.login)return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface1",children:o.jsx("div",{className:"text-neutral3",children:"Authentication is not configured"})});const{login:E}=s,T=E.type==="sso"||E.type==="both",j=E.type==="credentials"||E.type==="both",N=E.sso,I=E.signUpEnabled!==!1,P=m==="signin"||!I,R=P?l:d,B=P?c:f,D=()=>{t?t():e?window.location.href=e:window.location.href="/"},$=H=>{H.preventDefault(),P?i({email:w,password:k},{onSuccess:D}):u({email:w,password:k,name:y||void 0},{onSuccess:D})},U=()=>{h({redirectUri:e},{onSuccess:H=>{window.location.href=H.url}})},z=()=>{g(P?"signup":"signin")};return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface1",children:o.jsxs("div",{className:"w-full max-w-sm space-y-6 rounded-lg border border-border1 bg-surface2 p-8",children:[o.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[o.jsx(Yb,{className:"h-10 w-10"}),o.jsx("h1",{className:"text-xl font-semibold text-neutral6",children:P?"Sign in to Mastra Studio":"Create your account"})]}),E.description&&o.jsxs("div",{className:"flex items-start gap-2.5 rounded-md border border-border1 bg-surface1 p-3",children:[o.jsx(wVe,{className:"mt-0.5 h-4 w-4 shrink-0 text-neutral4"}),o.jsx("p",{className:"text-sm text-neutral3",children:E.description})]}),n&&o.jsx("div",{className:"rounded-md bg-red-500/10 p-3 text-sm text-red-400",children:n}),j&&o.jsxs("form",{onSubmit:$,className:"space-y-4",children:[!P&&o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{htmlFor:"name",className:"block text-sm text-neutral4",children:"Name"}),o.jsx(ar,{id:"name",type:"text",value:y,onChange:H=>x(H.target.value),placeholder:"Your name",variant:"default",size:"lg"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{htmlFor:"email",className:"block text-sm text-neutral4",children:"Email"}),o.jsx(ar,{id:"email",type:"email",value:w,onChange:H=>S(H.target.value),placeholder:"you@example.com",required:!0,variant:"default",size:"lg"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{htmlFor:"password",className:"block text-sm text-neutral4",children:"Password"}),o.jsx(ar,{id:"password",type:"password",value:k,onChange:H=>_(H.target.value),placeholder:P?"Enter your password":"Create a password",required:!0,variant:"default",size:"lg"})]}),B&&o.jsx("div",{className:"rounded-md bg-red-500/10 p-3 text-sm text-red-400",children:B.message}),o.jsx(ce,{type:"submit",disabled:R,className:"w-full",size:"lg",children:R?P?"Signing in...":"Creating account...":P?"Sign in":"Create account"}),I&&o.jsxs("div",{className:"text-center text-sm",children:[o.jsx("span",{className:"text-neutral3",children:P?"Don't have an account? ":"Already have an account? "}),o.jsx("button",{type:"button",onClick:z,className:"text-neutral6 hover:underline",children:P?"Sign up":"Sign in"})]})]}),T&&j&&o.jsxs("div",{className:"relative",children:[o.jsx("div",{className:"absolute inset-0 flex items-center",children:o.jsx("div",{className:"w-full border-t border-border1"})}),o.jsx("div",{className:"relative flex justify-center text-sm",children:o.jsx("span",{className:"bg-surface2 px-2 text-neutral3",children:"or continue with"})})]}),T&&N&&o.jsxs(ce,{onClick:U,disabled:p,className:"w-full",size:"lg",variant:"outline",children:[N.icon&&o.jsx("span",{className:"mr-2",children:N.icon}),p?"Redirecting...":N.text||"Sign in"]})]})})}function hAn(){const[e]=ao(),t=uu(),r=e.get("redirect")||"/",s=e.get("mode")==="signup"?"signup":"signin",a=e.get("error_description")||e.get("error")||null,i=()=>{r.startsWith("http")?window.location.href=r:t(r,{replace:!0})};return o.jsx(G1t,{redirectUri:r,onSuccess:i,initialMode:s,errorMessage:a})}function pAn(){const[e,t]=ao(),r=Ezr(e,t),n=Tzr(e,t),[s,a]=b.useState(),[i,l]=b.useState(!1),{data:c=[],isPending:u}=Tht(),{data:d=[],isPending:f}=Nht({entityType:r.selectedEntityOption?.entityType,rootOnly:!0}),{data:h=[],isPending:p}=Aht(),{data:m=[],isPending:g}=Iht(),y=b.useMemo(()=>bzr({availableTags:c,availableRootEntityNames:d,availableServiceNames:m,availableEnvironments:h,loading:{tags:u,entityNames:f,serviceNames:g,environments:p}}),[c,d,m,h,u,f,g,p]),x=b.useMemo(()=>Ozr({rootEntityType:r.selectedEntityOption?.entityType,dateFrom:r.selectedDateFrom,dateTo:r.selectedDateTo,tokens:r.filterTokens}),[r.filterTokens,r.selectedDateFrom,r.selectedDateTo,r.selectedEntityOption]),{data:w=[],isLoading:S,error:k,isFetchingNextPage:_,hasNextPage:E,setEndOfListElement:T}=hzr({filters:x}),{logIdMap:j,featuredLog:N,handleLogClick:I,handlePreviousLog:P,handleNextLog:R}=Izr(w,r.featuredLogId,r.handleFeaturedChange,r.featuredTraceId),{data:B,isLoading:D}=Mme(r.featuredTraceId??null),{data:$,isLoading:U}=MS(r.featuredTraceId??"",r.featuredSpanId??""),z=b.useCallback(()=>r.applyFilterTokens(kzr(y,r.filterTokens)),[y,r]),H=b.useCallback(()=>r.handleFeaturedChange({logId:null}),[r]),Q=b.useCallback(G=>r.handleFeaturedChange({traceId:G,spanId:null}),[r]),L=b.useCallback((G,J)=>r.handleFeaturedChange({traceId:G,spanId:J}),[r]),Z=b.useCallback(()=>{r.handleFeaturedChange({traceId:null,spanId:null}),l(!1)},[r]),V=b.useCallback(()=>r.handleFeaturedChange({spanId:null}),[r]),M=b.useCallback(G=>r.handleFeaturedChange({spanId:G??null}),[r]);if(k)return o.jsx(Jr,{title:"Logs",icon:o.jsx(YL,{}),children:o.jsx(szr,{error:k,resource:"logs",errorTitle:"Failed to load logs"})});const W=r.filterTokens.length>0||r.datePreset!=="last-24h"||!!r.selectedDateTo;return w.length===0&&!S&&!W?o.jsx(Jr,{title:"Logs",icon:o.jsx(YL,{}),children:o.jsx(czr,{})}):o.jsxs(bt,{width:"wide",height:"full",children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:S,children:[o.jsx(YL,{})," Logs"]})})}),o.jsxs(bt.Column,{className:"flex justify-end items-center gap-2",children:[o.jsx(lht,{preset:r.datePreset,onPresetChange:r.handleDatePresetChange,dateFrom:r.selectedDateFrom,dateTo:r.selectedDateTo,onDateChange:r.handleDateChange,disabled:S,presets:["last-24h","last-3d","last-7d","last-14d","last-30d","custom"]}),o.jsx(dft,{fields:y,tokens:r.filterTokens,onTokensChange:r.handleFilterTokensChange,disabled:S,onStartTextFilter:a}),o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/observability/logs/overview",target:"_blank",rel:"noopener noreferrer","aria-label":"Logs documentation",tooltipContent:"Go to Logs documentation",children:o.jsx(Li,{})})]})]}),o.jsx(ozr,{isLoading:S,filterFields:y,filterTokens:r.filterTokens,onFilterTokensChange:r.handleFilterTokensChange,onClear:z,onRemoveAll:r.handleRemoveAll,onSave:n.handleSave,onRemoveSaved:n.hasSavedFilters?n.handleRemoveSaved:void 0,autoFocusFilterFieldId:s})]}),o.jsx(azr,{logCollapsed:i,listSlot:o.jsx(izr,{logs:w,isLoading:S,isFetchingNextPage:_,hasNextPage:E,setEndOfListElement:T,logIdMap:j,featuredLogId:r.featuredLogId,onLogClick:I}),logPanelSlot:N?o.jsx(nzr,{log:N,onClose:H,onTraceClick:Q,onSpanClick:L,onPrevious:P,onNext:R,collapsed:i,onCollapsedChange:l}):null,tracePanelSlot:r.featuredTraceId?o.jsx(CFr,{traceId:r.featuredTraceId,spans:B?.spans,isLoading:D,onClose:Z,onSpanSelect:M,selectedSpanId:r.featuredSpanId}):null,spanPanelSlot:r.featuredTraceId&&r.featuredSpanId?o.jsx(EFr,{spanId:r.featuredSpanId,span:$?.span,isLoading:U,onClose:V}):null})]})}const Z1t=e=>{const t=Ge();return kt({queryKey:["mcpserver-tools",e?.id],queryFn:async()=>{const n=(await t.getMcpServerTools(e?.id)).tools,s={};return n.forEach(a=>{s[a.id]=a}),s},retry:!1,refetchOnWindowFocus:!1})};function mAn({server:e}){const{paths:t,Link:r}=or(),s=Ge().options.baseUrl,a=s?`${s}/api/mcp/${e.id}/sse`:"",{data:i}=Z1t(e),l=Object.values(i||{}),c=l.length,u=l.filter(h=>h.toolType==="agent").length,d=l.filter(h=>h.toolType==="workflow").length,f=Ch(e.name,50);return o.jsxs(Se.RowLink,{to:t.mcpServerLink(e.id),LinkComponent:r,children:[o.jsx(Se.NameCell,{children:f}),o.jsx(Se.DescriptionCell,{children:a}),o.jsx(Se.TextCell,{className:"text-center",children:u||""}),o.jsx(Se.TextCell,{className:"text-center",children:c||""}),o.jsx(Se.TextCell,{className:"text-center",children:d||""})]})}function gAn({mcpServers:e,isLoading:t,search:r=""}){const n=b.useMemo(()=>{const s=r.toLowerCase();return e.filter(a=>a.name?.toLowerCase().includes(s)||a.id?.toLowerCase().includes(s))},[e,r]);return t?o.jsx(yh,{columns:"auto 1fr auto auto auto"}):o.jsxs(Se,{columns:"auto 1fr auto auto auto",children:[o.jsxs(Se.Top,{children:[o.jsx(Se.TopCell,{children:"Name"}),o.jsx(Se.TopCell,{children:"URL"}),o.jsx(Se.TopCellSmart,{long:"Agents",short:o.jsx(ga,{}),tooltip:"Agent Tools",className:"text-center"}),o.jsx(Se.TopCellSmart,{long:"Tools",short:o.jsx(Mi,{}),tooltip:"Tools",className:"text-center"}),o.jsx(Se.TopCellSmart,{long:"Workflows",short:o.jsx(Di,{}),tooltip:"Workflow Tools",className:"text-center"})]}),n.length===0&&r?o.jsx(Se.NoMatch,{message:"No MCP Servers match your search"}):null,n.map(s=>o.jsx(mAn,{server:s},s.id))]})}const yAn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(yf,{}),titleSlot:"No MCP Servers yet",descriptionSlot:o.jsxs(o.Fragment,{children:["MCP servers are not configured yet. ",o.jsx("br",{}),"More information in the documentation."]}),actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/tools-mcp/mcp-overview",target:"_blank",rel:"noopener noreferrer",children:["MCP Documentation ",o.jsx(ba,{})]})})}),vAn=()=>{const{data:e=[],isLoading:t,error:r}=uM(),[n,s]=b.useState("");return r&&Ps(r)?o.jsx(Jr,{title:"MCP Servers",icon:o.jsx(gl,{}),children:o.jsx(sa,{})}):r&&Os(r)?o.jsx(Jr,{title:"MCP Servers",icon:o.jsx(gl,{}),children:o.jsx(Zs,{resource:"MCP servers"})}):r?o.jsx(Jr,{title:"MCP Servers",icon:o.jsx(gl,{}),children:o.jsx(pu,{title:"Failed to load MCP servers",message:r.message})}):e.length===0&&!t?o.jsx(Jr,{title:"MCP Servers",icon:o.jsx(gl,{}),children:o.jsx(yAn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:t,children:[o.jsx(gl,{})," MCP Servers"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to MCP documentation",children:o.jsx(Li,{})})})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Sg,{onSearch:s,label:"Filter MCP servers",placeholder:"Filter by name"})})]}),o.jsx(gAn,{mcpServers:e,isLoading:t,search:n})]})},bAn=(e,t)=>{const r=new Map,n=Object.keys(t);for(const s of n){const a=t[s],i=a.tools,l=Object.keys(i);for(const c of l){const u=i[c];r.has(u.id)||r.set(u.id,{...u,agents:[]}),r.get(u.id).agents.push({...a,id:s})}}for(const[s,a]of Object.entries(e))r.has(a.id)||r.set(a.id,{...a,agents:[]});return Array.from(r.values())};function xAn({tools:e,agents:t,isLoading:r,search:n=""}){const{paths:s,Link:a}=or(),i=b.useMemo(()=>bAn(e,t),[e,t]),l=b.useMemo(()=>i.filter(c=>c.id.toLowerCase().includes(n.toLowerCase())),[i,n]);return r?o.jsx(yh,{columns:"auto 1fr auto"}):o.jsxs(Se,{columns:"auto 1fr auto",children:[o.jsxs(Se.Top,{children:[o.jsx(Se.TopCell,{children:"Name"}),o.jsx(Se.TopCell,{children:"Description"}),o.jsx(Se.TopCellSmart,{long:"Agents",short:o.jsx(ga,{}),tooltip:"Attached Agents",className:"text-center"})]}),l.length===0&&n?o.jsx(Se.NoMatch,{message:"No Tools match your search"}):null,l.map(c=>{const u=Ch(c.id,50),d=Ch(c.description??"",200),f=c.agents.length;return o.jsxs(Se.RowLink,{to:s.toolLink(c.id),LinkComponent:a,children:[o.jsx(Se.NameCell,{children:u}),o.jsx(Se.DescriptionCell,{children:d}),o.jsx(Se.TextCell,{className:"text-center",children:f||""})]},c.id)})]})}const wAn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(yf,{}),titleSlot:"No Tools yet",descriptionSlot:o.jsxs(o.Fragment,{children:["Mastra tools are not configured yet. ",o.jsx("br",{}),"More information in the documentation."]}),actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/agents/using-tools-and-mcp",target:"_blank",rel:"noopener noreferrer",children:["Tools Documentation ",o.jsx(ba,{})]})})}),SAn=()=>{const e=Ge();return Kr({mutationFn:async({toolId:t,input:r,requestContext:n})=>{const s=new f_;Object.entries(n??{}).forEach(([a,i])=>{s.set(a,i)});try{return await e.getTool(t).execute({data:r,requestContext:s})}catch(a){throw ze.error("Error executing dev tool"),console.error("Error executing dev tool:",a),a}}})},OAn=({toolId:e})=>{const{canExecute:t}=Sv(),r=t("tools"),{data:n={}}=Eg(),s=b.useMemo(()=>{for(const g of Object.values(n))if(g.tools){const y=Object.values(g.tools).find(x=>x.id===e);if(y)return y}return null},[n,e]),{data:a,isLoading:i,error:l}=zkn(e,{enabled:!s}),c=s||a,{mutateAsync:u,isPending:d,data:f}=SAn(),{requestContext:h}=ks();b.useEffect(()=>{if(l){const g=l instanceof Error?l.message:"Failed to load tool";ze.error(`Error loading tool: ${g}`)}},[l]);const p=async(g,y)=>{if(!c)return;const x={...h??{},...y??{}};return u({toolId:c.id,input:g,requestContext:x})},m=c?.inputSchema?lg(ag(ev(c?.inputSchema))):Gn({});return i?o.jsxs("div",{className:"p-6",children:[o.jsx(Dn,{className:"h-8 w-48 mb-4"}),o.jsx(Dn,{className:"h-32 w-full"})]}):l?null:c?r?o.jsx(xve,{executionResult:f,isExecutingTool:d,zodInputSchema:m,handleExecuteTool:p,toolDescription:c.description,toolId:c.id,requestContextSchema:c.requestContextSchema}):o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(me,{variant:"ui-sm",className:"text-neutral3",children:"You don't have permission to execute tools."})}):o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(me,{variant:"header-md",className:"text-neutral3",children:"Tool not found"})})};function kAn({value:e,onValueChange:t,placeholder:r="Select a tool...",searchPlaceholder:n="Search tools...",emptyText:s="No tools found.",className:a,disabled:i=!1,variant:l="default"}){const{data:c={},isLoading:u,isError:d,error:f}=JB(),{data:h={},isLoading:p,isError:m,error:g}=Eg(),{navigate:y,paths:x}=or();b.useEffect(()=>{if(d){const _=f instanceof Error?f.message:"Failed to load tools";ze.error(`Error loading tools: ${_}`)}},[d,f]),b.useEffect(()=>{if(m){const _=g instanceof Error?g.message:"Failed to load agents";ze.error(`Error loading agents: ${_}`)}},[m,g]);const w=new Map;Object.values(h).forEach(_=>{_.tools&&Object.values(_.tools).forEach(E=>{w.has(E.id)||w.set(E.id,E)})}),Object.values(c).forEach(_=>{w.has(_.id)||w.set(_.id,_)});const S=Array.from(w.values()).map(_=>({label:_.id,value:_.id})),k=_=>{t?t(_):_&&_!==e&&y(x.toolLink(_))};return o.jsx(Gl,{options:S,value:e,onValueChange:k,placeholder:u||p?"Loading tools...":r,searchPlaceholder:n,emptyText:s,className:a,disabled:i||u||p||d||m,variant:l})}const _An=({isLoading:e,server:t})=>{const[{sseUrl:r,httpStreamUrl:n},s]=b.useState({sseUrl:"",httpStreamUrl:""});if(b.useEffect(()=>{if(!t)return;const i=window.MASTRA_SERVER_HOST,l=window.MASTRA_SERVER_PORT;let c=null;i&&l&&(c=`http://${i}:${l}`);const u=c||"http://localhost:4111",d=`${u}/api/mcp/${t.id}/sse`,f=`${u}/api/mcp/${t.id}/mcp`;s({sseUrl:d,httpStreamUrl:f})},[t]),e)return null;if(!t)return o.jsx(df,{children:o.jsx(me,{as:"h1",variant:"header-md",className:"text-neutral3 font-medium py-20 text-center",children:"Server not found"})});const a=`npx -y mcp-remote ${r}`;return o.jsxs(df,{isDivided:!0,children:[o.jsxs("div",{className:"px-8 py-12 mx-auto max-w-2xl w-full",children:[o.jsx(me,{as:"h1",variant:"header-md",className:"text-neutral6 font-medium pb-4",children:t.name}),o.jsxs("div",{className:"flex items-center gap-1 pb-6",children:[o.jsx(vt,{icon:o.jsx(B9,{className:"text-neutral6"}),className:"rounded-r-sm text-neutral4!",children:"Version"}),o.jsx(vt,{className:"rounded-l-sm text-neutral4!",children:t.version_detail.version})]}),o.jsx(me,{className:"text-neutral3 pb-4",children:"This MCP server can be accessed through multiple transport methods. Choose the one that best fits your use case."}),o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[o.jsx(vt,{icon:o.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"HTTP"}),children:"Regular HTTP Endpoint"}),o.jsx(me,{className:"text-neutral3 pt-1 pb-2",children:"Use for stateless HTTP transport with streamable responses."}),o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(me,{className:"px-2 py-1 bg-surface4 rounded-lg",children:n}),o.jsx("div",{className:"pt-1",children:o.jsx(ta,{tooltip:"Copy HTTP Stream URL",content:n})})]})]}),o.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[o.jsx(vt,{icon:o.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"SSE"}),children:"Server-Sent Events"}),o.jsx(me,{className:"text-neutral3 pt-1 pb-2",children:"Use for real-time communication via SSE."}),o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(me,{className:"px-2 py-1 bg-surface4 rounded-lg",children:r}),o.jsx("div",{className:"pt-1",children:o.jsx(ta,{tooltip:"Copy SSE URL",content:r})})]})]}),o.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[o.jsx(vt,{icon:o.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"CLI"}),children:"Command Line"}),o.jsx(me,{className:"text-neutral3 pt-1 pb-2",children:"Use for local command-line access via npx and mcp-remote."}),o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(me,{className:"px-2 py-1 bg-surface4 rounded-lg",children:a}),o.jsx("div",{className:"pt-1",children:o.jsx(ta,{tooltip:"Copy Command Line Config",content:a})})]})]})]})]}),o.jsx("div",{className:"h-full overflow-y-scroll border-l border-border1",children:o.jsx(EAn,{server:t})})]})},EAn=({server:e})=>{const{data:t={},isLoading:r}=Z1t(e);if(r)return null;const n=Object.keys(t);return o.jsxs("div",{className:"p-5 overflow-y-scroll",children:[o.jsxs("div",{className:"text-neutral6 flex gap-2 items-center",children:[o.jsx(Ce,{size:"lg",className:"bg-surface4 rounded-md p-1",children:o.jsx(gl,{})}),o.jsx(me,{variant:"header-md",as:"h2",className:"font-medium",children:"Available Tools"})]}),o.jsx("div",{className:"flex flex-col gap-2 pt-6",children:n.map(s=>{const a=t[s];return o.jsx(CAn,{tool:a,serverId:e.id},s)})})]})},CAn=({tool:e,serverId:t})=>{const r=b.useRef(null),{Link:n,paths:s}=or(),a=$St[e.toolType||"tool"];return o.jsxs(wf,{onClick:()=>r.current?.click(),children:[o.jsx(Edt,{children:o.jsx(a,{className:"group-hover/entity:text-accent6"})}),o.jsxs(kf,{children:[o.jsx(Sf,{children:o.jsx(n,{ref:r,href:s.mcpServerToolLink(t,e.id),children:e.id})}),o.jsx(Of,{children:e.description})]})]})},jAn=()=>{const{serverId:e}=na(),{data:t=[],isLoading:r}=uM(),n=t.find(s=>s.id===e);return o.jsxs(zr,{children:[o.jsxs(Cn,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/mcps",children:[o.jsx(Ce,{children:o.jsx(gl,{})}),"MCP Servers"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(e1t,{value:e,variant:"ghost"})})]}),o.jsx(fu,{children:o.jsxs(ce,{as:fr,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(o0,{}),"MCP documentation"]})})]}),o.jsx(_An,{isLoading:r,server:n})]})},Y1t=(e,t)=>{const{requestContext:r}=ks(),n=Ge();return kt({queryKey:["mcp-server-tool",e,t],queryFn:()=>n.getMcpServerTool(e,t).details(r)})},TAn=(e,t)=>{const{requestContext:r}=ks(),n=Ge();return Kr({mutationFn:s=>n.getMcpServerTool(e,t).execute({data:s,requestContext:r})})},NAn=({toolId:e,serverId:t})=>{const{canExecute:r}=Sv(),n=r("tools"),{data:s,isLoading:a,error:i}=Y1t(t,e),{mutateAsync:l,isPending:c,data:u}=TAn(t,e);b.useEffect(()=>{if(i){const h=i instanceof Error?i.message:"Failed to load tool";ze.error(`Error loading tool: ${h}`)}},[i]);const d=async h=>{if(s)return await l(h)};if(a)return o.jsxs("div",{className:"p-6",children:[o.jsx(Dn,{className:"h-8 w-48 mb-4"}),o.jsx(Dn,{className:"h-32 w-full"})]});if(i)return null;if(!s)return o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(me,{variant:"header-md",className:"text-neutral3",children:"Tool not found"})});if(!n)return o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(me,{variant:"ui-sm",className:"text-neutral3",children:"You don't have permission to execute tools."})});let f;try{f=lg(ag(s.inputSchema))}catch(h){console.error("Error processing input schema:",h),ze.error("Failed to process tool input schema."),f=Gn({})}return o.jsx(xve,{executionResult:u,isExecutingTool:c,zodInputSchema:f,handleExecuteTool:d,toolDescription:s.description||"",toolId:s.id})},AAn=()=>{const{data:e}=uM(),{serverId:t,toolId:r}=na(),{data:n,isLoading:s}=Y1t(t,r),a=e?.find(c=>c.id===t),i=n?.name,l=a?.name||"";return s||!n?null:o.jsxs("div",{className:"h-full w-full bg-surface2 overflow-y-hidden",children:[o.jsxs(Cn,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/mcps",children:[o.jsx(Ce,{children:o.jsx(gl,{})}),"MCP Servers"]}),o.jsx(jr,{as:fr,to:`/mcps/${t}`,children:l}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:i})]}),o.jsx(fu,{children:o.jsxs(ce,{as:fr,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(o0,{}),"MCP documentation"]})})]}),o.jsx(NAn,{toolId:r,serverId:t})]})};function IAn(){const{data:e,isLoading:t,isError:r}=oFr();return o.jsx(X6r,{data:e,isLoading:t,isError:r})}function RAn(){const{data:e,isLoading:t,isError:r}=wht();return o.jsx(Ame,{label:"Total Agent Runs",value:e?.value!=null?e.value.toLocaleString():null,prevValue:e?.previousValue!=null?e.previousValue.toLocaleString():void 0,changePct:e?.changePercent??null,isLoading:t,isError:r})}function PAn(){const{data:e,isLoading:t,isError:r}=sFr();return o.jsx(Ame,{label:"Total Model Cost",value:e?.cost!=null?Vw(e.cost,e.costUnit):null,prevValue:e?.previousCost!=null?Vw(e.previousCost,e.costUnit):void 0,changePct:e?.costChangePercent??null,isLoading:t,isError:r})}function MAn(){const{data:e,isLoading:t,isError:r}=aFr();return o.jsx(Ame,{label:"Total Tokens",value:e?.value!=null?Mm(e.value):null,prevValue:e?.previousValue!=null?Mm(e.previousValue):void 0,changePct:e?.changePercent??null,isLoading:t,isError:r})}function DAn(){const{data:e,isLoading:t,isError:r}=iFr();return o.jsx(K6r,{rows:e,isLoading:t,isError:r})}function LAn(){const{data:e,isLoading:t,isError:r}=cFr();return o.jsx(J6r,{data:e,isLoading:t,isError:r})}function $An(){const{data:e,isLoading:t,isError:r}=uFr();return o.jsx(tFr,{data:e,isLoading:t,isError:r})}function FAn(){const{data:e,isLoading:t,isError:r}=lFr();return o.jsx(rFr,{data:e,isLoading:t,isError:r})}const zAn=new Set(["ObservabilityStorageClickhouseVNext","ObservabilityStorageDuckDB","ObservabilityInMemory"]),are="period";function BAn(){const[e,t]=ao(),r=e.get(are),n=vht(r)?r:"24h",s=b.useCallback(a=>{t(i=>{const l=new URLSearchParams(i);return a==="24h"?l.delete(are):l.set(are,a),l},{replace:!0})},[t]);return o.jsx(G6r,{initialPreset:n,onPresetChange:s,children:o.jsx(UAn,{})})}function UAn(){const{error:e}=wht(),{data:t,isLoading:r}=HB(),n=t?.observabilityStorageType,s=n?zAn.has(n):!1,a=n==="ObservabilityInMemory";return e&&Ps(e)?o.jsx(Jr,{title:"Metrics",icon:o.jsx(nk,{}),children:o.jsx(sa,{})}):e&&Os(e)?o.jsx(Jr,{title:"Metrics",icon:o.jsx(nk,{}),children:o.jsx(Zs,{resource:"metrics"})}):e?o.jsx(Jr,{title:"Metrics",icon:o.jsx(nk,{}),children:o.jsx(pu,{title:"Failed to load metrics",message:e.message})}):o.jsxs(bt,{width:"wide",height:"full",children:[o.jsx(bt.TopArea,{className:"sticky top-0 z-100 bg-surface1 ",children:o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{children:[o.jsx(nk,{})," Metrics"]})})}),o.jsxs(bt.Column,{className:"flex justify-end gap-2",children:[o.jsx(Z6r,{}),o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/observability/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Metrics documentation",children:o.jsx(Li,{})})]})]})}),r?null:s?o.jsxs("div",{className:"grid gap-8 content-start pb-10",children:[a&&o.jsx(cn,{variant:"info",title:"Metrics are not persisted",children:o.jsx(cn.Message,{children:"This project uses in-memory storage for observability. Metrics will be lost on every server restart. For persistent metrics, switch the observability storage to ClickHouse or DuckDB."})}),o.jsxs(pie,{children:[o.jsx(RAn,{}),o.jsx(PAn,{}),o.jsx(MAn,{})]}),o.jsxs(pie,{children:[o.jsx(DAn,{}),o.jsx($An,{}),o.jsx(LAn,{}),o.jsx(FAn,{}),o.jsx(IAn,{})]})]}):o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(yf,{}),titleSlot:"Metrics are not available with your current storage",descriptionSlot:"Metrics require ClickHouse, DuckDB, or in-memory storage for observability. Relational databases (PostgreSQL, LibSQL) do not support metrics collection. To enable metrics on an existing project, switch the observability storage in the Mastra configuration.",actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/observability/metrics/overview",target:"_blank",rel:"noopener noreferrer",children:["Metrics Documentation ",o.jsx(ba,{})]})})})]})}const VAn=[{title:"Metrics",description:"View system performance metrics, request latencies, and throughput across your agents and workflows.",icon:nk,href:"/metrics"},{title:"Traces",description:"Explore distributed traces to debug and understand the execution flow of your AI operations.",icon:xo,href:"/observability"}];function qAn(){return o.jsxs(pk,{children:[o.jsx(pk.Top,{children:o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{children:[o.jsx(xo,{})," Observability"]})})})}),o.jsx("div",{className:"px-6 pt-6 overflow-y-auto",children:o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 max-w-3xl",children:VAn.map(e=>o.jsxs(fr,{to:e.href,className:"group flex flex-col gap-3 rounded-lg border border-border1 bg-surface2 p-5 transition-colors hover:border-accent1 hover:bg-surface3",children:[o.jsxs("div",{className:"flex items-center gap-2.5",children:[o.jsx(e.icon,{className:"h-5 w-5 text-icon3 group-hover:text-accent1 transition-colors"}),o.jsx("span",{className:"text-ui-md font-medium text-text1",children:e.title})]}),o.jsx("p",{className:"text-ui-sm text-text3 leading-relaxed",children:e.description})]},e.href))})})]})}const HAn=[{title:"Agents",description:"Create and manage AI agents with tools, memory, and custom instructions.",icon:ga,href:"/agents"},{title:"Prompts",description:"Design and version reusable prompt templates for your agents.",icon:Yi,href:"/prompts"},{title:"Workflows",description:"Build step-based execution flows with suspend, resume, and branching.",icon:Di,href:"/workflows"},{title:"Processors",description:"Configure data processors for transforming and routing information.",icon:eS,href:"/processors"},{title:"MCP Servers",description:"Connect to Model Context Protocol servers for external tool access.",icon:gl,href:"/mcps"},{title:"Tools",description:"Browse and test the tools available to your agents and workflows.",icon:Mi,href:"/tools"},{title:"Workspaces",description:"Organize your projects and resources into isolated workspaces.",icon:nc,href:"/workspaces"},{title:"Request Context",description:"Inspect request-scoped context propagation for dynamic configuration.",icon:jE,href:"/request-context"}];function QAn(){return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{children:[o.jsx(Z2t,{})," Primitives"]})})}),o.jsx(bt.MainArea,{children:o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:HAn.map(e=>o.jsxs(fr,{to:e.href,className:"group flex flex-col gap-3 rounded-lg border border-border1 bg-surface2 p-5 transition-colors hover:border-accent1 hover:bg-surface3",children:[o.jsxs("div",{className:"flex items-center gap-2.5",children:[o.jsx(e.icon,{className:"h-5 w-5 text-icon3 group-hover:text-accent1 transition-colors"}),o.jsx("span",{className:"text-ui-md font-medium text-text1",children:e.title})]}),o.jsx("p",{className:"text-ui-sm text-text3 leading-relaxed",children:e.description})]},e.href))})})]})}function WAn(){const{paths:e}=or(),{data:t,isLoading:r,error:n}=qSt(),{isCmsAvailable:s}=cM(),[a,i]=b.useState(""),l=t?.promptBlocks??[];return n&&Ps(n)?o.jsx(Jr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(sa,{})}):n&&Os(n)?o.jsx(Jr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(Zs,{resource:"prompt blocks"})}):n?o.jsx(Jr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(pu,{title:"Failed to load prompt blocks",message:n.message})}):l.length===0&&!r?o.jsx(Jr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(Nkn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:r,children:[o.jsx(Yi,{})," Prompts"]})})}),o.jsxs(bt.Column,{className:"flex justify-end gap-2",children:[o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/agents/agent-instructions#prompt-blocks",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Prompts documentation",children:o.jsx(Li,{})}),s&&o.jsxs(ce,{as:fr,to:e.cmsPromptBlockCreateLink(),variant:"primary",children:[o.jsx(us,{}),"Create Prompt"]})]})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Sg,{onSearch:i,label:"Filter prompts",placeholder:"Filter by name or description"})})]}),o.jsx(Tkn,{promptBlocks:l,isLoading:r,search:a})]})}function GAn(){return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{children:[o.jsx(jE,{})," Request Context"]})})}),o.jsx(bt.MainArea,{children:o.jsx(WSn,{children:o.jsx(SSt,{})})})]})}const ZAn=[{title:"Mastra APIs",description:"Explore and test the available REST API endpoints with the interactive Swagger UI.",icon:u2t,href:"/swagger-ui",external:!1},{title:"Documentation",description:"Read the official Mastra documentation for guides, references, and tutorials.",icon:Li,href:"https://mastra.ai/en/docs",external:!0},{title:"Github",description:"Browse the source code, report issues, and contribute to the Mastra project.",icon:ba,href:"https://github.com/mastra-ai/mastra",external:!0},{title:"Community",description:"Join the Mastra Discord community for help, discussion, and collaboration.",icon:tA,href:"https://discord.gg/BTYqqHKUrf",external:!0},{title:"Share with your team",description:"Running Mastra Studio locally? Deploy to the cloud so your team can collaborate.",icon:mVe,href:"https://mastra.ai/cloud",external:!0},{title:"Talk to our Sales team",description:"Get a custom demo, discuss on-prem deployments, and how we can help you accelerate getting agents into production.",icon:sMt,href:"https://mastra.ai/contact?ref=studio",external:!0}];function YAn(){return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{children:[o.jsx(Li,{})," Resources"]})})}),o.jsx(bt.MainArea,{children:o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 max-w-3xl",children:ZAn.map(e=>o.jsxs("a",{href:e.href,...e.external?{target:"_blank",rel:"noreferrer"}:{},className:"group flex flex-col gap-3 rounded-lg border border-border1 bg-surface2 p-5 transition-colors hover:border-accent1 hover:bg-surface3",children:[o.jsxs("div",{className:"flex items-center gap-2.5",children:[o.jsx(e.icon,{className:"h-5 w-5 text-icon3 group-hover:text-accent1 transition-colors"}),o.jsx("span",{className:"text-ui-md font-medium text-text1",children:e.title}),e.external&&o.jsx(ba,{className:"h-3.5 w-3.5 text-icon3 ml-auto opacity-0 group-hover:opacity-100 transition-opacity"})]}),o.jsx("p",{className:"text-ui-sm text-text3 leading-relaxed",children:e.description})]},e.href))})})]})}function XAn(){const{data:e={},isLoading:t,error:r}=cd(),[n,s]=b.useState(""),[a,i]=b.useState("all");if(r&&Ps(r))return o.jsx(Jr,{title:"Scorers",icon:o.jsx(La,{}),children:o.jsx(sa,{})});if(r&&Os(r))return o.jsx(Jr,{title:"Scorers",icon:o.jsx(La,{}),children:o.jsx(Zs,{resource:"scorers"})});if(r)return o.jsx(Jr,{title:"Scorers",icon:o.jsx(La,{}),children:o.jsx(pu,{title:"Failed to load scorers",message:r.message})});if(Object.keys(e).length===0&&!t)return o.jsx(Jr,{title:"Scorers",icon:o.jsx(La,{}),children:o.jsx(iOn,{})});const l=a!=="all"||n!=="",c=()=>{s(""),i("all")};return o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:t,children:[o.jsx(La,{})," Scorers"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/evals/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Scorers documentation",children:o.jsx(Li,{})})})]}),o.jsx(lOn,{search:n,onSearchChange:s,sourceFilter:a,onSourceFilterChange:i,onReset:c,hasActiveFilters:l})]}),o.jsx(aOn,{scorers:e,isLoading:t,search:n,sourceFilter:a})]})}function KAn(){const{scorerId:e}=na(),[t,r]=ao(),n=t.get("scoreId")??void 0,[s,a]=b.useState(n),[i,l]=b.useState({value:"all",label:"All Entities",type:"ALL"}),{scorer:c,isLoading:u,error:d}=rOn(e),{data:f={},isLoading:h,error:p}=Eg(),{isLoading:m,error:g}=c0(),{data:y=[],isLoading:x,error:w,isFetchingNextPage:S,hasNextPage:k,setEndOfListElement:_}=tOn({scorerId:e,entityId:i?.value==="all"?void 0:i?.value,entityType:i?.type==="ALL"?void 0:i?.type}),E=b.useMemo(()=>c?.agentIds?.filter(L=>f[L]).map(L=>({value:L,label:f[L].name,type:"AGENT"}))||[],[c?.agentIds,f]),T=b.useMemo(()=>c?.workflowIds?.map(L=>({value:L,label:L,type:"WORKFLOW"}))||[],[c?.workflowIds]),j=b.useMemo(()=>[{value:"all",label:"All Entities",type:"ALL"},...E,...T],[E,T]),N=t.get("entity")??"all",I=j.find(L=>L.value===N);I&&I.value!==i?.value&&l(I),b.useEffect(()=>{if(d){const L=d instanceof Error?d.message:"Failed to load scorer";ze.error(`Error loading scorer: ${L}`)}},[d]),b.useEffect(()=>{if(p){const L=p instanceof Error?p.message:"Failed to load agents";ze.error(`Error loading agents: ${L}`)}},[p]),b.useEffect(()=>{if(g){const L=g instanceof Error?g.message:"Failed to load workflows";ze.error(`Error loading workflows: ${L}`)}},[g]);const P=L=>{L?.value&&r(Z=>{const V=new URLSearchParams(Z);return V.set("entity",L.value),V})};b.useEffect(()=>{const L=t.get("scoreId")??void 0;if(L===s)return;if(!L){a(void 0);return}y.find(V=>V.id===L)&&a(L)},[t,y]);const R=b.useCallback(L=>{a(L||void 0),r(Z=>{const V=new URLSearchParams(Z);return L?V.set("scoreId",L):V.delete("scoreId"),V})},[r]);if(!c)return null;const B=Ps(d)||Ps(p)||Ps(g),D=d&&Os(d),$=!B&&!D&&(d||p||g),U=!x&&y.length===0,z=i?.value!=="all",H=o.jsxs(o.Fragment,{children:[o.jsxs(Xa,{children:[o.jsx(jr,{as:fr,to:"/scorers",children:"Scorers"}),o.jsx(nOn,{value:e,variant:"link"})]}),o.jsxs(bt.Row,{children:[o.jsxs(xn,{children:[o.jsxs(xn.Title,{isLoading:u,children:[o.jsx(La,{})," ",c?.scorer?.config?.name||e]}),(u||c?.scorer?.config?.description)&&o.jsx(xn.Description,{isLoading:u,children:c?.scorer?.config?.description})]}),o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/evals/overview",target:"_blank",rel:"noopener noreferrer","aria-label":"Scorers documentation",tooltipContent:"Go to Scorers documentation",children:o.jsx(Li,{})}),c?.scorer?.source==="stored"&&o.jsxs(ce,{variant:"default",as:fr,to:`/cms/scorers/${e}/edit`,children:[o.jsx(iv,{})," Edit"]})]})]})]});if(B||D||$||U&&!z){const L=(d instanceof Error?d.message:void 0)??(p instanceof Error?p.message:void 0)??(g instanceof Error?g.message:void 0)??"An unexpected error occurred";return o.jsxs(bt,{width:"wide",height:"full",children:[o.jsx(bt.TopArea,{children:H}),o.jsx(bt.MainArea,{isCentered:!0,children:B?o.jsx(sa,{}):D?o.jsx(Zs,{resource:"scorers"}):$?o.jsx(pu,{title:"Failed to load scorer",message:L}):o.jsx(G1n,{})})]})}return o.jsxs(bt,{width:"wide",children:[o.jsxs(bt.TopArea,{children:[H,o.jsx(X1n,{selectedEntity:i,entityOptions:j,onEntityChange:P,onReset:()=>{r(L=>{const Z=new URLSearchParams(L);return Z.set("entity","all"),Z})},isLoading:x||h||m})]}),o.jsx(W1n,{scores:y,isLoading:x,selectedScoreId:s,isFetchingNextPage:S,hasNextPage:k,setEndOfListElement:_,onScoreClick:R,errorMsg:w?.message})]})}const JAn=[{value:"dark",label:"Dark"},{value:"light",label:"Light"},{value:"system",label:"System"}],eIn=()=>{const{baseUrl:e,headers:t,apiPrefix:r}=cve(),{theme:n,setTheme:s}=gC();return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{children:[o.jsx(hme,{})," Settings"]})})}),o.jsxs(bt.MainArea,{className:"grid gap-8 mt-6",children:[o.jsx("section",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:o.jsxs("div",{className:"space-y-3",children:[o.jsx("h2",{className:"text-icon6 font-medium",children:"Theme"}),o.jsx(Oft,{name:"theme",label:"Theme mode",value:n,onValueChange:a=>s(a),options:JAn.map(a=>({...a}))})]})}),o.jsx(_St,{initialConfig:{baseUrl:e,headers:t,apiPrefix:r}})]})]})};function tIn(){const[e]=ao(),t=uu(),r=e.get("redirect")||"/",n=()=>{r.startsWith("http")?window.location.href=r:t(r,{replace:!0})};return o.jsx(G1t,{redirectUri:r,onSuccess:n,initialMode:"signup"})}function rIn(e){return e.replace(/\/$/,"").split("/").pop()}function s8({children:e,className:t}){return o.jsx("div",{className:Y("border border-border1 rounded-lg mt-12 py-8 lg:min-h-[25rem] transition-height px-4 lg:px-12",t),children:e})}function nIn({templates:e,linkComponent:t,className:r,isLoading:n}){const s=t||"a";return n?o.jsx("div",{className:Y("grid gap-y-4",r),children:Array.from({length:5}).map((a,i)=>o.jsx("div",{className:"h-16 bg-surface3 animate-pulse rounded-lg"},i))}):o.jsx("div",{className:Y("grid gap-y-4",r),children:e.map(a=>{const i=a?.agents||a?.tools||a?.networks||a?.workflows||a?.mcp;return o.jsxs("article",{className:Y("border border-border1 rounded-lg overflow-hidden w-full grid grid-cols-[1fr_auto] bg-surface3 transition-colors hover:bg-surface4"),children:[o.jsxs(s,{to:`/templates/${a.slug}`,className:Y("grid [&:hover_p]:text-neutral5",{"grid-cols-[8rem_1fr] lg:grid-cols-[12rem_1fr]":a.imageURL}),children:[a.imageURL&&o.jsx("div",{className:Y("overflow-hidden"),children:o.jsx("div",{className:"w-full h-full bg-cover thumb transition-scale duration-150",style:{backgroundImage:`url(${a.imageURL})`}})}),o.jsxs("div",{className:Y("grid py-3 px-6 w-full gap-0.5","[&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:text-neutral3"),children:[o.jsx("h2",{className:"text-ui-lg text-neutral5",children:a.title}),o.jsx("p",{className:"text-ui-md text-neutral4 transition-colors duration-500",children:a.description}),o.jsxs("div",{className:"hidden 2xl:flex text-neutral3 text-ui-md flex-wrap items-center gap-4 mt-3",children:[i&&o.jsxs("ul",{className:Y("flex gap-4 text-ui-md text-neutral3 m-0 p-0 list-none","[&>li]:flex [&>li]:items-center [&>li]:gap-0.5 text-neutral4"),children:[a?.agents&&a.agents.length>0&&o.jsxs("li",{children:[o.jsx(ga,{})," ",a.agents.length]}),a?.tools&&a.tools.length>0&&o.jsxs("li",{children:[o.jsx(Mi,{})," ",a.tools.length]}),a?.networks&&a.networks.length>0&&o.jsxs("li",{children:[o.jsx(kVe,{})," ",a.networks.length]}),a?.workflows&&a.workflows.length>0&&o.jsxs("li",{children:[o.jsx(hF,{})," ",a.workflows.length]}),a?.mcp&&a.mcp.length>0&&o.jsxs("li",{children:[o.jsx(gl,{})," ",a.mcp.length]})]}),i&&a.supportedProviders&&o.jsx("small",{children:"|"}),o.jsx("div",{className:"flex items-center text-neutral3 gap-4",children:a.supportedProviders.map(l=>o.jsx("span",{className:"",children:l},l))})]})]})]}),o.jsx("a",{href:a.githubUrl,className:Y("group items-center gap-2 text-ui-md ml-auto pr-4 hidden","lg:flex"),target:"_blank",rel:"noopener noreferrer",children:o.jsxs("span",{className:"flex items-center gap-2 px-2 py-1 rounded bg-surface1 group-hover:bg-surface2 text-neutral3 transition-colors group-hover:text-neutral5",children:[o.jsx(ydt,{})," ",rIn(a.githubUrl)]})})]},a.slug)})})}function sIn({tagOptions:e,selectedTag:t,providerOptions:r,selectedProvider:n,onTagChange:s,onProviderChange:a,searchTerm:i,onSearchChange:l,onReset:c,className:u,isLoading:d}){return d?o.jsxs("div",{className:Y("h-[6.5rem] flex items-center gap-8","[&>div]:bg-surface3 [&>div]:w-48 [&>div]:h-8 [&>div]:animate-pulse",u),children:[o.jsx("div",{})," ",o.jsx("div",{})," ",o.jsx("div",{})]}):o.jsxs("div",{className:Y("flex flex-wrap mx-auto sticky top-0 gap-4 bg-surface2 py-8",u),children:[o.jsx(Ox,{name:"search-templates",label:"Search templates",labelIsHidden:!0,value:i,onChange:f=>l?.(f.target.value),placeholder:"Search Template"}),o.jsx($o,{label:"Filter by tag",labelIsHidden:!0,name:"filter-tag",value:t,onValueChange:s,options:e}),o.jsx($o,{label:"Filter by provider",labelIsHidden:!0,name:"filter-provider",value:n,onValueChange:a,options:r}),c&&o.jsxs(ce,{onClick:c,children:["Reset ",o.jsx(Nn,{})]})]})}function aIn(){const{data:e,isLoading:t}=zzr(),{templates:r,tags:n,providers:s}=e??{templates:[],tags:[],providers:[]},[a,i]=b.useState("all"),[l,c]=b.useState("all"),[u,d]=b.useState(""),f=[{value:"all",label:"Any tag"}];(n||[]).forEach(w=>{f.push({value:w,label:w})});const h=[{value:"all",label:"Any provider"}];(s||[]).forEach(w=>{h.push({value:w,label:w})});const p=(w,S)=>{S==="tag"?i(w):S==="provider"&&c(w)},m=w=>{d(w)},g=()=>{i("all"),c("all"),d("")},y=r.filter(w=>!(u&&!w.title.toLowerCase().includes(u)&&!w.description.toLowerCase().includes(u)||a!=="all"&&!w.tags.includes(a)||l!=="all"&&!w.supportedProviders.includes(l))),x=u||a!=="all"||l!=="all";return o.jsxs(zr,{children:[o.jsx(Cn,{children:o.jsxs(Qu,{children:[o.jsx(Ce,{children:o.jsx(Fb,{})}),"Templates"]})}),o.jsxs("div",{className:Y("overflow-y-auto w-full h-full px-8 pb-12 z-10"),children:[o.jsx(sIn,{selectedTag:a,onTagChange:w=>p(w,"tag"),tagOptions:f,selectedProvider:l,onProviderChange:w=>p(w,"provider"),providerOptions:h,searchTerm:u,onSearchChange:m,onReset:x?g:void 0,className:"max-w-[80rem]",isLoading:t}),o.jsx(nIn,{templates:y,linkComponent:fr,className:"max-w-[80rem] mx-auto",isLoading:t})]})]})}const iIn="1.31.0-alpha.2";function oIn({errorMsg:e,validationErrors:t}){const r=typeof e=="string"?e:e!=null?String(e):void 0,n=r?.includes("Invalid schema for function"),s=r?.includes("validation issue")||t&&t.length>0,a=()=>s?"Template installation completed but some validation issues remain. The template may still be functional, but you should review and fix these issues.":n?"There was an issue with the AI model configuration. This may be related to the selected model or AI SDK version compatibility.":"An unexpected error occurred during template installation.",i=()=>s?{icon:o.jsx(AE,{className:"text-yellow-500"}),title:"Template Installed with Warnings"}:{icon:o.jsx(L2t,{}),title:"Template Installation Failed"},{icon:l,title:c}=i();return o.jsxs(s8,{className:"space-y-4 text-neutral3 mb-8 content-center",children:[o.jsxs("div",{className:Y("grid items-center justify-items-center gap-4 content-center","[&>svg]:w-8 [&>svg]:h-8"),children:[l,o.jsxs("div",{className:"text-center space-y-2",children:[o.jsx("p",{className:"text-ui-md font-medium text-neutral5",children:c}),o.jsx("p",{className:"text-ui-md text-neutral3",children:a()})]})]}),t&&t.length>0&&o.jsxs("details",{className:"text-xs",children:[o.jsxs("summary",{className:"cursor-pointer text-neutral3 hover:text-neutral4 select-none text-center",children:["Show Validation Issues (",t.length,")"]}),o.jsx("div",{className:"mt-4 p-3 bg-gray-100 dark:bg-gray-800 rounded text-xs overflow-auto max-h-60 text-left space-y-2",children:t.map((u,d)=>o.jsxs("div",{className:"border-l-2 border-red-400 pl-2",children:[o.jsx("div",{className:"font-medium text-red-600 dark:text-red-400",children:u.type==="typescript"?"🔴 TypeScript Error":"⚠️ Lint Error"}),o.jsx("div",{className:"text-xs font-mono text-gray-700 dark:text-gray-300 mt-1 whitespace-pre-wrap wrap-break-word",children:u.message})]},d))})]}),r&&!s&&o.jsxs("details",{className:"text-xs",children:[o.jsx("summary",{className:"cursor-pointer text-neutral3 hover:text-neutral4 select-none text-center",children:"Show Details"}),o.jsx("div",{className:"mt-4 p-3 bg-gray-100 dark:bg-gray-800 rounded text-xs font-mono overflow-auto max-h-60 text-left",children:o.jsx("div",{className:"whitespace-pre-wrap wrap-break-word",children:r})})]})]})}function lIn({providerOptions:e,selectedProvider:t,onProviderChange:r,variables:n,errors:s,handleInstallTemplate:a,handleVariableChange:i,isLoadingEnvVars:l,isInstalling:c,defaultModelProvider:u,defaultModelId:d,onModelUpdate:f}){return o.jsx(s8,{children:o.jsxs("div",{className:"max-w-[40rem] my-4 p-4 lg:p-8 mx-auto gap-8 grid",children:[o.jsxs("h2",{className:Y("text-neutral4 text-header-sm font-semibold flex items-center gap-2","[&>svg]:w-[1.2em] [&_svg]:h-[1.2em] [&_svg]:opacity-70"),children:["Install Template ",o.jsx(_Ve,{})]}),o.jsx($o,{name:"template-provider",options:e,label:"Template AI Model Provider",onValueChange:r,value:t,placeholder:"Select",layout:"horizontal"}),t&&Object.entries(n||{}).length>0&&o.jsxs(o.Fragment,{children:[o.jsx("h3",{className:"text-neutral3 text-ui-md",children:"Set required Environmental Variables"}),o.jsx("div",{className:"grid grid-cols-[1fr_1fr] gap-4 items-start",children:l?o.jsxs("div",{className:Y("flex items-center justify-center col-span-2 text-neutral3 text-ui-sm gap-4","[&_svg]:opacity-50 [&_svg]:w-[1.1em] [&_svg]:h-[1.1em]","animate-in fade-in duration-300"),children:[o.jsx(Dt,{})," Loading variables..."]}):Object.entries(n).map(([h,p])=>o.jsxs(b.Fragment,{children:[o.jsx(Sx,{name:`env-${h}`,labelIsHidden:!0,label:"Key",value:h,disabled:!0,className:"w-full"}),o.jsx(Sx,{name:h,labelIsHidden:!0,label:"Value",value:p,onChange:i,errorMsg:s.includes(h)?"Value is required.":"",autoComplete:"off",className:"w-full"})]},h))}),o.jsxs("div",{className:"border-t border-border1 pt-12 mt-3.5 relative",children:[o.jsx("div",{className:"absolute w-8 h-8 rounded-full bg-surface2 top-0 left-1/2 -translate-x-1/2 -translate-y-4 text-ui-sm text-neutral3 flex items-center justify-center",children:"And"}),o.jsx("h3",{className:"text-neutral4 text-ui-lg",children:"Set AI Model for Template Installation"}),o.jsx("p",{className:"text-neutral3 text-ui-md mt-2 mb-8",children:"This model will be used by the workflow to process and install the template"}),o.jsx(OSt,{defaultProvider:u||"",defaultModel:d||"",updateModel:f||(()=>Promise.resolve({message:"Updated"})),closeEditor:()=>{},autoSave:!0,selectProviderPlaceholder:"Provider"})]})]}),t&&!l&&o.jsx(ce,{className:Y("flex items-center gap-2 mt-4 justify-center text-ui-md w-full bg-surface5 min-h-10 rounded-lg text-neutral5 hover:bg-surface6 transition-colors","[&>svg]:w-[1.1em] [&_svg]:h-[1.1em] [&_svg]:text-neutral5"),onClick:a,disabled:!t||!u||!d||s.length>0||c,children:c?o.jsxs(o.Fragment,{children:[o.jsx(Dt,{className:"w-4 h-4"})," Installing..."]}):o.jsxs(o.Fragment,{children:["Install ",o.jsx(Dw,{})]})})]})})}function cIn({title:e,description:t,githubUrl:r,isLoading:n,infoData:s,templateSlug:a}){const i=a?`feat/install-template-${a}`:"feat/install-template-[slug]";return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:Y("grid mt-8 items-center"),children:o.jsxs("div",{className:Y("text-header-lg flex items-center gap-3","[&>svg]:w-[1.2em] [&>svg]:h-[1.2em] [&>svg]:opacity-50",{"[&>svg]:opacity-20":n}),children:[o.jsx(Fb,{}),o.jsx("h2",{className:Y({"bg-surface4 flex rounded-lg min-w-[50%]":n}),children:n?o.jsx(o.Fragment,{children:" "}):e})]})}),o.jsxs("div",{className:"grid lg:grid-cols-[1fr_1fr] gap-x-24",children:[o.jsxs("div",{className:"grid",children:[o.jsx("p",{className:Y("mb-4 text-ui-md text-neutral4 mt-2 leading-7",{"bg-surface4 rounded-lg ":n}),children:n?o.jsx(o.Fragment,{children:" "}):t}),!n&&a&&o.jsxs("div",{className:Y("bg-surface2 border border-surface4 rounded-lg p-4 mb-4","flex items-start gap-3"),children:[o.jsx("div",{className:"shrink-0 mt-0.5",children:o.jsx(zy,{className:"w-[1.1em] h-[1.1em] text-blue-500"})}),o.jsxs("div",{className:"flex-1 space-y-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(cF,{className:"w-[1em] h-[1em] text-neutral4"}),o.jsx("span",{className:"text-ui-md font-medium text-neutral5",children:"A new Git branch will be created"})]}),o.jsxs("div",{className:"text-ui-sm text-neutral4 space-y-1",children:[o.jsxs("div",{children:[o.jsx("span",{className:"font-medium",children:"Branch name:"})," ",o.jsx("code",{className:"bg-surface3 px-1.5 py-0.5 rounded text-ui-sm font-mono",children:i})]}),o.jsx("div",{children:"This ensures safe installation with easy rollback if needed. Your main branch remains unchanged."})]})]})]}),r&&o.jsxs("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 mt-auto text-neutral3 text-ui-md hover:text-neutral5",children:[o.jsx(ydt,{}),r?.split("/")?.pop()]})]}),s&&o.jsx(S1,{data:s,labelsAreHidden:!0,isLoading:n})]})]})}function uIn({name:e,streamResult:t,workflowInfo:r}){const n=t?.phase||"initializing",s=t?.payload?.workflowState,a=t?.payload?.currentStep,i=t?.error,l=s?.steps||{},c=Object.keys(l).length>0,u=m=>m==="input"||m.endsWith(".input")||m.startsWith("Mapping_")&&/[0-9a-f]{8}/.test(m)||/[0-9a-f]{8,}/.test(m)?!1:r?.allSteps?m in r.allSteps:!0,d=Object.entries(l).filter(([m,g])=>u(m)),f=d.length,h=()=>{switch(n){case"initializing":return"Preparing template installation...";case"processing":return`Installing ${e} template`;case"completed":return"Template installation completed!";case"error":return"Template installation failed";default:return"Installing template..."}},p=d.map(([m,g])=>({id:m,status:g?.status,description:g?.description,title:m.charAt(0).toUpperCase()+m.slice(1).replace(/-/g," "),isActive:a?.id===m}));return o.jsxs(s8,{className:"space-y-6 text-neutral3 mb-8 content-center",children:[o.jsxs("div",{className:"text-center",children:[o.jsx("h3",{className:"text-lg font-semibold text-neutral5",children:h()}),t?.runId&&o.jsxs("div",{className:"mt-2 text-ui-sm text-neutral3",children:["Run ID: ",t.runId]})]}),c&&f>0&&!["error"].includes(n)&&o.jsx("div",{className:"max-w-[30rem] w-full mx-auto px-6",children:o.jsx(q3r,{steps:p})}),i&&n==="error"&&o.jsxs("div",{className:Y("rounded-lg text-neutral5 p-6 flex items-center gap-3 text-ui-md bg-red-500/10","[&>svg]:w-6 [&>svg]:h-6 [&>svg]:opacity-70 [&>svg]:text-red-500"),children:[o.jsx(TDt,{}),i||"Something went wrong"]}),c&&o.jsx(V3r,{steps:p,currentStep:a,className:"pb-4"}),!c&&n==="initializing"&&o.jsxs("div",{className:"text-center text-sm text-neutral3 grid gap-4 justify-items-center",children:[o.jsx(Dt,{}),o.jsx("p",{children:"This may take some time..."})]})]})}function dIn({name:e,installedEntities:t}){return o.jsxs(s8,{className:Y("grid items-center justify-items-center gap-4 content-center","[&>svg]:w-8 [&>svg]:h-8"),children:[o.jsx(_Ve,{}),o.jsx("h2",{className:"text-header-md",children:"Done!"}),o.jsxs("p",{className:"text-ui-md text-center text-neutral3 ",children:["The ",o.jsx("b",{className:"text-neutral4",children:e})," template has been successfully installed.",t&&t.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("br",{})," Installed entities are listed below."]})]}),t&&t.length>0&&o.jsx(S1,{data:t})]})}function fIn(){const{templateSlug:e}=na(),[t,r]=ao(),[n,s]=b.useState(""),[a,i]=b.useState(""),[l,c]=b.useState(""),[u,d]=b.useState({}),[f,h]=b.useState([]),[p,m]=b.useState(null),[g,y]=b.useState(!1),[x,w]=b.useState(""),[S,k]=b.useState(!1),[_,E]=b.useState(!1),[T,j]=b.useState([]),{data:N,isLoading:I}=Bzr({repoOrSlug:e,owner:"mastra-ai"}),R=iIn?.includes("beta")??!1?"beta":"main",{data:B,isLoading:D}=Uzr({repo:N?.githubUrl?new URL(N.githubUrl).pathname.split("/")[2]:`template-${e}`,owner:"mastra-ai",branch:R}),{data:$,isLoading:U}=Vzr(),{mutateAsync:z,isPending:H}=qzr(),{mutateAsync:Q}=Hzr(),{streamInstall:L,streamResult:Z,isStreaming:V}=Wzr($),{observeInstall:M,streamResult:W,isStreaming:G}=Gzr($);b.useEffect(()=>{const se=t.get("runId");se&&!g&&!p&&!V&&!G&&(console.info("🔄 Checking completed run after hot reload:",{runId:se}),w(se),Q({runId:se}).then(le=>{const xe=le.snapshot;if(xe?.status==="success"&&xe?.result?.success)y(!0);else if(xe?.result?.success===!1)if(xe?.result?.validationResults&&!xe?.result?.validationResults?.valid&&xe?.result?.validationResults?.remainingErrors>0){const{remainingErrors:ue,errors:ve}=xe.result.validationResults,we=`Template installation completed but ${ue} validation issue${ue>1?"s":""} remain unresolved.`;m(we),j(ve||[])}else{const ue=xe?.result?.message||xe?.result?.error||"Template installation failed";m(typeof ue=="string"?ue:String(ue))}}).catch(le=>{console.error("❌ Failed to fetch run details:",le),m("Failed to retrieve installation status after reload")}))},[t,g,p,V,G,Q]),b.useEffect(()=>{const se=t.get("runId"),le=t.get("resume"),xe=t.get("provider");if(se&&le==="true"&&xe&&!V&&!G&&!S&&!_&&$){w(se),k(!0);try{Q({runId:se}).then(de=>{if(de.snapshot?.status==="running")return M.mutateAsync({runId:se})}).then(()=>{r(de=>{const ue=new URLSearchParams(de);return ue.delete("resume"),ue})}).catch(de=>{console.error("❌ Failed to resume template installation:",de),de.message?.includes("404")||de.message?.includes("not found")?m("Template installation run not found. It may have expired or been completed."):m("Failed to resume template installation. Please try again.")})}catch(de){console.error("❌ Auto-resume failed with error:",de),m("Failed to resume template installation. Please refresh and try again.")}}},[t,e,V,G,S,_,$,Q,M,r]);const J=[{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"groq",label:"Groq"},{value:"google",label:"Google"}],ae=[{key:"tools",label:"Tools",value:N?.tools?.length?N.tools.map(se=>se).join(", "):"n/a",icon:o.jsx(Mi,{})},{key:"agents",label:"Agents",value:N?.agents?.length?N.agents.map(se=>se).join(", "):"n/a",icon:o.jsx(ga,{})},{key:"workflows",label:"Workflows",value:N?.workflows?.length?N.workflows.map(se=>se).join(", "):"n/a",icon:o.jsx(hF,{})},{key:"providers",label:"Providers",value:N?.supportedProviders?.length?N.supportedProviders.join(", "):"n/a",icon:o.jsx(Em,{})},{key:"tags",label:"Tags",value:N?.tags?.length?N.tags.join(", "):"n/a",icon:o.jsx(NE,{})}],te=[{...ae[0]},{...ae[1]},{...ae[2]}].filter(se=>se.value!=="n/a");b.useEffect(()=>{B&&d(B)},[B]),b.useEffect(()=>{const se=Z||W;se?.phase==="error"&&se?.error&&m(typeof se.error=="string"?se.error:String(se.error))},[Z?.phase,Z?.error,W?.phase,W?.error]);const re=se=>{s(se)},ie=async se=>(i(se.provider),c(se.modelId),{message:"Model updated successfully"}),he=async()=>{const se=Object.entries(u).reduce((le,[xe,de])=>(de===""&&le.push(xe),le),[]);if(se.length>0){h(se);return}if(N){m(null),y(!1),w(""),E(!0);try{const xe={repo:N.githubUrl||`https://github.com/mastra-ai/template-${N.slug}`,ref:R,slug:N.slug,variables:u},{runId:de}=await z({});w(de),r(ue=>{const ve=new URLSearchParams(ue);return ve.set("runId",de),ve.set("resume","true"),ve.set("provider",n||"openai"),ve}),await L.mutateAsync({inputData:xe,selectedModel:{provider:a,modelId:l},runId:de})}catch(le){E(!1),m(le?.message||"Template installation failed"),console.error("Template installation failed",le)}}},X=se=>{const{name:le,value:xe}=se.target;xe.trim()===""?h(de=>[...de,le]):h(de=>de.filter(ue=>ue!==le)),d(de=>({...de,[le]:xe}))};return o.jsxs(zr,{children:[o.jsx(Cn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/templates",children:[o.jsx(Ce,{children:o.jsx(Fb,{})}),"Templates"]}),o.jsx(jr,{as:fr,to:`/templates/${N?.slug}`,isCurrent:!0,children:N?.title&&N.title})]})}),o.jsx("div",{className:Y("w-full lg:px-12 h-full overflow-y-scroll"),children:o.jsxs("div",{className:"p-6 w-full max-w-[80rem] mx-auto grid gap-y-4",children:[o.jsx(cIn,{isLoading:I,title:N?.title,description:N?.longDescription,imageURL:N?.imageURL,githubUrl:N?.githubUrl,infoData:ae,templateSlug:e}),N&&o.jsxs(o.Fragment,{children:[(V||G)&&o.jsx(uIn,{name:N.title,streamResult:G?W:Z,runId:x,workflowInfo:$}),g&&o.jsx(dIn,{name:N.title,installedEntities:te,linkComponent:fr}),p&&o.jsx(oIn,{errorMsg:p,validationErrors:T.length>0?T:Z?.validationResults?.errors||W?.validationResults?.errors}),!V&&!G&&!g&&!p&&o.jsx(lIn,{providerOptions:J,selectedProvider:n,onProviderChange:re,variables:u,setVariables:d,errors:f,setErrors:h,handleInstallTemplate:he,handleVariableChange:X,isLoadingEnvVars:D||U,isInstalling:H,defaultModelProvider:a,defaultModelId:l,onModelUpdate:ie})]})]})})]})}const hIn=()=>{const{toolId:e,agentId:t}=na();return o.jsxs(zr,{children:[o.jsxs(Cn,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/agents",children:[o.jsx(Ce,{children:o.jsx(ga,{})}),"Agents"]}),o.jsx(jr,{as:fr,to:`/agents/${t}/chat`,children:t}),o.jsx(jr,{as:fr,to:`/tools/${t}/${e}`,isCurrent:!0,children:e})]}),o.jsx(fu,{children:o.jsxs(ce,{as:fr,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",children:[o.jsx(Ce,{children:o.jsx(o0,{})}),"Tools documentation"]})})]}),o.jsx(MOn,{toolId:e,agentId:t})]})},pIn=()=>{const{toolId:e}=na();return o.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[o.jsxs(Cn,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/tools",children:[o.jsx(Ce,{children:o.jsx(Mi,{})}),"Tools"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(kAn,{value:e,variant:"ghost"})})]}),o.jsx(fu,{children:o.jsxs(ce,{as:fr,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(o0,{}),"Tools documentation"]})})]}),o.jsx(OAn,{toolId:e})]})};function mIn(e){return e.feedbackType==="thumbs"?e.value===1?"👍 Positive (1)":e.value===0||e.value===-1?"👎 Negative":String(e.value):e.feedbackType==="rating"?String(e.value):e.feedbackType==="comment"?String(e.value??e.comment??"-"):String(e.value??"-")}function gIn({feedback:e,isOpen:t,onClose:r,onNext:n,onPrevious:s}){const a=e?.metadata&&Object.keys(e.metadata).length>0?JSON.stringify(e.metadata,null,2):void 0;return o.jsxs(Vt,{dialogTitle:"Feedback Detail",dialogDescription:"View feedback details",isOpen:t,onClose:r,level:3,children:[o.jsxs(Vt.Top,{children:[o.jsxs(Zn,{children:[o.jsx(tA,{})," Feedback"]}),"|",o.jsx(Vt.Nav,{onNext:n,onPrevious:s})]}),o.jsxs(Vt.Content,{children:[o.jsxs(Vt.Header,{children:[o.jsxs(Vt.Heading,{children:[o.jsx(tA,{})," Feedback"]}),e?.traceId&&o.jsxs(Zn,{children:[o.jsx(m_,{})," ",e.traceId]})]}),o.jsxs(kx,{children:[o.jsx(S1,{data:[{label:"Created at",value:e?.timestamp?tr(new Date(e.timestamp),"MMM d, h:mm:ss aaa"):"n/a",key:"timestamp"},{label:"Type",value:e?.feedbackType??"n/a",key:"type"},{label:"Value",value:e?mIn(e):"n/a",key:"value"},...e?.comment?[{label:"Comment",value:e.comment,key:"comment"}]:[],{label:"Source",value:e?.feedbackSource??e?.source??"n/a",key:"source"},...e?.feedbackUserId?[{label:"User",value:e.feedbackUserId,key:"userId"}]:[],...e?.traceId?[{label:"Trace ID",value:e.traceId,key:"traceId"}]:[],...e?.spanId?[{label:"Span ID",value:e.spanId,key:"spanId"}]:[]]}),a&&o.jsx(Vt.CodeSection,{title:"Metadata",icon:o.jsx(m_,{}),codeStr:a,simplified:!0})]})]})]})}const UL=[{name:"source",label:"Source",size:"1fr"},{name:"date",label:"Date",size:"0.8fr"},{name:"time",label:"Time",size:"0.8fr"},{name:"value",label:"Value",size:"0.6fr"},{name:"comment",label:"Comment",size:"2fr"}];function yIn(e){return e.feedbackType==="thumbs"?e.value===1?"👍":e.value===0||e.value===-1?"👎":String(e.value):typeof e.value=="number"?String(e.value):"—"}function vIn(e){const t=e.comment||(typeof e.value=="string"?e.value:"");return t?t.length>60?t.slice(0,60)+"…":t:"—"}function X1t({feedbackData:e,isLoadingFeedbackData:t,onPageChange:r}){const[n,s]=b.useState(!1),[a,i]=b.useState(),l=e?.feedback??[],c=h=>{i(l[h]),s(!0)};if(t)return o.jsx(xft,{columns:UL});const u=a?l.indexOf(a):-1,d=u>=0&&u<l.length-1?()=>i(l[u+1]):void 0,f=u>0?()=>i(l[u-1]):void 0;return o.jsxs(o.Fragment,{children:[o.jsxs(ha,{children:[o.jsxs(ha.Trim,{children:[o.jsx(ha.Header,{columns:UL}),l.length>0?o.jsx(ha.Entries,{children:l.map((h,p)=>{const m=new Date(h.timestamp),g=xg(m),y={id:`${h.traceId}-${p}`,source:h.feedbackUserId||h.feedbackSource||"unknown",date:g?"Today":tr(m,"MMM dd"),time:tr(m,"h:mm:ss aaa"),value:yIn(h),comment:vIn(h)};return o.jsx(ha.Entry,{columns:UL,onClick:()=>c(p),entry:y,children:UL.map(x=>o.jsx(ha.EntryText,{children:String(y[x.name]??"")},`col-${x.name}`))},y.id)})}):o.jsx(ha.Message,{message:"No feedback found",type:"info"})]}),o.jsx(ha.Pagination,{currentPage:e?.pagination?.page||0,hasMore:e?.pagination?.hasMore,onNextPage:()=>r?.((e?.pagination?.page||0)+1),onPrevPage:()=>{const h=e?.pagination?.page||0;h>0&&r?.(h-1)}})]}),o.jsx(gIn,{feedback:a,isOpen:n,onClose:()=>s(!1),onNext:d,onPrevious:f})]})}const Q8e="auto auto auto auto 1fr";function K1t({scoresData:e,isLoadingScoresData:t,onPageChange:r,onScoreSelect:n}){return t?o.jsx(Y9,{columns:Q8e}):o.jsxs("div",{className:"grid gap-2",children:[o.jsxs(Ac,{columns:Q8e,className:"min-w-0",children:[o.jsxs(Ac.Top,{children:[o.jsx(Ac.TopCell,{children:"ID"}),o.jsx(Ac.TopCell,{children:"Date"}),o.jsx(Ac.TopCell,{children:"Time"}),o.jsx(Ac.TopCell,{children:"Score"}),o.jsx(Ac.TopCell,{children:"Scorer"})]}),e?.scores&&e.scores.length>0?e.scores.map(s=>{const a=new Date(s.createdAt),i=xg(a);return o.jsxs(Ac.RowButton,{onClick:()=>n?.(s),children:[o.jsx(Ac.Cell,{height:"compact",className:"font-mono text-neutral3 text-ui-smd",children:ef(s?.id)||"n/a"}),o.jsx(Ac.Cell,{height:"compact",className:"text-neutral2 text-ui-smd",children:i?"Today":tr(a,"MMM dd")}),o.jsx(Ac.Cell,{height:"compact",className:"font-mono text-neutral3 text-ui-smd",children:tr(a,"h:mm:ss aaa")}),o.jsx(Ac.Cell,{height:"compact",className:"text-ui-smd",children:String(s?.score??"")}),o.jsx(Ac.Cell,{height:"compact",className:"text-ui-smd",children:String(s?.scorer?.name||s?.scorer?.id||"")})]},s.id)}):o.jsx(Ac.NoMatch,{message:"No scores found"})]}),o.jsx(Ac.Pagination,{currentPage:e?.pagination?.page||0,hasMore:e?.pagination?.hasMore,onNextPage:()=>r?.((e?.pagination?.page||0)+1),onPrevPage:()=>r?.((e?.pagination?.page||0)-1)})]})}const J1t=({traceId:e="",page:t})=>{const r=Ge(),n=t??0;return kt({queryKey:["trace-feedback",e,n],queryFn:()=>r.listFeedback({filters:{traceId:e},pagination:{page:n,perPage:10}}),enabled:!!e,refetchInterval:3e3,gcTime:0,staleTime:0})};function bIn(){const[e,t]=ao(),[r,n]=b.useState(!1),s=KFr(e,t,{onRemoveAll:()=>n(!1)}),[a,i]=b.useState(),[l,c]=b.useState(0),[u,d]=b.useState(!1),[f,h]=b.useState(null);b.useEffect(()=>c(0),[s.traceIdParam,s.spanIdParam]);const{data:p,isLoading:m}=cd(),{data:g,isLoading:y}=vve({traceId:s.traceIdParam,spanId:s.spanIdParam,page:l}),[x,w]=b.useState(0);b.useEffect(()=>w(0),[s.traceIdParam,s.spanIdParam]);const{data:S,isLoading:k}=J1t({traceId:s.traceIdParam,page:x}),{data:_,isLoading:E}=Mme(s.traceIdParam??null),T=b.useMemo(()=>_?.spans,[_?.spans]),{data:j,isLoading:N}=MS(s.traceIdParam??"",s.spanIdParam??""),I=s.scoreIdParam?g?.scores?.find(ue=>ue.id===s.scoreIdParam):void 0,{data:P=[],isPending:R}=Tht(),{data:B=[],isPending:D}=Nht({entityType:s.selectedEntityOption?.entityType,rootOnly:!0}),{data:$=[],isPending:U}=Aht(),{data:z=[],isPending:H}=Iht(),Q=b.useMemo(()=>qFr({availableTags:P,availableRootEntityNames:B,availableServiceNames:z,availableEnvironments:$,loading:{tags:R,entityNames:D,serviceNames:H,environments:U}}),[P,B,z,$,R,D,H,U]),L=b.useMemo(()=>GFr({rootEntityType:s.selectedEntityOption?.entityType,status:s.selectedStatus,dateFrom:s.selectedDateFrom,dateTo:s.selectedDateTo,tokens:s.filterTokens}),[s.filterTokens,s.selectedDateFrom,s.selectedDateTo,s.selectedEntityOption,s.selectedStatus]),{data:Z,isLoading:V,isFetchingNextPage:M,hasNextPage:W,setEndOfListElement:G,error:J}=LFr({filters:L}),ae=b.useMemo(()=>Z?.spans??[],[Z?.spans]),te=Z?.threadTitles??{},{handlePreviousSpan:re,handleNextSpan:ie}=Rht(T,s.spanIdParam??null,ue=>s.handleSpanChange(ue)),he=tzr(e,t),X=b.useCallback(()=>s.applyFilterTokens(ZFr(Q,s.filterTokens)),[Q,s]),{handlePreviousTrace:se,handleNextTrace:le}=YFr(ae,s.traceIdParam,s.handleTraceClick),xe=b.useCallback(()=>{const ue=T?.find(ve=>ve.parentSpanId==null);ue&&(s.handleSpanChange(ue.spanId),s.handleSpanTabChange("scoring"))},[T,s]);if(J)return o.jsx(Jr,{title:"Traces",icon:o.jsx(xo,{}),children:o.jsx(jht,{error:J,resource:"traces",errorTitle:"Failed to load traces"})});const de=!!s.selectedEntityOption||!!s.selectedStatus||s.filterTokens.length>0||s.datePreset!=="last-24h"||!!s.selectedDateTo;return o.jsxs(bt,{width:"wide",height:"full",children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:V,children:[o.jsx(xo,{})," Traces"]})})}),o.jsxs(bt.Column,{className:"flex justify-end items-center gap-2",children:[o.jsx(lht,{preset:s.datePreset,onPresetChange:s.handleDatePresetChange,dateFrom:s.selectedDateFrom,dateTo:s.selectedDateTo,onDateChange:s.handleDateChange,disabled:V,presets:["last-24h","last-3d","last-7d","last-14d","last-30d","custom"]}),o.jsx(dft,{fields:Q,tokens:s.filterTokens,onTokensChange:s.handleFilterTokensChange,disabled:V,onStartTextFilter:i}),o.jsx(Ln,{disabled:V,"aria-pressed":r,"aria-label":r?"Ungroup traces":"Group traces by thread",tooltipContent:r?"Ungroup traces":"Group traces by thread",onClick:()=>n(ue=>!ue),children:r?o.jsx(m3,{}):o.jsx(xVe,{})}),o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/observability/tracing/overview",target:"_blank",rel:"noopener noreferrer","aria-label":"Traces documentation",tooltipContent:"Go to Traces documentation",children:o.jsx(Li,{})})]})]}),o.jsx(xFr,{isLoading:V,filterFields:Q,filterTokens:s.filterTokens,onFilterTokensChange:s.handleFilterTokensChange,onClear:X,onRemoveAll:s.handleRemoveAll,onSave:he.handleSave,onRemoveSaved:he.hasSavedFilters?he.handleRemoveSaved:void 0,autoFocusFilterFieldId:a})]}),o.jsx(jFr,{traceCollapsed:u,listSlot:o.jsx(NFr,{traces:ae,isLoading:V,isFetchingNextPage:M,hasNextPage:W,setEndOfListElement:G,filtersApplied:de,featuredTraceId:s.traceIdParam,onTraceClick:ue=>s.handleTraceClick(s.traceIdParam===ue.traceId?"":ue.traceId),groupByThread:r,threadTitles:te}),tracePanelSlot:s.traceIdParam?o.jsx(Eht,{traceId:s.traceIdParam,spans:T,isLoading:E,onClose:s.handleTraceClose,onSpanSelect:ue=>s.handleSpanChange(ue??null),onEvaluateTrace:xe,onSaveAsDatasetItem:ue=>h(ue),initialSpanId:s.spanIdParam,onPrevious:se,onNext:le,collapsed:u,onCollapsedChange:d,placement:"traces-list",LinkComponent:EB,traceHref:`/traces/${s.traceIdParam}`}):null,spanPanelSlot:s.traceIdParam&&s.spanIdParam?o.jsx(Cht,{traceId:s.traceIdParam,spanId:s.spanIdParam,span:j?.span,isLoading:N,onClose:s.handleSpanClose,onPrevious:re,onNext:ie,activeTab:s.spanTabParam??"details",onTabChange:ue=>s.handleSpanTabChange(ue),feedbackTabBadge:S?.pagination?.total??void 0,feedbackTabSlot:()=>o.jsx(X1t,{feedbackData:S,onPageChange:w,isLoadingFeedbackData:k}),scoringTabBadge:g?.pagination?.total??void 0,scoringTabSlot:({span:ue,traceId:ve,spanId:we})=>o.jsxs("div",{className:"grid gap-6",children:[o.jsx(Cve,{traceId:ve,isTopLevelSpan:!ue.parentSpanId,spanId:we,entityType:ue.attributes?.agentId||ue.entityType===Do.AGENT?"Agent":ue.attributes?.workflowId||ue.entityType===Do.WORKFLOW_RUN?"Workflow":void 0,scorers:p,isLoadingScorers:m}),o.jsx(K1t,{scoresData:g,onPageChange:c,isLoadingScoresData:y,onScoreSelect:Ne=>s.handleScoreChange(Ne.id)})]})}):null,scorePanelSlot:I?o.jsx(gve,{score:I,onClose:()=>s.handleScoreChange(null)}):null}),f&&o.jsx(jve,{rootSpanId:f.rootSpanId,traceId:f.traceId,isOpen:!0,onClose:()=>h(null)})]})}function xIn(){const{traceId:e}=na(),[t,r]=ao(),n=uu(),s=t.get("spanId")||void 0,a=t.get("tab"),i=a==="scoring"?"scoring":a==="feedback"?"feedback":"details",l=t.get("scoreId")||void 0,[c,u]=b.useState(s??null),[d,f]=b.useState(),[h,p]=b.useState(i),[m,g]=b.useState(0),[y,x]=b.useState(!1),{data:w,isLoading:S,error:k}=Mme(e),_=b.useMemo(()=>w?.spans??[],[w?.spans]),E=b.useMemo(()=>_.find(re=>re.parentSpanId==null),[_]),{data:T,isLoading:j}=MS(e,c??"");b.useEffect(()=>g(0),[e,c]);const{data:N,isLoading:I}=cd(),{data:P,isLoading:R}=vve({traceId:e,spanId:c??void 0,page:m}),[B,D]=b.useState(0);b.useEffect(()=>D(0),[e,c]);const{data:$,isLoading:U}=J1t({traceId:e,page:B});b.useEffect(()=>{if(l&&P?.scores&&!d){const re=P.scores.find(ie=>ie.id===l);re&&f(re)}},[l,P?.scores,d]);const z=b.useCallback(re=>{const ie=new URLSearchParams(t);for(const[he,X]of Object.entries(re))X===null||X===""?ie.delete(he):ie.set(he,X);r(ie,{replace:!0})},[t,r]),H=b.useCallback(re=>{const ie=re??null,he=ie===c;u(ie),he||(f(void 0),p("details"),z({spanId:ie,tab:null,scoreId:null}))},[c,z]),Q=b.useCallback(()=>{u(null),f(void 0),p("details"),z({spanId:null,tab:null,scoreId:null})},[z]),L=b.useCallback(re=>{u(re),f(void 0),p("details"),z({spanId:re,tab:null,scoreId:null})},[z]),{handlePreviousSpan:Z,handleNextSpan:V}=Rht(_,c,L),M=b.useCallback(re=>{const ie=re;p(ie),f(void 0),z({tab:ie==="details"?null:ie,scoreId:null})},[z]),W=b.useCallback(re=>{f(re),z({scoreId:re.id})},[z]),G=b.useCallback(()=>{f(void 0),z({scoreId:null})},[z]),J=b.useCallback(()=>{n("/observability")},[n]),ae=b.useCallback(()=>{p("scoring"),E&&c!==E.spanId?(u(E.spanId),f(void 0),z({spanId:E.spanId,tab:"scoring",scoreId:null})):z({tab:"scoring"})},[E,c,z]),te=o.jsxs(o.Fragment,{children:[o.jsxs(ce,{as:EB,href:"/observability",variant:"link",size:"md",className:"text-neutral2",children:[o.jsx(wp,{}),"Back to Traces"]}),o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:S,children:[o.jsx(xo,{})," Trace ",o.jsx("span",{className:"text-neutral3",children:e})]})})}),o.jsx(bt.Column,{children:o.jsxs(ps,{children:[o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/observability/tracing/overview",target:"_blank",rel:"noopener noreferrer","aria-label":"Traces documentation",tooltipContent:"Go to Traces documentation",children:o.jsx(Li,{})}),E&&o.jsxs(o.Fragment,{children:[o.jsxs(Ln,{tooltipContent:"Evaluate Trace","aria-label":"Evaluate Trace",onClick:ae,children:[o.jsx(p3,{}),"Evaluate"]}),o.jsxs(Ln,{tooltipContent:"Save as Dataset Item","aria-label":"Save as Dataset Item",onClick:()=>x(!0),children:[o.jsx(yc,{}),"Save"]})]})]})})]}),E&&o.jsx(bt.Row,{children:o.jsx(bt.Column,{children:o.jsx(Oht,{rootSpan:E,numOfCol:3})})})]});return k?o.jsxs(bt,{height:"full",children:[o.jsx(bt.TopArea,{children:te}),o.jsx(bt.MainArea,{isCentered:!0,children:o.jsx(jht,{error:k,resource:"traces",errorTitle:"Failed to load trace"})})]}):o.jsxs(bt,{children:[o.jsx(bt.TopArea,{children:te}),o.jsx(jve,{rootSpanId:E?.spanId,traceId:e,isOpen:y,onClose:()=>x(!1)}),o.jsxs("div",{className:Y("grid h-full min-h-0 gap-4 overflow-hidden items-start mt-4",c?"grid-cols-[2fr_3fr]":"grid-cols-[1fr]"),children:[o.jsx(Eht,{traceId:e,spans:_,isLoading:S,onClose:J,onSpanSelect:H,onEvaluateTrace:ae,initialSpanId:c,placement:"trace-page",timelineChartWidth:c?"default":"wide"}),c&&!S&&o.jsxs("div",{className:Y("grid gap-4 max-h-full min-h-0 overflow-auto",d?"grid-rows-[1fr_1fr]":"grid-rows-[1fr]"),children:[o.jsx(Cht,{traceId:e,spanId:c,span:T?.span,isLoading:j,onClose:Q,onPrevious:Z,onNext:V,activeTab:h,onTabChange:M,feedbackTabBadge:$?.pagination?.total??void 0,feedbackTabSlot:()=>o.jsx(X1t,{feedbackData:$,onPageChange:D,isLoadingFeedbackData:U}),scoringTabBadge:P?.pagination?.total??void 0,scoringTabSlot:({span:re,traceId:ie,spanId:he})=>o.jsxs("div",{className:"grid gap-6",children:[o.jsx(Cve,{traceId:ie,isTopLevelSpan:!re.parentSpanId,spanId:he,entityType:re.attributes?.agentId||re.entityType===Do.AGENT?"Agent":re.attributes?.workflowId||re.entityType===Do.WORKFLOW_RUN?"Workflow":void 0,scorers:N,isLoadingScorers:I}),o.jsx(K1t,{scoresData:P,onPageChange:g,isLoadingScoresData:R,onScoreSelect:W})]})}),d&&o.jsx(gve,{score:d,onClose:G})]})]})]})}function wIn(){const{data:e,isLoading:t,error:r}=c0(),[n,s]=b.useState("");return r&&Ps(r)?o.jsx(Jr,{title:"Workflows",icon:o.jsx(Di,{}),children:o.jsx(sa,{})}):r&&Os(r)?o.jsx(Jr,{title:"Workflows",icon:o.jsx(Di,{}),children:o.jsx(Zs,{resource:"workflows"})}):r?o.jsx(Jr,{title:"Workflows",icon:o.jsx(Di,{}),children:o.jsx(pu,{title:"Failed to load workflows",message:r.message})}):Object.keys(e||{}).length===0&&!t?o.jsx(Jr,{title:"Workflows",icon:o.jsx(Di,{}),children:o.jsx(ipn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:t,children:[o.jsx(Di,{})," Workflows"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/workflows/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Workflows documentation",children:o.jsx(Li,{})})})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Sg,{onSearch:s,label:"Filter workflows",placeholder:"Filter by name or description"})})]}),o.jsx(apn,{workflows:e||{},isLoading:t,search:n})]})}const W8e=()=>{const{workflowId:e}=na(),{data:t,isLoading:r,error:n}=zP(e);return n&&Ps(n)?o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(sa,{})}):n&&Os(n)?o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"workflows"})}):o.jsx(Rwt,{workflowId:e,workflow:t??void 0,isLoading:r})};function SIn(e){if(!e)return null;switch(e.icon||e.provider){case"aws-s3":case"s3":return o.jsx(bdt,{className:"h-4 w-4 text-[#FF9900]"});case"google-cloud":case"google-cloud-storage":case"gcs":return o.jsx(vdt,{className:"h-4 w-4"});case"azure-blob":case"azure":return o.jsx(xdt,{className:"h-4 w-4 text-[#0078D4]"});case"cloudflare":case"cloudflare-r2":case"r2":return o.jsx(yU,{className:"h-4 w-4 text-[#F38020]"});case"minio":return o.jsx(Fre,{className:"h-4 w-4 text-red-400"});case"database":return o.jsx(Na,{className:"h-4 w-4 text-emerald-400"});case"local":case"folder":return o.jsx(nc,{className:"h-4 w-4 text-amber-400"});case"hard-drive":return o.jsx(Fre,{className:"h-4 w-4 text-slate-400"});case"cloud":return o.jsx(yU,{className:"h-4 w-4 text-sky-400"});default:return o.jsx(yU,{className:"h-4 w-4 text-neutral4"})}}function eOt(e,t=!1){const{name:r,type:n,mount:s}=e;if(n==="directory")return s?SIn(s):t?o.jsx(CE,{className:"h-4 w-4 text-amber-400"}):o.jsx(nc,{className:"h-4 w-4 text-amber-400"});switch(r.split(".").pop()?.toLowerCase()){case"ts":case"tsx":case"js":case"jsx":return o.jsx(lx,{className:"h-4 w-4 text-blue-400"});case"json":return o.jsx(_R,{className:"h-4 w-4 text-yellow-400"});case"md":case"mdx":return o.jsx(Yi,{className:"h-4 w-4 text-neutral4"});case"png":case"jpg":case"jpeg":case"gif":case"svg":case"webp":return o.jsx(ice,{className:"h-4 w-4 text-purple-400"});default:return o.jsx(sce,{className:"h-4 w-4 text-neutral4"})}}function tOt(e){if(e==null||Number.isNaN(e))return"";if(e<0)return"-"+tOt(-e);if(e===0)return"0 B";const t=1024,r=["B","KB","MB","GB","TB"],n=Math.min(Math.floor(Math.log(e)/Math.log(t)),r.length-1);return parseFloat((e/Math.pow(t,n)).toFixed(1))+" "+r[n]}function OIn(e){if("body"in e&&e.body&&typeof e.body=="object"){const n=e.body;if(typeof n.error=="string")return n.error;if(typeof n.message=="string")return n.message}const t=e.message,r=t.lastIndexOf(" - {");if(r!==-1)try{const n=t.slice(r+3),s=JSON.parse(n);if(s.error)return s.error;if(s.message)return s.message}catch{}return t.includes("status: 404")?"Directory not found":t}function rOt(e){return e==="."||e===""}function kIn({path:e,onNavigate:t}){const n=rOt(e)?[]:e.split("/").filter(Boolean);return o.jsxs("div",{className:"flex items-center gap-1 text-sm overflow-x-auto",children:[o.jsx("button",{onClick:()=>t("."),className:"p-1 rounded hover:bg-surface4 text-neutral5 hover:text-neutral6 transition-colors","aria-label":"Workspace root",children:o.jsx(CE,{className:"h-4 w-4"})}),n.map((s,a)=>{const i=n.slice(0,a+1).join("/");return o.jsxs("div",{className:"flex items-center",children:[o.jsx(Vs,{className:"h-4 w-4 text-neutral3"}),o.jsx("button",{onClick:()=>t(i),className:"px-2 py-1 rounded hover:bg-surface4 text-neutral5 hover:text-neutral6 transition-colors truncate max-w-[150px]",title:s,children:s})]},i)})]})}function _In({entries:e,currentPath:t,isLoading:r,error:n,onNavigate:s,onFileSelect:a,onRefresh:i,onUpload:l,onCreateDirectory:c,onDelete:u,isCreatingDirectory:d,isDeleting:f}){const[h,p]=b.useState(null),m=[...e].sort((w,S)=>w.type==="directory"&&S.type!=="directory"?-1:w.type!=="directory"&&S.type==="directory"?1:w.name.localeCompare(S.name)),g=rOt(t),y=w=>{const S=g?w.name:`${t}/${w.name}`;w.type==="directory"?s(S):a?.(S)},x=w=>{const S=g?w.name:`${t}/${w.name}`;p(S)};return o.jsxs("div",{className:"rounded-lg border border-border1 overflow-hidden",children:[o.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-surface3 border-b border-border1",children:[o.jsx(kIn,{path:t,onNavigate:s}),o.jsxs("div",{className:"flex items-center gap-1",children:[i&&o.jsx(ce,{variant:"ghost",size:"md",onClick:i,disabled:r,"aria-label":"Refresh files",children:o.jsx(ER,{className:`h-4 w-4 ${r?"animate-spin":""}`})}),c&&o.jsx(ce,{variant:"ghost",size:"md",disabled:d,"aria-label":"Create directory",onClick:()=>{const w=prompt("Directory name:");if(w){const S=g?w:`${t}/${w}`;c(S)}},children:d?o.jsx(Aa,{className:"h-4 w-4 animate-spin"}):o.jsx(lF,{className:"h-4 w-4"})}),l&&o.jsx(ce,{variant:"ghost",size:"md",onClick:l,"aria-label":"Upload files",children:o.jsx(fF,{className:"h-4 w-4"})})]})]}),o.jsx("div",{className:"max-h-[400px] overflow-auto",children:r?o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx(Aa,{className:"h-6 w-6 animate-spin text-neutral3"})}):n?o.jsxs("div",{className:"py-12 px-4 text-center",children:[o.jsx("div",{className:"inline-flex items-center justify-center w-12 h-12 rounded-full bg-red-500/10 mb-4",children:o.jsx(eA,{className:"h-6 w-6 text-red-400"})}),o.jsx("p",{className:"text-sm text-neutral6 font-medium mb-1",children:"Failed to load directory"}),o.jsx("p",{className:"text-xs text-neutral4 max-w-sm mx-auto",children:OIn(n)})]}):m.length===0?o.jsx("div",{className:"py-12 text-center text-neutral4 text-sm",children:g?"Workspace is empty":"Directory is empty"}):o.jsx(ad,{children:o.jsxs("ul",{children:[!g&&o.jsx("li",{children:o.jsxs("button",{onClick:()=>{const w=t.split("/").slice(0,-1).join("/")||".";s(w)},className:"w-full flex items-center gap-3 px-4 py-2 hover:bg-surface4 transition-colors text-left",children:[o.jsx(CE,{className:"h-4 w-4 text-amber-400"}),o.jsx("span",{className:"text-sm text-neutral5",children:".."})]})}),m.map(w=>{const S=w.mount?.displayName||w.mount?.provider,k=w.mount?.status==="error";return o.jsx("li",{className:"group",children:o.jsxs("div",{className:"flex items-center hover:bg-surface4 transition-colors",children:[o.jsxs("button",{onClick:()=>y(w),className:"flex-1 flex items-center gap-3 px-4 py-2 text-left",children:[eOt(w),o.jsx("span",{className:"text-sm text-neutral6 flex-1 truncate",children:w.name}),w.mount&&k&&o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx("span",{tabIndex:0,className:"flex items-center",children:o.jsx(eA,{className:"h-4 w-4 text-red-400"})})}),o.jsxs(Wr,{className:"max-w-xs",children:[o.jsx("span",{className:"text-red-400",children:"Error:"})," ",w.mount.error||"Failed to connect to this filesystem"]})]}),w.mount&&S&&(w.mount.description?o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx("span",{tabIndex:0,className:`text-xs px-1.5 py-0.5 rounded ${k?"text-red-400 bg-red-400/10":"text-neutral3 bg-surface4"}`,children:S})}),o.jsx(Wr,{children:w.mount.description})]}):o.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${k?"text-red-400 bg-red-400/10":"text-neutral3 bg-surface4"}`,children:S})),w.type==="file"&&w.size!==void 0&&o.jsx("span",{className:"text-xs text-neutral3 tabular-nums",children:tOt(w.size)})]}),u&&!w.mount&&o.jsx("button",{onClick:()=>x(w),"aria-label":`Delete ${w.name}`,className:"p-2 opacity-0 group-hover:opacity-100 hover:text-red-400 text-neutral3 transition-all",children:o.jsx(ed,{className:"h-3.5 w-3.5"})})]})},w.name)})]})})}),o.jsx($t,{open:!!h,onOpenChange:w=>!f&&!w&&p(null),children:o.jsxs($t.Content,{children:[o.jsxs($t.Header,{children:[o.jsx($t.Title,{children:"Delete Item"}),o.jsxs($t.Description,{children:['Are you sure you want to delete "',h,'"? This action cannot be undone.']})]}),o.jsxs($t.Footer,{children:[o.jsx($t.Cancel,{disabled:f,children:"Cancel"}),o.jsxs($t.Action,{disabled:f,onClick:async()=>{try{h&&u&&await u(h)}finally{p(null)}},children:[f?o.jsx(Aa,{className:"h-4 w-4 animate-spin mr-2"}):null,"Delete"]})]})]})})]})}function EIn(e){return e&&{js:"javascript",jsx:"jsx",ts:"typescript",tsx:"tsx",json:"json",md:"markdown",mdx:"mdx",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",c:"c",cpp:"cpp",h:"c",hpp:"cpp",css:"css",scss:"scss",less:"less",html:"html",xml:"xml",yaml:"yaml",yml:"yaml",toml:"toml",sh:"bash",bash:"bash",zsh:"bash",sql:"sql",graphql:"graphql",gql:"graphql",dockerfile:"dockerfile",makefile:"makefile",vue:"vue",svelte:"svelte"}[e.toLowerCase()]||null}function CIn({content:e,language:t}){return o.jsx(nve,{language:t,style:sve.coldarkDark,customStyle:{margin:0,padding:"1rem",backgroundColor:"transparent",fontSize:"0.875rem"},codeTagProps:{style:{fontFamily:"var(--geist-mono), ui-monospace, monospace"}},children:e})}function jIn({path:e,content:t,isLoading:r,mimeType:n,onClose:s}){const a=e.split("/").pop()||e,i=a.split(".").pop()?.toLowerCase(),l=n?.startsWith("image/")||["png","jpg","jpeg","gif","svg","webp"].includes(i||""),c=EIn(i);return o.jsxs("div",{className:"rounded-lg border border-border1 overflow-hidden",children:[o.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-surface3 border-b border-border1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[eOt({name:a,type:"file"}),o.jsx("span",{className:"text-sm font-medium text-neutral6",children:a})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ta,{content:t,copyMessage:"Copied file content"}),s&&o.jsx(ce,{variant:"ghost",size:"md",onClick:s,children:"Close"})]})]}),o.jsx("div",{className:"max-h-[500px] overflow-auto h-full",style:{backgroundColor:"black"},children:r?o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx(Aa,{className:"h-6 w-6 animate-spin text-neutral3"})}):l?o.jsx("div",{className:"p-4 flex items-center justify-center",children:o.jsx("img",{src:`data:${n||"image/png"};base64,${btoa(t)}`,alt:a,className:"max-w-full max-h-[400px] object-contain"})}):c?o.jsx(CIn,{content:t,language:c}):o.jsx("pre",{className:"p-4 text-sm text-neutral5 whitespace-pre-wrap font-mono overflow-x-auto",children:t})})]})}const TIn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(yf,{}),titleSlot:"No Workspaces yet",descriptionSlot:o.jsxs(o.Fragment,{children:["Add a workspace to your Mastra configuration to ",o.jsx("br",{}),"manage files, skills, and enable semantic search."]}),actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",o.jsx(ba,{})]})})}),NIn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(WMt,{}),titleSlot:"Workspace Not Configured",descriptionSlot:o.jsxs(o.Fragment,{children:["No workspace is configured. Add a workspace to your ",o.jsx("br",{}),"Mastra configuration to manage files, skills, and enable semantic search."]}),actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",o.jsx(ba,{})]})})}),AIn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(eA,{}),titleSlot:"Workspace Not Supported",descriptionSlot:o.jsxs(o.Fragment,{children:["The workspace feature requires a newer version of ",o.jsx("code",{className:"text-neutral5",children:"@mastra/core"}),".",o.jsx("br",{}),"Please upgrade your dependencies to enable workspace functionality."]}),actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",o.jsx(ba,{})]})})}),ire={bm25:{label:"Keyword",icon:o.jsx(Yi,{className:"h-3.5 w-3.5"}),color:"bg-blue-500/10 text-blue-400 border-blue-500/30"},vector:{label:"Semantic",icon:o.jsx(g_,{className:"h-3.5 w-3.5"}),color:"bg-purple-500/10 text-purple-400 border-purple-500/30"},hybrid:{label:"Hybrid",icon:o.jsx(ALt,{className:"h-3.5 w-3.5"}),color:"bg-amber-500/10 text-amber-400 border-amber-500/30"}};function nOt(e){return e.id.replace(/#chunk-\d+$/,"")}function IIn({onSearch:e,isSearching:t,searchResults:r,canBM25:n,canVector:s,onViewResult:a}){const[i,l]=b.useState(""),[c,u]=b.useState(5),d=()=>n&&s?"hybrid":n?"bm25":s?"vector":"bm25",[f,h]=b.useState(d()),p=g=>{g.preventDefault(),i.trim()&&e({query:i.trim(),topK:c,mode:f})},m=[...n?["bm25"]:[],...s?["vector"]:[],...n&&s?["hybrid"]:[]];return o.jsxs("div",{className:"rounded-lg bg-surface4",children:[o.jsxs("form",{onSubmit:p,className:"p-4",children:[o.jsxs("div",{className:"flex gap-3 items-center",children:[o.jsxs("div",{className:"flex-1 relative",children:[o.jsx(TE,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-neutral3"}),o.jsx(ar,{value:i,onChange:g=>l(g.target.value),placeholder:"Search workspace files...",className:"pl-9 h-10 bg-surface2 border-border1"})]}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"text-xs text-neutral4",children:"Top"}),o.jsx(ar,{type:"number",min:1,max:50,value:c,onChange:g=>u(parseInt(g.target.value)||5),className:"w-14 h-10 text-center bg-surface2 border-border1",title:"Number of results"})]}),o.jsx(ce,{type:"submit",disabled:t||!i.trim(),size:"lg",className:"h-10 px-4",children:t?o.jsx(Aa,{className:"h-4 w-4 animate-spin"}):"Search"})]}),m.length>0&&o.jsx("div",{className:"flex gap-2 mt-3",children:m.map(g=>{const y=ire[g],x=f===g;return o.jsxs("button",{type:"button",onClick:()=>h(g),className:`
|
|
551
551
|
inline-flex items-center gap-1.5 px-2.5 py-1 rounded text-xs font-medium border transition-colors
|
|
552
552
|
${x?y.color:"bg-surface2 text-neutral4 border-transparent hover:bg-surface3"}
|
|
553
553
|
`,children:[y.icon,y.label]},g)})})]}),r&&o.jsxs("div",{className:"border-t border-border1",children:[o.jsxs("div",{className:"px-4 py-2 flex items-center justify-between text-xs",children:[o.jsxs("span",{className:"text-neutral4",children:[r.results.length," result",r.results.length!==1?"s":"",' for "',o.jsx("span",{className:"text-neutral6",children:r.query}),'"']}),o.jsx("span",{className:`px-1.5 py-0.5 rounded ${ire[r.mode].color}`,children:ire[r.mode].label})]}),r.results.length===0?o.jsx("div",{className:"px-4 py-8 text-center text-neutral4 text-sm",children:"No results found. Try a different query."}):o.jsx("ul",{className:"max-h-[320px] overflow-auto",children:r.results.map((g,y)=>o.jsx(RIn,{result:g,rank:y+1,onClick:()=>a?.(nOt(g))},`${g.id}-${y}`))})]})]})}function RIn({result:e,rank:t,onClick:r}){const n=Math.min(100,Math.max(0,e.score*100)),s=nOt(e);return o.jsx("li",{className:"border-t border-border1 first:border-t-0",children:o.jsxs("button",{onClick:r,className:"w-full px-4 py-3 text-left hover:bg-surface5 transition-colors flex gap-3",children:[o.jsx("span",{className:"text-xs text-neutral3 tabular-nums w-4 shrink-0",children:t}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx(CE,{className:"h-3.5 w-3.5 text-neutral4 shrink-0"}),o.jsx("span",{className:"font-mono text-sm text-neutral6 truncate",children:s}),o.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[o.jsx("div",{className:"w-12 h-1 rounded-full bg-surface2 overflow-hidden",children:o.jsx("div",{className:"h-full rounded-full bg-accent1",style:{width:`${n}%`}})}),o.jsx("span",{className:"text-ui-xs text-neutral3 tabular-nums",children:e.score.toFixed(2)})]})]}),o.jsx("p",{className:"text-xs text-neutral4 line-clamp-2",children:e.content}),e.lineRange&&o.jsxs("p",{className:"text-xs text-neutral3 mt-1",children:["Lines ",e.lineRange.start,"–",e.lineRange.end]})]})]})})}function PIn({onSearch:e,results:t,isSearching:r,onResultClick:n}){const[s,a]=b.useState(""),[i,l]=b.useState(5),[c,u]=b.useState(!0),d=f=>{f.preventDefault(),s.trim()&&e({query:s.trim(),topK:i,includeReferences:c})};return o.jsxs("div",{className:"space-y-4",children:[o.jsxs("form",{onSubmit:d,className:"space-y-3",children:[o.jsxs("div",{className:"flex gap-2",children:[o.jsxs("div",{className:"flex-1 relative",children:[o.jsx(TE,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-neutral3"}),o.jsx("input",{type:"text",value:s,onChange:f=>a(f.target.value),placeholder:"Search across skills...",className:"w-full pl-10 pr-4 py-2 rounded-lg bg-surface3 border border-border1 text-sm text-neutral6 placeholder:text-neutral3 focus:outline-hidden focus:ring-2 focus:ring-accent1"})]}),o.jsx(ce,{type:"submit",disabled:!s.trim()||r,children:r?o.jsx(Aa,{className:"h-4 w-4 animate-spin"}):"Search"})]}),o.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[o.jsxs("label",{className:"flex items-center gap-2 text-neutral4",children:[o.jsx("span",{children:"Results:"}),o.jsxs("select",{value:i,onChange:f=>l(Number(f.target.value)),className:"px-2 py-1 rounded bg-surface3 border border-border1 text-neutral5",children:[o.jsx("option",{value:3,children:"3"}),o.jsx("option",{value:5,children:"5"}),o.jsx("option",{value:10,children:"10"}),o.jsx("option",{value:20,children:"20"})]})]}),o.jsxs("label",{className:"flex items-center gap-2 text-neutral4 cursor-pointer",children:[o.jsx("input",{type:"checkbox",checked:c,onChange:f=>u(f.target.checked),className:"rounded border-border1 bg-surface3"}),o.jsx("span",{children:"Include references"})]})]})]}),t.length>0&&o.jsxs("div",{className:"space-y-2",children:[o.jsxs("h3",{className:"text-sm font-medium text-neutral5",children:["Found ",t.length," result",t.length!==1?"s":""]}),o.jsx("div",{className:"space-y-2",children:t.map((f,h)=>o.jsx(MIn,{result:f,onClick:()=>n?.(f)},`${f.skillName}-${f.source}-${h}`))})]})]})}function MIn({result:e,onClick:t}){const r=e.source!=="SKILL.md";return o.jsx("button",{onClick:t,className:"w-full p-4 rounded-lg bg-surface3 border border-border1 hover:border-accent1/50 text-left transition-colors",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("div",{className:"p-1.5 rounded bg-surface5 shrink-0 mt-0.5",children:r?o.jsx(Yi,{className:"h-3.5 w-3.5 text-neutral4"}):o.jsx(mC,{className:"h-3.5 w-3.5 text-neutral4"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx("span",{className:"font-medium text-neutral6",children:e.skillName}),o.jsx("span",{className:"text-xs text-neutral3",children:e.source}),o.jsxs("span",{className:"ml-auto text-xs text-neutral3",children:["Score: ",e.score.toFixed(3)]})]}),o.jsxs("p",{className:"text-sm text-neutral4 line-clamp-3 whitespace-pre-wrap",children:[e.content.slice(0,300),e.content.length>300&&"..."]}),e.lineRange&&o.jsxs("p",{className:"text-xs text-neutral3 mt-2",children:["Lines ",e.lineRange.start,"–",e.lineRange.end]})]})]})})}function DIn({skillName:e,onUpdate:t,isUpdating:r}){return o.jsx(ce,{variant:"default",size:"icon-sm",disabled:r,tooltip:`Update ${e}`,onClick:t,children:r?o.jsx(Aa,{className:"h-4 w-4 animate-spin"}):o.jsx(Tk,{className:"h-4 w-4"})})}function LIn({skillName:e,onRemove:t,isRemoving:r}){return o.jsxs($t,{children:[o.jsx($t.Trigger,{asChild:!0,children:o.jsx(ce,{variant:"default",size:"icon-sm",disabled:r,tooltip:`Remove ${e}`,children:r?o.jsx(Aa,{className:"h-4 w-4 animate-spin"}):o.jsx(ed,{className:"h-4 w-4"})})}),o.jsxs($t.Content,{children:[o.jsxs($t.Header,{children:[o.jsx($t.Title,{children:"Remove Skill"}),o.jsxs($t.Description,{children:['Are you sure you want to remove the skill "',e,'"? This action cannot be undone.']})]}),o.jsxs($t.Footer,{children:[o.jsx($t.Cancel,{children:"Cancel"}),o.jsx($t.Action,{onClick:t,children:"Remove"})]})]})]})}const $In=".agents/skills/",Mve=[{name:"name",label:"Skill",size:"1fr"},{name:"description",label:"Description",size:"2fr"}],sOt=[...Mve,{name:"actions",label:"",size:"48px"}];function FIn(e,t){if(!e||!t||t.length===0)return null;for(const r of t)if(e.startsWith(r+"/")||e===r)return r;return null}function zIn({skills:e,isLoading:t,isSkillsConfigured:r=!0,hasUndiscoveredAgentSkills:n=!1,basePath:s="/workspace/skills",onAddSkill:a,onUpdateSkill:i,onRemoveSkill:l,updatingSkillName:c,removingSkillName:u,mountPaths:d}){const{navigate:f}=or(),h=d&&d.length>0,p=w=>w.path?.includes($In)??!1,m=e.some(p),g=!!l||!!i,y=g&&m,x=y?sOt:Mve;return!r&&!t?o.jsx(UIn,{onAddSkill:a}):t?o.jsx(BIn,{hasRowActions:g}):o.jsxs("div",{className:"space-y-4",children:[a&&o.jsx("div",{className:"flex items-center gap-4",children:o.jsxs(ce,{variant:"default",size:"sm",onClick:a,children:[o.jsx(Ce,{children:o.jsx(us,{className:"h-4 w-4"})}),"Add Skill"]})}),n&&o.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-amber-500/10 border border-amber-500/20",children:[o.jsx(AE,{className:"h-5 w-5 text-amber-500 shrink-0 mt-0.5"}),o.jsxs("div",{className:"text-sm",children:[o.jsx("p",{className:"font-medium text-amber-500",children:"Skills installed but not discovered"}),o.jsxs("p",{className:"text-neutral4 mt-1",children:["You have skills in ",o.jsx("code",{className:"px-1 py-0.5 rounded bg-surface4 text-xs",children:".agents/skills"})," that aren't being discovered. Add this path to your workspace skills configuration to see them."]})]})]}),o.jsx(ha,{children:o.jsxs(ha.Trim,{children:[o.jsx(ha.Header,{columns:x}),e.length>0?o.jsx(ha.Entries,{children:e.map(w=>{const S={id:w.path,name:w.name,description:w.description||"—"},k=h?FIn(w.path,d):null;return o.jsxs(ha.Entry,{entry:S,columns:x,onClick:()=>{const _=`${s}/${encodeURIComponent(w.name)}?path=${encodeURIComponent(w.path)}`;f(_)},children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"p-1.5 rounded bg-surface5",children:o.jsx(mC,{className:"h-3.5 w-3.5 text-neutral4"})}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("span",{className:"font-medium text-neutral6",children:w.name}),w.path&&o.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[k&&o.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral3 shrink-0",children:k}),o.jsx("span",{className:"text-[11px] text-neutral3 truncate",title:w.path,children:w.path})]})]})]}),o.jsx(ha.EntryText,{children:w.description||"—"}),y&&o.jsx("div",{className:"flex justify-end gap-1",onClick:_=>_.stopPropagation(),children:p(w)&&o.jsxs(o.Fragment,{children:[i&&o.jsx(DIn,{skillName:w.name,onUpdate:()=>i(w.name),isUpdating:c===w.name}),l&&o.jsx(LIn,{skillName:w.name,onRemove:()=>l(w.name),isRemoving:u===w.name})]})})]},w.path)})}):o.jsx(ha.Message,{message:a?'No skills discovered. Click "Add Skill" to install from skills.sh.':"No skills discovered. Add SKILL.md files to your skills directory."})]})})]})}function BIn({hasRowActions:e}){const t=e?sOt:Mve;return o.jsx(ha,{children:o.jsxs(ha.Trim,{children:[o.jsx(ha.Header,{columns:t}),o.jsx(ha.Entries,{children:Array.from({length:3}).map((r,n)=>o.jsxs(ha.Entry,{columns:t,isLoading:!0,children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"h-7 w-7 rounded bg-surface4 animate-pulse"}),o.jsxs("div",{children:[o.jsx("div",{className:"h-4 w-32 rounded bg-surface4 animate-pulse"}),o.jsx("div",{className:"h-3 w-40 rounded bg-surface4 animate-pulse mt-1"})]})]}),o.jsx("div",{className:"h-4 w-48 rounded bg-surface4 animate-pulse"}),e&&o.jsx("div",{className:"h-4 w-6 rounded bg-surface4 animate-pulse"})]},n))})]})})}function UIn({onAddSkill:e}){return o.jsx("div",{className:"grid place-items-center py-16",children:o.jsxs("div",{className:"flex flex-col items-center text-center max-w-md",children:[o.jsx("div",{className:"p-4 rounded-full bg-surface4 mb-4",children:o.jsx(mC,{className:"h-8 w-8 text-neutral3"})}),o.jsx("h2",{className:"text-lg font-medium text-neutral6 mb-2",children:"Skills Not Configured"}),o.jsx("p",{className:"text-sm text-neutral4 mb-6",children:"No skills are configured in the workspace. Add SKILL.md files to your skills directory to discover and manage agent skills."}),o.jsxs("div",{className:"flex gap-3",children:[e&&o.jsxs(ce,{size:"lg",variant:"default",onClick:e,children:[o.jsx(Ce,{children:o.jsx(us,{className:"h-4 w-4"})}),"Add Skill from skills.sh"]}),o.jsxs(ce,{size:"lg",variant:"default",as:"a",href:"https://mastra.ai/en/docs/workspace/skills",target:"_blank",children:[o.jsx(Ce,{children:o.jsx(GPt,{className:"h-4 w-4"})}),"Learn about Skills"]})]})]})})}function VIn(e){switch(e.type){case"external":return{icon:o.jsx(Fb,{className:"h-3.5 w-3.5"}),label:"External Package",path:e.packagePath};case"local":return{icon:o.jsx(tDt,{className:"h-3.5 w-3.5"}),label:"Local Project",path:e.projectPath};case"managed":return{icon:o.jsx(XL,{className:"h-3.5 w-3.5"}),label:"Managed",path:e.mastraPath}}}function qIn({skill:e,rawSkillMd:t,onReferenceClick:r}){const[n,s]=b.useState(new Set(["instructions"])),[a,i]=b.useState(!1),l=VIn(e.source),c=u=>{s(d=>{const f=new Set(d);return f.has(u)?f.delete(u):f.add(u),f})};return o.jsxs("div",{className:"space-y-6 min-w-0 overflow-hidden",children:[o.jsxs("div",{className:"flex items-start gap-4",children:[o.jsx("div",{className:"p-3 rounded-lg bg-surface5",children:o.jsx(mC,{className:"h-6 w-6 text-neutral4"})}),o.jsxs("div",{className:"flex-1",children:[o.jsx("h1",{className:"text-xl font-semibold text-neutral6",children:e.name}),o.jsx("p",{className:"text-sm text-neutral4 mt-1",children:e.description})]})]}),o.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[o.jsx(ET,{label:"Source",value:l.label,icon:l.icon}),o.jsx(ET,{label:"Path",value:e.path,icon:o.jsx(CE,{className:"h-3.5 w-3.5"})}),e.license&&o.jsx(ET,{label:"License",value:e.license}),e.compatibility!=null&&o.jsx(ET,{label:"Compatibility",value:e.compatibility}),o.jsx(ET,{label:"References",value:`${e.references.length} files`,icon:o.jsx(Yi,{className:"h-3.5 w-3.5"})})]}),o.jsx(VL,{title:"Instructions",isExpanded:n.has("instructions"),onToggle:()=>c("instructions"),headerAction:o.jsxs("button",{onClick:u=>{u.stopPropagation(),i(!a)},className:"flex items-center gap-1.5 px-2 py-1 rounded text-xs text-neutral4 hover:text-neutral5 hover:bg-surface4 transition-colors",title:a?"Show rendered":"Show source",children:[a?o.jsx(xo,{className:"h-3.5 w-3.5"}):o.jsx(b2t,{className:"h-3.5 w-3.5"}),a?"Rendered":"Source"]}),children:a?o.jsx("div",{style:{backgroundColor:"black"},className:"rounded-lg overflow-x-auto w-0 min-w-full",children:o.jsx(nve,{language:"markdown",style:sve.coldarkDark,customStyle:{margin:0,padding:"1rem",backgroundColor:"transparent",fontSize:"0.875rem"},children:t??e.instructions})}):o.jsx(X_,{children:e.instructions})}),e.references.length>0&&o.jsx(VL,{title:`References (${e.references.length})`,isExpanded:n.has("references"),onToggle:()=>c("references"),children:o.jsx("div",{className:"space-y-1",children:e.references.map(u=>o.jsxs("button",{onClick:()=>r?.(u),className:"flex items-center gap-2 w-full px-3 py-2 rounded hover:bg-surface4 text-left transition-colors",children:[o.jsx(Yi,{className:"h-4 w-4 text-neutral3"}),o.jsx("span",{className:"text-sm text-neutral5",children:u})]},u))})}),e.scripts.length>0&&o.jsx(VL,{title:`Scripts (${e.scripts.length})`,isExpanded:n.has("scripts"),onToggle:()=>c("scripts"),children:o.jsx("div",{className:"space-y-1",children:e.scripts.map(u=>o.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded bg-surface3",children:[o.jsx(HMt,{className:"h-4 w-4 text-neutral3"}),o.jsx("span",{className:"text-sm text-neutral5",children:u})]},u))})}),e.assets.length>0&&o.jsx(VL,{title:`Assets (${e.assets.length})`,isExpanded:n.has("assets"),onToggle:()=>c("assets"),children:o.jsx("div",{className:"space-y-1",children:e.assets.map(u=>o.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded bg-surface3",children:[o.jsx(ice,{className:"h-4 w-4 text-neutral3"}),o.jsx("span",{className:"text-sm text-neutral5",children:u})]},u))})}),o.jsx("div",{className:"pt-4 border-t border-border1",children:o.jsxs("p",{className:"text-xs text-neutral3",children:["Path: ",o.jsx("code",{className:"px-1 py-0.5 rounded bg-surface4",children:e.path})]})})]})}function aOt(e){if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e))return e.map(t=>typeof t=="string"?t:JSON.stringify(t)).join(", ");if(typeof e=="object"&&e!==null){const t=Object.keys(e);if(t.length===0)return"{}";if(t.length===1){const r=t[0],n=e[r];return Array.isArray(n)?`${r}: ${n.join(", ")}`:`${r}: ${aOt(n)}`}return`{${t.join(", ")}}`}return String(e)}function ET({label:e,value:t,icon:r}){const n=aOt(t);return o.jsxs("div",{className:"p-3 rounded-lg bg-surface3",children:[o.jsx("p",{className:"text-xs text-neutral3 mb-1",children:e}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[r&&o.jsx("span",{className:"text-neutral4",children:r}),o.jsx("p",{className:"text-sm font-medium text-neutral5 truncate",title:n,children:n})]})]})}function VL({title:e,isExpanded:t,onToggle:r,headerAction:n,children:s}){return o.jsxs("div",{className:"border border-border1 rounded-lg overflow-hidden min-w-0",children:[o.jsxs("div",{className:"flex items-center bg-surface3 hover:bg-surface4 transition-colors",children:[o.jsxs("button",{onClick:r,className:"flex items-center gap-2 flex-1 px-4 py-3",children:[t?o.jsx(as,{className:"h-4 w-4 text-neutral3"}):o.jsx(Vs,{className:"h-4 w-4 text-neutral3"}),o.jsx("span",{className:"text-sm font-medium text-neutral5",children:e})]}),n&&o.jsx("div",{className:"pr-3",children:n})]}),t&&o.jsx("div",{className:"p-4 bg-surface2 overflow-x-auto w-0 min-w-full",children:s})]})}function HIn({open:e,onOpenChange:t,skillName:r,referencePath:n,content:s,isLoading:a,error:i}){const{isCopied:l,copyToClipboard:c}=LB({copiedDuration:2e3});if(!e)return null;const u=()=>{s&&c(s)};return o.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[o.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>t(!1)}),o.jsxs("div",{className:"relative w-full max-w-4xl max-h-[85vh] mx-4 bg-surface2 rounded-xl border border-border1 shadow-2xl flex flex-col overflow-hidden",role:"dialog","aria-modal":"true","aria-labelledby":"reference-viewer-title",onKeyDown:d=>{d.key==="Escape"&&t(!1)},children:[o.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border1 bg-surface3",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"p-1.5 rounded bg-surface5",children:o.jsx(Yi,{className:"h-4 w-4 text-neutral4"})}),o.jsxs("div",{children:[o.jsx("h2",{id:"reference-viewer-title",className:"text-base font-medium text-neutral6",children:n}),o.jsxs("p",{className:"text-xs text-neutral3",children:["from ",r]})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs(ce,{size:"md",variant:"default",onClick:u,disabled:!s||a,children:[o.jsx(Ce,{children:l?o.jsx(ra,{className:"h-3.5 w-3.5 text-green-400"}):o.jsx(tu,{className:"h-3.5 w-3.5"})}),l?"Copied!":"Copy"]}),o.jsx("button",{onClick:()=>t(!1),"aria-label":"Close reference viewer",className:"p-2 rounded-lg hover:bg-surface4 text-neutral3 hover:text-neutral5 transition-colors",children:o.jsx(Nn,{className:"h-4 w-4"})})]})]}),o.jsx("div",{className:"flex-1 overflow-auto p-6",children:a?o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx("div",{className:"h-6 w-6 border-2 border-accent1 border-t-transparent rounded-full animate-spin"})}):i?o.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[o.jsx("p",{className:"text-red-400 mb-2",children:"Failed to load reference"}),o.jsx("p",{className:"text-sm text-neutral3",children:i})]}):s?o.jsx("pre",{className:"whitespace-pre-wrap text-sm text-neutral5 font-mono bg-surface3 p-4 rounded-lg overflow-auto",children:s}):o.jsx("div",{className:"flex items-center justify-center py-12 text-neutral3",children:"No content available"})})]})]})}function G8e(e){return`${e.topSource}/${e.name}`}function Z8e(e){const t=f1t(e.topSource,e.name);return t?`${t.owner}/${t.repo}/${e.name}`:null}function QIn({open:e,onOpenChange:t,workspaceId:r,onInstall:n,isInstalling:s,installedSkillIds:a=[],installedSkillNames:i=[],writableMounts:l,installedSkillPaths:c}){const[u,d]=b.useState(""),[f,h]=b.useState(null),[p,m]=b.useState(l&&l.length>0?l[0]?.path:void 0),{data:g,isLoading:y}=G_n(r),x=W_n(r),w=b.useMemo(()=>f?.topSource?f1t(f.topSource,f.name):null,[f]),S=b.useMemo(()=>!w||!f?null:`https://skills.sh/${w.owner}/${w.repo}/${f.name}`,[w,f]),{data:k,isLoading:_}=Z_n(r,w?.owner,w?.repo,f?.name,{enabled:!!w&&!!f}),E=u1(D=>{D.trim().length>=2&&x.mutate(D)},300),T=b.useCallback(D=>{d(D),E(D)},[E]),j=b.useMemo(()=>u.trim().length>=2?x.data?.skills??[]:g?.skills??[],[u,x.data,g]),N=x.isPending,I=u.trim().length>=2,P=b.useMemo(()=>{if(!f)return!1;const D=Z8e(f);return!!(D&&a.includes(D)||i.includes(f.name))},[f,a,i]),R=b.useCallback(()=>{!f||!w||n({repository:`${w.owner}/${w.repo}`,skillName:f.name,mount:l&&l.length>1?p:void 0})},[f,w,n,l,p]),B=b.useCallback(D=>{D||(d(""),h(null),m(l?.[0]?.path)),t(D)},[t,l]);return o.jsx(On,{open:e,onOpenChange:B,children:o.jsxs(vn,{className:"max-w-4xl h-[80vh] flex flex-col",children:[o.jsxs(kn,{children:[o.jsx(bn,{children:"Add Skill"}),o.jsx(qs,{children:"Search and install skills from the community registry"})]}),o.jsxs(Bn,{className:"flex-1 flex flex-col gap-4 overflow-hidden max-h-none",children:[o.jsxs("div",{className:"relative",children:[o.jsx(TE,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-neutral3"}),o.jsx(ar,{placeholder:"Search skills...",value:u,onChange:D=>T(D.target.value),className:"pl-9"})]}),o.jsxs("div",{className:"flex flex-1 gap-4 min-h-0",children:[o.jsxs("div",{className:"w-1/2 flex flex-col min-h-0",children:[o.jsx("div",{className:"text-xs font-medium text-neutral4 uppercase tracking-wide mb-2",children:I?"Search Results":"Popular Skills"}),o.jsx(Ms,{className:"flex-1 border border-border1 rounded-lg",children:y||N?o.jsx("div",{className:"flex items-center justify-center py-8",children:o.jsx(Aa,{className:"h-6 w-6 animate-spin text-neutral3"})}):j.length===0?o.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-neutral4",children:[o.jsx(Fb,{className:"h-8 w-8 mb-2"}),o.jsx("p",{className:"text-sm",children:I?"No skills found":"No skills available"})]}):o.jsx("div",{className:"p-2 space-y-1",children:j.map(D=>{const $=G8e(D),U=Z8e(D),z=U&&a.includes(U)||i.includes(D.name),H=f?G8e(f):null;return o.jsx("button",{onClick:()=>h(D),className:Y("w-full text-left px-3 py-2 rounded-md transition-colors","hover:bg-surface4",H===$&&"bg-surface5 border border-accent1"),children:o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"font-medium text-sm text-neutral6 truncate",children:D.name}),z&&o.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-accent1/20 text-accent1",children:[o.jsx(ra,{className:"h-2.5 w-2.5"}),"Installed"]})]}),o.jsx("div",{className:"text-xs text-neutral4 truncate",children:D.topSource})]}),o.jsxs("div",{className:"flex items-center gap-1 text-xs text-neutral3 shrink-0",children:[o.jsx(Tk,{className:"h-3 w-3"}),o.jsx("span",{children:D.installs.toLocaleString()})]})]})},$)})})})]}),o.jsxs("div",{className:"w-1/2 flex flex-col min-h-0",children:[o.jsx("div",{className:"text-xs font-medium text-neutral4 uppercase tracking-wide mb-2",children:"Preview"}),o.jsx("div",{className:"flex-1 border border-border1 rounded-lg overflow-hidden flex flex-col",children:f?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"p-4 border-b border-border1 bg-surface3",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("div",{className:"p-2 rounded-lg bg-surface5",children:o.jsx(mC,{className:"h-5 w-5 text-neutral4"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("h3",{className:"font-semibold text-neutral6 truncate",children:f.name}),o.jsxs("div",{className:"flex items-center gap-3 mt-1 text-xs text-neutral4",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(H2t,{className:"h-3 w-3"}),f.topSource]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(Tk,{className:"h-3 w-3"}),f.installs.toLocaleString()," installs"]})]})]}),w&&o.jsx("a",{href:`https://github.com/${w.owner}/${w.repo}`,target:"_blank",rel:"noopener noreferrer",className:"text-neutral4 hover:text-neutral5 transition-colors",title:"View on GitHub",children:o.jsx(ba,{className:"h-4 w-4"})})]})}),_?o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(Aa,{className:"h-6 w-6 animate-spin text-neutral3"})}):k?o.jsx(Ms,{className:"flex-1",children:o.jsx("div",{className:"p-4",children:o.jsx(X_,{children:k})})}):o.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-neutral4",children:[o.jsx(Fb,{className:"h-8 w-8 mb-2"}),o.jsx("p",{className:"text-sm",children:"Preview unavailable"}),S&&o.jsxs("a",{href:S,target:"_blank",rel:"noopener noreferrer",className:"text-xs mt-2 text-accent1 hover:underline flex items-center gap-1",children:["View on skills.sh ",o.jsx(ba,{className:"h-3 w-3"})]})]})]}):o.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-neutral4",children:[o.jsx(Fb,{className:"h-8 w-8 mb-2"}),o.jsx("p",{className:"text-sm",children:"Select a skill to preview"})]})})]})]}),f&&o.jsxs("div",{className:"flex flex-col gap-3 pt-4 border-t border-border1",children:[l&&l.length>1&&o.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-surface3 border border-border1",children:[o.jsx(nc,{className:"h-4 w-4 text-icon4 shrink-0"}),o.jsx("label",{htmlFor:"mount-select",className:"text-sm text-icon5 whitespace-nowrap font-medium",children:"Install to"}),o.jsx("select",{id:"mount-select",value:p??"",onChange:D=>m(D.target.value),className:"flex-1 text-sm px-3 py-1.5 rounded-md border border-border1 bg-surface2 text-icon6",children:l.map(D=>{const $=D.displayName??D.name??D.provider??"unknown";return o.jsxs("option",{value:D.path,children:[$," (",D.path,")"]},D.path)})})]}),o.jsxs("div",{className:"flex items-center justify-end gap-2",children:[P&&l&&l.length>1&&f&&c?.[f.name]&&(()=>{const D=c[f.name],$=l.find(U=>D.startsWith(U.path+"/")||D===U.path);return $?o.jsxs("span",{className:"text-xs text-icon4",children:["Installed at ",$.path]}):null})(),o.jsx(ce,{variant:"default",onClick:()=>B(!1),children:"Cancel"}),o.jsx(ce,{variant:"primary",onClick:R,disabled:!w||s||P,"data-testid":"install-skill-button",children:s?o.jsxs(o.Fragment,{children:[o.jsx(Aa,{className:"h-4 w-4 mr-2 animate-spin"}),"Installing..."]}):P?o.jsxs(o.Fragment,{children:[o.jsx(ra,{className:"h-4 w-4 mr-2"}),"Already Installed"]}):o.jsxs(o.Fragment,{children:[o.jsx(Tk,{className:"h-4 w-4 mr-2"}),"Install"]})})]})]})]})]})})}function Y8e(){const{workspaceId:e}=na(),[t,r]=ao(),n=uu(),[s,a]=b.useState(!1),[i,l]=b.useState(!1),[c,u]=b.useState(!1),[d,f]=b.useState(null),[h,p]=b.useState(null),[m,g]=b.useState(!1),y=t.get("file"),x=t.get("tab"),{data:w,error:S,isLoading:k}=u1t(),_=w?.workspaces??[],E=e??_[0]?.id,{data:T,isLoading:j,error:N}=L_n(E),I=Ps(S)||Ps(N),P=Os(S)||Os(N),R=t.get("path")||".",B=Ele(S)||Ele(N),D=E?_.find(Re=>Re.id===E):void 0,$=Re=>{const it=new URLSearchParams(t);for(const[rt,ht]of Object.entries(Re))ht===null?it.delete(rt):it.set(rt,ht);r(it)},U=Re=>{g(!1),a(!1),n(`/workspaces/${Re}`)},z=Re=>{$({path:Re==="."||Re===""?null:Re,file:null})},H=Re=>{$({file:Re})},Q=Re=>{$({tab:Re})},L=R,Z=y,{data:V,isLoading:M,error:W,refetch:G}=$_n(L,{enabled:T?.isWorkspaceConfigured&&T?.capabilities?.hasFilesystem,workspaceId:E}),J=z_n(),ae=B_n(),{data:te,isLoading:re}=d1t(Z??"",{enabled:!!Z,workspaceId:E}),{data:ie,isLoading:he,refetch:X}=V_n({workspaceId:E}),se=Y_n(),le=X_n(),xe=K_n(),de=T?.isWorkspaceConfigured??!1,ue=T?.capabilities?.hasFilesystem??!1,ve=T?.capabilities?.hasSkills??!1,we=T?.capabilities?.canBM25??!1,Ne=T?.capabilities?.canVector??!1,K=D?.safety?.readOnly??!1,oe=ue&&!K,be=T?.mounts,Ae=be?.filter(Re=>!Re.readOnly).map(Re=>({path:Re.path,displayName:Re.displayName,icon:Re.icon,provider:Re.provider,name:Re.name})),$e=be&&be.length>1?be.map(Re=>Re.path):void 0,ye=b.useCallback(Re=>{E&&se.mutate({...Re,workspaceId:E},{onSuccess:async it=>{if(it.success){u(!1);const{data:rt,error:ht}=await X();if(ht||!rt){ze.success(`Skill "${it.skillName}" installed successfully (${it.filesWritten} files)`);return}rt.skills.some($r=>$r.name===it.skillName)?ze.success(`Skill "${it.skillName}" installed successfully (${it.filesWritten} files)`):(g(!0),ze.warning(`Skill "${it.skillName}" installed to .agents/skills but not discovered. Add .agents/skills to your workspace skills paths.`))}else ze.error("Failed to install skill")},onError:it=>{ze.error(`Failed to install skill: ${it instanceof Error?it.message:"Unknown error"}`)}})},[E,se,X]),ke=b.useCallback(Re=>{E&&(p(Re),le.mutate({workspaceId:E,skillName:Re},{onSuccess:it=>{if(p(null),it.updated.length>0){const rt=it.updated[0];rt.success?(ze.success(`Skill "${Re}" updated successfully (${rt.filesWritten} files)`),X()):ze.error(`Failed to update skill: ${rt.error??"Unknown error"}`)}else ze.error("Failed to update skill: No update result returned")},onError:it=>{p(null),ze.error(`Failed to update skill: ${it instanceof Error?it.message:"Unknown error"}`)}}))},[E,le,X]),ge=b.useCallback(Re=>{E&&(f(Re),xe.mutate({workspaceId:E,skillName:Re},{onSuccess:it=>{f(null),it.success?(ze.success(`Skill "${it.skillName}" removed successfully`),X()):ze.error(`Failed to remove skill "${it.skillName}"`)},onError:it=>{f(null),ze.error(`Failed to remove skill: ${it instanceof Error?it.message:"Unknown error"}`)}}))},[E,xe,X]),Fe=x==="files"&&ue?"files":x==="skills"&&ve?"skills":ue?"files":ve?"skills":"files",ct=ie?.skills??[],wt=ie?.isSkillsConfigured??!1,lr=V?.entries??[],Ve=ue&&(we||Ne),qe=ve&&wt&&ct.length>0,Ie=Ve||qe;if(k)return o.jsx(Jr,{title:"Workspace",icon:o.jsx(nc,{}),children:o.jsx(Dt,{})});if(I)return o.jsx(Jr,{title:"Workspace",icon:o.jsx(nc,{}),children:o.jsx(sa,{})});if(P)return o.jsx(Jr,{title:"Workspace",icon:o.jsx(nc,{}),children:o.jsx(Zs,{resource:"workspaces"})});if(B)return o.jsx(Jr,{title:"Workspace",icon:o.jsx(nc,{}),children:o.jsx(AIn,{})});const Le=S||N;return Le?o.jsx(Jr,{title:"Workspace",icon:o.jsx(nc,{}),children:o.jsx(pu,{title:"Failed to load workspace",message:Le.message})}):!k&&_.length===0?o.jsx(Jr,{title:"Workspace",icon:o.jsx(nc,{}),children:o.jsx(TIn,{})}):!j&&!k&&!de?o.jsx(Jr,{title:"Workspace",icon:o.jsx(nc,{}),children:o.jsx(NIn,{})}):o.jsxs(bt,{children:[o.jsx(bt.TopArea,{children:o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsxs(xn,{children:[o.jsxs(xn.Title,{children:[o.jsx(nc,{})," Workspace"]}),o.jsx(xn.Description,{children:"Manage files, skills, and search your workspace"})]})}),o.jsxs(bt.Column,{className:"flex justify-end gap-2",children:[Ie&&o.jsx(Ln,{onClick:()=>a(!s),tooltipContent:"Search workspace","aria-label":"Search workspace",children:o.jsx(TE,{})}),o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Workspaces documentation","aria-label":"Workspaces documentation",children:o.jsx(Li,{})})]})]})}),o.jsxs(bt.MainArea,{className:"grid content-start gap-6",children:[_.length>1&&o.jsxs("div",{className:"relative",children:[o.jsxs("button",{onClick:()=>l(!i),className:"flex items-center gap-2 px-3 py-2 text-sm border border-border1 rounded-lg bg-surface2 hover:bg-surface3 transition-colors w-full max-w-md",children:[D?.source==="agent"?o.jsx(ZL,{className:"h-4 w-4 text-accent1"}):o.jsx(XL,{className:"h-4 w-4 text-neutral4"}),o.jsxs("span",{className:"flex-1 text-left truncate",children:[D?.name??"Select workspace",D?.source==="agent"&&D.agentName&&o.jsxs("span",{className:"text-neutral4 ml-1",children:["(",D.agentName,")"]})]}),o.jsx(as,{className:`h-4 w-4 text-neutral4 transition-transform ${i?"rotate-180":""}`})]}),i&&o.jsx("div",{className:"absolute z-50 mt-1 w-full max-w-md bg-surface2 border border-border1 rounded-lg shadow-lg overflow-hidden",children:_.map(Re=>o.jsxs("button",{onClick:()=>{U(Re.id),l(!1)},className:`flex items-center gap-3 px-3 py-2 w-full text-left hover:bg-surface3 transition-colors ${D?.id===Re.id?"bg-surface3":""}`,children:[Re.source==="agent"?o.jsx(ZL,{className:"h-4 w-4 text-accent1 shrink-0"}):o.jsx(XL,{className:"h-4 w-4 text-neutral4 shrink-0"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"text-sm font-medium text-neutral6 truncate",children:Re.name}),o.jsx("div",{className:"text-xs text-neutral4 truncate",children:Re.source==="agent"?`Agent: ${Re.agentName}`:"Global workspace"})]}),o.jsxs("div",{className:"flex gap-1 shrink-0",children:[Re.safety?.readOnly&&o.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400",children:"Read-only"}),Re.capabilities.hasFilesystem&&o.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"FS"}),Re.capabilities.hasSandbox&&o.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"Sandbox"}),Re.capabilities.hasSkills&&o.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"Skills"})]})]},Re.id))})]}),_.length===1&&D&&o.jsxs("div",{className:"flex items-center gap-2 text-sm text-neutral4",children:[D.source==="agent"?o.jsx(ZL,{className:"h-4 w-4 text-accent1"}):o.jsx(XL,{className:"h-4 w-4"}),o.jsx("span",{children:D.name}),D.source==="agent"&&D.agentName&&o.jsxs("span",{className:"text-neutral3",children:["(",D.agentName,")"]}),K&&o.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400",children:"Read-only"})]}),s&&Ie&&E&&o.jsx(WIn,{workspaceId:E,canSearchFiles:Ve,canSearchSkills:qe,canBM25:we,canVector:Ne,showInitWarning:!j&&T?.status!=="ready",onViewFileResult:Re=>{$({file:Re,tab:"files"})},onViewSkillResult:(Re,it)=>{E&&n(`/workspaces/${E}/skills/${encodeURIComponent(Re)}?path=${encodeURIComponent(it)}`)}},E),o.jsxs("div",{className:"flex gap-2 border-b border-border1",children:[ue&&o.jsxs("button",{onClick:()=>Q("files"),className:`flex items-center gap-2 px-4 py-2 text-sm font-medium border-b-2 transition-colors ${Fe==="files"?"border-accent1 text-neutral6":"border-transparent text-neutral4 hover:text-neutral5"}`,children:[o.jsx(Yi,{className:"h-4 w-4"}),"Files"]}),ve&&o.jsxs("button",{onClick:()=>Q("skills"),className:`flex items-center gap-2 px-4 py-2 text-sm font-medium border-b-2 transition-colors ${Fe==="skills"?"border-accent1 text-neutral6":"border-transparent text-neutral4 hover:text-neutral5"}`,children:[o.jsx(y3,{className:"h-4 w-4"}),"Skills",wt&&ct.length>0&&o.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:ct.length})]})]}),o.jsxs("div",{className:"pb-8",children:[Fe==="files"&&ue&&o.jsx("div",{className:"space-y-4",children:o.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[o.jsx(_In,{entries:lr,currentPath:L,isLoading:M,error:W,onNavigate:z,onFileSelect:H,onRefresh:()=>G(),onCreateDirectory:K?void 0:Re=>ae.mutate({path:Re,workspaceId:E}),onDelete:K?void 0:Re=>J.mutate({path:Re,recursive:!0,force:!0,workspaceId:E})}),Z&&o.jsx(jIn,{path:Z,content:te?.content??"",isLoading:re,mimeType:te?.mimeType,onClose:()=>H(null)})]})}),Fe==="skills"&&ve&&o.jsx(zIn,{skills:ct,isLoading:he,isSkillsConfigured:wt,hasUndiscoveredAgentSkills:m,basePath:E?`/workspaces/${E}/skills`:"/workspaces",onAddSkill:oe?()=>u(!0):void 0,onUpdateSkill:oe?ke:void 0,onRemoveSkill:oe?ge:void 0,updatingSkillName:h??void 0,removingSkillName:d??void 0,mountPaths:$e}),!ue&&!ve&&!j&&o.jsx("div",{className:"py-12 text-center text-neutral4",children:o.jsx("p",{children:"No workspace capabilities are configured."})})]})]}),E&&oe&&o.jsx(QIn,{open:c,onOpenChange:u,workspaceId:E,onInstall:ye,isInstalling:se.isPending,installedSkillIds:ct.filter(Re=>Re.skillsShSource).map(Re=>`${Re.skillsShSource.owner}/${Re.skillsShSource.repo}/${Re.name}`),installedSkillNames:ct.filter(Re=>!Re.skillsShSource).map(Re=>Re.name),writableMounts:Ae,installedSkillPaths:Object.fromEntries(ct.filter(Re=>Re.path).map(Re=>[Re.name,Re.path]))})]})}function WIn({workspaceId:e,canSearchFiles:t,canSearchSkills:r,canBM25:n,canVector:s,showInitWarning:a,onViewFileResult:i,onViewSkillResult:l}){const c=U_n(),u=Q_n();return o.jsxs("div",{className:"border border-border1 rounded-lg p-4 bg-surface2 space-y-4",children:[t&&o.jsxs("div",{children:[o.jsxs("h3",{className:"text-sm font-medium text-neutral5 mb-3 flex items-center gap-2",children:[o.jsx(Yi,{className:"h-4 w-4"}),"Search Indexed Files"]}),a&&o.jsxs("p",{className:"text-xs text-amber-400 mb-3",children:["File search requires ",o.jsx("code",{className:"text-amber-300",children:"workspace.init()"})," to index files from your configured ",o.jsx("code",{className:"text-amber-300",children:"autoIndexPaths"}),"."]}),o.jsx(IIn,{onSearch:d=>c.mutate({...d,workspaceId:e}),isSearching:c.isPending,searchResults:c.data?{...c.data,results:c.data.results.filter(d=>!d.id.startsWith("skill:"))}:void 0,canBM25:n,canVector:s,onViewResult:i})]}),r&&o.jsxs("div",{children:[o.jsxs("h3",{className:"text-sm font-medium text-neutral5 mb-3 flex items-center gap-2",children:[o.jsx(y3,{className:"h-4 w-4"}),"Search Skills"]}),o.jsx(PIn,{onSearch:d=>u.mutate({...d,workspaceId:e}),results:u.data?.results??[],isSearching:u.isPending,onResultClick:d=>l(d.skillName,d.skillPath)})]})]})}function GIn(e,t){return e==null||t==null?null:e in t?e:null}function ZIn(){const{skillName:e,workspaceId:t}=na(),[r]=ao(),n=wa(),s=e?decodeURIComponent(e):"",a=r.get("path"),i=a?decodeURIComponent(a):void 0,l=r.get("agentId"),c=l?decodeURIComponent(l):null,d=n.getQueriesData({queryKey:["agents"]})?.[0]?.[1]??null,f=GIn(c,d),h=f?`/agents/${f}`:t?`/workspaces/${t}?tab=skills`:"/workspaces",[p,m]=b.useState(null),{data:g,isLoading:y,error:x}=q_n(s,{workspaceId:t,path:i}),{data:w}=d1t(g?.path?`${g.path}/SKILL.md`:"",{enabled:!!g?.path,workspaceId:t}),{data:S,isLoading:k}=H_n(s,p??"",{enabled:!!p,workspaceId:t,path:i}),_=E=>f?o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:h,children:[o.jsx(Ce,{children:o.jsx(ZL,{className:"h-4 w-4"})}),f]}),o.jsxs(jr,{as:"span",to:"",isCurrent:!0,children:[o.jsx(Ce,{children:o.jsx(y3,{className:"h-4 w-4"})}),E]})]}):o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:h,children:[o.jsx(Ce,{children:o.jsx(nc,{className:"h-4 w-4"})}),"Workspace"]}),o.jsxs(jr,{as:fr,to:h,children:[o.jsx(Ce,{children:o.jsx(y3,{className:"h-4 w-4"})}),"Skills"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:E})]});return y?o.jsxs(zr,{children:[o.jsx(Cn,{children:_("Loading...")}),o.jsx("div",{className:"grid place-items-center h-full",children:o.jsx("div",{className:"h-8 w-8 border-2 border-accent1 border-t-transparent rounded-full animate-spin"})})]}):x&&Ps(x)?o.jsxs(zr,{children:[o.jsx(Cn,{children:_("Session Expired")}),o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(sa,{})})]}):x&&Os(x)?o.jsxs(zr,{children:[o.jsx(Cn,{children:_("Permission Denied")}),o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"workspaces"})})]}):x||!g?o.jsxs(zr,{children:[o.jsx(Cn,{children:_("Error")}),o.jsx("div",{className:"grid place-items-center h-full",children:o.jsxs("div",{className:"text-center",children:[o.jsx("p",{className:"text-red-400 mb-2",children:"Failed to load skill"}),o.jsx("p",{className:"text-sm text-neutral3",children:x?.message??"Skill not found"})]})})]}):o.jsxs(zr,{children:[o.jsxs(Cn,{children:[_(g.name),o.jsx(fu,{children:o.jsxs(ce,{as:fr,to:"https://mastra.ai/en/docs/workspace/skills",target:"_blank",children:[o.jsx(Ce,{children:o.jsx(o0,{})}),"Documentation"]})})]}),o.jsx("div",{className:"grid overflow-y-auto overflow-x-hidden h-full",children:o.jsx("div",{className:"max-w-[100rem] px-[3rem] mx-auto py-8 h-full w-full overflow-x-hidden",children:o.jsx(qIn,{skill:g,rawSkillMd:w?.content,onReferenceClick:m})})}),o.jsx(HIn,{open:!!p,onOpenChange:E=>!E&&m(null),skillName:g.name,referencePath:p??"",content:S?.content,isLoading:k})]})}const iOt=()=>{const e=window.MASTRA_CLOUD_API_ENDPOINT;return{isMastraPlatform:!!e,mastraPlatformEndpoint:e}},YIn=[{key:"primitives",title:"Primitives",href:"/primitives",links:[{name:"Agents",url:"/agents",icon:o.jsx(ga,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"agents:read"},{name:"Prompts",url:"/prompts",icon:o.jsx(Yi,{}),isOnMastraPlatform:!0,indent:!0},{name:"Workflows",url:"/workflows",icon:o.jsx(Di,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"workflows:read"},{name:"Processors",url:"/processors",icon:o.jsx(eS,{}),isOnMastraPlatform:!1,indent:!0,requiredPermission:"processors:read"},{name:"MCP Servers",url:"/mcps",icon:o.jsx(gl,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"mcps:read"},{name:"Tools",url:"/tools",icon:o.jsx(Mi,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"tools:read"},{name:"Workspaces",url:"/workspaces",icon:o.jsx(nc,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"workspaces:read"},{name:"Request Context",url:"/request-context",icon:o.jsx(jE,{}),isOnMastraPlatform:!0,indent:!0}]},{key:"evaluation",title:"Evaluation",href:"/evaluation",links:[{name:"Scorers",url:"/scorers",icon:o.jsx(La,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"scorers:read"},{name:"Datasets",url:"/datasets",icon:o.jsx(Na,{}),isOnMastraPlatform:!0,indent:!0,requiredAnyPermission:["datasets:read"]},{name:"Experiments",url:"/experiments",icon:o.jsx(Tu,{}),isOnMastraPlatform:!0,indent:!0,requiredAnyPermission:["datasets:read"]}]},{key:"observability",title:"Observability",href:"/observability-overview",links:[{name:"Metrics",url:"/metrics",icon:o.jsx(nk,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"observability:read"},{name:"Traces",url:"/observability",activePaths:["/traces"],icon:o.jsx(xo,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"observability:read"},{name:"Logs",url:"/logs",icon:o.jsx(YL,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"observability:read"}]},{key:"bottom",separator:!0,links:[{name:"Settings",url:"/settings",icon:o.jsx(hme,{}),isOnMastraPlatform:!1},{name:"Resources",url:"/resources",icon:o.jsx(Li,{}),isOnMastraPlatform:!0}]}];function X8e(e,t){const r=n=>t===n||t.startsWith(n+"/");return r(e.url)?!0:e.activePaths?.some(r)??!1}function XIn(){const{Link:e}=or(),{state:t}=Sme(),n=Oc().pathname,{isMastraPlatform:s}=iOt(),{data:a}=wC(),{isCmsAvailable:i,isLoading:l}=cM(),{hasPermission:c,hasAnyPermission:u,rbacEnabled:d,isAuthenticated:f,isLoading:h}=Sv(),p=a&&HP(a),m=new Set(["/prompts"]),g=y=>m.has(y.url)&&!i&&!l||s&&!y.isOnMastraPlatform?!1:d&&f&&h?!0:!(y.requiredPermission&&!c(y.requiredPermission)||y.requiredAnyPermission&&!u(y.requiredAnyPermission));return o.jsxs(Hh,{children:[o.jsx("div",{className:"pt-3 mb-4 -ml-0.5 sticky top-0 bg-surface1 z-10",children:t==="collapsed"?o.jsxs("div",{className:"flex flex-col gap-3 items-center",children:[o.jsx(Yb,{className:"h-[1.5rem] w-[1.5rem] shrink-0 ml-3"}),p&&o.jsx(Ple,{})]}):p?o.jsxs("span",{className:"flex items-center justify-between pl-3 pr-2",children:[o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx(Yb,{className:"h-[1.5rem] w-[1.5rem] shrink-0"}),o.jsx("span",{className:"font-serif text-sm",children:"Mastra Studio"})]}),o.jsx(Ple,{})]}):o.jsxs("span",{className:"flex items-center gap-2 pl-3",children:[o.jsx(Yb,{className:"h-[1.5rem] w-[1.5rem] shrink-0"}),o.jsx("span",{className:"font-serif text-sm",children:"Mastra Studio"})]})}),o.jsx(Hh.Nav,{children:YIn.map(y=>{const x=y.links.filter(g),w=x.length>0&&y?.separator,S=x.some(_=>X8e(_,n)),k=!!(y.href&&n===y.href&&!S);return o.jsxs(Hh.NavSection,{children:[y?.title?o.jsx(Hh.NavHeader,{LinkComponent:e,state:t,href:y.href,isActive:k,children:y.title}):o.jsx(o.Fragment,{children:w&&o.jsx(Hh.NavSeparator,{})}),o.jsx(Hh.NavList,{children:x.map(_=>{const E=X8e(_,n);return o.jsx(Hh.NavLink,{LinkComponent:e,state:t,link:_,isActive:E},_.name)})})]},y.key)})}),o.jsxs(Hh.Bottom,{children:[t!=="collapsed"&&o.jsxs(o.Fragment,{children:[o.jsx(Hh.NavSeparator,{}),o.jsx($1n,{collapsed:!1})]}),o.jsx(Hh.NavSeparator,{}),o.jsx("div",{className:"flex justify-end pb-3",children:o.jsx(Hh.Trigger,{})})]})]})}function oOt({children:e,loginUrl:t="/login",signupUrl:r="/signup"}){const{data:n,isLoading:s}=wC();if(s)return o.jsx(o.Fragment,{children:e});if(!n?.enabled)return o.jsx(o.Fragment,{children:e});if(HP(n))return o.jsx(o.Fragment,{children:e});const a=typeof window<"u"?window.location.href:void 0;if(!n.login)return o.jsx("div",{className:"flex h-full w-full items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center space-y-6 text-center",children:[o.jsx(Yb,{className:"h-16 w-16 opacity-50"}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h2",{className:"text-xl font-semibold text-neutral6",children:"Authentication Required"}),o.jsx("p",{className:"max-w-sm text-neutral3",children:"This page requires authentication, but no login method is configured. Please contact your administrator."})]})]})});const i=()=>{const l=new URL(r,window.location.origin);a&&l.searchParams.set("redirect",a),window.location.href=l.toString()};return o.jsx("div",{className:"flex h-full w-full items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center space-y-6 text-center",children:[o.jsx(Yb,{className:"h-16 w-16 opacity-50"}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h2",{className:"text-xl font-semibold text-neutral6",children:"Sign in to continue"}),o.jsx("p",{className:"max-w-sm text-neutral3",children:"You need to sign in to access this page."})]}),n.login.description&&o.jsxs("div",{className:"flex items-start gap-2.5 rounded-md border border-border1 bg-surface2 p-3 text-left",children:[o.jsx(wVe,{className:"mt-0.5 h-4 w-4 shrink-0 text-neutral4"}),o.jsx("p",{className:"max-w-sm text-sm text-neutral3",children:n.login.description})]}),o.jsx(D1t,{config:n.login,redirectUri:a,loginUrl:t}),(n.login.type==="credentials"||n.login.type==="both")&&n.login.signUpEnabled!==!1&&o.jsxs("div",{className:"text-sm",children:[o.jsx("span",{className:"text-neutral3",children:"Don't have an account? "}),o.jsx("button",{type:"button",onClick:i,className:"text-neutral6 hover:underline",children:"Sign up"})]})]})})}const lOt="experimental-ui:",cOt="current",KIn=je.createContext(null);function JIn(e,t){const r=window.localStorage.getItem(lOt+e);return r&&t.has(r)?r:cOt}function eRn({experiments:e,children:t}){const r=je.useMemo(()=>new Map(e.map(c=>[c.key,new Set(c.variants.map(u=>u.value))])),[e]),[n,s]=je.useState({});je.useLayoutEffect(()=>{const c={};for(const u of e){const d=r.get(u.key);c[u.key]=JIn(u.key,d)}s(c)},[e,r]);const a=je.useCallback(c=>n[c]??cOt,[n]),i=je.useCallback((c,u)=>{window.localStorage.setItem(lOt+c,u),s(d=>({...d,[c]:u}))},[]),l=je.useMemo(()=>({experiments:e,getVariant:a,setVariant:i}),[e,a,i]);return o.jsx(KIn.Provider,{value:l,children:t})}const tRn=[{key:"entity-list-page",name:"Entity List page UI",path:["/agents","/prompts","/tools","/datasets","/scorers","/mcps","/workflows","/processors"],variants:[{value:"current",label:"Current state"},{value:"new-proposal",label:"New proposal"}]}],rRn=()=>({experimentalUIEnabled:typeof window<"u"&&window.MASTRA_EXPERIMENTAL_UI==="true"}),nRn=()=>{const[e,t]=b.useState(!1),r=b.useCallback(()=>{t(n=>!n)},[]);return b.useEffect(()=>{const n=s=>{s.key==="k"&&(s.metaKey||s.ctrlKey)&&(s.preventDefault(),r())};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[r]),{open:e,setOpen:t,toggle:r}},Dve=()=>{const{requestContext:e}=ks(),t=Ge();return kt({queryKey:["processors"],queryFn:()=>t.listProcessors(e)})},uOt=(e,t)=>{const r=Ge(),{requestContext:n}=ks();return kt({queryKey:["processor",e],queryFn:()=>r.getProcessor(e).details(n),enabled:!!e})},sRn=()=>{const e=Ge(),{requestContext:t}=ks();return Kr({mutationFn:async({processorId:r,phase:n,messages:s,agentId:a})=>e.getProcessor(r).execute({phase:n,messages:s,agentId:a,requestContext:t})})},aRn=()=>{const{open:e,setOpen:t}=nRn(),{navigate:r,paths:n}=or(),{isMastraPlatform:s}=iOt(),a=O3r(),{data:i={}}=Eg(),{data:l={}}=c0(),{data:c={}}=JB(),{data:u={}}=Dve(),{data:d=[]}=uM(),{data:f={}}=cd(),h=w=>{r(w),t(!1)},p=Object.entries(i),m=Object.entries(l),g=Object.entries(c),y=Object.values(u).filter(w=>w.phases&&w.phases.length>0),x=Object.entries(f);return o.jsxs(t$r,{open:e,onOpenChange:t,title:"Navigation",description:"Search and navigate to any entity",children:[o.jsx(zdt,{placeholder:"Search or navigate..."}),o.jsxs(Bdt,{children:[o.jsx(Udt,{children:"No results found."}),o.jsxs(fb,{heading:"Navigation",children:[a&&o.jsxs(Zo,{value:"toggle sidebar collapse expand",onSelect:()=>{a.toggleSidebar(),t(!1)},children:[o.jsx(EVe,{className:"text-neutral3"}),o.jsx("span",{children:"Toggle Sidebar"}),o.jsx(Vdt,{children:"Ctrl+B"})]}),o.jsxs(Zo,{value:"all agents",onSelect:()=>h("/agents"),children:[o.jsx(ga,{className:"text-neutral3"}),o.jsx("span",{children:"All Agents"})]}),o.jsxs(Zo,{value:"all workflows",onSelect:()=>h("/workflows"),children:[o.jsx(Di,{className:"text-neutral3"}),o.jsx("span",{children:"All Workflows"})]}),o.jsxs(Zo,{value:"all tools",onSelect:()=>h("/tools"),children:[o.jsx(Mi,{className:"text-neutral3"}),o.jsx("span",{children:"All Tools"})]}),o.jsxs(Zo,{value:"all scorers",onSelect:()=>h("/scorers"),children:[o.jsx(La,{className:"text-neutral3"}),o.jsx("span",{children:"All Scorers"})]}),o.jsxs(Zo,{value:"all processors",onSelect:()=>h("/processors"),children:[o.jsx(eS,{className:"text-neutral3"}),o.jsx("span",{children:"All Processors"})]}),o.jsxs(Zo,{value:"all mcp servers",onSelect:()=>h("/mcps"),children:[o.jsx(gl,{className:"text-neutral3"}),o.jsx("span",{children:"All MCP Servers"})]}),o.jsxs(Zo,{value:"observability traces",onSelect:()=>h("/observability"),children:[o.jsx(xo,{className:"text-neutral3"}),o.jsx("span",{children:"Observability"})]}),!s&&o.jsxs(o.Fragment,{children:[o.jsxs(Zo,{value:"settings",onSelect:()=>h("/settings"),children:[o.jsx(hme,{className:"text-neutral3"}),o.jsx("span",{children:"Settings"})]}),o.jsxs(Zo,{value:"templates",onSelect:()=>h("/templates"),children:[o.jsx(Fb,{className:"text-neutral3"}),o.jsx("span",{children:"Templates"})]})]})]}),p.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(iw,{}),o.jsx(fb,{heading:"Agents",children:p.map(([w,S])=>o.jsxs(je.Fragment,{children:[o.jsxs(Zo,{value:`${S.name} chat agent`,onSelect:()=>h(n.agentLink(w)),children:[o.jsx(ga,{className:"text-neutral3"}),o.jsxs("span",{children:[S.name,": Chat"]})]}),o.jsxs(Zo,{value:`${S.name} traces agent observability`,onSelect:()=>h(`/observability?entity=${w}`),children:[o.jsx(xo,{className:"text-neutral3"}),o.jsxs("span",{children:[S.name,": Traces"]})]})]},w))})]}),m.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(iw,{}),o.jsx(fb,{heading:"Workflows",children:m.map(([w,S])=>o.jsxs(je.Fragment,{children:[o.jsxs(Zo,{value:`${S.name} graph workflow view`,onSelect:()=>h(n.workflowLink(w)),children:[o.jsx(Di,{className:"text-neutral3"}),o.jsxs("span",{children:[S.name,": Graph"]})]}),o.jsxs(Zo,{value:`${S.name} traces workflow observability`,onSelect:()=>h(`/observability?entity=${S.name}`),children:[o.jsx(xo,{className:"text-neutral3"}),o.jsxs("span",{children:[S.name,": Traces"]})]})]},w))})]}),g.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(iw,{}),o.jsx(fb,{heading:"Tools",children:g.map(([w,S])=>o.jsxs(Zo,{value:`tool ${S.id}`,onSelect:()=>h(n.toolLink(w)),children:[o.jsx(Mi,{className:"text-neutral3"}),o.jsx("span",{children:S.id})]},w))})]}),x.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(iw,{}),o.jsx(fb,{heading:"Scorers",children:x.map(([w,S])=>{const k=S.scorer?.config?.name||S.scorer?.config?.id||w;return o.jsxs(Zo,{value:`scorer ${k}`,onSelect:()=>h(n.scorerLink(w)),children:[o.jsx(La,{className:"text-neutral3"}),o.jsx("span",{children:k})]},w)})})]}),y.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(iw,{}),o.jsx(fb,{heading:"Processors",children:y.map(w=>{const S=w.name||w.id,k=w.isWorkflow?n.workflowLink(w.id)+"/graph":n.processorLink(w.id);return o.jsxs(Zo,{value:`processor ${S}`,onSelect:()=>h(k),children:[o.jsx(eS,{className:"text-neutral3"}),o.jsx("span",{children:S})]},w.id)})})]}),d.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(iw,{}),o.jsx(fb,{heading:"MCP Servers",children:d.map(w=>o.jsxs(Zo,{value:`mcp server ${w.name}`,onSelect:()=>h(n.mcpServerLink(w.id)),children:[o.jsx(gl,{className:"text-neutral3"}),o.jsx("span",{children:w.name})]},w.id))})]})]})]})};function iRn({children:e}){const{data:t,isFetched:r}=wC(),{pathname:n}=Oc(),s=r&&t?.enabled&&!HP(t),a=r&&!s;return o.jsxs(o.Fragment,{children:[o.jsx(aRn,{}),o.jsxs("div",{className:a?"grid h-full grid-cols-[auto_1fr]":"h-full",children:[a&&o.jsx(XIn,{}),o.jsx("div",{className:Y("bg-transparent overflow-y-auto",{"h-[calc(100%-1.5rem)]":s}),children:o.jsx(oOt,{children:o.jsx(w5r,{resetKeys:[n],children:e})})})]})]})}const oRn=({children:e})=>{const{experimentalUIEnabled:t}=rRn();return o.jsxs("div",{className:"bg-surface1 font-sans h-screen",children:[o.jsx(fYe,{position:"bottom-right"}),o.jsx(_dt,{defaultTheme:"dark",children:o.jsx(ad,{delayDuration:0,children:o.jsx(eRn,{experiments:t?tRn:[],children:o.jsx(_3r,{children:o.jsx(iRn,{children:e})})})})})]})},lRn=({children:e})=>o.jsxs("div",{className:"bg-surface1 font-sans h-screen",children:[o.jsx(fYe,{position:"bottom-right"}),o.jsx(_dt,{defaultTheme:"dark",children:o.jsx(ad,{delayDuration:0,children:o.jsx("div",{className:"h-full overflow-y-auto",children:o.jsx(oOt,{children:e})})})})]});function cRn({agentId:e}){return o.jsxs(Cn,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/agents",children:[o.jsx(Ce,{children:o.jsx(ga,{})}),"Agents"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(TOn,{value:e,variant:"ghost"})})]}),o.jsx(fu,{children:o.jsxs(ce,{as:fr,to:"https://mastra.ai/en/docs/agents/overview",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(o0,{}),"Agents documentation"]})})]})}const uRn=({children:e})=>{const{agentId:t}=na(),r=Oc(),{isCmsAvailable:n}=cM(),{hasObservability:s}=U1n(),a=Dle.has("datasets"),i=n&&a,l=s&&a,{data:c}=Nf(t),u=Jc(c?.provider??""),d=c?.modelId??"",f=c?.requestContextSchema,h=r.pathname.includes("/editor")?"versions":r.pathname.includes("/evaluate")?"evaluate":r.pathname.includes("/review")?"review":r.pathname.includes("/traces")?"traces":"chat",p=(h==="versions"||h==="evaluate"||h==="review")&&(i||l),m=o.jsxs(zr,{className:"grid-rows-[auto_auto_1fr]",children:[o.jsx(cRn,{agentId:t}),o.jsx(ICn,{agentId:t,activeTab:h,showPlayground:i,showObservability:l,rightSlot:p?o.jsx(RCn,{requestContextSchema:f}):void 0}),e]});return o.jsx(FP,{children:o.jsx(zSn,{defaultProvider:u,defaultModel:d,children:o.jsx(bCn,{children:o.jsx(BSn,{children:m})})})})},dRn=({children:e,options:t})=>{const r=new I2r({...t,defaultOptions:{...t?.defaultOptions,queries:{retry:O6r,...t?.defaultOptions?.queries}}});return o.jsx(R2r,{client:r,children:e})},fRn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(yf,{}),titleSlot:"No Processors yet",descriptionSlot:"Configure processors. Add input or output processors to your agents to transform messages.",actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",children:["Processors Documentation ",o.jsx(ba,{})]})})}),hRn=["input","inputStep","outputStep","outputStream","outputResult"];function pRn({processors:e,isLoading:t,search:r=""}){const{paths:n,Link:s}=or(),a=b.useMemo(()=>Object.values(e??{}).filter(l=>l.phases&&l.phases.length>0),[e]),i=b.useMemo(()=>{const l=r.toLowerCase();return a.filter(c=>c.id.toLowerCase().includes(l)||(c.name||"").toLowerCase().includes(l))},[a,r]);return t?o.jsx(yh,{columns:"auto 1fr auto auto auto auto auto auto"}):o.jsxs(Se,{columns:"auto 1fr auto auto auto auto auto auto",children:[o.jsxs(Se.Top,{children:[o.jsx(Se.TopCell,{children:"Name"}),o.jsx(Se.TopCell,{children:"Description"}),o.jsx(Se.TopCellSmart,{long:"Input",short:"Input",tooltip:"Contains Input phase",className:"text-center"}),o.jsx(Se.TopCellSmart,{long:"Input Step",short:o.jsxs(o.Fragment,{children:[o.jsx(cx,{})," Step"]}),tooltip:"Contains Input Step phase",className:"text-center"}),o.jsx(Se.TopCellSmart,{long:"Output Step",short:o.jsxs(o.Fragment,{children:[o.jsx(Qd,{})," Step"]}),tooltip:"Contains Output Step phase",className:"text-center"}),o.jsx(Se.TopCellSmart,{long:"Output Stream",short:o.jsxs(o.Fragment,{children:[o.jsx(Qd,{})," Stream"]}),tooltip:"Contains Output Stream phase",className:"text-center"}),o.jsx(Se.TopCellSmart,{long:"Output Result",short:o.jsxs(o.Fragment,{children:[o.jsx(Qd,{})," Result"]}),tooltip:"Contains Output Result phase",className:"text-center"}),o.jsx(Se.TopCellSmart,{short:"Used by",long:"Used by Agents",className:"text-center"})]}),i.length===0&&r?o.jsx(Se.NoMatch,{message:"No Processors match your search"}):null,i.map(l=>{const c=Ch(l.name||l.id,50),u=Ch(l.description??"",200),d=l.agentIds?.length??0,f=new Set(l.phases||[]),h=l.isWorkflow?n.workflowLink(l.id)+"/graph":n.processorLink(l.id);return o.jsxs(Se.RowLink,{to:h,LinkComponent:s,children:[o.jsx(Se.NameCell,{children:c}),o.jsx(Se.DescriptionCell,{children:u}),hRn.map(p=>o.jsx(Se.TextCell,{className:"text-center",children:f.has(p)&&o.jsx(ra,{className:"size-4 mx-auto"})},p)),o.jsx(Se.TextCell,{className:"text-center",children:d||""})]},l.id)})]})}function mRn(){const{data:e={},isLoading:t,error:r}=Dve(),[n,s]=b.useState("");return r&&Ps(r)?o.jsx(Jr,{title:"Processors",icon:o.jsx(lp,{}),children:o.jsx(sa,{})}):r&&Os(r)?o.jsx(Jr,{title:"Processors",icon:o.jsx(lp,{}),children:o.jsx(Zs,{resource:"processors"})}):r?o.jsx(Jr,{title:"Processors",icon:o.jsx(lp,{}),children:o.jsx(pu,{title:"Failed to load processors",message:r.message})}):Object.keys(e).length===0&&!t?o.jsx(Jr,{title:"Processors",icon:o.jsx(lp,{}),children:o.jsx(fRn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:t,children:[o.jsx(lp,{})," Processors"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Processors documentation",children:o.jsx(Li,{})})})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Sg,{onSearch:s,label:"Filter processors",placeholder:"Filter by name"})})]}),o.jsx(pRn,{processors:e,isLoading:t,search:n})]})}function gRn({value:e,onValueChange:t,placeholder:r="Select a processor...",searchPlaceholder:n="Search processors...",emptyText:s="No processors found.",className:a,disabled:i=!1,variant:l="default"}){const{data:c={},isLoading:u,isError:d,error:f}=Dve(),{navigate:h,paths:p}=or();b.useEffect(()=>{if(d){const y=f instanceof Error?f.message:"Failed to load processors";ze.error(`Error loading processors: ${y}`)}},[d,f]);const m=Object.keys(c).filter(y=>{const x=c[y];return x?.phases&&x.phases.length>0}).map(y=>({label:c[y]?.name||y,value:y})),g=y=>{t?t(y):y&&y!==e&&(c[y]?.isWorkflow?h(p.workflowLink(y)+"/graph"):h(p.processorLink(y)))};return o.jsx(Gl,{options:m,value:e,onValueChange:g,placeholder:u?"Loading processors...":r,searchPlaceholder:n,emptyText:s,className:a,disabled:i||u||d,variant:l})}const yRn={input:"Input - Process input messages before LLM (once at start)",inputStep:"Input Step - Process at each agentic loop step",outputStream:"Output Stream - Process streaming chunks",outputResult:"Output Result - Process complete output after streaming",outputStep:"Output Step - Process after each LLM response (before tools)"};function vRn({processorId:e}){const{data:t,isLoading:r,error:n}=uOt(e);return b.useEffect(()=>{if(n){const s=n instanceof Error?n.message:"Failed to load processor";ze.error(`Error loading processor: ${s}`)}},[n]),r?o.jsxs("div",{className:"p-6",children:[o.jsx(Dn,{className:"h-8 w-48 mb-4"}),o.jsx(Dn,{className:"h-32 w-full"})]}):n?null:t?o.jsx(bRn,{processor:t}):o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(me,{variant:"header-md",className:"text-neutral3",children:"Processor not found"})})}function bRn({processor:e}){const t=wv(),r=b.useId(),[n,s]=b.useState(e.phases[0]||"input"),[a,i]=b.useState(e.configurations[0]?.agentId||""),[l,c]=b.useState("Hello, this is a test message."),[u,d]=b.useState(null),[f,h]=b.useState(),p=sRn(),m=async()=>{h(void 0),d(null);const x=n==="outputStep"||n==="outputResult"?"assistant":"user",w=[{id:crypto.randomUUID(),role:x,createdAt:new Date,content:{format:2,parts:[{type:"text",text:l}]}}];try{const S=await p.mutateAsync({processorId:e.id,phase:n,messages:w,agentId:a||void 0});d(S),!S.success&&S.error&&h(S.error)}catch(S){h(S.message||"An error occurred")}},g=u?JSON.stringify(u,null,2):"{}";return o.jsxs(df,{hasLeftServiceColumn:!0,className:"relative",children:[o.jsxs("div",{className:"bg-surface2 border-r border-border1 w-[22rem] overflow-y-auto",children:[o.jsx(xRn,{processor:e}),o.jsxs("div",{className:"p-5 space-y-5",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(me,{as:"label",variant:"ui-sm",className:"text-neutral3",children:"Phase"}),o.jsxs(hi,{value:n,onValueChange:y=>s(y),children:[o.jsx(ei,{className:"w-full",children:o.jsx(pi,{placeholder:"Select phase"})}),o.jsx(ti,{children:e.phases.map(y=>o.jsx(ss,{value:y,children:y},y))})]}),o.jsx(me,{variant:"ui-xs",className:"text-neutral4",children:yRn[n]})]}),e.configurations.length>1&&o.jsxs("div",{className:"space-y-2",children:[o.jsx(me,{as:"label",variant:"ui-sm",className:"text-neutral3",children:"Agent Configuration"}),o.jsxs(hi,{value:a,onValueChange:i,children:[o.jsx(ei,{className:"w-full",children:o.jsx(pi,{placeholder:"Select agent"})}),o.jsx(ti,{children:e.configurations.map(y=>o.jsxs(ss,{value:y.agentId,children:[y.agentName," (",y.type,")"]},y.agentId))})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(me,{as:"label",htmlFor:r,variant:"ui-sm",className:"text-neutral3",children:"Test Message"}),o.jsx("textarea",{id:r,value:l,onChange:y=>c(y.target.value),placeholder:"Enter a test message...",rows:4,className:"w-full bg-transparent border border-border1 rounded-md p-3 text-ui-sm text-neutral6 placeholder:text-neutral3 focus:outline-hidden focus:ring-2 focus:ring-accent1"})]}),o.jsx(ce,{onClick:m,disabled:p.isPending||n==="outputStream",className:"w-full",children:p.isPending?"Running...":"Run Processor"}),n==="outputStream"&&o.jsx(me,{variant:"ui-xs",className:"text-accent6",children:"Output Stream phase cannot be executed directly. Use streaming instead."}),u&&o.jsxs("div",{className:"space-y-2 pt-4 border-t border-border1",children:[o.jsx(me,{variant:"ui-sm",className:"text-neutral3",children:"Status"}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(vt,{variant:u.success?"success":"error",children:u.success?"Success":"Failed"}),u.tripwire?.triggered&&o.jsx(vt,{variant:"info",children:"Tripwire Triggered"})]}),u.tripwire?.triggered&&u.tripwire.reason&&o.jsxs("div",{className:"mt-2 p-3 bg-accent6Dark rounded-md border border-accent6/20",children:[o.jsx(me,{variant:"ui-sm",className:"text-accent6 font-medium",children:"Tripwire Reason"}),o.jsx(me,{variant:"ui-sm",className:"text-neutral3 mt-1",children:u.tripwire.reason})]})]})]})]}),o.jsx("div",{className:"absolute top-4 right-4 z-10",children:o.jsx(ta,{content:g,tooltip:"Copy JSON result to clipboard"})}),o.jsx("div",{className:"p-5 h-full relative overflow-x-auto overflow-y-auto",children:o.jsx(vc,{value:f||g,editable:!0,theme:t,extensions:[Gd]})})]})}function xRn({processor:e}){return o.jsxs("div",{className:"px-5 pt-5 pb-4 border-b border-border1",children:[o.jsx(me,{variant:"header-md",className:"text-neutral1 mb-2",children:e.name||e.id}),e.name&&e.name!==e.id&&o.jsx(me,{variant:"ui-sm",className:"text-neutral4 mb-3",children:e.id}),o.jsx("div",{className:"flex flex-wrap gap-1 mt-3",children:e.phases.map(t=>o.jsx(vt,{variant:"default",children:t},t))}),o.jsx("div",{className:"mt-3",children:o.jsxs(me,{variant:"ui-xs",className:"text-neutral4",children:["Attached to ",e.configurations.length," agent",e.configurations.length!==1?"s":""]})})]})}function wRn(){const{processorId:e}=na(),{data:t,isLoading:r,error:n}=uOt(e);return n&&Ps(n)?o.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[o.jsx(Cn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/processors",children:[o.jsx(Ce,{children:o.jsx(lp,{})}),"Processors"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:e})]})}),o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(sa,{})})]}):n&&Os(n)?o.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[o.jsx(Cn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/processors",children:[o.jsx(Ce,{children:o.jsx(lp,{})}),"Processors"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:e})]})}),o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"processors"})})]}):!r&&t?.isWorkflow?o.jsx(fFt,{to:`/workflows/${e}/graph`,replace:!0}):r?o.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[o.jsx(Cn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/processors",children:[o.jsx(Ce,{children:o.jsx(lp,{})}),"Processors"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(Dn,{className:"h-6 w-32"})})]})}),o.jsxs("div",{className:"p-6",children:[o.jsx(Dn,{className:"h-8 w-48 mb-4"}),o.jsx(Dn,{className:"h-32 w-full"})]})]}):o.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[o.jsxs(Cn,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/processors",children:[o.jsx(Ce,{children:o.jsx(lp,{})}),"Processors"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(gRn,{value:e,variant:"ghost"})})]}),o.jsx(fu,{children:o.jsxs(ce,{as:fr,to:"https://mastra.ai/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",variant:"ghost",size:"md",children:[o.jsx(o0,{}),"Processors documentation"]})})]}),o.jsx(vRn,{processorId:e})]})}function SRn(){const{data:e={},isLoading:t,error:r}=Eg(),{data:n={},isLoading:s,error:a}=JB(),[i,l]=b.useState(""),c=t||s,u=a||r;return u&&Ps(u)?o.jsx(Jr,{title:"Tools",icon:o.jsx(Mi,{}),children:o.jsx(sa,{})}):u&&Os(u)?o.jsx(Jr,{title:"Tools",icon:o.jsx(Mi,{}),children:o.jsx(Zs,{resource:"tools"})}):u?o.jsx(Jr,{title:"Tools",icon:o.jsx(Mi,{}),children:o.jsx(pu,{title:"Failed to load tools",message:u.message})}):Object.keys(n).length===0&&!c?o.jsx(Jr,{title:"Tools",icon:o.jsx(Mi,{}),children:o.jsx(wAn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:c,children:[o.jsx(Mi,{})," Tools"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Tools documentation",children:o.jsx(Li,{})})})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Sg,{onSearch:l,label:"Filter tools",placeholder:"Filter by name"})})]}),o.jsx(xAn,{tools:n,agents:e,isLoading:c,search:i})]})}const dOt={agentLink:e=>`/agents/${e}/chat/new`,agentToolLink:(e,t)=>`/agents/${e}/tools/${t}`,agentSkillLink:(e,t,r,n)=>n?`/workspaces/${n}/skills/${encodeURIComponent(t)}?agentId=${encodeURIComponent(e)}${r?`&path=${encodeURIComponent(r)}`:""}`:"/workspaces",agentsLink:()=>"/agents",agentNewThreadLink:e=>`/agents/${e}/chat/new`,agentThreadLink:(e,t,r)=>r?`/agents/${e}/chat/${t}?messageId=${r}`:`/agents/${e}/chat/${t}`,workflowsLink:()=>"/workflows",workflowLink:e=>`/workflows/${e}`,networkLink:e=>`/networks/v-next/${e}/chat`,networkNewThreadLink:e=>`/networks/v-next/${e}/chat/${Ki()}`,networkThreadLink:(e,t)=>`/networks/v-next/${e}/chat/${t}`,scorerLink:e=>`/scorers/${e}`,cmsScorersCreateLink:()=>"/cms/scorers/create",cmsScorerEditLink:e=>`/cms/scorers/${e}/edit`,cmsAgentCreateLink:()=>"/cms/agents/create",cmsAgentEditLink:e=>`/cms/agents/${e}/edit`,promptBlockLink:e=>`/prompts/${e}`,promptBlocksLink:()=>"/prompts",cmsPromptBlockCreateLink:()=>"/cms/prompts/create",cmsPromptBlockEditLink:e=>`/cms/prompts/${e}/edit`,toolLink:e=>`/tools/${e}`,skillLink:(e,t,r)=>r?`/workspaces/${r}/skills/${encodeURIComponent(e)}${t?`?path=${encodeURIComponent(t)}`:""}`:"/workspaces",workspaceLink:e=>e?`/workspaces/${e}`:"/workspaces",workspaceSkillLink:(e,t,r)=>r?`/workspaces/${r}/skills/${encodeURIComponent(e)}${t?`?path=${encodeURIComponent(t)}`:""}`:"/workspaces",workspacesLink:()=>"/workspaces",processorsLink:()=>"/processors",processorLink:e=>`/processors/${e}`,mcpServerLink:e=>`/mcps/${e}`,mcpServerToolLink:(e,t)=>`/mcps/${e}/tools/${t}`,workflowRunLink:(e,t)=>`/workflows/${e}/graph/${t}`,datasetLink:e=>`/datasets/${e}`,datasetItemLink:(e,t)=>`/datasets/${e}/items/${t}`,datasetExperimentLink:(e,t)=>`/datasets/${e}/experiments/${t}`,experimentLink:e=>`/experiments/${e}`},ORn=()=>{const e=uu(),t=r=>e(r,{viewTransition:!0});return o.jsx(Dht,{Link:EB,navigate:t,paths:dOt,children:o.jsx(oRn,{children:o.jsx(v_,{})})})},kRn=()=>{const e=uu(),t=r=>e(r,{viewTransition:!0});return o.jsx(Dht,{Link:EB,navigate:t,paths:dOt,children:o.jsx(lRn,{children:o.jsx(v_,{})})})},_Rn=!!window.MASTRA_CLOUD_API_ENDPOINT,K8e=Dle.has("datasets"),J8e=[{index:!0,element:o.jsx(Tjn,{})},{path:"instruction-blocks",element:o.jsx(Njn,{})},{path:"tools",element:o.jsx(Pjn,{})},{path:"agents",element:o.jsx(Ejn,{})},{path:"scorers",element:o.jsx(Ijn,{})},{path:"workflows",element:o.jsx(Djn,{})},{path:"skills",element:o.jsx(Rjn,{})},{path:"memory",element:o.jsx(Ajn,{})},{path:"variables",element:o.jsx(Mjn,{})}],ERn=[{path:"/login",element:o.jsx(hAn,{})},{path:"/signup",element:o.jsx(tIn,{})},{element:o.jsx(kRn,{}),children:[{path:"/agents/:agentId/session",element:o.jsx(w8e,{})},{path:"/agents/:agentId/session/:threadId",element:o.jsx(w8e,{})}]},{element:o.jsx(ORn,{}),children:[..._Rn?[]:[{path:"/settings",element:o.jsx(eIn,{})},{path:"/templates",element:o.jsx(aIn,{})},{path:"/templates/:templateSlug",element:o.jsx(fIn,{})}],{path:"/logs",element:o.jsx(pAn,{})},{path:"/primitives",element:o.jsx(QAn,{})},{path:"/evaluation",element:o.jsx(uAn,{})},{path:"/scorers",element:o.jsx(XAn,{})},{path:"/scorers/:scorerId",element:o.jsx(KAn,{})},{path:"/metrics",element:o.jsx(BAn,{})},{path:"/observability-overview",element:o.jsx(qAn,{})},{path:"/observability",element:o.jsx(bIn,{})},{path:"/traces/:traceId",element:o.jsx(xIn,{})},{path:"/resources",element:o.jsx(YAn,{})},{path:"/agents",element:o.jsx(jKr,{})},{path:"/cms/agents/create",element:o.jsx(Cjn,{}),children:J8e},{path:"/cms/agents/:agentId/edit",element:o.jsx(jjn,{}),children:J8e},{path:"/cms/scorers/create",element:o.jsx(zjn,{})},{path:"/cms/scorers/:scorerId/edit",element:o.jsx(Ujn,{})},{path:"/prompts",element:o.jsx(WAn,{})},{path:"/cms/prompts/create",element:o.jsx(Ljn,{})},{path:"/cms/prompts/:promptBlockId/edit",element:o.jsx(Fjn,{})},{path:"/agents/:agentId/tools/:toolId",element:o.jsx(hIn,{})},{path:"/agents/:agentId",element:o.jsx(uRn,{children:o.jsx(v_,{})}),children:[{index:!0,loader:({params:e})=>TU(`/agents/${e.agentId}/chat`)},{path:"chat",element:o.jsx(b8e,{})},{path:"chat/:threadId",element:o.jsx(b8e,{})},...K8e?[{path:"editor",element:o.jsx(Ojn,{})},{path:"evaluate",element:o.jsx(Sjn,{})},{path:"review",element:o.jsx(kjn,{})}]:[],{path:"traces",element:o.jsx(_jn,{})}]},{path:"/tools",element:o.jsx(SRn,{})},{path:"/tools/:toolId",element:o.jsx(pIn,{})},{path:"/processors",element:o.jsx(mRn,{})},{path:"/processors/:processorId",element:o.jsx(wRn,{})},{path:"/mcps",element:o.jsx(vAn,{})},{path:"/mcps/:serverId",element:o.jsx(jAn,{})},{path:"/mcps/:serverId/tools/:toolId",element:o.jsx(AAn,{})},{path:"/workspaces",element:o.jsx(Y8e,{})},{path:"/workspaces/:workspaceId",element:o.jsx(Y8e,{})},{path:"/workspaces/:workspaceId/skills/:skillName",element:o.jsx(ZIn,{})},{path:"/workflows",element:o.jsx(wIn,{})},{path:"/workflows/:workflowId",element:o.jsx(uYr,{children:o.jsx(v_,{})}),children:[{index:!0,loader:({params:e})=>TU(`/workflows/${e.workflowId}/graph`)},{path:"graph",element:o.jsx(W8e,{})},{path:"graph/:runId",element:o.jsx(W8e,{})}]},...K8e?[{path:"/datasets",element:o.jsx(UNn,{})},{path:"/datasets/:datasetId",element:o.jsx(qNn,{})},{path:"/datasets/:datasetId/items/:itemId",element:o.jsx(WNn,{})},{path:"/datasets/:datasetId/items/:itemId/versions",element:o.jsx(YNn,{})},{path:"/datasets/:datasetId/experiments/:experimentId",element:o.jsx(HNn,{})},{path:"/experiments",element:o.jsx(dAn,{})},{path:"/experiments/:experimentId",element:o.jsx(fAn,{})},{path:"/datasets/:datasetId/experiments",element:o.jsx(QNn,{})},{path:"/datasets/:datasetId/items",element:o.jsx(GNn,{})},{path:"/datasets/:datasetId/versions",element:o.jsx(KNn,{})}]:[],{index:!0,loader:()=>TU("/agents")},{path:"/request-context",element:o.jsx(GAn,{})}]}];function CRn(){const e=window.MASTRA_STUDIO_BASE_PATH||"",{baseUrl:t,headers:r,apiPrefix:n,isLoading:s}=cve(),a=b.useMemo(()=>t?pjn(t,n):void 0,[t,n]);if(s)return null;if(!t)return o.jsx(B1n,{});const i=$Ft(ERn,{basename:e});return o.jsx(c5t,{baseUrl:t,headers:r,apiPrefix:n,customFetch:a,children:o.jsx(xKr,{children:o.jsx(cFt,{router:i})})})}function jRn(){const e=window.MASTRA_SERVER_PROTOCOL||"http",t=window.MASTRA_SERVER_HOST||"localhost",r=window.MASTRA_SERVER_PORT||4111,n=window.MASTRA_API_PREFIX||"/api",s=window.MASTRA_CLOUD_API_ENDPOINT||"",a=window.MASTRA_AUTO_DETECT_URL==="true",i=s||(a?window.location.origin:`${e}://${t}:${r}`);return o.jsx(dRn,{children:o.jsx(i1n,{endpoint:i,defaultApiPrefix:n,children:o.jsx(CRn,{})})})}S_t.createRoot(document.getElementById("root")).render(o.jsx(b.StrictMode,{children:o.jsx(jRn,{})}));const CMn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));export{BHe as A,DGe as B,VHe as C,MWe as D,bf as E,ph as F,CMn as G,Js as I,iS as L,zHe as N,m4t as a,A4t as b,EMn as c,QSe as d,lS as e,C4t as f,Fk as g,N4t as h,a1 as i,i1 as j,s1 as k,DVt as l,UWe as m,rS as n,Ra as o,XUt as p,YUt as q,vue as r,_ce as s,ne as t,T3 as u,ku as v,x4t as w,ft as x,nt as y,aZe as z};
|